summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp9
-rw-r--r--noncore/settings/aqpkg/mainwin.h1
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp34
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.h2
4 files changed, 44 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 9f19dfa..0b5a5eb 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -45,7 +45,11 @@ MainWindow :: MainWindow( QWidget *p, char *name )
45 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); 45 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S );
46 46
47 QPopupMenu *edit = new QPopupMenu( this );
48 edit->insertItem( "&Search", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_F );
49
47 // Create the main menu 50 // Create the main menu
48 QMenuBar *menu = menuBar(); //new QMenuBar( this ); 51 QMenuBar *menu = menuBar(); //new QMenuBar( this );
49 menu->insertItem( "&Settings", settings ); 52 menu->insertItem( "&Settings", settings );
53 menu->insertItem( "&Edit", edit );
50 menu->insertItem( "&Help", help ); 54 menu->insertItem( "&Help", help );
51 55
@@ -90,4 +94,9 @@ void MainWindow :: displayHelp()
90} 94}
91 95
96void MainWindow :: searchForPackage()
97{
98 networkPkgWindow->searchForPackage();
99}
100
92void MainWindow :: displayAbout() 101void MainWindow :: displayAbout()
93{ 102{
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index a9e290c..9fa0eca 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -43,4 +43,5 @@ public slots:
43 void setDocument( const QString &doc ); 43 void setDocument( const QString &doc );
44 void displayHelp(); 44 void displayHelp();
45 void searchForPackage();
45 void displayAbout(); 46 void displayAbout();
46 void displaySettings(); 47 void displaySettings();
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index ccce401..78d3df5 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -471,5 +471,5 @@ void NetworkPackageManager :: applyChanges()
471 // deal with it 471 // deal with it
472 472
473 vector<InstallData> workingPackages; 473 vector<InstallData> workingPackages;
474 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 474 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
475 item != 0 ; 475 item != 0 ;
@@ -674,2 +674,34 @@ void NetworkPackageManager :: letterPushed( QString t )
674 } while ( item != start); 674 } while ( item != start);
675} 675}
676
677
678void NetworkPackageManager :: searchForPackage()
679{
680 bool ok = FALSE;
681 QString searchText = InputDialog::getText( "Search for package", "Enter package to search for", QString::null, &ok, this ).lower();
682 if ( ok && !searchText.isEmpty() )
683 {
684 cout << "searching for " << searchText << endl;
685 // look through package list for text startng at current position
686 vector<InstallData> workingPackages;
687 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
688 if ( start != 0 )
689 start = (QCheckListItem *)start->nextSibling();
690
691 if ( start == 0 )
692 start = (QCheckListItem *)packagesList->firstChild();
693
694 for ( QCheckListItem *item = start; item != 0 ;
695 item = (QCheckListItem *)item->nextSibling() )
696 {
697 cout << "checking " << item->text().lower() << endl;
698 if ( item->text().lower().find( searchText ) != -1 )
699 {
700 cout << "matched " << item->text() << endl;
701 packagesList->ensureItemVisible( item );
702 packagesList->setCurrentItem( item );
703 break;
704 }
705 }
706 }
707} \ No newline at end of file
diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h
index 3c437b4..3a111ff 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.h
+++ b/noncore/settings/aqpkg/networkpkgmgr.h
@@ -41,5 +41,5 @@ public:
41 void selectLocalPackage( const QString &pkg ); 41 void selectLocalPackage( const QString &pkg );
42 void updateData(); 42 void updateData();
43 43 void searchForPackage();
44private: 44private:
45 DataManager *dataMgr; 45 DataManager *dataMgr;