author | drw <drw> | 2004-08-16 18:11:27 (UTC) |
---|---|---|
committer | drw <drw> | 2004-08-16 18:11:27 (UTC) |
commit | cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2 (patch) (unidiff) | |
tree | 58d91571a252bc8519d94ff32832c9b3a7a16089 | |
parent | f8f568aaddc63d39b50aa8357326a64c036f5847 (diff) | |
download | opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.zip opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.tar.gz opie-cbb2e3969b0a6bb36aca6bc608a77dcaeb5bbac2.tar.bz2 |
Use OFileDialog::getDirectory to select destination path
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 23 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.h | 43 |
2 files changed, 40 insertions, 26 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 | |||
@@ -30,8 +30,10 @@ _;:, .> :=|. This program is free software; you can | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "oipkgconfigdlg.h" | 32 | #include "oipkgconfigdlg.h" |
33 | 33 | ||
34 | #include <opie2/ofiledialog.h> | ||
35 | |||
34 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
35 | 37 | ||
36 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
37 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
@@ -82,10 +84,8 @@ OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *paren | |||
82 | else | 84 | else |
83 | { | 85 | { |
84 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); | 86 | m_tabWidget.addTab( m_optionsWidget, "exec", tr( "Options" ) ); |
85 | } | 87 | } |
86 | |||
87 | //showMaximized(); | ||
88 | } | 88 | } |
89 | 89 | ||
90 | void OIpkgConfigDlg::accept() | 90 | void OIpkgConfigDlg::accept() |
91 | { | 91 | { |
@@ -254,25 +254,30 @@ void OIpkgConfigDlg::initDestinationWidget() | |||
254 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); | 254 | QWhatsThis::add( label, tr( "Enter the name of this entry here." ) ); |
255 | grplayout->addWidget( label, 0, 0 ); | 255 | grplayout->addWidget( label, 0, 0 ); |
256 | m_destName = new QLineEdit( grpbox ); | 256 | m_destName = new QLineEdit( grpbox ); |
257 | QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); | 257 | QWhatsThis::add( m_destName, tr( "Enter the name of this entry here." ) ); |
258 | grplayout->addWidget( m_destName, 0, 1 ); | 258 | grplayout->addMultiCellWidget( m_destName, 0, 0, 1, 2 ); |
259 | 259 | ||
260 | label = new QLabel( tr( "Location:" ), grpbox ); | 260 | label = new QLabel( tr( "Location:" ), grpbox ); |
261 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); | 261 | QWhatsThis::add( label, tr( "Enter the absolute directory path of this entry here." ) ); |
262 | grplayout->addWidget( label, 1, 0 ); | 262 | grplayout->addWidget( label, 1, 0 ); |
263 | m_destLocation = new QLineEdit( grpbox ); | 263 | m_destLocation = new QLineEdit( grpbox ); |
264 | QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); | 264 | QWhatsThis::add( m_destLocation, tr( "Enter the absolute directory path of this entry here." ) ); |
265 | grplayout->addWidget( m_destLocation, 1, 1 ); | 265 | grplayout->addWidget( m_destLocation, 1, 1 ); |
266 | btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, grpbox ); | ||
267 | btn->setMaximumWidth( btn->height() ); | ||
268 | QWhatsThis::add( btn, tr( "Tap here to select the desired location." ) ); | ||
269 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestSelectPath()) ); | ||
270 | grplayout->addWidget( btn, 1, 2 ); | ||
266 | 271 | ||
267 | m_destActive = new QCheckBox( tr( "Active" ), grpbox ); | 272 | m_destActive = new QCheckBox( tr( "Active" ), grpbox ); |
268 | QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); | 273 | QWhatsThis::add( m_destActive, tr( "Tap here to indicate whether this entry is active or not." ) ); |
269 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 1 ); | 274 | grplayout->addMultiCellWidget( m_destActive, 2, 2, 0, 2 ); |
270 | 275 | ||
271 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 276 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
272 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); | 277 | QWhatsThis::add( btn, tr( "Tap here to update the entry's information." ) ); |
273 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); | 278 | connect( btn, SIGNAL(clicked()), this, SLOT(slotDestUpdate()) ); |
274 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 279 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 2 ); |
275 | } | 280 | } |
276 | 281 | ||
277 | void OIpkgConfigDlg::initProxyWidget() | 282 | void OIpkgConfigDlg::initProxyWidget() |
278 | { | 283 | { |
@@ -583,8 +588,16 @@ void OIpkgConfigDlg::slotDestDelete() | |||
583 | m_destList->removeItem( m_destCurrent ); | 588 | m_destList->removeItem( m_destCurrent ); |
584 | } | 589 | } |
585 | } | 590 | } |
586 | 591 | ||
592 | void OIpkgConfigDlg::slotDestSelectPath() | ||
593 | { | ||
594 | QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_destLocation->text() ); | ||
595 | if ( path.at( path.length() - 1 ) == '/' ) | ||
596 | path.truncate( path.length() - 1 ); | ||
597 | m_destLocation->setText( path ); | ||
598 | } | ||
599 | |||
587 | void OIpkgConfigDlg::slotDestUpdate() | 600 | void OIpkgConfigDlg::slotDestUpdate() |
588 | { | 601 | { |
589 | QString newName = m_destName->text(); | 602 | QString newName = m_destName->text(); |
590 | 603 | ||
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,29 +1,29 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
@@ -124,8 +124,9 @@ private slots: | |||
124 | 124 | ||
125 | void slotDestEdit( int index ); | 125 | void slotDestEdit( int index ); |
126 | void slotDestNew(); | 126 | void slotDestNew(); |
127 | void slotDestDelete(); | 127 | void slotDestDelete(); |
128 | void slotDestSelectPath(); | ||
128 | void slotDestUpdate(); | 129 | void slotDestUpdate(); |
129 | }; | 130 | }; |
130 | 131 | ||
131 | #endif | 132 | #endif |