summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/configuredlg.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/dagger/configuredlg.cpp b/noncore/apps/dagger/configuredlg.cpp
index 535659d..42bc6da 100644
--- a/noncore/apps/dagger/configuredlg.cpp
+++ b/noncore/apps/dagger/configuredlg.cpp
@@ -1,155 +1,157 @@
1/* 1/*
2Dagger - A Bible study program utilizing the Sword library. 2Dagger - A Bible study program utilizing the Sword library.
3Copyright (c) 2004 Dan Williams <drw@handhelds.org> 3Copyright (c) 2004 Dan Williams <drw@handhelds.org>
4 4
5This file is free software; you can redistribute it and/or modify it under 5This file is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software 6the terms of the GNU General Public License as published by the Free Software
7Foundation; either version 2 of the License, or (at your option) any later version. 7Foundation; either version 2 of the License, or (at your option) any later version.
8 8
9This file is distributed in the hope that it will be useful, but WITHOUT ANY 9This file is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11PARTICULAR PURPOSE. See the GNU General Public License for more details. 11PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this 13You should have received a copy of the GNU General Public License along with this
14file; see the file COPYING. If not, write to the Free Software Foundation, Inc., 14file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
1559 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1559 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16*/ 16*/
17 17
18#include "configuredlg.h" 18#include "configuredlg.h"
19 19
20#include <opie2/ofiledialog.h> 20#include <opie2/ofiledialog.h>
21 21
22#include <qpe/resource.h> 22#include <qpe/resource.h>
23 23
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qvbuttongroup.h> 27#include <qvbuttongroup.h>
28#include <qwhatsthis.h> 28#include <qwhatsthis.h>
29 29
30ConfigureDlg::ConfigureDlg( QWidget *parent, const QString &swordPath, bool alwaysOpenNew, int numVerses, 30ConfigureDlg::ConfigureDlg( QWidget *parent, const QString &swordPath, bool alwaysOpenNew, int numVerses,
31 bool disableBlanking, int copyFormat, const QFont *font ) 31 bool disableBlanking, int copyFormat, const QFont *font )
32 : QDialog( parent, QString::null, true, WStyle_ContextHelp ) 32 : QDialog( parent, QString::null, true, WStyle_ContextHelp )
33 , m_tabs( this ) 33 , m_tabs( this )
34{ 34{
35 setCaption( tr( "Configure Dagger" ) ); 35 setCaption( tr( "Configure Dagger" ) );
36 36
37 QVBoxLayout *layout = new QVBoxLayout( this ); 37 QVBoxLayout *layout = new QVBoxLayout( this );
38 layout->setMargin( 4 ); 38 layout->setMargin( 4 );
39 layout->addWidget( &m_tabs ); 39 layout->addWidget( &m_tabs );
40 40
41 // General tab 41 // General tab
42 QWidget *widget = new QWidget( this ); 42 QWidget *widget = new QWidget( this );
43 QGridLayout *grid = new QGridLayout( widget, 1, 2, 4, 2 ); 43 QGridLayout *grid = new QGridLayout( widget, 1, 2, 4, 2 );
44 grid->setRowStretch( 9, 5 ); 44 grid->setRowStretch( 9, 5 );
45 grid->setColStretch( 0, 2 ); 45 grid->setColStretch( 0, 2 );
46 46
47 QLabel *label = new QLabel( tr( "Path where Sword texts are located:" ), widget ); 47 QLabel *label = new QLabel( tr( "Path where Sword texts are located:" ), widget );
48 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 48 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
49 QWhatsThis::add( label, tr( "Enter the path where the Sword modules (Bible texts, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) ); 49 QWhatsThis::add( label, tr( "Enter the path where the Sword modules (Bible texts, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) );
50 grid->addMultiCellWidget( label, 0, 0, 0, 1 ); 50 grid->addMultiCellWidget( label, 0, 0, 0, 1 );
51 m_swordPath = new QLineEdit( swordPath, widget ); 51 m_swordPath = new QLineEdit( swordPath, widget );
52 QWhatsThis::add( m_swordPath, tr( "Enter the path where the Sword texts (Bibles, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) ); 52 QWhatsThis::add( m_swordPath, tr( "Enter the path where the Sword texts (Bibles, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) );
53 grid->addWidget( m_swordPath, 1, 0 ); 53 grid->addWidget( m_swordPath, 1, 0 );
54 QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, widget ); 54 QPixmap pic;
55 pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
56 QPushButton *btn = new QPushButton( pic, QString::null, widget );
55 btn->setMaximumWidth( btn->height() ); 57 btn->setMaximumWidth( btn->height() );
56 QWhatsThis::add( btn, tr( "Tap here to select the path where the Sword texts (Bibles, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) ); 58 QWhatsThis::add( btn, tr( "Tap here to select the path where the Sword texts (Bibles, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) );
57 connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectSwordPath()) ); 59 connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectSwordPath()) );
58 grid->addWidget( btn, 1, 1 ); 60 grid->addWidget( btn, 1, 1 );
59 61
60 label = new QLabel( tr( "(Note: Dagger must be restarted for this option to take affect.)" ), widget ); 62 label = new QLabel( tr( "(Note: Dagger must be restarted for this option to take affect.)" ), widget );
61 label->setAlignment( Qt::AlignHCenter | Qt::AlignTop | Qt::WordBreak ); 63 label->setAlignment( Qt::AlignHCenter | Qt::AlignTop | Qt::WordBreak );
62 QWhatsThis::add( label, tr( "Enter the path where the Sword modules (Bible texts, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) ); 64 QWhatsThis::add( label, tr( "Enter the path where the Sword modules (Bible texts, commentaries, etc.) can be found. This path should contain either the 'mods.conf' file or 'mods.d' sub-directory." ) );
63 grid->addMultiCellWidget( label, 2, 2, 0, 1 ); 65 grid->addMultiCellWidget( label, 2, 2, 0, 1 );
64 66
65 grid->addRowSpacing( 3, 15 ); 67 grid->addRowSpacing( 3, 15 );
66 68
67 m_alwaysOpenNew = new QCheckBox( tr( "Always open texts in new window?" ), widget ); 69 m_alwaysOpenNew = new QCheckBox( tr( "Always open texts in new window?" ), widget );
68 m_alwaysOpenNew->setChecked( alwaysOpenNew ); 70 m_alwaysOpenNew->setChecked( alwaysOpenNew );
69 QWhatsThis::add( m_alwaysOpenNew, tr( "Tap here to always open texts in a new window. If this option is not selected, only one copy of a Sword text will be opened." ) ); 71 QWhatsThis::add( m_alwaysOpenNew, tr( "Tap here to always open texts in a new window. If this option is not selected, only one copy of a Sword text will be opened." ) );
70 grid->addMultiCellWidget( m_alwaysOpenNew, 4, 4, 0, 1 ); 72 grid->addMultiCellWidget( m_alwaysOpenNew, 4, 4, 0, 1 );
71 73
72 grid->addRowSpacing( 5, 15 ); 74 grid->addRowSpacing( 5, 15 );
73 75
74 label = new QLabel( tr( "Number of verses to display at a time:" ), widget ); 76 label = new QLabel( tr( "Number of verses to display at a time:" ), widget );
75 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 77 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
76 QWhatsThis::add( label, tr( "Enter the number of verses to display at a time. This also affects how far the scroll to previous/next page buttons on the Navigation bar scroll." ) ); 78 QWhatsThis::add( label, tr( "Enter the number of verses to display at a time. This also affects how far the scroll to previous/next page buttons on the Navigation bar scroll." ) );
77 grid->addWidget( label, 6, 0 ); 79 grid->addWidget( label, 6, 0 );
78 m_numVerses = new QSpinBox( 1, 20, 1, widget ); 80 m_numVerses = new QSpinBox( 1, 20, 1, widget );
79 m_numVerses->setValue( numVerses ); 81 m_numVerses->setValue( numVerses );
80 QWhatsThis::add( m_numVerses, tr( "Enter the number of verses to display at a time. This also affects how far the scroll to previous/next page buttons on the Navigation bar scroll." ) ); 82 QWhatsThis::add( m_numVerses, tr( "Enter the number of verses to display at a time. This also affects how far the scroll to previous/next page buttons on the Navigation bar scroll." ) );
81 grid->addWidget( m_numVerses, 6, 1 ); 83 grid->addWidget( m_numVerses, 6, 1 );
82 84
83 grid->addRowSpacing( 7, 15 ); 85 grid->addRowSpacing( 7, 15 );
84 86
85 m_disableScreenBlank = new QCheckBox( tr( "Disable automatic screen power-down?" ), widget ); 87 m_disableScreenBlank = new QCheckBox( tr( "Disable automatic screen power-down?" ), widget );
86 m_disableScreenBlank->setChecked( disableBlanking ); 88 m_disableScreenBlank->setChecked( disableBlanking );
87 QWhatsThis::add( m_disableScreenBlank, tr( "Tap here to disable Opie's automatic power management feature which will dim and turn off the screen after a specified time. This will only be effective while Dagger is running." ) ); 89 QWhatsThis::add( m_disableScreenBlank, tr( "Tap here to disable Opie's automatic power management feature which will dim and turn off the screen after a specified time. This will only be effective while Dagger is running." ) );
88 grid->addMultiCellWidget( m_disableScreenBlank, 8, 8, 0, 1 ); 90 grid->addMultiCellWidget( m_disableScreenBlank, 8, 8, 0, 1 );
89 91
90 m_tabs.addTab( widget, "SettingsIcon", tr( "General" ) ); 92 m_tabs.addTab( widget, "SettingsIcon", tr( "General" ) );
91 93
92 // Copy tab 94 // Copy tab
93 widget = new QWidget( this ); 95 widget = new QWidget( this );
94 QWhatsThis::add( widget, tr( "Select the format used when copying the current verse to the clipboard." ) ); 96 QWhatsThis::add( widget, tr( "Select the format used when copying the current verse to the clipboard." ) );
95 layout = new QVBoxLayout( widget ); 97 layout = new QVBoxLayout( widget );
96 layout->setMargin( 4 ); 98 layout->setMargin( 4 );
97 99
98 QVButtonGroup *bg = new QVButtonGroup( tr( "Select copy format" ), widget ); 100 QVButtonGroup *bg = new QVButtonGroup( tr( "Select copy format" ), widget );
99 m_copyTextFull = new QRadioButton( tr( "\"Verse (Book cc:vv, text)\"" ), bg ); 101 m_copyTextFull = new QRadioButton( tr( "\"Verse (Book cc:vv, text)\"" ), bg );
100 connect( m_copyTextFull, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) ); 102 connect( m_copyTextFull, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) );
101 m_copyFull = new QRadioButton( tr( "\"Verse (Book cc:vv)\"" ), bg ); 103 m_copyFull = new QRadioButton( tr( "\"Verse (Book cc:vv)\"" ), bg );
102 connect( m_copyFull, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) ); 104 connect( m_copyFull, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) );
103 m_copyVerse = new QRadioButton( tr( "\"Verse\"" ), bg ); 105 m_copyVerse = new QRadioButton( tr( "\"Verse\"" ), bg );
104 connect( m_copyVerse, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) ); 106 connect( m_copyVerse, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) );
105 m_copyKey = new QRadioButton( tr( "\"Book cc:vv\"" ), bg ); 107 m_copyKey = new QRadioButton( tr( "\"Book cc:vv\"" ), bg );
106 connect( m_copyKey, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) ); 108 connect( m_copyKey, SIGNAL(clicked()), this, SLOT(slotCopyFormatSelected()) );
107 layout->addWidget( bg ); 109 layout->addWidget( bg );
108 110
109 layout->addSpacing( 15 ); 111 layout->addSpacing( 15 );
110 112
111 label = new QLabel( tr( "Example:" ), widget ); 113 label = new QLabel( tr( "Example:" ), widget );
112 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 114 label->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
113 layout->addWidget( label ); 115 layout->addWidget( label );
114 116
115 layout->addSpacing( 15 ); 117 layout->addSpacing( 15 );
116 118
117 m_copyExample = new QLabel( widget ); 119 m_copyExample = new QLabel( widget );
118 m_copyExample->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak ); 120 m_copyExample->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
119 layout->addWidget( m_copyExample ); 121 layout->addWidget( m_copyExample );
120 122
121 if ( copyFormat == 0 ) 123 if ( copyFormat == 0 )
122 m_copyTextFull->animateClick(); 124 m_copyTextFull->animateClick();
123 else if ( copyFormat == 1 ) 125 else if ( copyFormat == 1 )
124 m_copyFull->animateClick(); 126 m_copyFull->animateClick();
125 else if ( copyFormat == 2 ) 127 else if ( copyFormat == 2 )
126 m_copyVerse->animateClick(); 128 m_copyVerse->animateClick();
127 else if ( copyFormat == 3 ) 129 else if ( copyFormat == 3 )
128 m_copyKey->animateClick(); 130 m_copyKey->animateClick();
129 131
130 layout->addStretch(); 132 layout->addStretch();
131 133
132 m_tabs.addTab( widget, "copy", tr( "Copy" ) ); 134 m_tabs.addTab( widget, "copy", tr( "Copy" ) );
133 135
134 // Font tab 136 // Font tab
135 m_font = new Opie::Ui::OFontSelector( true, this ); 137 m_font = new Opie::Ui::OFontSelector( true, this );
136 if ( font ) 138 if ( font )
137 m_font->setSelectedFont( *font ); 139 m_font->setSelectedFont( *font );
138 QWhatsThis::add( m_font, tr( "Select the font, style and size used for displaying texts." ) ); 140 QWhatsThis::add( m_font, tr( "Select the font, style and size used for displaying texts." ) );
139 141
140 m_tabs.addTab( m_font, "font", tr( "Font" ) ); 142 m_tabs.addTab( m_font, "font", tr( "Font" ) );
141 143
142 m_tabs.setCurrentTab( tr( "General" ) ); 144 m_tabs.setCurrentTab( tr( "General" ) );
143} 145}
144 146
145void ConfigureDlg::slotCopyFormatSelected() 147void ConfigureDlg::slotCopyFormatSelected()
146{ 148{
147 const QObject *option = sender(); 149 const QObject *option = sender();
148 150
149 QString text = tr( "KJV" ); 151 QString text = tr( "KJV" );
150 QString verse = tr( "In the beginning God created the heaven and the earth." ); 152 QString verse = tr( "In the beginning God created the heaven and the earth." );
151 QString key = tr( "Gen 1:1" ); 153 QString key = tr( "Gen 1:1" );
152 154
153 if ( option == m_copyTextFull && m_copyTextFull->isChecked() ) 155 if ( option == m_copyTextFull && m_copyTextFull->isChecked() )
154 m_copyExample->setText( QString( "%1 (%2, %3)" ).arg( verse ).arg( key ).arg( text ) ); 156 m_copyExample->setText( QString( "%1 (%2, %3)" ).arg( verse ).arg( key ).arg( text ) );
155 else if ( option == m_copyFull && m_copyFull->isChecked() ) 157 else if ( option == m_copyFull && m_copyFull->isChecked() )