Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Prefs.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'Prefs.ui'
00003 **
00004 ** Created: Tue Feb 11 23:53:35 2003
00005 **      by:  The User Interface Compiler (uic)
00006 **
00007 ** WARNING! All changes made in this file will be lost!
00008 ****************************************************************************/
00009 #include "Prefs.h"
00010 
00011 #include <stdlib.h>
00012 
00013 #include <qcheckbox.h>
00014 #include <qlabel.h>
00015 #include <qpushbutton.h>
00016 #include <qspinbox.h>
00017 #include <qlayout.h>
00018 #include <qvariant.h>
00019 #include <qtooltip.h>
00020 #include <qwhatsthis.h>
00021 #include <qbuttongroup.h>
00022 #include <qlineedit.h>
00023 #include <qdir.h>
00024 #ifdef USECOMBO
00025 #include <qcombobox.h>
00026 #else
00027 #include <qpe/menubutton.h>
00028 #endif
00029 #include <qfontdatabase.h>
00030 
00031 #ifdef USECOMBO
00032 void populate_colours(QComboBox *mb)
00033 #else
00034 void populate_colours(MenuButton *mb)
00035 #endif
00036 {
00037     mb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00038     mb->insertItem("White");
00039     mb->insertItem("Black");
00040     mb->insertItem("Dark Gray");
00041     mb->insertItem("Gray");
00042     mb->insertItem("Light Gray");
00043     mb->insertItem("Red");
00044     mb->insertItem("Green");
00045     mb->insertItem("Blue");
00046     mb->insertItem("Cyan");
00047     mb->insertItem("Magenta");
00048     mb->insertItem("Yellow");
00049     mb->insertItem("Dark Red");
00050     mb->insertItem("Dark Green");
00051     mb->insertItem("Dark Blue");
00052     mb->insertItem("Dark Cyan");
00053     mb->insertItem("Dark Magenta");
00054     mb->insertItem("Dark Yellow");
00055 }
00056 
00057 CLayoutPrefs::CLayoutPrefs( QWidget* parent,  const char* name, WFlags fl )
00058     : QWidget( parent, name, fl )
00059 {
00060     QHBoxLayout* hb = new QHBoxLayout(this);
00061     QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this);
00062     hb->addWidget(bg);
00063 
00064     StripCR = new QCheckBox( bg );
00065     StripCR->setText( tr( "Strip CR" ) );
00066 
00067     Dehyphen = new QCheckBox( bg );
00068     Dehyphen->setText( tr( "Dehyphen" ) );
00069 
00070     SingleSpace = new QCheckBox( bg );
00071     SingleSpace->setText( tr( "Single Space" ) );
00072 
00073     Unindent = new QCheckBox( bg );
00074     Unindent->setText( tr( "Unindent" ) );
00075 
00076     Reparagraph = new QCheckBox( bg );
00077     Reparagraph->setText( tr( "Reparagraph" ) );
00078 
00079     DoubleSpace = new QCheckBox( bg );
00080     DoubleSpace->setText( tr( "Double Space" ) );
00081 
00082     Remap = new QCheckBox( bg );
00083     Remap->setText( tr( "Remap" ) );
00084 
00085     Embolden = new QCheckBox( bg );
00086     Embolden->setText( tr( "Embolden" ) );
00087 
00088     FullJustify = new QCheckBox( bg );
00089     FullJustify->setText( tr( "Full Justify" ) );
00090 
00091     FixGraphics = new QCheckBox( bg );
00092     FixGraphics->setText( tr( "Fix Graphic Size" ) );
00093 
00094     hyphenate = new QCheckBox( bg );
00095     hyphenate->setText( tr( "Hyphenate" ) );
00096 
00097     /*
00098     customhyphen = new QCheckBox( bg );
00099     customhyphen->setText( tr( "Custom Hyphen'n" ) );
00100     */
00101 
00102     prepalm = new QCheckBox( bg );
00103     prepalm->setText( tr( "Repalm(Baen)" ) );
00104 
00105     pkern = new QCheckBox( bg );
00106     pkern->setText( tr( "Kern" ) );
00107 
00108     InlineTables = new QCheckBox( bg );
00109     InlineTables->setText( tr( "Inline Tables" ) );
00110 
00111     Underlinelinks = new QCheckBox( bg );
00112     Underlinelinks->setText( tr( "Underline Links" ) );
00113     /*
00114     Negative = new QCheckBox( bg );
00115     Negative->setText( tr( "Negative" ) );
00116     */
00117 
00118     //    Inverse = new QCheckBox( bg );
00119     //    Inverse->setText( tr( "Inverse" ) );
00120 }
00121 
00122 /*  
00123  *  Destroys the object and frees any allocated resources
00124  */
00125 CLayoutPrefs::~CLayoutPrefs()
00126 {
00127     // no need to delete child widgets, Qt does it all for us
00128 }
00129 
00130 
00131 
00132 CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent,  const char* name, WFlags fl )
00133     : QWidget( parent, name, fl )
00134 {
00135     
00136     QVBoxLayout* vb = new QVBoxLayout(this);
00137     QGridLayout* gl = new QGridLayout(vb, 4, 5);
00138 
00139     QLabel *TextLabel;
00140 
00141     TextLabel = new QLabel( this );
00142     TextLabel->setText( tr( "Page\nOverlap" ) );
00143     gl->addWidget(TextLabel, 0, 0);
00144     pageoverlap = new QSpinBox( this );
00145     pageoverlap->setRange(0,20);
00146     gl->addWidget(pageoverlap, 0, 1);
00147 
00148     TextLabel = new QLabel( this, "TextLabel1" );
00149     TextLabel->setText( tr( "Indent" ) );
00150     gl->addWidget(TextLabel, 1, 0);
00151     Indent = new QSpinBox( this, "Indent" );
00152     Indent->setRange(0,20);
00153     gl->addWidget(Indent, 1, 1);
00154 
00155 
00156 
00157     TextLabel = new QLabel( this );
00158     TextLabel->setText( tr( "Graphics\nZoom" ) );
00159     gl->addWidget(TextLabel, 1, 2);
00160     gfxzoom = new QSpinBox( this );
00161     gfxzoom->setRange(0,2000);
00162     gfxzoom->setLineStep(10);
00163     gfxzoom->setSuffix("%");
00164     gl->addWidget(gfxzoom, 1, 3);
00165 
00166     TextLabel = new QLabel( this, "TextLabel4" );
00167     TextLabel->setText( tr( "Top\nMargin" ) );
00168     gl->addWidget(TextLabel, 2, 0);
00169     TopMargin = new QSpinBox( this, "TMargin" );
00170     TopMargin->setRange(0, 1000);
00171     gl->addWidget(TopMargin, 2, 1);
00172 
00173     TextLabel = new QLabel( this );
00174     TextLabel->setText( tr( "Bottom\nMargin" ) );
00175     gl->addWidget(TextLabel, 2, 2);
00176     BottomMargin = new QSpinBox( this, "BMargin" );
00177     BottomMargin->setRange(0, 1000);
00178     gl->addWidget(BottomMargin, 2, 3);
00179 
00180     TextLabel = new QLabel( this, "TextLabel4" );
00181     TextLabel->setText( tr( "Left\nMargin" ) );
00182     gl->addWidget(TextLabel, 3, 0);
00183     LeftMargin = new QSpinBox( this, "LMargin" );
00184     LeftMargin->setRange(0, 1000);
00185     gl->addWidget(LeftMargin, 3, 1);
00186 
00187     TextLabel = new QLabel( this );
00188     TextLabel->setText( tr( "Right\nMargin" ) );
00189     gl->addWidget(TextLabel, 3, 2);
00190     RightMargin = new QSpinBox( this, "RMargin" );
00191     RightMargin->setRange(0, 1000);
00192     gl->addWidget(RightMargin, 3, 3);
00193 
00194     TextLabel = new QLabel( this );
00195     TextLabel->setText( tr( "Paragraph\nLeading" ) );
00196     gl->addWidget(TextLabel, 4, 0);
00197     ParaLead = new QSpinBox( this );
00198     ParaLead->setRange(-5, 50);
00199     gl->addWidget(ParaLead, 4, 1);
00200 
00201     TextLabel = new QLabel( this );
00202     TextLabel->setText( tr( "Line\nLeading" ) );
00203     gl->addWidget(TextLabel, 4, 2);
00204     LineLead = new QSpinBox( this );
00205     LineLead->setRange(-5, 50);
00206     gl->addWidget(LineLead, 4, 3);
00207 
00208     gl = new QGridLayout(vb, 2, 2);
00209 
00210     TextLabel = new QLabel( this);
00211     TextLabel->setText( tr( "Markup" ) );
00212     gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom);
00213     TextLabel = new QLabel( this);
00214     TextLabel->setText( tr( "Font" ) );
00215     gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom);
00216 
00217 
00218 #ifdef USECOMBO
00219     Markup = new QComboBox( this);
00220 #else
00221     Markup = new MenuButton( this);
00222 #endif
00223     Markup->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00224     Markup->insertItem("Auto");
00225     Markup->insertItem("None");
00226     Markup->insertItem("Text");
00227     Markup->insertItem("HTML");
00228     Markup->insertItem("PML");
00229     gl->addWidget(Markup, 1, 0, Qt::AlignTop);
00230 
00231 #ifdef USECOMBO
00232     fontselector = new QComboBox( this);
00233 #else
00234     fontselector = new MenuButton( this);
00235 #endif
00236     fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00237     {
00238         QFontDatabase f;
00239         QStringList flist = f.families();
00240         for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
00241         {
00242             fontselector->insertItem(*nm);
00243         }
00244     } // delete the FontDatabase!!!
00245     gl->addWidget(fontselector, 1, 1, Qt::AlignTop);
00246 
00247 #ifdef USECOMBO
00248     bgsel = new QComboBox( this );
00249 #else
00250     bgsel = new MenuButton( this );
00251 #endif
00252     populate_colours(bgsel);
00253 
00254 #ifdef USECOMBO
00255     fgsel = new QComboBox( this );
00256 #else
00257     fgsel = new MenuButton( this );
00258 #endif
00259     populate_colours(fgsel);
00260     gl = new QGridLayout(vb, 2, 2);
00261 
00262     TextLabel = new QLabel( this);
00263     TextLabel->setText( tr( "Background" ) );
00264     gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom);
00265     TextLabel = new QLabel( this);
00266     TextLabel->setText( tr( "Foreground" ) );
00267     gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom);
00268 
00269     gl->addWidget(bgsel, 1, 0, Qt::AlignTop);
00270     gl->addWidget(fgsel, 1, 1, Qt::AlignTop);
00271 
00272 }
00273 /*
00274 CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent,  const char* name, WFlags fl )
00275     : QWidget( parent, name, fl )
00276 {
00277     
00278     QVBoxLayout* vb = new QVBoxLayout(this);
00279     QGridLayout* gl = new QGridLayout(vb, 4, 3);
00280 
00281     QLabel *TextLabel;
00282 
00283     TextLabel = new QLabel( this, "TextLabel1" );
00284     TextLabel->setText( tr( "Indent" ) );
00285     gl->addWidget(TextLabel, 0, 0);
00286 
00287 
00288     TextLabel = new QLabel( this );
00289     TextLabel->setText( tr( "Page\nOverlap" ) );
00290     gl->addWidget(TextLabel, 0, 1);
00291 
00292     TextLabel = new QLabel( this );
00293     TextLabel->setText( tr( "Graphics\nZoom" ) );
00294     gl->addWidget(TextLabel, 0, 2);
00295 
00296     Indent = new QSpinBox( this, "Indent" );
00297     Indent->setRange(0,20);
00298     gl->addWidget(Indent, 1, 0);
00299 
00300     pageoverlap = new QSpinBox( this );
00301     pageoverlap->setRange(0,20);
00302     gl->addWidget(pageoverlap, 1, 1);
00303 
00304     gfxzoom = new QSpinBox( this );
00305     gfxzoom->setRange(0,100);
00306     gl->addWidget(gfxzoom, 1, 2);
00307 
00308     TextLabel = new QLabel( this, "TextLabel4" );
00309     TextLabel->setText( tr( "Margin" ) );
00310     gl->addWidget(TextLabel, 2, 0);
00311 
00312     TextLabel = new QLabel( this );
00313     TextLabel->setText( tr( "Paragraph\nLeading" ) );
00314     gl->addWidget(TextLabel, 2, 1);
00315 
00316     TextLabel = new QLabel( this );
00317     TextLabel->setText( tr( "Line\nLeading" ) );
00318     gl->addWidget(TextLabel, 2, 2);
00319 
00320     Margin = new QSpinBox( this, "Margin" );
00321     Margin->setRange(0, w/2);
00322     gl->addWidget(Margin, 3, 0);
00323 
00324     ParaLead = new QSpinBox( this );
00325     ParaLead->setRange(-5, 50);
00326     gl->addWidget(ParaLead, 3, 1);
00327 
00328     LineLead = new QSpinBox( this );
00329     LineLead->setRange(-5, 50);
00330     gl->addWidget(LineLead, 3, 2);
00331 
00332     gl = new QGridLayout(vb, 2, 2);
00333 
00334     TextLabel = new QLabel( this);
00335     TextLabel->setText( tr( "Markup" ) );
00336     gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom);
00337     TextLabel = new QLabel( this);
00338     TextLabel->setText( tr( "Font" ) );
00339     gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom);
00340 
00341 
00342 #ifdef USECOMBO
00343     Markup = new QComboBox( this);
00344 #else
00345     Markup = new MenuButton( this);
00346 #endif
00347     Markup->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00348     Markup->insertItem("Auto");
00349     Markup->insertItem("None");
00350     Markup->insertItem("Text");
00351     Markup->insertItem("HTML");
00352     Markup->insertItem("PML");
00353     gl->addWidget(Markup, 1, 0, Qt::AlignTop);
00354 
00355 #ifdef USECOMBO
00356     fontselector = new QComboBox( this);
00357 #else
00358     fontselector = new MenuButton( this);
00359 #endif
00360     fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00361     {
00362         QFontDatabase f;
00363         QStringList flist = f.families();
00364         for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
00365         {
00366             fontselector->insertItem(*nm);
00367         }
00368     } // delete the FontDatabase!!!
00369     gl->addWidget(fontselector, 1, 1, Qt::AlignTop);
00370 
00371 #ifdef USECOMBO
00372     bgsel = new QComboBox( this );
00373 #else
00374     bgsel = new MenuButton( this );
00375 #endif
00376     populate_colours(bgsel);
00377 
00378 #ifdef USECOMBO
00379     fgsel = new QComboBox( this );
00380 #else
00381     fgsel = new MenuButton( this );
00382 #endif
00383     populate_colours(fgsel);
00384     gl = new QGridLayout(vb, 2, 2);
00385 
00386     TextLabel = new QLabel( this);
00387     TextLabel->setText( tr( "Background" ) );
00388     gl->addWidget(TextLabel, 0, 0, Qt::AlignBottom);
00389     TextLabel = new QLabel( this);
00390     TextLabel->setText( tr( "Foreground" ) );
00391     gl->addWidget(TextLabel, 0, 1, Qt::AlignBottom);
00392 
00393     gl->addWidget(bgsel, 1, 0, Qt::AlignTop);
00394     gl->addWidget(fgsel, 1, 1, Qt::AlignTop);
00395 
00396 }
00397 */
00398 /*
00399 CLayoutPrefs2::CLayoutPrefs2( QWidget* parent,  const char* name, WFlags fl )
00400     : QWidget( parent, name, fl )
00401 {
00402     QHBoxLayout* hb = new QHBoxLayout(this);
00403 
00404     QVBoxLayout* vb = new QVBoxLayout;
00405     hb->addLayout(vb);
00406 
00407     QLabel *TextLabel;
00408 
00409     TextLabel = new QLabel( this, "TextLabel1" );
00410     TextLabel->setText( tr( "Indent" ) );
00411     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00412     Indent = new QSpinBox( this, "Indent" );
00413     Indent->setRange(0,20);
00414     vb->addWidget( Indent, 0, Qt::AlignLeft );
00415 
00416     TextLabel = new QLabel( this );
00417     TextLabel->setText( tr( "Page\nOverlap" ) );
00418     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00419     pageoverlap = new QSpinBox( this );
00420     pageoverlap->setRange(0,20);
00421     vb->addWidget( pageoverlap, 0, Qt::AlignLeft );
00422 
00423     TextLabel = new QLabel( this );
00424     TextLabel->setText( tr( "Graphics\nZoom" ) );
00425     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00426     gfxzoom = new QSpinBox( this );
00427     gfxzoom->setRange(0,100);
00428     vb->addWidget( gfxzoom, 0, Qt::AlignLeft );
00429 
00430     vb->addStretch();
00431 
00432     vb = new QVBoxLayout;
00433     hb->addLayout(vb);
00434 
00435     TextLabel = new QLabel( this, "TextLabel4" );
00436     TextLabel->setText( tr( "Margin" ) );
00437     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00438     Margin = new QSpinBox( this, "Margin" );
00439     Margin->setRange(0, 100);
00440     vb->addWidget( Margin, 0, Qt::AlignLeft );
00441 
00442     TextLabel = new QLabel( this );
00443     TextLabel->setText( tr( "Paragraph\nLeading" ) );
00444     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00445     ParaLead = new QSpinBox( this );
00446     ParaLead->setRange(-5, 50);
00447     vb->addWidget( ParaLead, 0, Qt::AlignLeft );
00448 
00449     TextLabel = new QLabel( this );
00450     TextLabel->setText( tr( "Line\nLeading" ) );
00451     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00452     LineLead = new QSpinBox( this );
00453     LineLead->setRange(-5, 50);
00454     vb->addWidget( LineLead, 0, Qt::AlignLeft );
00455 
00456     vb->addStretch();
00457 
00458     vb = new QVBoxLayout;
00459     hb->addLayout(vb);
00460 
00461 
00462     TextLabel = new QLabel( this);
00463     TextLabel->setText( tr( "Markup" ) );
00464     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00465     Markup = new MenuButton( this);
00466     Markup->insertItem("Auto");
00467     Markup->insertItem("None");
00468     Markup->insertItem("Text");
00469     Markup->insertItem("HTML");
00470     Markup->insertItem("PML");
00471     vb->addWidget( Markup, 0, Qt::AlignLeft );
00472 
00473     TextLabel = new QLabel( this);
00474     TextLabel->setText( tr( "Font" ) );
00475     vb->addWidget( TextLabel, 0, Qt::AlignBottom );
00476     fontselector = new MenuButton( this);
00477     fontselector->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00478     {
00479         FontDatabase f;
00480         QStringList flist = f.families();
00481         for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
00482         {
00483             fontselector->insertItem(*nm);
00484         }
00485     } // delete the FontDatabase!!!
00486     vb->addWidget( fontselector, 0, Qt::AlignLeft );
00487 
00488     vb->addStretch();
00489 }
00490 */
00491 /*  
00492  *  Destroys the object and frees any allocated resources
00493  */
00494 CLayoutPrefs2::~CLayoutPrefs2()
00495 {
00496     // no need to delete child widgets, Qt does it all for us
00497 }
00498 
00499 /*
00500 CPluckerPrefs::CPluckerPrefs( QWidget* parent,  const char* name, WFlags fl )
00501     : QWidget( parent, name, fl )
00502 {
00503     Layout11 = new QVBoxLayout(this); 
00504     Layout11->setMargin( 0 );
00505 
00506     Depluck = new QCheckBox( this, "Depluck" );
00507     Depluck->setText( tr( "Depluck" ) );
00508     Layout11->addWidget( Depluck );
00509 
00510     Dejpluck = new QCheckBox( this, "Dejpluck" );
00511     Dejpluck->setText( tr( "Dejpluck" ) );
00512     Layout11->addWidget( Dejpluck );
00513 
00514     Continuous = new QCheckBox( this, "Continuous" );
00515     Continuous->setText( tr( "Continuous" ) );
00516     Layout11->addWidget( Continuous );
00517 
00518 }
00519 
00520 CPluckerPrefs::~CPluckerPrefs()
00521 {
00522     // no need to delete child widgets, Qt does it all for us
00523 }
00524 */
00525 /*
00526 CMiscPrefs::CMiscPrefs( QWidget* parent,  const char* name, WFlags fl )
00527     : QWidget( parent, name, fl )
00528 {
00529 
00530     QVBoxLayout* Layout11 = new QVBoxLayout(this); 
00531     Layout11->setMargin( 0 );
00532 
00533 
00534     QHBoxLayout* hl = new QHBoxLayout;
00535 
00536     QLabel* TextLabel = new QLabel( this );
00537     TextLabel->setText( tr( "Action for\nSelect Button" ) );
00538     hl->addWidget(TextLabel);
00539 
00540     action = new QComboBox( this );
00541     action->insertItem("Open file");
00542     action->insertItem("Autoscroll");
00543     action->insertItem("Mark");
00544     action->insertItem("Annotate");
00545     action->insertItem("Fullscreen");
00546     hl->addWidget( action );
00547 
00548     Layout11->addLayout(hl);
00549 
00550     hl = new QHBoxLayout;
00551 
00552     TextLabel = new QLabel( this );
00553     TextLabel->setText( tr( "Dictionary\nApplication" ) );
00554     hl->addWidget(TextLabel);
00555     target = new QLineEdit(this);
00556     hl->addWidget( target );
00557 
00558     Layout11->addLayout(hl);
00559 
00560 
00561     QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Selection Target", this);
00562     Layout11->addWidget( bg );
00563 
00564     annotation = new QCheckBox( bg );
00565     annotation->setText( tr( "Annotation" ) );
00566 
00567     dictionary = new QCheckBox( bg );
00568     dictionary->setText( tr( "Dictionary" ) );
00569 
00570     clipboard = new QCheckBox( bg );
00571     clipboard->setText( tr( "Clipboard" ) );
00572 
00573     QCheckBox* outcodec = new QCheckBox( bg );
00574     outcodec->setText( tr( "Output" ) );
00575 
00576 }
00577 
00578 CMiscPrefs::~CMiscPrefs()
00579 {
00580     // no need to delete child widgets, Qt does it all for us
00581 }
00582 */
00583 
00584 CMiscPrefs::CMiscPrefs( QWidget* parent,  const char* name, WFlags fl )
00585     : QWidget( parent, name, fl )
00586 {
00587 
00588   QVBoxLayout* vl = new QVBoxLayout(this);
00589     QHBoxLayout* hl = new QHBoxLayout;
00590     vl->addLayout(hl);
00591 
00592     vl->setMargin( 0 );
00593     hl->setMargin( 0 );
00594 
00595     QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this);
00596     hl->addWidget( gb );
00597 
00598     annotation = new QCheckBox( gb );
00599     annotation->setText( tr( "Annotation" ) );
00600 
00601     dictionary = new QCheckBox( gb );
00602     dictionary->setText( tr( "Dictionary" ) );
00603 
00604     clipboard = new QCheckBox( gb );
00605     clipboard->setText( tr( "Clipboard" ) );
00606 
00607     boutput = new QCheckBox( gb );
00608     boutput->setText( tr( "Output" ) );
00609 
00610     QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this);
00611     hl->addWidget( bg );
00612 
00613     Depluck = new QCheckBox( bg );
00614     Depluck->setText( tr( "Depluck" ) );
00615 
00616     Dejpluck = new QCheckBox( bg );
00617     Dejpluck->setText( tr( "Dejpluck" ) );
00618 
00619     Continuous = new QCheckBox( bg );
00620     Continuous->setText( tr( "Continuous" ) );
00621     bg = new QButtonGroup(2, Qt::Horizontal, "Background", this);
00622     vl->addWidget( bg );
00623 
00624 //    QLabel* TextLabel = new QLabel( bg );
00625 //    TextLabel->setText( tr( "Copy an image to \"background\" in\n~/Applications/uqtreader/Theme/" ) );
00626 
00627 #ifdef USECOMBO
00628     bgtype = new QComboBox( bg );
00629 #else
00630     bgtype = new MenuButton( this);
00631 #endif
00632     bgtype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00633 
00634     bgtype->insertItem( tr("Centred") );
00635     bgtype->insertItem( tr("Tiled") );
00636     bgtype->insertItem( tr("Fitted") );
00637 
00638     DoubleBuffer = new QCheckBox( bg );
00639     DoubleBuffer->setText( tr( "Double Buffer" ) );
00640 
00641     QLabel* TextLabel = new QLabel( bg );
00642     TextLabel->setText( tr( "Minibar Colour" ) );
00643 #ifdef USECOMBO
00644     minibarcol = new QComboBox( bg );
00645 #else
00646     minibarcol = new MenuButton( this);
00647 #endif
00648     populate_colours(minibarcol);
00649     minibarcol->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00650 }
00651 
00652 CMiscPrefs::~CMiscPrefs()
00653 {
00654     // no need to delete child widgets, Qt does it all for us
00655 }
00656 
00657 CScrollPrefs::CScrollPrefs( QWidget* parent,  const char* name, WFlags fl )
00658     : QWidget( parent, name, fl )
00659 {
00660 
00661     QHBoxLayout* hl = new QHBoxLayout(this);
00662 
00663     hl->setMargin( 0 );
00664 
00665     QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this);
00666     hl->addWidget( bg );
00667 
00668     //    scrollinplace = new QCheckBox( bg );
00669     //    scrollinplace->setText( tr( "In Place" ) );
00670     QLabel* TextLabel = new QLabel( bg );
00671     TextLabel->setText( tr( "Scroll step" ) );
00672     //    gl->addWidget(TextLabel, 2, 0);
00673     scrollstep = new QSpinBox( bg );
00674     scrollstep->setRange(1, 10);
00675     scrollstep->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00676 
00677     TextLabel = new QLabel( bg );
00678     TextLabel->setText( tr( "Scroll type" ) );
00679 #ifdef USECOMBO
00680     scrolltype = new QComboBox( bg );
00681 #else
00682     scrolltype = new MenuButton( this);
00683 #endif
00684     scrolltype->insertItem("In Place");
00685     scrolltype->insertItem("Rolling (moving bg)");
00686     scrolltype->insertItem("Rolling (window)");
00687     scrolltype->insertItem("Rolling (static bg)");
00688     scrolltype->insertItem("Send to output");
00689     scrolltype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00690 
00691     TextLabel = new QLabel( bg );
00692     TextLabel->setText( tr( "Colour of scroll\nprogress indicator" ) );
00693 
00694 #ifdef USECOMBO
00695     scrollcolor = new QComboBox( bg );
00696 #else
00697     scrollcolor = new MenuButton( this);
00698 #endif
00699     populate_colours(scrollcolor);
00700     scrollcolor->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00701 
00702     TextLabel = new QLabel( bg );
00703     TextLabel->setText( tr( "Output" ) );
00704 
00705 #ifdef USECOMBO
00706     outcodec = new QComboBox( bg );
00707 #else
00708     outcodec = new MenuButton( this);
00709 #endif
00710 #ifdef USEQPE
00711 #ifdef OPIE
00712       QString codecpath(getenv("OPIEDIR"));
00713 #else
00714       QString codecpath(getenv("QTDIR"));
00715 #endif
00716       codecpath += "/plugins/reader/outcodecs";
00717 #else
00718       QString codecpath(getenv("READERDIR"));
00719       codecpath += "/outcodecs";
00720 #endif
00721       QDir ocd(codecpath, "lib*.so");
00722       for (int i = 0; i < ocd.count(); ++i)
00723         {
00724           QString tmp(ocd[i]);
00725           outcodec->insertItem(tmp.mid(3,tmp.length()-6));
00726         }
00727     outcodec->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00728 }
00729 
00730 CScrollPrefs::~CScrollPrefs()
00731 {
00732     // no need to delete child widgets, Qt does it all for us
00733 }
00734 
00735 
00736 CPrefs::CPrefs( int w, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true)
00737 {
00738     setCaption(tr( "OpieReader Settings" ) );
00739     QTabWidget* td = new QTabWidget(this);
00740     layout = new CLayoutPrefs(this);
00741     layout2 = new CLayoutPrefs2(w, this);
00742     scroll = new CScrollPrefs(this);
00743     misc = new CMiscPrefs(this);
00744     //    button = new CButtonPrefs(kmap, this);
00745     inter = new CInterPrefs(this);
00746     td->addTab(layout, tr("Layout"));
00747     td->addTab(layout2, tr("Layout(2)"));
00748     td->addTab(inter, tr("Locale"));
00749     td->addTab(scroll, tr("Scroll"));
00750     td->addTab(misc, tr("Misc"));
00751     //    td->addTab(button, tr("Buttons"));
00752     QVBoxLayout* v = new QVBoxLayout(this);
00753     v->addWidget(td);
00754 
00755     if (fs) showMaximized();
00756 }
00757 
00758 
00759 /*
00760 
00761 Unicode
00762   Ideo/Word
00763   Width
00764   Encoding
00765 
00766 */
00767 
00768 #include "CEncoding_tables.h"
00769 
00770 CInterPrefs::CInterPrefs( QWidget* parent,  const char* name, WFlags fl )
00771     : QWidget( parent, name, fl )
00772 {
00773     QHBoxLayout* hb = new QHBoxLayout(this);
00774 
00775     QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this);
00776 
00777     hb->addWidget(gb);
00778 
00779     QLabel *TextLabel;
00780 
00781     ideogram = new QCheckBox( gb );
00782     ideogram->setText( tr( "Ideograms" ) );
00783 
00784     TextLabel = new QLabel( gb );
00785     TextLabel->setText( tr( "Ideogram Width" ) );
00786     ideogramwidth = new QSpinBox( gb );
00787     ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00788     ideogramwidth->setRange(1,200);
00789 
00790     propfontchange = new QCheckBox( gb );
00791     propfontchange->setText( tr( "Apply font\nto dialogs" ) );
00792 
00793     TextLabel = new QLabel( gb );
00794     TextLabel->setText( tr( "Encoding" ) );
00795 #ifdef USECOMBO
00796     encoding = new QComboBox(gb);
00797 #else
00798     encoding = new MenuButton(gb);
00799 #endif
00800     encoding->insertItem("Ascii");
00801     encoding->insertItem("UTF-8");
00802     encoding->insertItem("UCS-2(BE)");
00803     encoding->insertItem("USC-2(LE)");
00804     encoding->insertItem("Palm");
00805     for (unicodetable::iterator iter = unicodetable::begin(); iter != unicodetable::end(); iter++)
00806     {
00807         encoding->insertItem(iter->mime);
00808     }
00809 
00810     QVBoxLayout* vb = new QVBoxLayout;
00811 
00812     gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this);
00813 
00814     TextLabel = new QLabel( gb );
00815     TextLabel->setText( tr( "Application" ) );
00816     application = new QLineEdit(gb);
00817     application->setFixedWidth(80);
00818 
00819     TextLabel = new QLabel( gb );
00820     TextLabel->setText( tr( "Message" ) );
00821     message = new QLineEdit(gb);
00822     message->setFixedWidth(80);
00823 //    message->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
00824     twotouch = new QCheckBox( gb );
00825     twotouch->setText( tr( "Two/One\nTouch" ) );
00826 
00827     SwapMouse = new QCheckBox( gb );
00828     SwapMouse->setText("Swap Tap\nActions");
00829 
00830 
00831     vb->addWidget(gb);
00832 
00833 //    vb->addStretch();
00834     hb->addLayout(vb);
00835 }
00836 
00837 CInterPrefs::~CInterPrefs()
00838 {
00839     // no need to delete child widgets, Qt does it all for us
00840 }

Generated on Sat Nov 5 16:16:56 2005 for OPIE by  doxygen 1.4.2