From cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2 Mon Sep 17 00:00:00 2001 From: drw Date: Mon, 16 Aug 2004 18:11:27 +0000 Subject: Use OFileDialog::getDirectory to select destination path --- (limited to 'noncore') 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 @@ -31,6 +31,8 @@ _;:, .> :=|. This program is free software; you can #include "oipkgconfigdlg.h" +#include + #include #include @@ -83,8 +85,6 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren { m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); } - - //showMaximized(); } void OIpkgConfigDlg::accept() @@ -255,7 +255,7 @@ void OIpkgConfigDlg::initDestinationWidget() 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." ) ); @@ -263,15 +263,20 @@ void OIpkgConfigDlg::initDestinationWidget() 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() @@ -584,6 +589,14 @@ void OIpkgConfigDlg::slotDestDelete() } } +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(); diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h index 800d94a..a4e4f82 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.h +++ b/noncore/settings/packagemanager/oipkgconfigdlg.h @@ -1,28 +1,28 @@ /* -                This file is part of the Opie Project + This file is part of the Opie Project -              Copyright (c) 2003 Dan Williams + Copyright (c) 2003 Dan Williams =. .=l. -           .>+-= - _;:,     .>    :=|. This program is free software; you can -.> <`_,   >  .   <= redistribute it and/or modify it under -:`=1 )Y*s>-.--   : the terms of the GNU Library General Public -.="- .-=="i,     .._ License as published by the Free Software - - .   .-<_>     .<> Foundation; either version 2 of the License, -     ._= =}       : or (at your option) any later version. -    .%`+i>       _;_. -    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU -..}^=.=       =       ; Library General Public License for more -++=   -.     .`     .: details. - :     =  ...= . :.=- - -.   .:....=;==+<; You should have received a copy of the GNU -  -_. . .   )=.  = Library General Public License along with -    --        :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -125,6 +125,7 @@ private slots: void slotDestEdit( int index ); void slotDestNew(); void slotDestDelete(); + void slotDestSelectPath(); void slotDestUpdate(); }; -- cgit v0.9.0.2