-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 6ec8d0e..f23bf1c 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp | |||
@@ -1,123 +1,123 @@ | |||
1 | /* | 1 | /* |
2 | * TODO | 2 | * TODO |
3 | * make a font selection thing | 3 | * make a font selection thing |
4 | * | 4 | * |
5 | * FIXME | 5 | * FIXME |
6 | * if you open the config dialog and close it from the little (x) button on the title bar, | 6 | * if you open the config dialog and close it from the little (x) button on the title bar, |
7 | * you have to hit the button on the keyboard twice for it to open the next time | 7 | * you have to hit the button on the keyboard twice for it to open the next time |
8 | * | 8 | * |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <qpe/qpeapplication.h> | 12 | #include <qpe/qpeapplication.h> |
13 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
14 | 14 | ||
15 | #include <qwidget.h> | 15 | #include <qwidget.h> |
16 | #include <qdialog.h> | 16 | #include <qdialog.h> |
17 | #include <qtabwidget.h> | 17 | #include <qtabwidget.h> |
18 | #include <qvbox.h> | 18 | #include <qvbox.h> |
19 | #include <qgrid.h> | 19 | #include <qgrid.h> |
20 | #include <qgroupbox.h> | 20 | #include <qgroupbox.h> |
21 | #include <qlabel.h> | 21 | #include <qlabel.h> |
22 | #include <qcheckbox.h> | 22 | #include <qcheckbox.h> |
23 | #include <qsizepolicy.h> | 23 | #include <qsizepolicy.h> |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
26 | #include "configdlg.h" | 26 | #include "configdlg.h" |
27 | #include "keyboard.h" | 27 | #include "keyboard.h" |
28 | 28 | ||
29 | ConfigDlg::ConfigDlg () : QTabWidget () | 29 | ConfigDlg::ConfigDlg () : QTabWidget () |
30 | { | 30 | { |
31 | setCaption( tr("Multikey Configuration") ); | 31 | setCaption( tr("Multikey Configuration") ); |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * 'general config' tab | 34 | * 'general config' tab |
35 | */ | 35 | */ |
36 | 36 | ||
37 | QVBox *gen_box = new QVBox (this); | 37 | QVBox *gen_box = new QVBox (this); |
38 | gen_box->setMargin(3); | 38 | gen_box->setMargin(3); |
39 | addTab(gen_box, tr("General Settings")); | 39 | addTab(gen_box, tr("General Settings")); |
40 | 40 | ||
41 | QGroupBox *map_group = new QGroupBox (2, Qt::Horizontal, tr("Keymap File"), gen_box); | 41 | QGroupBox *map_group = new QGroupBox (2, Qt::Horizontal, tr("Keymap File"), gen_box); |
42 | 42 | ||
43 | map_combo = new QComboBox ((bool)0, map_group); | 43 | map_combo = new QComboBox ((bool)0, map_group); |
44 | map_combo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); | 44 | map_combo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); |
45 | 45 | ||
46 | QString cur(tr("Current Language")); | 46 | QString cur(tr("Current Language")); |
47 | map_combo->insertItem(cur); | 47 | map_combo->insertItem(cur); |
48 | connect(map_combo, SIGNAL(activated(int)), SLOT(setMap(int))); | 48 | connect(map_combo, SIGNAL(activated(int)), SLOT(setMap(int))); |
49 | 49 | ||
50 | QString ko(tr("/opt/opie/share/multikey/ko.keymap")); | 50 | QString ko(tr(QPEApplication::qpeDir() + "/share/multikey/ko.keymap")); |
51 | map_combo->insertItem(ko); | 51 | map_combo->insertItem(ko); |
52 | 52 | ||
53 | QString en(tr("/opt/opie/share/multikey/en.keymap")); | 53 | QString en(tr(QPEApplication::qpeDir() + "/share/multikey/en.keymap")); |
54 | map_combo->insertItem(en); | 54 | map_combo->insertItem(en); |
55 | 55 | ||
56 | QString de(tr("/opt/opie/share/multikey/de.keymap")); | 56 | QString de(tr(QPEApplication::qpeDir() + "/share/multikey/de.keymap")); |
57 | map_combo->insertItem(de); | 57 | map_combo->insertItem(de); |
58 | 58 | ||
59 | QPushButton *button = new QPushButton(tr("Browse..."), map_group); | 59 | QPushButton *button = new QPushButton(tr("Browse..."), map_group); |
60 | button->setFlat((bool)1); | 60 | button->setFlat((bool)1); |
61 | 61 | ||
62 | pick_button = new QCheckBox(tr("Pickboard"), gen_box); | 62 | pick_button = new QCheckBox(tr("Pickboard"), gen_box); |
63 | 63 | ||
64 | Config config ("multikey"); | 64 | Config config ("multikey"); |
65 | config.setGroup ("pickboard"); | 65 | config.setGroup ("pickboard"); |
66 | bool pick_open = config.readBoolEntry ("open", "0"); // default closed | 66 | bool pick_open = config.readBoolEntry ("open", "0"); // default closed |
67 | if (pick_open) { | 67 | if (pick_open) { |
68 | 68 | ||
69 | pick_button->setChecked(true); | 69 | pick_button->setChecked(true); |
70 | } | 70 | } |
71 | 71 | ||
72 | // by connecting it after checking it, the signal isn't emmited | 72 | // by connecting it after checking it, the signal isn't emmited |
73 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); | 73 | connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * 'color' tab | 76 | * 'color' tab |
77 | */ | 77 | */ |
78 | 78 | ||
79 | QGrid *color_box = new QGrid(2, this); | 79 | QGrid *color_box = new QGrid(2, this); |
80 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); | 80 | color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); |
81 | color_box->setMargin(3); | 81 | color_box->setMargin(3); |
82 | addTab(color_box, tr("Colors")); | 82 | addTab(color_box, tr("Colors")); |
83 | 83 | ||
84 | QLabel *label; | 84 | QLabel *label; |
85 | 85 | ||
86 | label = new QLabel(tr("Key Color"), color_box); | 86 | label = new QLabel(tr("Key Color"), color_box); |
87 | button = new QPushButton(color_box); | 87 | button = new QPushButton(color_box); |
88 | button->setFlat((bool)1); | 88 | button->setFlat((bool)1); |
89 | label = new QLabel(tr("Key Pressed Color"), color_box); | 89 | label = new QLabel(tr("Key Pressed Color"), color_box); |
90 | button = new QPushButton(color_box); | 90 | button = new QPushButton(color_box); |
91 | button->setFlat((bool)1); | 91 | button->setFlat((bool)1); |
92 | label = new QLabel(tr("Line Color"), color_box); | 92 | label = new QLabel(tr("Line Color"), color_box); |
93 | button = new QPushButton(color_box); | 93 | button = new QPushButton(color_box); |
94 | button->setFlat((bool)1); | 94 | button->setFlat((bool)1); |
95 | label = new QLabel(tr("Text Color"), color_box); | 95 | label = new QLabel(tr("Text Color"), color_box); |
96 | button = new QPushButton(color_box); | 96 | button = new QPushButton(color_box); |
97 | button->setFlat((bool)1); | 97 | button->setFlat((bool)1); |
98 | 98 | ||
99 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand | 99 | label = new QLabel("", color_box); // a spacer so the above buttons dont expand |
100 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); | 100 | label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); |
101 | 101 | ||
102 | } | 102 | } |
103 | 103 | ||
104 | void ConfigDlg::pickTog() { | 104 | void ConfigDlg::pickTog() { |
105 | 105 | ||
106 | Config config ("multikey"); | 106 | Config config ("multikey"); |
107 | config.setGroup ("pickboard"); | 107 | config.setGroup ("pickboard"); |
108 | config.writeEntry ("open", pick_button->isChecked()); // default closed | 108 | config.writeEntry ("open", pick_button->isChecked()); // default closed |
109 | 109 | ||
110 | emit pickboardToggled(pick_button->isChecked()); | 110 | emit pickboardToggled(pick_button->isChecked()); |
111 | } | 111 | } |
112 | 112 | ||
113 | void ConfigDlg::setMap(int index) { | 113 | void ConfigDlg::setMap(int index) { |
114 | 114 | ||
115 | if (index == 0) { | 115 | if (index == 0) { |
116 | 116 | ||
117 | emit setMapToDefault(); | 117 | emit setMapToDefault(); |
118 | } | 118 | } |
119 | else { | 119 | else { |
120 | 120 | ||
121 | emit setMapToFile(map_combo->text(index)); | 121 | emit setMapToFile(map_combo->text(index)); |
122 | } | 122 | } |
123 | } | 123 | } |