Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 2cb11ba..8fd960f 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -213,11 +213,6 @@ void MainWindow::initUI() | |||
213 | 213 | ||
214 | popup->insertSeparator(); | 214 | popup->insertSeparator(); |
215 | 215 | ||
216 | a = new QAction( tr( "Configure filter" ), QString::null, 0, this, 0 ); | ||
217 | a->setWhatsThis( tr( "Click here to change package filter criteria." ) ); | ||
218 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | ||
219 | a->addTo( popup ); | ||
220 | |||
221 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), | 216 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), |
222 | QString::null, 0, this, 0 ); | 217 | QString::null, 0, this, 0 ); |
223 | m_actionFilter->setToggleAction( true ); | 218 | m_actionFilter->setToggleAction( true ); |
@@ -225,6 +220,11 @@ void MainWindow::initUI() | |||
225 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); | 220 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); |
226 | m_actionFilter->addTo( popup ); | 221 | m_actionFilter->addTo( popup ); |
227 | 222 | ||
223 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); | ||
224 | a->setWhatsThis( tr( "Click here to change the package filter criteria." ) ); | ||
225 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | ||
226 | a->addTo( popup ); | ||
227 | |||
228 | popup->insertSeparator(); | 228 | popup->insertSeparator(); |
229 | 229 | ||
230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
@@ -554,6 +554,7 @@ void MainWindow::slotShowNotInstalled() | |||
554 | { | 554 | { |
555 | m_actionShowInstalled->setOn( false ); | 555 | m_actionShowInstalled->setOn( false ); |
556 | m_actionShowUpdated->setOn( false ); | 556 | m_actionShowUpdated->setOn( false ); |
557 | m_actionFilter->setOn( false ); | ||
557 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 558 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
558 | OPackageManager::NotInstalled, QString::null ); | 559 | OPackageManager::NotInstalled, QString::null ); |
559 | } | 560 | } |
@@ -574,6 +575,7 @@ void MainWindow::slotShowInstalled() | |||
574 | { | 575 | { |
575 | m_actionShowNotInstalled->setOn( false ); | 576 | m_actionShowNotInstalled->setOn( false ); |
576 | m_actionShowUpdated->setOn( false ); | 577 | m_actionShowUpdated->setOn( false ); |
578 | m_actionFilter->setOn( false ); | ||
577 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 579 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
578 | OPackageManager::Installed, QString::null ); | 580 | OPackageManager::Installed, QString::null ); |
579 | } | 581 | } |
@@ -594,6 +596,7 @@ void MainWindow::slotShowUpdated() | |||
594 | { | 596 | { |
595 | m_actionShowInstalled->setOn( false ); | 597 | m_actionShowInstalled->setOn( false ); |
596 | m_actionShowNotInstalled->setOn( false ); | 598 | m_actionShowNotInstalled->setOn( false ); |
599 | m_actionFilter->setOn( false ); | ||
597 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 600 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
598 | OPackageManager::Updated, QString::null ); | 601 | OPackageManager::Updated, QString::null ); |
599 | } | 602 | } |
@@ -633,10 +636,44 @@ void MainWindow::slotFilter( bool isOn ) | |||
633 | OPackageList *packageList; | 636 | OPackageList *packageList; |
634 | if ( isOn ) | 637 | if ( isOn ) |
635 | { | 638 | { |
639 | // Turn off other filtering options | ||
640 | m_actionShowNotInstalled->setOn( false ); | ||
641 | m_actionShowInstalled->setOn( false ); | ||
642 | m_actionShowUpdated->setOn( false ); | ||
643 | |||
644 | // If the filter settings have not been set yet, display filter dialog | ||
645 | if ( m_filterName.isNull() && m_filterServer.isNull() && m_filterDest.isNull() && | ||
646 | m_filterStatus == OPackageManager::NotDefined && m_filterCategory.isNull() ) | ||
647 | { | ||
648 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, | ||
649 | m_filterCategory ); | ||
650 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | ||
651 | { | ||
652 | m_filterName = dlg.name(); | ||
653 | m_filterServer = dlg.server(); | ||
654 | m_filterDest = dlg.destination(); | ||
655 | m_filterStatus = dlg.status(); | ||
656 | m_filterCategory = dlg.category(); | ||
657 | m_actionFilter->setOn( true ); | ||
636 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | 658 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, |
637 | m_filterStatus, m_filterCategory ); | 659 | m_filterStatus, m_filterCategory ); |
638 | } | 660 | } |
639 | else | 661 | else |
662 | { | ||
663 | m_actionFilter->setOn( false ); | ||
664 | packageList = m_packman.packages(); | ||
665 | } | ||
666 | } | ||
667 | else | ||
668 | { | ||
669 | m_actionFilter->setOn( true ); | ||
670 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | ||
671 | m_filterStatus, m_filterCategory ); | ||
672 | } | ||
673 | |||
674 | |||
675 | } | ||
676 | else | ||
640 | packageList = m_packman.packages(); | 677 | packageList = m_packman.packages(); |
641 | 678 | ||
642 | if ( packageList ) | 679 | if ( packageList ) |