Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
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 @@ -309,14 +309,14 @@ 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, - OPackage::Install, ipkFile ); + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), + OPackage::Install, ipkFile ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget m_widgetStack.addWidget( dlg, 3 ); m_widgetStack.raiseWidget( dlg ); } @@ -383,25 +383,25 @@ void MainWindow::slotStatusBar( int currStep ) m_statusBar.setProgress( 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 m_widgetStack.addWidget( dlg, 3 ); m_widgetStack.raiseWidget( dlg ); } 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 m_widgetStack.addWidget( dlg, 3 ); m_widgetStack.raiseWidget( dlg ); @@ -442,14 +442,14 @@ void MainWindow::slotDownload() m_config.writeEntry( "DownloadDir", workingDir ); // Get starting directory QDir::setCurrent( workingDir ); // Create package manager output widget - InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, - OPackage::Download, workingPackages ); + InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), + OPackage::Download, workingPackages ); connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); // Display widget m_widgetStack.addWidget( dlg, 3 ); m_widgetStack.raiseWidget( dlg ); } @@ -517,24 +517,21 @@ void MainWindow::slotApply() { QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); 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()) ); // Display widget |