summaryrefslogtreecommitdiff
authorandyq <andyq>2002-11-03 12:41:54 (UTC)
committer andyq <andyq>2002-11-03 12:41:54 (UTC)
commitb9aad2af4da88816effbc09f8d609bcabaf1f492 (patch) (side-by-side diff)
treec8b260212063d2dab559656a3eb3073f1793d116
parent57e4563332689305ac247ca2e259b37c3592f389 (diff)
downloadopie-b9aad2af4da88816effbc09f8d609bcabaf1f492.zip
opie-b9aad2af4da88816effbc09f8d609bcabaf1f492.tar.gz
opie-b9aad2af4da88816effbc09f8d609bcabaf1f492.tar.bz2
Added find next facility
Diffstat (more/less context) (show 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
@@ -40,2 +40,3 @@ MainWindow :: MainWindow( QWidget *p, char *name )
QPopupMenu *help = new QPopupMenu( this );
+
help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H );
@@ -47,3 +48,4 @@ 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 );
@@ -97,3 +99,8 @@ 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
@@ -45,2 +45,3 @@ public slots:
void searchForPackage();
+ void repeatSearchForPackage();
void displayAbout();
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
@@ -677,9 +677,13 @@ 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
@@ -697,3 +701,3 @@ void NetworkPackageManager :: searchForPackage()
cout << "checking " << item->text().lower() << endl;
- if ( item->text().lower().find( searchText ) != -1 )
+ if ( item->text().lower().find( lastSearchText ) != -1 )
{
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
@@ -42,3 +42,3 @@ public:
void updateData();
- void searchForPackage();
+ void searchForPackage( bool findNext );
private:
@@ -55,2 +55,3 @@ private:
QString currentlySelectedServer;
+ QString lastSearchText;