author | drw <drw> | 2004-02-13 15:14:22 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-13 15:14:22 (UTC) |
commit | f3cf623e76060c8f4ee7c2eef241de02d63a2614 (patch) (unidiff) | |
tree | 949651c743a703448e4109e8189c78a1db7143ea | |
parent | 97bdea970b2fb017eef7d3b03d7a316eb216266b (diff) | |
download | opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.zip opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.gz opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.bz2 |
Fix handling of filtering options in View menu
-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 51 |
2 files changed, 48 insertions, 7 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index 744122f..6ad724f 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog | |||
@@ -1,3 +1,7 @@ | |||
1 | 2004-02-13 Dan Williams <drw@handhelds.org> | ||
2 | |||
3 | * Fix handling of filtering options in View menu | ||
4 | |||
1 | 2004-02-12 Dan Williams <drw@handhelds.org> | 5 | 2004-02-12 Dan Williams <drw@handhelds.org> |
2 | 6 | ||
3 | * Package information dialog implemented | 7 | * Package information dialog implemented |
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,8 +636,42 @@ void MainWindow::slotFilter( bool isOn ) | |||
633 | OPackageList *packageList; | 636 | OPackageList *packageList; |
634 | if ( isOn ) | 637 | if ( isOn ) |
635 | { | 638 | { |
636 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | 639 | // Turn off other filtering options |
637 | m_filterStatus, m_filterCategory ); | 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 ); | ||
658 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | ||
659 | m_filterStatus, m_filterCategory ); | ||
660 | } | ||
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 | |||
638 | } | 675 | } |
639 | else | 676 | else |
640 | packageList = m_packman.packages(); | 677 | packageList = m_packman.packages(); |