From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Sun, 12 Jan 2020 18:53:02 +0000 (+0100) Subject: Removed old account toolbox X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~413^2~53 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=163ca3b58ab6f6098393e440f54145f99fc374bf;p=nextcloud-desktop.git Removed old account toolbox Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index c28096b96..20822b068 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -143,9 +143,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) _ui->_folderList->setAttribute(Qt::WA_Hover, true); _ui->_folderList->installEventFilter(mouseCursorChanger); - createAccountToolbox(); - connect(AccountManager::instance(), &AccountManager::accountAdded, - this, &AccountSettings::slotAccountAdded); connect(this, &AccountSettings::removeAccountFolders, AccountManager::instance(), &AccountManager::removeAccountFolders); connect(_ui->_folderList, &QWidget::customContextMenuRequested, @@ -211,37 +208,10 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) _ui->encryptionMessage->hide(); } - customizeStyle(); -} - - -void AccountSettings::createAccountToolbox() -{ - QMenu *menu = new QMenu(); - - connect(menu, &QMenu::aboutToShow, this, &AccountSettings::slotMenuBeforeShow); - - _addAccountAction = new QAction(tr("Add new"), this); - menu->addAction(_addAccountAction); - - connect(_addAccountAction, &QAction::triggered, this, &AccountSettings::slotOpenAccountWizard); connect(UserModel::instance(), &UserModel::addAccount, - this, &AccountSettings::slotOpenAccountWizard); - - _toggleSignInOutAction = new QAction(tr("Log out"), this); - connect(_toggleSignInOutAction, &QAction::triggered, this, &AccountSettings::slotToggleSignInState); - menu->addAction(_toggleSignInOutAction); + this, &AccountSettings::slotOpenAccountWizard); - QAction *action = new QAction(tr("Remove"), this); - menu->addAction(action); - - connect(action, &QAction::triggered, this, &AccountSettings::slotDeleteAccount); - - _ui->_accountToolbox->setText(tr("Account") + QLatin1Char(' ')); - _ui->_accountToolbox->setMenu(menu); - _ui->_accountToolbox->setPopupMode(QToolButton::InstantPopup); - - slotAccountAdded(_accountState); + customizeStyle(); } @@ -257,24 +227,6 @@ void AccountSettings::slotNewMnemonicGenerated() _ui->encryptionMessage->show(); } -void AccountSettings::slotMenuBeforeShow() { - if (_menuShown) { - return; - } - - auto menu = _ui->_accountToolbox->menu(); - - // We can't check this during the initial creation as there is no account yet then - if (_accountState->account()->capabilities().clientSideEncryptionAvaliable()) { - QAction *mnemonic = new QAction(tr("Show E2E mnemonic"), this); - connect(mnemonic, &QAction::triggered, this, &AccountSettings::requesetMnemonic); - menu->addAction(mnemonic); - } - - _menuShown = true; -} - - QString AccountSettings::selectedFolderAlias() const { QModelIndex selected = _ui->_folderList->selectionModel()->currentIndex(); @@ -1068,21 +1020,12 @@ void AccountSettings::slotAccountStateChanged() // sync user interface buttons. refreshSelectiveSyncStatus(); - /* set the correct label for the Account toolbox button */ - if (_accountState) { - if (_accountState->isSignedOut()) { - _toggleSignInOutAction->setText(tr("Log in")); - } else { - _toggleSignInOutAction->setText(tr("Log out")); - } - } - if (state == AccountState::State::Connected) { /* TODO: We should probably do something better here. * Verify if the user has a private key already uploaded to the server, * if it has, do not offer to create one. */ - qCInfo(lcAccountSettings) << "Accout" << accountsState()->account()->displayName() + qCInfo(lcAccountSettings) << "Account" << accountsState()->account()->displayName() << "Client Side Encryption" << accountsState()->account()->capabilities().clientSideEncryptionAvaliable(); } } @@ -1198,18 +1141,6 @@ void AccountSettings::refreshSelectiveSyncStatus() } } -void AccountSettings::slotAccountAdded(AccountState *) -{ - // if the theme is limited to single account, the button must hide if - // there is already one account. - int s = AccountManager::instance()->accounts().size(); - if (s > 0 && !Theme::instance()->multiAccount()) { - _addAccountAction->setVisible(false); - } else { - _addAccountAction->setVisible(true); - } -} - void AccountSettings::slotDeleteAccount() { // Deleting the account potentially deletes 'this', so diff --git a/src/gui/accountsettings.h b/src/gui/accountsettings.h index 886ebed23..e620029a5 100644 --- a/src/gui/accountsettings.h +++ b/src/gui/accountsettings.h @@ -90,7 +90,6 @@ protected slots: void slotDeleteAccount(); void slotToggleSignInState(); void slotOpenAccountWizard(); - void slotAccountAdded(AccountState *); void refreshSelectiveSyncStatus(); void slotMarkSubfolderEncrypted(const FolderStatusModel::SubFolderInfo* folderInfo); void slotMarkSubfolderDecrypted(const FolderStatusModel::SubFolderInfo* folderInfo); @@ -100,8 +99,6 @@ protected slots: void doExpand(); void slotLinkActivated(const QString &link); - void slotMenuBeforeShow(); - // Encryption Related Stuff. void slotShowMnemonic(const QString &mnemonic); void slotNewMnemonicGenerated(); diff --git a/src/gui/accountsettings.ui b/src/gui/accountsettings.ui index 6249018bd..eafb4605d 100644 --- a/src/gui/accountsettings.ui +++ b/src/gui/accountsettings.ui @@ -6,7 +6,7 @@ 0 0 - 516 + 581 557 @@ -184,13 +184,6 @@ - - - - ... - - - diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index f26ad8717..52222586d 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -79,7 +79,6 @@ void Systray::create() void Systray::slotChangeActivityModel() { _trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel()); - //UserModel::instance()->currentActivityModel()->slotRefreshActivity(); } bool Systray::isOpen()