summaryrefslogtreecommitdiff
authortille <tille>2002-04-26 00:50:30 (UTC)
committer tille <tille>2002-04-26 00:50:30 (UTC)
commita111f57eedcf27623e9bff2816c83d3287272aff (patch) (side-by-side diff)
treeb43ac41ffbdc741f731cf3f91aab064ba94ab0f3
parent5198d98daeaa1e8eb8568ccd3c516ab70fbed512 (diff)
downloadopie-a111f57eedcf27623e9bff2816c83d3287272aff.zip
opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.gz
opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.bz2
added support for scipt ipkg (again;)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp23
-rw-r--r--noncore/unsupported/oipkg/mainwindow.h4
-rw-r--r--noncore/unsupported/oipkg/pksettings.h1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp75
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h11
-rw-r--r--noncore/unsupported/oipkg/settings.h5
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
@@ -90,7 +90,7 @@ void MainWindow::makeMenu()
toolBar->setStretchableWidget( spacer );
- runAction = new QAction( tr( "Commit" ),
+ runAction = new QAction( tr( "Apply" ),
Resource::loadPixmap( "oipkg/install" ),
QString::null, 0, this, 0 );
connect( runAction, SIGNAL( activated() ),
@@ -171,10 +171,7 @@ void MainWindow::makeMenu()
findBar->setStretchableWidget( findEdit );
connect( findEdit, SIGNAL( textChanged( const QString & ) ),
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 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( findBar );
@@ -183,7 +180,6 @@ void MainWindow::makeMenu()
findAction->setToggleAction( true );
findAction->setOn( true );
findAction->addTo( viewMenu );
-
}
MainWindow::~MainWindow()
@@ -193,14 +189,18 @@ MainWindow::~MainWindow()
void MainWindow::runIpkg()
{
ipkg->commit( packageList );
- updateList(); //to remove
+// updateList(); //to remove
}
void MainWindow::updateList()
{
+ QTimer *t = new QTimer( this );
+ connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) );
+ t->start( 0, false );
packageList.clear();
ipkg->update();
getList();
+ t->stop();
}
void MainWindow::getList()
@@ -346,3 +346,12 @@ void MainWindow::findClose()
findAction->setOn( false );
}
+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
@@ -3,6 +3,7 @@
#include <qmainwindow.h>
#include <qaction.h>
+#include <qtimer.h>
#include <qpopupmenu.h>
#include "packagelist.h"
@@ -69,6 +70,9 @@ private:
QComboBox *section;
QComboBox *subsection;
QPopupMenu *popupMenu;
+ bool updateIcon;
+private slots:
+ void rotateUpdateIcon();
};
#endif
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
@@ -19,7 +19,6 @@ public:
bool createLinks();
QStringList getActiveServers();
QStringList getDestinationUrls();
-
private:
QIntDict<QString> serverurlDic;
QIntDict<QString> destinationurlDic;
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
@@ -43,6 +43,14 @@ PmIpkg::~PmIpkg()
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
QStringList cmd = "/usr/bin/ipkg ";
#endif
@@ -153,6 +161,9 @@ void PmIpkg::commit( PackageList pl )
runwindow->outPut->setText("");
out( "<h1>"+tr("Todo")+"</h1>\n");
+ to_install.clear();
+ to_remove.clear();
+ int sizecount = 0;
QString rem="<b>To remove:</b><br>\n";
QString inst="<b>To install:</b><br>\n";;
for( Package *pack = pl.first();pack ; (pack = pl.next()) )
@@ -161,12 +172,24 @@ void PmIpkg::commit( PackageList pl )
{
if ( pack->toInstall() )
{
+ #ifndef NEWLIST
to_install.append( pack->name() );
+ #endif
+ #ifdef NEWLIST
+ to_install.append( pack );
+ sizecount += pack->size().toInt();
+ #endif
inst += pack->name()+"<br>";
}
if ( pack->toRemove() )
{
+ #ifndef NEWLIST
to_remove.append( pack->name() );
+ #endif
+ #ifdef NEWLIST
+ to_remove.append( pack );
+ sizecount += 1;
+ #endif
rem += pack->name()+"<br>";
}
}
@@ -176,6 +199,8 @@ void PmIpkg::commit( PackageList pl )
qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count());
+ runwindow->progress->setTotalSteps( sizecount );
+
connect( runwindow->doItButton, SIGNAL( clicked() ),
SLOT( doIt() ) );
connect( runwindow->installButton, SIGNAL( clicked() ),
@@ -207,8 +232,10 @@ void PmIpkg::remove()
show( true );
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)
{
@@ -216,6 +243,20 @@ void PmIpkg::remove()
out("<b>"+tr("Error while removing")+"</b>"+*it);
}
}
+#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
}
@@ -223,19 +264,33 @@ void PmIpkg::install()
{
if ( to_install.count() == 0 ) return;
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)
{
if ( runIpkg("install " + *it) == 0 )
- {
+ {
if ( settings->createLinks() )
makeLinks( *it );
}else{
out("<b>"+tr("Error while installing")+"</b>"+*it);
}
}
-
+#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
}
void PmIpkg::linkDestination( const QString msg, const QByteArray dest )
@@ -290,8 +345,8 @@ void PmIpkg::show(bool b)
if (!runwindow->isVisible())
runwindow->showMaximized();
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
@@ -3,6 +3,7 @@
#include <qobject.h>
+#include <qlist.h>
#include <qstring.h>
#include <qwidget.h>
#include "pksettings.h"
@@ -10,8 +11,8 @@
#include "packagelist.h"
#include "debug.h"
-
-
+//#define NEWLIST
+class Package;
class PmIpkg : public QObject
{
Q_OBJECT
@@ -28,8 +29,14 @@ public:
private:
PackageManagerSettings* settings;
RunWindow *runwindow;
+#ifndef NEWLIST
QStringList to_remove;
QStringList to_install;
+#endif
+#ifdef NEWLIST
+ QList<Package> to_remove;
+ QList<Package> to_install;
+#endif
bool runwindowopen;
void makeLinks(QString);
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
@@ -5,7 +5,8 @@
#include <qintdict.h>
-class PackageManagerSettings : private PackageManagerSettingsBase
+class PackageManagerSettings : public PackageManagerSettingsBase
+//class PackageManagerSettings : private PackageManagerSettingsBase
{
// Q_OBJECT
public:
@@ -19,6 +20,8 @@ public:
bool createLinks();
QStringList getActiveServers();
QStringList getDestinationUrls();
+ /** No descriptions */
+ QComboBox getActiveDestinationCombo();
private:
QIntDict<QString> serverurlDic;