reload clientrunes when they are changed

This commit is contained in:
mrbesen 2023-09-02 14:35:53 +02:00
parent 86b91774a7
commit 1a353a5a21
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
2 changed files with 10 additions and 2 deletions

View File

@ -29,6 +29,7 @@ public:
private slots:
void loadRunes();
void reloadClientRunes();
void setRunesEnabled(bool enabled);
void saveRunePageClient(int id, QString name, const RunePage& rp);

View File

@ -83,8 +83,7 @@ void RuneManager::loadRunes() {
this->ui->listaaRunes->setRuneInfos(runeInfo, runeStyles);
// load runepages
const std::vector<ClientAPI::RunePage> runePages = client->getAllRunePages();
ui->listClientRunes->loadRunePages(runePages);
reloadClientRunes();
// reload runepages - so they ids can get their names
reloadAARunes();
@ -106,6 +105,13 @@ void RuneManager::loadRunes() {
this->ui->btnRetry->setEnabled(true);
}
void RuneManager::reloadClientRunes() {
if(client) {
const std::vector<ClientAPI::RunePage> runePages = client->getAllRunePages();
ui->listClientRunes->loadRunePages(runePages);
}
}
void RuneManager::setRunesEnabled(bool enabled) {
this->ui->lblClientRunes->setEnabled(enabled);
@ -131,6 +137,7 @@ void RuneManager::saveRunePageClient(int id, QString name, const RunePage& rp) {
// TODO: some error occured
}
}
reloadClientRunes();
} catch(RestClient::WebException& e) {
qCritical() << "webexception: " << e.curlresponse;