summaryrefslogtreecommitdiff
authordrw <drw>2003-01-24 02:28:59 (UTC)
committer drw <drw>2003-01-24 02:28:59 (UTC)
commit342c113c3b7b3a319f49498b82def9f761c1264f (patch) (side-by-side diff)
tree596c76aded38645435ecc9c1a1a90d603e681465
parenta6ad63972673fdb2ed9fba33c7c2e5e9cb3968b1 (diff)
downloadopie-342c113c3b7b3a319f49498b82def9f761c1264f.zip
opie-342c113c3b7b3a319f49498b82def9f761c1264f.tar.gz
opie-342c113c3b7b3a319f49498b82def9f761c1264f.tar.bz2
Make the quick jump to keypad a toolbar like the find bar (option in config dialog will be removed).
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp92
-rw-r--r--noncore/settings/aqpkg/mainwin.h3
2 files changed, 65 insertions, 30 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index ae073ef..a25f5a7 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -60,11 +60,2 @@ MainWindow :: MainWindow()
-#ifdef QWS
- // read download directory from config file
- Config cfg( "aqpkg" );
- cfg.setGroup( "settings" );
- currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
- showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
-
-#endif
-
// Create UI widgets
@@ -91,2 +82,36 @@ MainWindow :: MainWindow()
+ // Quick jump toolbar
+ jumpBar = new QPEToolBar( this );
+ addToolBar( jumpBar, QMainWindow::Top, true );
+ jumpBar->setHorizontalStretchable( true );
+ QWidget *w = new QWidget( jumpBar );
+ jumpBar->setStretchableWidget( w );
+
+ QGridLayout *layout = new QGridLayout( w );
+ //QVBoxLayout *vbox = new QVBoxLayout( w, 0, -1 );
+ //QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 );
+ //QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 );
+
+ char text[2];
+ text[1] = '\0';
+ for ( int i = 0 ; i < 26 ; ++i )
+ {
+ text[0] = 'A' + i;
+ LetterPushButton *b = new LetterPushButton( text, w );
+ connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) );
+ layout->addWidget( b, i / 13, i % 13);
+/*
+ if ( i < 13 )
+ hbox3->addWidget( b );
+ else
+ hbox4->addWidget( b );
+*/
+ }
+
+ QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 );
+ a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) );
+ a->addTo( jumpBar );
+ jumpBar->hide();
+
// Packages menu
@@ -94,3 +119,3 @@ MainWindow :: MainWindow()
- QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 );
+ a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 );
a->setWhatsThis( tr( "Click here to update package lists from servers." ) );
@@ -170,2 +195,10 @@ MainWindow :: MainWindow()
+
+ popup->insertSeparator();
+
+ a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 );
+ a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) );
+ a->addTo( popup );
+
mb->insertItem( tr( "View" ), popup );
@@ -240,22 +273,2 @@ void MainWindow :: initMainWidget()
-
- QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 );
- QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 );
-
- if ( showJumpTo )
- {
- char text[2];
- text[1] = '\0';
- for ( int i = 0 ; i < 26 ; ++i )
- {
- text[0] = 'A' + i;
- LetterPushButton *b = new LetterPushButton( text, networkPkgWindow );
- connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) );
- if ( i < 13 )
- hbox3->addWidget( b );
- else
- hbox4->addWidget( b );
- }
- }
-
vbox->addWidget( packagesList );
@@ -281,2 +294,11 @@ void MainWindow :: init()
{
+#ifdef QWS
+ // read download directory from config file
+ Config cfg( "aqpkg" );
+ cfg.setGroup( "settings" );
+ currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
+// showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
+
+#endif
+
stack->raiseWidget( progressWindow );
@@ -355,2 +377,7 @@ void MainWindow :: displayFindBar()
+void MainWindow :: displayJumpBar()
+{
+ jumpBar->show();
+}
+
void MainWindow :: repeatFind()
@@ -371,2 +398,7 @@ void MainWindow :: hideFindBar()
+void MainWindow :: hideJumpBar()
+{
+ jumpBar->hide();
+}
+
void MainWindow :: displayAbout()
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index be30668..b49c819 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -50,2 +50,3 @@ private:
QPEToolBar *findBar;
+ QPEToolBar *jumpBar;
QLineEdit *findEdit;
@@ -106,2 +107,3 @@ public slots:
void displayFindBar();
+ void displayJumpBar();
void repeatFind();
@@ -109,2 +111,3 @@ public slots:
void hideFindBar();
+ void hideJumpBar();
void displayAbout();