summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp11
-rw-r--r--noncore/settings/aqpkg/mainwin.h1
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp16
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.h3
4 files changed, 22 insertions, 9 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 0b5a5eb..3c72f2b 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -39,4 +39,5 @@ MainWindow :: MainWindow( QWidget *p, char *name )
// Create our menu
QPopupMenu *help = new QPopupMenu( this );
+
help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H );
help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A );
@@ -46,5 +47,6 @@ MainWindow :: MainWindow( QWidget *p, char *name )
QPopupMenu *edit = new QPopupMenu( this );
- edit->insertItem( "&Search", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_F );
+ edit->insertItem( "&Find", this, SLOT(searchForPackage()), Qt::CTRL+Qt::Key_F );
+ edit->insertItem( "&Find Next", this, SLOT(repeatSearchForPackage()), Qt::CTRL+Qt::Key_R );
// Create the main menu
@@ -96,5 +98,10 @@ void MainWindow :: displayHelp()
void MainWindow :: searchForPackage()
{
- networkPkgWindow->searchForPackage();
+ networkPkgWindow->searchForPackage( false );
+}
+
+void MainWindow :: repeatSearchForPackage()
+{
+ networkPkgWindow->searchForPackage( true );
}
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index 9fa0eca..267233f 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -44,4 +44,5 @@ public slots:
void displayHelp();
void searchForPackage();
+ void repeatSearchForPackage();
void displayAbout();
void displaySettings();
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 78d3df5..a058285 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -676,11 +676,15 @@ void NetworkPackageManager :: letterPushed( QString t )
-void NetworkPackageManager :: searchForPackage()
+void NetworkPackageManager :: searchForPackage( bool findNext )
{
- bool ok = FALSE;
- QString searchText = InputDialog::getText( "Search for package", "Enter package to search for", QString::null, &ok, this ).lower();
- if ( ok && !searchText.isEmpty() )
+ bool ok = false;
+ if ( !findNext || lastSearchText.isEmpty() )
+ lastSearchText = InputDialog::getText( "Search for package", "Enter package to search for", lastSearchText, &ok, this ).lower();
+ else
+ ok = true;
+
+ if ( ok && !lastSearchText.isEmpty() )
{
- cout << "searching for " << searchText << endl;
+ cout << "searching for " << lastSearchText << endl;
// look through package list for text startng at current position
vector<InstallData> workingPackages;
@@ -696,5 +700,5 @@ void NetworkPackageManager :: searchForPackage()
{
cout << "checking " << item->text().lower() << endl;
- if ( item->text().lower().find( searchText ) != -1 )
+ if ( item->text().lower().find( lastSearchText ) != -1 )
{
cout << "matched " << item->text() << endl;
diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h
index 3a111ff..20f6e2d 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.h
+++ b/noncore/settings/aqpkg/networkpkgmgr.h
@@ -41,5 +41,5 @@ public:
void selectLocalPackage( const QString &pkg );
void updateData();
- void searchForPackage();
+ void searchForPackage( bool findNext );
private:
DataManager *dataMgr;
@@ -54,4 +54,5 @@ private:
ProgressDlg *progressDlg;
QString currentlySelectedServer;
+ QString lastSearchText;
bool showJumpTo;