summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp45
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.h44
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp139
-rw-r--r--noncore/settings/aqpkg/datamgr.h44
-rw-r--r--noncore/settings/aqpkg/destination.cpp42
-rw-r--r--noncore/settings/aqpkg/destination.h45
-rw-r--r--noncore/settings/aqpkg/global.h44
-rw-r--r--noncore/settings/aqpkg/inputdlg.cpp45
-rw-r--r--noncore/settings/aqpkg/inputdlg.h44
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp46
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.h43
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp44
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.h43
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp44
-rw-r--r--noncore/settings/aqpkg/ipkg.h42
-rw-r--r--noncore/settings/aqpkg/letterpushbutton.cpp42
-rw-r--r--noncore/settings/aqpkg/letterpushbutton.h44
-rw-r--r--noncore/settings/aqpkg/main.cpp47
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp55
-rw-r--r--noncore/settings/aqpkg/mainwin.h42
-rw-r--r--noncore/settings/aqpkg/mem.cpp216
-rw-r--r--noncore/settings/aqpkg/package.cpp44
-rw-r--r--noncore/settings/aqpkg/package.h42
-rw-r--r--noncore/settings/aqpkg/packagewin.cpp7
-rw-r--r--noncore/settings/aqpkg/packagewin.h5
-rw-r--r--noncore/settings/aqpkg/server.cpp52
-rw-r--r--noncore/settings/aqpkg/server.h43
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp44
-rw-r--r--noncore/settings/aqpkg/settingsimpl.h42
-rw-r--r--noncore/settings/aqpkg/utils.cpp47
-rw-r--r--noncore/settings/aqpkg/utils.h42
31 files changed, 951 insertions, 617 deletions
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp
index e8ce7e7..61e1f93 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.cpp
+++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 categoryfilterimpl.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sun Nov 17 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
17#include <iostream> 30#include <iostream>
18using namespace std; 31using namespace std;
19 32
20#include <qgroupbox.h> 33#include <qgroupbox.h>
21#include <qlayout.h> 34#include <qlayout.h>
22#include <qlistbox.h> 35#include <qlistbox.h>
23#include <qstring.h> 36#include <qstring.h>
24 37
25#include "categoryfilterimpl.h" 38#include "categoryfilterimpl.h"
26 39
27CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) 40CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name )
28 : QDialog( parent, name, true ) 41 : QDialog( parent, name, true )
29{ 42{
30 setCaption( tr( "Category Filter" ) ); 43 setCaption( tr( "Category Filter" ) );
31 44
32 QVBoxLayout *layout = new QVBoxLayout( this ); 45 QVBoxLayout *layout = new QVBoxLayout( this );
33 layout->setMargin( 2 ); 46 layout->setMargin( 2 );
34 layout->setSpacing( 4 ); 47 layout->setSpacing( 4 );
35 48
36 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this ); 49 QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Select one or more groups" ), this );
37 grpbox->layout()->setSpacing( 2 ); 50 grpbox->layout()->setSpacing( 2 );
38 grpbox->layout()->setMargin( 4 ); 51 grpbox->layout()->setMargin( 4 );
39 layout->addWidget( grpbox ); 52 layout->addWidget( grpbox );
40 53
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.h b/noncore/settings/aqpkg/categoryfilterimpl.h
index a85fce4..78d39db 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.h
+++ b/noncore/settings/aqpkg/categoryfilterimpl.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 categoryfilterimpl.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sun Nov 17 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef CATEGORYFILTERIMPL_H 30#ifndef CATEGORYFILTERIMPL_H
19#define CATEGORYFILTERIMPL_H 31#define CATEGORYFILTERIMPL_H
20 32
21#include <qdialog.h> 33#include <qdialog.h>
22 34
23class QListBox; 35class QListBox;
24 36
25/** 37/**
26 *@author Andy Qua 38 *@author Andy Qua
27 */ 39 */
28 40
29class CategoryFilterImpl : public QDialog 41class CategoryFilterImpl : public QDialog
30{ 42{
31 Q_OBJECT 43 Q_OBJECT
32public: 44public:
33 CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent=0, const char *name=0); 45 CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent=0, const char *name=0);
34 ~CategoryFilterImpl(); 46 ~CategoryFilterImpl();
35 47
36 QString getSelectedFilter(); 48 QString getSelectedFilter();
37 49
38private: 50private:
39 QListBox *lstCategories; 51 QListBox *lstCategories;
40 52
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index 79f36e1..cd0c78f 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -1,52 +1,62 @@
1/*************************************************************************** 1/*
2 datamgr.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Thu Aug 29 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17#include <fstream> 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18#include <iostream> 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19using namespace std; 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
20 29
21#ifdef QWS 30#ifdef QWS
22#include <qpe/config.h> 31#include <qpe/config.h>
23#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
24#else 33#else
25#include <qapplication.h> 34#include <qapplication.h>
26#endif 35#endif
27 36
28#include <stdio.h> 37#include <qfile.h>
38#include <qtextstream.h>
29 39
30#include "datamgr.h" 40#include "datamgr.h"
31#include "global.h" 41#include "global.h"
32 42
33 43
34QString DataManager::availableCategories = ""; 44QString DataManager::availableCategories = "";
35DataManager::DataManager() 45DataManager::DataManager()
36 : QObject( 0x0, 0x0 ) 46 : QObject( 0x0, 0x0 )
37{ 47{
38 activeServer = ""; 48 activeServer = "";
39 availableCategories = "#"; 49 availableCategories = "#";
40 50
41 serverList.setAutoDelete( TRUE ); 51 serverList.setAutoDelete( TRUE );
42 destList.setAutoDelete( TRUE ); 52 destList.setAutoDelete( TRUE );
43} 53}
44 54
45DataManager::~DataManager() 55DataManager::~DataManager()
46{ 56{
47} 57}
48 58
49Server *DataManager :: getServer( const char *name ) 59Server *DataManager :: getServer( const char *name )
50{ 60{
51 QListIterator<Server> it( serverList ); 61 QListIterator<Server> it( serverList );
52 while ( it.current() && it.current()->getServerName() != name ) 62 while ( it.current() && it.current()->getServerName() != name )
@@ -67,49 +77,48 @@ Destination *DataManager :: getDestination( const char *name )
67 77
68 return it.current(); 78 return it.current();
69} 79}
70 80
71void DataManager :: loadServers() 81void DataManager :: loadServers()
72{ 82{
73 // First add our local server - not really a server but 83 // First add our local server - not really a server but
74 // the local config (which packages are installed) 84 // the local config (which packages are installed)
75 serverList.append( new Server( LOCAL_SERVER, "" ) ); 85 serverList.append( new Server( LOCAL_SERVER, "" ) );
76 serverList.append( new Server( LOCAL_IPKGS, "" ) ); 86 serverList.append( new Server( LOCAL_IPKGS, "" ) );
77 87
78#ifdef QWS 88#ifdef QWS
79 Config cfg( "aqpkg" ); 89 Config cfg( "aqpkg" );
80 cfg.setGroup( "destinations" ); 90 cfg.setGroup( "destinations" );
81#endif 91#endif
82 92
83 // Read file from /etc/ipkg.conf 93 // Read file from /etc/ipkg.conf
84 QString ipkg_conf = IPKG_CONF; 94 QString ipkg_conf = IPKG_CONF;
85 FILE *fp; 95 FILE *fp;
86 fp = fopen( ipkg_conf, "r" ); 96 fp = fopen( ipkg_conf, "r" );
87 char line[130]; 97 char line[130];
88 QString lineStr; 98 QString lineStr;
89 if ( fp == NULL ) 99 if ( fp == NULL )
90 { 100 {
91 cout << "Couldn't open " << ipkg_conf << "! err = " << fp << endl;
92 return; 101 return;
93 } 102 }
94 else 103 else
95 { 104 {
96 while ( fgets( line, sizeof line, fp) != NULL ) 105 while ( fgets( line, sizeof line, fp) != NULL )
97 { 106 {
98 lineStr = line; 107 lineStr = line;
99 if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) 108 if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) )
100 { 109 {
101 char alias[20]; 110 char alias[20];
102 char url[100]; 111 char url[100];
103 112
104 // Looks a little wierd but read up to the r of src (throwing it away), 113 // Looks a little wierd but read up to the r of src (throwing it away),
105 // then read up to the next space and throw that away, the alias 114 // then read up to the next space and throw that away, the alias
106 // is next. 115 // is next.
107 // Should Handle #src, # src, src, and combinations of 116 // Should Handle #src, # src, src, and combinations of
108 sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url ); 117 sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url );
109 Server *s = new Server( alias, url ); 118 Server *s = new Server( alias, url );
110 if ( lineStr.startsWith( "src" ) ) 119 if ( lineStr.startsWith( "src" ) )
111 s->setActive( true ); 120 s->setActive( true );
112 else 121 else
113 s->setActive( false ); 122 s->setActive( false );
114 123
115 serverList.append( s ); 124 serverList.append( s );
@@ -177,115 +186,127 @@ void DataManager :: reloadServerData( )
177 for ( ; it.current(); ++it ) 186 for ( ; it.current(); ++it )
178 { 187 {
179 server = it.current(); 188 server = it.current();
180 serverName = server->getServerName(); 189 serverName = server->getServerName();
181 i++; 190 i++;
182 emit progressUpdate( i ); 191 emit progressUpdate( i );
183 qApp->processEvents(); 192 qApp->processEvents();
184 193
185 // Now we've read the config file in we need to read the servers 194 // Now we've read the config file in we need to read the servers
186 // The local server is a special case. This holds the contents of the 195 // The local server is a special case. This holds the contents of the
187 // status files the number of which depends on how many destinations 196 // status files the number of which depends on how many destinations
188 // we've set up 197 // we've set up
189 // The other servers files hold the contents of the server package list 198 // The other servers files hold the contents of the server package list
190 if ( serverName == LOCAL_SERVER ) 199 if ( serverName == LOCAL_SERVER )
191 server->readStatusFile( destList ); 200 server->readStatusFile( destList );
192 else if ( serverName == LOCAL_IPKGS ) 201 else if ( serverName == LOCAL_IPKGS )
193 server->readLocalIpks( getServer( LOCAL_SERVER ) ); 202 server->readLocalIpks( getServer( LOCAL_SERVER ) );
194 else 203 else
195 server->readPackageFile( getServer( LOCAL_SERVER ) ); 204 server->readPackageFile( getServer( LOCAL_SERVER ) );
196 } 205 }
197} 206}
198 207
199void DataManager :: writeOutIpkgConf() 208void DataManager :: writeOutIpkgConf()
200{ 209{
210 QFile f( IPKG_CONF );
211 if ( !f.open( IO_WriteOnly ) )
212 {
213 return;
214 }
215
216 QTextStream t( &f );
217/*
201 QString ipkg_conf = IPKG_CONF; 218 QString ipkg_conf = IPKG_CONF;
202 ofstream out( ipkg_conf ); 219 ofstream out( ipkg_conf );
220*/
221 t << "# Written by AQPkg\n";
222 t << "# Must have one or more source entries of the form:\n";
223 t << "#\n";
224 t << "# src <src-name> <source-url>\n";
225 t << "#\n";
226 t << "# and one or more destination entries of the form:\n";
227 t << "#\n";
228 t << "# dest <dest-name> <target-path>\n";
229 t << "#\n";
230 t << "# where <src-name> and <dest-names> are identifiers that\n";
231 t << "# should match [a-zA-Z0-9._-]+, <source-url> should be a\n";
232 t << "# URL that points to a directory containing a Familiar\n";
233 t << "# Packages file, and <target-path> should be a directory\n";
234 t << "# that exists on the target system.\n\n";
203 235
204 out << "# Written by AQPkg" << endl;
205 out << "# Must have one or more source entries of the form:" << endl;
206 out << "#" << endl;
207 out << "# src <src-name> <source-url>" << endl;
208 out << "#" << endl;
209 out << "# and one or more destination entries of the form:" << endl;
210 out << "#" << endl;
211 out << "# dest <dest-name> <target-path>" << endl;
212 out << "#" << endl;
213 out << "# where <src-name> and <dest-names> are identifiers that" << endl;
214 out << "# should match [a-zA-Z0-9._-]+, <source-url> should be a" << endl;
215 out << "# URL that points to a directory containing a Familiar" << endl;
216 out << "# Packages file, and <target-path> should be a directory" << endl;
217 out << "# that exists on the target system." << endl << endl;
218
219 // Write out servers 236 // Write out servers
220 Server *server; 237 Server *server;
221 QListIterator<Server> it( serverList ); 238 QListIterator<Server> it( serverList );
222 while ( it.current() ) 239 while ( it.current() )
223 { 240 {
224 server = it.current(); 241 server = it.current();
225 QString alias = server->getServerName(); 242 QString alias = server->getServerName();
226 // Don't write out local as its a dummy 243 // Don't write out local as its a dummy
227 if ( alias != LOCAL_SERVER && alias != LOCAL_IPKGS ) 244 if ( alias != LOCAL_SERVER && alias != LOCAL_IPKGS )
228 { 245 {
229 QString url = server->getServerUrl();; 246 QString url = server->getServerUrl();;
230 247
231 if ( !server->isServerActive() ) 248 if ( !server->isServerActive() )
232 out << "#"; 249 t << "#";
233 out << "src " << alias << " " << url << endl; 250 t << "src " << alias << " " << url << endl;
234 } 251 }
235 252
236 ++it; 253 ++it;
237 } 254 }
238 255
239 out << endl; 256 t << endl;
240 257
241 // Write out destinations 258 // Write out destinations
242 QListIterator<Destination> it2( destList ); 259 QListIterator<Destination> it2( destList );
243 while ( it2.current() ) 260 while ( it2.current() )
244 { 261 {
245 out << "dest " << it2.current()->getDestinationName() << " " << it2.current()->getDestinationPath() << endl; 262 t << "dest " << it2.current()->getDestinationName() << " " << it2.current()->getDestinationPath() << endl;
246 ++it2; 263 ++it2;
247 } 264 }
248 265
249 out << endl; 266 t << endl;
250 out << "# Proxy Support" << endl; 267 t << "# Proxy Support\n";
251 268
252 if ( !httpProxyEnabled && httpProxy == "" ) 269 if ( !httpProxyEnabled && httpProxy == "" )
253 out << "#option http_proxy http://proxy.tld:3128" << endl; 270 t << "#option http_proxy http://proxy.tld:3128\n";
254 else 271 else
255 { 272 {
256 if ( !httpProxyEnabled ) 273 if ( !httpProxyEnabled )
257 out << "#"; 274 t << "#";
258 out << "option http_proxy " << httpProxy << endl; 275 t << "option http_proxy " << httpProxy << endl;
259 } 276 }
260 277
261 if ( !ftpProxyEnabled && ftpProxy == "" ) 278 if ( !ftpProxyEnabled && ftpProxy == "" )
262 out << "#option ftp_proxy http://proxy.tld:3128" << endl; 279 t << "#option ftp_proxy http://proxy.tld:3128\n";
263 else 280 else
264 { 281 {
265 if ( !ftpProxyEnabled ) 282 if ( !ftpProxyEnabled )
266 out << "#"; 283 t << "#";
267 out << "option ftp_proxy " << ftpProxy << endl; 284 t << "option ftp_proxy " << ftpProxy << endl;
268 } 285 }
269 if ( proxyUsername == "" || (!httpProxyEnabled && !ftpProxyEnabled) ) 286 if ( proxyUsername == "" || (!httpProxyEnabled && !ftpProxyEnabled) )
270 out << "#option proxy_username <username>" << endl; 287 t << "#option proxy_username <username>\n";
271 else 288 else
272 out << "option proxy_username " << proxyUsername << endl; 289 t << "option proxy_username " << proxyUsername << endl;
273 if ( proxyPassword == "" || (!httpProxyEnabled && !ftpProxyEnabled) ) 290 if ( proxyPassword == "" || (!httpProxyEnabled && !ftpProxyEnabled) )
274 out << "#option proxy_password <password>" << endl << endl; 291 t << "#option proxy_password <password>\n\n";
275 else 292 else
276 out << "option proxy_password " << proxyPassword << endl<< endl; 293 t << "option proxy_password " << proxyPassword << endl<< endl;
277
278 out << "# Offline mode (for use in constructing flash images offline)" << endl;
279 out << "#option offline_root target" << endl;
280 294
295 t << "# Offline mode (for use in constructing flash images offline)\n";
296 t << "#option offline_root target\n";
281 297
282 out.close(); 298 f.close();
283} 299}
284 300
285 301
286void DataManager :: setAvailableCategories( QString section ) 302void DataManager :: setAvailableCategories( QString section )
287{ 303{
288 section = section.lower(); 304 QString sectstr = "#";
289 if ( availableCategories.find( "#" + section + "#" ) == -1 ) 305 sectstr.append( section.lower() );
290 availableCategories += section + "#"; 306 sectstr.append( "#" );
307 if ( availableCategories.find( sectstr ) == -1 )
308 {
309 availableCategories.append( section );
310 availableCategories.append( "#" );
311 }
291} 312}
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h
index 7fa42c1..32a1e57 100644
--- a/noncore/settings/aqpkg/datamgr.h
+++ b/noncore/settings/aqpkg/datamgr.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 datamgr.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Thu Aug 29 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef DATAMGR_H 30#ifndef DATAMGR_H
19#define DATAMGR_H 31#define DATAMGR_H
20 32
21#include <map> 33#include <map>
22using namespace std; 34using namespace std;
23 35
24#include <qlist.h> 36#include <qlist.h>
25#include <qobject.h> 37#include <qobject.h>
26#include <qstring.h> 38#include <qstring.h>
27 39
28#include "server.h" 40#include "server.h"
29#include "destination.h" 41#include "destination.h"
30 42
31 #define LOCAL_SERVER "Installed Pkgs" 43 #define LOCAL_SERVER "Installed Pkgs"
32 #define LOCAL_IPKGS "local IPKG" 44 #define LOCAL_IPKGS "local IPKG"
33 45
34/** 46/**
35 *@author Andy Qua 47 *@author Andy Qua
36 */ 48 */
37 49
38 50
39class DataManager : public QObject 51class DataManager : public QObject
40{ 52{
diff --git a/noncore/settings/aqpkg/destination.cpp b/noncore/settings/aqpkg/destination.cpp
index 45bdb48..6423894 100644
--- a/noncore/settings/aqpkg/destination.cpp
+++ b/noncore/settings/aqpkg/destination.cpp
@@ -1,30 +1,42 @@
1/*************************************************************************** 1/*
2 destination.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#include "destination.h" 30#include "destination.h"
19#include "global.h" 31#include "global.h"
20 32
21Destination::Destination( const char *name, const char *path ) 33Destination::Destination( const char *name, const char *path )
22{ 34{
23 destName = name; 35 destName = name;
24 destPath = path; 36 destPath = path;
25 linkToRootDir = true; 37 linkToRootDir = true;
26} 38}
27 39
28Destination::~Destination() 40Destination::~Destination()
29{ 41{
30} 42}
diff --git a/noncore/settings/aqpkg/destination.h b/noncore/settings/aqpkg/destination.h
index 646fae9..4a7f706 100644
--- a/noncore/settings/aqpkg/destination.h
+++ b/noncore/settings/aqpkg/destination.h
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 destination.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
17#ifndef DESTINATION_H 30#ifndef DESTINATION_H
18#define DESTINATION_H 31#define DESTINATION_H
19 32
20#include <qstring.h> 33#include <qstring.h>
21 34
22class Destination 35class Destination
23{ 36{
24public: 37public:
25 Destination() {} 38 Destination() {}
26 Destination( const char *name, const char *path ); 39 Destination( const char *name, const char *path );
27 ~Destination(); 40 ~Destination();
28 41
29 void setDestinationName( const QString &name ) { destName = name; } 42 void setDestinationName( const QString &name ) { destName = name; }
30 void setDestinationPath( const QString &path ) { destPath = path; } 43 void setDestinationPath( const QString &path ) { destPath = path; }
31 void linkToRoot( bool val ) { linkToRootDir = val; } 44 void linkToRoot( bool val ) { linkToRootDir = val; }
32 45
33 bool linkToRoot() { return linkToRootDir; } 46 bool linkToRoot() { return linkToRootDir; }
34 QString &getDestinationName() { return destName; } 47 QString &getDestinationName() { return destName; }
35 QString &getDestinationPath() { return destPath; } 48 QString &getDestinationPath() { return destPath; }
36 49
37protected: 50protected:
38 51
39private: 52private:
40 QString destName; 53 QString destName;
diff --git a/noncore/settings/aqpkg/global.h b/noncore/settings/aqpkg/global.h
index 920b090..4fdd51d 100644
--- a/noncore/settings/aqpkg/global.h
+++ b/noncore/settings/aqpkg/global.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 global.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef __GLOBAL_H 30#ifndef __GLOBAL_H
19#define __GLOBAL_H 31#define __GLOBAL_H
20 32
21#define VERSION_TEXT "AQPkg Version 1.11" 33#define VERSION_TEXT "AQPkg Version 1.11"
22 34
23// Uncomment the below line to run on a Linux box rather than a Zaurus 35// Uncomment the below line to run on a Linux box rather than a Zaurus
24// box this allows you to change where root is, and where to load config files from 36// box this allows you to change where root is, and where to load config files from
25// #define X86 37// #define X86
26 38
27// Sets up location of ipkg.conf and root directory 39// Sets up location of ipkg.conf and root directory
28#ifdef QWS 40#ifdef QWS
29 41
30#ifndef X86 42#ifndef X86
31 43
32// Running QT/Embedded on an arm processor 44// Running QT/Embedded on an arm processor
33#define IPKG_CONF "/etc/ipkg.conf" 45#define IPKG_CONF "/etc/ipkg.conf"
34#define ROOT "/" 46#define ROOT "/"
35#define IPKG_DIR "/usr/lib/ipkg/" 47#define IPKG_DIR "/usr/lib/ipkg/"
36 48
37#else 49#else
38 50
39// Running QT/Embedded on a X86 linux box 51// Running QT/Embedded on a X86 linux box
40#define IPKG_CONF "/home/andy/projects/aqpkg/data/ipkg.conf" 52#define IPKG_CONF "/home/andy/projects/aqpkg/data/ipkg.conf"
diff --git a/noncore/settings/aqpkg/inputdlg.cpp b/noncore/settings/aqpkg/inputdlg.cpp
index 724a891..06e934c 100644
--- a/noncore/settings/aqpkg/inputdlg.cpp
+++ b/noncore/settings/aqpkg/inputdlg.cpp
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 inputdlg.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
17#include <qlayout.h> 30#include <qlayout.h>
18#include <qlabel.h> 31#include <qlabel.h>
19#include <qlineedit.h> 32#include <qlineedit.h>
20#include <qpushbutton.h> 33#include <qpushbutton.h>
21#include <qspinbox.h> 34#include <qspinbox.h>
22#include <qcombobox.h> 35#include <qcombobox.h>
23#include <qwidgetstack.h> 36#include <qwidgetstack.h>
24#include <qvalidator.h> 37#include <qvalidator.h>
25#include <qapplication.h> 38#include <qapplication.h>
26 39
27#include "inputdlg.h" 40#include "inputdlg.h"
28#include "global.h" 41#include "global.h"
29 42
30 43
31InputDialog :: InputDialog( const QString &label, QWidget* parent, const char* name, 44InputDialog :: InputDialog( const QString &label, QWidget* parent, const char* name,
32 bool modal ) 45 bool modal )
33 : QDialog( parent, name, modal ) 46 : QDialog( parent, name, modal )
34{ 47{
35 lineEdit = 0; 48 lineEdit = 0;
36 49
37 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); 50 QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 );
38 51
39 QLabel* l = new QLabel( label, this ); 52 QLabel* l = new QLabel( label, this );
40 vbox->addWidget( l ); 53 vbox->addWidget( l );
diff --git a/noncore/settings/aqpkg/inputdlg.h b/noncore/settings/aqpkg/inputdlg.h
index 1e0c5bc..260201e 100644
--- a/noncore/settings/aqpkg/inputdlg.h
+++ b/noncore/settings/aqpkg/inputdlg.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 inputdlg.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef INPUTDIALOG_H 30#ifndef INPUTDIALOG_H
19#define INPUTDIALOG_H 31#define INPUTDIALOG_H
20 32
21#include <qdialog.h> 33#include <qdialog.h>
22#include <qstring.h> 34#include <qstring.h>
23#include <qlineedit.h> 35#include <qlineedit.h>
24#include <qpushbutton.h> 36#include <qpushbutton.h>
25 37
26class InputDialog : public QDialog 38class InputDialog : public QDialog
27{ 39{
28 Q_OBJECT 40 Q_OBJECT
29 41
30public: 42public:
31 static QString getText( const QString &caption, const QString &label, const QString &text = QString::null, 43 static QString getText( const QString &caption, const QString &label, const QString &text = QString::null,
32 bool *ok = 0, QWidget *parent = 0, const char *name = 0 ); 44 bool *ok = 0, QWidget *parent = 0, const char *name = 0 );
33 45
34 InputDialog( const QString &label, QWidget* parent = 0, const char* name = 0, 46 InputDialog( const QString &label, QWidget* parent = 0, const char* name = 0,
35 bool modal = TRUE ); 47 bool modal = TRUE );
36 ~InputDialog(); 48 ~InputDialog();
37 49
38 void setText( const QString &text ); 50 void setText( const QString &text );
39 QString getText(); 51 QString getText();
40 52
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 896e370..17f7b08 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 installdlgimpl.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include <stdio.h> 30#include <stdio.h>
19 31
20#include <opie/ofiledialog.h> 32#include <opie/ofiledialog.h>
21 33
22#ifdef QWS 34#ifdef QWS
23#include <qpe/config.h> 35#include <qpe/config.h>
24#include <qpe/fileselector.h> 36#include <qpe/fileselector.h>
25#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
26#include <qpe/resource.h> 38#include <qpe/resource.h>
27#include <qpe/storage.h> 39#include <qpe/storage.h>
28#endif 40#endif
29 41
30#include <qcheckbox.h> 42#include <qcheckbox.h>
31#include <qcombobox.h> 43#include <qcombobox.h>
32#include <qdialog.h> 44#include <qdialog.h>
33#include <qfileinfo.h> 45#include <qfileinfo.h>
34#include <qgroupbox.h> 46#include <qgroupbox.h>
35#include <qmultilineedit.h> 47#include <qmultilineedit.h>
36#include <qlabel.h> 48#include <qlabel.h>
37#include <qlayout.h> 49#include <qlayout.h>
38#include <qpushbutton.h> 50#include <qpushbutton.h>
39 51
40#include "datamgr.h" 52#include "datamgr.h"
@@ -442,25 +454,25 @@ void InstallDlgImpl :: ipkgFinished()
442 454
443 pIpkg->setDestination( item->destination->getDestinationName() ); 455 pIpkg->setDestination( item->destination->getDestinationName() );
444 pIpkg->setDestinationDir( item->destination->getDestinationPath() ); 456 pIpkg->setDestinationDir( item->destination->getDestinationPath() );
445 pIpkg->setPackage( item->packageName ); 457 pIpkg->setPackage( item->packageName );
446 458
447 tmpFlags |= FORCE_REINSTALL; 459 tmpFlags |= FORCE_REINSTALL;
448 if ( item->destination->linkToRoot() && item->recreateLinks ) 460 if ( item->destination->linkToRoot() && item->recreateLinks )
449 tmpFlags |= MAKE_LINKS; 461 tmpFlags |= MAKE_LINKS;
450 } 462 }
451 pIpkg->setFlags( tmpFlags, infoLevel ); 463 pIpkg->setFlags( tmpFlags, infoLevel );
452 pIpkg->runIpkg(); 464 pIpkg->runIpkg();
453 } 465 }
454 else 466 else
455 { 467 {
456 btnOptions->setEnabled( true ); 468 btnOptions->setEnabled( true );
457 btnInstall->setText( tr( "Close" ) ); 469 btnInstall->setText( tr( "Close" ) );
458 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) ); 470 btnInstall->setIconSet( Resource::loadPixmap( "enter" ) );
459 471
460 btnOptions->setText( tr( "Save output" ) ); 472 btnOptions->setText( tr( "Save output" ) );
461 btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); 473 btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
462 474
463 if ( destination && destination->currentText() != 0 && destination->currentText() != "" ) 475 if ( destination && destination->currentText() != 0 && destination->currentText() != "" )
464 displayAvailableSpace( destination->currentText() ); 476 displayAvailableSpace( destination->currentText() );
465 } 477 }
466} \ No newline at end of file 478}
diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h
index 9a7dbff..894465a 100644
--- a/noncore/settings/aqpkg/installdlgimpl.h
+++ b/noncore/settings/aqpkg/installdlgimpl.h
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 installdlgimpl.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
8 29
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#ifndef INSTALLDLGIMPL_H 30#ifndef INSTALLDLGIMPL_H
18#define INSTALLDLGIMPL_H 31#define INSTALLDLGIMPL_H
19 32
20using namespace std; 33using namespace std;
21 34
22#include <qlist.h> 35#include <qlist.h>
23#include <qstring.h> 36#include <qstring.h>
24#include <qwidget.h> 37#include <qwidget.h>
25 38
26class QComboBox; 39class QComboBox;
27class QLabel; 40class QLabel;
28class QMultiLineEdit; 41class QMultiLineEdit;
29class QPushButton; 42class QPushButton;
30 43
31class DataManager; 44class DataManager;
32class Destination; 45class Destination;
33class Ipkg; 46class Ipkg;
34 47
35class InstallData 48class InstallData
36{ 49{
37public: 50public:
38 QString option; // I - install, D - delete, R- reinstall U - upgrade 51 QString option; // I - install, D - delete, R- reinstall U - upgrade
39 QString packageName; 52 QString packageName;
40 Destination *destination; 53 Destination *destination;
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp
index 72d794f..9d52013 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.cpp
+++ b/noncore/settings/aqpkg/instoptionsimpl.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 instoptionsimpl.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifdef QWS 30#ifdef QWS
19#include <qpe/config.h> 31#include <qpe/config.h>
20#endif 32#endif
21 33
22#include <qcheckbox.h> 34#include <qcheckbox.h>
23#include <qcombobox.h> 35#include <qcombobox.h>
24#include <qgroupbox.h> 36#include <qgroupbox.h>
25#include <qlabel.h> 37#include <qlabel.h>
26#include <qlayout.h> 38#include <qlayout.h>
27 39
28#include "global.h" 40#include "global.h"
29#include "instoptionsimpl.h" 41#include "instoptionsimpl.h"
30#include "ipkg.h" 42#include "ipkg.h"
31 43
32InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) 44InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
33 : QDialog( parent, name, modal, fl ) 45 : QDialog( parent, name, modal, fl )
34{ 46{
35 setCaption( tr( "Options" ) ); 47 setCaption( tr( "Options" ) );
36 48
37 QVBoxLayout *layout = new QVBoxLayout( this ); 49 QVBoxLayout *layout = new QVBoxLayout( this );
38 layout->setMargin( 2 ); 50 layout->setMargin( 2 );
39 layout->setSpacing( 4 ); 51 layout->setSpacing( 4 );
40 52
diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h
index 1312afd..e68a3dc 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.h
+++ b/noncore/settings/aqpkg/instoptionsimpl.h
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 installoptionsimpl.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
8 29
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#ifndef INSTALLOPTIONSIMPL_H 30#ifndef INSTALLOPTIONSIMPL_H
18#define INSTALLOPTIONSIMPL_H 31#define INSTALLOPTIONSIMPL_H
19 32
20#include <qdialog.h> 33#include <qdialog.h>
21 34
22class QCheckBox; 35class QCheckBox;
23class QComboBox; 36class QComboBox;
24 37
25class InstallOptionsDlgImpl : public QDialog 38class InstallOptionsDlgImpl : public QDialog
26{ 39{
27 Q_OBJECT 40 Q_OBJECT
28public: 41public:
29 InstallOptionsDlgImpl( int, int, QWidget * = 0, const char * = 0, bool = false, WFlags = 0 ); 42 InstallOptionsDlgImpl( int, int, QWidget * = 0, const char * = 0, bool = false, WFlags = 0 );
30 ~InstallOptionsDlgImpl(); 43 ~InstallOptionsDlgImpl();
31 int getFlags(); 44 int getFlags();
32 int getInfoLevel(); 45 int getInfoLevel();
33 46
34private: 47private:
35 QCheckBox* forceDepends; 48 QCheckBox* forceDepends;
36 QCheckBox* forceReinstall; 49 QCheckBox* forceReinstall;
37 QCheckBox* forceRemove; 50 QCheckBox* forceRemove;
38 QCheckBox* forceOverwrite; 51 QCheckBox* forceOverwrite;
39 QCheckBox* verboseWget; 52 QCheckBox* verboseWget;
40 QComboBox* verboseIpkg; 53 QComboBox* verboseIpkg;
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 34999ad..08ae386 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 ipkg.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sat Aug 31 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include <fstream> 30#include <fstream>
19#include <iostream> 31#include <iostream>
20#include <vector> 32#include <vector>
21using namespace std; 33using namespace std;
22 34
23#include <stdio.h> 35#include <stdio.h>
24#include <unistd.h> 36#include <unistd.h>
25 37
26#ifdef QWS 38#ifdef QWS
27#include <qpe/qpeapplication.h> 39#include <qpe/qpeapplication.h>
28#else 40#else
29#include <qapplication.h> 41#include <qapplication.h>
30#endif 42#endif
31#include <qdir.h> 43#include <qdir.h>
32#include <qtextstream.h> 44#include <qtextstream.h>
33 45
34#include <opie/oprocess.h> 46#include <opie/oprocess.h>
35 47
36#include "utils.h" 48#include "utils.h"
37#include "ipkg.h" 49#include "ipkg.h"
38#include "global.h" 50#include "global.h"
39 51
40Ipkg :: Ipkg() 52Ipkg :: Ipkg()
diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h
index a0d38e3..8f254f9 100644
--- a/noncore/settings/aqpkg/ipkg.h
+++ b/noncore/settings/aqpkg/ipkg.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 ipkg.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sat Aug 31 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#ifndef IPKG_H 30#ifndef IPKG_H
19#define IPKG_H 31#define IPKG_H
20 32
21 33
22/** 34/**
23 *@author Andy Qua 35 *@author Andy Qua
24 */ 36 */
25 37
26#include <qobject.h> 38#include <qobject.h>
27#include <qstring.h> 39#include <qstring.h>
28#include <qstringlist.h> 40#include <qstringlist.h>
29#include <qlist.h> 41#include <qlist.h>
30 42
31#define FORCE_DEPENDS 0x0001 43#define FORCE_DEPENDS 0x0001
32#define FORCE_REMOVE 0x0002 44#define FORCE_REMOVE 0x0002
33#define FORCE_REINSTALL 0x0004 45#define FORCE_REINSTALL 0x0004
34#define FORCE_OVERWRITE 0x0008 46#define FORCE_OVERWRITE 0x0008
35#define MAKE_LINKS 0x0010 47#define MAKE_LINKS 0x0010
36#define VERBOSE_WGET 0x0020 48#define VERBOSE_WGET 0x0020
37 49
38class OProcess; 50class OProcess;
39 51
40class Ipkg : public QObject 52class Ipkg : public QObject
diff --git a/noncore/settings/aqpkg/letterpushbutton.cpp b/noncore/settings/aqpkg/letterpushbutton.cpp
index ca96c6c..c8b43e9 100644
--- a/noncore/settings/aqpkg/letterpushbutton.cpp
+++ b/noncore/settings/aqpkg/letterpushbutton.cpp
@@ -1,34 +1,46 @@
1/*************************************************************************** 1/*
2 letterpushbutton.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Wed Oct 16 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#include "letterpushbutton.h" 30#include "letterpushbutton.h"
19 31
20LetterPushButton :: LetterPushButton( const QString &text, QWidget *parent, const char *name ) 32LetterPushButton :: LetterPushButton( const QString &text, QWidget *parent, const char *name )
21 : QPushButton( text, parent, name ) 33 : QPushButton( text, parent, name )
22{ 34{
23 connect( this, SIGNAL(released()), this, SLOT(released_emmitor()) ); 35 connect( this, SIGNAL(released()), this, SLOT(released_emmitor()) );
24} 36}
25 37
26LetterPushButton :: ~LetterPushButton() 38LetterPushButton :: ~LetterPushButton()
27{ 39{
28} 40}
29 41
30void LetterPushButton :: released_emmitor() 42void LetterPushButton :: released_emmitor()
31{ 43{
32 emit released( text() ); 44 emit released( text() );
33} 45}
34 46
diff --git a/noncore/settings/aqpkg/letterpushbutton.h b/noncore/settings/aqpkg/letterpushbutton.h
index e45b89d..452d68e 100644
--- a/noncore/settings/aqpkg/letterpushbutton.h
+++ b/noncore/settings/aqpkg/letterpushbutton.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 letterpushbutton.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Wed Oct 16 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef LETTERPUSHBUTTON_H 30#ifndef LETTERPUSHBUTTON_H
19#define LETTERPUSHBUTTON_H 31#define LETTERPUSHBUTTON_H
20 32
21#include <qpushbutton.h> 33#include <qpushbutton.h>
22 34
23/** 35/**
24 *@author Andy Qua 36 *@author Andy Qua
25 */ 37 */
26 38
27class LetterPushButton : public QPushButton 39class LetterPushButton : public QPushButton
28{ 40{
29 Q_OBJECT 41 Q_OBJECT
30public: 42public:
31 LetterPushButton( const QString & text, QWidget * parent, const char * name=0 ); 43 LetterPushButton( const QString & text, QWidget * parent, const char * name=0 );
32 ~LetterPushButton(); 44 ~LetterPushButton();
33 45
34public slots: 46public slots:
35 void released_emmitor(); 47 void released_emmitor();
36 48
37signals: 49signals:
38 void released( QString text ); 50 void released( QString text );
39}; 51};
40 52
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp
index 15ef9d6..066d79f 100644
--- a/noncore/settings/aqpkg/main.cpp
+++ b/noncore/settings/aqpkg/main.cpp
@@ -1,62 +1,71 @@
1/*************************************************************************** 1/*
2 main.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 13:32:30 BST 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifdef QWS 30#ifdef QWS
19#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
20#include <qpe/qcopenvelope_qws.h> 32#include <qpe/qcopenvelope_qws.h>
21#else 33#else
22#include <qapplication.h> 34#include <qapplication.h>
23#endif 35#endif
24 36
25#include <qobjectdefs.h> 37#include <qobjectdefs.h>
26 38
27#include "mainwin.h" 39#include "mainwin.h"
28#include "server.h" 40#include "server.h"
29 41
30#include "global.h" 42#include "global.h"
31 43
32 44
33int main(int argc, char *argv[]) 45int main(int argc, char *argv[])
34{ 46{
35// cout << "Root dir = " << ROOT << endl;
36#ifdef QWS 47#ifdef QWS
37 QPEApplication a( argc, argv ); 48 QPEApplication a( argc, argv );
38#else 49#else
39 QApplication a( argc, argv ); 50 QApplication a( argc, argv );
40#endif 51#endif
41 52
42#ifdef QWS 53#ifdef QWS
43 // Disable suspend mode 54 // Disable suspend mode
44// cout << "Disabling suspend mode" << endl;
45 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 55 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
46#endif 56#endif
47 57
48 MainWindow *win = new MainWindow(); 58 MainWindow *win = new MainWindow();
49 a.setMainWidget(win); 59 a.setMainWidget(win);
50 win->showMaximized(); 60 win->showMaximized();
51 61
52 a.exec(); 62 a.exec();
53 63
54#ifdef QWS 64#ifdef QWS
55 // Reenable suspend mode 65 // Reenable suspend mode
56// cout << "Enabling suspend mode" << endl;
57 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 66 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
58#endif 67#endif
59 #ifdef _DEBUG 68 #ifdef _DEBUG
60 DumpUnfreed(); 69 DumpUnfreed();
61 #endif 70 #endif
62} 71}
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index f0e8e48..0102292 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 mainwin.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 13:32:30 BST 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include <linux/limits.h> 30#include <linux/limits.h>
19#include <unistd.h> 31#include <unistd.h>
20 32
21#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
22#include <qmenubar.h> 34#include <qmenubar.h>
23#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
24#include <qtoolbar.h> 36#include <qtoolbar.h>
25#include <qpe/config.h> 37#include <qpe/config.h>
26#include <qpe/resource.h> 38#include <qpe/resource.h>
27 39
28#include <qaction.h> 40#include <qaction.h>
29#include <qcombobox.h> 41#include <qcombobox.h>
30#include <qfile.h> 42#include <qfile.h>
31#include <qlabel.h> 43#include <qlabel.h>
32#include <qlayout.h> 44#include <qlayout.h>
33#include <qlineedit.h> 45#include <qlineedit.h>
34#include <qlistview.h> 46#include <qlistview.h>
35#include <qmenubar.h> 47#include <qmenubar.h>
36#include <qmessagebox.h> 48#include <qmessagebox.h>
37#include <qpopupmenu.h> 49#include <qpopupmenu.h>
38#include <qprogressbar.h> 50#include <qprogressbar.h>
39#include <qtimer.h> 51#include <qtimer.h>
40#include <qwhatsthis.h> 52#include <qwhatsthis.h>
@@ -281,49 +293,48 @@ void MainWindow :: init()
281 293
282 stack->raiseWidget( progressWindow ); 294 stack->raiseWidget( progressWindow );
283 295
284 mgr = new DataManager(); 296 mgr = new DataManager();
285 connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); 297 connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) );
286 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), 298 connect( mgr, SIGNAL( progressSetMessage( const QString & ) ),
287 this, SLOT( setProgressMessage( const QString & ) ) ); 299 this, SLOT( setProgressMessage( const QString & ) ) );
288 connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); 300 connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) );
289 mgr->loadServers(); 301 mgr->loadServers();
290 302
291 showUninstalledPkgs = false; 303 showUninstalledPkgs = false;
292 showInstalledPkgs = false; 304 showInstalledPkgs = false;
293 showUpgradedPkgs = false; 305 showUpgradedPkgs = false;
294 categoryFilterEnabled = false; 306 categoryFilterEnabled = false;
295 307
296 updateData(); 308 updateData();
297 309
298 stack->raiseWidget( networkPkgWindow ); 310 stack->raiseWidget( networkPkgWindow );
299} 311}
300 312
301void MainWindow :: setDocument( const QString &doc ) 313void MainWindow :: setDocument( const QString &doc )
302{ 314{
303 // Remove path from package 315 // Remove path from package
304 QString package = Utils::getPackageNameFromIpkFilename( doc ); 316 QString package = Utils::getPackageNameFromIpkFilename( doc );
305// std::cout << "Selecting package " << package << std::endl;
306 317
307 // First select local server 318 // First select local server
308 for ( int i = 0 ; i < serversList->count() ; ++i ) 319 for ( int i = 0 ; i < serversList->count() ; ++i )
309 { 320 {
310 if ( serversList->text( i ) == LOCAL_IPKGS ) 321 if ( serversList->text( i ) == LOCAL_IPKGS )
311 { 322 {
312 serversList->setCurrentItem( i ); 323 serversList->setCurrentItem( i );
313 break; 324 break;
314 } 325 }
315 } 326 }
316 serverSelected( 0 ); 327 serverSelected( 0 );
317 328
318 // Now set the check box of the selected package 329 // Now set the check box of the selected package
319 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); 330 for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild();
320 item != 0 ; 331 item != 0 ;
321 item = (QCheckListItem *)item->nextSibling() ) 332 item = (QCheckListItem *)item->nextSibling() )
322 { 333 {
323 if ( item->text().startsWith( package ) ) 334 if ( item->text().startsWith( package ) )
324 { 335 {
325 item->setOn( true ); 336 item->setOn( true );
326 break; 337 break;
327 } 338 }
328 } 339 }
329} 340}
@@ -533,52 +544,50 @@ void MainWindow :: updateProgress( int progress )
533} 544}
534 545
535void MainWindow :: updateData() 546void MainWindow :: updateData()
536{ 547{
537 m_progress->setTotalSteps( mgr->getServerList().count() ); 548 m_progress->setTotalSteps( mgr->getServerList().count() );
538 549
539 serversList->clear(); 550 serversList->clear();
540 packagesList->clear(); 551 packagesList->clear();
541 552
542 int activeItem = -1; 553 int activeItem = -1;
543 int i = 0; 554 int i = 0;
544 QString serverName; 555 QString serverName;
545 556
546 QListIterator<Server> it( mgr->getServerList() ); 557 QListIterator<Server> it( mgr->getServerList() );
547 Server *server; 558 Server *server;
548 559
549 for ( ; it.current(); ++it, ++i ) 560 for ( ; it.current(); ++it, ++i )
550 { 561 {
551 server = it.current(); 562 server = it.current();
552 serverName = server->getServerName(); 563 serverName = server->getServerName();
553 m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); 564 m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) );
554 m_progress->setProgress( i ); 565 m_progress->setProgress( i );
555 qApp->processEvents(); 566 qApp->processEvents();
556 567
557// cout << "Adding " << it->getServerName() << " to combobox" << endl;
558 if ( !server->isServerActive() ) 568 if ( !server->isServerActive() )
559 { 569 {
560// cout << serverName << " is not active" << endl;
561 i--; 570 i--;
562 continue; 571 continue;
563 } 572 }
564 573
565 serversList->insertItem( serverName ); 574 serversList->insertItem( serverName );
566 if ( serverName == currentlySelectedServer ) 575 if ( serverName == currentlySelectedServer )
567 activeItem = i; 576 activeItem = i;
568 } 577 }
569 578
570 // set selected server to be active server 579 // set selected server to be active server
571 if ( activeItem != -1 ) 580 if ( activeItem != -1 )
572 serversList->setCurrentItem( activeItem ); 581 serversList->setCurrentItem( activeItem );
573 serverSelected( 0, FALSE ); 582 serverSelected( 0, FALSE );
574} 583}
575 584
576void MainWindow :: serverSelected( int index ) 585void MainWindow :: serverSelected( int index )
577{ 586{
578 serverSelected( index, TRUE ); 587 serverSelected( index, TRUE );
579} 588}
580 589
581void MainWindow :: serverSelected( int, bool raiseProgress ) 590void MainWindow :: serverSelected( int, bool raiseProgress )
582{ 591{
583 QPixmap nullIcon( installedIcon.size() ); 592 QPixmap nullIcon( installedIcon.size() );
584 nullIcon.fill( colorGroup().base() ); 593 nullIcon.fill( colorGroup().base() );
@@ -692,65 +701,59 @@ void MainWindow :: serverSelected( int, bool raiseProgress )
692 } 701 }
693 else if ( serverName == LOCAL_IPKGS ) 702 else if ( serverName == LOCAL_IPKGS )
694 { 703 {
695 downloadEnabled = FALSE; 704 downloadEnabled = FALSE;
696 actionUpgrade->setEnabled( FALSE ); 705 actionUpgrade->setEnabled( FALSE );
697 } 706 }
698 else 707 else
699 { 708 {
700 downloadEnabled = TRUE; 709 downloadEnabled = TRUE;
701 actionUpgrade->setEnabled( TRUE ); 710 actionUpgrade->setEnabled( TRUE );
702 } 711 }
703 enableDownload( downloadEnabled ); 712 enableDownload( downloadEnabled );
704 713
705 // Display this widget once everything is done 714 // Display this widget once everything is done
706 if ( doProgress && raiseProgress ) 715 if ( doProgress && raiseProgress )
707 { 716 {
708 stack->raiseWidget( networkPkgWindow ); 717 stack->raiseWidget( networkPkgWindow );
709 } 718 }
710} 719}
711 720
712void MainWindow :: searchForPackage( const QString &text ) 721void MainWindow :: searchForPackage( const QString &text )
713{ 722{
714 if ( !text.isEmpty() ) 723 if ( !text.isEmpty() )
715 { 724 {
716// cout << "searching for " << text << endl;
717 // look through package list for text startng at current position 725 // look through package list for text startng at current position
718// vector<InstallData> workingPackages;
719 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); 726 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
720// if ( start != 0 )
721// start = (QCheckListItem *)start->nextSibling();
722 727
723 if ( start == 0 ) 728 if ( start == 0 )
724 start = (QCheckListItem *)packagesList->firstChild(); 729 start = (QCheckListItem *)packagesList->firstChild();
725 730
726 for ( QCheckListItem *item = start; item != 0 ; 731 for ( QCheckListItem *item = start; item != 0 ;
727 item = (QCheckListItem *)item->nextSibling() ) 732 item = (QCheckListItem *)item->nextSibling() )
728 { 733 {
729// cout << "checking " << item->text().lower() << endl;
730 if ( item->text().lower().find( text ) != -1 ) 734 if ( item->text().lower().find( text ) != -1 )
731 { 735 {
732// cout << "matched " << item->text() << endl;
733 packagesList->ensureItemVisible( item ); 736 packagesList->ensureItemVisible( item );
734 packagesList->setCurrentItem( item ); 737 packagesList->setCurrentItem( item );
735 break; 738 break;
736 } 739 }
737 } 740 }
738 } 741 }
739} 742}
740 743
741void MainWindow :: updateServer() 744void MainWindow :: updateServer()
742{ 745{
743 QString serverName = serversList->currentText(); 746 QString serverName = serversList->currentText();
744 747
745 // Update the current server 748 // Update the current server
746 // Display dialog 749 // Display dialog
747 750
748 // Disable buttons to stop silly people clicking lots on them :) 751 // Disable buttons to stop silly people clicking lots on them :)
749 752
750 // First, write out ipkg_conf file so that ipkg can use it 753 // First, write out ipkg_conf file so that ipkg can use it
751 mgr->writeOutIpkgConf(); 754 mgr->writeOutIpkgConf();
752 755
753 Ipkg *ipkg = new Ipkg; 756 Ipkg *ipkg = new Ipkg;
754 ipkg->setOption( "update" ); 757 ipkg->setOption( "update" );
755 758
756 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ), 759 InstallDlgImpl *dlg = new InstallDlgImpl( ipkg, tr( "Refreshing server package lists" ),
@@ -992,50 +995,48 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
992 if ( p->isPackageStoredLocally() ) 995 if ( p->isPackageStoredLocally() )
993 name = p->getFilename(); 996 name = p->getFilename();
994 997
995 QString option; 998 QString option;
996 QString dest = "root"; 999 QString dest = "root";
997 if ( !p->isInstalled() ) 1000 if ( !p->isInstalled() )
998 { 1001 {
999 InstallData *newitem = new InstallData(); 1002 InstallData *newitem = new InstallData();
1000 newitem->option = "I"; 1003 newitem->option = "I";
1001 newitem->packageName = name; 1004 newitem->packageName = name;
1002 return newitem; 1005 return newitem;
1003 } 1006 }
1004 else 1007 else
1005 { 1008 {
1006 InstallData *newitem = new InstallData(); 1009 InstallData *newitem = new InstallData();
1007 newitem->option = "D"; 1010 newitem->option = "D";
1008 if ( !p->isPackageStoredLocally() ) 1011 if ( !p->isPackageStoredLocally() )
1009 newitem->packageName = p->getInstalledPackageName(); 1012 newitem->packageName = p->getInstalledPackageName();
1010 else 1013 else
1011 newitem->packageName = name; 1014 newitem->packageName = name;
1012 1015
1013 if ( p->getInstalledTo() ) 1016 if ( p->getInstalledTo() )
1014 { 1017 {
1015 newitem->destination = p->getInstalledTo(); 1018 newitem->destination = p->getInstalledTo();
1016// cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl;
1017// cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl;
1018 } 1019 }
1019 else 1020 else
1020 { 1021 {
1021 newitem->destination = p->getLocalPackage()->getInstalledTo(); 1022 newitem->destination = p->getLocalPackage()->getInstalledTo();
1022 } 1023 }
1023 1024
1024 // Now see if version is newer or not 1025 // Now see if version is newer or not
1025 int val = compareVersions( p->getInstalledVersion(), p->getVersion() ); 1026 int val = compareVersions( p->getInstalledVersion(), p->getVersion() );
1026 1027
1027 // If the version requested is older and user selected a local ipk file, then reinstall the file 1028 // If the version requested is older and user selected a local ipk file, then reinstall the file
1028 if ( p->isPackageStoredLocally() && val == -1 ) 1029 if ( p->isPackageStoredLocally() && val == -1 )
1029 val = 0; 1030 val = 0;
1030 1031
1031 if ( val == -2 ) 1032 if ( val == -2 )
1032 { 1033 {
1033 // Error - should handle 1034 // Error - should handle
1034 } 1035 }
1035 else if ( val == -1 ) 1036 else if ( val == -1 )
1036 { 1037 {
1037 // Version available is older - remove only 1038 // Version available is older - remove only
1038 newitem->option = "D"; 1039 newitem->option = "D";
1039 } 1040 }
1040 else 1041 else
1041 { 1042 {
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index f95c332..9f48321 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 mainwin.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 13:32:30 BST 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#ifndef MAINWIN_H 30#ifndef MAINWIN_H
19#define MAINWIN_H 31#define MAINWIN_H
20 32
21#include <qmainwindow.h> 33#include <qmainwindow.h>
22#include <qpixmap.h> 34#include <qpixmap.h>
23 35
24class DataManager; 36class DataManager;
25class InstallData; 37class InstallData;
26class InstallDlgImpl; 38class InstallDlgImpl;
27 39
28class QAction; 40class QAction;
29class QCheckListItem; 41class QCheckListItem;
30class QComboBox; 42class QComboBox;
31class QLabel; 43class QLabel;
32class QLineEdit; 44class QLineEdit;
33class QListView; 45class QListView;
34class QListViewItem; 46class QListViewItem;
35class QToolBar; 47class QToolBar;
36class QProgressBar; 48class QProgressBar;
37class QWidgetStack; 49class QWidgetStack;
38 50
39class MainWindow :public QMainWindow 51class MainWindow :public QMainWindow
40{ 52{
diff --git a/noncore/settings/aqpkg/mem.cpp b/noncore/settings/aqpkg/mem.cpp
index 405aada..5f32a26 100644
--- a/noncore/settings/aqpkg/mem.cpp
+++ b/noncore/settings/aqpkg/mem.cpp
@@ -1,106 +1,110 @@
1/*************************************************************************** 1/*
2 mem.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17#include <stdio.h> 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18#include <fstream> 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19#include <iostream> 19..}^=.=       =       ; Public License for more details.
20#include <list> 20++=   -.     .`     .:
21using namespace std; 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 22 -.   .:....=;==+<; General Public License along with this file;
23#define __MEMFILE_C 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24#include "global.h" 24    --        :-=` Free Software Foundation, Inc.,
25 25 59 Temple Place - Suite 330,
26#ifdef _DEBUG 26 Boston, MA 02111-1307, USA.
27 27
28void __cdecl *operator new( unsigned int size, const char *file, int line ) 28*/
29{ 29
30 void *ptr = (void *)malloc(size); 30#include <stdio.h>
31 AddTrack((long)ptr, size, file, line); 31#include <list>
32 return(ptr); 32using namespace std;
33} 33
34 34#define __MEMFILE_C
35void operator delete(void *p) 35#include "global.h"
36{ 36
37 RemoveTrack((long)p); 37#ifdef _DEBUG
38 free(p); 38
39} 39void __cdecl *operator new( unsigned int size, const char *file, int line )
40 40{
41#endif 41 void *ptr = (void *)malloc(size);
42 42 AddTrack((long)ptr, size, file, line);
43 43 return(ptr);
44typedef struct { 44}
45 longaddress; 45
46 longsize; 46void operator delete(void *p)
47 charfile[64]; 47{
48 longline; 48 RemoveTrack((long)p);
49} ALLOC_INFO; 49 free(p);
50 50}
51typedef list<ALLOC_INFO*> AllocList; 51
52 52#endif
53AllocList allocList; 53
54 54
55 55typedef struct {
56 56 longaddress;
57void AddTrack(long addr, long asize, const char *fname, long lnum) 57 longsize;
58{ 58 charfile[64];
59 ALLOC_INFO *info; 59 longline;
60 60} ALLOC_INFO;
61 61
62 info = (ALLOC_INFO *)malloc(sizeof( ALLOC_INFO )); 62typedef list<ALLOC_INFO*> AllocList;
63 info->address = addr; 63
64 strncpy(info->file, fname, 63); 64AllocList allocList;
65 info->line = lnum; 65
66 info->size = asize; 66
67 allocList.insert(allocList.begin(), info); 67
68}; 68void AddTrack(long addr, long asize, const char *fname, long lnum)
69 69{
70void RemoveTrack(long addr) 70 ALLOC_INFO *info;
71{ 71
72 AllocList::iterator i; 72
73 73 info = (ALLOC_INFO *)malloc(sizeof( ALLOC_INFO ));
74 bool found = false; 74 info->address = addr;
75 for(i = allocList.begin(); i != allocList.end(); i++) 75 strncpy(info->file, fname, 63);
76 { 76 info->line = lnum;
77 if((*i)->address == addr) 77 info->size = asize;
78 { 78 allocList.insert(allocList.begin(), info);
79 allocList.remove((*i)); 79};
80 found = true; 80
81 break; 81void RemoveTrack(long addr)
82 } 82{
83 } 83 AllocList::iterator i;
84} 84
85 85 bool found = false;
86void DumpUnfreed() 86 for(i = allocList.begin(); i != allocList.end(); i++)
87{ 87 {
88 AllocList::iterator i; 88 if((*i)->address == addr)
89 long totalSize = 0; 89 {
90 char buf[1024]; 90 allocList.remove((*i));
91 91 found = true;
92 92 break;
93// if(!allocList) 93 }
94 // return; 94 }
95 95}
96 for(i = allocList.begin(); i != allocList.end(); i++) { 96
97 sprintf(buf, "%-15s: LINE %ld, ADDRESS %ld %ld unfreed", 97void DumpUnfreed()
98 (*i)->file, (*i)->line, (*i)->address, (*i)->size); 98{
99 cout <<buf << endl; 99 AllocList::iterator i;
100 totalSize += (*i)->size; 100 long totalSize = 0;
101 } 101 char buf[1024];
102 sprintf(buf, "-----------------------------------------------------------\n"); 102
103 cout <<buf << endl; 103 for(i = allocList.begin(); i != allocList.end(); i++) {
104 sprintf(buf, "Total Unfreed: %ld bytes\n", totalSize); 104 sprintf(buf, "%-15s: LINE %ld, ADDRESS %ld %ld unfreed",
105 cout <<buf << endl; 105 (*i)->file, (*i)->line, (*i)->address, (*i)->size);
106}; 106 totalSize += (*i)->size;
107 }
108 sprintf(buf, "-----------------------------------------------------------\n");
109 sprintf(buf, "Total Unfreed: %ld bytes\n", totalSize);
110};
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index 3395870..4c27c65 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 package.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include "package.h" 30#include "package.h"
19#include "global.h" 31#include "global.h"
20 32
21Package::Package( QString &name ) 33Package::Package( QString &name )
22{ 34{
23 packageName = name; 35 packageName = name;
24 36
25 version = "N/A"; 37 version = "N/A";
26 description = "N/A"; 38 description = "N/A";
27 packageSize = "N/A"; 39 packageSize = "N/A";
28 section = "N/A"; 40 section = "N/A";
29 41
30 localPackage = 0; 42 localPackage = 0;
31 installed = false; 43 installed = false;
32 packageStoredLocally = false; 44 packageStoredLocally = false;
33 installedToRoot = false; 45 installedToRoot = false;
34 installed = false; 46 installed = false;
35 installedTo = 0; 47 installedTo = 0;
36} 48}
37 49
38Package::Package( char *name ) 50Package::Package( char *name )
39{ 51{
40 packageName = name; 52 packageName = name;
diff --git a/noncore/settings/aqpkg/package.h b/noncore/settings/aqpkg/package.h
index 110ae91..c72f8b3 100644
--- a/noncore/settings/aqpkg/package.h
+++ b/noncore/settings/aqpkg/package.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 package.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#ifndef PACKAGE_H 30#ifndef PACKAGE_H
19#define PACKAGE_H 31#define PACKAGE_H
20 32
21#include <stdlib.h> 33#include <stdlib.h>
22 34
23/** 35/**
24 *@author Andy Qua 36 *@author Andy Qua
25 */ 37 */
26 38
27#include <qstring.h> 39#include <qstring.h>
28#include "destination.h" 40#include "destination.h"
29 41
30class Package 42class Package
31{ 43{
32public: 44public:
33 Package( QString &name ); 45 Package( QString &name );
34 Package( char *name ); 46 Package( char *name );
35 ~Package(); 47 ~Package();
36 48
37 void setLocalPackage( Package *p ); 49 void setLocalPackage( Package *p );
38 void setPackageName( const QString &name ); 50 void setPackageName( const QString &name );
39 void setVersion( const QString &v ); 51 void setVersion( const QString &v );
40 void setStatus( const QString &s ); 52 void setStatus( const QString &s );
diff --git a/noncore/settings/aqpkg/packagewin.cpp b/noncore/settings/aqpkg/packagewin.cpp
index 7971ccc..9553cd1 100644
--- a/noncore/settings/aqpkg/packagewin.cpp
+++ b/noncore/settings/aqpkg/packagewin.cpp
@@ -1,28 +1,29 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3
4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?> 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5             .=l. Dan Williams <drw@handhelds.org>
5           .>+-= 6           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 13    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 20++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
26 27
27*/ 28*/
28 29
@@ -83,37 +84,35 @@ PackageWindow::PackageWindow( Package *package, const QString &server )
83 } 84 }
84 else 85 else
85 { 86 {
86 str.append( tr( "<p><b>Version Available</b> - " ) ); 87 str.append( tr( "<p><b>Version Available</b> - " ) );
87 str.append( package->getVersion() ); 88 str.append( package->getVersion() );
88 if ( package->getLocalPackage() ) 89 if ( package->getLocalPackage() )
89 { 90 {
90 if ( package->isInstalled() ) 91 if ( package->isInstalled() )
91 { 92 {
92 str.append( tr( "<p><b>Version Installed</b> - " ) ); 93 str.append( tr( "<p><b>Version Installed</b> - " ) );
93 str.append( package->getInstalledVersion() ); 94 str.append( package->getInstalledVersion() );
94 } 95 }
95 } 96 }
96 } 97 }
97 } 98 }
98 else 99 else
99 { 100 {
100 setCaption( tr( "Package Information" ) ); 101 setCaption( tr( "Package Information" ) );
101 str = tr( "Package information is unavailable" ); 102 str = tr( "Package information is unavailable" );
102 } 103 }
103 104
104 QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 ); 105 QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 );
105 106
106 QTextView *l = new QTextView( str, QString::null, this ); 107 QTextView *l = new QTextView( str, QString::null, this );
107 //l->setTextFormat( Qt::RichText );
108 //l->setAlignment( Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak );
109 layout->addWidget( l ); 108 layout->addWidget( l );
110 109
111 QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this ); 110 QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this );
112 layout->addWidget( btn ); 111 layout->addWidget( btn );
113 connect( btn, SIGNAL( clicked() ), this, SLOT( close() ) ); 112 connect( btn, SIGNAL( clicked() ), this, SLOT( close() ) );
114 113
115} 114}
116 115
117PackageWindow::~PackageWindow() 116PackageWindow::~PackageWindow()
118{ 117{
119} 118}
diff --git a/noncore/settings/aqpkg/packagewin.h b/noncore/settings/aqpkg/packagewin.h
index b4fdcad..83f3849 100644
--- a/noncore/settings/aqpkg/packagewin.h
+++ b/noncore/settings/aqpkg/packagewin.h
@@ -1,28 +1,29 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3
4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?> 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5             .=l. Dan Williams <drw@handhelds.org>
5           .>+-= 6           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 13    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 20++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
26 27
27*/ 28*/
28 29
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index e2b8096..4693db1 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -1,111 +1,119 @@
1/*************************************************************************** 1/*
2 server.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 description : This class holds details about a server 7 _;:,     .>    :=|. This file is free software; you can
8 : e.g. all the packages that contained on the server 8.> <`_,   >  .   <= redistribute it and/or modify it under
9 : the installation status 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 ***************************************************************************/ 10.="- .-=="i,     .._ License as published by the Free Software
11 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12/*************************************************************************** 12     ._= =}       : or (at your option) any later version.
13 * * 13    .%`+i>       _;_.
14 * This program is free software; you can redistribute it and/or modify * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * it under the terms of the GNU General Public License as published by * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 * the Free Software Foundation; either version 2 of the License, or * 16    : ..    .:,     . . . without even the implied warranty of
17 * (at your option) any later version. * 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18 * * 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19 ***************************************************************************/ 19..}^=.=       =       ; Public License for more details.
20 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
21 29
22#include "server.h" 30#include "server.h"
23#include "datamgr.h" 31#include "datamgr.h"
24 32
25#include <qfile.h> 33#include <qfile.h>
26#include <qtextstream.h> 34#include <qtextstream.h>
27 35
28#ifdef QWS 36#ifdef QWS
29#include <qpe/global.h> 37#include <qpe/global.h>
30#include <qpe/applnk.h> 38#include <qpe/applnk.h>
31#include <qlist.h> 39#include <qlist.h>
32#endif 40#endif
33 41
34#include "utils.h" 42#include "utils.h"
35 43
36#include "global.h" 44#include "global.h"
37 45
38Server :: Server( const char *name, const char *url ) 46Server :: Server( const char *name, const char *url )
39{ 47{
40 serverName = name; 48 serverName = name;
41 serverUrl = url; 49 serverUrl = url;
42 packageFile = IPKG_DIR; 50 packageFile = IPKG_DIR;
43 active = true; 51 active = true;
44 packageFile += "lists/" + serverName; 52 packageFile.append( "lists/" );
53 packageFile.append( serverName );
45} 54}
46 55
47Server :: ~Server() 56Server :: ~Server()
48{ 57{
49 cleanUp(); 58 cleanUp();
50} 59}
51 60
52void Server :: cleanUp() 61void Server :: cleanUp()
53{ 62{
54 packageList.clear(); 63 packageList.clear();
55} 64}
56 65
57void Server :: readStatusFile( QList<Destination> &destList ) 66void Server :: readStatusFile( QList<Destination> &destList )
58{ 67{
59 cleanUp(); 68 cleanUp();
60 69
61 Destination *dest; 70 Destination *dest;
62 QListIterator<Destination> dit( destList ); 71 QListIterator<Destination> dit( destList );
63 bool rootRead = false; 72 bool rootRead = false;
64 for ( ; dit.current(); ++dit ) 73 for ( ; dit.current(); ++dit )
65 { 74 {
66 dest = dit.current(); 75 dest = dit.current();
67 bool installingToRoot = false; 76 bool installingToRoot = false;
68 77
69 QString path = dest->getDestinationPath(); 78 QString path = dest->getDestinationPath();
70 if ( path.right( 1 ) != "/" ) 79 if ( path.right( 1 ) != "/" )
71 path.append( "/" ); 80 path.append( "/" );
72 81
73 if ( path == "/" ) 82 if ( path == "/" )
74 { 83 {
75 rootRead = true; 84 rootRead = true;
76 installingToRoot = true; 85 installingToRoot = true;
77 } 86 }
78 87
79 packageFile = path; 88 packageFile = path;
80 packageFile.append( "usr/lib/ipkg/status" ); 89 packageFile.append( "usr/lib/ipkg/status" );
81 readPackageFile( 0, false, installingToRoot, &( *dest ) ); 90 readPackageFile( 0, false, installingToRoot, &( *dest ) );
82 } 91 }
83 92
84 // Ensure that the root status file is read 93 // Ensure that the root status file is read
85 if ( !rootRead ) 94 if ( !rootRead )
86 { 95 {
87 //cout << "Reading status file " << "/usr/lib/ipkg/status" << endl;
88 packageFile = "/usr/lib/ipkg/status"; 96 packageFile = "/usr/lib/ipkg/status";
89 readPackageFile( 0, false, true ); 97 readPackageFile( 0, false, true );
90 } 98 }
91} 99}
92 100
93void Server :: readLocalIpks( Server *local ) 101void Server :: readLocalIpks( Server *local )
94{ 102{
95 cleanUp(); 103 cleanUp();
96 104
97#ifdef QWS 105#ifdef QWS
98 // First, get any local IPKGs in the documents area 106 // First, get any local IPKGs in the documents area
99 // Only applicable to Qtopie/Opie 107 // Only applicable to Qtopie/Opie
100 108
101 DocLnkSet files; 109 DocLnkSet files;
102 Global::findDocuments( &files, "application/ipkg" ); 110 Global::findDocuments( &files, "application/ipkg" );
103 111
104 // Now add the items to the list 112 // Now add the items to the list
105 QListIterator<DocLnk> it( files.children() ); 113 QListIterator<DocLnk> it( files.children() );
106 114
107 for ( ; it.current() ; ++it ) 115 for ( ; it.current() ; ++it )
108 { 116 {
109 // OK, we have a local IPK file, I think the standard naming conventions 117 // OK, we have a local IPK file, I think the standard naming conventions
110 // for these are packagename_version_arm.ipk 118 // for these are packagename_version_arm.ipk
111 QString file = (*it)->file(); 119 QString file = (*it)->file();
diff --git a/noncore/settings/aqpkg/server.h b/noncore/settings/aqpkg/server.h
index 02746e0..f524ed6 100644
--- a/noncore/settings/aqpkg/server.h
+++ b/noncore/settings/aqpkg/server.h
@@ -1,40 +1,53 @@
1/*************************************************************************** 1/*
2 server.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Mon Aug 26 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
8 29
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#ifndef SERVER_H 30#ifndef SERVER_H
18#define SERVER_H 31#define SERVER_H
19 32
20#include <qlist.h> 33#include <qlist.h>
21#include <qstring.h> 34#include <qstring.h>
22 35
23using namespace std; 36using namespace std;
24 37
25#include "package.h" 38#include "package.h"
26#include "destination.h" 39#include "destination.h"
27 40
28class Server 41class Server
29{ 42{
30public: 43public:
31 Server() {} 44 Server() {}
32 Server( const char *name, const char *url ); 45 Server( const char *name, const char *url );
33 Server( const char *name, const char *url, const char *file ); 46 Server( const char *name, const char *url, const char *file );
34 ~Server(); 47 ~Server();
35 48
36 void cleanUp(); 49 void cleanUp();
37 50
38 void readStatusFile( QList<Destination> &v ); 51 void readStatusFile( QList<Destination> &v );
39 void readLocalIpks( Server *local ); 52 void readLocalIpks( Server *local );
40 void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false, Destination *dest = 0 ); 53 void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false, Destination *dest = 0 );
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index e2afada..4887ceb 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 settingsimpl.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Thu Aug 29 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include <fstream> 30#include <fstream>
19#include <algorithm> 31#include <algorithm>
20using namespace std; 32using namespace std;
21 33
22#include <qcheckbox.h> 34#include <qcheckbox.h>
23#include <qgroupbox.h> 35#include <qgroupbox.h>
24#include <qlabel.h> 36#include <qlabel.h>
25#include <qlayout.h> 37#include <qlayout.h>
26#include <qlineedit.h> 38#include <qlineedit.h>
27#include <qlistbox.h> 39#include <qlistbox.h>
28#include <qpushbutton.h> 40#include <qpushbutton.h>
29 41
30#include <opie/otabwidget.h> 42#include <opie/otabwidget.h>
31 43
32#ifdef QWS 44#ifdef QWS
33#include <qpe/config.h> 45#include <qpe/config.h>
34#include <qpe/resource.h> 46#include <qpe/resource.h>
35#endif 47#endif
36 48
37#include "settingsimpl.h" 49#include "settingsimpl.h"
38 50
39#include "global.h" 51#include "global.h"
40 52
diff --git a/noncore/settings/aqpkg/settingsimpl.h b/noncore/settings/aqpkg/settingsimpl.h
index 9ffc259..1530ce1 100644
--- a/noncore/settings/aqpkg/settingsimpl.h
+++ b/noncore/settings/aqpkg/settingsimpl.h
@@ -1,40 +1,52 @@
1/*************************************************************************** 1/*
2 settingsimpl.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Thu Aug 29 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#include "datamgr.h" 30#include "datamgr.h"
19 31
20#include <qdialog.h> 32#include <qdialog.h>
21 33
22class QCheckBox; 34class QCheckBox;
23class QLineEdit; 35class QLineEdit;
24class QListBox; 36class QListBox;
25 37
26class SettingsImpl : public QDialog 38class SettingsImpl : public QDialog
27{ 39{
28 Q_OBJECT 40 Q_OBJECT
29public: 41public:
30 SettingsImpl( DataManager *dataManager, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 42 SettingsImpl( DataManager *dataManager, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
31 ~SettingsImpl(); 43 ~SettingsImpl();
32 44
33 bool showDlg(); 45 bool showDlg();
34 46
35private: 47private:
36 QListBox *servers; 48 QListBox *servers;
37 QLineEdit *servername; 49 QLineEdit *servername;
38 QLineEdit *serverurl; 50 QLineEdit *serverurl;
39 QCheckBox *active; 51 QCheckBox *active;
40 QListBox *destinations; 52 QListBox *destinations;
diff --git a/noncore/settings/aqpkg/utils.cpp b/noncore/settings/aqpkg/utils.cpp
index 446ce39..00607dd 100644
--- a/noncore/settings/aqpkg/utils.cpp
+++ b/noncore/settings/aqpkg/utils.cpp
@@ -1,57 +1,67 @@
1/*************************************************************************** 1/*
2 utils.cpp - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sat Sep 7 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#include <stdio.h> 30#include <stdio.h>
19#include <sys/vfs.h> 31#include <sys/vfs.h>
20//#include <mntent.h>
21 32
22#include "utils.h" 33#include "utils.h"
23#include "global.h" 34#include "global.h"
24 35
25Utils :: Utils() 36Utils :: Utils()
26{ 37{
27} 38}
28 39
29Utils :: ~Utils() 40Utils :: ~Utils()
30{ 41{
31} 42}
32 43
33
34QString Utils :: getPathfromIpkFilename( const QString &file ) 44QString Utils :: getPathfromIpkFilename( const QString &file )
35{ 45{
36 int p = file.findRev( "/" ); 46 int p = file.findRev( "/" );
37 QString path = ""; 47 QString path = "";
38 if ( p != -1 ) 48 if ( p != -1 )
39 path = file.left( p ); 49 path = file.left( p );
40 50
41 return path; 51 return path;
42 52
43} 53}
44 54
45QString Utils :: getFilenameFromIpkFilename( const QString &file ) 55QString Utils :: getFilenameFromIpkFilename( const QString &file )
46{ 56{
47 int p = file.findRev( "/" ); 57 int p = file.findRev( "/" );
48 QString name = file; 58 QString name = file;
49 if ( p != -1 ) 59 if ( p != -1 )
50 name = name.mid( p + 1 ); 60 name = name.mid( p + 1 );
51 61
52 62
53 return name; 63 return name;
54} 64}
55 65
56QString Utils :: getPackageNameFromIpkFilename( const QString &file ) 66QString Utils :: getPackageNameFromIpkFilename( const QString &file )
57{ 67{
@@ -60,37 +70,36 @@ QString Utils :: getPackageNameFromIpkFilename( const QString &file )
60 if ( p != -1 ) 70 if ( p != -1 )
61 name = name.mid( p + 1 ); 71 name = name.mid( p + 1 );
62 p = name.find( "_" ); 72 p = name.find( "_" );
63 QString packageName = name.mid( 0, p ); 73 QString packageName = name.mid( 0, p );
64 return packageName; 74 return packageName;
65} 75}
66 76
67QString Utils :: getPackageVersionFromIpkFilename( const QString &file ) 77QString Utils :: getPackageVersionFromIpkFilename( const QString &file )
68{ 78{
69 int p = file.findRev( "/" ); 79 int p = file.findRev( "/" );
70 QString name = file; 80 QString name = file;
71 if ( p != -1 ) 81 if ( p != -1 )
72 name = name.mid( p + 1 ); 82 name = name.mid( p + 1 );
73 p = name.find( "_" ) + 1; 83 p = name.find( "_" ) + 1;
74 int p2 = name.find( "_", p ); 84 int p2 = name.find( "_", p );
75 QString version = name.mid( p, p2 - p ); 85 QString version = name.mid( p, p2 - p );
76 return version; 86 return version;
77} 87}
78 88
79 89
80bool Utils :: getStorageSpace( const char *path, long *blockSize, long *totalBlocks, long *availBlocks ) 90bool Utils :: getStorageSpace( const char *path, long *blockSize, long *totalBlocks, long *availBlocks )
81{ 91{
82 bool ret = false; 92 bool ret = false;
83 93
84// qDebug( "Reading from path %s", path );
85 struct statfs fs; 94 struct statfs fs;
86 if ( !statfs( path, &fs ) ) 95 if ( !statfs( path, &fs ) )
87 { 96 {
88 *blockSize = fs.f_bsize; 97 *blockSize = fs.f_bsize;
89 *totalBlocks = fs.f_blocks; 98 *totalBlocks = fs.f_blocks;
90 *availBlocks = fs.f_bavail; 99 *availBlocks = fs.f_bavail;
91 ret = true; 100 ret = true;
92 } 101 }
93 102
94 return ret; 103 return ret;
95} 104}
96 105
diff --git a/noncore/settings/aqpkg/utils.h b/noncore/settings/aqpkg/utils.h
index c572f7b..6e5116e 100644
--- a/noncore/settings/aqpkg/utils.h
+++ b/noncore/settings/aqpkg/utils.h
@@ -1,39 +1,51 @@
1/*************************************************************************** 1/*
2 utils.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Sat Sep 7 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
8 27
9/*************************************************************************** 28*/
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 29
18#ifndef UTILS_H 30#ifndef UTILS_H
19#define UTILS_H 31#define UTILS_H
20 32
21#include <qstring.h> 33#include <qstring.h>
22 34
23/** 35/**
24 *@author Andy Qua 36 *@author Andy Qua
25 */ 37 */
26 38
27class Utils { 39class Utils {
28public: 40public:
29 Utils(); 41 Utils();
30 ~Utils(); 42 ~Utils();
31 43
32 static QString getPathfromIpkFilename( const QString &file ); 44 static QString getPathfromIpkFilename( const QString &file );
33 static QString getFilenameFromIpkFilename( const QString &file ); 45 static QString getFilenameFromIpkFilename( const QString &file );
34 static QString getPackageNameFromIpkFilename( const QString &file ); 46 static QString getPackageNameFromIpkFilename( const QString &file );
35 static QString getPackageVersionFromIpkFilename( const QString &file ); 47 static QString getPackageVersionFromIpkFilename( const QString &file );
36 static bool getStorageSpace( const char *path, long *blockSize, long *totalBlocks, long *availBlocks ); 48 static bool getStorageSpace( const char *path, long *blockSize, long *totalBlocks, long *availBlocks );
37}; 49};
38 50
39#endif 51#endif