author | tille <tille> | 2002-05-08 17:36:13 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-08 17:36:13 (UTC) |
commit | 4216d2833503440d25ee40683cd563f379f125a6 (patch) (unidiff) | |
tree | 54a7a5a88e0cb4ae0064197141717ebdd98d204d /noncore/unsupported | |
parent | 8a293a84b7119bab0b84b5241c665ff5892faffc (diff) | |
download | opie-4216d2833503440d25ee40683cd563f379f125a6.zip opie-4216d2833503440d25ee40683cd563f379f125a6.tar.gz opie-4216d2833503440d25ee40683cd563f379f125a6.tar.bz2 |
fixed runwindow open on cancel
-rw-r--r-- | noncore/unsupported/oipkg/installdialog.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/installdialog.h | 5 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 52 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 2 |
4 files changed, 34 insertions, 28 deletions
diff --git a/noncore/unsupported/oipkg/installdialog.cpp b/noncore/unsupported/oipkg/installdialog.cpp index 72f436a..a2c9702 100644 --- a/noncore/unsupported/oipkg/installdialog.cpp +++ b/noncore/unsupported/oipkg/installdialog.cpp | |||
@@ -68,12 +68,15 @@ InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const | |||
68 | _force_remove->setFont( _force_remove_font ); | 68 | _force_remove->setFont( _force_remove_font ); |
69 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); | 69 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); |
70 | 70 | ||
71 | GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 ); | 71 | GroupBoxOptionsLayout->addWidget( _force_remove, 2, 0 ); |
72 | 72 | ||
73 | InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 ); | 73 | InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 ); |
74 | toRemoveItem = new QCheckListItem( ListViewPackages, QObject::tr("To remove") ); | ||
75 | toInstallItem = new QCheckListItem( ListViewPackages, QObject::tr("To install") ); | ||
76 | |||
74 | } | 77 | } |
75 | 78 | ||
76 | /* | 79 | /* |
77 | * Destroys the object and frees any allocated resources | 80 | * Destroys the object and frees any allocated resources |
78 | */ | 81 | */ |
79 | InstallDialog::~InstallDialog() | 82 | InstallDialog::~InstallDialog() |
diff --git a/noncore/unsupported/oipkg/installdialog.h b/noncore/unsupported/oipkg/installdialog.h index f2164ac..5af2c35 100644 --- a/noncore/unsupported/oipkg/installdialog.h +++ b/noncore/unsupported/oipkg/installdialog.h | |||
@@ -22,21 +22,22 @@ class QListView; | |||
22 | class QListViewItem; | 22 | class QListViewItem; |
23 | 23 | ||
24 | class InstallDialog : public QDialog | 24 | class InstallDialog : public QDialog |
25 | { | 25 | { |
26 | Q_OBJECT | 26 | Q_OBJECT |
27 | 27 | ||
28 | public: | 28 | public: InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
29 | InstallDialog( PackageManagerSettings* s, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | ||
30 | ~InstallDialog(); | 29 | ~InstallDialog(); |
31 | 30 | ||
32 | PackageListView* ListViewPackages; | 31 | PackageListView* ListViewPackages; |
33 | QGroupBox* GroupBoxOptions; | 32 | QGroupBox* GroupBoxOptions; |
34 | QCheckBox* _force_depends; | 33 | QCheckBox* _force_depends; |
35 | QCheckBox* _force_reinstall; | 34 | QCheckBox* _force_reinstall; |
36 | QCheckBox* _force_remove; | 35 | QCheckBox* _force_remove; |
36 | QCheckListItem *toRemoveItem; | ||
37 | QCheckListItem *toInstallItem; | ||
37 | 38 | ||
38 | protected: | 39 | protected: |
39 | QGridLayout* InstallDialogLayout; | 40 | QGridLayout* InstallDialogLayout; |
40 | QGridLayout* GroupBoxOptionsLayout; | 41 | QGridLayout* GroupBoxOptionsLayout; |
41 | bool event( QEvent* ); | 42 | bool event( QEvent* ); |
42 | private: | 43 | private: |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 75f93cf..f2852c3 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -211,35 +211,36 @@ void PmIpkg::loadList( PackageList *pl ) | |||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | void PmIpkg::commit() | 214 | void PmIpkg::commit() |
215 | { | 215 | { |
216 | int sizecount = 0; | 216 | int sizecount = 0; |
217 | installDialog = new InstallDialog(settings,0,0,true); | 217 | installDialog = new InstallDialog(settings,0,0,true); |
218 | QCheckListItem *toRemoveItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); | 218 | installDialog->toRemoveItem->setOpen( true ); |
219 | QCheckListItem *toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); | 219 | installDialog->toInstallItem->setOpen( true ); |
220 | toRemoveItem->setOpen( true ); | ||
221 | toInstallItem->setOpen( true ); | ||
222 | for (uint i=0; i < to_remove.count(); i++) | 220 | for (uint i=0; i < to_remove.count(); i++) |
223 | { | 221 | { |
224 | sizecount += 1; | 222 | sizecount += 1; |
225 | toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); | 223 | installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); |
226 | } | 224 | } |
227 | for (uint i=0; i < to_install.count(); i++) | 225 | for (uint i=0; i < to_install.count(); i++) |
228 | { | 226 | { |
229 | sizecount += to_install.at(i)->size().toInt(); | 227 | sizecount += to_install.at(i)->size().toInt(); |
230 | toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); | 228 | installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); |
231 | } | 229 | } |
232 | runwindow->progress->setTotalSteps(sizecount); | 230 | runwindow->progress->setTotalSteps(sizecount); |
233 | qDebug("Install size %i",sizecount); | 231 | qDebug("Install size %i",sizecount); |
234 | installDialog->showMaximized(); | 232 | installDialog->showMaximized(); |
235 | installDialog->show(); | 233 | installDialog->show(); |
236 | if ( installDialog->exec() ) doIt(); | 234 | if ( installDialog->exec() ) |
235 | { | ||
236 | doIt(); | ||
237 | runwindow->showMaximized(); | ||
238 | runwindow->show(); | ||
239 | } | ||
237 | installDialog->close(); | 240 | installDialog->close(); |
238 | runwindow->showMaximized(); | ||
239 | runwindow->show(); | ||
240 | out(tr("\nAll done.")); | 241 | out(tr("\nAll done.")); |
241 | } | 242 | } |
242 | 243 | ||
243 | void PmIpkg::doIt() | 244 | void PmIpkg::doIt() |
244 | { | 245 | { |
245 | runwindow->progress->setProgress(0); | 246 | runwindow->progress->setProgress(0); |
@@ -256,28 +257,29 @@ void PmIpkg::remove() | |||
256 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); | 257 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); |
257 | 258 | ||
258 | QStringList *fileList; | 259 | QStringList *fileList; |
259 | for (uint i=0; i < to_remove.count(); i++) | 260 | for (uint i=0; i < to_remove.count(); i++) |
260 | { | 261 | { |
261 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); | 262 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); |
262 | if ( runIpkg("remove " + to_remove.at(i)->name(), to_remove.at(i)->dest() )) | 263 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) |
263 | { | 264 | { |
264 | runwindow->progress->setProgress( 1 ); | 265 | runwindow->progress->setProgress( 1 ); |
265 | linkOpp = removeLink; | 266 | linkOpp = removeLink; |
266 | if ( to_remove.at(i)->link() ) | ||
267 | { | ||
268 | out( "\nremoving links\n" ); | ||
269 | out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" ); | ||
270 | processFileList( fileList, to_remove.at(i)->dest() ); | ||
271 | } | ||
272 | to_remove.at(i)->processed(); | 267 | to_remove.at(i)->processed(); |
273 | to_remove.take( i ); | 268 | to_remove.take( i ); |
269 | |||
274 | out("\n\n"); | 270 | out("\n\n"); |
275 | }else{ | 271 | }else{ |
276 | out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); | 272 | out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); |
277 | } | 273 | } |
274 | if ( to_remove.at(i)->link() ) | ||
275 | { | ||
276 | out( "\nremoving links\n" ); | ||
277 | out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" ); | ||
278 | processFileList( fileList, to_remove.at(i)->dest() ); | ||
279 | } | ||
278 | if ( to_remove.at(i)->link() )delete fileList; | 280 | if ( to_remove.at(i)->link() )delete fileList; |
279 | } | 281 | } |
280 | to_remove.clear(); | 282 | to_remove.clear(); |
281 | out("\n"); | 283 | out("\n"); |
282 | } | 284 | } |
283 | 285 | ||
@@ -288,25 +290,25 @@ void PmIpkg::install() | |||
288 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); | 290 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); |
289 | for (uint i=0; i < to_install.count(); i++) | 291 | for (uint i=0; i < to_install.count(); i++) |
290 | { | 292 | { |
291 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) | 293 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) |
292 | { | 294 | { |
293 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); | 295 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); |
294 | linkOpp = createLink; | ||
295 | if ( to_install.at(i)->link() ) | ||
296 | { | ||
297 | out( "\ncreating links\n" ); | ||
298 | out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" ); | ||
299 | makeLinks( to_install.at(i) ); | ||
300 | } | ||
301 | to_install.at(i)->processed(); | 296 | to_install.at(i)->processed(); |
302 | to_install.take( i ); | 297 | to_install.take( i ); |
303 | out("\n\n"); | 298 | out("\n\n"); |
304 | }else{ | 299 | }else{ |
305 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); | 300 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); |
306 | } | 301 | } |
302 | linkOpp = createLink; | ||
303 | if ( to_install.at(i)->link() ) | ||
304 | { | ||
305 | out( "\ncreating links\n" ); | ||
306 | out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" ); | ||
307 | makeLinks( to_install.at(i) ); | ||
308 | } | ||
307 | } | 309 | } |
308 | out("\n"); | 310 | out("\n"); |
309 | to_install.clear(); | 311 | to_install.clear(); |
310 | } | 312 | } |
311 | 313 | ||
312 | void PmIpkg::createLinks( const QString &dest ) | 314 | void PmIpkg::createLinks( const QString &dest ) |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index f8ac39a..c543304 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -45,13 +45,13 @@ private: | |||
45 | QList<Package> to_remove; | 45 | QList<Package> to_remove; |
46 | QList<Package> to_install; | 46 | QList<Package> to_install; |
47 | QString fileNameToInstall; | 47 | QString fileNameToInstall; |
48 | QCheckBox *_force_reinstall; | 48 | QCheckBox *_force_reinstall; |
49 | QCheckBox *_force_remove; | 49 | QCheckBox *_force_remove; |
50 | QCheckBox *_force_depends; | 50 | QCheckBox *_force_depends; |
51 | void startDialog(); | 51 | // void startDialog(); |
52 | void makeLinks(Package*); | 52 | void makeLinks(Package*); |
53 | void linkPackage( QString, QString ); | 53 | void linkPackage( QString, QString ); |
54 | void processLinkDir( QString , QString ); | 54 | void processLinkDir( QString , QString ); |
55 | bool runIpkg(const QString& args, const QString& dest="" ); | 55 | bool runIpkg(const QString& args, const QString& dest="" ); |
56 | void out( QString ); | 56 | void out( QString ); |
57 | QStringList* getList( QString, QString ); | 57 | QStringList* getList( QString, QString ); |