Skip to content

Json theme - #1114

Merged
TheOneRing merged 2 commits into
mainfrom
work/theme
Oct 8, 2026
Merged

TheOneRing merged 2 commits into
mainfrom
work/theme

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

No description provided.

@dragotin dragotin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite cool.

{ QStringLiteral("COPY_PRIVATE_LINK_MENU_TITLE"), tr("Copy private link to clipboard") },
{ QStringLiteral("EMAIL_PRIVATE_LINK_MENU_TITLE"), tr("Send private link by email...") },
} };
static std::array<std::pair<QString, QString>, 5> strings{{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: This is one to large... It's only four entries.

@TheOneRing
TheOneRing force-pushed the work/theme branch 9 times, most recently from 4d0458b to 39b8d3c Compare October 5, 2026 14:09
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
Comment thread src/resources/jsontheme.cpp Fixed
@TheOneRing
TheOneRing force-pushed the work/theme branch 3 times, most recently from 4025533 to 6babd2d Compare October 8, 2026 08:58
@TheOneRing
TheOneRing requested review from dragotin and a balanced review from Copilot October 8, 2026 08:58

# resources for the theme patcher
# TODO: guard by an option?
if (WIN32)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we guard the theming resources with an option? @dragotin

@TheOneRing
TheOneRing marked this pull request as ready for review October 8, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It currently contains compile failures, configuration migration regressions, unsafe signing behavior, and broken package-patching paths.

15 open findings
What changed in this PR

Replaces compile-time OEM branding with runtime JSON themes and post-install package patching.

Changes:

  • Adds JsonTheme for application identity, colors, icons, URLs, and QML integration.
  • Migrates branding consumers away from legacy Theme and CMake definitions.
  • Adds cross-platform theme patching and updates packaging, macOS, Craft, and CI configuration.
File Description
THEME.cmake Removes legacy theme configuration.
src/​resources/​resources.h Removes obsolete theme helpers.
src/​resources/​resources.cpp Loads icons through JsonTheme.
src/​resources/​jsontheme.h Defines the JSON theme API and QML types.
src/​resources/​jsontheme.cpp Implements JSON parsing and system-theme loading.
src/​resources/​fonticon.cpp Sources icon tint from JSON themes.
src/​resources/​CMakeLists.txt Builds JSON theme support and installs patcher assets.
src/​plugins/​vfs/​openvfs/​vfs_openvfs.cpp Migrates VFS ownership branding.
src/​plugins/​vfs/​cfapi/​shellext/​thumbnailprovider.h Removes obsolete generated configuration include.
src/​plugins/​vfs/​cfapi/​shellext/​customstateprovider.h Removes obsolete generated configuration include.
src/​libsync/​theme.h Removes branding responsibilities from Theme.
src/​libsync/​theme.cpp Removes legacy branding implementations.
src/​libsync/​platform_win.cpp Uses JSON theme identity on Windows.
src/​libsync/​opencloudtheme.h Deletes the legacy OpenCloud theme subclass.
src/​libsync/​opencloudtheme.cpp Deletes legacy theme implementation.
src/​libsync/​globalconfig.cpp Uses JSON theme identifiers and server URL.
src/​libsync/​creds/​oauth.cpp Applies themed identity and colors to OAuth.
src/​libsync/​creds/​credentialmanager.cpp Uses themed keychain identifiers.
src/​libsync/​configfile.cpp Derives the configuration filename from the theme.
src/​libsync/​config.h.in Removes generated branding definitions.
src/​libsync/​common/​utility.cpp Uses themed organization-domain markings.
src/​libsync/​CMakeLists.txt Removes legacy theme sources and configuration.
src/​gui/​updater/​updatedownloadedwidget.cpp Uses the themed application icon.
src/​gui/​updater/​ocupdater.cpp Uses the themed display name.
src/​gui/​updater/​newversionavailablewidget.cpp Uses the themed application icon.
src/​gui/​systray.cpp Themes tray labels, menus, and icons.
src/​gui/​socketapi/​socketapi.cpp Themes shell-integration strings and icon.
src/​gui/​settingsdialog.cpp Themes settings titles and prompts.
src/​gui/​selectivesyncwidget.cpp Uses the themed root icon.
src/​gui/​qml/​UpdateUrlDialog.qml Uses JSON theme palette colors.
src/​gui/​qml/​credentials/​Credentials.qml Uses themed colors and wizard logo.
src/​gui/​qml/​AccountBar.qml Uses themed account policy and URL buttons.
src/​gui/​notifications/​snoretoast.cpp Themes notification identifiers.
src/​gui/​notifications/​dbusnotifications.cpp Themes D-Bus notification identity.
src/​gui/​newwizard/​setupwizardwidget.cpp Applies JSON theme wizard colors.
src/​gui/​newwizard/​pages/​serverurlsetupwizardpage.cpp Themes wizard logo and accessibility text.
src/​gui/​navigationpanehelper.cpp Uses themed Explorer integration identity.
src/​gui/​main.cpp Loads the system theme during startup.
src/​gui/​issueswidget.cpp Adds the JSON theme dependency.
src/​gui/​guiutility.cpp Updates theme-related includes.
src/​gui/​guiutility_mac.mm Themes Finder and socket identifiers.
src/​gui/​generalsettings.cpp Themes autostart identifiers.
src/​gui/​folderstatusmodel.cpp Removes unsupported-configuration errors.
src/​gui/​folderman.h Removes the unsupported-configuration API.
src/​gui/​folderman.cpp Migrates folder branding and removes journal warnings.
src/​gui/​folder.cpp Themes folder and VFS presentation.
src/​gui/​CMakeLists.txt Uses fixed OpenCloud application icons.
src/​gui/​application.cpp Themes automatic startup registration.
src/​gui/​accountstate.cpp Themes account error dialogs.
src/​gui/​aboutdialog.cpp Uses the JSON-themed application icon.
src/​crashreporter/​CMakeLists.txt Uses fixed OpenCloud crash-reporter assets.
shell_integration/​MacOSX/​OpenCloudFinderExtension/​OpenCloudFinderExtension.xcodeproj/​project.pbxproj Raises the extension deployment target.
shell_integration/​MacOSX/​CMakeLists.txt Updates icon and deployment-target handling.
opencloud.desktop.in Uses the fixed OpenCloud desktop icon.
OPENCLOUD.cmake Removes legacy OpenCloud branding definitions.
CMakeLists.txt Defines base identity and beta JSON-theme setup.
cmake/​modules/​OCRcVersion.cmake Stops loading the legacy theme configuration.
cmake/​modules/​OCBundleResources.cmake Removes generated OEM theme resources.
beta.json Adds beta application identity and icon data.
admin/​theme_patcher.py Adds cross-platform package branding.
admin/​osx/​pre_install.sh.cmake Uses the short application name in paths.
admin/​osx/​post_install.sh.cmake Uses the short application name in paths.
admin/​osx/​CMakeLists.txt Installs package-patcher assets.
admin/​CMakeLists.txt Restricts macOS administration setup to Apple builds.
.github/​workflows/​main.yml Changes branch and signing behavior.
.craft.shelf Updates Craft revisions for theme work.
.craft.ini Adds distinguished-name signing configuration.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread CMakeLists.txt
endif()
endif()

option( WITH_CRASHREPORTER "Build crashreporter" OFF )
Comment thread admin/theme_patcher.py Resolved
Comment thread admin/theme_patcher.py
Comment on lines +170 to +174
def resizedApplicationIcon(self, size : tuple[int, int], format = "PNG"):
with Image.open(io.BytesIO(self.applicationIcon)) as image:
out = io.BytesIO()
image.convert("RGBA").resize(size, Image.Resampling.LANCZOS).save(out, format=format)
return out.getvalue()
Comment thread src/gui/aboutdialog.cpp Resolved
Comment thread src/libsync/configfile.cpp Resolved
Comment thread src/libsync/theme.cpp
#include "common/version.h"
#include "config.h"
#include "configfile.h"
#include "resources/jsontheme.h"
Comment thread src/libsync/theme.cpp
Comment on lines 261 to +263
bool Theme::withCrashReporter() const
{
return WITH_CRASHREPORTER;
return false;
Comment thread src/resources/jsontheme.cpp Resolved
Comment thread src/gui/qml/credentials/Credentials.qml Resolved
Comment thread src/resources/jsontheme.cpp Resolved
@TheOneRing
TheOneRing force-pushed the work/theme branch 2 times, most recently from 000ffa6 to 56381bb Compare October 8, 2026 09:53
@TheOneRing
TheOneRing requested a balanced review from Copilot October 8, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It contains compile failures, packaging identity regressions, lost safety checks, and macOS patcher failures.

18 open findings
6 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread admin/theme_patcher.py
Comment on lines +114 to +126
def renameBinaries(self):
if self.isMacOS:
oldBundle = self.bundleRoot.parent / "OpenCloud.app"
print(f"Renaming {oldBundle} to {self.bundleRoot}")
oldBundle.rename(self.bundleRoot)
binayDir = self.bundleRoot / "Contents" / "MacOS"
else:
binayDir = self.installDir / "bin"
for app in ["opencloud", "opencloudcmd"]:
oldBin = binayDir / f"{app}{self.exeSuffix}"
newBin = oldBin.with_name(self.renamedFileName(oldBin.name))
print(f"Renaming {oldBin} to {newBin}")
oldBin.rename(newBin)
Comment thread src/gui/aboutdialog.cpp
// non-standard update channels are only supported by the vanilla theme and the testpilotcloud theme
if (!Resources::isVanillaTheme() && !isTestPilotCloudTheme()) {
// non-standard update channels are only supported by the vanilla theme
if (!Resources::isVanillaTheme()) {
Comment thread src/resources/resources.cpp Resolved
Comment thread .craft.shelf Outdated
[craft/craft-blueprints-opencloud]
version = main
revision = 4b5f539
revision = work/theme
Comment thread CMakeLists.txt
Comment on lines +55 to +57
if(BETA_CHANNEL_BUILD)
# copy the beta theme to the bin directory so we can use the beta theme during development
configure_file("${PROJECT_SOURCE_DIR}/beta.json" "${CMAKE_CURRENT_BINARY_DIR}/bin/opencloud_theme.json" COPYONLY)
Comment thread admin/theme_patcher.py
Comment on lines +131 to +132
content = (content.replace("<string>OpenCloud Desktop</string>", f"<string>{self.applicationDisplayName}</string>")
.replace("<string>OpenCloud</string>", f"<string>{self.applicationName}</string>"))
Comment thread admin/theme_patcher.py
Comment on lines +145 to +147
content = (content.replace("OpenCloud Desktop", self.applicationDisplayName)
.replace("eu.opencloud.desktop", self.organizationDomain)
.replace("OpenCloud", self.applicationName))
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)


add_library(libsync SHARED
Comment on lines 251 to +253
QString ConfigFile::configFile()
{
return configPath() + Theme::instance()->configFileName();
return u"%1%2.cfg"_s.arg(configPath(), Resources::JsonTheme::instance().applicationName().toLower());
@TheOneRing
TheOneRing deleted the work/theme branch October 8, 2026 10:12
@openclouders openclouders mentioned this pull request Nov 13, 2026
1 task
@saw-jan saw-jan mentioned this pull request Nov 25, 2026
9 of 22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants