author | drw <drw> | 2004-11-18 23:38:33 (UTC) |
---|---|---|
committer | drw <drw> | 2004-11-18 23:38:33 (UTC) |
commit | 0619d68ccab04095418a771349875afaee40858a (patch) (unidiff) | |
tree | 885784b6baaae2c3fb177c4d7e31c94b69c8d35e /noncore/settings | |
parent | 770e76de2e039300a1e89f3cb0c4785a8d1c16a7 (diff) | |
download | opie-0619d68ccab04095418a771349875afaee40858a.zip opie-0619d68ccab04095418a771349875afaee40858a.tar.gz opie-0619d68ccab04095418a771349875afaee40858a.tar.bz2 |
1. Implemented linking of apps to root (thanks to zecke for getting this started for me) 2. Bumped version to 0.5.0 (all v1.0 functionality is there...I think) 3. Added package dependency on ipkg-link 4. Updated Opie-PM ChangeLog, TODO
-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 8 | ||||
-rw-r--r-- | noncore/settings/packagemanager/README | 2 | ||||
-rw-r--r-- | noncore/settings/packagemanager/TODO | 14 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 84 | ||||
-rw-r--r-- | noncore/settings/packagemanager/installdlg.h | 7 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 25 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opie-packagemanager.control | 4 |
7 files changed, 93 insertions, 51 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index c9e33c4..7799136 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog | |||
@@ -1,12 +1,20 @@ | |||
1 | 2004-11-18 Dan Williams <drw@handhelds.org> | ||
2 | |||
3 | * Released version 0.5.0 | ||
4 | * All v1.0 functionality implemented | ||
5 | * Implemented installation of local packages | ||
6 | * Implemented linking of non-root apps (using ipkg-link) | ||
7 | * Many UI tweaks for installation and filter dialogs | ||
8 | |||
1 | 2004-04-21 Dan Williams <drw@handhelds.org> | 9 | 2004-04-21 Dan Williams <drw@handhelds.org> |
2 | 10 | ||
3 | * Released version 0.4.0 | 11 | * Released version 0.4.0 |
4 | * Added saving of ipkg configuration information | 12 | * Added saving of ipkg configuration information |
5 | * Re-initialize ipkg when configuration information changes | 13 | * Re-initialize ipkg when configuration information changes |
6 | * Added QWhatsThis for all UI controls | 14 | * Added QWhatsThis for all UI controls |
7 | * Remove Location from OConfItem as it is not used/needed | 15 | * Remove Location from OConfItem as it is not used/needed |
8 | * Re-ordered includes to follow Opie standards | 16 | * Re-ordered includes to follow Opie standards |
9 | 17 | ||
10 | 2004-02-13 Dan Williams <drw@handhelds.org> | 18 | 2004-02-13 Dan Williams <drw@handhelds.org> |
11 | 19 | ||
12 | * Released version 0.3.0 | 20 | * Released version 0.3.0 |
diff --git a/noncore/settings/packagemanager/README b/noncore/settings/packagemanager/README index bf93c98..c34a6af 100644 --- a/noncore/settings/packagemanager/README +++ b/noncore/settings/packagemanager/README | |||
@@ -1,17 +1,17 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | /* | 2 | /* |
3 | /* Opie - Package Manager | 3 | /* Opie - Package Manager |
4 | /* ======================== | 4 | /* ======================== |
5 | /* Version 0.4.0 | 5 | /* Version 0.5.0 |
6 | /* | 6 | /* |
7 | /* A package management client for Opie | 7 | /* A package management client for Opie |
8 | /* | 8 | /* |
9 | /************************************************************************ | 9 | /************************************************************************ |
10 | 10 | ||
11 | ------------------------------------------------------- | 11 | ------------------------------------------------------- |
12 | Release Notes for Opie-PackageManager - January, 2004 | 12 | Release Notes for Opie-PackageManager - January, 2004 |
13 | ------------------------------------------------------- | 13 | ------------------------------------------------------- |
14 | 14 | ||
15 | ====================== | 15 | ====================== |
16 | = To-do = | 16 | = To-do = |
17 | ====================== | 17 | ====================== |
diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO index 633c589..265beda 100644 --- a/noncore/settings/packagemanager/TODO +++ b/noncore/settings/packagemanager/TODO | |||
@@ -1,27 +1,25 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | /* | 2 | /* |
3 | /* Opie - Package Manager | 3 | /* Opie - Package Manager |
4 | /* ======================== | 4 | /* ======================== |
5 | /* Version 0.4.0 | 5 | /* Version 0.5.0 |
6 | /* | 6 | /* |
7 | /* A package management client for Opie | 7 | /* A package management client for Opie |
8 | /* | 8 | /* |
9 | /************************************************************************ | 9 | /************************************************************************ |
10 | 10 | ||
11 | --------------------------------------------- | 11 | ----------------------------------------------- |
12 | To-do for Opie-PackageManager - April, 2004 | 12 | To-do for Opie-PackageManager - November, 2004 |
13 | --------------------------------------------- | 13 | ----------------------------------------------- |
14 | 14 | ||
15 | ====================== | 15 | ====================== |
16 | = Current release = | 16 | = Current release = |
17 | ====================== | 17 | ====================== |
18 | 18 | ||
19 | 1. Link non-root destination apps | 19 | 1. Re-work package download dialog |
20 | 2. Implement QCOP interface for installing, removing, etc. | ||
21 | 3. Redesign configuration dialog | ||
22 | 20 | ||
23 | ====================== | 21 | ====================== |
24 | = Future releases = | 22 | = Future releases = |
25 | ====================== | 23 | ====================== |
26 | 24 | ||
27 | 1. ??? \ No newline at end of file | 25 | 1. Re-work server and destination tabs in configuration dialog \ No newline at end of file |
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 781f8f5..494603b 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp | |||
@@ -41,61 +41,71 @@ _;:, .> :=|. This file is free software; you can | |||
41 | #include <qfileinfo.h> | 41 | #include <qfileinfo.h> |
42 | #include <qgroupbox.h> | 42 | #include <qgroupbox.h> |
43 | #include <qlabel.h> | 43 | #include <qlabel.h> |
44 | #include <qlayout.h> | 44 | #include <qlayout.h> |
45 | #include <qmap.h> | 45 | #include <qmap.h> |
46 | #include <qmultilineedit.h> | 46 | #include <qmultilineedit.h> |
47 | #include <qpushbutton.h> | 47 | #include <qpushbutton.h> |
48 | 48 | ||
49 | #include <sys/vfs.h> | 49 | #include <sys/vfs.h> |
50 | 50 | ||
51 | #include "opackagemanager.h" | 51 | #include "opackagemanager.h" |
52 | 52 | ||
53 | InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, | 53 | InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, |
54 | OPackage::Command command1, const QStringList &packages1, | 54 | OPackage::Command command1, const QStringList &packages1, |
55 | OPackage::Command command2, const QStringList &packages2, | 55 | OPackage::Command command2, const QStringList &packages2, |
56 | OPackage::Command command3, const QStringList &packages3 ) | 56 | OPackage::Command command3, const QStringList &packages3 ) |
57 | : QWidget( 0x0 ) | 57 | : QWidget( 0x0 ) |
58 | , m_packman( pm ) | 58 | , m_packman( pm ) |
59 | , m_installFound( false ) | ||
59 | , m_numCommands( 0 ) | 60 | , m_numCommands( 0 ) |
60 | , m_currCommand( 0 ) | 61 | , m_currCommand( 0 ) |
61 | , m_destItem( 0x0 ) | 62 | , m_destItem( 0x0 ) |
62 | { | 63 | { |
63 | // Save command/package list information | 64 | // Save command/package list information |
64 | if ( command1 != OPackage::NotDefined ) | 65 | if ( command1 != OPackage::NotDefined ) |
65 | { | 66 | { |
66 | m_command[ m_numCommands ] = command1; | 67 | m_command[ m_numCommands ] = command1; |
67 | m_packages[ m_numCommands ] = packages1; | 68 | m_packages[ m_numCommands ] = packages1; |
68 | ++m_numCommands; | 69 | ++m_numCommands; |
70 | |||
71 | if ( command1 == OPackage::Install ) | ||
72 | m_installFound = true; | ||
69 | } | 73 | } |
70 | if ( command2 != OPackage::NotDefined ) | 74 | if ( command2 != OPackage::NotDefined ) |
71 | { | 75 | { |
72 | m_command[ m_numCommands ] = command2; | 76 | m_command[ m_numCommands ] = command2; |
73 | m_packages[ m_numCommands ] = packages2; | 77 | m_packages[ m_numCommands ] = packages2; |
74 | ++m_numCommands; | 78 | ++m_numCommands; |
79 | |||
80 | if ( command2 == OPackage::Install ) | ||
81 | m_installFound = true; | ||
75 | } | 82 | } |
76 | if ( command3 != OPackage::NotDefined ) | 83 | if ( command3 != OPackage::NotDefined ) |
77 | { | 84 | { |
78 | m_command[ m_numCommands ] = command3; | 85 | m_command[ m_numCommands ] = command3; |
79 | m_packages[ m_numCommands ] = packages3; | 86 | m_packages[ m_numCommands ] = packages3; |
80 | ++m_numCommands; | 87 | ++m_numCommands; |
88 | |||
89 | if ( command3 == OPackage::Install ) | ||
90 | m_installFound = true; | ||
81 | } | 91 | } |
82 | 92 | ||
83 | // Initialize UI | 93 | // Initialize UI |
84 | if ( parent ) | 94 | if ( parent ) |
85 | parent->setCaption( caption ); | 95 | parent->setCaption( caption ); |
86 | 96 | ||
87 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); | 97 | QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); |
88 | 98 | ||
89 | if ( showDestInfo ) | 99 | if ( m_installFound ) |
90 | { | 100 | { |
91 | QLabel *label = new QLabel( tr( "Destination" ), this ); | 101 | QLabel *label = new QLabel( tr( "Destination" ), this ); |
92 | layout->addWidget( label, 0, 0 ); | 102 | layout->addWidget( label, 0, 0 ); |
93 | m_destination = new QComboBox( this ); | 103 | m_destination = new QComboBox( this ); |
94 | m_destination->insertStringList( m_packman->destinations() ); | 104 | m_destination->insertStringList( m_packman->destinations() ); |
95 | layout->addWidget( m_destination, 0, 1 ); | 105 | layout->addWidget( m_destination, 0, 1 ); |
96 | connect( m_destination, SIGNAL(highlighted(const QString&)), | 106 | connect( m_destination, SIGNAL(highlighted(const QString&)), |
97 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); | 107 | this, SLOT(slotDisplayAvailSpace(const QString&)) ); |
98 | 108 | ||
99 | label = new QLabel( tr( "Space Avail" ), this ); | 109 | label = new QLabel( tr( "Space Avail" ), this ); |
100 | layout->addWidget( label, 1, 0 ); | 110 | layout->addWidget( label, 1, 0 ); |
101 | m_availSpace = new QLabel( this ); | 111 | m_availSpace = new QLabel( this ); |
@@ -211,82 +221,108 @@ void InstallDlg::slotBtnStart() | |||
211 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); | 221 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); |
212 | return; | 222 | return; |
213 | } | 223 | } |
214 | else if ( btnText == tr( "Close" ) ) | 224 | else if ( btnText == tr( "Close" ) ) |
215 | { | 225 | { |
216 | // TODO - force reload of package data | 226 | // TODO - force reload of package data |
217 | emit closeInstallDlg(); | 227 | emit closeInstallDlg(); |
218 | return; | 228 | return; |
219 | } | 229 | } |
220 | 230 | ||
221 | // Start was clicked, start executing | 231 | // Start was clicked, start executing |
222 | QString dest; | 232 | QString dest; |
223 | if ( m_destination ) | 233 | if ( m_installFound ) |
224 | { | 234 | { |
225 | dest = m_destination->currentText(); | 235 | dest = m_destination->currentText(); |
226 | m_destination->setEnabled( false ); | 236 | m_destination->setEnabled( false ); |
227 | } | 237 | } |
228 | 238 | ||
229 | m_btnOptions->setEnabled( false ); | 239 | m_btnOptions->setEnabled( false ); |
230 | if ( m_numCommands > 1 ) | 240 | if ( m_numCommands > 1 ) |
231 | { | 241 | { |
232 | m_btnStart->setText( tr( "Abort" ) ); | 242 | m_btnStart->setText( tr( "Abort" ) ); |
233 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); | 243 | m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); |
234 | } | 244 | } |
235 | else | 245 | else |
236 | { | 246 | { |
237 | m_btnStart->setEnabled( false ); | 247 | m_btnStart->setEnabled( false ); |
238 | } | 248 | } |
239 | 249 | ||
250 | Opie::Core::OProcess process( this ); | ||
240 | for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) | 251 | for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) |
241 | { | 252 | { |
242 | // Execute next command | 253 | // Execute next command |
243 | m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, | 254 | m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, |
244 | this, SLOT(slotOutput(char*)), true ); | 255 | this, SLOT(slotOutput(char*)), true ); |
245 | } | ||
246 | slotProcessDone(0l); | ||
247 | 256 | ||
248 | // Get destination | 257 | // Link/Unlink application if the package was removed from or installed to a destination |
249 | /* | 258 | // other than root |
250 | if ( dest == "root" ) | 259 | if ( ( m_command[ m_currCommand ] == OPackage::Install && dest != "root" ) || |
260 | ( m_command[ m_currCommand ] == OPackage::Remove ) ) | ||
251 | { | 261 | { |
252 | slotProcessDone(0l); | 262 | //m_packman->findPackage( m_packages[ m_currCommand ]->destination() != "root"*/ ) |
253 | return; | ||
254 | } | ||
255 | 263 | ||
256 | m_destItem = m_packman->findConfItem( OConfItem::Destination, dest ); | 264 | // Loop through all package names in the command group |
257 | if ( m_destItem ) | 265 | for ( QStringList::Iterator it = m_packages[ m_currCommand ].begin(); |
266 | it != m_packages[ m_currCommand ].end(); | ||
267 | ++it ) | ||
258 | { | 268 | { |
259 | QString path = m_destItem->value(); | 269 | OPackage *currPackage = m_packman->findPackage( (*it) ); |
260 | Opie::Core::OProcess *process = new Opie::Core::OProcess( this, "ipkg-link process" ); | ||
261 | connect( process, SIGNAL(processExited(Opie::Core::OProcess*)), | ||
262 | this, SLOT(slotProcessDone(Opie::Core::OProcess*)) ); | ||
263 | 270 | ||
264 | *process << "ipkg-link" << "mount" << path; | 271 | // Skip package if it is not found or being removed from 'root' |
265 | if ( !process->start( Opie::Core::OProcess::NotifyOnExit, | 272 | if ( !currPackage || ( m_command[ m_currCommand ] == OPackage::Remove && |
273 | currPackage->destination() == "root" ) ) | ||
274 | continue; | ||
275 | |||
276 | // Display feedback to user | ||
277 | if ( m_command[ m_currCommand ] == OPackage::Install ) | ||
278 | m_output->append( tr( QString( "Running ipkg-link to link package '%1'." ) | ||
279 | .arg( currPackage->name() ) ) ); | ||
280 | else | ||
281 | m_output->append( tr( QString( "Running ipkg-link to remove links for package '%1'." ) | ||
282 | .arg( currPackage->name() ) ) ); | ||
283 | m_output->setCursorPosition( m_output->numLines(), 0 ); | ||
284 | |||
285 | // Execute ipkg-link | ||
286 | process.clearArguments(); | ||
287 | process << "ipkg-link" | ||
288 | << ( ( m_command[ m_currCommand ] == OPackage::Install ) ? "add" : "remove" ) | ||
289 | << currPackage->name(); | ||
290 | if ( !process.start( Opie::Core::OProcess::Block, | ||
266 | Opie::Core::OProcess::NoCommunication ) ) | 291 | Opie::Core::OProcess::NoCommunication ) ) |
267 | slotProcessDone( 0l ); | 292 | { |
268 | m_output->append( tr( "Starting ipkg-link to link installed applications." ) ); | 293 | slotProcessDone( 0x0 ); |
294 | m_output->append( tr( "Unable to run ipkg-link." ) ); | ||
269 | m_output->setCursorPosition( m_output->numLines(), 0 ); | 295 | m_output->setCursorPosition( m_output->numLines(), 0 ); |
296 | return; | ||
270 | } | 297 | } |
271 | */ | 298 | } |
299 | |||
300 | } | ||
301 | } | ||
302 | |||
303 | slotProcessDone( 0x0 ); | ||
272 | } | 304 | } |
273 | 305 | ||
274 | void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc ) | 306 | void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc ) |
275 | { | 307 | { |
276 | delete proc; | 308 | if ( proc ) |
277 | 309 | { | |
310 | // Display message pnly if linking was done | ||
278 | m_output->append( tr( "The package linking is done." ) ); | 311 | m_output->append( tr( "The package linking is done." ) ); |
279 | m_output->setCursorPosition( m_output->numLines(), 0 ); | 312 | m_output->setCursorPosition( m_output->numLines(), 0 ); |
280 | 313 | ||
314 | delete proc; | ||
315 | } | ||
316 | |||
281 | // All commands executed, allow user to close dialog | 317 | // All commands executed, allow user to close dialog |
282 | m_btnStart->setEnabled( true ); | 318 | m_btnStart->setEnabled( true ); |
283 | m_btnStart->setText( tr( "Close" ) ); | 319 | m_btnStart->setText( tr( "Close" ) ); |
284 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); | 320 | m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); |
285 | 321 | ||
286 | m_btnOptions->setEnabled( true ); | 322 | m_btnOptions->setEnabled( true ); |
287 | m_btnOptions->setText( tr( "Save output" ) ); | 323 | m_btnOptions->setText( tr( "Save output" ) ); |
288 | m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); | 324 | m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); |
289 | } | 325 | } |
290 | 326 | ||
291 | void InstallDlg::slotBtnOptions() | 327 | void InstallDlg::slotBtnOptions() |
292 | { | 328 | { |
diff --git a/noncore/settings/packagemanager/installdlg.h b/noncore/settings/packagemanager/installdlg.h index f45c17c..eabb717 100644 --- a/noncore/settings/packagemanager/installdlg.h +++ b/noncore/settings/packagemanager/installdlg.h | |||
@@ -46,36 +46,39 @@ namespace Opie | |||
46 | { | 46 | { |
47 | namespace Core | 47 | namespace Core |
48 | { | 48 | { |
49 | class OProcess; | 49 | class OProcess; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | class InstallDlg : public QWidget | 53 | class InstallDlg : public QWidget |
54 | { | 54 | { |
55 | Q_OBJECT | 55 | Q_OBJECT |
56 | 56 | ||
57 | public: | 57 | public: |
58 | InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &caption = QString::null, | 58 | InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, |
59 | bool showDestInfo = true, | 59 | const QString &caption = QString::null, |
60 | OPackage::Command command1 = OPackage::NotDefined, | 60 | OPackage::Command command1 = OPackage::NotDefined, |
61 | const QStringList &packages1 = QStringList(), | 61 | const QStringList &packages1 = QStringList(), |
62 | OPackage::Command command2 = OPackage::NotDefined, | 62 | OPackage::Command command2 = OPackage::NotDefined, |
63 | const QStringList &packages2 = QStringList(), | 63 | const QStringList &packages2 = QStringList(), |
64 | OPackage::Command command3 = OPackage::NotDefined, | 64 | OPackage::Command command3 = OPackage::NotDefined, |
65 | const QStringList &packages3 = QStringList() ); | 65 | const QStringList &packages3 = QStringList() ); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | OPackageManager *m_packman; // Pointer to application instance of package manager | 68 | OPackageManager *m_packman; // Pointer to application instance of package manager |
69 | 69 | ||
70 | bool m_installFound; // Indicates if an install is being done, controls display of | ||
71 | // destination selection, available space | ||
72 | |||
70 | // UI controls | 73 | // UI controls |
71 | QComboBox *m_destination; // Destination selection list | 74 | QComboBox *m_destination; // Destination selection list |
72 | QLabel *m_availSpace; // Text label to display available space on selected destination | 75 | QLabel *m_availSpace; // Text label to display available space on selected destination |
73 | QMultiLineEdit *m_output; // Multi-line edit to display status | 76 | QMultiLineEdit *m_output; // Multi-line edit to display status |
74 | QPushButton *m_btnStart; // Start/abort/close button | 77 | QPushButton *m_btnStart; // Start/abort/close button |
75 | QPushButton *m_btnOptions; // Installation options button | 78 | QPushButton *m_btnOptions; // Installation options button |
76 | 79 | ||
77 | // Commands and packages to execute | 80 | // Commands and packages to execute |
78 | int m_numCommands; // Number of commands to be executed | 81 | int m_numCommands; // Number of commands to be executed |
79 | int m_currCommand; // Number of currently executing command | 82 | int m_currCommand; // Number of currently executing command |
80 | OPackage::Command m_command[3]; // List of commands to be executed | 83 | OPackage::Command m_command[3]; // List of commands to be executed |
81 | QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) | 84 | QStringList m_packages[3]; // Lists of package names associated to commands (m_command[]) |
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 459a75b..8a5b90c 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -303,25 +303,25 @@ void MainWindow::searchForPackage( const QString &text ) | |||
303 | { | 303 | { |
304 | m_packageList.ensureItemVisible( item ); | 304 | m_packageList.ensureItemVisible( item ); |
305 | m_packageList.setCurrentItem( item ); | 305 | m_packageList.setCurrentItem( item ); |
306 | break; | 306 | break; |
307 | } | 307 | } |
308 | } | 308 | } |
309 | } | 309 | } |
310 | } | 310 | } |
311 | 311 | ||
312 | void MainWindow::installLocalPackage( const QString &ipkFile ) | 312 | void MainWindow::installLocalPackage( const QString &ipkFile ) |
313 | { | 313 | { |
314 | // Install selected file | 314 | // Install selected file |
315 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true, | 315 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), |
316 | OPackage::Install, ipkFile ); | 316 | OPackage::Install, ipkFile ); |
317 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 317 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
318 | 318 | ||
319 | // Display widget | 319 | // Display widget |
320 | m_widgetStack.addWidget( dlg, 3 ); | 320 | m_widgetStack.addWidget( dlg, 3 ); |
321 | m_widgetStack.raiseWidget( dlg ); | 321 | m_widgetStack.raiseWidget( dlg ); |
322 | } | 322 | } |
323 | 323 | ||
324 | void MainWindow::setDocument( const QString &ipkFile ) | 324 | void MainWindow::setDocument( const QString &ipkFile ) |
325 | { | 325 | { |
326 | QString file = ipkFile; | 326 | QString file = ipkFile; |
327 | DocLnk lnk( ipkFile ); | 327 | DocLnk lnk( ipkFile ); |
@@ -377,37 +377,37 @@ void MainWindow::slotStatusText( const QString &status ) | |||
377 | { | 377 | { |
378 | m_statusText.setText( status ); | 378 | m_statusText.setText( status ); |
379 | } | 379 | } |
380 | 380 | ||
381 | void MainWindow::slotStatusBar( int currStep ) | 381 | void MainWindow::slotStatusBar( int currStep ) |
382 | { | 382 | { |
383 | m_statusBar.setProgress( currStep ); | 383 | m_statusBar.setProgress( currStep ); |
384 | } | 384 | } |
385 | 385 | ||
386 | void MainWindow::slotUpdate() | 386 | void MainWindow::slotUpdate() |
387 | { | 387 | { |
388 | // Create package manager output widget | 388 | // Create package manager output widget |
389 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false, | 389 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), |
390 | OPackage::Update ); | 390 | OPackage::Update ); |
391 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 391 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
392 | 392 | ||
393 | // Display widget | 393 | // Display widget |
394 | m_widgetStack.addWidget( dlg, 3 ); | 394 | m_widgetStack.addWidget( dlg, 3 ); |
395 | m_widgetStack.raiseWidget( dlg ); | 395 | m_widgetStack.raiseWidget( dlg ); |
396 | } | 396 | } |
397 | 397 | ||
398 | void MainWindow::slotUpgrade() | 398 | void MainWindow::slotUpgrade() |
399 | { | 399 | { |
400 | // Create package manager output widget | 400 | // Create package manager output widget |
401 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false, | 401 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), |
402 | OPackage::Upgrade ); | 402 | OPackage::Upgrade ); |
403 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 403 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
404 | 404 | ||
405 | // Display widget | 405 | // Display widget |
406 | m_widgetStack.addWidget( dlg, 3 ); | 406 | m_widgetStack.addWidget( dlg, 3 ); |
407 | m_widgetStack.raiseWidget( dlg ); | 407 | m_widgetStack.raiseWidget( dlg ); |
408 | } | 408 | } |
409 | 409 | ||
410 | void MainWindow::slotDownload() | 410 | void MainWindow::slotDownload() |
411 | { | 411 | { |
412 | // Retrieve list of packages selected for download (if any) | 412 | // Retrieve list of packages selected for download (if any) |
413 | QStringList workingPackages; | 413 | QStringList workingPackages; |
@@ -436,25 +436,25 @@ void MainWindow::slotDownload() | |||
436 | if ( ok && !text.isEmpty() ) | 436 | if ( ok && !text.isEmpty() ) |
437 | workingDir = text; // user entered something and pressed ok | 437 | workingDir = text; // user entered something and pressed ok |
438 | else | 438 | else |
439 | return; // user entered nothing or pressed cancel | 439 | return; // user entered nothing or pressed cancel |
440 | 440 | ||
441 | // Store download directory in config file | 441 | // Store download directory in config file |
442 | m_config.writeEntry( "DownloadDir", workingDir ); | 442 | m_config.writeEntry( "DownloadDir", workingDir ); |
443 | 443 | ||
444 | // Get starting directory | 444 | // Get starting directory |
445 | QDir::setCurrent( workingDir ); | 445 | QDir::setCurrent( workingDir ); |
446 | 446 | ||
447 | // Create package manager output widget | 447 | // Create package manager output widget |
448 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, | 448 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), |
449 | OPackage::Download, workingPackages ); | 449 | OPackage::Download, workingPackages ); |
450 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 450 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
451 | 451 | ||
452 | // Display widget | 452 | // Display widget |
453 | m_widgetStack.addWidget( dlg, 3 ); | 453 | m_widgetStack.addWidget( dlg, 3 ); |
454 | m_widgetStack.raiseWidget( dlg ); | 454 | m_widgetStack.raiseWidget( dlg ); |
455 | } | 455 | } |
456 | } | 456 | } |
457 | 457 | ||
458 | void MainWindow::slotApply() | 458 | void MainWindow::slotApply() |
459 | { | 459 | { |
460 | QStringList removeList; | 460 | QStringList removeList; |
@@ -511,36 +511,33 @@ void MainWindow::slotApply() | |||
511 | } | 511 | } |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | // If nothing is selected, display message and exit | 515 | // If nothing is selected, display message and exit |
516 | if ( removeList.isEmpty() && installList.isEmpty() && upgradeList.isEmpty() ) | 516 | if ( removeList.isEmpty() && installList.isEmpty() && upgradeList.isEmpty() ) |
517 | { | 517 | { |
518 | QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); | 518 | QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); |
519 | return; | 519 | return; |
520 | } | 520 | } |
521 | 521 | ||
522 | // Send command only if there are packages to process | 522 | // Send command only if there are packages to process |
523 | OPackage::Command removeCmd = OPackage::NotDefined; | 523 | OPackage::Command removeCmd = !removeList.isEmpty() ? OPackage::Remove |
524 | if ( !removeList.isEmpty() ) | 524 | : OPackage::NotDefined; |
525 | removeCmd = OPackage::Remove; | 525 | OPackage::Command installCmd = !installList.isEmpty() ? OPackage::Install |
526 | OPackage::Command installCmd = OPackage::NotDefined; | 526 | : OPackage::NotDefined; |
527 | if ( !installList.isEmpty() ) | 527 | OPackage::Command upgradeCmd = !upgradeList.isEmpty() ? OPackage::Upgrade |
528 | installCmd = OPackage::Install; | 528 | : OPackage::NotDefined; |
529 | OPackage::Command upgradeCmd = OPackage::NotDefined; | ||
530 | if ( !upgradeList.isEmpty() ) | ||
531 | upgradeCmd = OPackage::Upgrade; | ||
532 | 529 | ||
533 | // Create package manager output widget | 530 | // Create package manager output widget |
534 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), !installList.isEmpty(), | 531 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), |
535 | removeCmd, removeList, | 532 | removeCmd, removeList, |
536 | installCmd, installList, | 533 | installCmd, installList, |
537 | upgradeCmd, upgradeList ); | 534 | upgradeCmd, upgradeList ); |
538 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 535 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
539 | 536 | ||
540 | // Display widget | 537 | // Display widget |
541 | m_widgetStack.addWidget( dlg, 3 ); | 538 | m_widgetStack.addWidget( dlg, 3 ); |
542 | m_widgetStack.raiseWidget( dlg ); | 539 | m_widgetStack.raiseWidget( dlg ); |
543 | } | 540 | } |
544 | 541 | ||
545 | void MainWindow::slotInstallLocal() | 542 | void MainWindow::slotInstallLocal() |
546 | { | 543 | { |
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control index 5385ea5..aacd0ca 100644 --- a/noncore/settings/packagemanager/opie-packagemanager.control +++ b/noncore/settings/packagemanager/opie-packagemanager.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-packagemanager | 1 | Package: opie-packagemanager |
2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop | 2 | Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120) | 5 | Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120), ipkg-link |
6 | Replaces: packagemanager | 6 | Replaces: packagemanager |
7 | Architecture: arm | 7 | Architecture: arm |
8 | Maintainer: Dan Williams (drw@handhelds.org) | 8 | Maintainer: Dan Williams (drw@handhelds.org) |
9 | Description: Opie package management client | 9 | Description: Opie package management client |
10 | Version: 0.4.0$EXTRAVERSION | 10 | Version: 0.5.0$EXTRAVERSION |