From e54adf4c1862b9ddf762c037f9cdb75ae8237e98 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 2 Oct 2023 15:59:53 +0200 Subject: [PATCH] Fix "Add Space" button text in disconnected state When the account state was disconnected from an oCIS server, the button would show "Add Folder" instead of "Add Space". This also fixes the tooltip of the button. Fixes: #11230 --- src/gui/accountsettings.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 23a42270653..8a7248b8542 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -828,9 +828,10 @@ void AccountSettings::slotAccountStateChanged() _toggleSignInOutAction->setText(tr("Log out")); } - ui->addButton->setEnabled(state == AccountState::Connected); if (state == AccountState::Connected) { ui->_folderList->setItemsExpandable(true); + ui->addButton->setEnabled(true); + if (_accountState->supportsSpaces()) { ui->addButton->setText(tr("Add Space")); ui->addButton->setToolTip(tr("Click this button to add a Space.")); @@ -840,8 +841,15 @@ void AccountSettings::slotAccountStateChanged() } } else { ui->_folderList->setItemsExpandable(false); - ui->addButton->setText(tr("Add Folder")); - ui->addButton->setToolTip(tr("You need to be connected to add a folder.")); + ui->addButton->setEnabled(false); + + if (_accountState->supportsSpaces()) { + ui->addButton->setText(tr("Add Space")); + ui->addButton->setToolTip(tr("You need to be connected to add a Space.")); + } else { + ui->addButton->setText(tr("Add Folder")); + ui->addButton->setToolTip(tr("You need to be connected to add a folder.")); + } /* check if there are expanded root items, if so, close them */ ui->_folderList->collapseAll();