Theme: add a method to hide the 'add account' button #3517
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 13 Aug 2015 07:38:53 +0000 (09:38 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 13 Aug 2015 07:39:44 +0000 (09:39 +0200)
src/gui/generalsettings.cpp
src/libsync/theme.cpp
src/libsync/theme.h

index 919a67b1072da9b73522f84f98cd49d747fd8392..55be618137f6853e3d37aed7f4fa4469079a1020 100644 (file)
@@ -76,6 +76,10 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
 
     connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));
     connect(_ui->addAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
+
+    if (Theme::instance()->singleAccount()) {
+        _ui->addAccountButton->setVisible(false);
+    }
 }
 
 GeneralSettings::~GeneralSettings()
index 3aafeaad5bdcfdb98e78a6cdfc32dccc42926837..737b304c04d19934fa51e3b06fb957f456ed5c4b 100644 (file)
@@ -201,6 +201,11 @@ bool Theme::singleSyncFolder() const {
     return false;
 }
 
+bool Theme::singleAccount() const
+{
+    return false;
+}
+
 QString Theme::defaultServerFolder() const
 {
     return QLatin1String("/");
index 2d34c3144376e994586ec928f2a6a6ba62471d4b..3836c73c5aee02e9caf9266ef6f162f9c667df31 100644 (file)
@@ -111,6 +111,10 @@ public:
      * Characteristics: bool if more than one sync folder is allowed
      */
     virtual bool singleSyncFolder() const;
+    /**
+     * When true, there can only be one account.
+     */
+    virtual bool singleAccount() const;
 
     /**
     * URL to help file