diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-05-17 09:36:04 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-05-17 09:36:04 +0000 |
commit | 0c41e1d057f0425c2687b87da4272f8eafb70ba4 (patch) | |
tree | 98b271dfc99c0833959d6c52f0efbb90e48ba1af /vncviewer/OptionsDialog.cxx | |
parent | 17fca55bc93139554e9259e78e9bad39d846141d (diff) | |
download | tigervnc-0c41e1d057f0425c2687b87da4272f8eafb70ba4.tar.gz tigervnc-0c41e1d057f0425c2687b87da4272f8eafb70ba4.zip |
Add a callback mechanism to the options dialog so that other parts of vncviewer
can pick up on changes.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4421 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/OptionsDialog.cxx')
-rw-r--r-- | vncviewer/OptionsDialog.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index f69a2998..8fe7eecf 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -42,6 +42,8 @@ using namespace std; using namespace rdr; using namespace rfb; +std::map<OptionsCallback*, void*> OptionsDialog::callbacks; + OptionsDialog::OptionsDialog() : Fl_Window(450, 450, _("VNC Viewer: Connection Options")) { @@ -101,6 +103,18 @@ void OptionsDialog::showDialog(void) } +void OptionsDialog::addCallback(OptionsCallback *cb, void *data) +{ + callbacks[cb] = data; +} + + +void OptionsDialog::removeCallback(OptionsCallback *cb) +{ + callbacks.erase(cb); +} + + void OptionsDialog::show(void) { loadOptions(); @@ -333,6 +347,11 @@ void OptionsDialog::storeOptions(void) fullScreen.setParam(fullScreenCheckbox->value()); useLocalCursor.setParam(localCursorCheckbox->value()); dotWhenNoCursor.setParam(dotCursorCheckbox->value()); + + std::map<OptionsCallback*, void*>::const_iterator iter; + + for (iter = callbacks.begin();iter != callbacks.end();++iter) + iter->first(iter->second); } |