author | drw <drw> | 2004-08-16 18:11:27 (UTC) |
---|---|---|
committer | drw <drw> | 2004-08-16 18:11:27 (UTC) |
commit | cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2 (patch) (side-by-side diff) | |
tree | 58d91571a252bc8519d94ff32832c9b3a7a16089 /noncore/settings/packagemanager/oipkgconfigdlg.cpp | |
parent | f8f568aaddc63d39b50aa8357326a64c036f5847 (diff) | |
download | opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.zip opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.tar.gz opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.tar.bz2 |
Use OFileDialog::getDirectory to select destination path
Diffstat (limited to 'noncore/settings/packagemanager/oipkgconfigdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 1561470..ea0aef0 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -28,12 +28,14 @@ _;:, .> :=|. This program is free software; you can Boston, MA 02111-1307, USA. */ #include "oipkgconfigdlg.h" +#include <opie2/ofiledialog.h> + #include <qpe/resource.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qgroupbox.h> #include <qlabel.h> @@ -80,14 +82,12 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren m_tabWidget.setCurrentTab( tr( "Servers" ) ); } else { m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); } - - //showMaximized(); } void OIpkgConfigDlg::accept() { // Save server, destination and proxy configuration if ( !m_installOptions ) @@ -252,29 +252,34 @@ void OIpkgConfigDlg::initDestinationWidget() QLabel *label = new QLabel( tr( "Name:" ), grpbox ); QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); grplayout->addWidget( label, 0, 0 ); m_destName = new QLineEdit( grpbox ); QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); - grplayout->addWidget( m_destName, 0, 1 ); + grplayout->addMultiCellWidget( m_destName, 0, 0, 1, 2 ); label = new QLabel( tr( "Location:" ), grpbox ); QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); grplayout->addWidget( label, 1, 0 ); m_destLocation = new QLineEdit( grpbox ); QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); grplayout->addWidget( m_destLocation, 1, 1 ); + btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, grpbox ); + btn->setMaximumWidth( btn->height() ); + QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); + connect( btn, SIGNAL(clicked()), this, SLOT(slotDestSelectPath()) ); + grplayout->addWidget( btn, 1, 2 ); m_destActive = new QCheckBox( tr( "Active" ), grpbox ); QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); - grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 ); + grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 2 ); btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); - grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); + grplayout->addMultiCellWidget( btn, 3, 3, 0, 2 ); } void OIpkgConfigDlg::initProxyWidget() { m_proxyWidget = new QWidget( this ); @@ -581,12 +586,20 @@ void OIpkgConfigDlg::slotDestDelete() { m_configs->removeRef( destination ); m_destList->removeItem( m_destCurrent ); } } +void OIpkgConfigDlg::slotDestSelectPath() +{ + QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_destLocation->text() ); + if ( path.at( path.length() - 1 ) == '/' ) + path.truncate( path.length() - 1 ); + m_destLocation->setText( path ); +} + void OIpkgConfigDlg::slotDestUpdate() { QString newName = m_destName->text(); // Convert any spaces to underscores newName.replace( QRegExp( " " ), "_" ); |