author | tille <tille> | 2002-04-26 00:50:30 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-26 00:50:30 (UTC) |
commit | a111f57eedcf27623e9bff2816c83d3287272aff (patch) (side-by-side diff) | |
tree | b43ac41ffbdc741f731cf3f91aab064ba94ab0f3 /noncore | |
parent | 5198d98daeaa1e8eb8568ccd3c516ab70fbed512 (diff) | |
download | opie-a111f57eedcf27623e9bff2816c83d3287272aff.zip opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.gz opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.bz2 |
added support for scipt ipkg (again;)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 23 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 75 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 11 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/settings.h | 5 |
6 files changed, 98 insertions, 21 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 54ee115..c803ca0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -92,3 +92,3 @@ void MainWindow::makeMenu() - runAction = new QAction( tr( "Commit" ), + runAction = new QAction( tr( "Apply" ), Resource::loadPixmap( "oipkg/install" ), @@ -173,6 +173,3 @@ void MainWindow::makeMenu() this, SLOT( displayList() ) ); -// a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); -// connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); -// a->addTo( findBar ); -// a->addTo( edit ); + a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); @@ -185,3 +182,2 @@ void MainWindow::makeMenu() findAction->addTo( viewMenu ); - } @@ -195,3 +191,3 @@ void MainWindow::runIpkg() ipkg->commit( packageList ); - updateList(); //to remove +// updateList(); //to remove } @@ -200,2 +196,5 @@ void MainWindow::updateList() { + QTimer *t = new QTimer( this ); + connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); + t->start( 0, false ); packageList.clear(); @@ -203,2 +202,3 @@ void MainWindow::updateList() getList(); + t->stop(); } @@ -348 +348,10 @@ void MainWindow::findClose() +void MainWindow::rotateUpdateIcon() +{ + pvDebug(2, "MainWindow::rotateUpdateIcon"); + if ( updateIcon ) + updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); + else + updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); + updateIcon = !updateIcon; +} diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 0c1e474..892d5e8 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h @@ -5,2 +5,3 @@ #include <qaction.h> +#include <qtimer.h> #include <qpopupmenu.h> @@ -71,2 +72,5 @@ private: QPopupMenu *popupMenu; + bool updateIcon; +private slots: + void rotateUpdateIcon(); }; diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index cda352a..2982f1c 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h @@ -21,3 +21,2 @@ public: QStringList getDestinationUrls(); - private: diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index b23b9ea..eae73ad 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -45,2 +45,10 @@ int PmIpkg::runIpkg(const QString& args) pvDebug(2,"PmIpkg::runIpkg "+args); + + //to make script ipkg happy + pvDebug(2, "cd "+settings->getDestinationUrl()+"/tmp/ipkg"); + if (!QDir::setCurrent(settings->getDestinationUrl()+"/tmp/ipkg")) + { + QDir instDir = QDir(settings->getDestinationUrl()+"/tmp/ipkg"); + instDir.mkdir(settings->getDestinationUrl()+"/tmp/ipkg"); + } #ifdef PROC @@ -155,2 +163,5 @@ void PmIpkg::commit( PackageList pl ) + to_install.clear(); + to_remove.clear(); + int sizecount = 0; QString rem="<b>To remove:</b><br>\n"; @@ -163,3 +174,9 @@ void PmIpkg::commit( PackageList pl ) { + #ifndef NEWLIST to_install.append( pack->name() ); + #endif + #ifdef NEWLIST + to_install.append( pack ); + sizecount += pack->size().toInt(); + #endif inst += pack->name()+"<br>"; @@ -168,3 +185,9 @@ void PmIpkg::commit( PackageList pl ) { + #ifndef NEWLIST to_remove.append( pack->name() ); + #endif + #ifdef NEWLIST + to_remove.append( pack ); + sizecount += 1; + #endif rem += pack->name()+"<br>"; @@ -178,2 +201,4 @@ void PmIpkg::commit( PackageList pl ) + runwindow->progress->setTotalSteps( sizecount ); + connect( runwindow->doItButton, SIGNAL( clicked() ), @@ -209,4 +234,6 @@ void PmIpkg::remove() out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); - for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) - { + + #ifndef NEWLIST + for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) + { if ( runIpkg("remove " + *it) == 0) @@ -218,2 +245,16 @@ void PmIpkg::remove() } +#endif + #ifdef NEWLIST + for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) + { + if ( runIpkg("remove " + it->name()) == 0) + { + runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); + it->processed(); + runwindow->progress->setProgress( 1 ); + }else{ + out("<b>"+tr("Error while removing")+"</b>"+it->name()); + } + } +#endif } @@ -225,4 +266,4 @@ void PmIpkg::install() show( true ); - out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"<b><br>"); - if ( to_install.count() ) + out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); + #ifndef NEWLIST for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) @@ -230,3 +271,3 @@ void PmIpkg::install() if ( runIpkg("install " + *it) == 0 ) - { + { if ( settings->createLinks() ) @@ -237,3 +278,17 @@ void PmIpkg::install() } - +#endif + #ifdef NEWLIST + for (Package *it=to_install.first(); it != 0; it=to_install.next() ) + { + if ( runIpkg("install " + it->name()) == 0 ) + { + runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); + if ( settings->createLinks() ) + makeLinks( it->name() ); + it->processed(); + }else{ + out("<b>"+tr("Error while installing")+"</b>"+it->name()); + } + } +#endif } @@ -292,6 +347,6 @@ void PmIpkg::show(bool b) showButtons(b); - if ( b ) - runwindow->progress->show(); - else - runwindow->progress->show(); +// if ( b ) + runwindow->progress->hide(); +// else +// runwindow->progress->show(); } diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 8718f49..2692017 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h @@ -5,2 +5,3 @@ #include <qobject.h> +#include <qlist.h> #include <qstring.h> @@ -12,4 +13,4 @@ - - +//#define NEWLIST +class Package; class PmIpkg : public QObject @@ -30,4 +31,10 @@ private: RunWindow *runwindow; +#ifndef NEWLIST QStringList to_remove; QStringList to_install; +#endif +#ifdef NEWLIST + QList<Package> to_remove; + QList<Package> to_install; +#endif bool runwindowopen; diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index d4b1072..5df522b 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h @@ -7,3 +7,4 @@ -class PackageManagerSettings : private PackageManagerSettingsBase +class PackageManagerSettings : public PackageManagerSettingsBase +//class PackageManagerSettings : private PackageManagerSettingsBase { @@ -21,2 +22,4 @@ public: QStringList getDestinationUrls(); + /** No descriptions */ + QComboBox getActiveDestinationCombo(); |