author | harlekin <harlekin> | 2003-04-10 21:14:03 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-04-10 21:14:03 (UTC) |
commit | 6f7b120de8f4b883e709386882f3fe8ed925d0da (patch) (unidiff) | |
tree | 2935f95a527e146a78b8459dbb02711093864df1 /noncore/settings | |
parent | 91867cb8a9a35c89a357bb6f20677f680709e357 (diff) | |
download | opie-6f7b120de8f4b883e709386882f3fe8ed925d0da.zip opie-6f7b120de8f4b883e709386882f3fe8ed925d0da.tar.gz opie-6f7b120de8f4b883e709386882f3fe8ed925d0da.tar.bz2 |
qpetoolbar and qpemenubar are depreciated
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 130 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.h | 6 |
2 files changed, 68 insertions, 68 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index b597e03..6ea619c 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -18,11 +18,11 @@ | |||
18 | #include <linux/limits.h> | 18 | #include <linux/limits.h> |
19 | #include <unistd.h> | 19 | #include <unistd.h> |
20 | 20 | ||
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | #include <qpe/qpemenubar.h> | 22 | #include <qmenubar.h> |
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/qpetoolbar.h> | 24 | #include <qtoolbar.h> |
25 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | 27 | ||
28 | #include <qaction.h> | 28 | #include <qaction.h> |
@@ -60,34 +60,34 @@ MainWindow :: MainWindow() | |||
60 | 60 | ||
61 | // Create UI widgets | 61 | // Create UI widgets |
62 | initMainWidget(); | 62 | initMainWidget(); |
63 | initProgressWidget(); | 63 | initProgressWidget(); |
64 | 64 | ||
65 | // Build menu and tool bars | 65 | // Build menu and tool bars |
66 | setToolBarsMovable( FALSE ); | 66 | setToolBarsMovable( FALSE ); |
67 | 67 | ||
68 | QPEToolBar *bar = new QPEToolBar( this ); | 68 | QToolBar *bar = new QToolBar( this ); |
69 | bar->setHorizontalStretchable( TRUE ); | 69 | bar->setHorizontalStretchable( TRUE ); |
70 | QPEMenuBar *mb = new QPEMenuBar( bar ); | 70 | QMenuBar *mb = new QMenuBar( bar ); |
71 | mb->setMargin( 0 ); | 71 | mb->setMargin( 0 ); |
72 | bar = new QPEToolBar( this ); | 72 | bar = new QToolBar( this ); |
73 | 73 | ||
74 | // Find toolbar | 74 | // Find toolbar |
75 | findBar = new QPEToolBar( this ); | 75 | findBar = new QToolBar( this ); |
76 | addToolBar( findBar, QMainWindow::Top, true ); | 76 | addToolBar( findBar, QMainWindow::Top, true ); |
77 | findBar->setHorizontalStretchable( true ); | 77 | findBar->setHorizontalStretchable( true ); |
78 | findEdit = new QLineEdit( findBar ); | 78 | findEdit = new QLineEdit( findBar ); |
79 | QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); | 79 | QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); |
80 | findBar->setStretchableWidget( findEdit ); | 80 | findBar->setStretchableWidget( findEdit ); |
81 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); | 81 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); |
82 | 82 | ||
83 | // Quick jump toolbar | 83 | // Quick jump toolbar |
84 | jumpBar = new QPEToolBar( this ); | 84 | jumpBar = new QToolBar( this ); |
85 | addToolBar( jumpBar, QMainWindow::Top, true ); | 85 | addToolBar( jumpBar, QMainWindow::Top, true ); |
86 | jumpBar->setHorizontalStretchable( true ); | 86 | jumpBar->setHorizontalStretchable( true ); |
87 | QWidget *w = new QWidget( jumpBar ); | 87 | QWidget *w = new QWidget( jumpBar ); |
88 | jumpBar->setStretchableWidget( w ); | 88 | jumpBar->setStretchableWidget( w ); |
89 | 89 | ||
90 | QGridLayout *layout = new QGridLayout( w ); | 90 | QGridLayout *layout = new QGridLayout( w ); |
91 | 91 | ||
92 | char text[2]; | 92 | char text[2]; |
93 | text[1] = '\0'; | 93 | text[1] = '\0'; |
@@ -97,18 +97,18 @@ MainWindow :: MainWindow() | |||
97 | LetterPushButton *b = new LetterPushButton( text, w ); | 97 | LetterPushButton *b = new LetterPushButton( text, w ); |
98 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | 98 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); |
99 | layout->addWidget( b, i / 13, i % 13); | 99 | layout->addWidget( b, i / 13, i % 13); |
100 | } | 100 | } |
101 | 101 | ||
102 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); | 102 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); |
103 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); | 103 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); |
104 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); | 104 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); |
105 | a->addTo( jumpBar ); | 105 | a->addTo( jumpBar ); |
106 | jumpBar->hide(); | 106 | jumpBar->hide(); |
107 | 107 | ||
108 | // Packages menu | 108 | // Packages menu |
109 | QPopupMenu *popup = new QPopupMenu( this ); | 109 | QPopupMenu *popup = new QPopupMenu( this ); |
110 | 110 | ||
111 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); | 111 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); |
112 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 112 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); |
113 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); | 113 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); |
114 | a->addTo( popup ); | 114 | a->addTo( popup ); |
@@ -143,9 +143,9 @@ MainWindow :: MainWindow() | |||
143 | mb->insertItem( tr( "Actions" ), popup ); | 143 | mb->insertItem( tr( "Actions" ), popup ); |
144 | 144 | ||
145 | // View menu | 145 | // View menu |
146 | popup = new QPopupMenu( this ); | 146 | popup = new QPopupMenu( this ); |
147 | 147 | ||
148 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 148 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
149 | actionUninstalled->setToggleAction( TRUE ); | 149 | actionUninstalled->setToggleAction( TRUE ); |
150 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); | 150 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); |
151 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); | 151 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); |
@@ -196,11 +196,11 @@ MainWindow :: MainWindow() | |||
196 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); | 196 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); |
197 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); | 197 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); |
198 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); | 198 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); |
199 | a->addTo( popup ); | 199 | a->addTo( popup ); |
200 | 200 | ||
201 | mb->insertItem( tr( "View" ), popup ); | 201 | mb->insertItem( tr( "View" ), popup ); |
202 | 202 | ||
203 | // Finish find toolbar creation | 203 | // Finish find toolbar creation |
204 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 204 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
205 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | 205 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); |
206 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); | 206 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); |
@@ -212,9 +212,9 @@ MainWindow :: MainWindow() | |||
212 | stack->addWidget( progressWindow, 2 ); | 212 | stack->addWidget( progressWindow, 2 ); |
213 | stack->addWidget( networkPkgWindow, 1 ); | 213 | stack->addWidget( networkPkgWindow, 1 ); |
214 | setCentralWidget( stack ); | 214 | setCentralWidget( stack ); |
215 | stack->raiseWidget( progressWindow ); | 215 | stack->raiseWidget( progressWindow ); |
216 | 216 | ||
217 | // Delayed call to finish initialization | 217 | // Delayed call to finish initialization |
218 | QTimer::singleShot( 100, this, SLOT( init() ) ); | 218 | QTimer::singleShot( 100, this, SLOT( init() ) ); |
219 | } | 219 | } |
220 | 220 | ||
@@ -225,36 +225,36 @@ MainWindow :: ~MainWindow() | |||
225 | 225 | ||
226 | void MainWindow :: initMainWidget() | 226 | void MainWindow :: initMainWidget() |
227 | { | 227 | { |
228 | networkPkgWindow = new QWidget( this ); | 228 | networkPkgWindow = new QWidget( this ); |
229 | 229 | ||
230 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); | 230 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); |
231 | 231 | ||
232 | serversList = new QComboBox( networkPkgWindow ); | 232 | serversList = new QComboBox( networkPkgWindow ); |
233 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); | 233 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); |
234 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); | 234 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); |
235 | 235 | ||
236 | installedIcon = Resource::loadPixmap( "installed" ); | 236 | installedIcon = Resource::loadPixmap( "installed" ); |
237 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); | 237 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); |
238 | 238 | ||
239 | packagesList = new QListView( networkPkgWindow ); | 239 | packagesList = new QListView( networkPkgWindow ); |
240 | packagesList->addColumn( tr( "Packages" ), 225 ); | 240 | packagesList->addColumn( tr( "Packages" ), 225 ); |
241 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); | 241 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); |
242 | 242 | ||
243 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); | 243 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); |
244 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); | 244 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); |
245 | hbox1->addWidget( l ); | 245 | hbox1->addWidget( l ); |
246 | hbox1->addWidget( serversList ); | 246 | hbox1->addWidget( serversList ); |
247 | 247 | ||
248 | vbox->addWidget( packagesList ); | 248 | vbox->addWidget( packagesList ); |
249 | 249 | ||
250 | downloadEnabled = TRUE; | 250 | downloadEnabled = TRUE; |
251 | } | 251 | } |
252 | 252 | ||
253 | void MainWindow :: initProgressWidget() | 253 | void MainWindow :: initProgressWidget() |
254 | { | 254 | { |
255 | progressWindow = new QWidget( this ); | 255 | progressWindow = new QWidget( this ); |
256 | 256 | ||
257 | QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); | 257 | QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); |
258 | 258 | ||
259 | m_status = new QLabel( progressWindow ); | 259 | m_status = new QLabel( progressWindow ); |
260 | m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); | 260 | m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); |
@@ -275,32 +275,32 @@ void MainWindow :: init() | |||
275 | 275 | ||
276 | #endif | 276 | #endif |
277 | 277 | ||
278 | stack->raiseWidget( progressWindow ); | 278 | stack->raiseWidget( progressWindow ); |
279 | 279 | ||
280 | mgr = new DataManager(); | 280 | mgr = new DataManager(); |
281 | connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); | 281 | connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); |
282 | connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), | 282 | connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), |
283 | this, SLOT( setProgressMessage( const QString & ) ) ); | 283 | this, SLOT( setProgressMessage( const QString & ) ) ); |
284 | connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); | 284 | connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); |
285 | mgr->loadServers(); | 285 | mgr->loadServers(); |
286 | 286 | ||
287 | showUninstalledPkgs = false; | 287 | showUninstalledPkgs = false; |
288 | showInstalledPkgs = false; | 288 | showInstalledPkgs = false; |
289 | showUpgradedPkgs = false; | 289 | showUpgradedPkgs = false; |
290 | categoryFilterEnabled = false; | 290 | categoryFilterEnabled = false; |
291 | 291 | ||
292 | updateData(); | 292 | updateData(); |
293 | 293 | ||
294 | stack->raiseWidget( networkPkgWindow ); | 294 | stack->raiseWidget( networkPkgWindow ); |
295 | } | 295 | } |
296 | /* | 296 | /* |
297 | void MainWindow :: setDocument( const QString &doc ) | 297 | void MainWindow :: setDocument( const QString &doc ) |
298 | { | 298 | { |
299 | // Remove path from package | 299 | // Remove path from package |
300 | QString package = Utils::getPackageNameFromIpkFilename( doc ); | 300 | QString package = Utils::getPackageNameFromIpkFilename( doc ); |
301 | // std::cout << "Selecting package " << package << std::endl; | 301 | // std::cout << "Selecting package " << package << std::endl; |
302 | 302 | ||
303 | // First select local server | 303 | // First select local server |
304 | for ( int i = 0 ; i < serversList->count() ; ++i ) | 304 | for ( int i = 0 ; i < serversList->count() ; ++i ) |
305 | { | 305 | { |
306 | if ( serversList->text( i ) == LOCAL_IPKGS ) | 306 | if ( serversList->text( i ) == LOCAL_IPKGS ) |
@@ -351,9 +351,9 @@ void MainWindow :: closeEvent( QCloseEvent *e ) | |||
351 | { | 351 | { |
352 | e->accept(); | 352 | e->accept(); |
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
356 | void MainWindow :: displayFindBar() | 356 | void MainWindow :: displayFindBar() |
357 | { | 357 | { |
358 | findBar->show(); | 358 | findBar->show(); |
359 | findEdit->setFocus(); | 359 | findEdit->setFocus(); |
@@ -393,9 +393,9 @@ void MainWindow :: filterUninstalledPackages() | |||
393 | showInstalledPkgs = FALSE; | 393 | showInstalledPkgs = FALSE; |
394 | showUpgradedPkgs = FALSE; | 394 | showUpgradedPkgs = FALSE; |
395 | } | 395 | } |
396 | serverSelected( -1 ); | 396 | serverSelected( -1 ); |
397 | 397 | ||
398 | actionInstalled->setOn( FALSE ); | 398 | actionInstalled->setOn( FALSE ); |
399 | actionUpdated->setOn( FALSE ); | 399 | actionUpdated->setOn( FALSE ); |
400 | } | 400 | } |
401 | 401 | ||
@@ -407,9 +407,9 @@ void MainWindow :: filterInstalledPackages() | |||
407 | showUninstalledPkgs = FALSE; | 407 | showUninstalledPkgs = FALSE; |
408 | showUpgradedPkgs = FALSE; | 408 | showUpgradedPkgs = FALSE; |
409 | } | 409 | } |
410 | serverSelected( -1 ); | 410 | serverSelected( -1 ); |
411 | 411 | ||
412 | actionUninstalled->setOn( FALSE ); | 412 | actionUninstalled->setOn( FALSE ); |
413 | actionUpdated->setOn( FALSE ); | 413 | actionUpdated->setOn( FALSE ); |
414 | } | 414 | } |
415 | 415 | ||
@@ -421,9 +421,9 @@ void MainWindow :: filterUpgradedPackages() | |||
421 | showUninstalledPkgs = FALSE; | 421 | showUninstalledPkgs = FALSE; |
422 | showInstalledPkgs = FALSE; | 422 | showInstalledPkgs = FALSE; |
423 | } | 423 | } |
424 | serverSelected( -1 ); | 424 | serverSelected( -1 ); |
425 | 425 | ||
426 | actionUninstalled->setOn( FALSE ); | 426 | actionUninstalled->setOn( FALSE ); |
427 | actionInstalled->setOn( FALSE ); | 427 | actionInstalled->setOn( FALSE ); |
428 | } | 428 | } |
429 | 429 | ||
@@ -436,9 +436,9 @@ bool MainWindow :: setFilterCategory() | |||
436 | categoryFilter = dlg.getSelectedFilter(); | 436 | categoryFilter = dlg.getSelectedFilter(); |
437 | 437 | ||
438 | if ( categoryFilter == "" ) | 438 | if ( categoryFilter == "" ) |
439 | return false; | 439 | return false; |
440 | 440 | ||
441 | categoryFilterEnabled = true; | 441 | categoryFilterEnabled = true; |
442 | serverSelected( -1 ); | 442 | serverSelected( -1 ); |
443 | actionFilter->setOn( TRUE ); | 443 | actionFilter->setOn( TRUE ); |
444 | return true; | 444 | return true; |
@@ -467,9 +467,9 @@ bool MainWindow :: filterByCategory( bool val ) | |||
467 | { | 467 | { |
468 | if ( !setFilterCategory() ) | 468 | if ( !setFilterCategory() ) |
469 | return false; | 469 | return false; |
470 | } | 470 | } |
471 | 471 | ||
472 | categoryFilterEnabled = true; | 472 | categoryFilterEnabled = true; |
473 | serverSelected( -1 ); | 473 | serverSelected( -1 ); |
474 | return true; | 474 | return true; |
475 | } | 475 | } |
@@ -530,35 +530,35 @@ void MainWindow :: updateProgress( int progress ) | |||
530 | 530 | ||
531 | void MainWindow :: updateData() | 531 | void MainWindow :: updateData() |
532 | { | 532 | { |
533 | m_progress->setTotalSteps( mgr->getServerList().count() ); | 533 | m_progress->setTotalSteps( mgr->getServerList().count() ); |
534 | 534 | ||
535 | serversList->clear(); | 535 | serversList->clear(); |
536 | packagesList->clear(); | 536 | packagesList->clear(); |
537 | 537 | ||
538 | int activeItem = -1; | 538 | int activeItem = -1; |
539 | int i = 0; | 539 | int i = 0; |
540 | QString serverName; | 540 | QString serverName; |
541 | 541 | ||
542 | QListIterator<Server> it( mgr->getServerList() ); | 542 | QListIterator<Server> it( mgr->getServerList() ); |
543 | Server *server; | 543 | Server *server; |
544 | 544 | ||
545 | for ( ; it.current(); ++it, ++i ) | 545 | for ( ; it.current(); ++it, ++i ) |
546 | { | 546 | { |
547 | server = it.current(); | 547 | server = it.current(); |
548 | serverName = server->getServerName(); | 548 | serverName = server->getServerName(); |
549 | m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); | 549 | m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); |
550 | m_progress->setProgress( i ); | 550 | m_progress->setProgress( i ); |
551 | qApp->processEvents(); | 551 | qApp->processEvents(); |
552 | 552 | ||
553 | // cout << "Adding " << it->getServerName() << " to combobox" << endl; | 553 | // cout << "Adding " << it->getServerName() << " to combobox" << endl; |
554 | if ( !server->isServerActive() ) | 554 | if ( !server->isServerActive() ) |
555 | { | 555 | { |
556 | // cout << serverName << " is not active" << endl; | 556 | // cout << serverName << " is not active" << endl; |
557 | i--; | 557 | i--; |
558 | continue; | 558 | continue; |
559 | } | 559 | } |
560 | 560 | ||
561 | serversList->insertItem( serverName ); | 561 | serversList->insertItem( serverName ); |
562 | if ( serverName == currentlySelectedServer ) | 562 | if ( serverName == currentlySelectedServer ) |
563 | activeItem = i; | 563 | activeItem = i; |
564 | } | 564 | } |
@@ -577,18 +577,18 @@ void MainWindow :: serverSelected( int index ) | |||
577 | void MainWindow :: serverSelected( int, bool raiseProgress ) | 577 | void MainWindow :: serverSelected( int, bool raiseProgress ) |
578 | { | 578 | { |
579 | QPixmap nullIcon( installedIcon.size() ); | 579 | QPixmap nullIcon( installedIcon.size() ); |
580 | nullIcon.fill( colorGroup().base() ); | 580 | nullIcon.fill( colorGroup().base() ); |
581 | 581 | ||
582 | // display packages | 582 | // display packages |
583 | QString serverName = serversList->currentText(); | 583 | QString serverName = serversList->currentText(); |
584 | currentlySelectedServer = serverName; | 584 | currentlySelectedServer = serverName; |
585 | 585 | ||
586 | Server *s = mgr->getServer( serverName ); | 586 | Server *s = mgr->getServer( serverName ); |
587 | 587 | ||
588 | QList<Package> &list = s->getPackageList(); | 588 | QList<Package> &list = s->getPackageList(); |
589 | QListIterator<Package> it( list ); | 589 | QListIterator<Package> it( list ); |
590 | 590 | ||
591 | // Display progress widget while loading list | 591 | // Display progress widget while loading list |
592 | bool doProgress = ( list.count() > 200 ); | 592 | bool doProgress = ( list.count() > 200 ); |
593 | if ( doProgress ) | 593 | if ( doProgress ) |
594 | { | 594 | { |
@@ -622,11 +622,11 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
622 | m_progress->setProgress( i ); | 622 | m_progress->setProgress( i ); |
623 | } | 623 | } |
624 | qApp->processEvents(); | 624 | qApp->processEvents(); |
625 | } | 625 | } |
626 | 626 | ||
627 | QString text = ""; | 627 | QString text = ""; |
628 | 628 | ||
629 | package = it.current(); | 629 | package = it.current(); |
630 | 630 | ||
631 | // Apply show only uninstalled packages filter | 631 | // Apply show only uninstalled packages filter |
632 | if ( showUninstalledPkgs && package->isInstalled() ) | 632 | if ( showUninstalledPkgs && package->isInstalled() ) |
@@ -657,9 +657,9 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
657 | 657 | ||
658 | 658 | ||
659 | QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), | 659 | QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), |
660 | QCheckListItem::CheckBox ); | 660 | QCheckListItem::CheckBox ); |
661 | 661 | ||
662 | if ( package->isInstalled() ) | 662 | if ( package->isInstalled() ) |
663 | { | 663 | { |
664 | // If a different version of package is available, show update available icon | 664 | // If a different version of package is available, show update available icon |
665 | // Otherwise, show installed icon | 665 | // Otherwise, show installed icon |
@@ -672,9 +672,9 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
672 | else | 672 | else |
673 | { | 673 | { |
674 | item->setPixmap( 0, installedIcon ); | 674 | item->setPixmap( 0, installedIcon ); |
675 | } | 675 | } |
676 | 676 | ||
677 | QString destName = ""; | 677 | QString destName = ""; |
678 | if ( package->getLocalPackage() ) | 678 | if ( package->getLocalPackage() ) |
679 | { | 679 | { |
680 | if ( package->getLocalPackage()->getInstalledTo() ) | 680 | if ( package->getLocalPackage()->getInstalledTo() ) |
@@ -691,18 +691,18 @@ void MainWindow :: serverSelected( int, bool raiseProgress ) | |||
691 | else | 691 | else |
692 | { | 692 | { |
693 | item->setPixmap( 0, nullIcon ); | 693 | item->setPixmap( 0, nullIcon ); |
694 | } | 694 | } |
695 | 695 | ||
696 | if ( !package->isPackageStoredLocally() ) | 696 | if ( !package->isPackageStoredLocally() ) |
697 | { | 697 | { |
698 | new QCheckListItem( item, QString( tr( "Description - %1" ).arg( package->getDescription() ) ) ); | 698 | new QCheckListItem( item, QString( tr( "Description - %1" ).arg( package->getDescription() ) ) ); |
699 | new QCheckListItem( item, QString( tr( "Size - %1" ).arg( package->getPackageSize() ) ) ); | 699 | new QCheckListItem( item, QString( tr( "Size - %1" ).arg( package->getPackageSize() ) ) ); |
700 | new QCheckListItem( item, QString( tr( "Section - %1" ).arg( package->getSection() ) ) ); | 700 | new QCheckListItem( item, QString( tr( "Section - %1" ).arg( package->getSection() ) ) ); |
701 | } | 701 | } |
702 | else | 702 | else |
703 | new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( package->getFilename() ) ) ); | 703 | new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( package->getFilename() ) ) ); |
704 | 704 | ||
705 | if ( serverName == LOCAL_SERVER ) | 705 | if ( serverName == LOCAL_SERVER ) |
706 | { | 706 | { |
707 | new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getVersion() ) ) ); | 707 | new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getVersion() ) ) ); |
708 | } | 708 | } |
@@ -753,12 +753,12 @@ void MainWindow :: searchForPackage( const QString &text ) | |||
753 | // vector<InstallData> workingPackages; | 753 | // vector<InstallData> workingPackages; |
754 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); | 754 | QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); |
755 | // if ( start != 0 ) | 755 | // if ( start != 0 ) |
756 | // start = (QCheckListItem *)start->nextSibling(); | 756 | // start = (QCheckListItem *)start->nextSibling(); |
757 | 757 | ||
758 | if ( start == 0 ) | 758 | if ( start == 0 ) |
759 | start = (QCheckListItem *)packagesList->firstChild(); | 759 | start = (QCheckListItem *)packagesList->firstChild(); |
760 | 760 | ||
761 | for ( QCheckListItem *item = start; item != 0 ; | 761 | for ( QCheckListItem *item = start; item != 0 ; |
762 | item = (QCheckListItem *)item->nextSibling() ) | 762 | item = (QCheckListItem *)item->nextSibling() ) |
763 | { | 763 | { |
764 | // cout << "checking " << item->text().lower() << endl; | 764 | // cout << "checking " << item->text().lower() << endl; |
@@ -768,9 +768,9 @@ void MainWindow :: searchForPackage( const QString &text ) | |||
768 | packagesList->ensureItemVisible( item ); | 768 | packagesList->ensureItemVisible( item ); |
769 | packagesList->setCurrentItem( item ); | 769 | packagesList->setCurrentItem( item ); |
770 | break; | 770 | break; |
771 | } | 771 | } |
772 | } | 772 | } |
773 | } | 773 | } |
774 | } | 774 | } |
775 | 775 | ||
776 | void MainWindow :: updateServer() | 776 | void MainWindow :: updateServer() |
@@ -792,9 +792,9 @@ void MainWindow :: updateServer() | |||
792 | tr( "Update lists" ) ); | 792 | tr( "Update lists" ) ); |
793 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 793 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
794 | stack->addWidget( dlg, 3 ); | 794 | stack->addWidget( dlg, 3 ); |
795 | stack->raiseWidget( dlg ); | 795 | stack->raiseWidget( dlg ); |
796 | 796 | ||
797 | // delete progDlg; | 797 | // delete progDlg; |
798 | } | 798 | } |
799 | 799 | ||
800 | void MainWindow :: upgradePackages() | 800 | void MainWindow :: upgradePackages() |
@@ -807,9 +807,9 @@ void MainWindow :: upgradePackages() | |||
807 | QMessageBox::Yes, | 807 | QMessageBox::Yes, |
808 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , | 808 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , |
809 | 0, this ); | 809 | 0, this ); |
810 | warn.adjustSize(); | 810 | warn.adjustSize(); |
811 | 811 | ||
812 | if ( warn.exec() == QMessageBox::Yes ) | 812 | if ( warn.exec() == QMessageBox::Yes ) |
813 | { | 813 | { |
814 | // First, write out ipkg_conf file so that ipkg can use it | 814 | // First, write out ipkg_conf file so that ipkg can use it |
815 | mgr->writeOutIpkgConf(); | 815 | mgr->writeOutIpkgConf(); |
@@ -842,17 +842,17 @@ void MainWindow :: downloadPackage() | |||
842 | if ( item->isOn() ) | 842 | if ( item->isOn() ) |
843 | found = true; | 843 | found = true; |
844 | } | 844 | } |
845 | } | 845 | } |
846 | 846 | ||
847 | // If user selected some packages then download the and store the locally | 847 | // If user selected some packages then download the and store the locally |
848 | // otherwise, display dialog asking user what package to download from an http server | 848 | // otherwise, display dialog asking user what package to download from an http server |
849 | // and whether to install it | 849 | // and whether to install it |
850 | if ( found ) | 850 | if ( found ) |
851 | downloadSelectedPackages(); | 851 | downloadSelectedPackages(); |
852 | else | 852 | else |
853 | downloadRemotePackage(); | 853 | downloadRemotePackage(); |
854 | 854 | ||
855 | } | 855 | } |
856 | else | 856 | else |
857 | { | 857 | { |
858 | doUpdate = false; | 858 | doUpdate = false; |
@@ -869,9 +869,9 @@ void MainWindow :: downloadPackage() | |||
869 | // if (there is a (installed), remove it | 869 | // if (there is a (installed), remove it |
870 | pos = name.find( "(installed)" ); | 870 | pos = name.find( "(installed)" ); |
871 | if ( pos > 0 ) | 871 | if ( pos > 0 ) |
872 | name.truncate( pos - 1 ); | 872 | name.truncate( pos - 1 ); |
873 | 873 | ||
874 | Package *p = mgr->getServer( serversList->currentText() )->getPackage( name ); | 874 | Package *p = mgr->getServer( serversList->currentText() )->getPackage( name ); |
875 | 875 | ||
876 | QString msgtext; | 876 | QString msgtext; |
877 | msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() ); | 877 | msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() ); |
@@ -970,9 +970,9 @@ void MainWindow :: downloadRemotePackage() | |||
970 | 970 | ||
971 | void MainWindow :: applyChanges() | 971 | void MainWindow :: applyChanges() |
972 | { | 972 | { |
973 | stickyOption = ""; | 973 | stickyOption = ""; |
974 | 974 | ||
975 | // First, write out ipkg_conf file so that ipkg can use it | 975 | // First, write out ipkg_conf file so that ipkg can use it |
976 | mgr->writeOutIpkgConf(); | 976 | mgr->writeOutIpkgConf(); |
977 | 977 | ||
978 | // Now for each selected item | 978 | // Now for each selected item |
@@ -994,12 +994,12 @@ void MainWindow :: applyChanges() | |||
994 | { | 994 | { |
995 | // Nothing to do | 995 | // Nothing to do |
996 | QMessageBox::information( this, tr( "Nothing to do" ), | 996 | QMessageBox::information( this, tr( "Nothing to do" ), |
997 | tr( "No packages selected" ), tr( "OK" ) ); | 997 | tr( "No packages selected" ), tr( "OK" ) ); |
998 | 998 | ||
999 | return; | 999 | return; |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | // do the stuff | 1002 | // do the stuff |
1003 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); | 1003 | InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); |
1004 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); | 1004 | connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); |
1005 | stack->addWidget( dlg, 3 ); | 1005 | stack->addWidget( dlg, 3 ); |
@@ -1039,9 +1039,9 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1039 | if ( !p->isPackageStoredLocally() ) | 1039 | if ( !p->isPackageStoredLocally() ) |
1040 | newitem->packageName = p->getInstalledPackageName(); | 1040 | newitem->packageName = p->getInstalledPackageName(); |
1041 | else | 1041 | else |
1042 | newitem->packageName = name; | 1042 | newitem->packageName = name; |
1043 | 1043 | ||
1044 | if ( p->getInstalledTo() ) | 1044 | if ( p->getInstalledTo() ) |
1045 | { | 1045 | { |
1046 | newitem->destination = p->getInstalledTo(); | 1046 | newitem->destination = p->getInstalledTo(); |
1047 | // cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; | 1047 | // cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; |
@@ -1057,9 +1057,9 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1057 | 1057 | ||
1058 | // If the version requested is older and user selected a local ipk file, then reinstall the file | 1058 | // If the version requested is older and user selected a local ipk file, then reinstall the file |
1059 | if ( p->isPackageStoredLocally() && val == -1 ) | 1059 | if ( p->isPackageStoredLocally() && val == -1 ) |
1060 | val = 0; | 1060 | val = 0; |
1061 | 1061 | ||
1062 | if ( val == -2 ) | 1062 | if ( val == -2 ) |
1063 | { | 1063 | { |
1064 | // Error - should handle | 1064 | // Error - should handle |
1065 | } | 1065 | } |
@@ -1114,9 +1114,9 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1114 | // newitem->option = stickyOption; | 1114 | // newitem->option = stickyOption; |
1115 | } | 1115 | } |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | 1118 | ||
1119 | // Check if we are reinstalling the same version | 1119 | // Check if we are reinstalling the same version |
1120 | if ( newitem->option != "R" ) | 1120 | if ( newitem->option != "R" ) |
1121 | newitem->recreateLinks = true; | 1121 | newitem->recreateLinks = true; |
1122 | else | 1122 | else |
@@ -1129,27 +1129,27 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) | |||
1129 | 1129 | ||
1130 | void MainWindow :: reloadData( InstallDlgImpl *dlg ) | 1130 | void MainWindow :: reloadData( InstallDlgImpl *dlg ) |
1131 | { | 1131 | { |
1132 | stack->raiseWidget( progressWindow ); | 1132 | stack->raiseWidget( progressWindow ); |
1133 | 1133 | ||
1134 | if ( dlg ) | 1134 | if ( dlg ) |
1135 | { | 1135 | { |
1136 | dlg->close(); | 1136 | dlg->close(); |
1137 | delete dlg; | 1137 | delete dlg; |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | mgr->reloadServerData(); | 1140 | mgr->reloadServerData(); |
1141 | serverSelected( -1, FALSE ); | 1141 | serverSelected( -1, FALSE ); |
1142 | 1142 | ||
1143 | #ifdef QWS | 1143 | #ifdef QWS |
1144 | m_status->setText( tr( "Updating Launcher..." ) ); | 1144 | m_status->setText( tr( "Updating Launcher..." ) ); |
1145 | 1145 | ||
1146 | // Finally let the main system update itself | 1146 | // Finally let the main system update itself |
1147 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 1147 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
1148 | QString lf = QString::null; | 1148 | QString lf = QString::null; |
1149 | e << lf; | 1149 | e << lf; |
1150 | #endif | 1150 | #endif |
1151 | 1151 | ||
1152 | stack->raiseWidget( networkPkgWindow ); | 1152 | stack->raiseWidget( networkPkgWindow ); |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | void MainWindow :: letterPushed( QString t ) | 1155 | void MainWindow :: letterPushed( QString t ) |
@@ -1180,7 +1180,7 @@ void MainWindow :: letterPushed( QString t ) | |||
1180 | } | 1180 | } |
1181 | 1181 | ||
1182 | item = (QCheckListItem *)item->nextSibling(); | 1182 | item = (QCheckListItem *)item->nextSibling(); |
1183 | if ( !item ) | 1183 | if ( !item ) |
1184 | item = (QCheckListItem *)packagesList->firstChild(); | 1184 | item = (QCheckListItem *)packagesList->firstChild(); |
1185 | } while ( item != start); | 1185 | } while ( item != start); |
1186 | } | 1186 | } |
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h index b2de871..4b044de 100644 --- a/noncore/settings/aqpkg/mainwin.h +++ b/noncore/settings/aqpkg/mainwin.h | |||
@@ -30,9 +30,9 @@ class QCheckListItem; | |||
30 | class QComboBox; | 30 | class QComboBox; |
31 | class QLabel; | 31 | class QLabel; |
32 | class QLineEdit; | 32 | class QLineEdit; |
33 | class QListView; | 33 | class QListView; |
34 | class QPEToolBar; | 34 | class QToolBar; |
35 | class QProgressBar; | 35 | class QProgressBar; |
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | 37 | ||
38 | class MainWindow :public QMainWindow | 38 | class MainWindow :public QMainWindow |
@@ -50,10 +50,10 @@ private: | |||
50 | DataManager *mgr; | 50 | DataManager *mgr; |
51 | 51 | ||
52 | QWidgetStack *stack; | 52 | QWidgetStack *stack; |
53 | 53 | ||
54 | QPEToolBar *findBar; | 54 | QToolBar *findBar; |
55 | QPEToolBar *jumpBar; | 55 | QToolBar *jumpBar; |
56 | QLineEdit *findEdit; | 56 | QLineEdit *findEdit; |
57 | QAction *actionFindNext; | 57 | QAction *actionFindNext; |
58 | QAction *actionFilter; | 58 | QAction *actionFilter; |
59 | QAction *actionUpgrade; | 59 | QAction *actionUpgrade; |