summaryrefslogtreecommitdiff
path: root/noncore
authortille <tille>2002-04-26 00:50:30 (UTC)
committer tille <tille>2002-04-26 00:50:30 (UTC)
commita111f57eedcf27623e9bff2816c83d3287272aff (patch) (unidiff)
treeb43ac41ffbdc741f731cf3f91aab064ba94ab0f3 /noncore
parent5198d98daeaa1e8eb8568ccd3c516ab70fbed512 (diff)
downloadopie-a111f57eedcf27623e9bff2816c83d3287272aff.zip
opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.gz
opie-a111f57eedcf27623e9bff2816c83d3287272aff.tar.bz2
added support for scipt ipkg (again;)
Diffstat (limited to 'noncore') (more/less context) (show 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.cpp69
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h11
-rw-r--r--noncore/unsupported/oipkg/settings.h5
6 files changed, 95 insertions, 18 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()
92 92
93 runAction = new QAction( tr( "Commit" ), 93 runAction = new QAction( tr( "Apply" ),
94 Resource::loadPixmap( "oipkg/install" ), 94 Resource::loadPixmap( "oipkg/install" ),
@@ -173,6 +173,3 @@ void MainWindow::makeMenu()
173 this, SLOT( displayList() ) ); 173 this, SLOT( displayList() ) );
174 //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); 174
175// connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) );
176// a->addTo( findBar );
177// a->addTo( edit );
178 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 175 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
@@ -185,3 +182,2 @@ void MainWindow::makeMenu()
185 findAction->addTo( viewMenu ); 182 findAction->addTo( viewMenu );
186
187} 183}
@@ -195,3 +191,3 @@ void MainWindow::runIpkg()
195 ipkg->commit( packageList ); 191 ipkg->commit( packageList );
196 updateList(); //to remove 192// updateList(); //to remove
197} 193}
@@ -200,2 +196,5 @@ void MainWindow::updateList()
200{ 196{
197 QTimer *t = new QTimer( this );
198 connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) );
199 t->start( 0, false );
201 packageList.clear(); 200 packageList.clear();
@@ -203,2 +202,3 @@ void MainWindow::updateList()
203 getList(); 202 getList();
203 t->stop();
204} 204}
@@ -348 +348,10 @@ void MainWindow::findClose()
348 348
349void MainWindow::rotateUpdateIcon()
350{
351 pvDebug(2, "MainWindow::rotateUpdateIcon");
352 if ( updateIcon )
353 updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) );
354 else
355 updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) );
356 updateIcon = !updateIcon;
357}
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 @@
5#include <qaction.h> 5#include <qaction.h>
6#include <qtimer.h>
6#include <qpopupmenu.h> 7#include <qpopupmenu.h>
@@ -71,2 +72,5 @@ private:
71 QPopupMenu *popupMenu; 72 QPopupMenu *popupMenu;
73 bool updateIcon;
74private slots:
75 void rotateUpdateIcon();
72}; 76};
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:
21 QStringList getDestinationUrls(); 21 QStringList getDestinationUrls();
22
23private: 22private:
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)
45 pvDebug(2,"PmIpkg::runIpkg "+args); 45 pvDebug(2,"PmIpkg::runIpkg "+args);
46
47 //to make script ipkg happy
48 pvDebug(2, "cd "+settings->getDestinationUrl()+"/tmp/ipkg");
49 if (!QDir::setCurrent(settings->getDestinationUrl()+"/tmp/ipkg"))
50 {
51 QDir instDir = QDir(settings->getDestinationUrl()+"/tmp/ipkg");
52 instDir.mkdir(settings->getDestinationUrl()+"/tmp/ipkg");
53 }
46#ifdef PROC 54#ifdef PROC
@@ -155,2 +163,5 @@ void PmIpkg::commit( PackageList pl )
155 163
164 to_install.clear();
165 to_remove.clear();
166 int sizecount = 0;
156 QString rem="<b>To remove:</b><br>\n"; 167 QString rem="<b>To remove:</b><br>\n";
@@ -163,3 +174,9 @@ void PmIpkg::commit( PackageList pl )
163 { 174 {
175 #ifndef NEWLIST
164 to_install.append( pack->name() ); 176 to_install.append( pack->name() );
177 #endif
178 #ifdef NEWLIST
179 to_install.append( pack );
180 sizecount += pack->size().toInt();
181 #endif
165 inst += pack->name()+"<br>"; 182 inst += pack->name()+"<br>";
@@ -168,3 +185,9 @@ void PmIpkg::commit( PackageList pl )
168 { 185 {
186 #ifndef NEWLIST
169 to_remove.append( pack->name() ); 187 to_remove.append( pack->name() );
188 #endif
189 #ifdef NEWLIST
190 to_remove.append( pack );
191 sizecount += 1;
192 #endif
170 rem += pack->name()+"<br>"; 193 rem += pack->name()+"<br>";
@@ -178,2 +201,4 @@ void PmIpkg::commit( PackageList pl )
178 201
202 runwindow->progress->setTotalSteps( sizecount );
203
179 connect( runwindow->doItButton, SIGNAL( clicked() ), 204 connect( runwindow->doItButton, SIGNAL( clicked() ),
@@ -209,2 +234,4 @@ void PmIpkg::remove()
209 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); 234 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>");
235
236 #ifndef NEWLIST
210 for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) 237 for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it)
@@ -218,2 +245,16 @@ void PmIpkg::remove()
218 } 245 }
246#endif
247 #ifdef NEWLIST
248 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
249 {
250 if ( runIpkg("remove " + it->name()) == 0)
251 {
252 runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress());
253 it->processed();
254 runwindow->progress->setProgress( 1 );
255 }else{
256 out("<b>"+tr("Error while removing")+"</b>"+it->name());
257 }
258 }
259#endif
219} 260}
@@ -225,4 +266,4 @@ void PmIpkg::install()
225 show( true ); 266 show( true );
226 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"<b><br>"); 267 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
227 if ( to_install.count() ) 268 #ifndef NEWLIST
228 for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) 269 for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it)
@@ -237,3 +278,17 @@ void PmIpkg::install()
237 } 278 }
238 279#endif
280 #ifdef NEWLIST
281 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
282 {
283 if ( runIpkg("install " + it->name()) == 0 )
284 {
285 runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress());
286 if ( settings->createLinks() )
287 makeLinks( it->name() );
288 it->processed();
289 }else{
290 out("<b>"+tr("Error while installing")+"</b>"+it->name());
291 }
292 }
293#endif
239} 294}
@@ -292,6 +347,6 @@ void PmIpkg::show(bool b)
292 showButtons(b); 347 showButtons(b);
293 if ( b ) 348 //if ( b )
294 runwindow->progress->show(); 349 runwindow->progress->hide();
295 else 350// else
296 runwindow->progress->show(); 351 // runwindow->progress->show();
297} 352}
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 @@
5#include <qobject.h> 5#include <qobject.h>
6#include <qlist.h>
6#include <qstring.h> 7#include <qstring.h>
@@ -12,4 +13,4 @@
12 13
13 14//#define NEWLIST
14 15class Package;
15class PmIpkg : public QObject 16class PmIpkg : public QObject
@@ -30,4 +31,10 @@ private:
30 RunWindow *runwindow; 31 RunWindow *runwindow;
32#ifndef NEWLIST
31 QStringList to_remove; 33 QStringList to_remove;
32 QStringList to_install; 34 QStringList to_install;
35#endif
36#ifdef NEWLIST
37 QList<Package> to_remove;
38 QList<Package> to_install;
39#endif
33 bool runwindowopen; 40 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 @@
7 7
8class PackageManagerSettings : private PackageManagerSettingsBase 8class PackageManagerSettings : public PackageManagerSettingsBase
9//class PackageManagerSettings : private PackageManagerSettingsBase
9{ 10{
@@ -21,2 +22,4 @@ public:
21 QStringList getDestinationUrls(); 22 QStringList getDestinationUrls();
23 /** No descriptions */
24 QComboBox getActiveDestinationCombo();
22 25