GUI: Move the icon-related code from the DownloadPacksDialog to the options

This commit is contained in:
Eugene Sandulenko 2023-01-08 14:09:41 +01:00
parent 52a87ad04e
commit fcb2182266
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 3 additions and 4 deletions

View File

@ -141,7 +141,6 @@ void DialogState::downloadFileCallback(Networking::DataResponse r) {
if (response->eos) {
if (!takeOneFile()) {
state = kDownloadComplete;
g_gui.initIconsSet();
if (dialog)
dialog->sendCommand(kDownloadEndedCmd, 0);
return;
@ -473,9 +472,6 @@ void DownloadPacksDialog::clearCache() {
}
g_state->fileHash.clear();
// Reload (now empty) icons set
g_gui.initIconsSet();
// Fetch current packs list file and re-trigger downloads
g_state->downloadList();
calculateList();

View File

@ -3112,6 +3112,9 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
case kUpdateIconsCmd: {
DownloadPacksDialog dia(_("icon packs"), "LIST", "gui-icons*.dat");
dia.runModal();
// Refresh the icons
g_gui.initIconsSet();
break;
}
#endif