aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/ui/pages/global/AccountListPage.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index b97fe35e..5447a07b 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -255,18 +255,20 @@ void AccountListPage::updateButtonStates()
{
// If there is no selection, disable buttons that require something selected.
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
- bool hasSelection = selection.size() > 0;
+ bool hasSelection = !selection.empty();
bool accountIsReady = false;
+ bool accountIsOnline;
if (hasSelection)
{
QModelIndex selected = selection.first();
MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
accountIsReady = !account->isActive();
+ accountIsOnline = !account->isOffline();
}
ui->actionRemove->setEnabled(accountIsReady);
ui->actionSetDefault->setEnabled(accountIsReady);
- ui->actionUploadSkin->setEnabled(accountIsReady);
- ui->actionDeleteSkin->setEnabled(accountIsReady);
+ ui->actionUploadSkin->setEnabled(accountIsReady && accountIsOnline);
+ ui->actionDeleteSkin->setEnabled(accountIsReady && accountIsOnline);
ui->actionRefresh->setEnabled(accountIsReady);
if(m_accounts->defaultAccount().get() == nullptr) {