summaryrefslogtreecommitdiff
authordrw <drw>2003-03-04 01:15:19 (UTC)
committer drw <drw>2003-03-04 01:15:19 (UTC)
commit7cf53b4030437bdbd405b8b16684ba9f68e2891d (patch) (unidiff)
tree5dd4474a127422a837f886b83947ab494806225e
parentc0045eaf96fc06316bfab1ac2f5c4fade050c088 (diff)
downloadopie-7cf53b4030437bdbd405b8b16684ba9f68e2891d.zip
opie-7cf53b4030437bdbd405b8b16684ba9f68e2891d.tar.gz
opie-7cf53b4030437bdbd405b8b16684ba9f68e2891d.tar.bz2
Remove AQPkg's own help window, use standard help system
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro2
-rw-r--r--noncore/settings/aqpkg/doc.txt49
-rw-r--r--noncore/settings/aqpkg/helpwindow.cpp95
-rw-r--r--noncore/settings/aqpkg/helpwindow.h34
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp25
-rw-r--r--noncore/settings/aqpkg/mainwin.h2
6 files changed, 0 insertions, 207 deletions
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro
index 6b4fb30..e4076f5 100644
--- a/noncore/settings/aqpkg/aqpkg.pro
+++ b/noncore/settings/aqpkg/aqpkg.pro
@@ -1,61 +1,59 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = global.h \ 3 HEADERS = global.h \
4 mainwin.h \ 4 mainwin.h \
5 datamgr.h \ 5 datamgr.h \
6 settingsimpl.h \ 6 settingsimpl.h \
7 ipkg.h \ 7 ipkg.h \
8 package.h \ 8 package.h \
9 installdlgimpl.h \ 9 installdlgimpl.h \
10 instoptionsimpl.h \ 10 instoptionsimpl.h \
11 destination.h \ 11 destination.h \
12 utils.h \ 12 utils.h \
13 server.h \ 13 server.h \
14 helpwindow.h \
15 letterpushbutton.h \ 14 letterpushbutton.h \
16 inputdlg.h \ 15 inputdlg.h \
17 categoryfilterimpl.h 16 categoryfilterimpl.h
18 SOURCES = mainwin.cpp \ 17 SOURCES = mainwin.cpp \
19 datamgr.cpp \ 18 datamgr.cpp \
20 mem.cpp \ 19 mem.cpp \
21 settingsimpl.cpp \ 20 settingsimpl.cpp \
22 ipkg.cpp \ 21 ipkg.cpp \
23 main.cpp \ 22 main.cpp \
24 package.cpp \ 23 package.cpp \
25 installdlgimpl.cpp \ 24 installdlgimpl.cpp \
26 instoptionsimpl.cpp \ 25 instoptionsimpl.cpp \
27 destination.cpp \ 26 destination.cpp \
28 utils.cpp \ 27 utils.cpp \
29 server.cpp \ 28 server.cpp \
30 helpwindow.cpp \
31 letterpushbutton.cpp \ 29 letterpushbutton.cpp \
32 inputdlg.cpp \ 30 inputdlg.cpp \
33 version.cpp \ 31 version.cpp \
34 categoryfilterimpl.cpp 32 categoryfilterimpl.cpp
35 INTERFACES= 33 INTERFACES=
36 TARGET = aqpkg 34 TARGET = aqpkg
37INCLUDEPATH += $(OPIEDIR)/include 35INCLUDEPATH += $(OPIEDIR)/include
38DEPENDPATH += $(OPIEDIR)/include 36DEPENDPATH += $(OPIEDIR)/include
39LIBS += -lqpe -lopie -lstdc++ 37LIBS += -lqpe -lopie -lstdc++
40DESTDIR = $(OPIEDIR)/bin 38DESTDIR = $(OPIEDIR)/bin
41 39
42TRANSLATIONS = ../../../i18n/de/aqpkg.ts \ 40TRANSLATIONS = ../../../i18n/de/aqpkg.ts \
43 ../../../i18n/xx/aqpkg.ts \ 41 ../../../i18n/xx/aqpkg.ts \
44 ../../../i18n/en/aqpkg.ts \ 42 ../../../i18n/en/aqpkg.ts \
45 ../../../i18n/es/aqpkg.ts \ 43 ../../../i18n/es/aqpkg.ts \
46 ../../../i18n/fr/aqpkg.ts \ 44 ../../../i18n/fr/aqpkg.ts \
47 ../../../i18n/hu/aqpkg.ts \ 45 ../../../i18n/hu/aqpkg.ts \
48 ../../../i18n/ja/aqpkg.ts \ 46 ../../../i18n/ja/aqpkg.ts \
49 ../../../i18n/ko/aqpkg.ts \ 47 ../../../i18n/ko/aqpkg.ts \
50 ../../../i18n/no/aqpkg.ts \ 48 ../../../i18n/no/aqpkg.ts \
51 ../../../i18n/pl/aqpkg.ts \ 49 ../../../i18n/pl/aqpkg.ts \
52 ../../../i18n/pt/aqpkg.ts \ 50 ../../../i18n/pt/aqpkg.ts \
53 ../../../i18n/pt_BR/aqpkg.ts \ 51 ../../../i18n/pt_BR/aqpkg.ts \
54 ../../../i18n/sl/aqpkg.ts \ 52 ../../../i18n/sl/aqpkg.ts \
55 ../../../i18n/zh_CN/aqpkg.ts \ 53 ../../../i18n/zh_CN/aqpkg.ts \
56 ../../../i18n/zh_TW/aqpkg.ts \ 54 ../../../i18n/zh_TW/aqpkg.ts \
57 ../../../i18n/it/aqpkg.ts \ 55 ../../../i18n/it/aqpkg.ts \
58 ../../../i18n/da/aqpkg.ts 56 ../../../i18n/da/aqpkg.ts
59 57
60 58
61include ( $(OPIEDIR)/include.pro ) 59include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/aqpkg/doc.txt b/noncore/settings/aqpkg/doc.txt
deleted file mode 100644
index 7722c07..0000000
--- a/noncore/settings/aqpkg/doc.txt
+++ b/dev/null
@@ -1,49 +0,0 @@
1<qt><h1>Documentation for AQPkg</h1><p>
2AQPkg is a package manager for the Sharp Zaurus.<br>
3Basic Instructions:<br>
4On startup, you will be shown a window. The main part of the window is taken up
5by a list box showing packages. The packages shown will depend on the server selected.<br>
6The servers list contains network servers containing feeds of packages that can be downloaded
7and installed onto your Zaurus. These are held in the file /etc/ipkg.conf and can be maintained
8using AQPkg. In addition to the servers defined in ipkg.conf file, there are two other servers -
9local and local IPKGs. These are not network servers but views of yours Zaurus.<br>
10The local server shows all installed packages, and the local IPKGs server shows all ipks
11that are stored on your Zaurus.<br>
12On the local server, you can only remove packages. On the local IPKGs server you can only
13install and delete packages - removing installed packages is currently not working. On all other
14servers you can install, uninstall, upgrade and download packages.<br>
15To get the latest package list for a server (or refresh the view), select the server you
16wish to update and click the Refresh List button.<br>
17To download a package from a remote server, select the server (any except local and local IPKGs),
18then select the package(s) you wish to download (by tapping in the box next to the package
19name so that a tick appears in the box) and click the Download button. Enter the path where you
20want the package to be downloaded to and click OK to download the package.<br>
21To install, upgrade or remove a package select the packages you wish to install and click the Apply
22button. You will then be shown a dialog which allows you to select which destination you wish
23to install the package to, which packages will be installed, removed and upgraded. You can also
24set various options. (for the moment, see the documentation for IPKG for more details on these
25options). To start the process, click Start. This will perform the necessary operations and
26will show you what is happening. Once everything has completed click the Close button.<br>
27Note: Currently, the operation to perform for a package is automatically decided based on the
28following rules:<br>
29If a package isn't installed, then it will be installed.<br>
30If a package is installed and there isn't a later version available then it will be removed.<br>
31If a package is installed and a different version is available then it will be upgraded. (Note,
32I haven't yet found a way to determine if an available package is newer or older than the one
33currently installed so it is possible that a package may be downgraded).<br>
34As previously mentioned, a package can be explicitly removed by using the local server.<br><br>
35A couple of last notes, in the main window, the following may be useful:<br>
36If a package is installed then it will have (installed) after it.<br>
37If a different version is available then it will have a * after the package name.<br>
38You can view details of a package by tapping twice (quickly) on the package name (NOT the
39box next to the package name). This will show you a brief description of the package, the
40version installed (if it is installed), and the version available for download/installation
41(if a different on is available).<br><br><br>
42Well, hope you enjoy using this program. If you have any ideas/suggestions/ideas for improvements
43then please let me know at andy.qua@blueyonder.co.uk.<br><br>
44Thanks for using this.
45Andy.
46</p></qt>
47
48
49
diff --git a/noncore/settings/aqpkg/helpwindow.cpp b/noncore/settings/aqpkg/helpwindow.cpp
deleted file mode 100644
index 0302b3f..0000000
--- a/noncore/settings/aqpkg/helpwindow.cpp
+++ b/dev/null
@@ -1,95 +0,0 @@
1/***************************************************************************
2 helpwindow.cpp - description
3 -------------------
4 begin : Sun Sep 8 2002
5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include <qwidget.h>
19#include <qlayout.h>
20#include <qstring.h>
21#include <qtextview.h>
22
23#include "helpwindow.h"
24#include "global.h"
25
26
27#define HELP_TEXT \
28"<qt><h1>Documentation for AQPkg</h1><p> " \
29"AQPkg is a package manager for the Sharp Zaurus.<br><br> " \
30"Basic Instructions:<br><br> " \
31"On startup, you will be shown a window. The main part of the window is taken up " \
32"by a list box showing packages. The packages shown will depend on the server selected.<br><br> " \
33"The servers list contains network servers containing feeds of packages that can be downloaded " \
34"and installed onto your Zaurus. These are held in the file /etc/ipkg.conf and can be maintained " \
35"using AQPkg. In addition to the servers defined in ipkg.conf file, there are two other servers - " \
36"local and local IPKGs. These are not network servers but views of yours Zaurus.<br><br> " \
37"The local server shows all installed packages, and the local IPKGs server shows all ipks " \
38"that are stored on your Zaurus.<br><br> " \
39"On the local server, you can only remove packages. On the local IPKGs server you can only " \
40"install and delete packages - removing installed packages is currently not working. On all other " \
41"servers you can install, uninstall, upgrade and download packages.<br><br> " \
42"To get the latest package list for a server (or refresh the view), select the server you " \
43"wish to update and click the Refresh List button.<br><br> " \
44"To download a package from a remote server, select the server (any except local and local IPKGs), " \
45"then select the package(s) you wish to download (by tapping in the box next to the package " \
46"name so that a tick appears in the box) and click the Download button. Enter the path where you " \
47"want the package to be downloaded to and click OK to download the package.<br><br> " \
48"To install, upgrade or remove a package select the packages you wish to install and click the Apply " \
49"button. You will then be shown a dialog which allows you to select which destination you wish " \
50"to install the package to, which packages will be installed, removed and upgraded. You can also " \
51"set various options. (for the moment, see the documentation for IPKG for more details on these " \
52"options). To start the process, click Start. This will perform the necessary operations and " \
53"will show you what is happening. Once everything has completed click the Close button.<br><br> " \
54"Note: Currently, the operation to perform for a package is automatically decided based on the " \
55"following rules:<br><br> " \
56" If a package isn't installed, then it will be installed.<br> " \
57" If a package is installed and there isn't a later version available then it will be removed.<br> " \
58" If a package is installed and a different version is available then it will be upgraded. (Note, " \
59"I haven't yet found a way to determine if an available package is newer or older than the one " \
60"currently installed so it is possible that a package may be downgraded).<br><br> " \
61"As previously mentioned, a package can be explicitly removed by using the local server.<br><br> " \
62"A couple of last notes, in the main window, the following may be useful:<br><br> " \
63"If a package is installed then it will have (installed) after it.<br><br> " \
64"If a different version is available then it will have a * after the package name.<br><br> " \
65"You can view details of a package by tapping twice (quickly) on the package name (NOT the " \
66"box next to the package name). This will show you a brief description of the package, the " \
67"version installed (if it is installed), and the version available for download or installation " \
68"(if a different on is available).<br><br> " \
69"Well, hope you enjoy using this program. If you have any ideas/suggestions/ideas for improvements " \
70"then please let me know at andy.qua@blueyonder.co.uk.<br><br> " \
71"Thanks for using this. " \
72"Andy. " \
73"</p></qt>"
74
75
76HelpWindow::HelpWindow( QWidget *parent, const char *name, bool modal, WFlags flags )
77 : QDialog( parent, name, modal, flags )
78{
79// resize( 230, 280 );
80
81 setCaption( "Help for AQPkg" );
82
83 QVBoxLayout *layout = new QVBoxLayout( this );
84 QString text = HELP_TEXT;;
85 QTextView *view = new QTextView( text, 0, this, "view" );
86 layout->insertSpacing( -1, 5 );
87 layout->insertWidget( -1, view );
88 layout->insertSpacing( -1, 5 );
89
90 showMaximized();
91}
92
93HelpWindow::~HelpWindow()
94{
95}
diff --git a/noncore/settings/aqpkg/helpwindow.h b/noncore/settings/aqpkg/helpwindow.h
deleted file mode 100644
index edc1b6e..0000000
--- a/noncore/settings/aqpkg/helpwindow.h
+++ b/dev/null
@@ -1,34 +0,0 @@
1/***************************************************************************
2 helpwindow.h - description
3 -------------------
4 begin : Sun Sep 8 2002
5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef HELPWINDOW_H
19#define HELPWINDOW_H
20
21#include <qdialog.h>
22
23/**
24 *@author Andy Qua
25 */
26
27class HelpWindow : public QDialog
28{
29public:
30 HelpWindow( QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags flags = 0 );
31 ~HelpWindow();
32};
33
34#endif
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 8ae5815..392d04d 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1,1168 +1,1143 @@
1/*************************************************************************** 1/***************************************************************************
2 mainwin.cpp - description 2 mainwin.cpp - description
3 ------------------- 3 -------------------
4 begin : Mon Aug 26 13:32:30 BST 2002 4 begin : Mon Aug 26 13:32:30 BST 2002
5 copyright : (C) 2002 by Andy Qua 5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk 6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
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 <qpe/qpemenubar.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.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>
29#include <qcombobox.h> 29#include <qcombobox.h>
30#include <qfile.h> 30#include <qfile.h>
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qlineedit.h> 33#include <qlineedit.h>
34#include <qlistview.h> 34#include <qlistview.h>
35#include <qmenubar.h> 35#include <qmenubar.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37#include <qpopupmenu.h> 37#include <qpopupmenu.h>
38#include <qprogressbar.h> 38#include <qprogressbar.h>
39#include <qtimer.h> 39#include <qtimer.h>
40#include <qwhatsthis.h> 40#include <qwhatsthis.h>
41#include <qwidgetstack.h> 41#include <qwidgetstack.h>
42 42
43#include "categoryfilterimpl.h" 43#include "categoryfilterimpl.h"
44#include "datamgr.h" 44#include "datamgr.h"
45#include "global.h" 45#include "global.h"
46#include "helpwindow.h"
47#include "inputdlg.h" 46#include "inputdlg.h"
48#include "ipkg.h" 47#include "ipkg.h"
49#include "installdlgimpl.h" 48#include "installdlgimpl.h"
50#include "letterpushbutton.h" 49#include "letterpushbutton.h"
51#include "mainwin.h" 50#include "mainwin.h"
52#include "settingsimpl.h" 51#include "settingsimpl.h"
53#include "utils.h" 52#include "utils.h"
54 53
55extern int compareVersions( const char *v1, const char *v2 ); 54extern int compareVersions( const char *v1, const char *v2 );
56 55
57MainWindow :: MainWindow() 56MainWindow :: MainWindow()
58 :QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) 57 :QMainWindow( 0x0, 0x0, WStyle_ContextHelp )
59{ 58{
60 setCaption( tr( "AQPkg - Package Manager" ) ); 59 setCaption( tr( "AQPkg - Package Manager" ) );
61 60
62 // Create UI widgets 61 // Create UI widgets
63 initMainWidget(); 62 initMainWidget();
64 initProgressWidget(); 63 initProgressWidget();
65 64
66 // Build menu and tool bars 65 // Build menu and tool bars
67 setToolBarsMovable( FALSE ); 66 setToolBarsMovable( FALSE );
68 67
69 QPEToolBar *bar = new QPEToolBar( this ); 68 QPEToolBar *bar = new QPEToolBar( this );
70 bar->setHorizontalStretchable( TRUE ); 69 bar->setHorizontalStretchable( TRUE );
71 QPEMenuBar *mb = new QPEMenuBar( bar ); 70 QPEMenuBar *mb = new QPEMenuBar( bar );
72 mb->setMargin( 0 ); 71 mb->setMargin( 0 );
73 bar = new QPEToolBar( this ); 72 bar = new QPEToolBar( this );
74 73
75 // Find toolbar 74 // Find toolbar
76 findBar = new QPEToolBar( this ); 75 findBar = new QPEToolBar( this );
77 addToolBar( findBar, QMainWindow::Top, true ); 76 addToolBar( findBar, QMainWindow::Top, true );
78 findBar->setHorizontalStretchable( true ); 77 findBar->setHorizontalStretchable( true );
79 findEdit = new QLineEdit( findBar ); 78 findEdit = new QLineEdit( findBar );
80 QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); 79 QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) );
81 findBar->setStretchableWidget( findEdit ); 80 findBar->setStretchableWidget( findEdit );
82 connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); 81 connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) );
83 82
84 // Quick jump toolbar 83 // Quick jump toolbar
85 jumpBar = new QPEToolBar( this ); 84 jumpBar = new QPEToolBar( this );
86 addToolBar( jumpBar, QMainWindow::Top, true ); 85 addToolBar( jumpBar, QMainWindow::Top, true );
87 jumpBar->setHorizontalStretchable( true ); 86 jumpBar->setHorizontalStretchable( true );
88 QWidget *w = new QWidget( jumpBar ); 87 QWidget *w = new QWidget( jumpBar );
89 jumpBar->setStretchableWidget( w ); 88 jumpBar->setStretchableWidget( w );
90 89
91 QGridLayout *layout = new QGridLayout( w ); 90 QGridLayout *layout = new QGridLayout( w );
92 91
93 char text[2]; 92 char text[2];
94 text[1] = '\0'; 93 text[1] = '\0';
95 for ( int i = 0 ; i < 26 ; ++i ) 94 for ( int i = 0 ; i < 26 ; ++i )
96 { 95 {
97 text[0] = 'A' + i; 96 text[0] = 'A' + i;
98 LetterPushButton *b = new LetterPushButton( text, w ); 97 LetterPushButton *b = new LetterPushButton( text, w );
99 connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); 98 connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) );
100 layout->addWidget( b, i / 13, i % 13); 99 layout->addWidget( b, i / 13, i % 13);
101 } 100 }
102 101
103 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 );
104 a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); 103 a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) );
105 connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); 104 connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) );
106 a->addTo( jumpBar ); 105 a->addTo( jumpBar );
107 jumpBar->hide(); 106 jumpBar->hide();
108 107
109 // Packages menu 108 // Packages menu
110 QPopupMenu *popup = new QPopupMenu( this ); 109 QPopupMenu *popup = new QPopupMenu( this );
111 110
112 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 );
113 a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); 112 a->setWhatsThis( tr( "Click here to update package lists from servers." ) );
114 connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); 113 connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) );
115 a->addTo( popup ); 114 a->addTo( popup );
116 a->addTo( bar ); 115 a->addTo( bar );
117 116
118 actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); 117 actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 );
119 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); 118 actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) );
120 connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); 119 connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) );
121 actionUpgrade->addTo( popup ); 120 actionUpgrade->addTo( popup );
122 actionUpgrade->addTo( bar ); 121 actionUpgrade->addTo( bar );
123 122
124 iconDownload = Resource::loadPixmap( "aqpkg/download" ); 123 iconDownload = Resource::loadPixmap( "aqpkg/download" );
125 iconRemove = Resource::loadPixmap( "aqpkg/remove" ); 124 iconRemove = Resource::loadPixmap( "aqpkg/remove" );
126 actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); 125 actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 );
127 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); 126 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) );
128 connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); 127 connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) );
129 actionDownload->addTo( popup ); 128 actionDownload->addTo( popup );
130 actionDownload->addTo( bar ); 129 actionDownload->addTo( bar );
131 130
132 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); 131 a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 );
133 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); 132 a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) );
134 connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); 133 connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) );
135 a->addTo( popup ); 134 a->addTo( popup );
136 a->addTo( bar ); 135 a->addTo( bar );
137 136
138 mb->insertItem( tr( "Actions" ), popup ); 137 mb->insertItem( tr( "Actions" ), popup );
139 138
140 // View menu 139 // View menu
141 popup = new QPopupMenu( this ); 140 popup = new QPopupMenu( this );
142 141
143 actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); 142 actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
144 actionUninstalled->setToggleAction( TRUE ); 143 actionUninstalled->setToggleAction( TRUE );
145 actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); 144 actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) );
146 connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); 145 connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) );
147 actionUninstalled->addTo( popup ); 146 actionUninstalled->addTo( popup );
148 147
149 actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); 148 actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 );
150 actionInstalled->setToggleAction( TRUE ); 149 actionInstalled->setToggleAction( TRUE );
151 actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); 150 actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) );
152 connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); 151 connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) );
153 actionInstalled->addTo( popup ); 152 actionInstalled->addTo( popup );
154 153
155 actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); 154 actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 );
156 actionUpdated->setToggleAction( TRUE ); 155 actionUpdated->setToggleAction( TRUE );
157 actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); 156 actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) );
158 connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); 157 connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) );
159 actionUpdated->addTo( popup ); 158 actionUpdated->addTo( popup );
160 159
161 popup->insertSeparator(); 160 popup->insertSeparator();
162 161
163 actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); 162 actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 );
164 actionFilter->setToggleAction( TRUE ); 163 actionFilter->setToggleAction( TRUE );
165 actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); 164 actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) );
166 connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); 165 connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) );
167 actionFilter->addTo( popup ); 166 actionFilter->addTo( popup );
168 167
169 a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); 168 a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 );
170 a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); 169 a->setWhatsThis( tr( "Click here to change package category to used filter." ) );
171 connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); 170 connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) );
172 a->addTo( popup ); 171 a->addTo( popup );
173 172
174 popup->insertSeparator(); 173 popup->insertSeparator();
175 174
176 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 175 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
177 a->setWhatsThis( tr( "Click here to search for text in package names." ) ); 176 a->setWhatsThis( tr( "Click here to search for text in package names." ) );
178 connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); 177 connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) );
179 a->addTo( popup ); 178 a->addTo( popup );
180 179
181 actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); 180 actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 );
182 actionFindNext->setEnabled( FALSE ); 181 actionFindNext->setEnabled( FALSE );
183 actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); 182 actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) );
184 connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); 183 connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) );
185 actionFindNext->addTo( popup ); 184 actionFindNext->addTo( popup );
186 actionFindNext->addTo( findBar ); 185 actionFindNext->addTo( findBar );
187 186
188 187
189 popup->insertSeparator(); 188 popup->insertSeparator();
190 189
191 a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); 190 a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 );
192 a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); 191 a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) );
193 connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); 192 connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) );
194 a->addTo( popup ); 193 a->addTo( popup );
195 194
196 mb->insertItem( tr( "View" ), popup ); 195 mb->insertItem( tr( "View" ), popup );
197 196
198 197
199 // Options menu 198 // Options menu
200 popup = new QPopupMenu( this ); 199 popup = new QPopupMenu( this );
201 200
202 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 ); 201 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 );
203 a->setWhatsThis( tr( "Click here to configure this application." ) ); 202 a->setWhatsThis( tr( "Click here to configure this application." ) );
204 connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); 203 connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) );
205 a->addTo( popup ); 204 a->addTo( popup );
206 205
207 popup->insertSeparator();
208
209 a = new QAction( tr( "Help" ), Resource::loadPixmap( "help_icon" ), QString::null, 0, this, 0 );
210 a->setWhatsThis( tr( "Click here for help." ) );
211 connect( a, SIGNAL( activated() ), this, SLOT( displayHelp() ) );
212 a->addTo( popup );
213
214 a = new QAction( tr( "About" ), Resource::loadPixmap( "UtilsIcon" ), QString::null, 0, this, 0 );
215 a->setWhatsThis( tr( "Click here for software version information." ) );
216 connect( a, SIGNAL( activated() ), this, SLOT( displayAbout() ) );
217 a->addTo( popup );
218
219 mb->insertItem( tr( "Options" ), popup ); 206 mb->insertItem( tr( "Options" ), popup );
220 207
221 // Finish find toolbar creation 208 // Finish find toolbar creation
222 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 209 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
223 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); 210 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) );
224 connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); 211 connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) );
225 a->addTo( findBar ); 212 a->addTo( findBar );
226 findBar->hide(); 213 findBar->hide();
227 214
228 // Create widget stack and add UI widgets 215 // Create widget stack and add UI widgets
229 stack = new QWidgetStack( this ); 216 stack = new QWidgetStack( this );
230 stack->addWidget( progressWindow, 2 ); 217 stack->addWidget( progressWindow, 2 );
231 stack->addWidget( networkPkgWindow, 1 ); 218 stack->addWidget( networkPkgWindow, 1 );
232 setCentralWidget( stack ); 219 setCentralWidget( stack );
233 stack->raiseWidget( progressWindow ); 220 stack->raiseWidget( progressWindow );
234 221
235 // Delayed call to finish initialization 222 // Delayed call to finish initialization
236 QTimer::singleShot( 100, this, SLOT( init() ) ); 223 QTimer::singleShot( 100, this, SLOT( init() ) );
237} 224}
238 225
239MainWindow :: ~MainWindow() 226MainWindow :: ~MainWindow()
240{ 227{
241 delete mgr; 228 delete mgr;
242} 229}
243 230
244void MainWindow :: initMainWidget() 231void MainWindow :: initMainWidget()
245{ 232{
246 networkPkgWindow = new QWidget( this ); 233 networkPkgWindow = new QWidget( this );
247 234
248 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); 235 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow );
249 236
250 serversList = new QComboBox( networkPkgWindow ); 237 serversList = new QComboBox( networkPkgWindow );
251 connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); 238 connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) );
252 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); 239 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) );
253 240
254 installedIcon = Resource::loadPixmap( "aqpkg/installed" ); 241 installedIcon = Resource::loadPixmap( "aqpkg/installed" );
255 updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); 242 updatedIcon = Resource::loadPixmap( "aqpkg/updated" );
256 243
257 packagesList = new QListView( networkPkgWindow ); 244 packagesList = new QListView( networkPkgWindow );
258 packagesList->addColumn( tr( "Packages" ), 225 ); 245 packagesList->addColumn( tr( "Packages" ), 225 );
259 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." ) ); 246 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." ) );
260 247
261 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); 248 QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 );
262 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); 249 QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 );
263 hbox1->addWidget( l ); 250 hbox1->addWidget( l );
264 hbox1->addWidget( serversList ); 251 hbox1->addWidget( serversList );
265 252
266 vbox->addWidget( packagesList ); 253 vbox->addWidget( packagesList );
267 254
268 downloadEnabled = TRUE; 255 downloadEnabled = TRUE;
269} 256}
270 257
271void MainWindow :: initProgressWidget() 258void MainWindow :: initProgressWidget()
272{ 259{
273 progressWindow = new QWidget( this ); 260 progressWindow = new QWidget( this );
274 261
275 QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); 262 QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 );
276 263
277 m_status = new QLabel( progressWindow ); 264 m_status = new QLabel( progressWindow );
278 m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 265 m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
279 layout->addWidget( m_status ); 266 layout->addWidget( m_status );
280 267
281 m_progress = new QProgressBar( progressWindow ); 268 m_progress = new QProgressBar( progressWindow );
282 layout->addWidget( m_progress ); 269 layout->addWidget( m_progress );
283} 270}
284 271
285void MainWindow :: init() 272void MainWindow :: init()
286{ 273{
287#ifdef QWS 274#ifdef QWS
288 // read download directory from config file 275 // read download directory from config file
289 Config cfg( "aqpkg" ); 276 Config cfg( "aqpkg" );
290 cfg.setGroup( "settings" ); 277 cfg.setGroup( "settings" );
291 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); 278 currentlySelectedServer = cfg.readEntry( "selectedServer", "local" );
292// showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); 279// showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" );
293 280
294#endif 281#endif
295 282
296 stack->raiseWidget( progressWindow ); 283 stack->raiseWidget( progressWindow );
297 284
298 mgr = new DataManager(); 285 mgr = new DataManager();
299 connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); 286 connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) );
300 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), 287 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ),
301 this, SLOT( setProgressMessage( const QString & ) ) ); 288 this, SLOT( setProgressMessage( const QString & ) ) );
302 connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); 289 connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) );
303 mgr->loadServers(); 290 mgr->loadServers();
304 291
305 showUninstalledPkgs = false; 292 showUninstalledPkgs = false;
306 showInstalledPkgs = false; 293 showInstalledPkgs = false;
307 showUpgradedPkgs = false; 294 showUpgradedPkgs = false;
308 categoryFilterEnabled = false; 295 categoryFilterEnabled = false;
309 296
310 updateData(); 297 updateData();
311 298
312 stack->raiseWidget( networkPkgWindow ); 299 stack->raiseWidget( networkPkgWindow );
313} 300}
314/* 301/*
315void MainWindow :: setDocument( const QString &doc ) 302void MainWindow :: setDocument( const QString &doc )
316{ 303{
317 // Remove path from package 304 // Remove path from package
318 QString package = Utils::getPackageNameFromIpkFilename( doc ); 305 QString package = Utils::getPackageNameFromIpkFilename( doc );
319// std::cout << "Selecting package " << package << std::endl; 306// std::cout << "Selecting package " << package << std::endl;
320 307
321 // First select local server 308 // First select local server
322 for ( int i = 0 ; i < serversList->count() ; ++i ) 309 for ( int i = 0 ; i < serversList->count() ; ++i )
323 { 310 {
324 if ( serversList->text( i ) == LOCAL_IPKGS ) 311 if ( serversList->text( i ) == LOCAL_IPKGS )
325 { 312 {
326 serversList->setCurrentItem( i ); 313 serversList->setCurrentItem( i );
327 break; 314 break;
328 } 315 }
329 } 316 }
330 serverSelected( 0 ); 317 serverSelected( 0 );
331 318
332 // Now set the check box of the selected package 319 // Now set the check box of the selected package
333 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 320 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
334 item != 0 ; 321 item != 0 ;
335 item = (QCheckListItem *)item->nextSibling() ) 322 item = (QCheckListItem *)item->nextSibling() )
336 { 323 {
337 if ( item->text().startsWith( package ) ) 324 if ( item->text().startsWith( package ) )
338 { 325 {
339 item->setOn( true ); 326 item->setOn( true );
340 break; 327 break;
341 } 328 }
342 } 329 }
343} 330}
344*/ 331*/
345void MainWindow :: displaySettings() 332void MainWindow :: displaySettings()
346{ 333{
347 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); 334 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
348 if ( dlg->showDlg() ) 335 if ( dlg->showDlg() )
349 { 336 {
350 stack->raiseWidget( progressWindow ); 337 stack->raiseWidget( progressWindow );
351 updateData(); 338 updateData();
352 stack->raiseWidget( networkPkgWindow ); 339 stack->raiseWidget( networkPkgWindow );
353 } 340 }
354 delete dlg; 341 delete dlg;
355} 342}
356
357void MainWindow :: displayHelp()
358{
359 HelpWindow *dlg = new HelpWindow( this );
360 dlg->exec();
361 delete dlg;
362}
363 343
364void MainWindow :: displayFindBar() 344void MainWindow :: displayFindBar()
365{ 345{
366 findBar->show(); 346 findBar->show();
367 findEdit->setFocus(); 347 findEdit->setFocus();
368} 348}
369 349
370void MainWindow :: displayJumpBar() 350void MainWindow :: displayJumpBar()
371{ 351{
372 jumpBar->show(); 352 jumpBar->show();
373} 353}
374 354
375void MainWindow :: repeatFind() 355void MainWindow :: repeatFind()
376{ 356{
377 searchForPackage( findEdit->text() ); 357 searchForPackage( findEdit->text() );
378} 358}
379 359
380void MainWindow :: findPackage( const QString &text ) 360void MainWindow :: findPackage( const QString &text )
381{ 361{
382 actionFindNext->setEnabled( !text.isEmpty() ); 362 actionFindNext->setEnabled( !text.isEmpty() );
383 searchForPackage( text ); 363 searchForPackage( text );
384} 364}
385 365
386void MainWindow :: hideFindBar() 366void MainWindow :: hideFindBar()
387{ 367{
388 findBar->hide(); 368 findBar->hide();
389} 369}
390 370
391void MainWindow :: hideJumpBar() 371void MainWindow :: hideJumpBar()
392{ 372{
393 jumpBar->hide(); 373 jumpBar->hide();
394} 374}
395 375
396void MainWindow :: displayAbout()
397{
398 QMessageBox::about( this, tr( "About AQPkg" ), tr( VERSION_TEXT ) );
399}
400
401void MainWindow :: filterUninstalledPackages() 376void MainWindow :: filterUninstalledPackages()
402{ 377{
403 showUninstalledPkgs = actionUninstalled->isOn(); 378 showUninstalledPkgs = actionUninstalled->isOn();
404 if ( showUninstalledPkgs ) 379 if ( showUninstalledPkgs )
405 { 380 {
406 showInstalledPkgs = FALSE; 381 showInstalledPkgs = FALSE;
407 showUpgradedPkgs = FALSE; 382 showUpgradedPkgs = FALSE;
408 } 383 }
409 serverSelected( -1 ); 384 serverSelected( -1 );
410 385
411 actionInstalled->setOn( FALSE ); 386 actionInstalled->setOn( FALSE );
412 actionUpdated->setOn( FALSE ); 387 actionUpdated->setOn( FALSE );
413} 388}
414 389
415void MainWindow :: filterInstalledPackages() 390void MainWindow :: filterInstalledPackages()
416{ 391{
417 showInstalledPkgs = actionInstalled->isOn(); 392 showInstalledPkgs = actionInstalled->isOn();
418 if ( showInstalledPkgs ) 393 if ( showInstalledPkgs )
419 { 394 {
420 showUninstalledPkgs = FALSE; 395 showUninstalledPkgs = FALSE;
421 showUpgradedPkgs = FALSE; 396 showUpgradedPkgs = FALSE;
422 } 397 }
423 serverSelected( -1 ); 398 serverSelected( -1 );
424 399
425 actionUninstalled->setOn( FALSE ); 400 actionUninstalled->setOn( FALSE );
426 actionUpdated->setOn( FALSE ); 401 actionUpdated->setOn( FALSE );
427} 402}
428 403
429void MainWindow :: filterUpgradedPackages() 404void MainWindow :: filterUpgradedPackages()
430{ 405{
431 showUpgradedPkgs = actionUpdated->isOn(); 406 showUpgradedPkgs = actionUpdated->isOn();
432 if ( showUpgradedPkgs ) 407 if ( showUpgradedPkgs )
433 { 408 {
434 showUninstalledPkgs = FALSE; 409 showUninstalledPkgs = FALSE;
435 showInstalledPkgs = FALSE; 410 showInstalledPkgs = FALSE;
436 } 411 }
437 serverSelected( -1 ); 412 serverSelected( -1 );
438 413
439 actionUninstalled->setOn( FALSE ); 414 actionUninstalled->setOn( FALSE );
440 actionInstalled->setOn( FALSE ); 415 actionInstalled->setOn( FALSE );
441} 416}
442 417
443bool MainWindow :: setFilterCategory() 418bool MainWindow :: setFilterCategory()
444{ 419{
445 // Get categories; 420 // Get categories;
446 CategoryFilterImpl dlg( DataManager::getAvailableCategories(), categoryFilter, this ); 421 CategoryFilterImpl dlg( DataManager::getAvailableCategories(), categoryFilter, this );
447 if ( dlg.exec() == QDialog::Accepted ) 422 if ( dlg.exec() == QDialog::Accepted )
448 { 423 {
449 categoryFilter = dlg.getSelectedFilter(); 424 categoryFilter = dlg.getSelectedFilter();
450 425
451 if ( categoryFilter == "" ) 426 if ( categoryFilter == "" )
452 return false; 427 return false;
453 428
454 categoryFilterEnabled = true; 429 categoryFilterEnabled = true;
455 serverSelected( -1 ); 430 serverSelected( -1 );
456 actionFilter->setOn( TRUE ); 431 actionFilter->setOn( TRUE );
457 return true; 432 return true;
458 } 433 }
459 434
460 return false; 435 return false;
461} 436}
462 437
463void MainWindow :: filterCategory() 438void MainWindow :: filterCategory()
464{ 439{
465 if ( !actionFilter->isOn() ) 440 if ( !actionFilter->isOn() )
466 { 441 {
467 filterByCategory( FALSE ); 442 filterByCategory( FALSE );
468 } 443 }
469 else 444 else
470 { 445 {
471 actionFilter->setOn( filterByCategory( TRUE ) ); 446 actionFilter->setOn( filterByCategory( TRUE ) );
472 } 447 }
473} 448}
474 449
475bool MainWindow :: filterByCategory( bool val ) 450bool MainWindow :: filterByCategory( bool val )
476{ 451{
477 if ( val ) 452 if ( val )
478 { 453 {
479 if ( categoryFilter == "" ) 454 if ( categoryFilter == "" )
480 { 455 {
481 if ( !setFilterCategory() ) 456 if ( !setFilterCategory() )
482 return false; 457 return false;
483 } 458 }
484 459
485 categoryFilterEnabled = true; 460 categoryFilterEnabled = true;
486 serverSelected( -1 ); 461 serverSelected( -1 );
487 return true; 462 return true;
488 } 463 }
489 else 464 else
490 { 465 {
491 // Turn off filter 466 // Turn off filter
492 categoryFilterEnabled = false; 467 categoryFilterEnabled = false;
493 serverSelected( -1 ); 468 serverSelected( -1 );
494 return false; 469 return false;
495 } 470 }
496} 471}
497 472
498void MainWindow :: raiseMainWidget() 473void MainWindow :: raiseMainWidget()
499{ 474{
500 stack->raiseWidget( networkPkgWindow ); 475 stack->raiseWidget( networkPkgWindow );
501} 476}
502 477
503void MainWindow :: raiseProgressWidget() 478void MainWindow :: raiseProgressWidget()
504{ 479{
505 stack->raiseWidget( progressWindow ); 480 stack->raiseWidget( progressWindow );
506} 481}
507 482
508void MainWindow :: enableUpgrade( bool enabled ) 483void MainWindow :: enableUpgrade( bool enabled )
509{ 484{
510 actionUpgrade->setEnabled( enabled ); 485 actionUpgrade->setEnabled( enabled );
511} 486}
512 487
513void MainWindow :: enableDownload( bool enabled ) 488void MainWindow :: enableDownload( bool enabled )
514{ 489{
515 if ( enabled ) 490 if ( enabled )
516 { 491 {
517 actionDownload->setIconSet( iconDownload ); 492 actionDownload->setIconSet( iconDownload );
518 actionDownload->setText( tr( "Download" ) ); 493 actionDownload->setText( tr( "Download" ) );
519 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); 494 actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) );
520 } 495 }
521 else 496 else
522 { 497 {
523 actionDownload->setIconSet( iconRemove ); 498 actionDownload->setIconSet( iconRemove );
524 actionDownload->setText( tr( "Remove" ) ); 499 actionDownload->setText( tr( "Remove" ) );
525 actionDownload->setWhatsThis( tr( "Click here to uninstall the currently selected package(s)." ) ); 500 actionDownload->setWhatsThis( tr( "Click here to uninstall the currently selected package(s)." ) );
526 } 501 }
527} 502}
528 503
529void MainWindow :: setProgressSteps( int numsteps ) 504void MainWindow :: setProgressSteps( int numsteps )
530{ 505{
531 m_progress->setTotalSteps( numsteps ); 506 m_progress->setTotalSteps( numsteps );
532} 507}
533 508
534void MainWindow :: setProgressMessage( const QString &msg ) 509void MainWindow :: setProgressMessage( const QString &msg )
535{ 510{
536 m_status->setText( msg ); 511 m_status->setText( msg );
537} 512}
538 513
539void MainWindow :: updateProgress( int progress ) 514void MainWindow :: updateProgress( int progress )
540{ 515{
541 m_progress->setProgress( progress ); 516 m_progress->setProgress( progress );
542} 517}
543 518
544void MainWindow :: updateData() 519void MainWindow :: updateData()
545{ 520{
546 m_progress->setTotalSteps( mgr->getServerList().count() ); 521 m_progress->setTotalSteps( mgr->getServerList().count() );
547 522
548 serversList->clear(); 523 serversList->clear();
549 packagesList->clear(); 524 packagesList->clear();
550 525
551 int activeItem = -1; 526 int activeItem = -1;
552 int i = 0; 527 int i = 0;
553 QString serverName; 528 QString serverName;
554 529
555 QListIterator<Server> it( mgr->getServerList() ); 530 QListIterator<Server> it( mgr->getServerList() );
556 Server *server; 531 Server *server;
557 532
558 for ( ; it.current(); ++it, ++i ) 533 for ( ; it.current(); ++it, ++i )
559 { 534 {
560 server = it.current(); 535 server = it.current();
561 serverName = server->getServerName(); 536 serverName = server->getServerName();
562 m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); 537 m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) );
563 m_progress->setProgress( i ); 538 m_progress->setProgress( i );
564 qApp->processEvents(); 539 qApp->processEvents();
565 540
566// cout << "Adding " << it->getServerName() << " to combobox" << endl; 541// cout << "Adding " << it->getServerName() << " to combobox" << endl;
567 if ( !server->isServerActive() ) 542 if ( !server->isServerActive() )
568 { 543 {
569// cout << serverName << " is not active" << endl; 544// cout << serverName << " is not active" << endl;
570 i--; 545 i--;
571 continue; 546 continue;
572 } 547 }
573 548
574 serversList->insertItem( serverName ); 549 serversList->insertItem( serverName );
575 if ( serverName == currentlySelectedServer ) 550 if ( serverName == currentlySelectedServer )
576 activeItem = i; 551 activeItem = i;
577 } 552 }
578 553
579 // set selected server to be active server 554 // set selected server to be active server
580 if ( activeItem != -1 ) 555 if ( activeItem != -1 )
581 serversList->setCurrentItem( activeItem ); 556 serversList->setCurrentItem( activeItem );
582 serverSelected( 0, FALSE ); 557 serverSelected( 0, FALSE );
583} 558}
584 559
585void MainWindow :: serverSelected( int index ) 560void MainWindow :: serverSelected( int index )
586{ 561{
587 serverSelected( index, TRUE ); 562 serverSelected( index, TRUE );
588} 563}
589 564
590void MainWindow :: serverSelected( int, bool raiseProgress ) 565void MainWindow :: serverSelected( int, bool raiseProgress )
591{ 566{
592 QPixmap nullIcon( installedIcon.size() ); 567 QPixmap nullIcon( installedIcon.size() );
593 nullIcon.fill( colorGroup().base() ); 568 nullIcon.fill( colorGroup().base() );
594 569
595 // display packages 570 // display packages
596 QString serverName = serversList->currentText(); 571 QString serverName = serversList->currentText();
597 currentlySelectedServer = serverName; 572 currentlySelectedServer = serverName;
598 573
599 Server *s = mgr->getServer( serverName ); 574 Server *s = mgr->getServer( serverName );
600 575
601 QList<Package> &list = s->getPackageList(); 576 QList<Package> &list = s->getPackageList();
602 QListIterator<Package> it( list ); 577 QListIterator<Package> it( list );
603 578
604 // Display progress widget while loading list 579 // Display progress widget while loading list
605 bool doProgress = ( list.count() > 200 ); 580 bool doProgress = ( list.count() > 200 );
606 if ( doProgress ) 581 if ( doProgress )
607 { 582 {
608 if ( raiseProgress ) 583 if ( raiseProgress )
609 { 584 {
610 stack->raiseWidget( progressWindow ); 585 stack->raiseWidget( progressWindow );
611 } 586 }
612 m_progress->setTotalSteps( list.count() ); 587 m_progress->setTotalSteps( list.count() );
613 m_status->setText( tr( "Building package list for:\n\t%1" ).arg( serverName ) ); 588 m_status->setText( tr( "Building package list for:\n\t%1" ).arg( serverName ) );
614 } 589 }
615 590
616 packagesList->clear(); 591 packagesList->clear();
617 592
618#ifdef QWS 593#ifdef QWS
619 // read download directory from config file 594 // read download directory from config file
620 Config cfg( "aqpkg" ); 595 Config cfg( "aqpkg" );
621 cfg.setGroup( "settings" ); 596 cfg.setGroup( "settings" );
622 cfg.writeEntry( "selectedServer", currentlySelectedServer ); 597 cfg.writeEntry( "selectedServer", currentlySelectedServer );
623#endif 598#endif
624 599
625 int i = 0; 600 int i = 0;
626 Package *package; 601 Package *package;
627 for ( ; it.current(); ++it ) 602 for ( ; it.current(); ++it )
628 { 603 {
629 // Update progress after every 100th package (arbitrary value, seems to give good balance) 604 // Update progress after every 100th package (arbitrary value, seems to give good balance)
630 i++; 605 i++;
631 if ( ( i % 100 ) == 0 ) 606 if ( ( i % 100 ) == 0 )
632 { 607 {
633 if ( doProgress ) 608 if ( doProgress )
634 { 609 {
635 m_progress->setProgress( i ); 610 m_progress->setProgress( i );
636 } 611 }
637 qApp->processEvents(); 612 qApp->processEvents();
638 } 613 }
639 614
640 QString text = ""; 615 QString text = "";
641 616
642 package = it.current(); 617 package = it.current();
643 618
644 // Apply show only uninstalled packages filter 619 // Apply show only uninstalled packages filter
645 if ( showUninstalledPkgs && package->isInstalled() ) 620 if ( showUninstalledPkgs && package->isInstalled() )
646 continue; 621 continue;
647 622
648 // Apply show only installed packages filter 623 // Apply show only installed packages filter
649 if ( showInstalledPkgs && !package->isInstalled() ) 624 if ( showInstalledPkgs && !package->isInstalled() )
650 continue; 625 continue;
651 626
652 // Apply show only new installed packages filter 627 // Apply show only new installed packages filter
653 if ( showUpgradedPkgs ) 628 if ( showUpgradedPkgs )
654 { 629 {
655 if ( !package->isInstalled() || 630 if ( !package->isInstalled() ||
656 compareVersions( package->getInstalledVersion(), package->getVersion() ) != 1 ) 631 compareVersions( package->getInstalledVersion(), package->getVersion() ) != 1 )
657 continue; 632 continue;
658 } 633 }
659 634
660 // Apply the section filter 635 // Apply the section filter
661 if ( categoryFilterEnabled && categoryFilter != "" ) 636 if ( categoryFilterEnabled && categoryFilter != "" )
662 { 637 {
663 if ( package->getSection() == "" || categoryFilter.find( package->getSection().lower() ) == -1 ) 638 if ( package->getSection() == "" || categoryFilter.find( package->getSection().lower() ) == -1 )
664 continue; 639 continue;
665 } 640 }
666 641
667 // If the local server, only display installed packages 642 // If the local server, only display installed packages
668 if ( serverName == LOCAL_SERVER && !package->isInstalled() ) 643 if ( serverName == LOCAL_SERVER && !package->isInstalled() )
669 continue; 644 continue;
670 645
671 646
672 QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(), 647 QCheckListItem *item = new QCheckListItem( packagesList, package->getPackageName(),
673 QCheckListItem::CheckBox ); 648 QCheckListItem::CheckBox );
674 649
675 if ( package->isInstalled() ) 650 if ( package->isInstalled() )
676 { 651 {
677 // If a different version of package is available, show update available icon 652 // If a different version of package is available, show update available icon
678 // Otherwise, show installed icon 653 // Otherwise, show installed icon
679 if ( package->getVersion() != package->getInstalledVersion() && 654 if ( package->getVersion() != package->getInstalledVersion() &&
680 compareVersions( package->getInstalledVersion(), package->getVersion() ) == 1) 655 compareVersions( package->getInstalledVersion(), package->getVersion() ) == 1)
681 { 656 {
682 657
683 item->setPixmap( 0, updatedIcon ); 658 item->setPixmap( 0, updatedIcon );
684 } 659 }
685 else 660 else
686 { 661 {
687 item->setPixmap( 0, installedIcon ); 662 item->setPixmap( 0, installedIcon );
688 } 663 }
689 664
690 QString destName = ""; 665 QString destName = "";
691 if ( package->getLocalPackage() ) 666 if ( package->getLocalPackage() )
692 { 667 {
693 if ( package->getLocalPackage()->getInstalledTo() ) 668 if ( package->getLocalPackage()->getInstalledTo() )
694 destName = package->getLocalPackage()->getInstalledTo()->getDestinationName(); 669 destName = package->getLocalPackage()->getInstalledTo()->getDestinationName();
695 } 670 }
696 else 671 else
697 { 672 {
698 if ( package->getInstalledTo() ) 673 if ( package->getInstalledTo() )
699 destName = package->getInstalledTo()->getDestinationName(); 674 destName = package->getInstalledTo()->getDestinationName();
700 } 675 }
701 if ( destName != "" ) 676 if ( destName != "" )
702 new QCheckListItem( item, QString( tr( "Installed To - %1" ).arg( destName ) ) ); 677 new QCheckListItem( item, QString( tr( "Installed To - %1" ).arg( destName ) ) );
703 } 678 }
704 else 679 else
705 { 680 {
706 item->setPixmap( 0, nullIcon ); 681 item->setPixmap( 0, nullIcon );
707 } 682 }
708 683
709 if ( !package->isPackageStoredLocally() ) 684 if ( !package->isPackageStoredLocally() )
710 { 685 {
711 new QCheckListItem( item, QString( tr( "Description - %1" ).arg( package->getDescription() ) ) ); 686 new QCheckListItem( item, QString( tr( "Description - %1" ).arg( package->getDescription() ) ) );
712 new QCheckListItem( item, QString( tr( "Size - %1" ).arg( package->getPackageSize() ) ) ); 687 new QCheckListItem( item, QString( tr( "Size - %1" ).arg( package->getPackageSize() ) ) );
713 new QCheckListItem( item, QString( tr( "Section - %1" ).arg( package->getSection() ) ) ); 688 new QCheckListItem( item, QString( tr( "Section - %1" ).arg( package->getSection() ) ) );
714 } 689 }
715 else 690 else
716 new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( package->getFilename() ) ) ); 691 new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( package->getFilename() ) ) );
717 692
718 if ( serverName == LOCAL_SERVER ) 693 if ( serverName == LOCAL_SERVER )
719 { 694 {
720 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getVersion() ) ) ); 695 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getVersion() ) ) );
721 } 696 }
722 else 697 else
723 { 698 {
724 new QCheckListItem( item, QString( tr( "V. Available - %1" ).arg( package->getVersion() ) ) ); 699 new QCheckListItem( item, QString( tr( "V. Available - %1" ).arg( package->getVersion() ) ) );
725 if ( package->getLocalPackage() ) 700 if ( package->getLocalPackage() )
726 { 701 {
727 if ( package->isInstalled() ) 702 if ( package->isInstalled() )
728 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getInstalledVersion() ) ) ); 703 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( package->getInstalledVersion() ) ) );
729 } 704 }
730 } 705 }
731 706
732 packagesList->insertItem( item ); 707 packagesList->insertItem( item );
733 } 708 }
734 709
735 // If the local server or the local ipkgs server disable the download button 710 // If the local server or the local ipkgs server disable the download button
736 if ( serverName == LOCAL_SERVER ) 711 if ( serverName == LOCAL_SERVER )
737 { 712 {
738 downloadEnabled = TRUE; 713 downloadEnabled = TRUE;
739 actionUpgrade->setEnabled( FALSE ); 714 actionUpgrade->setEnabled( FALSE );
740 } 715 }
741 else if ( serverName == LOCAL_IPKGS ) 716 else if ( serverName == LOCAL_IPKGS )
742 { 717 {
743 downloadEnabled = FALSE; 718 downloadEnabled = FALSE;
744 actionUpgrade->setEnabled( FALSE ); 719 actionUpgrade->setEnabled( FALSE );
745 } 720 }
746 else 721 else
747 { 722 {
748 downloadEnabled = TRUE; 723 downloadEnabled = TRUE;
749 actionUpgrade->setEnabled( TRUE ); 724 actionUpgrade->setEnabled( TRUE );
750 } 725 }
751 enableDownload( downloadEnabled ); 726 enableDownload( downloadEnabled );
752 727
753 // Display this widget once everything is done 728 // Display this widget once everything is done
754 if ( doProgress && raiseProgress ) 729 if ( doProgress && raiseProgress )
755 { 730 {
756 stack->raiseWidget( networkPkgWindow ); 731 stack->raiseWidget( networkPkgWindow );
757 } 732 }
758} 733}
759 734
760void MainWindow :: searchForPackage( const QString &text ) 735void MainWindow :: searchForPackage( const QString &text )
761{ 736{
762 if ( !text.isEmpty() ) 737 if ( !text.isEmpty() )
763 { 738 {
764// cout << "searching for " << text << endl; 739// cout << "searching for " << text << endl;
765 // look through package list for text startng at current position 740 // look through package list for text startng at current position
766// vector<InstallData> workingPackages; 741// vector<InstallData> workingPackages;
767 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); 742 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
768// if ( start != 0 ) 743// if ( start != 0 )
769// start = (QCheckListItem *)start->nextSibling(); 744// start = (QCheckListItem *)start->nextSibling();
770 745
771 if ( start == 0 ) 746 if ( start == 0 )
772 start = (QCheckListItem *)packagesList->firstChild(); 747 start = (QCheckListItem *)packagesList->firstChild();
773 748
774 for ( QCheckListItem *item = start; item != 0 ; 749 for ( QCheckListItem *item = start; item != 0 ;
775 item = (QCheckListItem *)item->nextSibling() ) 750 item = (QCheckListItem *)item->nextSibling() )
776 { 751 {
777// cout << "checking " << item->text().lower() << endl; 752// cout << "checking " << item->text().lower() << endl;
778 if ( item->text().lower().find( text ) != -1 ) 753 if ( item->text().lower().find( text ) != -1 )
779 { 754 {
780// cout << "matched " << item->text() << endl; 755// cout << "matched " << item->text() << endl;
781 packagesList->ensureItemVisible( item ); 756 packagesList->ensureItemVisible( item );
782 packagesList->setCurrentItem( item ); 757 packagesList->setCurrentItem( item );
783 break; 758 break;
784 } 759 }
785 } 760 }
786 } 761 }
787} 762}
788 763
789void MainWindow :: updateServer() 764void MainWindow :: updateServer()
790{ 765{
791 QString serverName = serversList->currentText(); 766 QString serverName = serversList->currentText();
792 767
793 // Update the current server 768 // Update the current server
794 // Display dialog 769 // Display dialog
795 770
796 // Disable buttons to stop silly people clicking lots on them :) 771 // Disable buttons to stop silly people clicking lots on them :)
797 772
798 // First, write out ipkg_conf file so that ipkg can use it 773 // First, write out ipkg_conf file so that ipkg can use it
799 mgr->writeOutIpkgConf(); 774 mgr->writeOutIpkgConf();
800 775
801 Ipkg *ipkg = new Ipkg; 776 Ipkg *ipkg = new Ipkg;
802 ipkg->setOption( "update" ); 777 ipkg->setOption( "update" );
803 778
804 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), 779 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
805 tr( "Update lists" ) ); 780 tr( "Update lists" ) );
806 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 781 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
807 dlg->showMaximized(); 782 dlg->showMaximized();
808 783
809// delete progDlg; 784// delete progDlg;
810} 785}
811 786
812void MainWindow :: upgradePackages() 787void MainWindow :: upgradePackages()
813{ 788{
814 // We're gonna do an upgrade of all packages 789 // We're gonna do an upgrade of all packages
815 // First warn user that this isn't recommended 790 // First warn user that this isn't recommended
816 // TODO - ODevice???? 791 // TODO - ODevice????
817 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); 792 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" );
818 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning, 793 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning,
819 QMessageBox::Yes, 794 QMessageBox::Yes,
820 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , 795 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ,
821 0, this ); 796 0, this );
822 warn.adjustSize(); 797 warn.adjustSize();
823 798
824 if ( warn.exec() == QMessageBox::Yes ) 799 if ( warn.exec() == QMessageBox::Yes )
825 { 800 {
826 // First, write out ipkg_conf file so that ipkg can use it 801 // First, write out ipkg_conf file so that ipkg can use it
827 mgr->writeOutIpkgConf(); 802 mgr->writeOutIpkgConf();
828 803
829 // Now run upgrade 804 // Now run upgrade
830 Ipkg *ipkg = new Ipkg; 805 Ipkg *ipkg = new Ipkg;
831 ipkg->setOption( "upgrade" ); 806 ipkg->setOption( "upgrade" );
832 807
833 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ), 808 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Upgrading installed packages" ),
834 tr ( "Upgrade" ) ); 809 tr ( "Upgrade" ) );
835 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 810 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
836 dlg->showMaximized(); 811 dlg->showMaximized();
837 } 812 }
838} 813}
839 814
840void MainWindow :: downloadPackage() 815void MainWindow :: downloadPackage()
841{ 816{
842 bool doUpdate = true; 817 bool doUpdate = true;
843 if ( downloadEnabled ) 818 if ( downloadEnabled )
844 { 819 {
845 // See if any packages are selected 820 // See if any packages are selected
846 bool found = false; 821 bool found = false;
847 if ( serversList->currentText() != LOCAL_SERVER ) 822 if ( serversList->currentText() != LOCAL_SERVER )
848 { 823 {
849 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 824 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
850 item != 0 && !found; 825 item != 0 && !found;
851 item = (QCheckListItem *)item->nextSibling() ) 826 item = (QCheckListItem *)item->nextSibling() )
852 { 827 {
853 if ( item->isOn() ) 828 if ( item->isOn() )
854 found = true; 829 found = true;
855 } 830 }
856 } 831 }
857 832
858 // If user selected some packages then download the and store the locally 833 // If user selected some packages then download the and store the locally
859 // otherwise, display dialog asking user what package to download from an http server 834 // otherwise, display dialog asking user what package to download from an http server
860 // and whether to install it 835 // and whether to install it
861 if ( found ) 836 if ( found )
862 downloadSelectedPackages(); 837 downloadSelectedPackages();
863 else 838 else
864 downloadRemotePackage(); 839 downloadRemotePackage();
865 840
866 } 841 }
867 else 842 else
868 { 843 {
869 doUpdate = false; 844 doUpdate = false;
870 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 845 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
871 item != 0 ; 846 item != 0 ;
872 item = (QCheckListItem *)item->nextSibling() ) 847 item = (QCheckListItem *)item->nextSibling() )
873 { 848 {
874 if ( item->isOn() ) 849 if ( item->isOn() )
875 { 850 {
876 QString name = item->text(); 851 QString name = item->text();
877 int pos = name.find( "*" ); 852 int pos = name.find( "*" );
878 name.truncate( pos ); 853 name.truncate( pos );
879 854
880 // if (there is a (installed), remove it 855 // if (there is a (installed), remove it
881 pos = name.find( "(installed)" ); 856 pos = name.find( "(installed)" );
882 if ( pos > 0 ) 857 if ( pos > 0 )
883 name.truncate( pos - 1 ); 858 name.truncate( pos - 1 );
884 859
885 Package *p = mgr->getServer( serversList->currentText() )->getPackage( name ); 860 Package *p = mgr->getServer( serversList->currentText() )->getPackage( name );
886 861
887 QString msgtext; 862 QString msgtext;
888 msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() ); 863 msgtext = tr( "Are you sure you wish to delete\n%1?" ).arg( (const char *)p->getPackageName() );
889 if ( QMessageBox::information( this, tr( "Are you sure?" ), 864 if ( QMessageBox::information( this, tr( "Are you sure?" ),
890 msgtext, tr( "No" ), tr( "Yes" ) ) == 1 ) 865 msgtext, tr( "No" ), tr( "Yes" ) ) == 1 )
891 { 866 {
892 doUpdate = true; 867 doUpdate = true;
893 QFile f( p->getFilename() ); 868 QFile f( p->getFilename() );
894 f.remove(); 869 f.remove();
895 } 870 }
896 } 871 }
897 } 872 }
898 } 873 }
899 874
900 if ( doUpdate ) 875 if ( doUpdate )
901 { 876 {
902 reloadData( 0x0 ); 877 reloadData( 0x0 );
903 } 878 }
904} 879}
905 880
906void MainWindow :: downloadSelectedPackages() 881void MainWindow :: downloadSelectedPackages()
907{ 882{
908 // First, write out ipkg_conf file so that ipkg can use it 883 // First, write out ipkg_conf file so that ipkg can use it
909 mgr->writeOutIpkgConf(); 884 mgr->writeOutIpkgConf();
910 885
911 // Display dialog to user asking where to download the files to 886 // Display dialog to user asking where to download the files to
912 bool ok = FALSE; 887 bool ok = FALSE;
913 QString dir = ""; 888 QString dir = "";
914#ifdef QWS 889#ifdef QWS
915 // read download directory from config file 890 // read download directory from config file
916 Config cfg( "aqpkg" ); 891 Config cfg( "aqpkg" );
917 cfg.setGroup( "settings" ); 892 cfg.setGroup( "settings" );
918 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" ); 893 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" );
919#endif 894#endif
920 895
921 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this ); 896 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this );
922 if ( ok && !text.isEmpty() ) 897 if ( ok && !text.isEmpty() )
923 dir = text; // user entered something and pressed ok 898 dir = text; // user entered something and pressed ok
924 else 899 else
925 return; // user entered nothing or pressed cancel 900 return; // user entered nothing or pressed cancel
926 901
927#ifdef QWS 902#ifdef QWS
928 // Store download directory in config file 903 // Store download directory in config file
929 cfg.writeEntry( "downloadDir", dir ); 904 cfg.writeEntry( "downloadDir", dir );
930#endif 905#endif
931 906
932 // Get starting directory 907 // Get starting directory
933 char initDir[PATH_MAX]; 908 char initDir[PATH_MAX];
934 getcwd( initDir, PATH_MAX ); 909 getcwd( initDir, PATH_MAX );
935 910
936 // Download each package 911 // Download each package
937 Ipkg ipkg; 912 Ipkg ipkg;
938 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 913 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
939 914
940 ipkg.setOption( "download" ); 915 ipkg.setOption( "download" );
941 ipkg.setRuntimeDirectory( dir ); 916 ipkg.setRuntimeDirectory( dir );
942 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 917 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
943 item != 0 ; 918 item != 0 ;
944 item = (QCheckListItem *)item->nextSibling() ) 919 item = (QCheckListItem *)item->nextSibling() )
945 { 920 {
946 if ( item->isOn() ) 921 if ( item->isOn() )
947 { 922 {
948 ipkg.setPackage( item->text() ); 923 ipkg.setPackage( item->text() );
949 ipkg.runIpkg( ); 924 ipkg.runIpkg( );
950 } 925 }
951 } 926 }
952} 927}
953 928
954void MainWindow :: downloadRemotePackage() 929void MainWindow :: downloadRemotePackage()
955{ 930{
956 // Display dialog 931 // Display dialog
957 bool ok; 932 bool ok;
958 QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this ); 933 QString package = InputDialog::getText( tr( "Install Remote Package" ), tr( "Enter package location" ), "http://", &ok, this );
959 if ( !ok || package.isEmpty() ) 934 if ( !ok || package.isEmpty() )
960 return; 935 return;
961// DownloadRemoteDlgImpl dlg( this, "Install", true ); 936// DownloadRemoteDlgImpl dlg( this, "Install", true );
962// if ( dlg.exec() == QDialog::Rejected ) 937// if ( dlg.exec() == QDialog::Rejected )
963// return; 938// return;
964 939
965 // grab details from dialog 940 // grab details from dialog
966// QString package = dlg.getPackageLocation(); 941// QString package = dlg.getPackageLocation();
967 942
968 InstallData *item = new InstallData(); 943 InstallData *item = new InstallData();
969 item->option = "I"; 944 item->option = "I";
970 item->packageName = package; 945 item->packageName = package;
971 QList<InstallData> workingPackages; 946 QList<InstallData> workingPackages;
972 workingPackages.setAutoDelete( TRUE ); 947 workingPackages.setAutoDelete( TRUE );
973 workingPackages.append( item ); 948 workingPackages.append( item );
974 949
975 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) ); 950 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Download" ) );
976 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 951 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
977 dlg->showMaximized(); 952 dlg->showMaximized();
978} 953}
979 954
980 955
981void MainWindow :: applyChanges() 956void MainWindow :: applyChanges()
982{ 957{
983 stickyOption = ""; 958 stickyOption = "";
984 959
985 // First, write out ipkg_conf file so that ipkg can use it 960 // First, write out ipkg_conf file so that ipkg can use it
986 mgr->writeOutIpkgConf(); 961 mgr->writeOutIpkgConf();
987 962
988 // Now for each selected item 963 // Now for each selected item
989 // deal with it 964 // deal with it
990 965
991 QList<InstallData> workingPackages; 966 QList<InstallData> workingPackages;
992 workingPackages.setAutoDelete( TRUE ); 967 workingPackages.setAutoDelete( TRUE );
993 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 968 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
994 item != 0 ; 969 item != 0 ;
995 item = (QCheckListItem *)item->nextSibling() ) 970 item = (QCheckListItem *)item->nextSibling() )
996 { 971 {
997 if ( item->isOn() ) 972 if ( item->isOn() )
998 { 973 {
999 workingPackages.append( dealWithItem( item ) ); 974 workingPackages.append( dealWithItem( item ) );
1000 } 975 }
1001 } 976 }
1002 977
1003 if ( workingPackages.count() == 0 ) 978 if ( workingPackages.count() == 0 )
1004 { 979 {
1005 // Nothing to do 980 // Nothing to do
1006 QMessageBox::information( this, tr( "Nothing to do" ), 981 QMessageBox::information( this, tr( "Nothing to do" ),
1007 tr( "No packages selected" ), tr( "OK" ) ); 982 tr( "No packages selected" ), tr( "OK" ) );
1008 983
1009 return; 984 return;
1010 } 985 }
1011 986
1012 // do the stuff 987 // do the stuff
1013 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) ); 988 InstallDlgImpl *dlg = new InstallDlgImpl( workingPackages, mgr, tr( "Apply changes" ) );
1014 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) ); 989 connect( dlg, SIGNAL( reloadData( InstallDlgImpl * ) ), this, SLOT( reloadData( InstallDlgImpl * ) ) );
1015 dlg->showMaximized(); 990 dlg->showMaximized();
1016} 991}
1017 992
1018// decide what to do - either remove, upgrade or install 993// decide what to do - either remove, upgrade or install
1019// Current rules: 994// Current rules:
1020// If not installed - install 995// If not installed - install
1021// If installed and different version available - upgrade 996// If installed and different version available - upgrade
1022// If installed and version up to date - remove 997// If installed and version up to date - remove
1023InstallData *MainWindow :: dealWithItem( QCheckListItem *item ) 998InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1024{ 999{
1025 QString name = item->text(); 1000 QString name = item->text();
1026 1001
1027 // Get package 1002 // Get package
1028 Server *s = mgr->getServer( serversList->currentText() ); 1003 Server *s = mgr->getServer( serversList->currentText() );
1029 Package *p = s->getPackage( name ); 1004 Package *p = s->getPackage( name );
1030 1005
1031 // If the package has a filename then it is a local file 1006 // If the package has a filename then it is a local file
1032 if ( p->isPackageStoredLocally() ) 1007 if ( p->isPackageStoredLocally() )
1033 name = p->getFilename(); 1008 name = p->getFilename();
1034 1009
1035 QString option; 1010 QString option;
1036 QString dest = "root"; 1011 QString dest = "root";
1037 if ( !p->isInstalled() ) 1012 if ( !p->isInstalled() )
1038 { 1013 {
1039 InstallData *newitem = new InstallData();; 1014 InstallData *newitem = new InstallData();;
1040 newitem->option = "I"; 1015 newitem->option = "I";
1041 newitem->packageName = name; 1016 newitem->packageName = name;
1042 return newitem; 1017 return newitem;
1043 } 1018 }
1044 else 1019 else
1045 { 1020 {
1046 InstallData *newitem = new InstallData();; 1021 InstallData *newitem = new InstallData();;
1047 newitem->option = "D"; 1022 newitem->option = "D";
1048 if ( !p->isPackageStoredLocally() ) 1023 if ( !p->isPackageStoredLocally() )
1049 newitem->packageName = p->getInstalledPackageName(); 1024 newitem->packageName = p->getInstalledPackageName();
1050 else 1025 else
1051 newitem->packageName = name; 1026 newitem->packageName = name;
1052 1027
1053 if ( p->getInstalledTo() ) 1028 if ( p->getInstalledTo() )
1054 { 1029 {
1055 newitem->destination = p->getInstalledTo(); 1030 newitem->destination = p->getInstalledTo();
1056// cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; 1031// cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl;
1057// cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; 1032// cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl;
1058 } 1033 }
1059 else 1034 else
1060 { 1035 {
1061 newitem->destination = p->getLocalPackage()->getInstalledTo(); 1036 newitem->destination = p->getLocalPackage()->getInstalledTo();
1062 } 1037 }
1063 1038
1064 // Now see if version is newer or not 1039 // Now see if version is newer or not
1065 int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); 1040 int val = compareVersions( p->getInstalledVersion(), p->getVersion() );
1066 1041
1067 // If the version requested is older and user selected a local ipk file, then reinstall the file 1042 // If the version requested is older and user selected a local ipk file, then reinstall the file
1068 if ( p->isPackageStoredLocally() && val == -1 ) 1043 if ( p->isPackageStoredLocally() && val == -1 )
1069 val = 0; 1044 val = 0;
1070 1045
1071 if ( val == -2 ) 1046 if ( val == -2 )
1072 { 1047 {
1073 // Error - should handle 1048 // Error - should handle
1074 } 1049 }
1075 else if ( val == -1 ) 1050 else if ( val == -1 )
1076 { 1051 {
1077 // Version available is older - remove only 1052 // Version available is older - remove only
1078 newitem->option = "D"; 1053 newitem->option = "D";
1079 } 1054 }
1080 else 1055 else
1081 { 1056 {
1082 QString caption; 1057 QString caption;
1083 QString text; 1058 QString text;
1084 QString secondButton; 1059 QString secondButton;
1085 QString secondOption; 1060 QString secondOption;
1086 if ( val == 0 ) 1061 if ( val == 0 )
1087 { 1062 {
1088 // Version available is the same - option to remove or reinstall 1063 // Version available is the same - option to remove or reinstall
1089 caption = tr( "Do you wish to remove or reinstall\n%1?" ); 1064 caption = tr( "Do you wish to remove or reinstall\n%1?" );
1090 text = tr( "Remove or ReInstall" ); 1065 text = tr( "Remove or ReInstall" );
1091 secondButton = tr( "ReInstall" ); 1066 secondButton = tr( "ReInstall" );
1092 secondOption = tr( "R" ); 1067 secondOption = tr( "R" );
1093 } 1068 }
1094 else if ( val == 1 ) 1069 else if ( val == 1 )
1095 { 1070 {
1096 // Version available is newer - option to remove or upgrade 1071 // Version available is newer - option to remove or upgrade
1097 caption = tr( "Do you wish to remove or upgrade\n%1?" ); 1072 caption = tr( "Do you wish to remove or upgrade\n%1?" );
1098 text = tr( "Remove or Upgrade" ); 1073 text = tr( "Remove or Upgrade" );
1099 secondButton = tr( "Upgrade" ); 1074 secondButton = tr( "Upgrade" );
1100 secondOption = tr( "U" ); 1075 secondOption = tr( "U" );
1101 } 1076 }
1102 1077
1103 // Sticky option not implemented yet, but will eventually allow 1078 // Sticky option not implemented yet, but will eventually allow
1104 // the user to say something like 'remove all' 1079 // the user to say something like 'remove all'
1105 if ( stickyOption == "" ) 1080 if ( stickyOption == "" )
1106 { 1081 {
1107 QString msgtext; 1082 QString msgtext;
1108 msgtext = caption.arg( ( const char * )name ); 1083 msgtext = caption.arg( ( const char * )name );
1109 switch( QMessageBox::information( this, text, 1084 switch( QMessageBox::information( this, text,
1110 msgtext, tr( "Remove" ), secondButton ) ) 1085 msgtext, tr( "Remove" ), secondButton ) )
1111 { 1086 {
1112 case 0: // Try again or Enter 1087 case 0: // Try again or Enter
1113 // option 0 = Remove 1088 // option 0 = Remove
1114 newitem->option = "D"; 1089 newitem->option = "D";
1115 break; 1090 break;
1116 case 1: // Quit or Escape 1091 case 1: // Quit or Escape
1117 newitem->option = secondOption; 1092 newitem->option = secondOption;
1118 break; 1093 break;
1119 } 1094 }
1120 } 1095 }
1121 else 1096 else
1122 { 1097 {
1123// newitem->option = stickyOption; 1098// newitem->option = stickyOption;
1124 } 1099 }
1125 } 1100 }
1126 1101
1127 1102
1128 // Check if we are reinstalling the same version 1103 // Check if we are reinstalling the same version
1129 if ( newitem->option != "R" ) 1104 if ( newitem->option != "R" )
1130 newitem->recreateLinks = true; 1105 newitem->recreateLinks = true;
1131 else 1106 else
1132 newitem->recreateLinks = false; 1107 newitem->recreateLinks = false;
1133 1108
1134 // User hit cancel (on dlg - assume remove) 1109 // User hit cancel (on dlg - assume remove)
1135 return newitem; 1110 return newitem;
1136 } 1111 }
1137} 1112}
1138 1113
1139void MainWindow :: reloadData( InstallDlgImpl *dlg ) 1114void MainWindow :: reloadData( InstallDlgImpl *dlg )
1140{ 1115{
1141 stack->raiseWidget( progressWindow ); 1116 stack->raiseWidget( progressWindow );
1142 1117
1143 if ( dlg ) 1118 if ( dlg )
1144 { 1119 {
1145 dlg->close(); 1120 dlg->close();
1146 delete dlg; 1121 delete dlg;
1147 } 1122 }
1148 1123
1149 mgr->reloadServerData(); 1124 mgr->reloadServerData();
1150 serverSelected( -1, FALSE ); 1125 serverSelected( -1, FALSE );
1151 1126
1152#ifdef QWS 1127#ifdef QWS
1153 m_status->setText( tr( "Updating Launcher..." ) ); 1128 m_status->setText( tr( "Updating Launcher..." ) );
1154 1129
1155 // Finally let the main system update itself 1130 // Finally let the main system update itself
1156 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 1131 QCopEnvelope e("QPE/System", "linkChanged(QString)");
1157 QString lf = QString::null; 1132 QString lf = QString::null;
1158 e << lf; 1133 e << lf;
1159#endif 1134#endif
1160 1135
1161 stack->raiseWidget( networkPkgWindow ); 1136 stack->raiseWidget( networkPkgWindow );
1162} 1137}
1163 1138
1164void MainWindow :: letterPushed( QString t ) 1139void MainWindow :: letterPushed( QString t )
1165{ 1140{
1166 QCheckListItem *top = (QCheckListItem *)packagesList->firstChild(); 1141 QCheckListItem *top = (QCheckListItem *)packagesList->firstChild();
1167 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); 1142 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
1168 if ( packagesList->firstChild() == 0 ) 1143 if ( packagesList->firstChild() == 0 )
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index db06e16..d75e5d2 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -1,138 +1,136 @@
1/*************************************************************************** 1/***************************************************************************
2 mainwin.h - description 2 mainwin.h - description
3 ------------------- 3 -------------------
4 begin : Mon Aug 26 13:32:30 BST 2002 4 begin : Mon Aug 26 13:32:30 BST 2002
5 copyright : (C) 2002 by Andy Qua 5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk 6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#ifndef MAINWIN_H 18#ifndef MAINWIN_H
19#define MAINWIN_H 19#define MAINWIN_H
20 20
21#include <qmainwindow.h> 21#include <qmainwindow.h>
22#include <qpixmap.h> 22#include <qpixmap.h>
23 23
24class DataManager; 24class DataManager;
25class InstallData; 25class InstallData;
26class InstallDlgImpl; 26class InstallDlgImpl;
27 27
28class QAction; 28class QAction;
29class QCheckListItem; 29class QCheckListItem;
30class QComboBox; 30class QComboBox;
31class QLabel; 31class QLabel;
32class QLineEdit; 32class QLineEdit;
33class QListView; 33class QListView;
34class QPEToolBar; 34class QPEToolBar;
35class QProgressBar; 35class QProgressBar;
36class QWidgetStack; 36class QWidgetStack;
37 37
38class MainWindow :public QMainWindow 38class MainWindow :public QMainWindow
39{ 39{
40 Q_OBJECT 40 Q_OBJECT
41public: 41public:
42 42
43 MainWindow(); 43 MainWindow();
44 ~MainWindow(); 44 ~MainWindow();
45 45
46private: 46private:
47 DataManager *mgr; 47 DataManager *mgr;
48 48
49 QWidgetStack *stack; 49 QWidgetStack *stack;
50 50
51 QPEToolBar *findBar; 51 QPEToolBar *findBar;
52 QPEToolBar *jumpBar; 52 QPEToolBar *jumpBar;
53 QLineEdit *findEdit; 53 QLineEdit *findEdit;
54 QAction *actionFindNext; 54 QAction *actionFindNext;
55 QAction *actionFilter; 55 QAction *actionFilter;
56 QAction *actionUpgrade; 56 QAction *actionUpgrade;
57 QAction *actionDownload; 57 QAction *actionDownload;
58 QAction *actionUninstalled; 58 QAction *actionUninstalled;
59 QAction *actionInstalled; 59 QAction *actionInstalled;
60 QAction *actionUpdated; 60 QAction *actionUpdated;
61 61
62 QPixmap iconDownload; 62 QPixmap iconDownload;
63 QPixmap iconRemove; 63 QPixmap iconRemove;
64 64
65 int mnuShowUninstalledPkgsId; 65 int mnuShowUninstalledPkgsId;
66 int mnuShowInstalledPkgsId; 66 int mnuShowInstalledPkgsId;
67 int mnuShowUpgradedPkgsId; 67 int mnuShowUpgradedPkgsId;
68 int mnuFilterByCategory; 68 int mnuFilterByCategory;
69 int mnuSetFilterCategory; 69 int mnuSetFilterCategory;
70 70
71 // Main package list widget 71 // Main package list widget
72 QWidget *networkPkgWindow; 72 QWidget *networkPkgWindow;
73 QComboBox *serversList; 73 QComboBox *serversList;
74 QListView *packagesList; 74 QListView *packagesList;
75 QPixmap installedIcon; 75 QPixmap installedIcon;
76 QPixmap updatedIcon; 76 QPixmap updatedIcon;
77 QString currentlySelectedServer; 77 QString currentlySelectedServer;
78 QString categoryFilter; 78 QString categoryFilter;
79 QString stickyOption; 79 QString stickyOption;
80 80
81 bool categoryFilterEnabled; 81 bool categoryFilterEnabled;
82 bool showJumpTo; 82 bool showJumpTo;
83 bool showUninstalledPkgs; 83 bool showUninstalledPkgs;
84 bool showInstalledPkgs; 84 bool showInstalledPkgs;
85 bool showUpgradedPkgs; 85 bool showUpgradedPkgs;
86 bool downloadEnabled; 86 bool downloadEnabled;
87 87
88 void initMainWidget(); 88 void initMainWidget();
89 void updateData(); 89 void updateData();
90 void serverSelected( int index, bool showProgress ); 90 void serverSelected( int index, bool showProgress );
91 void searchForPackage( const QString & ); 91 void searchForPackage( const QString & );
92 bool filterByCategory( bool val ); 92 bool filterByCategory( bool val );
93 void downloadSelectedPackages(); 93 void downloadSelectedPackages();
94 void downloadRemotePackage(); 94 void downloadRemotePackage();
95 InstallData *dealWithItem( QCheckListItem *item ); 95 InstallData *dealWithItem( QCheckListItem *item );
96 96
97 // Progress widget 97 // Progress widget
98 QWidget *progressWindow; 98 QWidget *progressWindow;
99 QLabel *m_status; 99 QLabel *m_status;
100 QProgressBar *m_progress; 100 QProgressBar *m_progress;
101 101
102 void initProgressWidget(); 102 void initProgressWidget();
103 103
104public slots: 104public slots:
105// void setDocument( const QString &doc ); 105// void setDocument( const QString &doc );
106 void displayHelp();
107 void displayFindBar(); 106 void displayFindBar();
108 void displayJumpBar(); 107 void displayJumpBar();
109 void repeatFind(); 108 void repeatFind();
110 void findPackage( const QString & ); 109 void findPackage( const QString & );
111 void hideFindBar(); 110 void hideFindBar();
112 void hideJumpBar(); 111 void hideJumpBar();
113 void displayAbout();
114 void displaySettings(); 112 void displaySettings();
115 void filterUninstalledPackages(); 113 void filterUninstalledPackages();
116 void filterInstalledPackages(); 114 void filterInstalledPackages();
117 void filterUpgradedPackages(); 115 void filterUpgradedPackages();
118 void filterCategory(); 116 void filterCategory();
119 bool setFilterCategory(); 117 bool setFilterCategory();
120 void raiseMainWidget(); 118 void raiseMainWidget();
121 void raiseProgressWidget(); 119 void raiseProgressWidget();
122 void enableUpgrade( bool ); 120 void enableUpgrade( bool );
123 void enableDownload( bool ); 121 void enableDownload( bool );
124 void reloadData( InstallDlgImpl * ); 122 void reloadData( InstallDlgImpl * );
125 123
126private slots: 124private slots:
127 void init(); 125 void init();
128 void setProgressSteps( int ); 126 void setProgressSteps( int );
129 void setProgressMessage( const QString & ); 127 void setProgressMessage( const QString & );
130 void updateProgress( int ); 128 void updateProgress( int );
131 void serverSelected( int index ); 129 void serverSelected( int index );
132 void updateServer(); 130 void updateServer();
133 void upgradePackages(); 131 void upgradePackages();
134 void downloadPackage(); 132 void downloadPackage();
135 void applyChanges(); 133 void applyChanges();
136 void letterPushed( QString t ); 134 void letterPushed( QString t );
137}; 135};
138#endif 136#endif