Diffstat (limited to 'noncore/apps/opie-reader/Prefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Prefs.cpp | 127 |
1 files changed, 95 insertions, 32 deletions
diff --git a/noncore/apps/opie-reader/Prefs.cpp b/noncore/apps/opie-reader/Prefs.cpp index 2733faa..6c4d45b 100644 --- a/noncore/apps/opie-reader/Prefs.cpp +++ b/noncore/apps/opie-reader/Prefs.cpp @@ -1,152 +1,160 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'Prefs.ui' ** ** Created: Tue Feb 11 23:53:35 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "Prefs.h" +#include <stdlib.h> + #include <qcheckbox.h> #include <qlabel.h> #include <qpushbutton.h> #include <qspinbox.h> #include <qlayout.h> #include <qvariant.h> #include <qtooltip.h> #include <qwhatsthis.h> #include <qbuttongroup.h> #include <qlineedit.h> +#include <qdir.h> #ifdef USECOMBO #include <qcombobox.h> #else #include <qpe/menubutton.h> #endif #include <qfontdatabase.h> #ifdef USECOMBO void populate_colours(QComboBox *mb) #else void populate_colours(MenuButton *mb) #endif { mb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); mb->insertItem("White"); mb->insertItem("Black"); mb->insertItem("Dark Gray"); mb->insertItem("Gray"); mb->insertItem("Light Gray"); mb->insertItem("Red"); mb->insertItem("Green"); mb->insertItem("Blue"); mb->insertItem("Cyan"); mb->insertItem("Magenta"); mb->insertItem("Yellow"); mb->insertItem("Dark Red"); mb->insertItem("Dark Green"); mb->insertItem("Dark Blue"); mb->insertItem("Dark Cyan"); mb->insertItem("Dark Magenta"); mb->insertItem("Dark Yellow"); } CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QHBoxLayout* hb = new QHBoxLayout(this); QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this); hb->addWidget(bg); StripCR = new QCheckBox( bg ); StripCR->setText( tr( "Strip CR" ) ); Dehyphen = new QCheckBox( bg ); Dehyphen->setText( tr( "Dehyphen" ) ); SingleSpace = new QCheckBox( bg ); SingleSpace->setText( tr( "Single Space" ) ); Unindent = new QCheckBox( bg ); Unindent->setText( tr( "Unindent" ) ); Reparagraph = new QCheckBox( bg ); Reparagraph->setText( tr( "Reparagraph" ) ); DoubleSpace = new QCheckBox( bg ); DoubleSpace->setText( tr( "Double Space" ) ); Remap = new QCheckBox( bg ); Remap->setText( tr( "Remap" ) ); Embolden = new QCheckBox( bg ); Embolden->setText( tr( "Embolden" ) ); FullJustify = new QCheckBox( bg ); FullJustify->setText( tr( "Full Justify" ) ); FixGraphics = new QCheckBox( bg ); FixGraphics->setText( tr( "Fix Graphic Size" ) ); hyphenate = new QCheckBox( bg ); hyphenate->setText( tr( "Hyphenate" ) ); /* customhyphen = new QCheckBox( bg ); customhyphen->setText( tr( "Custom Hyphen'n" ) ); */ prepalm = new QCheckBox( bg ); prepalm->setText( tr( "Repalm(Baen)" ) ); pkern = new QCheckBox( bg ); pkern->setText( tr( "Kern" ) ); + InlineTables = new QCheckBox( bg ); + InlineTables->setText( tr( "Inline Tables" ) ); + + Underlinelinks = new QCheckBox( bg ); + Underlinelinks->setText( tr( "Underline Links" ) ); /* Negative = new QCheckBox( bg ); Negative->setText( tr( "Negative" ) ); */ // Inverse = new QCheckBox( bg ); // Inverse->setText( tr( "Inverse" ) ); } /* * Destroys the object and frees any allocated resources */ CLayoutPrefs::~CLayoutPrefs() { // no need to delete child widgets, Qt does it all for us } CLayoutPrefs2::CLayoutPrefs2( int w, QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QVBoxLayout* vb = new QVBoxLayout(this); QGridLayout* gl = new QGridLayout(vb, 4, 5); QLabel *TextLabel; TextLabel = new QLabel( this ); TextLabel->setText( tr( "Page\nOverlap" ) ); gl->addWidget(TextLabel, 0, 0); pageoverlap = new QSpinBox( this ); pageoverlap->setRange(0,20); gl->addWidget(pageoverlap, 0, 1); TextLabel = new QLabel( this, "TextLabel1" ); TextLabel->setText( tr( "Indent" ) ); gl->addWidget(TextLabel, 1, 0); Indent = new QSpinBox( this, "Indent" ); Indent->setRange(0,20); gl->addWidget(Indent, 1, 1); TextLabel = new QLabel( this ); TextLabel->setText( tr( "Graphics\nZoom" ) ); gl->addWidget(TextLabel, 1, 2); gfxzoom = new QSpinBox( this ); @@ -517,218 +525,273 @@ CPluckerPrefs::~CPluckerPrefs() /* CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QVBoxLayout* Layout11 = new QVBoxLayout(this); Layout11->setMargin( 0 ); QHBoxLayout* hl = new QHBoxLayout; QLabel* TextLabel = new QLabel( this ); TextLabel->setText( tr( "Action for\nSelect Button" ) ); hl->addWidget(TextLabel); action = new QComboBox( this ); action->insertItem("Open file"); action->insertItem("Autoscroll"); action->insertItem("Mark"); action->insertItem("Annotate"); action->insertItem("Fullscreen"); hl->addWidget( action ); Layout11->addLayout(hl); hl = new QHBoxLayout; TextLabel = new QLabel( this ); TextLabel->setText( tr( "Dictionary\nApplication" ) ); hl->addWidget(TextLabel); target = new QLineEdit(this); hl->addWidget( target ); Layout11->addLayout(hl); QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Selection Target", this); Layout11->addWidget( bg ); annotation = new QCheckBox( bg ); annotation->setText( tr( "Annotation" ) ); dictionary = new QCheckBox( bg ); dictionary->setText( tr( "Dictionary" ) ); clipboard = new QCheckBox( bg ); clipboard->setText( tr( "Clipboard" ) ); + QCheckBox* outcodec = new QCheckBox( bg ); + outcodec->setText( tr( "Output" ) ); + } CMiscPrefs::~CMiscPrefs() { // no need to delete child widgets, Qt does it all for us } */ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QVBoxLayout* vl = new QVBoxLayout(this); QHBoxLayout* hl = new QHBoxLayout; vl->addLayout(hl); vl->setMargin( 0 ); hl->setMargin( 0 ); QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this); hl->addWidget( gb ); annotation = new QCheckBox( gb ); annotation->setText( tr( "Annotation" ) ); dictionary = new QCheckBox( gb ); dictionary->setText( tr( "Dictionary" ) ); clipboard = new QCheckBox( gb ); clipboard->setText( tr( "Clipboard" ) ); + boutput = new QCheckBox( gb ); + boutput->setText( tr( "Output" ) ); + QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this); hl->addWidget( bg ); Depluck = new QCheckBox( bg ); Depluck->setText( tr( "Depluck" ) ); Dejpluck = new QCheckBox( bg ); Dejpluck->setText( tr( "Dejpluck" ) ); Continuous = new QCheckBox( bg ); Continuous->setText( tr( "Continuous" ) ); - - bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this); + bg = new QButtonGroup(2, Qt::Horizontal, "Background", this); vl->addWidget( bg ); - // scrollinplace = new QCheckBox( bg ); - // scrollinplace->setText( tr( "In Place" ) ); +// QLabel* TextLabel = new QLabel( bg ); +// TextLabel->setText( tr( "Copy an image to \"background\" in\n~/Applications/uqtreader/Theme/" ) ); + #ifdef USECOMBO - scrolltype = new QComboBox( bg ); + bgtype = new QComboBox( bg ); #else - scrolltype = new MenuButton( this); + bgtype = new MenuButton( this); #endif - scrolltype->insertItem("In Place"); - scrolltype->insertItem("Rolling (moving bg)"); - scrolltype->insertItem("Rolling (window)"); - scrolltype->insertItem("Rolling (static bg)"); - scrolltype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + bgtype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + + bgtype->insertItem( tr("Centred") ); + bgtype->insertItem( tr("Tiled") ); + bgtype->insertItem( tr("Fitted") ); + DoubleBuffer = new QCheckBox( bg ); + DoubleBuffer->setText( tr( "Double Buffer" ) ); + QLabel* TextLabel = new QLabel( bg ); + TextLabel->setText( tr( "Minibar Colour" ) ); #ifdef USECOMBO - scrollcolor = new QComboBox( bg ); + minibarcol = new QComboBox( bg ); #else - scrollcolor = new MenuButton( this); + minibarcol = new MenuButton( this); #endif - populate_colours(scrollcolor); - scrollcolor->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + populate_colours(minibarcol); + minibarcol->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); +} + +CMiscPrefs::~CMiscPrefs() +{ + // no need to delete child widgets, Qt does it all for us +} + +CScrollPrefs::CScrollPrefs( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + + QHBoxLayout* hl = new QHBoxLayout(this); + hl->setMargin( 0 ); + + QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this); + hl->addWidget( bg ); + // scrollinplace = new QCheckBox( bg ); + // scrollinplace->setText( tr( "In Place" ) ); QLabel* TextLabel = new QLabel( bg ); TextLabel->setText( tr( "Scroll step" ) ); // gl->addWidget(TextLabel, 2, 0); scrollstep = new QSpinBox( bg ); scrollstep->setRange(1, 10); scrollstep->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); TextLabel = new QLabel( bg ); - TextLabel->setText( tr( "Minibar Colour" ) ); + TextLabel->setText( tr( "Scroll type" ) ); #ifdef USECOMBO - minibarcol = new QComboBox( bg ); + scrolltype = new QComboBox( bg ); #else - minibarcol = new MenuButton( this); + scrolltype = new MenuButton( this); #endif - populate_colours(minibarcol); - minibarcol->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + scrolltype->insertItem("In Place"); + scrolltype->insertItem("Rolling (moving bg)"); + scrolltype->insertItem("Rolling (window)"); + scrolltype->insertItem("Rolling (static bg)"); + scrolltype->insertItem("Send to output"); + scrolltype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + TextLabel = new QLabel( bg ); + TextLabel->setText( tr( "Colour of scroll\nprogress indicator" ) ); - bg = new QButtonGroup(2, Qt::Vertical, "Background", this); - vl->addWidget( bg ); +#ifdef USECOMBO + scrollcolor = new QComboBox( bg ); +#else + scrollcolor = new MenuButton( this); +#endif + populate_colours(scrollcolor); + scrollcolor->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); -// QLabel* TextLabel = new QLabel( bg ); -// TextLabel->setText( tr( "Copy an image to \"background\" in\n~/Applications/uqtreader/Theme/" ) ); + TextLabel = new QLabel( bg ); + TextLabel->setText( tr( "Output" ) ); #ifdef USECOMBO - bgtype = new QComboBox( bg ); + outcodec = new QComboBox( bg ); #else - bgtype = new MenuButton( this); + outcodec = new MenuButton( this); #endif - bgtype->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - - bgtype->insertItem( tr("Centred") ); - bgtype->insertItem( tr("Tiled") ); - bgtype->insertItem( tr("Fitted") ); +#ifdef USEQPE +#ifdef OPIE + QString codecpath(getenv("OPIEDIR")); +#else + QString codecpath(getenv("QTDIR")); +#endif + codecpath += "/plugins/reader/outcodecs"; +#else + QString codecpath(getenv("READERDIR")); + codecpath += "/outcodecs"; +#endif + QDir ocd(codecpath, "lib*.so"); + for (int i = 0; i < ocd.count(); ++i) + { + QString tmp(ocd[i]); + outcodec->insertItem(tmp.mid(3,tmp.length()-6)); + } + outcodec->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); } -CMiscPrefs::~CMiscPrefs() +CScrollPrefs::~CScrollPrefs() { // no need to delete child widgets, Qt does it all for us } + CPrefs::CPrefs( int w, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true) { setCaption(tr( "OpieReader Settings" ) ); QTabWidget* td = new QTabWidget(this); layout = new CLayoutPrefs(this); layout2 = new CLayoutPrefs2(w, this); + scroll = new CScrollPrefs(this); misc = new CMiscPrefs(this); // button = new CButtonPrefs(kmap, this); inter = new CInterPrefs(this); td->addTab(layout, tr("Layout")); td->addTab(layout2, tr("Layout(2)")); td->addTab(inter, tr("Locale")); + td->addTab(scroll, tr("Scroll")); td->addTab(misc, tr("Misc")); // td->addTab(button, tr("Buttons")); QVBoxLayout* v = new QVBoxLayout(this); v->addWidget(td); if (fs) showMaximized(); } /* Unicode Ideo/Word Width Encoding */ #include "CEncoding_tables.h" CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QHBoxLayout* hb = new QHBoxLayout(this); QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this); hb->addWidget(gb); QLabel *TextLabel; ideogram = new QCheckBox( gb ); ideogram->setText( tr( "Ideograms" ) ); TextLabel = new QLabel( gb ); TextLabel->setText( tr( "Ideogram Width" ) ); ideogramwidth = new QSpinBox( gb ); ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); ideogramwidth->setRange(1,200); propfontchange = new QCheckBox( gb ); propfontchange->setText( tr( "Apply font\nto dialogs" ) ); TextLabel = new QLabel( gb ); TextLabel->setText( tr( "Encoding" ) ); #ifdef USECOMBO encoding = new QComboBox(gb); #else |