Add bool theme option to display legacy import dialog.
authorCamila Ayres <hello@camilasan.com>
Mon, 9 Dec 2024 10:06:32 +0000 (11:06 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 9 Dec 2024 17:36:27 +0000 (18:36 +0100)
Signed-off-by: Camila Ayres <hello@camilasan.com>
NEXTCLOUD.cmake
config.h.in
src/libsync/theme.cpp
src/libsync/theme.h

index e2632dbcfb6d67caf1692d11e576f9b82058c190..3cd8a49c09b41ef7b497839c5113ccf0a691584b 100644 (file)
@@ -28,6 +28,7 @@ set( APPLICATION_REV_DOMAIN "com.nextcloud.desktopclient" )
 set( APPLICATION_VIRTUALFILE_SUFFIX "nextcloud" CACHE STRING "Virtual file suffix (not including the .)")
 set( APPLICATION_OCSP_STAPLING_ENABLED OFF )
 set( APPLICATION_FORBID_BAD_SSL OFF )
+option( APPLICATION_DISPLAY_LEGACY_IMPORT_DIALOG "Display legacy import dialog" ON )
 
 set( LINUX_PACKAGE_SHORTNAME "nextcloud" )
 set( LINUX_APPLICATION_ID "${APPLICATION_REV_DOMAIN}.${LINUX_PACKAGE_SHORTNAME}")
index be3005502032f2f698fac607d95611c3882fa93b..faaec1bea23f6322b285692e8987627332ab30e5 100644 (file)
@@ -38,6 +38,7 @@
 #cmakedefine01 ENFORCE_VIRTUAL_FILES_SYNC_FOLDER
 #cmakedefine DO_NOT_USE_PROXY "@DO_NOT_USE_PROXY@"
 #cmakedefine ENFORCE_SINGLE_ACCOUNT "@ENFORCE_SINGLE_ACCOUNT@"
+#cmakedefine01 APPLICATION_DISPLAY_LEGACY_IMPORT_DIALOG
 
 #cmakedefine ZLIB_FOUND @ZLIB_FOUND@
 
index a77aa4450d7f10476c305dc8fa239c2ca1ca3668..51a42f4ce92bfc4886d6af0d81681a44dbf4c3c6 100644 (file)
@@ -1036,6 +1036,15 @@ bool Theme::darkMode() const
     return isDarkFromStyle();
 }
 
+bool Theme::displayLegacyImportDialog() const
+{
+#if defined APPLICATION_DISPLAY_LEGACY_IMPORT_DIALOG && APPLICATION_DISPLAY_LEGACY_IMPORT_DIALOG
+    return true;
+#else
+    return false;
+#endif
+}
+
 void Theme::setOverrideServerUrl(const QString &overrideServerUrl)
 {
     auto validOverrideServerUrl = overrideServerUrl;
index 9e12ba709f51c5b2830111d469b151fd6ad5aa88..1c1416ef64cdfcf860c7cb152a46dc6cbbf35c56 100644 (file)
@@ -604,6 +604,13 @@ public:
     [[nodiscard]] QVariantMap systemPalette() const;
     [[nodiscard]] bool darkMode() const;
 
+    /**
+     * Display legacy import dialog
+     *
+     * The user will interact with the dialog to import legacy account when set to true
+     */
+    [[nodiscard]] bool displayLegacyImportDialog() const;
+
 public slots:
     void setOverrideServerUrl(const QString &overrideServerUrl);
     void setForceOverrideServerUrl(bool forceOverride);