author | drw <drw> | 2003-01-24 02:28:59 (UTC) |
---|---|---|
committer | drw <drw> | 2003-01-24 02:28:59 (UTC) |
commit | 342c113c3b7b3a319f49498b82def9f761c1264f (patch) (unidiff) | |
tree | 596c76aded38645435ecc9c1a1a90d603e681465 | |
parent | a6ad63972673fdb2ed9fba33c7c2e5e9cb3968b1 (diff) | |
download | opie-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).
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 92 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 3 |
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() | |||
60 | 60 | ||
61 | #ifdef QWS | ||
62 | // read download directory from config file | ||
63 | Config cfg( "aqpkg" ); | ||
64 | cfg.setGroup( "settings" ); | ||
65 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); | ||
66 | showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); | ||
67 | |||
68 | #endif | ||
69 | |||
70 | // Create UI widgets | 61 | // Create UI widgets |
@@ -90,3 +81,37 @@ MainWindow :: MainWindow() | |||
90 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); | 81 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); |
82 | |||
83 | // Quick jump toolbar | ||
84 | jumpBar = new QPEToolBar( this ); | ||
85 | addToolBar( jumpBar, QMainWindow::Top, true ); | ||
86 | jumpBar->setHorizontalStretchable( true ); | ||
87 | QWidget *w = new QWidget( jumpBar ); | ||
88 | jumpBar->setStretchableWidget( w ); | ||
91 | 89 | ||
90 | QGridLayout *layout = new QGridLayout( w ); | ||
91 | //QVBoxLayout *vbox = new QVBoxLayout( w, 0, -1 ); | ||
92 | //QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 ); | ||
93 | //QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 ); | ||
94 | |||
95 | char text[2]; | ||
96 | text[1] = '\0'; | ||
97 | for ( int i = 0 ; i < 26 ; ++i ) | ||
98 | { | ||
99 | text[0] = 'A' + i; | ||
100 | LetterPushButton *b = new LetterPushButton( text, w ); | ||
101 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | ||
102 | layout->addWidget( b, i / 13, i % 13); | ||
103 | /* | ||
104 | if ( i < 13 ) | ||
105 | hbox3->addWidget( b ); | ||
106 | else | ||
107 | hbox4->addWidget( b ); | ||
108 | */ | ||
109 | } | ||
110 | |||
111 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); | ||
112 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); | ||
113 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); | ||
114 | a->addTo( jumpBar ); | ||
115 | jumpBar->hide(); | ||
116 | |||
92 | // Packages menu | 117 | // Packages menu |
@@ -94,3 +119,3 @@ MainWindow :: MainWindow() | |||
94 | 119 | ||
95 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); | 120 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); |
96 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 121 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); |
@@ -170,2 +195,10 @@ MainWindow :: MainWindow() | |||
170 | 195 | ||
196 | |||
197 | popup->insertSeparator(); | ||
198 | |||
199 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); | ||
200 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); | ||
201 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); | ||
202 | a->addTo( popup ); | ||
203 | |||
171 | mb->insertItem( tr( "View" ), popup ); | 204 | mb->insertItem( tr( "View" ), popup ); |
@@ -239,22 +272,2 @@ void MainWindow :: initMainWidget() | |||
239 | hbox1->addWidget( serversList ); | 272 | hbox1->addWidget( serversList ); |
240 | |||
241 | |||
242 | QHBoxLayout *hbox3 = new QHBoxLayout( vbox, -1 ); | ||
243 | QHBoxLayout *hbox4 = new QHBoxLayout( vbox, -1 ); | ||
244 | |||
245 | if ( showJumpTo ) | ||
246 | { | ||
247 | char text[2]; | ||
248 | text[1] = '\0'; | ||
249 | for ( int i = 0 ; i < 26 ; ++i ) | ||
250 | { | ||
251 | text[0] = 'A' + i; | ||
252 | LetterPushButton *b = new LetterPushButton( text, networkPkgWindow ); | ||
253 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | ||
254 | if ( i < 13 ) | ||
255 | hbox3->addWidget( b ); | ||
256 | else | ||
257 | hbox4->addWidget( b ); | ||
258 | } | ||
259 | } | ||
260 | 273 | ||
@@ -281,2 +294,11 @@ void MainWindow :: init() | |||
281 | { | 294 | { |
295 | #ifdef QWS | ||
296 | // read download directory from config file | ||
297 | Config cfg( "aqpkg" ); | ||
298 | cfg.setGroup( "settings" ); | ||
299 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); | ||
300 | // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); | ||
301 | |||
302 | #endif | ||
303 | |||
282 | stack->raiseWidget( progressWindow ); | 304 | stack->raiseWidget( progressWindow ); |
@@ -355,2 +377,7 @@ void MainWindow :: displayFindBar() | |||
355 | 377 | ||
378 | void MainWindow :: displayJumpBar() | ||
379 | { | ||
380 | jumpBar->show(); | ||
381 | } | ||
382 | |||
356 | void MainWindow :: repeatFind() | 383 | void MainWindow :: repeatFind() |
@@ -371,2 +398,7 @@ void MainWindow :: hideFindBar() | |||
371 | 398 | ||
399 | void MainWindow :: hideJumpBar() | ||
400 | { | ||
401 | jumpBar->hide(); | ||
402 | } | ||
403 | |||
372 | void MainWindow :: displayAbout() | 404 | 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: | |||
50 | QPEToolBar *findBar; | 50 | QPEToolBar *findBar; |
51 | QPEToolBar *jumpBar; | ||
51 | QLineEdit *findEdit; | 52 | QLineEdit *findEdit; |
@@ -106,2 +107,3 @@ public slots: | |||
106 | void displayFindBar(); | 107 | void displayFindBar(); |
108 | void displayJumpBar(); | ||
107 | void repeatFind(); | 109 | void repeatFind(); |
@@ -109,2 +111,3 @@ public slots: | |||
109 | void hideFindBar(); | 111 | void hideFindBar(); |
112 | void hideJumpBar(); | ||
110 | void displayAbout(); | 113 | void displayAbout(); |