-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.h | 43 |
2 files changed, 52 insertions, 21 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 807bddd..5a942a1 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -5,64 +5,66 @@ | |||
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
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 "mainwindow.h" | 30 | #include "mainwindow.h" |
31 | #include "installdlg.h" | 31 | #include "installdlg.h" |
32 | #include "filterdlg.h" | 32 | #include "filterdlg.h" |
33 | #include "promptdlg.h" | 33 | #include "promptdlg.h" |
34 | #include "entrydlg.h" | 34 | #include "entrydlg.h" |
35 | #include "packageinfodlg.h" | 35 | #include "packageinfodlg.h" |
36 | 36 | ||
37 | #include <opie2/ofiledialog.h> | ||
38 | |||
37 | #include <qpe/qcopenvelope_qws.h> | 39 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 40 | #include <qpe/qpeapplication.h> |
39 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
40 | 42 | ||
41 | #include <qaction.h> | 43 | #include <qaction.h> |
42 | #include <qdir.h> | 44 | #include <qdir.h> |
43 | #include <qlayout.h> | 45 | #include <qlayout.h> |
44 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
45 | #include <qmenubar.h> | 47 | #include <qmenubar.h> |
46 | #include <qmessagebox.h> | 48 | #include <qmessagebox.h> |
47 | #include <qpopupmenu.h> | 49 | #include <qpopupmenu.h> |
48 | #include <qtimer.h> | 50 | #include <qtimer.h> |
49 | #include <qtoolbar.h> | 51 | #include <qtoolbar.h> |
50 | #include <qwhatsthis.h> | 52 | #include <qwhatsthis.h> |
51 | 53 | ||
52 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | 54 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) |
53 | : QMainWindow( parent, name, WStyle_ContextHelp ) | 55 | : QMainWindow( parent, name, WStyle_ContextHelp ) |
54 | , m_config( "packman" ) | 56 | , m_config( "packman" ) |
55 | , m_packman( &m_config, this ) | 57 | , m_packman( &m_config, this ) |
56 | , m_menuBar( this ) | 58 | , m_menuBar( this ) |
57 | , m_toolBar( this ) | 59 | , m_toolBar( this ) |
58 | , m_findBar( this ) | 60 | , m_findBar( this ) |
59 | , m_widgetStack( this ) | 61 | , m_widgetStack( this ) |
60 | , m_packageList( this ) | 62 | , m_packageList( this ) |
61 | , m_statusWidget( this ) | 63 | , m_statusWidget( this ) |
62 | , m_statusText( &m_statusWidget ) | 64 | , m_statusText( &m_statusWidget ) |
63 | , m_statusBar( &m_statusWidget ) | 65 | , m_statusBar( &m_statusWidget ) |
64 | , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) | 66 | , m_iconUpdated( Resource::loadPixmap( "packagemanager/updated" ) ) |
65 | , m_iconInstalled( Resource::loadPixmap( "installed" ) ) | 67 | , m_iconInstalled( Resource::loadPixmap( "installed" ) ) |
66 | , m_iconNull( m_iconUpdated.size() ) | 68 | , m_iconNull( m_iconUpdated.size() ) |
67 | , m_filterName( QString::null ) | 69 | , m_filterName( QString::null ) |
68 | , m_filterServer( QString::null ) | 70 | , m_filterServer( QString::null ) |
@@ -153,64 +155,70 @@ void MainWindow::initUI() | |||
153 | m_findBar.setStretchableWidget( m_findEdit ); | 155 | m_findBar.setStretchableWidget( m_findEdit ); |
154 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); | 156 | connect( m_findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotFindChanged(const QString&)) ); |
155 | 157 | ||
156 | // Packages menu | 158 | // Packages menu |
157 | QPopupMenu *popup = new QPopupMenu( this ); | 159 | QPopupMenu *popup = new QPopupMenu( this ); |
158 | 160 | ||
159 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); | 161 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "packagemanager/update" ), QString::null, 0, this, 0 ); |
160 | a->setWhatsThis( tr( "Tap here to update package lists from servers." ) ); | 162 | a->setWhatsThis( tr( "Tap here to update package lists from servers." ) ); |
161 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); | 163 | connect( a, SIGNAL(activated()), this, SLOT(slotUpdate()) ); |
162 | a->addTo( popup ); | 164 | a->addTo( popup ); |
163 | a->addTo( &m_toolBar ); | 165 | a->addTo( &m_toolBar ); |
164 | 166 | ||
165 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); | 167 | QAction *actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "packagemanager/upgrade" ), QString::null, 0, this, 0 ); |
166 | actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) ); | 168 | actionUpgrade->setWhatsThis( tr( "Tap here to upgrade all installed packages if a newer version is available." ) ); |
167 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); | 169 | connect( actionUpgrade, SIGNAL(activated()), this, SLOT(slotUpgrade()) ); |
168 | actionUpgrade->addTo( popup ); | 170 | actionUpgrade->addTo( popup ); |
169 | actionUpgrade->addTo( &m_toolBar ); | 171 | actionUpgrade->addTo( &m_toolBar ); |
170 | 172 | ||
171 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); | 173 | QPixmap iconDownload = Resource::loadPixmap( "packagemanager/download" ); |
172 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); | 174 | QPixmap iconRemove = Resource::loadPixmap( "packagemanager/remove" ); |
173 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 175 | QAction *actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
174 | actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); | 176 | actionDownload->setWhatsThis( tr( "Tap here to download the currently selected package(s)." ) ); |
175 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); | 177 | connect( actionDownload, SIGNAL(activated()), this, SLOT(slotDownload()) ); |
176 | actionDownload->addTo( popup ); | 178 | actionDownload->addTo( popup ); |
177 | actionDownload->addTo( &m_toolBar ); | 179 | actionDownload->addTo( &m_toolBar ); |
178 | 180 | ||
179 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "packagemanager/apply" ), QString::null, 0, this, 0 ); |
180 | a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); | 182 | a->setWhatsThis( tr( "Tap here to install, remove or upgrade currently selected package(s)." ) ); |
181 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); | 183 | connect( a, SIGNAL(activated()), this, SLOT(slotApply()) ); |
182 | a->addTo( popup ); | 184 | a->addTo( popup ); |
183 | a->addTo( &m_toolBar ); | 185 | a->addTo( &m_toolBar ); |
184 | 186 | ||
187 | a = new QAction( tr( "Install local package" ), Resource::loadPixmap( "folder" ), QString::null, 0, this, 0 ); | ||
188 | a->setWhatsThis( tr( "Tap here to install a package file located on device." ) ); | ||
189 | connect( a, SIGNAL(activated()), this, SLOT(slotInstallLocal()) ); | ||
190 | a->addTo( popup ); | ||
191 | //a->addTo( &m_toolBar ); | ||
192 | |||
185 | popup->insertSeparator(); | 193 | popup->insertSeparator(); |
186 | 194 | ||
187 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); | 195 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); |
188 | a->setWhatsThis( tr( "Tap here to configure this application." ) ); | 196 | a->setWhatsThis( tr( "Tap here to configure this application." ) ); |
189 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); | 197 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); |
190 | a->addTo( popup ); | 198 | a->addTo( popup ); |
191 | mb->insertItem( tr( "Actions" ), popup ); | 199 | mb->insertItem( tr( "Actions" ), popup ); |
192 | 200 | ||
193 | // View menu | 201 | // View menu |
194 | popup = new QPopupMenu( this ); | 202 | popup = new QPopupMenu( this ); |
195 | 203 | ||
196 | m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 204 | m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
197 | m_actionShowNotInstalled->setToggleAction( true ); | 205 | m_actionShowNotInstalled->setToggleAction( true ); |
198 | m_actionShowNotInstalled->setWhatsThis( tr( "Tap here to show packages available which have not been installed." ) ); | 206 | m_actionShowNotInstalled->setWhatsThis( tr( "Tap here to show packages available which have not been installed." ) ); |
199 | connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); | 207 | connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); |
200 | m_actionShowNotInstalled->addTo( popup ); | 208 | m_actionShowNotInstalled->addTo( popup ); |
201 | 209 | ||
202 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 210 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
203 | m_actionShowInstalled->setToggleAction( true ); | 211 | m_actionShowInstalled->setToggleAction( true ); |
204 | m_actionShowInstalled->setWhatsThis( tr( "Tap here to show packages currently installed on this device." ) ); | 212 | m_actionShowInstalled->setWhatsThis( tr( "Tap here to show packages currently installed on this device." ) ); |
205 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); | 213 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); |
206 | m_actionShowInstalled->addTo( popup ); | 214 | m_actionShowInstalled->addTo( popup ); |
207 | 215 | ||
208 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 216 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
209 | m_actionShowUpdated->setToggleAction( true ); | 217 | m_actionShowUpdated->setToggleAction( true ); |
210 | m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) ); | 218 | m_actionShowUpdated->setWhatsThis( tr( "Tap here to show packages currently installed on this device which have a newer version available." ) ); |
211 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); | 219 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); |
212 | m_actionShowUpdated->addTo( popup ); | 220 | m_actionShowUpdated->addTo( popup ); |
213 | 221 | ||
214 | popup->insertSeparator(); | 222 | popup->insertSeparator(); |
215 | 223 | ||
216 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), | 224 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), |
@@ -490,64 +498,86 @@ void MainWindow::slotApply() | |||
490 | } | 498 | } |
491 | 499 | ||
492 | // If nothing is selected, display message and exit | 500 | // If nothing is selected, display message and exit |
493 | if ( !removeList && !installList && !upgradeList ) | 501 | if ( !removeList && !installList && !upgradeList ) |
494 | { | 502 | { |
495 | QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); | 503 | QMessageBox::information( this, tr( "Nothing to do" ), tr( "No packages selected" ), tr( "OK" ) ); |
496 | return; | 504 | return; |
497 | } | 505 | } |
498 | 506 | ||
499 | // Send command only if there are packages to process | 507 | // Send command only if there are packages to process |
500 | OPackage::Command removeCmd = OPackage::NotDefined; | 508 | OPackage::Command removeCmd = OPackage::NotDefined; |
501 | if ( removeList && !removeList->isEmpty() ) | 509 | if ( removeList && !removeList->isEmpty() ) |
502 | removeCmd = OPackage::Remove; | 510 | removeCmd = OPackage::Remove; |
503 | OPackage::Command installCmd = OPackage::NotDefined; | 511 | OPackage::Command installCmd = OPackage::NotDefined; |
504 | if ( installList && !installList->isEmpty() ) | 512 | if ( installList && !installList->isEmpty() ) |
505 | installCmd = OPackage::Install; | 513 | installCmd = OPackage::Install; |
506 | OPackage::Command upgradeCmd = OPackage::NotDefined; | 514 | OPackage::Command upgradeCmd = OPackage::NotDefined; |
507 | if ( upgradeList && !upgradeList->isEmpty() ) | 515 | if ( upgradeList && !upgradeList->isEmpty() ) |
508 | upgradeCmd = OPackage::Upgrade; | 516 | upgradeCmd = OPackage::Upgrade; |
509 | 517 | ||
510 | // Create package manager output widget | 518 | // Create package manager output widget |
511 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, | 519 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Apply changes" ), true, |
512 | removeCmd, removeList, | 520 | removeCmd, removeList, |
513 | installCmd, installList, | 521 | installCmd, installList, |
514 | upgradeCmd, upgradeList ); | 522 | upgradeCmd, upgradeList ); |
515 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | 523 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); |
516 | 524 | ||
517 | // Display widget | 525 | // Display widget |
518 | m_widgetStack.addWidget( dlg, 3 ); | 526 | m_widgetStack.addWidget( dlg, 3 ); |
519 | m_widgetStack.raiseWidget( dlg ); | 527 | m_widgetStack.raiseWidget( dlg ); |
520 | } | 528 | } |
521 | 529 | ||
530 | void MainWindow::slotInstallLocal() | ||
531 | { | ||
532 | // Display file open dialog with only package files | ||
533 | MimeTypes type; | ||
534 | QStringList packages; | ||
535 | packages << "application/ipkg"; | ||
536 | type.insert( tr( "Application Packages" ), packages ); | ||
537 | QString package = Opie::Ui::OFileDialog::getOpenFileName( Opie::Ui::OFileSelector::NORMAL, | ||
538 | "/", QString::null, type ); | ||
539 | if ( !package.isNull() ) | ||
540 | { | ||
541 | // Install selected file | ||
542 | InstallDlg *dlg = new InstallDlg( this, &m_packman, tr( "Install local package" ), true, | ||
543 | OPackage::Install, new QStringList( package ) ); | ||
544 | connect( dlg, SIGNAL(closeInstallDlg()), this, SLOT(slotCloseDlg()) ); | ||
545 | |||
546 | // Display widget | ||
547 | m_widgetStack.addWidget( dlg, 3 ); | ||
548 | m_widgetStack.raiseWidget( dlg ); | ||
549 | } | ||
550 | } | ||
551 | |||
522 | void MainWindow::slotCloseDlg() | 552 | void MainWindow::slotCloseDlg() |
523 | { | 553 | { |
524 | // Close install dialog | 554 | // Close install dialog |
525 | delete m_widgetStack.visibleWidget(); | 555 | delete m_widgetStack.visibleWidget(); |
526 | 556 | ||
527 | // Reload package list | 557 | // Reload package list |
528 | initPackageInfo(); | 558 | initPackageInfo(); |
529 | 559 | ||
530 | // Update Opie launcher links | 560 | // Update Opie launcher links |
531 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 561 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
532 | QString lf = QString::null; | 562 | QString lf = QString::null; |
533 | e << lf; | 563 | e << lf; |
534 | 564 | ||
535 | // Reapply any filters previously set | 565 | // Reapply any filters previously set |
536 | if ( m_actionShowNotInstalled->isOn() ) | 566 | if ( m_actionShowNotInstalled->isOn() ) |
537 | slotShowNotInstalled(); | 567 | slotShowNotInstalled(); |
538 | else if ( m_actionShowInstalled->isOn() ) | 568 | else if ( m_actionShowInstalled->isOn() ) |
539 | slotShowInstalled(); | 569 | slotShowInstalled(); |
540 | else if ( m_actionShowUpdated->isOn() ) | 570 | else if ( m_actionShowUpdated->isOn() ) |
541 | slotShowUpdated(); | 571 | slotShowUpdated(); |
542 | else if ( m_actionFilter->isOn() ) | 572 | else if ( m_actionFilter->isOn() ) |
543 | slotFilter( true ); | 573 | slotFilter( true ); |
544 | } | 574 | } |
545 | 575 | ||
546 | void MainWindow::slotConfigure() | 576 | void MainWindow::slotConfigure() |
547 | { | 577 | { |
548 | if ( m_packman.configureDlg( false ) ) | 578 | if ( m_packman.configureDlg( false ) ) |
549 | { | 579 | { |
550 | if ( PromptDlg::ask( tr( "Config updated" ), | 580 | if ( PromptDlg::ask( tr( "Config updated" ), |
551 | tr( "The configuration has been updated. Do you want to update server and package information now?" ), | 581 | tr( "The configuration has been updated. Do you want to update server and package information now?" ), |
552 | tr( "Yes" ), tr( "No" ), this ) == 1 ) | 582 | tr( "Yes" ), tr( "No" ), this ) == 1 ) |
553 | { | 583 | { |
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h index 632effb..7968614 100644 --- a/noncore/settings/packagemanager/mainwindow.h +++ b/noncore/settings/packagemanager/mainwindow.h | |||
@@ -1,56 +1,56 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | =. Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
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 | #ifndef MAINWINDOW_H | 30 | #ifndef MAINWINDOW_H |
31 | #define MAINWINDOW_H | 31 | #define MAINWINDOW_H |
32 | 32 | ||
33 | #include "opackagemanager.h" | 33 | #include "opackagemanager.h" |
34 | 34 | ||
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | 36 | ||
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qmainwindow.h> | 39 | #include <qmainwindow.h> |
40 | #include <qpixmap.h> | 40 | #include <qpixmap.h> |
41 | #include <qprogressbar.h> | 41 | #include <qprogressbar.h> |
42 | #include <qtoolbar.h> | 42 | #include <qtoolbar.h> |
43 | #include <qwidgetstack.h> | 43 | #include <qwidgetstack.h> |
44 | 44 | ||
45 | class QAction; | 45 | class QAction; |
46 | class QLineEdit; | 46 | class QLineEdit; |
47 | 47 | ||
48 | class MainWindow :public QMainWindow | 48 | class MainWindow :public QMainWindow |
49 | { | 49 | { |
50 | Q_OBJECT | 50 | Q_OBJECT |
51 | 51 | ||
52 | public: | 52 | public: |
53 | MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); | 53 | MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); |
54 | static QString appName() { return QString::fromLatin1( "packagemanager" ); }; | 54 | static QString appName() { return QString::fromLatin1( "packagemanager" ); }; |
55 | 55 | ||
56 | protected: | 56 | protected: |
@@ -87,53 +87,54 @@ private: | |||
87 | QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available | 87 | QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available |
88 | QAction *m_actionFilter; // Action to filter packages | 88 | QAction *m_actionFilter; // Action to filter packages |
89 | QAction *m_actionFindNext; // Action to find next match | 89 | QAction *m_actionFindNext; // Action to find next match |
90 | 90 | ||
91 | // Cached filter settings | 91 | // Cached filter settings |
92 | QString m_filterName; // Cached name filter value | 92 | QString m_filterName; // Cached name filter value |
93 | QString m_filterServer; // Cached server name filter value | 93 | QString m_filterServer; // Cached server name filter value |
94 | QString m_filterDest; // Cached destination name filter value | 94 | QString m_filterDest; // Cached destination name filter value |
95 | OPackageManager::Status m_filterStatus; // Cached status filter value | 95 | OPackageManager::Status m_filterStatus; // Cached status filter value |
96 | QString m_filterCategory; // Cached category filter value | 96 | QString m_filterCategory; // Cached category filter value |
97 | 97 | ||
98 | void initPackageList(); | 98 | void initPackageList(); |
99 | void initStatusWidget(); | 99 | void initStatusWidget(); |
100 | void initUI(); | 100 | void initUI(); |
101 | 101 | ||
102 | void loadPackageList( OPackageList *packages = 0x0, bool clearList = true ); | 102 | void loadPackageList( OPackageList *packages = 0x0, bool clearList = true ); |
103 | void searchForPackage( const QString &text ); | 103 | void searchForPackage( const QString &text ); |
104 | 104 | ||
105 | private slots: | 105 | private slots: |
106 | void initPackageInfo(); | 106 | void initPackageInfo(); |
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 slotInstallLocal(); | ||
119 | void slotCloseDlg(); | 120 | void slotCloseDlg(); |
120 | void slotConfigure(); | 121 | void slotConfigure(); |
121 | 122 | ||
122 | // View menu action slots | 123 | // View menu action slots |
123 | void slotShowNotInstalled(); | 124 | void slotShowNotInstalled(); |
124 | void slotShowInstalled(); | 125 | void slotShowInstalled(); |
125 | void slotShowUpdated(); | 126 | void slotShowUpdated(); |
126 | void slotFilterChange(); | 127 | void slotFilterChange(); |
127 | void slotFilter( bool isOn ); | 128 | void slotFilter( bool isOn ); |
128 | 129 | ||
129 | // Find action slots | 130 | // Find action slots |
130 | void slotFindShowToolbar(); | 131 | void slotFindShowToolbar(); |
131 | void slotFindHideToolbar(); | 132 | void slotFindHideToolbar(); |
132 | void slotFindChanged( const QString &findText ); | 133 | void slotFindChanged( const QString &findText ); |
133 | void slotFindNext(); | 134 | void slotFindNext(); |
134 | 135 | ||
135 | // Other slots | 136 | // Other slots |
136 | void slotDisplayPackageInfo( QListViewItem * ); | 137 | void slotDisplayPackageInfo( QListViewItem * ); |
137 | }; | 138 | }; |
138 | 139 | ||
139 | #endif | 140 | #endif |