summaryrefslogtreecommitdiff
authordrw <drw>2004-02-13 15:14:22 (UTC)
committer drw <drw>2004-02-13 15:14:22 (UTC)
commitf3cf623e76060c8f4ee7c2eef241de02d63a2614 (patch) (side-by-side diff)
tree949651c743a703448e4109e8189c78a1db7143ea
parent97bdea970b2fb017eef7d3b03d7a316eb216266b (diff)
downloadopie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.zip
opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.gz
opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.bz2
Fix handling of filtering options in View menu
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog4
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp51
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 +1,5 @@
+2004-02-13 Dan Williams <drw@handhelds.org>
+
+ * Fix handling of filtering options in View menu
+
2004-02-12 Dan Williams <drw@handhelds.org>
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
@@ -215,7 +215,2 @@ void MainWindow::initUI()
- a = new QAction( tr( "Configure filter" ), QString::null, 0, this, 0 );
- a->setWhatsThis( tr( "Click here to change package filter criteria." ) );
- connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) );
- a->addTo( popup );
-
m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ),
@@ -227,2 +222,7 @@ void MainWindow::initUI()
+ a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 );
+ a->setWhatsThis( tr( "Click here to change the package filter criteria." ) );
+ connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) );
+ a->addTo( popup );
+
popup->insertSeparator();
@@ -556,2 +556,3 @@ void MainWindow::slotShowNotInstalled()
m_actionShowUpdated->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
@@ -576,2 +577,3 @@ void MainWindow::slotShowInstalled()
m_actionShowUpdated->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
@@ -596,2 +598,3 @@ void MainWindow::slotShowUpdated()
m_actionShowNotInstalled->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
@@ -635,4 +638,38 @@ void MainWindow::slotFilter( bool isOn )
{
- packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest,
- m_filterStatus, m_filterCategory );
+ // Turn off other filtering options
+ m_actionShowNotInstalled->setOn( false );
+ m_actionShowInstalled->setOn( false );
+ m_actionShowUpdated->setOn( false );
+
+ // If the filter settings have not been set yet, display filter dialog
+ if ( m_filterName.isNull() && m_filterServer.isNull() && m_filterDest.isNull() &&
+ m_filterStatus == OPackageManager::NotDefined && m_filterCategory.isNull() )
+ {
+ FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus,
+ m_filterCategory );
+ if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
+ {
+ m_filterName = dlg.name();
+ m_filterServer = dlg.server();
+ m_filterDest = dlg.destination();
+ m_filterStatus = dlg.status();
+ m_filterCategory = dlg.category();
+ m_actionFilter->setOn( true );
+ packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest,
+ m_filterStatus, m_filterCategory );
+ }
+ else
+ {
+ m_actionFilter->setOn( false );
+ packageList = m_packman.packages();
+ }
+ }
+ else
+ {
+ m_actionFilter->setOn( true );
+ packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest,
+ m_filterStatus, m_filterCategory );
+ }
+
+
}