summaryrefslogtreecommitdiff
authortille <tille>2002-06-21 09:01:39 (UTC)
committer tille <tille>2002-06-21 09:01:39 (UTC)
commit0d5a0129ee055e0f077505b05caa942bf6ef6165 (patch) (side-by-side diff)
treec718cc805ae49c922a126192c7e98747c025b103
parent48847f165b3ee8d096871c1bde8748d18cfb0f43 (diff)
downloadopie-0d5a0129ee055e0f077505b05caa942bf6ef6165.zip
opie-0d5a0129ee055e0f077505b05caa942bf6ef6165.tar.gz
opie-0d5a0129ee055e0f077505b05caa942bf6ef6165.tar.bz2
some fixes and first version with oprocess (out-ifdefed)
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO13
-rw-r--r--noncore/unsupported/oipkg/installdialog.cpp4
-rw-r--r--noncore/unsupported/oipkg/main.cpp2
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp3
-rw-r--r--noncore/unsupported/oipkg/oipkg.pro1
-rw-r--r--noncore/unsupported/oipkg/package.cpp23
-rw-r--r--noncore/unsupported/oipkg/package.h15
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp10
-rw-r--r--noncore/unsupported/oipkg/packagelist.h8
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.cpp8
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.h4
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp2
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp6
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp1
-rw-r--r--noncore/unsupported/oipkg/pksettings.h2
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp72
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h10
-rw-r--r--noncore/unsupported/oipkg/settings.h2
18 files changed, 138 insertions, 48 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index e7b017c..6e0e6ca 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -1,5 +1,8 @@
-* check for networt before installing from network
-* Settings Class
-* parse "to install" and "to remove" from status
+* check for network before installing from network
+* Settings Class / new setting dialog
+* parse "to install" and "to remove" from status, and change status
+ i.e. improve status handling / modify status file
+ dest keyword in status? -> cworth
* install local file dialog
+* parse lists files after opening feed / doclnk
* qcop
@@ -13 +16,5 @@
* display new list after update
+* make sure oipkg installs to the correct dest when getting packet to install from list
+ dest keyword?
+* cancel button while installing
+* duplicate button for settings-servers
diff --git a/noncore/unsupported/oipkg/installdialog.cpp b/noncore/unsupported/oipkg/installdialog.cpp
index a2c9702..bb50103 100644
--- a/noncore/unsupported/oipkg/installdialog.cpp
+++ b/noncore/unsupported/oipkg/installdialog.cpp
@@ -73,4 +73,4 @@ InstallDialog::InstallDialog( PackageManagerSettings* s, QWidget* parent, const
InstallDialogLayout->addWidget( GroupBoxOptions, 1, 0 );
- toRemoveItem = new QCheckListItem( ListViewPackages, QObject::tr("To remove") );
- toInstallItem = new QCheckListItem( ListViewPackages, QObject::tr("To install") );
+ toRemoveItem = new QCheckListItem( ListViewPackages, tr("To remove") );
+ toInstallItem = new QCheckListItem( ListViewPackages, tr("To install") );
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp
index de25e27..f72540c 100644
--- a/noncore/unsupported/oipkg/main.cpp
+++ b/noncore/unsupported/oipkg/main.cpp
@@ -11,3 +11,3 @@ int main( int argc, char ** argv )
printf("This is oipkg\n");
- printf("$ID$\n");
+ printf("$Id$\n");
debugLevel = 2;
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 27c9f4c..11ab406 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -35,2 +35,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
QMainWindow( parent, name, f )
+// packageListServers( QObject(parent), name ),
+// packageListSearch( parent, name ),
+// packageListDocLnk( parent, name )
{
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro
index 9e2f5f8..7f60ed8 100644
--- a/noncore/unsupported/oipkg/oipkg.pro
+++ b/noncore/unsupported/oipkg/oipkg.pro
@@ -32,2 +32,3 @@ DEPENDPATH += $(OPIEDIR)/ioclude
LIBS += -lqpe
+LIBS += -lopie
INTERFACES = runwindow.ui \
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 4a09b40..97f7813 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -11,8 +11,16 @@
-//Package::~Package()
-//{
-//}
+Package::Package( QObject *parent=0, const char *name=0 )
+ : QObject(parent,name)
+{
+
+}
+
+Package::~Package()
+{
+}
-Package::Package( PackageManagerSettings *s )
+Package::Package( PackageManagerSettings *s, QObject *parent=0, const char *name=0 )
+ : QObject(parent,name)
{
+ Package(parent,name);
init(s);
@@ -39,3 +47,4 @@ void Package::init( PackageManagerSettings *s )
-Package::Package( QStringList pack, PackageManagerSettings *s )
+Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent=0, const char *name=0 )
+ : QObject(parent,name)
{
@@ -45,3 +54,3 @@ Package::Package( QStringList pack, PackageManagerSettings *s )
-Package::Package( QString n, PackageManagerSettings *s )
+Package::Package( QString n, PackageManagerSettings *s, QObject *parent=0, const char *name=0 )
{
@@ -59,3 +68,3 @@ Package::Package( QString n, PackageManagerSettings *s )
-Package::Package( Package *pi )
+Package::Package( Package *pi, QObject *parent=0, const char *name=0 )
{
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h
index 68090dc..f50b9b5 100644
--- a/noncore/unsupported/oipkg/package.h
+++ b/noncore/unsupported/oipkg/package.h
@@ -12,11 +12,12 @@
-class Package //: public QObject
+class Package : public QObject
{
-// Q_OBJECT
+ Q_OBJECT
public:
- Package(PackageManagerSettings *);
- // ~Package();
- Package( QStringList, PackageManagerSettings * );
- Package( QString, PackageManagerSettings * );
- Package( Package* );
+ Package(QObject *parent=0, const char *name=0);
+ Package(PackageManagerSettings *s, QObject *parent=0, const char *name=0);
+ ~Package();
+ Package( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
+ Package( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
+ Package( Package*s, QObject *parent=0, const char *name=0 );
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index 1b572e0..3cc0443 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -12,4 +12,4 @@ static int packageListAllRefCount = 0;
-PackageList::PackageList()
- : packageIter( packageList )
+PackageList::PackageList(QObject *parent=0, const char *name=0)
+ : QObject(parent,name), packageIter( packageList )
{
@@ -26,7 +26,7 @@ PackageList::PackageList()
-PackageList::PackageList( PackageManagerSettings* s)
- : packageIter( packageList )
+PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name)
+ : QObject(parent,name), packageIter( packageList )
{
settings = s;
- PackageList();
+ PackageList(parent, name);
}
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h
index d0f8897..78dcd92 100644
--- a/noncore/unsupported/oipkg/packagelist.h
+++ b/noncore/unsupported/oipkg/packagelist.h
@@ -8,5 +8,5 @@
-class PackageList //:QObject
+class PackageList :QObject
{
-// Q_OBJECT
+ Q_OBJECT
public:
@@ -14,4 +14,4 @@ public:
- PackageList();
- PackageList( PackageManagerSettings* );
+ PackageList (QObject *parent=0, const char *name=0);
+ PackageList( PackageManagerSettings *s, QObject *parent=0, const char *name=0);
virtual ~PackageList();
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
index f31f742..b42cfdd 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
@@ -10,10 +10,10 @@
-PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s)
+PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent=0, const char *name=0)
: PackageList(s)
{
- PackageListDocLnk();
+ PackageListDocLnk(parent, name);
}
-PackageListDocLnk::PackageListDocLnk()
- : PackageList()
+PackageListDocLnk::PackageListDocLnk(QObject *parent=0, const char *name=0)
+ : PackageList(parent, name)
{
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.h b/noncore/unsupported/oipkg/packagelistdoclnk.h
index fe73658..a63fb59 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.h
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.h
@@ -11,4 +11,4 @@ class PackageListDocLnk : public PackageList
public:
- PackageListDocLnk();
- PackageListDocLnk( PackageManagerSettings* s);
+ PackageListDocLnk(QObject *parent=0, const char *name=0);
+ PackageListDocLnk( PackageManagerSettings *s, QObject *parent=0, const char *name=0);
virtual ~PackageListDocLnk();
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 55047d5..0c9c676 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -161,3 +161,3 @@ void PackageListItem::displayDetails()
nameItem->setText( 0, QObject::tr("Name: ")+package->name());
- linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) );
+ linkItem->setText( 0, QObject::tr("Link: ")+package->link()?QObject::tr("Yes"):QObject::tr("No"));
destItem->setText( 0, QObject::tr("Destination: ")+package->dest() );
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 70aa48a..2bb74e9 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -61,3 +61,3 @@ void PackageListView::showPopup()
{
- popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
+ popupMenu->insertItem( tr("Install to"), destsMenu );
QStringList dests = settings->getDestinationNames();
@@ -77,3 +77,3 @@ void PackageListView::showPopup()
}else{
- popupAction = new QAction( QObject::tr("Remove"),QString::null, 0, this, 0 );
+ popupAction = new QAction( tr("Remove"),QString::null, 0, this, 0 );
popupAction->addTo( popupMenu );
@@ -81,3 +81,3 @@ void PackageListView::showPopup()
this , SLOT( toggleProcess() ) );
- popupAction = new QAction( QObject::tr("Reinstall"),QString::null, 0, this, 0 );
+ popupAction = new QAction( tr("Reinstall"),QString::null, 0, this, 0 );
popupAction->addTo( popupMenu );
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index 09975b0..59d5a3e 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -243,2 +243,3 @@ void PackageManagerSettings::readInstallationSettings()
cfg.setGroup( "Settings" );
+
installationSettingsCount = cfg.readNumEntry( "count", -1 );
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h
index dcc1e3a..8f9fe62 100644
--- a/noncore/unsupported/oipkg/pksettings.h
+++ b/noncore/unsupported/oipkg/pksettings.h
@@ -11,3 +11,3 @@ class PackageManagerSettings : public PackageManagerSettingsBase
{
-// Q_OBJECT
+ Q_OBJECT
public:
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 7b3fa1e..2a534d2 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -5,3 +5,5 @@
-#include <qpe/process.h>
+//#infdef OPROCESS
+#include <opie/oprocess.h>
+//#endif
#include <qpe/resource.h>
@@ -34,2 +36,11 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
runwindow = new RunWindow( p, name, true, f );
+#ifdef OPROCESS
+ ipkgProcess = new OProcess();
+ connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ this, SLOT(getIpkgOutput(OProcess*,char*,int)));
+
+ connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ this, SLOT(getIpkgOutput(OProcess*,char*,int)));
+ installDialog = 0;
+#endif
}
@@ -38,2 +49,5 @@ PmIpkg::~PmIpkg()
{
+#ifdef OPROCESS
+ delete ipkgProcess;
+#endif
}
@@ -45,2 +59,7 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
QString cmd = "/usr/bin/ipkg ";
+#ifdef OPROCESS
+ ipkgProcess->clearArguments();
+ *ipkgProcess << "/usr/bin/ipkg ";
+ QString cmd = "";
+#endif
pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
@@ -67,2 +86,37 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
pvDebug(2,"running:"+cmd);
+#ifdef OPROCESS
+ *ipkgProcess << args;
+ out( "running:\n" + cmd);
+ *ipkgProcess << cmd;
+
+//debug
+ ipkgProcess->clearArguments();
+ *ipkgProcess << "/bin/ls ";
+//debug
+ QValueList<QCString> a = ipkgProcess->args();
+ QValueList<QCString>::Iterator it;
+ for( it = a.begin(); it != a.end(); ++it )
+ {
+ out( *it );
+ cmd += *it;
+ }
+
+ pvDebug(2,"running:"+cmd);
+ qApp->processEvents();
+// sleep(1);
+ ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
+ if ( !ret ) {
+ pvDebug(2,"Could not execute '" + cmd);
+ out("\nError while executing "+ cmd+"\n\n");
+ out("\nError while executing\n\n");
+ // return false;
+ }
+
+ while ( ipkgProcess->isRunning() )
+ {
+ out(".");
+ pvDebug(7,"wait for oprocess to terminate");
+ qApp->processEvents();
+ };
+#else
qApp->processEvents();
@@ -93,2 +147,3 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
}
+#endif
//out( "Finished!");
@@ -101,3 +156,3 @@ void PmIpkg::makeLinks(Package *pack)
pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
- linkPackage( pack->installName(), pack->dest() );
+ linkPackage( pack->name(), pack->dest() );
}
@@ -244,2 +299,3 @@ void PmIpkg::commit()
delete installDialog;
+ installDialog = 0;
out(tr("\nAll done."));
@@ -398 +454,13 @@ void PmIpkg::clearLists()
}
+
+
+void PmIpkg::getIpkgOutput(OProcess *proc, char *buffer, int buflen)
+{
+ QString lineStr, lineStrOld;
+ lineStr = buffer;
+ lineStr=lineStr.left(buflen);
+ //Configuring opie-oipkg...Done
+ if (lineStr!=lineStrOld)
+ out(lineStr);
+ lineStrOld = lineStr;
+} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index d53a74d..2c92348 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -4,2 +4,3 @@
+#include <opie/oprocess.h>
#include <qobject.h>
@@ -42,3 +43,7 @@ public slots:
+//private slots:
+ void getIpkgOutput(OProcess *proc, char *buffer, int buflen);
+
private:
+ OProcess *ipkgProcess;
PackageManagerSettings* settings;
@@ -48,7 +53,2 @@ private:
QList<Package> to_install;
- QString fileNameToInstall;
- QCheckBox *_force_reinstall;
- QCheckBox *_force_remove;
- QCheckBox *_force_depends;
-// void startDialog();
void makeLinks(Package*);
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h
index f01cb69..9cb7a9b 100644
--- a/noncore/unsupported/oipkg/settings.h
+++ b/noncore/unsupported/oipkg/settings.h
@@ -10,3 +10,3 @@ class PackageManagerSettings : public PackageManagerSettingsBase
{
- // Q_OBJECT
+ Q_OBJECT
public: