summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-22 18:00:55 (UTC)
committer andyq <andyq>2002-10-22 18:00:55 (UTC)
commitd7cca919f20d602bd755b7690c25e31f6e9520b1 (patch) (unidiff)
treeb5ffe24d905ace7563c21be0eea06b39402430aa
parent6843a1bd8f8e679c220431f8377abcd2ffd2019b (diff)
downloadopie-d7cca919f20d602bd755b7690c25e31f6e9520b1.zip
opie-d7cca919f20d602bd755b7690c25e31f6e9520b1.tar.gz
opie-d7cca919f20d602bd755b7690c25e31f6e9520b1.tar.bz2
Changed so that refreshing server packages shows status dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp58
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.h4
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp5
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp23
4 files changed, 46 insertions, 44 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index e122064..a924daf 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -68,169 +68,169 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *d
68 if ( dit->getDestinationName() == defaultDest ) 68 if ( dit->getDestinationName() == defaultDest )
69 defIndex = i; 69 defIndex = i;
70 } 70 }
71 71
72 destination->setCurrentItem( defIndex ); 72 destination->setCurrentItem( defIndex );
73 73
74 vector<InstallData>::iterator it; 74 vector<InstallData>::iterator it;
75 // setup package data 75 // setup package data
76 QString remove = "Remove\n"; 76 QString remove = "Remove\n";
77 QString install = "\nInstall\n"; 77 QString install = "\nInstall\n";
78 QString upgrade = "\nUpgrade\n"; 78 QString upgrade = "\nUpgrade\n";
79 for ( it = packageList.begin() ; it != packageList.end() ; ++it ) 79 for ( it = packageList.begin() ; it != packageList.end() ; ++it )
80 { 80 {
81 InstallData item = *it; 81 InstallData item = *it;
82 if ( item.option == "I" ) 82 if ( item.option == "I" )
83 { 83 {
84 installList.push_back( item ); 84 installList.push_back( item );
85 install += " " + item.packageName + "\n"; 85 install += " " + item.packageName + "\n";
86 } 86 }
87 else if ( item.option == "D" ) 87 else if ( item.option == "D" )
88 { 88 {
89 removeList.push_back( item ); 89 removeList.push_back( item );
90 remove += " " + item.packageName + "\n"; 90 remove += " " + item.packageName + "\n";
91 } 91 }
92 else if ( item.option == "U" ) 92 else if ( item.option == "U" )
93 { 93 {
94 updateList.push_back( item ); 94 updateList.push_back( item );
95 upgrade += " " + item.packageName + "\n"; 95 upgrade += " " + item.packageName + "\n";
96 } 96 }
97 } 97 }
98 98
99 output->setText( remove + install + upgrade ); 99 output->setText( remove + install + upgrade );
100
101 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
102} 100}
103 101
104InstallDlgImpl::InstallDlgImpl( QWidget *parent, const char *name, bool modal, WFlags fl ) 102InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl )
105 : InstallDlg( parent, name, modal, fl ) 103 : InstallDlg( parent, name, modal, fl )
106{ 104{
107 upgradePackages = true; 105 pIpkg = ipkg;
108 output->setText( "Upgrading installed packages" ); 106 output->setText( initialText );
109 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
110} 107}
111 108
112 109
113InstallDlgImpl::~InstallDlgImpl() 110InstallDlgImpl::~InstallDlgImpl()
114{ 111{
115} 112}
116 113
117bool InstallDlgImpl :: showDlg() 114bool InstallDlgImpl :: showDlg()
118{ 115{
119 showMaximized(); 116 showMaximized();
120 bool ret = exec(); 117 bool ret = exec();
121 118
122 return ret; 119 return ret;
123} 120}
124 121
125void InstallDlgImpl :: optionsSelected() 122void InstallDlgImpl :: optionsSelected()
126{ 123{
127 InstallOptionsDlgImpl opt( flags, this, "Option", true ); 124 InstallOptionsDlgImpl opt( flags, this, "Option", true );
128 opt.exec(); 125 opt.exec();
129 126
130 // set options selected from dialog 127 // set options selected from dialog
131 flags = 0; 128 flags = 0;
132 if ( opt.forceDepends->isChecked() ) 129 if ( opt.forceDepends->isChecked() )
133 flags |= FORCE_DEPENDS; 130 flags |= FORCE_DEPENDS;
134 if ( opt.forceReinstall->isChecked() ) 131 if ( opt.forceReinstall->isChecked() )
135 flags |= FORCE_REINSTALL; 132 flags |= FORCE_REINSTALL;
136 if ( opt.forceRemove->isChecked() ) 133 if ( opt.forceRemove->isChecked() )
137 flags |= FORCE_REMOVE; 134 flags |= FORCE_REMOVE;
138 if ( opt.forceOverwrite->isChecked() ) 135 if ( opt.forceOverwrite->isChecked() )
139 flags |= FORCE_OVERWRITE; 136 flags |= FORCE_OVERWRITE;
140 137
141#ifdef QWS 138#ifdef QWS
142 Config cfg( "aqpkg" ); 139 Config cfg( "aqpkg" );
143 cfg.setGroup( "settings" ); 140 cfg.setGroup( "settings" );
144 cfg.writeEntry( "installFlags", flags ); 141 cfg.writeEntry( "installFlags", flags );
145#endif 142#endif
146} 143}
147 144
148void InstallDlgImpl :: installSelected() 145void InstallDlgImpl :: installSelected()
149{ 146{
150 if ( btnInstall->text() == "Close" ) 147 if ( btnInstall->text() == "Close" )
151 { 148 {
152 done( 1 ); 149 done( 1 );
153 return; 150 return;
154 } 151 }
155 152
156 btnInstall->setEnabled( false ); 153 btnInstall->setEnabled( false );
157 154
158 if ( upgradePackages ) 155 if ( pIpkg )
159 { 156 {
160 output->setText( "" ); 157 output->setText( "" );
161 158
162 Ipkg ipkg; 159 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
163 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 160 pIpkg->runIpkg();
164 ipkg.setOption( "upgrade" );
165 ipkg.runIpkg();
166 } 161 }
167 else 162 else
168 { 163 {
169 output->setText( "" ); 164 output->setText( "" );
170 Destination *d = dataMgr->getDestination( destination->currentText() ); 165 Destination *d = dataMgr->getDestination( destination->currentText() );
171 QString dest = d->getDestinationName(); 166 QString dest = d->getDestinationName();
172 QString destDir = d->getDestinationPath(); 167 QString destDir = d->getDestinationPath();
173 int instFlags = flags; 168 int instFlags = flags;
174 if ( d->linkToRoot() ) 169 if ( d->linkToRoot() )
175 instFlags |= MAKE_LINKS; 170 instFlags |= MAKE_LINKS;
176 171
177#ifdef QWS 172#ifdef QWS
178 // Save settings 173 // Save settings
179 Config cfg( "aqpkg" ); 174 Config cfg( "aqpkg" );
180 cfg.setGroup( "settings" ); 175 cfg.setGroup( "settings" );
181 cfg.writeEntry( "dest", dest ); 176 cfg.writeEntry( "dest", dest );
182#endif 177#endif
183 178
179 pIpkg = new Ipkg;
180 connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &)));
181
184 // First run through the remove list, then the install list then the upgrade list 182 // First run through the remove list, then the install list then the upgrade list
185 vector<InstallData>::iterator it; 183 vector<InstallData>::iterator it;
186 ipkg.setOption( "remove" ); 184 pIpkg->setOption( "remove" );
187 for ( it = removeList.begin() ; it != removeList.end() ; ++it ) 185 for ( it = removeList.begin() ; it != removeList.end() ; ++it )
188 { 186 {
189 ipkg.setDestination( it->destination->getDestinationName() ); 187 pIpkg->setDestination( it->destination->getDestinationName() );
190 ipkg.setDestinationDir( it->destination->getDestinationPath() ); 188 pIpkg->setDestinationDir( it->destination->getDestinationPath() );
191 ipkg.setPackage( it->packageName ); 189 pIpkg->setPackage( it->packageName );
192 190
193 int tmpFlags = flags; 191 int tmpFlags = flags;
194 if ( it->destination->linkToRoot() ) 192 if ( it->destination->linkToRoot() )
195 tmpFlags |= MAKE_LINKS; 193 tmpFlags |= MAKE_LINKS;
196 194
197 ipkg.setFlags( tmpFlags ); 195 pIpkg->setFlags( tmpFlags );
198 ipkg.runIpkg(); 196 pIpkg->runIpkg();
199 } 197 }
200 198
201 ipkg.setOption( "install" ); 199 pIpkg->setOption( "install" );
202 ipkg.setDestination( dest ); 200 pIpkg->setDestination( dest );
203 ipkg.setDestinationDir( destDir ); 201 pIpkg->setDestinationDir( destDir );
204 ipkg.setFlags( instFlags ); 202 pIpkg->setFlags( instFlags );
205 for ( it = installList.begin() ; it != installList.end() ; ++it ) 203 for ( it = installList.begin() ; it != installList.end() ; ++it )
206 { 204 {
207 ipkg.setPackage( it->packageName ); 205 pIpkg->setPackage( it->packageName );
208 ipkg.runIpkg(); 206 pIpkg->runIpkg();
209 } 207 }
210 208
211 flags |= FORCE_REINSTALL; 209 flags |= FORCE_REINSTALL;
212 ipkg.setOption( "reinstall" ); 210 pIpkg->setOption( "reinstall" );
213 for ( it = updateList.begin() ; it != updateList.end() ; ++it ) 211 for ( it = updateList.begin() ; it != updateList.end() ; ++it )
214 { 212 {
215 ipkg.setDestination( it->destination->getDestinationName() ); 213 pIpkg->setDestination( it->destination->getDestinationName() );
216 ipkg.setDestinationDir( it->destination->getDestinationPath() ); 214 pIpkg->setDestinationDir( it->destination->getDestinationPath() );
217 ipkg.setPackage( it->packageName ); 215 pIpkg->setPackage( it->packageName );
218 216
219 int tmpFlags = flags; 217 int tmpFlags = flags;
220 if ( it->destination->linkToRoot() && it->recreateLinks ) 218 if ( it->destination->linkToRoot() && it->recreateLinks )
221 tmpFlags |= MAKE_LINKS; 219 tmpFlags |= MAKE_LINKS;
222 ipkg.setFlags( tmpFlags ); 220 pIpkg->setFlags( tmpFlags );
223 ipkg.runIpkg(); 221 pIpkg->runIpkg();
224 } 222 }
223
224 delete pIpkg;
225 } 225 }
226 226
227 btnInstall->setEnabled( true ); 227 btnInstall->setEnabled( true );
228 btnInstall->setText( tr( "Close" ) ); 228 btnInstall->setText( tr( "Close" ) );
229} 229}
230 230
231void InstallDlgImpl :: displayText(const QString &text ) 231void InstallDlgImpl :: displayText(const QString &text )
232{ 232{
233 QString t = output->text() + "\n" + text; 233 QString t = output->text() + "\n" + text;
234 output->setText( t ); 234 output->setText( t );
235 output->setCursorPosition( output->numLines(), 0 ); 235 output->setCursorPosition( output->numLines(), 0 );
236} 236}
diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h
index 3a5d8b8..6716ced 100644
--- a/noncore/settings/aqpkg/installdlgimpl.h
+++ b/noncore/settings/aqpkg/installdlgimpl.h
@@ -9,57 +9,57 @@
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#ifndef INSTALLDLGIMPL_H 17#ifndef INSTALLDLGIMPL_H
18#define INSTALLDLGIMPL_H 18#define INSTALLDLGIMPL_H
19 19
20#include <vector> 20#include <vector>
21using namespace std; 21using namespace std;
22 22
23#include <qstring.h> 23#include <qstring.h>
24 24
25#include "ipkg.h" 25#include "ipkg.h"
26#include "install.h" 26#include "install.h"
27 27
28class InstallData 28class InstallData
29{ 29{
30public: 30public:
31 QString option; // I - install, D - delete, U - upgrade 31 QString option; // I - install, D - delete, U - upgrade
32 QString packageName; 32 QString packageName;
33 Destination *destination; 33 Destination *destination;
34 bool recreateLinks; 34 bool recreateLinks;
35}; 35};
36 36
37class InstallDlgImpl : public InstallDlg 37class InstallDlgImpl : public InstallDlg
38{ 38{
39public: 39public:
40 InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); 40 InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
41 InstallDlgImpl( QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); 41 InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
42 ~InstallDlgImpl(); 42 ~InstallDlgImpl();
43 43
44 bool showDlg(); 44 bool showDlg();
45 bool upgradeServer( QString &server ); 45 bool upgradeServer( QString &server );
46 46
47protected: 47protected:
48 48
49private: 49private:
50 DataManager *dataMgr; 50 DataManager *dataMgr;
51 vector<InstallData> installList; 51 vector<InstallData> installList;
52 vector<InstallData> removeList; 52 vector<InstallData> removeList;
53 vector<InstallData> updateList; 53 vector<InstallData> updateList;
54 int flags; 54 int flags;
55 Ipkg ipkg; 55 Ipkg *pIpkg;
56 bool upgradePackages; 56 bool upgradePackages;
57 57
58 bool runIpkg( QString &option, const QString& package, const QString& dest, int flags ); 58 bool runIpkg( QString &option, const QString& package, const QString& dest, int flags );
59 59
60 void optionsSelected(); 60 void optionsSelected();
61 void installSelected(); 61 void installSelected();
62 void displayText(const QString &text ); 62 void displayText(const QString &text );
63}; 63};
64 64
65#endif 65#endif
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 02d4258..eacef76 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -76,66 +76,67 @@ bool Ipkg :: runIpkg( )
76 cmd += " -force-reinstall"; 76 cmd += " -force-reinstall";
77 if ( flags & FORCE_REMOVE ) 77 if ( flags & FORCE_REMOVE )
78 cmd += " -force-removal-of-essential-packages"; 78 cmd += " -force-removal-of-essential-packages";
79 if ( flags & FORCE_OVERWRITE ) 79 if ( flags & FORCE_OVERWRITE )
80 cmd += " -force-overwrite"; 80 cmd += " -force-overwrite";
81 81
82 // Handle make links 82 // Handle make links
83 // Rules - If make links is switched on, create links to root 83 // Rules - If make links is switched on, create links to root
84 // if destDir is NOT / 84 // if destDir is NOT /
85 if ( flags & MAKE_LINKS ) 85 if ( flags & MAKE_LINKS )
86 { 86 {
87 // If destDir == / turn off make links as package is being insalled 87 // If destDir == / turn off make links as package is being insalled
88 // to root already. 88 // to root already.
89 if ( destDir == "/" ) 89 if ( destDir == "/" )
90 flags ^= MAKE_LINKS; 90 flags ^= MAKE_LINKS;
91 } 91 }
92 } 92 }
93 93
94#ifdef X86 94#ifdef X86
95 cmd += " -f "; 95 cmd += " -f ";
96 cmd += IPKG_CONF; 96 cmd += IPKG_CONF;
97#endif 97#endif
98 98
99 99
100 if ( option == "reinstall" ) 100 if ( option == "reinstall" )
101 cmd += " install"; 101 cmd += " install";
102 else 102 else
103 cmd += " " + option; 103 cmd += " " + option;
104 if ( option != "upgrade" ) 104 if ( option != "upgrade" )
105 cmd += " " + package; 105 cmd += " " + package;
106 cmd += " 2>&1"; 106 cmd += " 2>&1";
107 107
108 108
109 emit outputText( QString( "Dealing with package " ) + package ); 109 if ( package != "" )
110 emit outputText( QString( "Dealing with package " ) + package );
110 111
111 qApp->processEvents(); 112 qApp->processEvents();
112 113
113 // If we are removing packages and make links option is selected 114 // If we are removing packages and make links option is selected
114 // create the links 115 // create the links
115 if ( option == "remove" || option == "reinstall" ) 116 if ( option == "remove" || option == "reinstall" )
116 { 117 {
117 createLinks = false; 118 createLinks = false;
118 if ( flags & MAKE_LINKS ) 119 if ( flags & MAKE_LINKS )
119 { 120 {
120 emit outputText( QString( "Removing symbolic links...\n" ) ); 121 emit outputText( QString( "Removing symbolic links...\n" ) );
121 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); 122 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
122 emit outputText( QString( " " ) ); 123 emit outputText( QString( " " ) );
123 } 124 }
124 } 125 }
125 126
126 emit outputText( cmd ); 127 emit outputText( cmd );
127 128
128 // Execute command 129 // Execute command
129 dependantPackages = new QList<QString>; 130 dependantPackages = new QList<QString>;
130 dependantPackages->setAutoDelete( true ); 131 dependantPackages->setAutoDelete( true );
131 132
132 ret = executeIpkgCommand( cmd, option ); 133 ret = executeIpkgCommand( cmd, option );
133 134
134 if ( option == "install" || option == "reinstall" ) 135 if ( option == "install" || option == "reinstall" )
135 { 136 {
136 // If we are not removing packages and make links option is selected 137 // If we are not removing packages and make links option is selected
137 // create the links 138 // create the links
138 createLinks = true; 139 createLinks = true;
139 if ( flags & MAKE_LINKS ) 140 if ( flags & MAKE_LINKS )
140 { 141 {
141 emit outputText( " " ); 142 emit outputText( " " );
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 52d95a8..6874ded 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -239,106 +239,107 @@ void NetworkPackageManager :: serverSelected( int )
239 new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() ); 239 new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() );
240 } 240 }
241 packagesList->insertItem( item ); 241 packagesList->insertItem( item );
242 } 242 }
243 243
244 // If the local server or the local ipkgs server disable the download button 244 // If the local server or the local ipkgs server disable the download button
245 if ( serverName == LOCAL_SERVER ) 245 if ( serverName == LOCAL_SERVER )
246 { 246 {
247 upgrade->setEnabled( false ); 247 upgrade->setEnabled( false );
248 download->setText( "Download" ); 248 download->setText( "Download" );
249 download->setEnabled( false ); 249 download->setEnabled( false );
250 } 250 }
251 else if ( serverName == LOCAL_IPKGS ) 251 else if ( serverName == LOCAL_IPKGS )
252 { 252 {
253 upgrade->setEnabled( false ); 253 upgrade->setEnabled( false );
254 download->setEnabled( true ); 254 download->setEnabled( true );
255 download->setText( "Remove" ); 255 download->setText( "Remove" );
256 } 256 }
257 else 257 else
258 { 258 {
259 upgrade->setEnabled( true ); 259 upgrade->setEnabled( true );
260 download->setEnabled( true ); 260 download->setEnabled( true );
261 download->setText( "Download" ); 261 download->setText( "Download" );
262 } 262 }
263} 263}
264 264
265void NetworkPackageManager :: updateServer() 265void NetworkPackageManager :: updateServer()
266{ 266{
267 QString serverName = serversList->currentText(); 267 QString serverName = serversList->currentText();
268 268
269 // Update the current server 269 // Update the current server
270 // Display dialog 270 // Display dialog
271 ProgressDlg *dlg = new ProgressDlg( this ); 271// ProgressDlg *progDlg = new ProgressDlg( this );
272 QString status = "Updating package lists..."; 272// QString status = "Updating package lists...";
273 dlg->show(); 273// progDlg->show();
274 dlg->setText( status ); 274// progDlg->setText( status );
275 275
276 // Disable buttons to stop silly people clicking lots on them :) 276 // Disable buttons to stop silly people clicking lots on them :)
277 277
278 // First, write out ipkg_conf file so that ipkg can use it 278 // First, write out ipkg_conf file so that ipkg can use it
279 dataMgr->writeOutIpkgConf(); 279 dataMgr->writeOutIpkgConf();
280 280
281 QString option = "update";
282 QString dummy = "";
283 Ipkg ipkg; 281 Ipkg ipkg;
284 connect( &ipkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); 282 ipkg.setOption( "update" );
285 ipkg.setOption( option );
286 283
287 ipkg.runIpkg( ); 284 InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true );
285 dlg.showDlg();
288 286
289 // Reload data 287 // Reload data
290 dataMgr->reloadServerData( serversList->currentText() ); 288 dataMgr->reloadServerData( serversList->currentText() );
291 serverSelected(-1); 289 serverSelected(-1);
292 delete dlg; 290// delete progDlg;
293} 291}
294 292
295void NetworkPackageManager :: upgradePackages() 293void NetworkPackageManager :: upgradePackages()
296{ 294{
297 // We're gonna do an upgrade of all packages 295 // We're gonna do an upgrade of all packages
298 // First warn user that this isn't recommended 296 // First warn user that this isn't recommended
299 QString text = "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n"; 297 QString text = "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n";
300 QMessageBox warn("Warning", text, QMessageBox::Warning, 298 QMessageBox warn("Warning", text, QMessageBox::Warning,
301 QMessageBox::Yes, 299 QMessageBox::Yes,
302 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default , 300 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ,
303 0, this ); 301 0, this );
304 warn.adjustSize(); 302 warn.adjustSize();
305 303
306 if ( warn.exec() == QMessageBox::Yes ) 304 if ( warn.exec() == QMessageBox::Yes )
307 { 305 {
308 // First, write out ipkg_conf file so that ipkg can use it 306 // First, write out ipkg_conf file so that ipkg can use it
309 dataMgr->writeOutIpkgConf(); 307 dataMgr->writeOutIpkgConf();
310 308
311 // Now run upgrade 309 // Now run upgrade
312 InstallDlgImpl dlg( this, "Upgrade", true ); 310 Ipkg ipkg;
311 ipkg.setOption( "upgrade" );
312
313 InstallDlgImpl dlg( &ipkg, "Upgrading installed packages", this, "Upgrade", true );
313 dlg.showDlg(); 314 dlg.showDlg();
314 315
315 // Reload data 316 // Reload data
316 dataMgr->reloadServerData( LOCAL_SERVER ); 317 dataMgr->reloadServerData( LOCAL_SERVER );
317 318
318 dataMgr->reloadServerData( serversList->currentText() ); 319 dataMgr->reloadServerData( serversList->currentText() );
319 serverSelected(-1); 320 serverSelected(-1);
320 } 321 }
321} 322}
322 323
323 324
324void NetworkPackageManager :: downloadPackage() 325void NetworkPackageManager :: downloadPackage()
325{ 326{
326 if ( download->text() == "Download" ) 327 if ( download->text() == "Download" )
327 { 328 {
328 // First, write out ipkg_conf file so that ipkg can use it 329 // First, write out ipkg_conf file so that ipkg can use it
329 dataMgr->writeOutIpkgConf(); 330 dataMgr->writeOutIpkgConf();
330 331
331 // Display dialog to user asking where to download the files to 332 // Display dialog to user asking where to download the files to
332 bool ok = FALSE; 333 bool ok = FALSE;
333 QString dir = ""; 334 QString dir = "";
334#ifdef QWS 335#ifdef QWS
335 // read download directory from config file 336 // read download directory from config file
336 Config cfg( "aqpkg" ); 337 Config cfg( "aqpkg" );
337 cfg.setGroup( "settings" ); 338 cfg.setGroup( "settings" );
338 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" ); 339 dir = cfg.readEntry( "downloadDir", "/home/root/Documents/application/ipkg" );
339#endif 340#endif
340 341
341 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this ); 342 QString text = InputDialog::getText( tr( "Download to where" ), tr( "Enter path to download to" ), dir, &ok, this );
342 if ( ok && !text.isEmpty() ) 343 if ( ok && !text.isEmpty() )
343 dir = text; // user entered something and pressed ok 344 dir = text; // user entered something and pressed ok
344 else 345 else