summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Prefs.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/Prefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Prefs.cpp463
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
@@ -5,29 +5,60 @@
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "Prefs.h" 9#include "Prefs.h"
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
29void populate_colours(QComboBox *mb)
30#else
31void 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
23CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) 54CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl )
24 : QWidget( parent, name, fl ) 55 : QWidget( parent, name, fl )
25{ 56{
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);
29 60
30 StripCR = new QCheckBox( bg ); 61 StripCR = new QCheckBox( bg );
31 StripCR->setText( tr( "Strip CR" ) ); 62 StripCR->setText( tr( "Strip CR" ) );
32 63
33 Dehyphen = new QCheckBox( bg ); 64 Dehyphen = new QCheckBox( bg );
@@ -51,25 +82,191 @@ CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl )
51 Embolden = new QCheckBox( bg ); 82 Embolden = new QCheckBox( bg );
52 Embolden->setText( tr( "Embolden" ) ); 83 Embolden->setText( tr( "Embolden" ) );
53 84
54 FullJustify = new QCheckBox( bg ); 85 FullJustify = new QCheckBox( bg );
55 FullJustify->setText( tr( "Full Justify" ) ); 86 FullJustify->setText( tr( "Full Justify" ) );
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}
58 113
59/* 114/*
60 * Destroys the object and frees any allocated resources 115 * Destroys the object and frees any allocated resources
61 */ 116 */
62CLayoutPrefs::~CLayoutPrefs() 117CLayoutPrefs::~CLayoutPrefs()
63{ 118{
64 // no need to delete child widgets, Qt does it all for us 119 // no need to delete child widgets, Qt does it all for us
65} 120}
66 121
67 122
68 123
69CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) 124CLayoutPrefs2::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/*
266CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent, const char* name, WFlags fl )
70 : QWidget( parent, name, fl ) 267 : QWidget( parent, name, fl )
71{ 268{
72 269
73 QVBoxLayout* vb = new QVBoxLayout(this); 270 QVBoxLayout* vb = new QVBoxLayout(this);
74 QGridLayout* gl = new QGridLayout(vb, 4, 3); 271 QGridLayout* gl = new QGridLayout(vb, 4, 3);
75 272
@@ -110,13 +307,13 @@ CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl )
110 307
111 TextLabel = new QLabel( this ); 308 TextLabel = new QLabel( this );
112 TextLabel->setText( tr( "Line\nLeading" ) ); 309 TextLabel->setText( tr( "Line\nLeading" ) );
113 gl->addWidget(TextLabel, 2, 2); 310 gl->addWidget(TextLabel, 2, 2);
114 311
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);
118 315
119 ParaLead = new QSpinBox( this ); 316 ParaLead = new QSpinBox( this );
120 ParaLead->setRange(-5, 50); 317 ParaLead->setRange(-5, 50);
121 gl->addWidget(ParaLead, 3, 1); 318 gl->addWidget(ParaLead, 3, 1);
122 319
@@ -151,25 +348,48 @@ CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl )
151 fontselector = new QComboBox( this); 348 fontselector = new QComboBox( this);
152#else 349#else
153 fontselector = new MenuButton( this); 350 fontselector = new MenuButton( this);
154#endif 351#endif
155 fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); 352 fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
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();
163 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) 356 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
164 { 357 {
165 fontselector->insertItem(*nm); 358 fontselector->insertItem(*nm);
166 } 359 }
167 } // delete the FontDatabase!!! 360 } // delete the FontDatabase!!!
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/*
171CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl ) 391CLayoutPrefs2::CLayoutPrefs2( QWidget* parent, const char* name, WFlags fl )
172 : QWidget( parent, name, fl ) 392 : QWidget( parent, name, fl )
173{ 393{
174 QHBoxLayout* hb = new QHBoxLayout(this); 394 QHBoxLayout* hb = new QHBoxLayout(this);
175 395
@@ -351,80 +571,128 @@ CMiscPrefs::~CMiscPrefs()
351*/ 571*/
352 572
353CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) 573CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl )
354 : QWidget( parent, name, fl ) 574 : QWidget( parent, name, fl )
355{ 575{
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
364 annotation = new QCheckBox( gb ); 587 annotation = new QCheckBox( gb );
365 annotation->setText( tr( "Annotation" ) ); 588 annotation->setText( tr( "Annotation" ) );
366 589
367 dictionary = new QCheckBox( gb ); 590 dictionary = new QCheckBox( gb );
368 dictionary->setText( tr( "Dictionary" ) ); 591 dictionary->setText( tr( "Dictionary" ) );
369 592
370 clipboard = new QCheckBox( gb ); 593 clipboard = new QCheckBox( gb );
371 clipboard->setText( tr( "Clipboard" ) ); 594 clipboard->setText( tr( "Clipboard" ) );
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
376 Depluck = new QCheckBox( bg ); 599 Depluck = new QCheckBox( bg );
377 Depluck->setText( tr( "Depluck" ) ); 600 Depluck->setText( tr( "Depluck" ) );
378 601
379 Dejpluck = new QCheckBox( bg ); 602 Dejpluck = new QCheckBox( bg );
380 Dejpluck->setText( tr( "Dejpluck" ) ); 603 Dejpluck->setText( tr( "Dejpluck" ) );
381 604
382 Continuous = new QCheckBox( bg ); 605 Continuous = new QCheckBox( bg );
383 Continuous->setText( tr( "Continuous" ) ); 606 Continuous->setText( tr( "Continuous" ) );
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}
400 669
401CMiscPrefs::~CMiscPrefs() 670CMiscPrefs::~CMiscPrefs()
402{ 671{
403 // no need to delete child widgets, Qt does it all for us 672 // no need to delete child widgets, Qt does it all for us
404} 673}
405 674
406CPrefs::CPrefs(bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) 675CPrefs::CPrefs( int w, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true)
407{ 676{
408 setCaption(tr( "OpieReader Settings" ) ); 677 setCaption(tr( "OpieReader Settings" ) );
409 QTabWidget* td = new QTabWidget(this); 678 QTabWidget* td = new QTabWidget(this);
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);
415 td->addTab(layout, tr("Layout")); 684 td->addTab(layout, tr("Layout"));
416 td->addTab(layout2, tr("Layout(2)")); 685 td->addTab(layout2, tr("Layout(2)"));
417 td->addTab(inter, tr("Locale")); 686 td->addTab(inter, tr("Locale"));
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);
421 v->addWidget(td); 690 v->addWidget(td);
422 691
423 if (fs) 692 if (fs) showMaximized();
424 QPEApplication::showDialog( this );
425} 693}
426 694
427 695
428/* 696/*
429 697
430Unicode 698Unicode
@@ -475,13 +743,13 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl )
475 { 743 {
476 encoding->insertItem(iter->mime); 744 encoding->insertItem(iter->mime);
477 } 745 }
478 746
479 QVBoxLayout* vb = new QVBoxLayout; 747 QVBoxLayout* vb = new QVBoxLayout;
480 748
481 gb = new QGroupBox(1, Qt::Horizontal, tr("Dictionary"), this); 749 gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this);
482 750
483 TextLabel = new QLabel( gb ); 751 TextLabel = new QLabel( gb );
484 TextLabel->setText( tr( "Application" ) ); 752 TextLabel->setText( tr( "Application" ) );
485 application = new QLineEdit(gb); 753 application = new QLineEdit(gb);
486 application->setFixedWidth(80); 754 application->setFixedWidth(80);
487 755
@@ -491,140 +759,19 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl )
491 message->setFixedWidth(80); 759 message->setFixedWidth(80);
492// message->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); 760// message->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
493 twotouch = new QCheckBox( gb ); 761 twotouch = new QCheckBox( gb );
494 twotouch->setText( tr( "Two/One\nTouch" ) ); 762 twotouch->setText( tr( "Two/One\nTouch" ) );
495 763
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
499 767
500 vb->addWidget(gb); 768 vb->addWidget(gb);
501 769
502// vb->addStretch(); 770// vb->addStretch();
503 hb->addLayout(vb); 771 hb->addLayout(vb);
504} 772}
505 773
506CInterPrefs::~CInterPrefs() 774CInterPrefs::~CInterPrefs()
507{ 775{
508 // no need to delete child widgets, Qt does it all for us 776 // no need to delete child widgets, Qt does it all for us
509} 777}
510
511
512
513#ifdef USECOMBO
514void CButtonPrefs::populate(QComboBox *mb)
515#else
516void 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
540CButtonPrefs::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
627CButtonPrefs::~CButtonPrefs()
628{
629 // no need to delete child widgets, Qt does it all for us
630}