Diffstat (limited to 'noncore/settings/packagemanager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 26 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.h | 5 | ||||
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 34 | ||||
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.h | 9 |
4 files changed, 63 insertions, 11 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 486561d..05f21bc 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -38,24 +38,25 @@ | |||
38 | #include <qtoolbar.h> | 38 | #include <qtoolbar.h> |
39 | #include <qwhatsthis.h> | 39 | #include <qwhatsthis.h> |
40 | 40 | ||
41 | #include <qpe/qcopenvelope_qws.h> | 41 | #include <qpe/qcopenvelope_qws.h> |
42 | #include <qpe/qpeapplication.h> | 42 | #include <qpe/qpeapplication.h> |
43 | #include <qpe/resource.h> | 43 | #include <qpe/resource.h> |
44 | 44 | ||
45 | #include "mainwindow.h" | 45 | #include "mainwindow.h" |
46 | #include "installdlg.h" | 46 | #include "installdlg.h" |
47 | #include "filterdlg.h" | 47 | #include "filterdlg.h" |
48 | #include "promptdlg.h" | 48 | #include "promptdlg.h" |
49 | #include "entrydlg.h" | 49 | #include "entrydlg.h" |
50 | #include "packageinfodlg.h" | ||
50 | 51 | ||
51 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) | 52 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) |
52 | : QMainWindow( parent, name, fl || WStyle_ContextHelp ) | 53 | : QMainWindow( parent, name, fl || WStyle_ContextHelp ) |
53 | , m_config( "packman" ) | 54 | , m_config( "packman" ) |
54 | , m_packman( &m_config, this ) | 55 | , m_packman( &m_config, this ) |
55 | , m_menuBar( this ) | 56 | , m_menuBar( this ) |
56 | , m_toolBar( this ) | 57 | , m_toolBar( this ) |
57 | , m_findBar( this ) | 58 | , m_findBar( this ) |
58 | , m_widgetStack( this ) | 59 | , m_widgetStack( this ) |
59 | , m_packageList( this ) | 60 | , m_packageList( this ) |
60 | , m_statusWidget( this ) | 61 | , m_statusWidget( this ) |
61 | , m_statusText( &m_statusWidget ) | 62 | , m_statusText( &m_statusWidget ) |
@@ -108,24 +109,26 @@ void MainWindow::closeEvent( QCloseEvent *event ) | |||
108 | { | 109 | { |
109 | delete m_widgetStack.visibleWidget(); | 110 | delete m_widgetStack.visibleWidget(); |
110 | m_widgetStack.raiseWidget( &m_packageList ); | 111 | m_widgetStack.raiseWidget( &m_packageList ); |
111 | event->ignore(); | 112 | event->ignore(); |
112 | } | 113 | } |
113 | } | 114 | } |
114 | 115 | ||
115 | void MainWindow::initPackageList() | 116 | void MainWindow::initPackageList() |
116 | { | 117 | { |
117 | m_packageList.addColumn( tr( "Packages" ) ); | 118 | m_packageList.addColumn( tr( "Packages" ) ); |
118 | QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\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." ) ); | 119 | QWhatsThis::add( &m_packageList, tr( "This is a listing of all packages.\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." ) ); |
119 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); | 120 | QPEApplication::setStylusOperation( m_packageList.viewport(), QPEApplication::RightOnHold ); |
121 | connect( &m_packageList, SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)), | ||
122 | this, SLOT(slotDisplayPackageInfo(QListViewItem *)) ); | ||
120 | } | 123 | } |
121 | 124 | ||
122 | void MainWindow::initStatusWidget() | 125 | void MainWindow::initStatusWidget() |
123 | { | 126 | { |
124 | QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); | 127 | QVBoxLayout *layout = new QVBoxLayout( &m_statusWidget, 4, 4 ); |
125 | 128 | ||
126 | m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); | 129 | m_statusText.setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); |
127 | layout->addWidget( &m_statusText ); | 130 | layout->addWidget( &m_statusText ); |
128 | 131 | ||
129 | connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); | 132 | connect( &m_packman, SIGNAL(initStatus(int)), this, SLOT(slotInitStatusBar(int)) ); |
130 | connect( &m_packman, SIGNAL(statusText(const QString &)), this, SLOT(slotStatusText(const QString &)) ); | 133 | connect( &m_packman, SIGNAL(statusText(const QString &)), this, SLOT(slotStatusText(const QString &)) ); |
131 | connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); | 134 | connect( &m_packman, SIGNAL(statusBar(int)), this, SLOT(slotStatusBar(int)) ); |
@@ -343,37 +346,37 @@ void MainWindow::slotStatusText( const QString &status ) | |||
343 | } | 346 | } |
344 | 347 | ||
345 | void MainWindow::slotStatusBar( int currStep ) | 348 | void MainWindow::slotStatusBar( int currStep ) |
346 | { | 349 | { |
347 | m_statusBar.setProgress( currStep ); | 350 | m_statusBar.setProgress( currStep ); |
348 | } | 351 | } |
349 | 352 | ||
350 | void MainWindow::slotUpdate() | 353 | void MainWindow::slotUpdate() |
351 | { | 354 | { |
352 | // Create package manager output widget | 355 | // Create package manager output widget |
353 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false, | 356 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Update package information" ), false, |
354 | OPackage::Update ); | 357 | OPackage::Update ); |
355 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); | 358 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
356 | 359 | ||
357 | // Display widget | 360 | // Display widget |
358 | m_widgetStack.addWidget( dlg, 3 ); | 361 | m_widgetStack.addWidget( dlg, 3 ); |
359 | m_widgetStack.raiseWidget( dlg ); | 362 | m_widgetStack.raiseWidget( dlg ); |
360 | } | 363 | } |
361 | 364 | ||
362 | void MainWindow::slotUpgrade() | 365 | void MainWindow::slotUpgrade() |
363 | { | 366 | { |
364 | // Create package manager output widget | 367 | // Create package manager output widget |
365 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false, | 368 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Upgrade installed packages" ), false, |
366 | OPackage::Upgrade ); | 369 | OPackage::Upgrade ); |
367 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); | 370 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
368 | 371 | ||
369 | // Display widget | 372 | // Display widget |
370 | m_widgetStack.addWidget( dlg, 3 ); | 373 | m_widgetStack.addWidget( dlg, 3 ); |
371 | m_widgetStack.raiseWidget( dlg ); | 374 | m_widgetStack.raiseWidget( dlg ); |
372 | } | 375 | } |
373 | 376 | ||
374 | void MainWindow::slotDownload() | 377 | void MainWindow::slotDownload() |
375 | { | 378 | { |
376 | // Retrieve list of packages selected for download (if any) | 379 | // Retrieve list of packages selected for download (if any) |
377 | QStringList *workingPackages = new QStringList(); | 380 | QStringList *workingPackages = new QStringList(); |
378 | 381 | ||
379 | for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); | 382 | for ( QCheckListItem *item = static_cast<QCheckListItem *>(m_packageList.firstChild()); |
@@ -402,25 +405,25 @@ void MainWindow::slotDownload() | |||
402 | else | 405 | else |
403 | return; // user entered nothing or pressed cancel | 406 | return; // user entered nothing or pressed cancel |
404 | 407 | ||
405 | // Store download directory in config file | 408 | // Store download directory in config file |
406 | m_config.writeEntry( "DownloadDir", workingDir ); | 409 | m_config.writeEntry( "DownloadDir", workingDir ); |
407 | 410 | ||
408 | // Get starting directory | 411 | // Get starting directory |
409 | QDir::setCurrent( workingDir ); | 412 | QDir::setCurrent( workingDir ); |
410 | 413 | ||
411 | // Create package manager output widget | 414 | // Create package manager output widget |
412 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, | 415 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Download packages" ), false, |
413 | OPackage::Download, workingPackages ); | 416 | OPackage::Download, workingPackages ); |
414 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); | 417 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
415 | 418 | ||
416 | // Display widget | 419 | // Display widget |
417 | m_widgetStack.addWidget( dlg, 3 ); | 420 | m_widgetStack.addWidget( dlg, 3 ); |
418 | m_widgetStack.raiseWidget( dlg ); | 421 | m_widgetStack.raiseWidget( dlg ); |
419 | } | 422 | } |
420 | } | 423 | } |
421 | 424 | ||
422 | void MainWindow::slotApply() | 425 | void MainWindow::slotApply() |
423 | { | 426 | { |
424 | QStringList *removeList = 0x0; | 427 | QStringList *removeList = 0x0; |
425 | QStringList *installList = 0x0; | 428 | QStringList *installList = 0x0; |
426 | QStringList *upgradeList = 0x0; | 429 | QStringList *upgradeList = 0x0; |
@@ -500,32 +503,32 @@ void MainWindow::slotApply() | |||
500 | OPackage::Command installCmd = OPackage::NotDefined; | 503 | OPackage::Command installCmd = OPackage::NotDefined; |
501 | if ( installList && !installList->isEmpty() ) | 504 | if ( installList && !installList->isEmpty() ) |
502 | installCmd = OPackage::Install; | 505 | installCmd = OPackage::Install; |
503 | OPackage::Command upgradeCmd = OPackage::NotDefined; | 506 | OPackage::Command upgradeCmd = OPackage::NotDefined; |
504 | if ( upgradeList && !upgradeList->isEmpty() ) | 507 | if ( upgradeList && !upgradeList->isEmpty() ) |
505 | upgradeCmd = OPackage::Upgrade; | 508 | upgradeCmd = OPackage::Upgrade; |
506 | 509 | ||
507 | // Create package manager output widget | 510 | // Create package manager output widget |
508 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, | 511 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, |
509 | removeCmd, removeList, | 512 | removeCmd, removeList, |
510 | installCmd, installList, | 513 | installCmd, installList, |
511 | upgradeCmd, upgradeList ); | 514 | upgradeCmd, upgradeList ); |
512 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseInstallDlg()) ); | 515 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
513 | 516 | ||
514 | // Display widget | 517 | // Display widget |
515 | m_widgetStack.addWidget( dlg, 3 ); | 518 | m_widgetStack.addWidget( dlg, 3 ); |
516 | m_widgetStack.raiseWidget( dlg ); | 519 | m_widgetStack.raiseWidget( dlg ); |
517 | } | 520 | } |
518 | 521 | ||
519 | void MainWindow::slotCloseInstallDlg() | 522 | void MainWindow::slotCloseDlg() |
520 | { | 523 | { |
521 | // Close install dialog | 524 | // Close install dialog |
522 | delete m_widgetStack.visibleWidget(); | 525 | delete m_widgetStack.visibleWidget(); |
523 | 526 | ||
524 | // Reload package list | 527 | // Reload package list |
525 | initPackageInfo(); | 528 | initPackageInfo(); |
526 | 529 | ||
527 | // Update Opie launcher links | 530 | // Update Opie launcher links |
528 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 531 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
529 | QString lf = QString::null; | 532 | QString lf = QString::null; |
530 | e << lf; | 533 | e << lf; |
531 | } | 534 | } |
@@ -656,12 +659,25 @@ void MainWindow::slotFindHideToolbar() | |||
656 | 659 | ||
657 | void MainWindow::slotFindChanged( const QString &findText ) | 660 | void MainWindow::slotFindChanged( const QString &findText ) |
658 | { | 661 | { |
659 | 662 | ||
660 | m_actionFindNext->setEnabled( !findText.isEmpty() ); | 663 | m_actionFindNext->setEnabled( !findText.isEmpty() ); |
661 | searchForPackage( findText ); | 664 | searchForPackage( findText ); |
662 | } | 665 | } |
663 | 666 | ||
664 | void MainWindow::slotFindNext() | 667 | void MainWindow::slotFindNext() |
665 | { | 668 | { |
666 | searchForPackage( m_findEdit->text() ); | 669 | searchForPackage( m_findEdit->text() ); |
667 | } | 670 | } |
671 | |||
672 | void MainWindow::slotDisplayPackageInfo( QListViewItem *packageItem ) | ||
673 | { | ||
674 | QString packageName( ( static_cast<QCheckListItem*>( packageItem ) )->text() ); | ||
675 | |||
676 | // Create package manager output widget | ||
677 | PackageInfoDlg *dlg = new PackageInfoDlg( this, &m_packman, packageName ); | ||
678 | connect( dlg, SIGNAL(closeInfoDlg()), this, SLOT(slotCloseDlg()) ); | ||
679 | |||
680 | // Display widget | ||
681 | m_widgetStack.addWidget( dlg, 3 ); | ||
682 | m_widgetStack.raiseWidget( dlg ); | ||
683 | } | ||
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h index 285cddf..fb555c5 100644 --- a/noncore/settings/packagemanager/mainwindow.h +++ b/noncore/settings/packagemanager/mainwindow.h | |||
@@ -107,30 +107,33 @@ private slots: | |||
107 | void slotWidgetStackShow( QWidget *widget ); | 107 | void slotWidgetStackShow( QWidget *widget ); |
108 | 108 | ||
109 | // Status widget slots | 109 | // Status widget slots |
110 | void slotInitStatusBar( int numSteps ); | 110 | void slotInitStatusBar( int numSteps ); |
111 | void slotStatusText( const QString &status ); | 111 | void slotStatusText( const QString &status ); |
112 | void slotStatusBar( int currStep ); | 112 | void slotStatusBar( int currStep ); |
113 | 113 | ||
114 | // Actions menu action slots | 114 | // Actions menu action slots |
115 | void slotUpdate(); | 115 | void slotUpdate(); |
116 | void slotUpgrade(); | 116 | void slotUpgrade(); |
117 | void slotDownload(); | 117 | void slotDownload(); |
118 | void slotApply(); | 118 | void slotApply(); |
119 | void slotCloseInstallDlg(); | 119 | void slotCloseDlg(); |
120 | void slotConfigure(); | 120 | void slotConfigure(); |
121 | 121 | ||
122 | // View menu action slots | 122 | // View menu action slots |
123 | void slotShowNotInstalled(); | 123 | void slotShowNotInstalled(); |
124 | void slotShowInstalled(); | 124 | void slotShowInstalled(); |
125 | void slotShowUpdated(); | 125 | void slotShowUpdated(); |
126 | void slotFilterChange(); | 126 | void slotFilterChange(); |
127 | void slotFilter( bool isOn ); | 127 | void slotFilter( bool isOn ); |
128 | 128 | ||
129 | // Find action slots | 129 | // Find action slots |
130 | void slotFindShowToolbar(); | 130 | void slotFindShowToolbar(); |
131 | void slotFindHideToolbar(); | 131 | void slotFindHideToolbar(); |
132 | void slotFindChanged( const QString &findText ); | 132 | void slotFindChanged( const QString &findText ); |
133 | void slotFindNext(); | 133 | void slotFindNext(); |
134 | |||
135 | // Other slots | ||
136 | void slotDisplayPackageInfo( QListViewItem * ); | ||
134 | }; | 137 | }; |
135 | 138 | ||
136 | #endif | 139 | #endif |
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp index 71f17eb..26356b9 100644 --- a/noncore/settings/packagemanager/packageinfodlg.cpp +++ b/noncore/settings/packagemanager/packageinfodlg.cpp | |||
@@ -25,32 +25,58 @@ | |||
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "packageinfodlg.h" | 30 | #include "packageinfodlg.h" |
31 | 31 | ||
32 | #include <qlayout.h> | 32 | #include <qlayout.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | 34 | ||
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | 36 | ||
37 | #include <opie/otabwidget.h> | ||
38 | |||
37 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) | 39 | PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) |
38 | : QWidget( 0x0 ) | 40 | : QWidget( 0x0 ) |
39 | , m_packman( pm ) | 41 | , m_packman( pm ) |
40 | , m_output( this ) | 42 | , m_information( this ) |
43 | , m_files( this ) | ||
41 | { | 44 | { |
42 | // Initialize UI | 45 | // Initialize UI |
43 | if ( parent ) | 46 | if ( parent ) |
44 | parent->setCaption( package ); | 47 | parent->setCaption( package ); |
45 | 48 | ||
46 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 0 ); | 49 | QVBoxLayout *layout = new QVBoxLayout( this, 4, 0 ); |
47 | 50 | ||
48 | m_output.setReadOnly( true ); | 51 | OTabWidget *tabWidget = new OTabWidget( this ); |
49 | layout->addWidget( &m_output ); | 52 | layout->addWidget( tabWidget ); |
50 | 53 | ||
51 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this ); | 54 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this ); |
52 | layout->addWidget( btn ); | 55 | layout->addWidget( btn ); |
53 | // TODO connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnClose()) ); | 56 | connect( btn, SIGNAL(clicked()), this, SLOT(slotBtnClose()) ); |
57 | |||
58 | // Information tab | ||
59 | m_information.reparent( tabWidget, QPoint( 0, 0 ) ); | ||
60 | m_information.setReadOnly( true ); | ||
61 | tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); | ||
62 | |||
63 | // Files tab | ||
64 | QWidget *filesWidget = new QWidget( tabWidget ); | ||
65 | QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 4, 0 ); | ||
66 | m_files.reparent( filesWidget, QPoint( 0, 0 ) ); | ||
67 | m_files.setReadOnly( true ); | ||
68 | filesLayout->addWidget( &m_files ); | ||
54 | 69 | ||
70 | btn = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Retrieve file list" ), | ||
71 | filesWidget ); | ||
72 | filesLayout->addWidget( btn ); | ||
73 | // TODO connect( btn, SIGNAL(clicked()), this, SLOT(slotFileScan()) ); | ||
74 | tabWidget->addTab( filesWidget, "binary", tr( "Files" ) ); | ||
55 | 75 | ||
76 | tabWidget->setCurrentTab( tr( "Information" ) ); | ||
77 | } | ||
78 | |||
79 | void PackageInfoDlg::slotBtnClose() | ||
80 | { | ||
81 | emit closeInfoDlg(); | ||
56 | } | 82 | } |
diff --git a/noncore/settings/packagemanager/packageinfodlg.h b/noncore/settings/packagemanager/packageinfodlg.h index 3bb9a7a..09af6f4 100644 --- a/noncore/settings/packagemanager/packageinfodlg.h +++ b/noncore/settings/packagemanager/packageinfodlg.h | |||
@@ -43,16 +43,23 @@ class OPackageManager; | |||
43 | 43 | ||
44 | class PackageInfoDlg : public QWidget | 44 | class PackageInfoDlg : public QWidget |
45 | { | 45 | { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | 47 | ||
48 | public: | 48 | public: |
49 | PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null ); | 49 | PackageInfoDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &package = QString::null ); |
50 | 50 | ||
51 | private: | 51 | private: |
52 | OPackageManager *m_packman; // Pointer to application instance of package manager | 52 | OPackageManager *m_packman; // Pointer to application instance of package manager |
53 | 53 | ||
54 | // UI controls | 54 | // UI controls |
55 | QMultiLineEdit m_output; // Multi-line edit to display package information | 55 | QMultiLineEdit m_information; // Multi-line edit to display package information |
56 | QMultiLineEdit m_files; // Multi-line edit to display package file list | ||
57 | |||
58 | private slots: | ||
59 | void slotBtnClose(); | ||
60 | |||
61 | signals: | ||
62 | void closeInfoDlg(); | ||
56 | }; | 63 | }; |
57 | 64 | ||
58 | #endif | 65 | #endif |