diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-08-29 22:55:33 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-08-29 22:55:33 +0200 |
commit | 317101430148e3bbc52995aa92d668b8473026d9 (patch) | |
tree | 0dda85a8fd0b60c7eeba3950842bd1dd876155e2 /launcher/pages/global/AccountListPage.cpp | |
parent | 7239502675fb68b1a2050c68f483e5d5371114e1 (diff) | |
download | PrismLauncher-317101430148e3bbc52995aa92d668b8473026d9.tar.gz PrismLauncher-317101430148e3bbc52995aa92d668b8473026d9.tar.bz2 PrismLauncher-317101430148e3bbc52995aa92d668b8473026d9.zip |
GH-3392 checking for migration status and refresh button in accounts list
Diffstat (limited to 'launcher/pages/global/AccountListPage.cpp')
-rw-r--r-- | launcher/pages/global/AccountListPage.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/launcher/pages/global/AccountListPage.cpp b/launcher/pages/global/AccountListPage.cpp index 45b778de..6bb07b22 100644 --- a/launcher/pages/global/AccountListPage.cpp +++ b/launcher/pages/global/AccountListPage.cpp @@ -153,6 +153,22 @@ void AccountListPage::on_actionRemove_triggered() } } +void AccountListPage::on_actionRefresh_triggered() { + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) { + QModelIndex selected = selection.first(); + MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>(); + AuthSessionPtr session = std::make_shared<AuthSession>(); + auto task = account->refresh(session); + if (task) { + ProgressDialog progDialog(this); + progDialog.execWithTask(task.get()); + // TODO: respond to results of the task + } + } +} + + void AccountListPage::on_actionSetDefault_triggered() { QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); @@ -178,6 +194,7 @@ void AccountListPage::updateButtonStates() ui->actionSetDefault->setEnabled(selection.size() > 0); ui->actionUploadSkin->setEnabled(selection.size() > 0); ui->actionDeleteSkin->setEnabled(selection.size() > 0); + ui->actionRefresh->setEnabled(selection.size() > 0); if(m_accounts->activeAccount().get() == nullptr) { ui->actionNoDefault->setEnabled(false); |