projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
da9fd55
)
Fix instant-translation when things are changed more than once.
author
Carl Hetherington
<cth@carlh.net>
Thu, 21 Mar 2019 23:07:44 +0000
(23:07 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 21 Mar 2019 23:07:44 +0000
(23:07 +0000)
src/wx/check_box.cc
patch
|
blob
|
history
src/wx/dcpomatic_button.cc
patch
|
blob
|
history
src/wx/i18n_hook.cc
patch
|
blob
|
history
src/wx/i18n_hook.h
patch
|
blob
|
history
src/wx/static_text.cc
patch
|
blob
|
history
diff --git
a/src/wx/check_box.cc
b/src/wx/check_box.cc
index 8f24f43ec73fc7cf17c43922d14ad0cff990c797..d41b8a3f1e3a2e261b2d39bbe7eab08810ee8763 100644
(file)
--- a/
src/wx/check_box.cc
+++ b/
src/wx/check_box.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-24,7
+24,7
@@
using std::cout;
CheckBox::CheckBox (wxWindow* parent, wxString label)
: wxCheckBox (parent, wxID_ANY, label)
CheckBox::CheckBox (wxWindow* parent, wxString label)
: wxCheckBox (parent, wxID_ANY, label)
- , I18NHook (this)
+ , I18NHook (this
, get_text()
)
{
}
{
}
diff --git
a/src/wx/dcpomatic_button.cc
b/src/wx/dcpomatic_button.cc
index de26629a981239a37b9b2b53f4c815b92ee17fbc..beab6422770f6e7b1dd5a2cef0aaa3c24759d717 100644
(file)
--- a/
src/wx/dcpomatic_button.cc
+++ b/
src/wx/dcpomatic_button.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-22,7
+22,7
@@
Button::Button (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
: wxButton (parent, wxID_ANY, label, pos, size, style)
Button::Button (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
: wxButton (parent, wxID_ANY, label, pos, size, style)
- , I18NHook (this)
+ , I18NHook (this
, get_text()
)
{
}
{
}
diff --git
a/src/wx/i18n_hook.cc
b/src/wx/i18n_hook.cc
index 84dcd761fdbfdc914397ef15639ea5fc5bc7b5b2..b2cd6df8e7f5e1af60ff0179cb2673bac43422b1 100644
(file)
--- a/
src/wx/i18n_hook.cc
+++ b/
src/wx/i18n_hook.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-30,8
+30,9
@@
using std::string;
map<string, string> I18NHook::_translations;
map<string, string> I18NHook::_translations;
-I18NHook::I18NHook (wxWindow* window)
+I18NHook::I18NHook (wxWindow* window
, wxString original
)
: _window (window)
: _window (window)
+ , _original (original)
{
_window->Bind (wxEVT_MIDDLE_DOWN, bind(&I18NHook::handle, this, _1));
}
{
_window->Bind (wxEVT_MIDDLE_DOWN, bind(&I18NHook::handle, this, _1));
}
@@
-39,8
+40,6
@@
I18NHook::I18NHook (wxWindow* window)
void
I18NHook::handle (wxMouseEvent& ev)
{
void
I18NHook::handle (wxMouseEvent& ev)
{
- wxString const original = get_text ();
-
InstantI18NDialog* d = new InstantI18NDialog (_window, get_text());
d->ShowModal();
set_text (d->get());
InstantI18NDialog* d = new InstantI18NDialog (_window, get_text());
d->ShowModal();
set_text (d->get());
@@
-56,5
+55,5
@@
I18NHook::handle (wxMouseEvent& ev)
ev.Skip ();
ev.Skip ();
- _translations[wx_to_std(original)] = wx_to_std(get_text());
+ _translations[wx_to_std(
_
original)] = wx_to_std(get_text());
}
}
diff --git
a/src/wx/i18n_hook.h
b/src/wx/i18n_hook.h
index 106d9d8c4f4edf60657f77b5ad963a467756e8d5..40fd89a2c66cce72ecaed2701c7a47afbbad450d 100644
(file)
--- a/
src/wx/i18n_hook.h
+++ b/
src/wx/i18n_hook.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-27,7
+27,7
@@
class I18NHook
{
public:
class I18NHook
{
public:
- I18NHook (wxWindow* window);
+ I18NHook (wxWindow* window
, wxString original
);
virtual void set_text (wxString text) = 0;
virtual wxString get_text () const = 0;
virtual void set_text (wxString text) = 0;
virtual wxString get_text () const = 0;
@@
-40,6
+40,7
@@
private:
void handle (wxMouseEvent &);
wxWindow* _window;
void handle (wxMouseEvent &);
wxWindow* _window;
+ wxString _original;
static std::map<std::string, std::string> _translations;
};
static std::map<std::string, std::string> _translations;
};
diff --git
a/src/wx/static_text.cc
b/src/wx/static_text.cc
index 6a11f647a87c02b4e8cecfa7cc87110f4aac255b..40710590fca01d787022190050ff1afb82cb7b5e 100644
(file)
--- a/
src/wx/static_text.cc
+++ b/
src/wx/static_text.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2019
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-22,7
+22,7
@@
StaticText::StaticText (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
: wxStaticText (parent, wxID_ANY, label, pos, size, style)
StaticText::StaticText (wxWindow* parent, wxString label, wxPoint pos, wxSize size, long style)
: wxStaticText (parent, wxID_ANY, label, pos, size, style)
- , I18NHook (this)
+ , I18NHook (this
, get_text()
)
{
}
{
}