[Pkg-owncloud-commits] [owncloud-client] 06/83: AccountSettings: Handle button states more correctly

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat May 31 11:31:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 7ade4bb6e6c8343c0379b38dd0dd89f798de5bb2
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Mon May 19 15:46:23 2014 +0200

    AccountSettings: Handle button states more correctly
    
    Fixes #1779
---
 src/mirall/accountsettings.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index 7fff0bc..ee3efcc 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -114,7 +114,6 @@ AccountSettings::AccountSettings(QWidget *parent) :
     connect(FolderMan::instance(), SIGNAL(folderListLoaded(Folder::Map)),
             this, SLOT(setFolderList(Folder::Map)));
     setFolderList(FolderMan::instance()->map());
-
 }
 
 void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccount)
@@ -140,28 +139,28 @@ void AccountSettings::slotAccountChanged(Account *newAccount, Account *oldAccoun
 
 void AccountSettings::slotFolderActivated( const QModelIndex& indx )
 {
-  bool state = indx.isValid();
+  bool isValid = indx.isValid();
 
   bool haveFolders = ui->_folderList->model()->rowCount() > 0;
 
-  ui->_buttonRemove->setEnabled(state);
+  ui->_buttonRemove->setEnabled(isValid);
   if( Theme::instance()->singleSyncFolder() ) {
       // only one folder synced folder allowed.
       ui->_buttonAdd->setVisible(!haveFolders);
   } else {
       ui->_buttonAdd->setVisible(true);
-      ui->_buttonAdd->setEnabled( true );
   }
-  ui->_buttonEnable->setEnabled( state );
+  ui->_buttonAdd->setEnabled(_account && _account->state() == Account::Connected);
+  ui->_buttonEnable->setEnabled( isValid );
 
-  if ( state ) {
+  if ( isValid ) {
     bool folderEnabled = _model->data( indx, FolderStatusDelegate::FolderSyncEnabled).toBool();
     if ( folderEnabled ) {
       ui->_buttonEnable->setText( tr( "Pause" ) );
     } else {
       ui->_buttonEnable->setText( tr( "Resume" ) );
     }
-    ui->_buttonEnable->setEnabled(_account && _account->state() == Account::Connected);
+    ui->_buttonEnable->setEnabled( _account && _account->state() == Account::Connected);
   }
 }
 
@@ -740,7 +739,7 @@ void AccountSettings::slotAccountStateChanged(int state)
         ui->sslButton->updateAccountInfo(_account);
         QUrl safeUrl(_account->url());
         safeUrl.setPassword(QString()); // Remove the password from the URL to avoid showing it in the UI
-        ui->_buttonAdd->setEnabled(state == Account::Connected);
+        slotButtonsSetEnabled();
         if (state == Account::Connected) {
             QString user;
             if (AbstractCredentials *cred = _account->credentials()) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list