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: private slots:
void loadRunes(); void loadRunes();
void reloadClientRunes();
void setRunesEnabled(bool enabled); void setRunesEnabled(bool enabled);
void saveRunePageClient(int id, QString name, const RunePage& rp); void saveRunePageClient(int id, QString name, const RunePage& rp);

View File

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