Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 5ccd3c3..0141359 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -49,16 +49,19 @@ MainWindow :: MainWindow( QWidget *p, char *name ) edit = new QPopupMenu( this );
edit->insertItem( "&Find", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_I );
edit->insertItem( "Find &Next", this, SLOT(repeatSearchForPackage()), Qt::CTRL+Qt::Key_N );
filter = new QPopupMenu( this );
mnuShowUninstalledPkgsId = filter->insertItem( "Show &Uninstalled Packages", this, SLOT(filterUninstalledPackages()), Qt::CTRL+Qt::Key_U );
mnuShowInstalledPkgsId = filter->insertItem( "Show In&stalled Packages", this, SLOT(filterInstalledPackages()), Qt::CTRL+Qt::Key_S );
mnuShowUpgradedPkgsId = filter->insertItem( "Show U&pdated Packages", this, SLOT(filterUpgradedPackages()), Qt::CTRL+Qt::Key_P );
+ filter->insertSeparator(); + mnuFilterByCategory = filter->insertItem( "Filter By &Category", this, SLOT(filterCategory()), Qt::CTRL+Qt::Key_C ); + mnuSetFilterCategory = filter->insertItem( "Set Filter C&ategory", this, SLOT(setFilterCategory()), Qt::CTRL+Qt::Key_A ); // Create the main menu
menu = menuBar(); //new QMenuBar( this );
menu->insertItem( "&Settings", settings );
menu->insertItem( "&Edit", edit );
menu->insertItem( "&Filter", filter );
menu->insertItem( "&Help", help );
@@ -179,8 +182,28 @@ void MainWindow :: filterUpgradedPackages() filter->setItemChecked( mnuShowUninstalledPkgsId, false );
networkPkgWindow->showOnlyUninstalledPackages( false );
filter->setItemChecked( mnuShowInstalledPkgsId, false );
networkPkgWindow->showOnlyInstalledPackages( false );
networkPkgWindow->showUpgradedPackages( val );
}
+ +void MainWindow :: setFilterCategory() +{ + if ( networkPkgWindow->setFilterCategory( ) ) + filter->setItemChecked( mnuFilterByCategory, true ); +} + +void MainWindow :: filterCategory() +{ + if ( filter->isItemChecked( mnuFilterByCategory ) ) + { + networkPkgWindow->filterByCategory( false ); + filter->setItemChecked( mnuFilterByCategory, false ); + } + else + { + if ( networkPkgWindow->filterByCategory( true ) ) + filter->setItemChecked( mnuFilterByCategory, true ); + } +}
\ No newline at end of file |