-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 19 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 22 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 2 |
4 files changed, 17 insertions, 27 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index a23c900..1c56aae 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -249,24 +249,25 @@ MainWindow::~MainWindow() | |||
249 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 249 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
250 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 250 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
251 | 251 | ||
252 | } | 252 | } |
253 | 253 | ||
254 | void MainWindow::runIpkg() | 254 | void MainWindow::runIpkg() |
255 | { | 255 | { |
256 | packageListServers.allPackages(); | 256 | packageListServers.allPackages(); |
257 | ipkg->loadList( &packageListSearch ); | 257 | ipkg->loadList( &packageListSearch ); |
258 | ipkg->loadList( &packageListDocLnk ); | 258 | ipkg->loadList( &packageListDocLnk ); |
259 | ipkg->loadList( &packageListServers ); | 259 | ipkg->loadList( &packageListServers ); |
260 | ipkg->commit(); | 260 | ipkg->commit(); |
261 | ipkg->clearLists(); | ||
261 | // ##### If we looked in the list of files, we could send out accurate | 262 | // ##### If we looked in the list of files, we could send out accurate |
262 | // ##### messages. But we don't bother yet, and just do an "all". | 263 | // ##### messages. But we don't bother yet, and just do an "all". |
263 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 264 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
264 | QString lf = QString::null; | 265 | QString lf = QString::null; |
265 | e << lf; | 266 | e << lf; |
266 | displayList(); | 267 | displayList(); |
267 | } | 268 | } |
268 | 269 | ||
269 | void MainWindow::updateList() | 270 | void MainWindow::updateList() |
270 | { | 271 | { |
271 | //wait->show(); | 272 | //wait->show(); |
272 | QTimer *t = new QTimer( this ); | 273 | QTimer *t = new QTimer( this ); |
@@ -411,47 +412,33 @@ void MainWindow::rotateUpdateIcon() | |||
411 | { | 412 | { |
412 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | 413 | pvDebug(2, "MainWindow::rotateUpdateIcon"); |
413 | if ( updateIcon ) | 414 | if ( updateIcon ) |
414 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | 415 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); |
415 | else | 416 | else |
416 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | 417 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); |
417 | updateIcon = !updateIcon; | 418 | updateIcon = !updateIcon; |
418 | } | 419 | } |
419 | 420 | ||
420 | 421 | ||
421 | void MainWindow::setDocument(const QString &fileName) | 422 | void MainWindow::setDocument(const QString &fileName) |
422 | { | 423 | { |
423 | installFile(fileName); | ||
424 | // ##### If we looked in the list of files, we could send out accurate | ||
425 | // ##### messages. But we don't bother yet, and just do an "all". | ||
426 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | ||
427 | QString lf = QString::null; | ||
428 | e << lf; | ||
429 | // displayList(); | ||
430 | exit; | ||
431 | } | ||
432 | |||
433 | void MainWindow::installFile(const QString &fileName) | ||
434 | { | ||
435 | pvDebug(3, "MainWindow::installFile "+fileName); | ||
436 | if ( !QFile::exists( fileName ) ) return; | 424 | if ( !QFile::exists( fileName ) ) return; |
437 | ipkg->installFile( fileName ); | 425 | ipkg->installFile( fileName ); |
438 | // ##### If we looked in the list of files, we could send out accurate | ||
439 | // ##### messages. But we don't bother yet, and just do an "all". | ||
440 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 426 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
441 | QString lf = QString::null; | 427 | QString lf = QString::null; |
442 | e << lf; | 428 | e << lf; |
443 | displayList(); | 429 | exit; |
444 | } | 430 | } |
445 | 431 | ||
432 | |||
446 | void MainWindow::makeChannel() | 433 | void MainWindow::makeChannel() |
447 | { | 434 | { |
448 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | 435 | channel = new QCopChannel( "QPE/Application/oipkg", this ); |
449 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 436 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
450 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 437 | this, SLOT(receive(const QCString&, const QByteArray&)) ); |
451 | } | 438 | } |
452 | 439 | ||
453 | 440 | ||
454 | 441 | ||
455 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | 442 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) |
456 | { | 443 | { |
457 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); | 444 | pvDebug(3, "QCop "+msg+" "+QCString(arg)); |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 7c93dad..ce3e761 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -55,25 +55,24 @@ public slots: | |||
55 | void destShow(bool); | 55 | void destShow(bool); |
56 | void filterList(); | 56 | void filterList(); |
57 | void createLinks(); | 57 | void createLinks(); |
58 | void removeLinks(); | 58 | void removeLinks(); |
59 | void receive (const QCString &, const QByteArray &); | 59 | void receive (const QCString &, const QByteArray &); |
60 | void setDocument (const QString &); | 60 | void setDocument (const QString &); |
61 | void remotePackageQuery(); | 61 | void remotePackageQuery(); |
62 | 62 | ||
63 | private: | 63 | private: |
64 | void makeMenu(); | 64 | void makeMenu(); |
65 | void setSections(); | 65 | void setSections(); |
66 | void setSubSections(); | 66 | void setSubSections(); |
67 | void installFile(const QString &); | ||
68 | bool updateIcon; | 67 | bool updateIcon; |
69 | 68 | ||
70 | PmIpkg* ipkg; | 69 | PmIpkg* ipkg; |
71 | PackageManagerSettings *settings; | 70 | PackageManagerSettings *settings; |
72 | PackageListLocal packageListServers; | 71 | PackageListLocal packageListServers; |
73 | PackageListRemote packageListSearch; | 72 | PackageListRemote packageListSearch; |
74 | PackageListDocLnk packageListDocLnk; | 73 | PackageListDocLnk packageListDocLnk; |
75 | PackageListView *listViewPackages; | 74 | PackageListView *listViewPackages; |
76 | QAction *runAction; | 75 | QAction *runAction; |
77 | QAction *updateAction; | 76 | QAction *updateAction; |
78 | QAction *findAction; | 77 | QAction *findAction; |
79 | QPEToolBar *findBar; | 78 | QPEToolBar *findBar; |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 0401a5b..30777c2 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -232,24 +232,25 @@ void PmIpkg::commit() | |||
232 | } | 232 | } |
233 | runwindow->progress->setTotalSteps(sizecount); | 233 | runwindow->progress->setTotalSteps(sizecount); |
234 | qDebug("Install size %i",sizecount); | 234 | qDebug("Install size %i",sizecount); |
235 | installDialog->showMaximized(); | 235 | installDialog->showMaximized(); |
236 | installDialog->show(); | 236 | installDialog->show(); |
237 | if ( installDialog->exec() ) | 237 | if ( installDialog->exec() ) |
238 | { | 238 | { |
239 | doIt(); | 239 | doIt(); |
240 | runwindow->showMaximized(); | 240 | runwindow->showMaximized(); |
241 | runwindow->show(); | 241 | runwindow->show(); |
242 | } | 242 | } |
243 | installDialog->close(); | 243 | installDialog->close(); |
244 | delete installDialog; | ||
244 | out(tr("\nAll done.")); | 245 | out(tr("\nAll done.")); |
245 | } | 246 | } |
246 | 247 | ||
247 | void PmIpkg::doIt() | 248 | void PmIpkg::doIt() |
248 | { | 249 | { |
249 | runwindow->progress->setProgress(0); | 250 | runwindow->progress->setProgress(0); |
250 | show(); | 251 | show(); |
251 | remove(); | 252 | remove(); |
252 | install(); | 253 | install(); |
253 | } | 254 | } |
254 | 255 | ||
255 | 256 | ||
@@ -259,33 +260,33 @@ void PmIpkg::remove() | |||
259 | 260 | ||
260 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); | 261 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); |
261 | 262 | ||
262 | QStringList *fileList; | 263 | QStringList *fileList; |
263 | for (uint i=0; i < to_remove.count(); i++) | 264 | for (uint i=0; i < to_remove.count(); i++) |
264 | { | 265 | { |
265 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); | 266 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); |
266 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) | 267 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) |
267 | { | 268 | { |
268 | runwindow->progress->setProgress( 1 ); | 269 | runwindow->progress->setProgress( 1 ); |
269 | linkOpp = removeLink; | 270 | linkOpp = removeLink; |
270 | to_remove.at(i)->processed(); | 271 | to_remove.at(i)->processed(); |
271 | pvDebug(4,"link "+QString::number(i)); | 272 | pvDebug(3,"link "+QString::number(i)); |
272 | if ( to_remove.at(i)->link() ) | 273 | if ( to_remove.at(i)->link() ) |
273 | processFileList( fileList, to_remove.at(i)->dest() ); | 274 | processFileList( fileList, to_remove.at(i)->dest() ); |
274 | pvDebug(4,"take "+QString::number(i)); | 275 | //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); |
275 | to_remove.take( i ); | 276 | //if ( to_remove.at(i) ) to_remove.take( i ); |
276 | 277 | ||
277 | out("\n"); | 278 | out("\n"); |
278 | }else{ | 279 | }else{ |
279 | out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); | 280 | out(tr("Error while removing ")+to_remove.at(i)->name()+"\n"); |
280 | if ( to_remove.at(i)->link() ) | 281 | if ( to_remove.at(i)->link() ) |
281 | processFileList( fileList, to_remove.at(i)->dest() ); | 282 | processFileList( fileList, to_remove.at(i)->dest() ); |
282 | } | 283 | } |
283 | if ( to_remove.at(i)->link() ) | 284 | if ( to_remove.at(i)->link() ) |
284 | processFileList( fileList, to_remove.at(i)->dest() ); | 285 | processFileList( fileList, to_remove.at(i)->dest() ); |
285 | if ( to_remove.at(i)->link() )delete fileList; | 286 | if ( to_remove.at(i)->link() )delete fileList; |
286 | } | 287 | } |
287 | to_remove.clear(); | 288 | to_remove.clear(); |
288 | out("\n"); | 289 | out("\n"); |
289 | } | 290 | } |
290 | 291 | ||
291 | 292 | ||
@@ -294,25 +295,25 @@ void PmIpkg::install() | |||
294 | if ( to_install.count() == 0 ) return; | 295 | if ( to_install.count() == 0 ) return; |
295 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); | 296 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); |
296 | for (uint i=0; i < to_install.count(); i++) | 297 | for (uint i=0; i < to_install.count(); i++) |
297 | { | 298 | { |
298 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug | 299 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug |
299 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) | 300 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) |
300 | { | 301 | { |
301 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); | 302 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); |
302 | to_install.at(i)->processed(); | 303 | to_install.at(i)->processed(); |
303 | linkOpp = createLink; | 304 | linkOpp = createLink; |
304 | if ( to_install.at(i)->link() ) | 305 | if ( to_install.at(i)->link() ) |
305 | makeLinks( to_install.at(i) ); | 306 | makeLinks( to_install.at(i) ); |
306 | to_install.take( i ); | 307 | // to_install.take( i ); |
307 | out("\n"); | 308 | out("\n"); |
308 | }else{ | 309 | }else{ |
309 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); | 310 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); |
310 | linkOpp = createLink; | 311 | linkOpp = createLink; |
311 | if ( to_install.at(i)->link() ) | 312 | if ( to_install.at(i)->link() ) |
312 | makeLinks( to_install.at(i) ); | 313 | makeLinks( to_install.at(i) ); |
313 | } | 314 | } |
314 | } | 315 | } |
315 | out("\n"); | 316 | out("\n"); |
316 | to_install.clear(); | 317 | to_install.clear(); |
317 | } | 318 | } |
318 | 319 | ||
@@ -351,29 +352,24 @@ void PmIpkg::out( QString o ) | |||
351 | 352 | ||
352 | 353 | ||
353 | 354 | ||
354 | 355 | ||
355 | void PmIpkg::show() | 356 | void PmIpkg::show() |
356 | { | 357 | { |
357 | if (!runwindow->isVisible()) | 358 | if (!runwindow->isVisible()) |
358 | { | 359 | { |
359 | runwindow->showMaximized(); | 360 | runwindow->showMaximized(); |
360 | runwindow->show(); | 361 | runwindow->show(); |
361 | } | 362 | } |
362 | runwindow->outPut->setText(""); | 363 | runwindow->outPut->setText(""); |
363 | //showButtons(b); | ||
364 | //if ( !b ) | ||
365 | // runwindow->progress->hide(); | ||
366 | // else | ||
367 | // runwindow->progress->show(); | ||
368 | } | 364 | } |
369 | 365 | ||
370 | void PmIpkg::installFile(const QString &fileName, const QString &dest) | 366 | void PmIpkg::installFile(const QString &fileName, const QString &dest) |
371 | { | 367 | { |
372 | 368 | ||
373 | to_install.clear(); | 369 | to_install.clear(); |
374 | to_remove.clear(); | 370 | to_remove.clear(); |
375 | pvDebug( 2,"PmIpkg::installFile "+ fileName); | 371 | pvDebug( 2,"PmIpkg::installFile "+ fileName); |
376 | Package *p = new Package(fileName,settings); | 372 | Package *p = new Package(fileName,settings); |
377 | if ( dest!="") p->setDest( dest ); | 373 | if ( dest!="") p->setDest( dest ); |
378 | to_install.append( p ); | 374 | to_install.append( p ); |
379 | commit(); | 375 | commit(); |
@@ -384,12 +380,18 @@ void PmIpkg::removeFile(const QString &fileName, const QString &dest) | |||
384 | { | 380 | { |
385 | 381 | ||
386 | to_install.clear(); | 382 | to_install.clear(); |
387 | to_remove.clear(); | 383 | to_remove.clear(); |
388 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); | 384 | pvDebug( 2,"PmIpkg::removeFile "+ fileName); |
389 | Package *p = new Package(fileName,settings); | 385 | Package *p = new Package(fileName,settings); |
390 | if ( dest!="") p->setDest( dest ); | 386 | if ( dest!="") p->setDest( dest ); |
391 | to_remove.append( p ); | 387 | to_remove.append( p ); |
392 | commit(); | 388 | commit(); |
393 | delete p; | 389 | delete p; |
394 | } | 390 | } |
395 | 391 | ||
392 | |||
393 | void PmIpkg::clearLists() | ||
394 | { | ||
395 | to_remove.clear(); | ||
396 | to_install.clear(); | ||
397 | } | ||
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index c543304..d53a74d 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -19,24 +19,26 @@ class Package; | |||
19 | class PmIpkg : public QObject | 19 | class PmIpkg : public QObject |
20 | { | 20 | { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | public: | 22 | public: |
23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
24 | ~PmIpkg(); | 24 | ~PmIpkg(); |
25 | 25 | ||
26 | int linkOpp; | 26 | int linkOpp; |
27 | void loadList( PackageList* ); | 27 | void loadList( PackageList* ); |
28 | void commit(); | 28 | void commit(); |
29 | void update(); | 29 | void update(); |
30 | void show(); | 30 | void show(); |
31 | /** No descriptions */ | ||
32 | void clearLists(); | ||
31 | 33 | ||
32 | public slots: | 34 | public slots: |
33 | void doIt(); | 35 | void doIt(); |
34 | void install(); | 36 | void install(); |
35 | void remove(); | 37 | void remove(); |
36 | void installFile(const QString &fileName, const QString &dest=""); | 38 | void installFile(const QString &fileName, const QString &dest=""); |
37 | void removeFile(const QString &fileName, const QString &dest=""); | 39 | void removeFile(const QString &fileName, const QString &dest=""); |
38 | void createLinks( const QString &dest ); | 40 | void createLinks( const QString &dest ); |
39 | void removeLinks( const QString &dest ); | 41 | void removeLinks( const QString &dest ); |
40 | 42 | ||
41 | private: | 43 | private: |
42 | PackageManagerSettings* settings; | 44 | PackageManagerSettings* settings; |