diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2011-09-04 07:04:43 +0000 |
---|---|---|
committer | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2011-09-04 07:04:43 +0000 |
commit | 498ef46cc28bb8a74b1d59f347294da1f5c57143 (patch) | |
tree | e9f6740ba00e1538a1adeeedc53257edc21c3b41 /vncviewer/OptionsDialog.cxx | |
parent | 76745f1ef5868c4ca51964342ffe695cd95614bd (diff) | |
download | tigervnc-498ef46cc28bb8a74b1d59f347294da1f5c57143.tar.gz tigervnc-498ef46cc28bb8a74b1d59f347294da1f5c57143.zip |
Support other keys than F8 as menu key
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4665 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/OptionsDialog.cxx')
-rw-r--r-- | vncviewer/OptionsDialog.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index 220ca962..5fd61546 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -36,6 +36,7 @@ #include "OptionsDialog.h" #include "fltk_layout.h" #include "i18n.h" +#include "menukey.h" #include "parameters.h" #include <FL/Fl_Tabs.H> @@ -268,11 +269,9 @@ void OptionsDialog::loadOptions(void) menuKeyChoice->value(0); menuKeyBuf = menuKey; - if (menuKeyBuf[0] == 'F') { - int num = atoi(menuKeyBuf+1); - if ((num >= 1) && (num <= 12)) - menuKeyChoice->value(num); - } + for (int i = 0; i < getMenuKeySymbolCount(); i++) + if (!strcmp(getMenuKeySymbols()[i].name, menuKeyBuf)) + menuKeyChoice->value(i + 1); /* Misc. */ sharedCheckbox->value(shared); @@ -361,9 +360,7 @@ void OptionsDialog::storeOptions(void) if (menuKeyChoice->value() == 0) menuKey.setParam(""); else { - char buf[16]; - sprintf(buf, "F%d", menuKeyChoice->value()); - menuKey.setParam(buf); + menuKey.setParam(menuKeyChoice->text()); } /* Misc. */ @@ -696,11 +693,8 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th) menuKeyChoice = new Fl_Choice(LBLLEFT(tx, ty, 150, CHOICE_HEIGHT, _("Menu key"))); menuKeyChoice->add(_("None"), 0, NULL, (void*)0, FL_MENU_DIVIDER); - for (int i = 1;i <= 12;i++) { - char buf[16]; - sprintf(buf, "F%d", i); - menuKeyChoice->add(buf, 0, NULL, (void*)i, 0); - } + for (int i = 0; i < getMenuKeySymbolCount(); i++) + menuKeyChoice->add(getMenuKeySymbols()[i].name, 0, NULL, 0, 0); ty += CHOICE_HEIGHT + TIGHT_MARGIN; |