mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Added 'insert symbol' menu for SymbolFonts;
Added scriptable 'enabled' to symbols in symbol font, used instead of scripted filenames. This means changing the tap symbol style now works; Added localisation for games, stylesheets and symbolfonts; Warnings from Reader are now shown onIdle; git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@198 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+24
-6
@@ -24,7 +24,8 @@ String Error::what() const {
|
||||
|
||||
// Errors for which a message box was already shown
|
||||
vector<String> previous_errors;
|
||||
String pending_error;
|
||||
String pending_errors;
|
||||
String pending_warnings;
|
||||
DECLARE_TYPEOF_COLLECTION(String);
|
||||
|
||||
void handle_error(const String& e, bool allow_duplicate = true, bool now = true) {
|
||||
@@ -38,8 +39,8 @@ void handle_error(const String& e, bool allow_duplicate = true, bool now = true)
|
||||
}
|
||||
// Only show errors in the main thread
|
||||
if (!now || !wxThread::IsMain()) {
|
||||
if (!pending_error.empty()) pending_error += _("\n\n");
|
||||
pending_error += e;
|
||||
if (!pending_errors.empty()) pending_errors += _("\n\n");
|
||||
pending_errors += e;
|
||||
return;
|
||||
}
|
||||
// show message
|
||||
@@ -50,10 +51,27 @@ void handle_error(const Error& e, bool allow_duplicate, bool now) {
|
||||
handle_error(e.what(), allow_duplicate, now);
|
||||
}
|
||||
|
||||
void handle_warning(const String& w, bool now) {
|
||||
// Check duplicates
|
||||
// TODO: thread safety
|
||||
// Only show errors in the main thread
|
||||
if (!now || !wxThread::IsMain()) {
|
||||
if (!pending_warnings.empty()) pending_warnings += _("\n\n");
|
||||
pending_warnings += w;
|
||||
return;
|
||||
}
|
||||
// show message
|
||||
wxMessageBox(w, _("Warning"), wxOK | wxICON_EXCLAMATION);
|
||||
}
|
||||
|
||||
void handle_pending_errors() {
|
||||
assert(wxThread::IsMain());
|
||||
if (!pending_error.empty()) {
|
||||
handle_error(pending_error);
|
||||
pending_error.clear();
|
||||
if (!pending_errors.empty()) {
|
||||
handle_error(pending_errors);
|
||||
pending_errors.clear();
|
||||
}
|
||||
if (!pending_warnings.empty()) {
|
||||
handle_warning(pending_warnings);
|
||||
pending_warnings.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user