Diffstat (limited to 'noncore/settings/aqpkg/installdlgimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index da21cef..e828595 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -1,52 +1,50 @@ | |||
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) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <stdio.h> | 30 | #include <stdio.h> |
31 | 31 | ||
32 | #include <opie2/ofiledialog.h> | 32 | #include <opie2/ofiledialog.h> |
33 | #include <opie2/oresource.h> | ||
33 | 34 | ||
34 | #ifdef QWS | ||
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | #include <qpe/fileselector.h> | 36 | #include <qpe/fileselector.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include <qpe/resource.h> | ||
39 | #include <qpe/storage.h> | 38 | #include <qpe/storage.h> |
40 | #endif | ||
41 | 39 | ||
42 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
43 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
44 | #include <qdialog.h> | 42 | #include <qdialog.h> |
45 | #include <qfileinfo.h> | 43 | #include <qfileinfo.h> |
46 | #include <qgroupbox.h> | 44 | #include <qgroupbox.h> |
47 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
48 | #include <qlabel.h> | 46 | #include <qlabel.h> |
49 | #include <qlayout.h> | 47 | #include <qlayout.h> |
50 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
51 | 49 | ||
52 | #include "datamgr.h" | 50 | #include "datamgr.h" |
@@ -187,29 +185,29 @@ void InstallDlgImpl :: init( bool displayextrainfo ) | |||
187 | txtAvailableSpace = 0x0; | 185 | txtAvailableSpace = 0x0; |
188 | } | 186 | } |
189 | 187 | ||
190 | QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); | 188 | QGroupBox *GroupBox2 = new QGroupBox( 0, Qt::Vertical, tr( "Output" ), this ); |
191 | GroupBox2->layout()->setSpacing( 0 ); | 189 | GroupBox2->layout()->setSpacing( 0 ); |
192 | GroupBox2->layout()->setMargin( 4 ); | 190 | GroupBox2->layout()->setMargin( 4 ); |
193 | 191 | ||
194 | QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() ); | 192 | QVBoxLayout *GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() ); |
195 | output = new QMultiLineEdit( GroupBox2 ); | 193 | output = new QMultiLineEdit( GroupBox2 ); |
196 | GroupBox2Layout->addWidget( output ); | 194 | GroupBox2Layout->addWidget( output ); |
197 | layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); | 195 | layout->addMultiCellWidget( GroupBox2, 2, 2, 0, 1 ); |
198 | 196 | ||
199 | btnInstall = new QPushButton( Resource::loadPixmap( "aqpkg/apply" ), tr( "Start" ), this ); | 197 | btnInstall = new QPushButton( Opie::Core::OResource::loadPixmap( "aqpkg/apply", Opie::Core::OResource::SmallIcon ), tr( "Start" ), this ); |
200 | layout->addWidget( btnInstall, 3, 0 ); | 198 | layout->addWidget( btnInstall, 3, 0 ); |
201 | connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); | 199 | connect( btnInstall, SIGNAL( clicked() ), this, SLOT( installSelected() ) ); |
202 | 200 | ||
203 | btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); | 201 | btnOptions = new QPushButton( Opie::Core::OResource::loadPixmap( "SettingsIcon", Opie::Core::OResource::SmallIcon ), tr( "Options" ), this ); |
204 | layout->addWidget( btnOptions, 3, 1 ); | 202 | layout->addWidget( btnOptions, 3, 1 ); |
205 | connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); | 203 | connect( btnOptions, SIGNAL( clicked() ), this, SLOT( optionsSelected() ) ); |
206 | } | 204 | } |
207 | 205 | ||
208 | void InstallDlgImpl :: optionsSelected() | 206 | void InstallDlgImpl :: optionsSelected() |
209 | { | 207 | { |
210 | if ( btnOptions->text() == tr( "Options" ) ) | 208 | if ( btnOptions->text() == tr( "Options" ) ) |
211 | { | 209 | { |
212 | InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); | 210 | InstallOptionsDlgImpl opt( flags, infoLevel, this, "Option", true ); |
213 | if ( opt.exec() == QDialog::Accepted ) | 211 | if ( opt.exec() == QDialog::Accepted ) |
214 | { | 212 | { |
215 | // set options selected from dialog | 213 | // set options selected from dialog |
@@ -251,39 +249,39 @@ void InstallDlgImpl :: optionsSelected() | |||
251 | void InstallDlgImpl :: installSelected() | 249 | void InstallDlgImpl :: installSelected() |
252 | { | 250 | { |
253 | if ( btnInstall->text() == tr( "Abort" ) ) | 251 | if ( btnInstall->text() == tr( "Abort" ) ) |
254 | { | 252 | { |
255 | if ( pIpkg ) | 253 | if ( pIpkg ) |
256 | { | 254 | { |
257 | displayText( tr( "\n**** User Clicked ABORT ***" ) ); | 255 | displayText( tr( "\n**** User Clicked ABORT ***" ) ); |
258 | pIpkg->abort(); | 256 | pIpkg->abort(); |
259 | displayText( tr( "**** Process Aborted ****" ) ); | 257 | displayText( tr( "**** Process Aborted ****" ) ); |
260 | } | 258 | } |
261 | 259 | ||
262 | btnInstall->setText( tr( "Close" ) ); | 260 | btnInstall->setText( tr( "Close" ) ); |
263 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); | 261 | btnInstall->setIconSet( Opie::Core::OResource::loadPixmap( "enter", Opie::Core::OResource::SmallIcon ) ); |
264 | return; | 262 | return; |
265 | } | 263 | } |
266 | else if ( btnInstall->text() == tr( "Close" ) ) | 264 | else if ( btnInstall->text() == tr( "Close" ) ) |
267 | { | 265 | { |
268 | emit reloadData( this ); | 266 | emit reloadData( this ); |
269 | return; | 267 | return; |
270 | } | 268 | } |
271 | 269 | ||
272 | // Disable buttons | 270 | // Disable buttons |
273 | btnOptions->setEnabled( false ); | 271 | btnOptions->setEnabled( false ); |
274 | // btnInstall->setEnabled( false ); | 272 | // btnInstall->setEnabled( false ); |
275 | 273 | ||
276 | btnInstall->setText( tr( "Abort" ) ); | 274 | btnInstall->setText( tr( "Abort" ) ); |
277 | btnInstall->setIconSet( Resource::loadPixmap( "close" ) ); | 275 | btnInstall->setIconSet( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) ); |
278 | 276 | ||
279 | if ( pIpkg ) | 277 | if ( pIpkg ) |
280 | { | 278 | { |
281 | output->setText( "" ); | 279 | output->setText( "" ); |
282 | connect( pIpkg, SIGNAL(outputText(const QString&)), this, SLOT(displayText(const QString&))); | 280 | connect( pIpkg, SIGNAL(outputText(const QString&)), this, SLOT(displayText(const QString&))); |
283 | connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished())); | 281 | connect( pIpkg, SIGNAL(ipkgFinished()), this, SLOT(ipkgFinished())); |
284 | pIpkg->runIpkg(); | 282 | pIpkg->runIpkg(); |
285 | } | 283 | } |
286 | else | 284 | else |
287 | { | 285 | { |
288 | output->setText( "" ); | 286 | output->setText( "" ); |
289 | Destination *d = dataMgr->getDestination( destination->currentText() ); | 287 | Destination *d = dataMgr->getDestination( destination->currentText() ); |
@@ -457,21 +455,21 @@ void InstallDlgImpl :: ipkgFinished() | |||
457 | 455 | ||
458 | tmpFlags |= FORCE_REINSTALL; | 456 | tmpFlags |= FORCE_REINSTALL; |
459 | if ( item->destination->linkToRoot() && item->recreateLinks ) | 457 | if ( item->destination->linkToRoot() && item->recreateLinks ) |
460 | tmpFlags |= MAKE_LINKS; | 458 | tmpFlags |= MAKE_LINKS; |
461 | } | 459 | } |
462 | pIpkg->setFlags( tmpFlags, infoLevel ); | 460 | pIpkg->setFlags( tmpFlags, infoLevel ); |
463 | pIpkg->runIpkg(); | 461 | pIpkg->runIpkg(); |
464 | } | 462 | } |
465 | else | 463 | else |
466 | { | 464 | { |
467 | btnOptions->setEnabled( true ); | 465 | btnOptions->setEnabled( true ); |
468 | btnInstall->setText( tr( "Close" ) ); | 466 | btnInstall->setText( tr( "Close" ) ); |
469 | btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); | 467 | btnInstall->setIconSet( Opie::Core::OResource::loadPixmap( "enter", Opie::Core::OResource::SmallIcon ) ); |
470 | 468 | ||
471 | btnOptions->setText( tr( "Save output" ) ); | 469 | btnOptions->setText( tr( "Save output" ) ); |
472 | btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); | 470 | btnOptions->setIconSet( Opie::Core::OResource::loadPixmap( "save", Opie::Core::OResource::SmallIcon ) ); |
473 | 471 | ||
474 | if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) | 472 | if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) |
475 | displayAvailableSpace( destination->currentText() ); | 473 | displayAvailableSpace( destination->currentText() ); |
476 | } | 474 | } |
477 | } | 475 | } |