projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.
[dcpomatic.git]
/
src
/
wx
/
wx_util.cc
diff --git
a/src/wx/wx_util.cc
b/src/wx/wx_util.cc
index aac35e97a4a1a2b2eb4ba5b78b81f0eeb1b3a697..003cc222f13ff400b1a64d4f4a06e112ee52a25a 100644
(file)
--- a/
src/wx/wx_util.cc
+++ b/
src/wx/wx_util.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012
-2014
Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-193,7
+193,7
@@
void
checked_set (wxSpinCtrlDouble* widget, double value)
{
/* XXX: completely arbitrary epsilon */
checked_set (wxSpinCtrlDouble* widget, double value)
{
/* XXX: completely arbitrary epsilon */
- if (fabs (widget->GetValue() - value)
<
1e-16) {
+ if (fabs (widget->GetValue() - value)
>
1e-16) {
widget->SetValue (value);
}
}
widget->SetValue (value);
}
}
@@
-312,10
+312,20
@@
wx_get (wxSpinCtrlDouble* w)
return w->GetValue ();
}
return w->GetValue ();
}
-void
-run_gui_loop ()
+/** @param s String of the form Context|String
+ * @return translation, or String if no translation is available.
+ */
+wxString
+context_translation (wxString s)
{
{
- while (wxTheApp->Pending ()) {
- wxTheApp->Dispatch ();
+ wxString t = wxGetTranslation (s);
+ if (t == s) {
+ /* No translation; strip the context */
+ int c = t.Find (wxT ("|"));
+ if (c != wxNOT_FOUND) {
+ t = t.Mid (c + 1);
+ }
}
}
+
+ return t;
}
}