Skip to content

Commit

Permalink
Fix "Add Space" button text in disconnected state
Browse files Browse the repository at this point in the history
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
  • Loading branch information
erikjv committed Oct 4, 2023
1 parent 620c5e5 commit e54adf4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand All @@ -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();
Expand Down

0 comments on commit e54adf4

Please sign in to comment.