author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (unidiff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/Prefs.cpp | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/Prefs.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Prefs.cpp | 463 |
1 files changed, 305 insertions, 158 deletions
diff --git a/noncore/apps/opie-reader/Prefs.cpp b/noncore/apps/opie-reader/Prefs.cpp index 72eefba..2733faa 100644 --- a/noncore/apps/opie-reader/Prefs.cpp +++ b/noncore/apps/opie-reader/Prefs.cpp | |||
@@ -10,13 +10,44 @@ | |||
10 | 10 | ||
11 | #include <qcheckbox.h> | ||
11 | #include <qlabel.h> | 12 | #include <qlabel.h> |
13 | #include <qpushbutton.h> | ||
14 | #include <qspinbox.h> | ||
12 | #include <qlayout.h> | 15 | #include <qlayout.h> |
16 | #include <qvariant.h> | ||
17 | #include <qtooltip.h> | ||
18 | #include <qwhatsthis.h> | ||
13 | #include <qbuttongroup.h> | 19 | #include <qbuttongroup.h> |
14 | #ifdef USEQPE | 20 | #include <qlineedit.h> |
15 | #include <qpe/menubutton.h> | 21 | #ifdef USECOMBO |
16 | #include <qpe/fontdatabase.h> | 22 | #include <qcombobox.h> |
17 | #else | 23 | #else |
18 | #include <qfontdatabase.h> | 24 | #include <qpe/menubutton.h> |
19 | #endif | 25 | #endif |
26 | #include <qfontdatabase.h> | ||
20 | 27 | ||
21 | #include <qpe/qpeapplication.h> | 28 | #ifdef USECOMBO |
29 | void populate_colours(QComboBox *mb) | ||
30 | #else | ||
31 | void populate_colours(MenuButton *mb) | ||
32 | #endif | ||
33 | { | ||
34 | mb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
35 | mb->insertItem("White"); | ||
36 | mb->insertItem("Black"); | ||
37 | mb->insertItem("Dark Gray"); | ||
38 | mb->insertItem("Gray"); | ||
39 | mb->insertItem("Light Gray"); | ||
40 | mb->insertItem("Red"); | ||
41 | mb->insertItem("Green"); | ||
42 | mb->insertItem("Blue"); | ||
43 | mb->insertItem("Cyan"); | ||
44 | mb->insertItem("Magenta"); | ||
45 | mb->insertItem("Yellow"); | ||
46 | mb->insertItem("Dark Red"); | ||
47 | mb->insertItem("Dark Green"); | ||
48 | mb->insertItem("Dark Blue"); | ||
49 | mb->insertItem("Dark Cyan"); | ||
50 | mb->insertItem("Dark Magenta"); | ||
51 | mb->insertItem("Dark Yellow"); | ||
52 | } | ||
22 | 53 | ||
@@ -26,3 +57,3 @@ CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
26 | QHBoxLayout* hb = new QHBoxLayout(this); | 57 | QHBoxLayout* hb = new QHBoxLayout(this); |
27 | QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, tr("Text"), this); | 58 | QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this); |
28 | hb->addWidget(bg); | 59 | hb->addWidget(bg); |
@@ -56,2 +87,26 @@ CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
56 | 87 | ||
88 | FixGraphics = new QCheckBox( bg ); | ||
89 | FixGraphics->setText( tr( "Fix Graphic Size" ) ); | ||
90 | |||
91 | hyphenate = new QCheckBox( bg ); | ||
92 | hyphenate->setText( tr( "Hyphenate" ) ); | ||
93 | |||
94 | /* | ||
95 | customhyphen = new QCheckBox( bg ); | ||
96 | customhyphen->setText( tr( "Custom Hyphen'n" ) ); | ||
97 | */ | ||
98 | |||
99 | prepalm = new QCheckBox( bg ); | ||
100 | prepalm->setText( tr( "Repalm(Baen)" ) ); | ||
101 | |||
102 | pkern = new QCheckBox( bg ); | ||
103 | pkern->setText( tr( "Kern" ) ); | ||
104 | |||
105 | /* | ||
106 | Negative = new QCheckBox( bg ); | ||
107 | Negative->setText( tr( "Negative" ) ); | ||
108 | */ | ||
109 | |||
110 | // Inverse = new QCheckBox( bg ); | ||
111 | // Inverse->setText( tr( "Inverse" ) ); | ||
57 | } | 112 | } |
@@ -68,3 +123,145 @@ CLayoutPrefs::~CLayoutPrefs() | |||
68 | 123 | ||
69 | CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) | 124 | CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent, const char* name, WFlags fl ) |
125 | : QWidget( parent, name, fl ) | ||
126 | { | ||
127 | |||
128 | QVBoxLayout* vb = new QVBoxLayout(this); | ||
129 | QGridLayout* gl = new QGridLayout(vb, 4, 5); | ||
130 | |||
131 | QLabel *TextLabel; | ||
132 | |||
133 | TextLabel = new QLabel( this ); | ||
134 | TextLabel->setText( tr( "Page\nOverlap" ) ); | ||
135 | gl->addWidget(TextLabel, 0, 0); | ||
136 | pageoverlap = new QSpinBox( this ); | ||
137 | pageoverlap->setRange(0,20); | ||
138 | gl->addWidget(pageoverlap, 0, 1); | ||
139 | |||
140 | TextLabel = new QLabel( this, "TextLabel1" ); | ||
141 | TextLabel->setText( tr( "Indent" ) ); | ||
142 | gl->addWidget(TextLabel, 1, 0); | ||
143 | Indent = new QSpinBox( this, "Indent" ); | ||
144 | Indent->setRange(0,20); | ||
145 | gl->addWidget(Indent, 1, 1); | ||
146 | |||
147 | |||
148 | |||
149 | TextLabel = new QLabel( this ); | ||
150 | TextLabel->setText( tr( "Graphics\nZoom" ) ); | ||
151 | gl->addWidget(TextLabel, 1, 2); | ||
152 | gfxzoom = new QSpinBox( this ); | ||
153 | gfxzoom->setRange(0,2000); | ||
154 | gfxzoom->setLineStep(10); | ||
155 | gfxzoom->setSuffix("%"); | ||
156 | gl->addWidget(gfxzoom, 1, 3); | ||
157 | |||
158 | TextLabel = new QLabel( this, "TextLabel4" ); | ||
159 | TextLabel->setText( tr( "Top\nMargin" ) ); | ||
160 | gl->addWidget(TextLabel, 2, 0); | ||
161 | TopMargin = new QSpinBox( this, "TMargin" ); | ||
162 | TopMargin->setRange(0, 1000); | ||
163 | gl->addWidget(TopMargin, 2, 1); | ||
164 | |||
165 | TextLabel = new QLabel( this ); | ||
166 | TextLabel->setText( tr( "Bottom\nMargin" ) ); | ||
167 | gl->addWidget(TextLabel, 2, 2); | ||
168 | BottomMargin = new QSpinBox( this, "BMargin" ); | ||
169 | BottomMargin->setRange(0, 1000); | ||
170 | gl->addWidget(BottomMargin, 2, 3); | ||
171 | |||
172 | TextLabel = new QLabel( this, "TextLabel4" ); | ||
173 | TextLabel->setText( tr( "Left\nMargin" ) ); | ||
174 | gl->addWidget(TextLabel, 3, 0); | ||
175 | LeftMargin = new QSpinBox( this, "LMargin" ); | ||
176 | LeftMargin->setRange(0, 1000); | ||
177 | gl->addWidget(LeftMargin, 3, 1); | ||
178 | |||
179 | TextLabel = new QLabel( this ); | ||
180 | TextLabel->setText( tr( "Right\nMargin" ) ); | ||
181 | gl->addWidget(TextLabel, 3, 2); | ||
182 | RightMargin = new QSpinBox( this, "RMargin" ); | ||
183 | RightMargin->setRange(0, 1000); | ||
184 | gl->addWidget(RightMargin, 3, 3); | ||
185 | |||
186 | TextLabel = new QLabel( this ); | ||
187 | TextLabel->setText( tr( "Paragraph\nLeading" ) ); | ||
188 | gl->addWidget(TextLabel, 4, 0); | ||
189 | ParaLead = new QSpinBox( this ); | ||
190 | ParaLead->setRange(-5, 50); | ||
191 | gl->addWidget(ParaLead, 4, 1); | ||
192 | |||
193 | TextLabel = new QLabel( this ); | ||
194 | TextLabel->setText( tr( "Line\nLeading" ) ); | ||
195 | gl->addWidget(TextLabel, 4, 2); | ||
196 | LineLead = new QSpinBox( this ); | ||
197 | LineLead->setRange(-5, 50); | ||
198 | gl->addWidget(LineLead, 4, 3); | ||
199 | |||
200 | gl = new QGridLayout(vb, 2, 2); | ||
201 | |||
202 | TextLabel = new QLabel( this); | ||
203 | TextLabel->setText( tr( "Markup" ) ); | ||
204 | gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom); | ||
205 | TextLabel = new QLabel( this); | ||
206 | TextLabel->setText( tr( "Font" ) ); | ||
207 | gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom); | ||
208 | |||
209 | |||
210 | #ifdef USECOMBO | ||
211 | Markup = new QComboBox( this); | ||
212 | #else | ||
213 | Markup = new MenuButton( this); | ||
214 | #endif | ||
215 | Markup->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
216 | Markup->insertItem("Auto"); | ||
217 | Markup->insertItem("None"); | ||
218 | Markup->insertItem("Text"); | ||
219 | Markup->insertItem("HTML"); | ||
220 | Markup->insertItem("PML"); | ||
221 | gl->addWidget(Markup, 1, 0, Qt::AlignTop); | ||
222 | |||
223 | #ifdef USECOMBO | ||
224 | fontselector = new QComboBox( this); | ||
225 | #else | ||
226 | fontselector = new MenuButton( this); | ||
227 | #endif | ||
228 | fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
229 | { | ||
230 | QFontDatabase f; | ||
231 | QStringList flist = f.families(); | ||
232 | for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) | ||
233 | { | ||
234 | fontselector->insertItem(*nm); | ||
235 | } | ||
236 | } // delete the FontDatabase!!! | ||
237 | gl->addWidget(fontselector, 1, 1, Qt::AlignTop); | ||
238 | |||
239 | #ifdef USECOMBO | ||
240 | bgsel = new QComboBox( this ); | ||
241 | #else | ||
242 | bgsel = new MenuButton( this ); | ||
243 | #endif | ||
244 | populate_colours(bgsel); | ||
245 | |||
246 | #ifdef USECOMBO | ||
247 | fgsel = new QComboBox( this ); | ||
248 | #else | ||
249 | fgsel = new MenuButton( this ); | ||
250 | #endif | ||
251 | populate_colours(fgsel); | ||
252 | gl = new QGridLayout(vb, 2, 2); | ||
253 | |||
254 | TextLabel = new QLabel( this); | ||
255 | TextLabel->setText( tr( "Background" ) ); | ||
256 | gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom); | ||
257 | TextLabel = new QLabel( this); | ||
258 | TextLabel->setText( tr( "Foreground" ) ); | ||
259 | gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom); | ||
260 | |||
261 | gl->addWidget(bgsel, 1, 0, Qt::AlignTop); | ||
262 | gl->addWidget(fgsel, 1, 1, Qt::AlignTop); | ||
263 | |||
264 | } | ||
265 | /* | ||
266 | CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent, const char* name, WFlags fl ) | ||
70 | : QWidget( parent, name, fl ) | 267 | : QWidget( parent, name, fl ) |
@@ -115,3 +312,3 @@ CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) | |||
115 | Margin = new QSpinBox( this, "Margin" ); | 312 | Margin = new QSpinBox( this, "Margin" ); |
116 | Margin->setRange(0, 100); | 313 | Margin->setRange(0, w/2); |
117 | gl->addWidget(Margin, 3, 0); | 314 | gl->addWidget(Margin, 3, 0); |
@@ -156,7 +353,3 @@ CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) | |||
156 | { | 353 | { |
157 | #ifdef USEQPE | ||
158 | FontDatabase f; | ||
159 | #else | ||
160 | QFontDatabase f; | 354 | QFontDatabase f; |
161 | #endif | ||
162 | QStringList flist = f.families(); | 355 | QStringList flist = f.families(); |
@@ -168,3 +361,30 @@ CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) | |||
168 | gl->addWidget(fontselector, 1, 1, Qt::AlignTop); | 361 | gl->addWidget(fontselector, 1, 1, Qt::AlignTop); |
362 | |||
363 | #ifdef USECOMBO | ||
364 | bgsel = new QComboBox( this ); | ||
365 | #else | ||
366 | bgsel = new MenuButton( this ); | ||
367 | #endif | ||
368 | populate_colours(bgsel); | ||
369 | |||
370 | #ifdef USECOMBO | ||
371 | fgsel = new QComboBox( this ); | ||
372 | #else | ||
373 | fgsel = new MenuButton( this ); | ||
374 | #endif | ||
375 | populate_colours(fgsel); | ||
376 | gl = new QGridLayout(vb, 2, 2); | ||
377 | |||
378 | TextLabel = new QLabel( this); | ||
379 | TextLabel->setText( tr( "Background" ) ); | ||
380 | gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom); | ||
381 | TextLabel = new QLabel( this); | ||
382 | TextLabel->setText( tr( "Foreground" ) ); | ||
383 | gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom); | ||
384 | |||
385 | gl->addWidget(bgsel, 1, 0, Qt::AlignTop); | ||
386 | gl->addWidget(fgsel, 1, 1, Qt::AlignTop); | ||
387 | |||
169 | } | 388 | } |
389 | */ | ||
170 | /* | 390 | /* |
@@ -356,8 +576,11 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
356 | 576 | ||
357 | QGridLayout* hl = new QGridLayout(this,1,2); | 577 | QVBoxLayout* vl = new QVBoxLayout(this); |
578 | QHBoxLayout* hl = new QHBoxLayout; | ||
579 | vl->addLayout(hl); | ||
358 | 580 | ||
581 | vl->setMargin( 0 ); | ||
359 | hl->setMargin( 0 ); | 582 | hl->setMargin( 0 ); |
360 | 583 | ||
361 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("Select Action"), this); | 584 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this); |
362 | hl->addWidget( gb, 0, 0 ); | 585 | hl->addWidget( gb ); |
363 | 586 | ||
@@ -372,4 +595,4 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
372 | 595 | ||
373 | QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, tr("Plucker"), this); | 596 | QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this); |
374 | hl->addWidget( bg, 0 , 1 ); | 597 | hl->addWidget( bg ); |
375 | 598 | ||
@@ -384,16 +607,62 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
384 | 607 | ||
608 | bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this); | ||
609 | vl->addWidget( bg ); | ||
385 | 610 | ||
386 | /* | 611 | // scrollinplace = new QCheckBox( bg ); |
612 | // scrollinplace->setText( tr( "In Place" ) ); | ||
613 | #ifdef USECOMBO | ||
614 | scrolltype = new QComboBox( bg ); | ||
615 | #else | ||
616 | scrolltype = new MenuButton( this); | ||
617 | #endif | ||
618 | scrolltype->insertItem("In Place"); | ||
619 | scrolltype->insertItem("Rolling (moving bg)"); | ||
620 | scrolltype->insertItem("Rolling (window)"); | ||
621 | scrolltype->insertItem("Rolling (static bg)"); | ||
622 | scrolltype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
387 | 623 | ||
388 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Navigation", this); | 624 | |
389 | TextLabel = new QLabel( gb ); | 625 | #ifdef USECOMBO |
390 | TextLabel->setText( tr( "Overlap" ) ); | 626 | scrollcolor = new QComboBox( bg ); |
391 | QSpinBox* sb = new QSpinBox( gb ); | 627 | #else |
392 | 628 | scrollcolor = new MenuButton( this); | |
393 | Internationalisation | 629 | #endif |
394 | Ideogram/Word | 630 | populate_colours(scrollcolor); |
395 | Set Width | 631 | scrollcolor->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); |
396 | Set Encoding | 632 | |
397 | Set Font | 633 | |
398 | */ | 634 | QLabel* TextLabel = new QLabel( bg ); |
635 | TextLabel->setText( tr( "Scroll step" ) ); | ||
636 | // gl->addWidget(TextLabel, 2, 0); | ||
637 | scrollstep = new QSpinBox( bg ); | ||
638 | scrollstep->setRange(1, 10); | ||
639 | scrollstep->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
640 | |||
641 | TextLabel = new QLabel( bg ); | ||
642 | TextLabel->setText( tr( "Minibar Colour" ) ); | ||
643 | #ifdef USECOMBO | ||
644 | minibarcol = new QComboBox( bg ); | ||
645 | #else | ||
646 | minibarcol = new MenuButton( this); | ||
647 | #endif | ||
648 | populate_colours(minibarcol); | ||
649 | minibarcol->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
650 | |||
651 | |||
652 | bg = new QButtonGroup(2, Qt::Vertical, "Background", this); | ||
653 | vl->addWidget( bg ); | ||
654 | |||
655 | // QLabel* TextLabel = new QLabel( bg ); | ||
656 | // TextLabel->setText( tr( "Copy an image to \"background\" in\n~/Applications/uqtreader/Theme/" ) ); | ||
657 | |||
658 | #ifdef USECOMBO | ||
659 | bgtype = new QComboBox( bg ); | ||
660 | #else | ||
661 | bgtype = new MenuButton( this); | ||
662 | #endif | ||
663 | bgtype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
664 | |||
665 | bgtype->insertItem( tr("Centred") ); | ||
666 | bgtype->insertItem( tr("Tiled") ); | ||
667 | bgtype->insertItem( tr("Fitted") ); | ||
399 | } | 668 | } |
@@ -405,3 +674,3 @@ CMiscPrefs::~CMiscPrefs() | |||
405 | 674 | ||
406 | CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) | 675 | CPrefs::CPrefs( int w, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) |
407 | { | 676 | { |
@@ -410,5 +679,5 @@ CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, nam | |||
410 | layout = new CLayoutPrefs(this); | 679 | layout = new CLayoutPrefs(this); |
411 | layout2 = new CLayoutPrefs2(this); | 680 | layout2 = new CLayoutPrefs2(w, this); |
412 | misc = new CMiscPrefs(this); | 681 | misc = new CMiscPrefs(this); |
413 | button = new CButtonPrefs(this); | 682 | // button = new CButtonPrefs(kmap, this); |
414 | inter = new CInterPrefs(this); | 683 | inter = new CInterPrefs(this); |
@@ -418,3 +687,3 @@ CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, nam | |||
418 | td->addTab(misc, tr("Misc")); | 687 | td->addTab(misc, tr("Misc")); |
419 | td->addTab(button, tr("Buttons")); | 688 | // td->addTab(button, tr("Buttons")); |
420 | QVBoxLayout* v = new QVBoxLayout(this); | 689 | QVBoxLayout* v = new QVBoxLayout(this); |
@@ -422,4 +691,3 @@ CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, nam | |||
422 | 691 | ||
423 | if (fs) | 692 | if (fs) showMaximized(); |
424 | QPEApplication::showDialog( this ); | ||
425 | } | 693 | } |
@@ -480,3 +748,3 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
480 | 748 | ||
481 | gb = new QGroupBox(1, Qt::Horizontal, tr("Dictionary"), this); | 749 | gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this); |
482 | 750 | ||
@@ -496,3 +764,3 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
496 | SwapMouse = new QCheckBox( gb ); | 764 | SwapMouse = new QCheckBox( gb ); |
497 | SwapMouse->setText(tr("Swap Tap\nActions") ); | 765 | SwapMouse->setText("Swap Tap\nActions"); |
498 | 766 | ||
@@ -509,122 +777 @@ CInterPrefs::~CInterPrefs() | |||
509 | } | } | |
510 | |||
511 | |||
512 | |||
513 | #ifdef USECOMBO | ||
514 | void CButtonPrefs::populate(QComboBox *mb) | ||
515 | #else | ||
516 | void CButtonPrefs::populate(MenuButton *mb) | ||
517 | #endif | ||
518 | { | ||
519 | mb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
520 | mb->insertItem(tr("<Nothing>") ); | ||
521 | mb->insertItem(tr("Open file") ); | ||
522 | mb->insertItem(tr("Autoscroll") ); | ||
523 | mb->insertItem(tr("Bookmark") ); | ||
524 | mb->insertItem(tr("Annotate") ); | ||
525 | mb->insertItem(tr("Fullscreen") ); | ||
526 | |||
527 | mb->insertItem(tr("Zoom in") ); | ||
528 | mb->insertItem(tr("Zoom out") ); | ||
529 | mb->insertItem(tr("Back") ); | ||
530 | mb->insertItem(tr("Forward") ); | ||
531 | mb->insertItem(tr("Home") ); | ||
532 | mb->insertItem(tr("Page up") ); | ||
533 | mb->insertItem(tr("Page down") ); | ||
534 | mb->insertItem(tr("Line up") ); | ||
535 | mb->insertItem(tr("Line down") ); | ||
536 | mb->insertItem(tr("Beginning") ); | ||
537 | mb->insertItem(tr("End") ); | ||
538 | } | ||
539 | |||
540 | CButtonPrefs::CButtonPrefs( QWidget* parent, const char* name, WFlags fl ) | ||
541 | : QWidget( parent, name, fl ) | ||
542 | { | ||
543 | |||
544 | QGridLayout* hl = new QGridLayout(this,10,2); | ||
545 | |||
546 | hl->setMargin( 0 ); | ||
547 | |||
548 | QLabel* ql = new QLabel(tr("Escape Button"), this); | ||
549 | hl->addWidget(ql, 0, 0, Qt::AlignBottom); | ||
550 | #ifdef USECOMBO | ||
551 | escapeAction = new QComboBox( this ); | ||
552 | #else | ||
553 | escapeAction = new MenuButton( this ); | ||
554 | #endif | ||
555 | populate(escapeAction); | ||
556 | hl->addWidget(escapeAction, 1, 0, Qt::AlignTop | Qt::AlignLeft); | ||
557 | |||
558 | ql = new QLabel(tr("Space Button"), this); | ||
559 | hl->addWidget(ql, 2, 0, Qt::AlignBottom); | ||
560 | #ifdef USECOMBO | ||
561 | spaceAction = new QComboBox( this ); | ||
562 | #else | ||
563 | spaceAction = new MenuButton( this ); | ||
564 | #endif | ||
565 | populate(spaceAction); | ||
566 | hl->addWidget(spaceAction, 3, 0, Qt::AlignTop | Qt::AlignLeft); | ||
567 | |||
568 | ql = new QLabel(tr("Return Button"), this); | ||
569 | hl->addWidget(ql, 2, 1, Qt::AlignBottom); | ||
570 | #ifdef USECOMBO | ||
571 | returnAction = new QComboBox( this ); | ||
572 | #else | ||
573 | returnAction = new MenuButton( this ); | ||
574 | #endif | ||
575 | populate(returnAction); | ||
576 | hl->addWidget(returnAction, 3, 1, Qt::AlignTop | Qt::AlignLeft); | ||
577 | |||
578 | ql = new QLabel(tr("Left Arrow"), this); | ||
579 | hl->addWidget(ql, 4, 0, Qt::AlignBottom); | ||
580 | #ifdef USECOMBO | ||
581 | leftAction = new QComboBox( this ); | ||
582 | #else | ||
583 | leftAction = new MenuButton( this ); | ||
584 | #endif | ||
585 | populate(leftAction); | ||
586 | hl->addWidget(leftAction, 5, 0, Qt::AlignTop | Qt::AlignLeft); | ||
587 | leftScroll = new QCheckBox( tr("Scroll Speed"), this ); | ||
588 | hl->addWidget(leftScroll, 6, 0, Qt::AlignTop | Qt::AlignLeft); | ||
589 | |||
590 | ql = new QLabel(tr("Right Arrow"), this); | ||
591 | hl->addWidget(ql, 4, 1, Qt::AlignBottom); | ||
592 | #ifdef USECOMBO | ||
593 | rightAction = new QComboBox( this ); | ||
594 | #else | ||
595 | rightAction = new MenuButton( this ); | ||
596 | #endif | ||
597 | populate(rightAction); | ||
598 | hl->addWidget(rightAction, 5, 1, Qt::AlignTop | Qt::AlignLeft); | ||
599 | rightScroll = new QCheckBox( tr("Scroll Speed"), this ); | ||
600 | hl->addWidget(rightScroll, 6, 1, Qt::AlignTop | Qt::AlignLeft); | ||
601 | |||
602 | ql = new QLabel(tr("Down Arrow"), this); | ||
603 | hl->addWidget(ql, 7, 0, Qt::AlignBottom); | ||
604 | #ifdef USECOMBO | ||
605 | downAction = new QComboBox( this ); | ||
606 | #else | ||
607 | downAction = new MenuButton( this ); | ||
608 | #endif | ||
609 | populate(downAction); | ||
610 | hl->addWidget(downAction, 8, 0, Qt::AlignTop | Qt::AlignLeft); | ||
611 | downScroll = new QCheckBox( tr("Scroll Speed"), this ); | ||
612 | hl->addWidget(downScroll, 9, 0, Qt::AlignTop | Qt::AlignLeft); | ||
613 | |||
614 | ql = new QLabel(tr("Up Arrow"), this); | ||
615 | hl->addWidget(ql, 7, 1, Qt::AlignBottom); | ||
616 | #ifdef USECOMBO | ||
617 | upAction = new QComboBox( this ); | ||
618 | #else | ||
619 | upAction = new MenuButton( this ); | ||
620 | #endif | ||
621 | populate(upAction); | ||
622 | hl->addWidget(upAction, 8, 1, Qt::AlignTop | Qt::AlignLeft); | ||
623 | upScroll = new QCheckBox( tr("Scroll Speed"), this ); | ||
624 | hl->addWidget(upScroll, 9, 1, Qt::AlignTop | Qt::AlignLeft); | ||
625 | } | ||
626 | |||
627 | CButtonPrefs::~CButtonPrefs() | ||
628 | { | ||
629 | // no need to delete child widgets, Qt does it all for us | ||
630 | } | ||