Diffstat (limited to 'noncore/apps/opie-reader/ToolbarPrefs.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ToolbarPrefs.cpp | 76 |
1 files changed, 66 insertions, 10 deletions
diff --git a/noncore/apps/opie-reader/ToolbarPrefs.cpp b/noncore/apps/opie-reader/ToolbarPrefs.cpp index 0347736..5cf220a 100644 --- a/noncore/apps/opie-reader/ToolbarPrefs.cpp +++ b/noncore/apps/opie-reader/ToolbarPrefs.cpp | |||
@@ -3,20 +3,29 @@ | |||
3 | ** | 3 | ** |
4 | ** Created: Tue Feb 11 23:53:35 2003 | 4 | ** Created: Tue Feb 11 23:53:35 2003 |
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 "useqpe.h" | ||
9 | #include "ToolbarPrefs.h" | 10 | #include "ToolbarPrefs.h" |
10 | 11 | ||
12 | #include <qcheckbox.h> | ||
13 | #include <qlabel.h> | ||
14 | #include <qpushbutton.h> | ||
15 | #include <qspinbox.h> | ||
11 | #include <qlayout.h> | 16 | #include <qlayout.h> |
17 | #include <qvariant.h> | ||
18 | #include <qtooltip.h> | ||
19 | #include <qwhatsthis.h> | ||
20 | #include <qcombobox.h> | ||
12 | #include <qbuttongroup.h> | 21 | #include <qbuttongroup.h> |
22 | #include <qlineedit.h> | ||
13 | #ifdef USEQPE | 23 | #ifdef USEQPE |
14 | #include <qpe/menubutton.h> | 24 | #include <qpe/menubutton.h> |
15 | #endif | 25 | #endif |
16 | #include <qpe/qpeapplication.h> | ||
17 | 26 | ||
18 | CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) | 27 | CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) |
19 | { | 28 | { |
20 | setCaption(tr( "Toolbar Settings" ) ); | 29 | setCaption(tr( "Toolbar Settings" ) ); |
21 | QTabWidget* td = new QTabWidget(this); | 30 | QTabWidget* td = new QTabWidget(this); |
22 | misc = new CMiscBarPrefs(this); | 31 | misc = new CMiscBarPrefs(this); |
@@ -31,14 +40,13 @@ CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char | |||
31 | td->addTab(markbar, tr("Marks")); | 40 | td->addTab(markbar, tr("Marks")); |
32 | td->addTab(indbar, tr("Indicators")); | 41 | td->addTab(indbar, tr("Indicators")); |
33 | td->addTab(misc, tr("Policy")); | 42 | td->addTab(misc, tr("Policy")); |
34 | QVBoxLayout* v = new QVBoxLayout(this); | 43 | QVBoxLayout* v = new QVBoxLayout(this); |
35 | v->addWidget(td); | 44 | v->addWidget(td); |
36 | 45 | ||
37 | if (fs) | 46 | if (fs) showMaximized(); |
38 | QPEApplication::showDialog( this ); | ||
39 | } | 47 | } |
40 | 48 | ||
41 | /* | 49 | /* |
42 | CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) | 50 | CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) |
43 | : QWidget( parent, name, fl ), config(_config) | 51 | : QWidget( parent, name, fl ), config(_config) |
44 | { | 52 | { |
@@ -118,12 +126,20 @@ CBarPrefs2::CBarPrefs2( Config& _config, QWidget* parent, const char* name, WFl | |||
118 | 126 | ||
119 | config.setGroup( "Toolbar" ); | 127 | config.setGroup( "Toolbar" ); |
120 | 128 | ||
121 | fullscreen = new QCheckBox( tr("Fullscreen"), bg ); | 129 | fullscreen = new QCheckBox( tr("Fullscreen"), bg ); |
122 | fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); | 130 | fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); |
123 | connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 131 | connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
132 | rotate = new QCheckBox( tr("Rotate"), bg ); | ||
133 | rotate->setChecked(config.readBoolEntry( "Rotate", false )); | ||
134 | connect(rotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | ||
135 | |||
136 | invert = new QCheckBox( tr("Invert"), bg ); | ||
137 | invert->setChecked(config.readBoolEntry( "Invert Action", false )); | ||
138 | connect(invert, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | ||
139 | |||
124 | zoom = new QCheckBox( tr("Zoom"), bg ); | 140 | zoom = new QCheckBox( tr("Zoom"), bg ); |
125 | zoom->setChecked(config.readBoolEntry( "Zoom In/Out", false )); | 141 | zoom->setChecked(config.readBoolEntry( "Zoom In/Out", false )); |
126 | connect(zoom, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 142 | connect(zoom, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
127 | setfont = new QCheckBox( tr("Set Font"), bg ); | 143 | setfont = new QCheckBox( tr("Set Font"), bg ); |
128 | setfont->setChecked(config.readBoolEntry( "Set Font", false )); | 144 | setfont->setChecked(config.readBoolEntry( "Set Font", false )); |
129 | connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 145 | connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
@@ -174,12 +190,14 @@ CBarPrefs2::CBarPrefs2( Config& _config, QWidget* parent, const char* name, WFl | |||
174 | } | 190 | } |
175 | 191 | ||
176 | void CBarPrefs2::saveall() | 192 | void CBarPrefs2::saveall() |
177 | { | 193 | { |
178 | config.setGroup( "Toolbar" ); | 194 | config.setGroup( "Toolbar" ); |
179 | config.writeEntry( "Fullscreen", fullscreen->isChecked()); | 195 | config.writeEntry( "Fullscreen", fullscreen->isChecked()); |
196 | config.writeEntry( "Rotate", rotate->isChecked()); | ||
197 | config.writeEntry( "Invert Action", invert->isChecked()); | ||
180 | config.writeEntry( "Zoom In/Out", zoom->isChecked()); | 198 | config.writeEntry( "Zoom In/Out", zoom->isChecked()); |
181 | config.writeEntry( "Set Font", setfont->isChecked()); | 199 | config.writeEntry( "Set Font", setfont->isChecked()); |
182 | config.writeEntry("Encoding Select", encoding->isChecked()); | 200 | config.writeEntry("Encoding Select", encoding->isChecked()); |
183 | config.writeEntry("Ideogram Mode", ideogram->isChecked()); | 201 | config.writeEntry("Ideogram Mode", ideogram->isChecked()); |
184 | 202 | ||
185 | config.writeEntry( "Mark", mark->isChecked()); | 203 | config.writeEntry( "Mark", mark->isChecked()); |
@@ -312,12 +330,20 @@ CViewBarPrefs::CViewBarPrefs( Config& _config, QWidget* parent, const char* nam | |||
312 | 330 | ||
313 | config.setGroup( "Toolbar" ); | 331 | config.setGroup( "Toolbar" ); |
314 | 332 | ||
315 | fullscreen = new QCheckBox( tr("Fullscreen"), bg ); | 333 | fullscreen = new QCheckBox( tr("Fullscreen"), bg ); |
316 | fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); | 334 | fullscreen->setChecked(config.readBoolEntry( "Fullscreen", false )); |
317 | connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 335 | connect(fullscreen, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
336 | rotate = new QCheckBox( tr("Rotate"), bg ); | ||
337 | rotate->setChecked(config.readBoolEntry( "Rotate", false )); | ||
338 | connect(rotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | ||
339 | |||
340 | invert = new QCheckBox( tr("Invert"), bg ); | ||
341 | invert->setChecked(config.readBoolEntry( "Invert Action", false )); | ||
342 | connect(invert, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | ||
343 | |||
318 | zoomin = new QCheckBox( tr("Zoom In"), bg ); | 344 | zoomin = new QCheckBox( tr("Zoom In"), bg ); |
319 | zoomin->setChecked(config.readBoolEntry( "Zoom In", false )); | 345 | zoomin->setChecked(config.readBoolEntry( "Zoom In", false )); |
320 | connect(zoomin, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 346 | connect(zoomin, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
321 | zoomout = new QCheckBox( tr("Zoom Out"), bg ); | 347 | zoomout = new QCheckBox( tr("Zoom Out"), bg ); |
322 | zoomout->setChecked(config.readBoolEntry( "Zoom Out", false )); | 348 | zoomout->setChecked(config.readBoolEntry( "Zoom Out", false )); |
323 | connect(zoomout, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); | 349 | connect(zoomout, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); |
@@ -335,12 +361,14 @@ CViewBarPrefs::CViewBarPrefs( Config& _config, QWidget* parent, const char* nam | |||
335 | } | 361 | } |
336 | 362 | ||
337 | void CViewBarPrefs::saveall() | 363 | void CViewBarPrefs::saveall() |
338 | { | 364 | { |
339 | config.setGroup( "Toolbar" ); | 365 | config.setGroup( "Toolbar" ); |
340 | config.writeEntry( "Fullscreen", fullscreen->isChecked()); | 366 | config.writeEntry( "Fullscreen", fullscreen->isChecked()); |
367 | config.writeEntry( "Rotate", rotate->isChecked()); | ||
368 | config.writeEntry( "Invert Action", invert->isChecked()); | ||
341 | config.writeEntry( "Zoom In", zoomin->isChecked()); | 369 | config.writeEntry( "Zoom In", zoomin->isChecked()); |
342 | config.writeEntry( "Zoom Out", zoomout->isChecked()); | 370 | config.writeEntry( "Zoom Out", zoomout->isChecked()); |
343 | config.writeEntry( "Set Font", setfont->isChecked()); | 371 | config.writeEntry( "Set Font", setfont->isChecked()); |
344 | config.writeEntry("Encoding Select", encoding->isChecked()); | 372 | config.writeEntry("Encoding Select", encoding->isChecked()); |
345 | config.writeEntry("Ideogram Mode", ideogram->isChecked()); | 373 | config.writeEntry("Ideogram Mode", ideogram->isChecked()); |
346 | } | 374 | } |
@@ -409,24 +437,19 @@ CMarkBarPrefs::~CMarkBarPrefs() | |||
409 | } | 437 | } |
410 | 438 | ||
411 | CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) | 439 | CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) |
412 | : QWidget( parent, name, fl ) | 440 | : QWidget( parent, name, fl ) |
413 | { | 441 | { |
414 | 442 | ||
415 | QGridLayout* hl = new QGridLayout(this,1,2); | 443 | QGridLayout* hl = new QGridLayout(this,2,2); |
416 | 444 | ||
417 | hl->setMargin( 0 ); | 445 | hl->setMargin( 0 ); |
418 | 446 | ||
419 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Dialogs", this); | 447 | QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Dialogs", this); |
420 | floating = new QCheckBox(gb); | 448 | floating = new QCheckBox(gb); |
421 | floating->setText(tr("Floating")); | 449 | floating->setText(tr("Floating")); |
422 | |||
423 | // QLabel* TextLabel = new QLabel( gb ); | ||
424 | // TextLabel->setText( tr( "Select Button" ) ); | ||
425 | |||
426 | |||
427 | hl->addWidget( gb, 0, 0 ); | 450 | hl->addWidget( gb, 0, 0 ); |
428 | 451 | ||
429 | 452 | ||
430 | gb = new QGroupBox(1, Qt::Horizontal, "Bars (Restart)", this); | 453 | gb = new QGroupBox(1, Qt::Horizontal, "Bars (Restart)", this); |
431 | 454 | ||
432 | // QLabel* ql = new QLabel("Restart to apply changes", gb); | 455 | // QLabel* ql = new QLabel("Restart to apply changes", gb); |
@@ -436,15 +459,20 @@ CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
436 | #ifdef USECOMBO | 459 | #ifdef USECOMBO |
437 | tbpolicy = new QComboBox(gb); | 460 | tbpolicy = new QComboBox(gb); |
438 | #else | 461 | #else |
439 | tbpolicy = new MenuButton(gb); | 462 | tbpolicy = new MenuButton(gb); |
440 | #endif | 463 | #endif |
441 | tbpolicy->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); | 464 | tbpolicy->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); |
465 | #ifdef USEQPE | ||
442 | tbpolicy->insertItem(tr("Single bar")); | 466 | tbpolicy->insertItem(tr("Single bar")); |
443 | tbpolicy->insertItem(tr("Menu/tool bar")); | 467 | tbpolicy->insertItem(tr("Menu/tool bar")); |
444 | tbpolicy->insertItem(tr("Multiple bars")); | 468 | tbpolicy->insertItem(tr("Multiple bars")); |
469 | #else | ||
470 | tbpolicy->insertItem(tr("Single bar")); | ||
471 | tbpolicy->insertItem(tr("Multiple bars")); | ||
472 | #endif | ||
445 | 473 | ||
446 | #ifdef USECOMBO | 474 | #ifdef USECOMBO |
447 | tbposition = new QComboBox(gb); | 475 | tbposition = new QComboBox(gb); |
448 | #else | 476 | #else |
449 | tbposition = new MenuButton(gb); | 477 | tbposition = new MenuButton(gb); |
450 | #endif | 478 | #endif |
@@ -452,16 +480,44 @@ CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) | |||
452 | tbposition->insertItem(tr("Bottom")); | 480 | tbposition->insertItem(tr("Bottom")); |
453 | tbposition->insertItem(tr("Right")); | 481 | tbposition->insertItem(tr("Right")); |
454 | tbposition->insertItem(tr("Left")); | 482 | tbposition->insertItem(tr("Left")); |
455 | tbposition->insertItem(tr("Minimised")); | 483 | tbposition->insertItem(tr("Minimised")); |
456 | 484 | ||
457 | tbmovable = new QCheckBox( tr("Movable"), gb ); | 485 | tbmovable = new QCheckBox( tr("Movable"), gb ); |
458 | // ch->setChecked(config.readBoolEntry( "Movable", false )); | ||
459 | 486 | ||
460 | hl->addWidget(gb, 0, 1); | 487 | hl->addWidget(gb, 0, 1); |
461 | 488 | ||
489 | gb = new QGroupBox(1, Qt::Horizontal, "QT Scroll Bar", this); | ||
490 | |||
491 | #ifdef USECOMBO | ||
492 | qtscroll = new QComboBox(gb); | ||
493 | #else | ||
494 | qtscroll = new MenuButton(gb); | ||
495 | #endif | ||
496 | qtscroll->insertItem(tr("None")); | ||
497 | qtscroll->insertItem(tr("Right")); | ||
498 | qtscroll->insertItem(tr("Left")); | ||
499 | |||
500 | hl->addWidget(gb, 1, 0); | ||
501 | gb = new QGroupBox(1, Qt::Horizontal, "Miniscroll", this); | ||
502 | |||
503 | #ifdef USECOMBO | ||
504 | localscroll = new QComboBox(gb); | ||
505 | #else | ||
506 | localscroll = new MenuButton(gb); | ||
507 | #endif | ||
508 | localscroll->insertItem(tr("None")); | ||
509 | localscroll->insertItem(tr("Bottom")); | ||
510 | localscroll->insertItem(tr("Right")); | ||
511 | localscroll->insertItem(tr("Left")); | ||
512 | |||
513 | //scrollonleft = new QCheckBox( tr("... on Left"), gb ); | ||
514 | // ch->setChecked(config.readBoolEntry( "Movable", false )); | ||
515 | |||
516 | hl->addWidget(gb, 1, 1); | ||
517 | |||
462 | } | 518 | } |
463 | 519 | ||
464 | CMiscBarPrefs::~CMiscBarPrefs() | 520 | CMiscBarPrefs::~CMiscBarPrefs() |
465 | { | 521 | { |
466 | // no need to delete child widgets, Qt does it all for us | 522 | // no need to delete child widgets, Qt does it all for us |
467 | } | 523 | } |