summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ToolbarPrefs.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/ToolbarPrefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ToolbarPrefs.cpp76
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
@@ -1,50 +1,58 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'Prefs.ui' 2** Form implementation generated from reading ui file 'Prefs.ui'
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
18CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) 27CBarPrefs::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);
23 filebar = new CFileBarPrefs(config, this); 32 filebar = new CFileBarPrefs(config, this);
24 navbar = new CNavBarPrefs(config, this); 33 navbar = new CNavBarPrefs(config, this);
25 viewbar = new CViewBarPrefs(config, this); 34 viewbar = new CViewBarPrefs(config, this);
26 markbar = new CMarkBarPrefs(config, this); 35 markbar = new CMarkBarPrefs(config, this);
27 indbar = new CIndBarPrefs(config, this); 36 indbar = new CIndBarPrefs(config, this);
28 td->addTab(filebar, tr("File")); 37 td->addTab(filebar, tr("File"));
29 td->addTab(navbar, tr("Navigation")); 38 td->addTab(navbar, tr("Navigation"));
30 td->addTab(viewbar, tr("View")); 39 td->addTab(viewbar, tr("View"));
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/*
42CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) 50CBarPrefs1::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{
45 config.setGroup( "Toolbar" ); 53 config.setGroup( "Toolbar" );
46 QVBoxLayout* vb = new QVBoxLayout(this); 54 QVBoxLayout* vb = new QVBoxLayout(this);
47 55
48 QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this); 56 QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this);
49 vb->addWidget(bg); 57 vb->addWidget(bg);
50 58
@@ -112,24 +120,32 @@ CBarPrefs2::CBarPrefs2( Config& _config, QWidget* parent, const char* name, WFl
112 : QWidget( parent, name, fl ), config(_config) 120 : QWidget( parent, name, fl ), config(_config)
113{ 121{
114 QVBoxLayout* vb = new QVBoxLayout(this); 122 QVBoxLayout* vb = new QVBoxLayout(this);
115 123
116 QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "View", this); 124 QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "View", this);
117 vb->addWidget(bg); 125 vb->addWidget(bg);
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) ) );
130 146
131 encoding = new QCheckBox( tr("Encoding"), bg ); 147 encoding = new QCheckBox( tr("Encoding"), bg );
132 encoding->setChecked(config.readBoolEntry("Encoding Select", false)); 148 encoding->setChecked(config.readBoolEntry("Encoding Select", false));
133 connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); 149 connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) );
134 ideogram = new QCheckBox( tr("Ideogram"), bg ); 150 ideogram = new QCheckBox( tr("Ideogram"), bg );
135 ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false)); 151 ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false));
@@ -168,24 +184,26 @@ CBarPrefs2::CBarPrefs2( Config& _config, QWidget* parent, const char* name, WFl
168 bg = new QGroupBox(1, Qt::Horizontal, "Indicators", this); 184 bg = new QGroupBox(1, Qt::Horizontal, "Indicators", this);
169 vb->addWidget(bg); 185 vb->addWidget(bg);
170 indannotate = new QCheckBox( tr("Annotation"), bg ); 186 indannotate = new QCheckBox( tr("Annotation"), bg );
171 indannotate->setChecked(config.readBoolEntry( "Annotation indicator", false )); 187 indannotate->setChecked(config.readBoolEntry( "Annotation indicator", false ));
172 connect(indannotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); 188 connect(indannotate, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) );
173 m_isChanged = false; 189 m_isChanged = false;
174} 190}
175 191
176void CBarPrefs2::saveall() 192void 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());
186 config.writeEntry( "Annotate", annotate->isChecked()); 204 config.writeEntry( "Annotate", annotate->isChecked());
187 config.writeEntry( "Goto", go_to->isChecked()); 205 config.writeEntry( "Goto", go_to->isChecked());
188 config.writeEntry( "Delete", Delete->isChecked()); 206 config.writeEntry( "Delete", Delete->isChecked());
189 config.writeEntry( "Autogen", autogen->isChecked()); 207 config.writeEntry( "Autogen", autogen->isChecked());
190 config.writeEntry( "Clear", clear->isChecked()); 208 config.writeEntry( "Clear", clear->isChecked());
191 config.writeEntry( "Save", save->isChecked()); 209 config.writeEntry( "Save", save->isChecked());
@@ -306,47 +324,57 @@ CViewBarPrefs::CViewBarPrefs( Config& _config, QWidget* parent, const char* nam
306 : QWidget( parent, name, fl ), config(_config) 324 : QWidget( parent, name, fl ), config(_config)
307{ 325{
308 QVBoxLayout* vb = new QVBoxLayout(this); 326 QVBoxLayout* vb = new QVBoxLayout(this);
309 327
310 QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "View", this); 328 QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "View", this);
311 vb->addWidget(bg); 329 vb->addWidget(bg);
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) ) );
324 setfont = new QCheckBox( tr("Set Font"), bg ); 350 setfont = new QCheckBox( tr("Set Font"), bg );
325 setfont->setChecked(config.readBoolEntry( "Set Font", false )); 351 setfont->setChecked(config.readBoolEntry( "Set Font", false ));
326 connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); 352 connect(setfont, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) );
327 353
328 encoding = new QCheckBox( tr("Encoding"), bg ); 354 encoding = new QCheckBox( tr("Encoding"), bg );
329 encoding->setChecked(config.readBoolEntry("Encoding Select", false)); 355 encoding->setChecked(config.readBoolEntry("Encoding Select", false));
330 connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); 356 connect(encoding, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) );
331 ideogram = new QCheckBox( tr("Ideogram"), bg ); 357 ideogram = new QCheckBox( tr("Ideogram"), bg );
332 ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false)); 358 ideogram->setChecked(config.readBoolEntry("Ideogram Mode", false));
333 connect(ideogram, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) ); 359 connect(ideogram, SIGNAL(stateChanged(int)), this, SLOT( isChanged(int) ) );
334 m_isChanged = false; 360 m_isChanged = false;
335} 361}
336 362
337void CViewBarPrefs::saveall() 363void 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}
347 375
348CViewBarPrefs::~CViewBarPrefs() 376CViewBarPrefs::~CViewBarPrefs()
349{ 377{
350} 378}
351 379
352CMarkBarPrefs::CMarkBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) 380CMarkBarPrefs::CMarkBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl )
@@ -403,71 +431,99 @@ void CMarkBarPrefs::saveall()
403 config.writeEntry( "Start Block", startblock->isChecked()); 431 config.writeEntry( "Start Block", startblock->isChecked());
404 config.writeEntry( "Copy Block", copyblock->isChecked()); 432 config.writeEntry( "Copy Block", copyblock->isChecked());
405} 433}
406 434
407CMarkBarPrefs::~CMarkBarPrefs() 435CMarkBarPrefs::~CMarkBarPrefs()
408{ 436{
409} 437}
410 438
411CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl ) 439CMiscBarPrefs::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);
433// TextLabel = new QLabel( gb ); 456// TextLabel = new QLabel( gb );
434// TextLabel->setText( tr( "Policy" ) ); 457// TextLabel->setText( tr( "Policy" ) );
435 458
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
451 tbposition->insertItem(tr("Top")); 479 tbposition->insertItem(tr("Top"));
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
464CMiscBarPrefs::~CMiscBarPrefs() 520CMiscBarPrefs::~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}
468 524
469 525
470CIndBarPrefs::CIndBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl ) 526CIndBarPrefs::CIndBarPrefs( Config& _config, QWidget* parent, const char* name, WFlags fl )
471 : QWidget( parent, name, fl ), config(_config) 527 : QWidget( parent, name, fl ), config(_config)
472{ 528{
473 QVBoxLayout* vb = new QVBoxLayout(this); 529 QVBoxLayout* vb = new QVBoxLayout(this);