summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog4
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp47
2 files changed, 46 insertions, 5 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,4 +1,8 @@
+2004-02-13 Dan Williams <drw@handhelds.org>
+
+ * Fix handling of filtering options in View menu
+
2004-02-12 Dan Williams <drw@handhelds.org>
* Package information dialog implemented
* What's This app icon enabled
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
@@ -212,20 +212,20 @@ void MainWindow::initUI()
m_actionShowUpdated->addTo( popup );
popup->insertSeparator();
- 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" ),
QString::null, 0, this, 0 );
m_actionFilter->setToggleAction( true );
m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) );
connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) );
m_actionFilter->addTo( popup );
+ 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();
a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Click here to search for text in package names." ) );
@@ -553,8 +553,9 @@ void MainWindow::slotShowNotInstalled()
if ( m_actionShowNotInstalled->isOn() )
{
m_actionShowInstalled->setOn( false );
m_actionShowUpdated->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
OPackageManager::NotInstalled, QString::null );
}
else
@@ -573,8 +574,9 @@ void MainWindow::slotShowInstalled()
if ( m_actionShowInstalled->isOn() )
{
m_actionShowNotInstalled->setOn( false );
m_actionShowUpdated->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
OPackageManager::Installed, QString::null );
}
else
@@ -593,8 +595,9 @@ void MainWindow::slotShowUpdated()
if ( m_actionShowUpdated->isOn() )
{
m_actionShowInstalled->setOn( false );
m_actionShowNotInstalled->setOn( false );
+ m_actionFilter->setOn( false );
packageList = m_packman.filterPackages( QString::null, QString::null, QString::null,
OPackageManager::Updated, QString::null );
}
else
@@ -632,12 +635,46 @@ void MainWindow::slotFilter( bool isOn )
{
OPackageList *packageList;
if ( isOn )
{
+ // 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 );
+ }
+
+
+ }
+ else
packageList = m_packman.packages();
if ( packageList )
{