Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Add Space" button text in disconnected state #11256

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"));
TheOneRing marked this conversation as resolved.
Show resolved Hide resolved
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
Loading