author | drw <drw> | 2004-11-18 23:38:33 (UTC) |
---|---|---|
committer | drw <drw> | 2004-11-18 23:38:33 (UTC) |
commit | 0619d68ccab04095418a771349875afaee40858a (patch) (side-by-side diff) | |
tree | 885784b6baaae2c3fb177c4d7e31c94b69c8d35e | |
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,4 +1,12 @@ +2004-11-18 Dan Williams <drw@handhelds.org> + + * Released version 0.5.0 + * All v1.0 functionality implemented + * Implemented installation of local packages + * Implemented linking of non-root apps (using ipkg-link) + * Many UI tweaks for installation and filter dialogs + 2004-04-21 Dan Williams <drw@handhelds.org> * Released version 0.4.0 * Added saving of ipkg configuration information 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,9 +1,9 @@ /************************************************************************ /* /* Opie - Package Manager /* ======================== -/* Version 0.4.0 +/* Version 0.5.0 /* /* A package management client for Opie /* /************************************************************************ 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 @@ /************************************************************************ /* /* Opie - Package Manager /* ======================== -/* Version 0.4.0 +/* Version 0.5.0 /* /* A package management client for Opie /* /************************************************************************ ---------------------------------------------- - To-do for Opie-PackageManager - April, 2004 ---------------------------------------------- +----------------------------------------------- + To-do for Opie-PackageManager - November, 2004 +----------------------------------------------- ====================== = Current release = ====================== -1. Link non-root destination apps -2. Implement QCOP interface for installing, removing, etc. -3. Redesign configuration dialog +1. Re-work package download dialog ====================== = Future releases = ====================== -1. ???
\ No newline at end of file +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 @@ -49,14 +49,15 @@ _;:, .> :=|. This file is free software; you can #include <sys/vfs.h> #include "opackagemanager.h" -InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, +InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, OPackage::Command command1, const QStringList &packages1, OPackage::Command command2, const QStringList &packages2, OPackage::Command command3, const QStringList &packages3 ) : QWidget( 0x0 ) , m_packman( pm ) + , m_installFound( false ) , m_numCommands( 0 ) , m_currCommand( 0 ) , m_destItem( 0x0 ) { @@ -65,29 +66,38 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap { m_command[ m_numCommands ] = command1; m_packages[ m_numCommands ] = packages1; ++m_numCommands; + + if ( command1 == OPackage::Install ) + m_installFound = true; } if ( command2 != OPackage::NotDefined ) { m_command[ m_numCommands ] = command2; m_packages[ m_numCommands ] = packages2; ++m_numCommands; + + if ( command2 == OPackage::Install ) + m_installFound = true; } if ( command3 != OPackage::NotDefined ) { m_command[ m_numCommands ] = command3; m_packages[ m_numCommands ] = packages3; ++m_numCommands; + + if ( command3 == OPackage::Install ) + m_installFound = true; } // Initialize UI if ( parent ) parent->setCaption( caption ); QGridLayout *layout = new QGridLayout( this, 4, 2, 2, 4 ); - if ( showDestInfo ) + if ( m_installFound ) { QLabel *label = new QLabel( tr( "Destination" ), this ); layout->addWidget( label, 0, 0 ); m_destination = new QComboBox( this ); @@ -219,9 +229,9 @@ void InstallDlg::slotBtnStart() } // Start was clicked, start executing QString dest; - if ( m_destination ) + if ( m_installFound ) { dest = m_destination->currentText(); m_destination->setEnabled( false ); } @@ -236,49 +246,75 @@ void InstallDlg::slotBtnStart() { m_btnStart->setEnabled( false ); } + Opie::Core::OProcess process( this ); for ( m_currCommand = 0; m_currCommand < m_numCommands; m_currCommand++ ) { // Execute next command m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, this, SLOT(slotOutput(char*)), true ); - } - slotProcessDone(0l); - // Get destination -/* - if ( dest == "root" ) + // Link/Unlink application if the package was removed from or installed to a destination + // other than root + if ( ( m_command[ m_currCommand ] == OPackage::Install && dest != "root" ) || + ( m_command[ m_currCommand ] == OPackage::Remove ) ) { - slotProcessDone(0l); - return; - } + //m_packman->findPackage( m_packages[ m_currCommand ]->destination() != "root"*/ ) - m_destItem = m_packman->findConfItem( OConfItem::Destination, dest ); - if ( m_destItem ) + // Loop through all package names in the command group + for ( QStringList::Iterator it = m_packages[ m_currCommand ].begin(); + it != m_packages[ m_currCommand ].end(); + ++it ) { - QString path = m_destItem->value(); - Opie::Core::OProcess *process = new Opie::Core::OProcess( this, "ipkg-link process" ); - connect( process, SIGNAL(processExited(Opie::Core::OProcess*)), - this, SLOT(slotProcessDone(Opie::Core::OProcess*)) ); + OPackage *currPackage = m_packman->findPackage( (*it) ); - *process << "ipkg-link" << "mount" << path; - if ( !process->start( Opie::Core::OProcess::NotifyOnExit, + // Skip package if it is not found or being removed from 'root' + if ( !currPackage || ( m_command[ m_currCommand ] == OPackage::Remove && + currPackage->destination() == "root" ) ) + continue; + + // Display feedback to user + if ( m_command[ m_currCommand ] == OPackage::Install ) + m_output->append( tr( QString( "Running ipkg-link to link package '%1'." ) + .arg( currPackage->name() ) ) ); + else + m_output->append( tr( QString( "Running ipkg-link to remove links for package '%1'." ) + .arg( currPackage->name() ) ) ); + m_output->setCursorPosition( m_output->numLines(), 0 ); + + // Execute ipkg-link + process.clearArguments(); + process << "ipkg-link" + << ( ( m_command[ m_currCommand ] == OPackage::Install ) ? "add" : "remove" ) + << currPackage->name(); + if ( !process.start( Opie::Core::OProcess::Block, Opie::Core::OProcess::NoCommunication ) ) - slotProcessDone( 0l ); - m_output->append( tr( "Starting ipkg-link to link installed applications." ) ); + { + slotProcessDone( 0x0 ); + m_output->append( tr( "Unable to run ipkg-link." ) ); m_output->setCursorPosition( m_output->numLines(), 0 ); + return; } -*/ + } + + } + } + + slotProcessDone( 0x0 ); } void InstallDlg::slotProcessDone( Opie::Core::OProcess *proc ) { - delete proc; - + if ( proc ) + { + // Display message pnly if linking was done m_output->append( tr( "The package linking is done." ) ); m_output->setCursorPosition( m_output->numLines(), 0 ); + delete proc; + } + // All commands executed, allow user to close dialog m_btnStart->setEnabled( true ); m_btnStart->setText( tr( "Close" ) ); m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); 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 @@ -54,10 +54,10 @@ class InstallDlg : public QWidget { Q_OBJECT public: - InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &caption = QString::null, - bool showDestInfo = true, + InstallDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, + const QString &caption = QString::null, OPackage::Command command1 = OPackage::NotDefined, const QStringList &packages1 = QStringList(), OPackage::Command command2 = OPackage::NotDefined, const QStringList &packages2 = QStringList(), @@ -66,8 +66,11 @@ public: private: OPackageManager *m_packman; // Pointer to application instance of package manager + bool m_installFound; // Indicates if an install is being done, controls display of + // destination selection, available space + // UI controls QComboBox *m_destination; // Destination selection list QLabel *m_availSpace; // Text label to display available space on selected destination QMultiLineEdit *m_output; // Multi-line edit to display status 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 @@ -311,9 +311,9 @@ void MainWindow::searchForPackage( const QString &text ) void MainWindow::installLocalPackage( const QString &ipkFile ) { // Install selected file - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true, + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), OPackage::Install, ipkFile ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget @@ -385,9 +385,9 @@ void MainWindow::slotStatusBar( int currStep ) void MainWindow::slotUpdate() { // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false, + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), OPackage::Update ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget @@ -397,9 +397,9 @@ void MainWindow::slotUpdate() void MainWindow::slotUpgrade() { // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false, + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), OPackage::Upgrade ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget @@ -444,9 +444,9 @@ void MainWindow::slotDownload() // Get starting directory QDir::setCurrent( workingDir ); // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), OPackage::Download, workingPackages ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget @@ -519,20 +519,17 @@ void MainWindow::slotApply() return; } // Send command only if there are packages to process - OPackage::Command removeCmd = OPackage::NotDefined; - if ( !removeList.isEmpty() ) - removeCmd = OPackage::Remove; - OPackage::Command installCmd = OPackage::NotDefined; - if ( !installList.isEmpty() ) - installCmd = OPackage::Install; - OPackage::Command upgradeCmd = OPackage::NotDefined; - if ( !upgradeList.isEmpty() ) - upgradeCmd = OPackage::Upgrade; + OPackage::Command removeCmd = !removeList.isEmpty() ? OPackage::Remove + : OPackage::NotDefined; + OPackage::Command installCmd = !installList.isEmpty() ? OPackage::Install + : OPackage::NotDefined; + OPackage::Command upgradeCmd = !upgradeList.isEmpty() ? OPackage::Upgrade + : OPackage::NotDefined; // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), !installList.isEmpty(), + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), removeCmd, removeList, installCmd, installList, upgradeCmd, upgradeList ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); 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 @@ Package: opie-packagemanager Files: plugins/application/libpackagemanager.so* bin/packagemanager pics/packagemanager apps/Settings/packagemanager.desktop Priority: optional Section: opie/settings -Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120) +Depends: task-opie-minimal, libopiecore2, libopieui2, libipkg (>=0.99.120), ipkg-link Replaces: packagemanager Architecture: arm Maintainer: Dan Williams (drw@handhelds.org) Description: Opie package management client -Version: 0.4.0$EXTRAVERSION +Version: 0.5.0$EXTRAVERSION |