Skip to content

Commit

Permalink
page_load: Disable loading when loading is impossible
Browse files Browse the repository at this point in the history
When loading the preview fails because we couldn't extract the preview from the
save, be conservative and disable the "Load" button (how could the server load
the file if we can't?). Also hide the preview from the previously selected
item, if any.

See #1166.
  • Loading branch information
lmoureaux committed Aug 2, 2022
1 parent 8cc2cf4 commit 19d3d53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/page_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,14 @@ void page_load::slot_selection_changed(const QItemSelection &selected,
}
}
ui.load_save_text->setText(final_str);

ui.load_save_text->show();
ui.load_pix->show();
ui.buttons->button(QDialogButtonBox::Ok)->setEnabled(true);
} else {
// Couldn't load the save. Clear the preview and prevent loading it.
ui.load_save_text->hide();
ui.load_pix->hide();
ui.buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
}
}

0 comments on commit 19d3d53

Please sign in to comment.