Diffstat (limited to 'noncore/apps/dagger/configuredlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/dagger/configuredlg.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/noncore/apps/dagger/configuredlg.cpp b/noncore/apps/dagger/configuredlg.cpp index 0a9317c..535659d 100644 --- a/noncore/apps/dagger/configuredlg.cpp +++ b/noncore/apps/dagger/configuredlg.cpp | |||
@@ -18,6 +18,11 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc., | |||
18 | #include "configuredlg.h" | 18 | #include "configuredlg.h" |
19 | 19 | ||
20 | #include <opie2/ofiledialog.h> | ||
21 | |||
22 | #include <qpe/resource.h> | ||
23 | |||
20 | #include <qlabel.h> | 24 | #include <qlabel.h> |
21 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qpushbutton.h> | ||
22 | #include <qvbuttongroup.h> | 27 | #include <qvbuttongroup.h> |
23 | #include <qwhatsthis.h> | 28 | #include <qwhatsthis.h> |
@@ -46,5 +51,11 @@ ConfigureDlg::ConfigureDlg( QWidget *parent, const QString &swordPath, bool alwa | |||
46 | m_swordPath = new QLineEdit( swordPath, widget ); | 51 | m_swordPath = new QLineEdit( swordPath, widget ); |
47 | 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." ) ); |
48 | grid->addMultiCellWidget( m_swordPath, 1, 1, 0, 1 ); | 53 | grid->addWidget( m_swordPath, 1, 0 ); |
54 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, widget ); | ||
55 | 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." ) ); | ||
57 | connect( btn, SIGNAL(clicked()), this, SLOT(slotSelectSwordPath()) ); | ||
58 | grid->addWidget( btn, 1, 1 ); | ||
59 | |||
49 | label = new QLabel( tr( "(Note: Dagger must be restarted for this option to take affect.)" ), widget ); | 60 | label = new QLabel( tr( "(Note: Dagger must be restarted for this option to take affect.)" ), widget ); |
50 | label->setAlignment( Qt::AlignHCenter | Qt::AlignTop | Qt::WordBreak ); | 61 | label->setAlignment( Qt::AlignHCenter | Qt::AlignTop | Qt::WordBreak ); |
@@ -149,2 +160,10 @@ void ConfigureDlg::slotCopyFormatSelected() | |||
149 | m_copyExample->setText( key ); | 160 | m_copyExample->setText( key ); |
150 | } | 161 | } |
162 | |||
163 | void ConfigureDlg::slotSelectSwordPath() | ||
164 | { | ||
165 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_swordPath->text() ); | ||
166 | if ( path.at( path.length() - 1 ) == '/' ) | ||
167 | path.truncate( path.length() - 1 ); | ||
168 | m_swordPath->setText( path ); | ||
169 | } | ||