Repository navigation
Json theme - #1114
Json theme#1114
Conversation
| { 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{{ |
There was a problem hiding this comment.
Nitpick: This is one to large... It's only four entries.
4d0458b to
39b8d3c
Compare
4025533 to
6babd2d
Compare
|
|
||
| # resources for the theme patcher | ||
| # TODO: guard by an option? | ||
| if (WIN32) |
There was a problem hiding this comment.
Should we guard the theming resources with an option? @dragotin
There was a problem hiding this comment.
🟡 Changes recommended
It currently contains compile failures, configuration migration regressions, unsafe signing behavior, and broken package-patching paths.
15 open findings
Restore default CRASHREPORTER_EXECUTABLE target name · New Prevent desktop launcher filename collision · New Support or reject SVG icon generation explicitly · New Use applicationName() instead of nonexistent appName() · New Preserve legacy configuration filename during rename · New Include JsonTheme header and call applicationName() · New Define missing icon and vendor branding variables · New Update main app plist bundle identifier · New Restore multiple sync journal safety check · New Fix undefined JsonThme binding in QML · New Restore APPLICATION_UPDATE_URL configuration definition · New Preserve build-time crash reporter setting · New Validate theme structure and required identifiers · New Remove leftover theme debugging log · New Fix typo in JsonTheme logging category · New
What changed in this PR
Replaces compile-time OEM branding with runtime JSON themes and post-install package patching.
Changes:
- Adds
JsonThemefor application identity, colors, icons, URLs, and QML integration. - Migrates branding consumers away from legacy
Themeand 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.
| endif() | ||
| endif() | ||
|
|
||
| option( WITH_CRASHREPORTER "Build crashreporter" OFF ) |
| 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() |
| #include "common/version.h" | ||
| #include "config.h" | ||
| #include "configfile.h" | ||
| #include "resources/jsontheme.h" |
| bool Theme::withCrashReporter() const | ||
| { | ||
| return WITH_CRASHREPORTER; | ||
| return false; |
000ffa6 to
56381bb
Compare
There was a problem hiding this comment.
🟡 Changes recommended
It contains compile failures, packaging identity regressions, lost safety checks, and macOS patcher failures.
18 open findings
Fix macOS binary name case during patching · New Update auto-updater checks for removed isVanillaTheme() · New Validate image-provider IDs before list indexing · New Include JsonTheme header and call applicationName() Support or reject SVG icon generation explicitly Restore default CRASHREPORTER_EXECUTABLE target name Pin the blueprint revision for reproducible builds · New Keep beta packaging identifiers distinct from stable · New Prevent chained replacements from corrupting inserted values · New Prevent generic replacements from corrupting package metadata · New Restore APPLICATION_UPDATE_URL configuration · New Normalize beta configuration filename to opencloud_beta · New Preserve build-time crash reporter setting Restore APPLICATION_UPDATE_URL configuration definition Fix undefined JsonThme binding in QML Restore multiple sync journal safety check Update main app plist bundle identifier Define missing icon and vendor branding variables
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.
| 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) |
| // 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()) { |
| [craft/craft-blueprints-opencloud] | ||
| version = main | ||
| revision = 4b5f539 | ||
| revision = work/theme |
| 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) |
| content = (content.replace("<string>OpenCloud Desktop</string>", f"<string>{self.applicationDisplayName}</string>") | ||
| .replace("<string>OpenCloud</string>", f"<string>{self.applicationName}</string>")) |
| 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 |
| QString ConfigFile::configFile() | ||
| { | ||
| return configPath() + Theme::instance()->configFileName(); | ||
| return u"%1%2.cfg"_s.arg(configPath(), Resources::JsonTheme::instance().applicationName().toLower()); |



No description provided.