summaryrefslogtreecommitdiff
path: root/noncore
authortille <tille>2002-04-25 21:06:23 (UTC)
committer tille <tille>2002-04-25 21:06:23 (UTC)
commit054b0f3268189d6f8f06135960042a7f51117223 (patch) (unidiff)
tree2ab5eef44d4e6604d6c0a45e51608390c8b3a521 /noncore
parentc06667cd62b945a05edce621aab34358ee0e964f (diff)
downloadopie-054b0f3268189d6f8f06135960042a7f51117223.zip
opie-054b0f3268189d6f8f06135960042a7f51117223.tar.gz
opie-054b0f3268189d6f8f06135960042a7f51117223.tar.bz2
installation messages working
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp10
-rw-r--r--noncore/unsupported/oipkg/oipkg.pro3
-rw-r--r--noncore/unsupported/oipkg/package.cpp10
-rw-r--r--noncore/unsupported/oipkg/package.h2
-rw-r--r--noncore/unsupported/oipkg/pksettingsbase.ui10
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp140
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h14
-rw-r--r--noncore/unsupported/oipkg/runwindow.ui112
8 files changed, 232 insertions, 69 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 997f449..54ee115 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -98,13 +98,13 @@ void MainWindow::makeMenu()
98 runAction->addTo( toolBar ); 98 runAction->addTo( toolBar );
99 runAction->addTo( srvMenu ); 99 runAction->addTo( srvMenu );
100 100
101 srvMenu->insertSeparator (); 101 srvMenu->insertSeparator ();
102 102
103 updateAction = new QAction( tr( "Update" ), 103 updateAction = new QAction( tr( "Update" ),
104 Resource::loadIconSet( "oipkg/repeat" ), 104 Resource::loadIconSet( "oipkg/update" ),
105 QString::null, 0, this, 0 ); 105 QString::null, 0, this, 0 );
106 connect( updateAction, SIGNAL( activated() ), 106 connect( updateAction, SIGNAL( activated() ),
107 this , SLOT( updateList() ) ); 107 this , SLOT( updateList() ) );
108 updateAction->addTo( toolBar ); 108 updateAction->addTo( toolBar );
109 updateAction->addTo( srvMenu ); 109 updateAction->addTo( srvMenu );
110 110
@@ -142,18 +142,18 @@ void MainWindow::makeMenu()
142 142
143 sectionBar = new QPEToolBar( this ); 143 sectionBar = new QPEToolBar( this );
144 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); 144 addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE );
145 sectionBar->setHorizontalStretchable( true ); 145 sectionBar->setHorizontalStretchable( true );
146 QLabel *label = new QLabel( tr("Section: "), sectionBar ); 146 QLabel *label = new QLabel( tr("Section: "), sectionBar );
147 label->setBackgroundColor( sectionBar->backgroundColor() ); 147 label->setBackgroundColor( sectionBar->backgroundColor() );
148 sectionBar->setStretchableWidget( label );
148 section = new QComboBox( false, sectionBar ); 149 section = new QComboBox( false, sectionBar );
149// section->setBackgroundMode( PaletteBackground ); 150// section->setBackgroundMode( PaletteBackground );
150 label = new QLabel( " / ", sectionBar ); 151 label = new QLabel( " / ", sectionBar );
151 label->setBackgroundColor( sectionBar->backgroundColor() ); 152 label->setBackgroundColor( sectionBar->backgroundColor() );
152 subsection = new QComboBox( false, sectionBar ); 153 subsection = new QComboBox( false, sectionBar );
153 sectionBar->setStretchableWidget( label );
154 154
155 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 155 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
156 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); 156 connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) );
157 a->addTo( sectionBar ); 157 a->addTo( sectionBar );
158 158
159 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); 159 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
@@ -272,23 +272,23 @@ void MainWindow::setSubSections()
272} 272}
273 273
274 274
275void MainWindow::showSettings() 275void MainWindow::showSettings()
276{ 276{
277 if ( settings->showDialog( 0 ) ) 277 if ( settings->showDialog( 0 ) )
278 getList(); 278 updateList();
279} 279}
280void MainWindow::showSettingsSrv() 280void MainWindow::showSettingsSrv()
281{ 281{
282 if ( settings->showDialog( 1 ) ) 282 if ( settings->showDialog( 1 ) )
283 getList(); 283 updateList();
284} 284}
285void MainWindow::showSettingsDst() 285void MainWindow::showSettingsDst()
286{ 286{
287 if ( settings->showDialog( 2 ) ) 287 if ( settings->showDialog( 2 ) )
288 getList(); 288 updateList();
289} 289}
290 290
291 291
292void MainWindow::showDetails() 292void MainWindow::showDetails()
293{ 293{
294 if ( activePackage ) return; 294 if ( activePackage ) return;
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro
index c16cc73..955c7f3 100644
--- a/noncore/unsupported/oipkg/oipkg.pro
+++ b/noncore/unsupported/oipkg/oipkg.pro
@@ -13,14 +13,13 @@ SOURCES = main.cpp \
13 pksettings.cpp \ 13 pksettings.cpp \
14 pmipkg.cpp \ 14 pmipkg.cpp \
15 packagelistitem.cpp \ 15 packagelistitem.cpp \
16 packagelist.cpp \ 16 packagelist.cpp \
17 package.cpp 17 package.cpp
18INCLUDEPATH += $(OPIEDIR)/include 18INCLUDEPATH += $(OPIEDIR)/include
19 DEPENDPATH+= $(OPIEDIR)/include 19 DEPENDPATH+= $(OPIEDIR)/ioclude
20LIBS += -lqpe 20LIBS += -lqpe
21 INTERFACES= pkdesc.ui \ 21 INTERFACES= pkdesc.ui \
22 pkfind.ui \
23 runwindow.ui \ 22 runwindow.ui \
24 pksettingsbase.ui 23 pksettingsbase.ui
25 TARGET = oipkg 24 TARGET = oipkg
26 25
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index e317308..1705f78 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -14,13 +14,13 @@ Package::Package()
14 _size = ""; 14 _size = "";
15 _section = ""; 15 _section = "";
16 _subsection = ""; 16 _subsection = "";
17 _shortDesc = ""; 17 _shortDesc = "";
18 _desc = ""; 18 _desc = "";
19 _name = ""; 19 _name = "";
20 _toProcess = true; 20 _toProcess = false;
21 _status = ""; 21 _status = "";
22} 22}
23 23
24Package::Package( QStringList pack ) 24Package::Package( QStringList pack )
25 { 25 {
26 Package(); 26 Package();
@@ -250,6 +250,14 @@ QString Package::details()
250 } 250 }
251 } 251 }
252 } 252 }
253 return description; 253 return description;
254} 254}
255 255
256/** No descriptions */
257void Package::processed()
258{
259 _toProcess = false;
260 //hack, but we're mot writing status anyway...
261 if ( installed() ) _status = "install";
262 else _status = "installed";
263}
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h
index 08d0c57..cf2af75 100644
--- a/noncore/unsupported/oipkg/package.h
+++ b/noncore/unsupported/oipkg/package.h
@@ -32,12 +32,14 @@ class Package //: public QObject
32 QString getSection(); 32 QString getSection();
33 QString getSubSection(); 33 QString getSubSection();
34 QString details(); 34 QString details();
35 bool toProcess(); 35 bool toProcess();
36 bool toInstall(); 36 bool toInstall();
37 bool toRemove(); 37 bool toRemove();
38 /** No descriptions */
39 void processed();
38public slots: 40public slots:
39 void toggleProcess(); 41 void toggleProcess();
40 42
41private: 43private:
42 QString _name; 44 QString _name;
43 bool _toProcess; 45 bool _toProcess;
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui
index ea507a8..196a89f 100644
--- a/noncore/unsupported/oipkg/pksettingsbase.ui
+++ b/noncore/unsupported/oipkg/pksettingsbase.ui
@@ -8,13 +8,13 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>353</width> 14 <width>349</width>
15 <height>454</height> 15 <height>454</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Package Servers</string> 20 <string>Package Servers</string>
@@ -173,13 +173,13 @@
173 <property stdset="1"> 173 <property stdset="1">
174 <name>name</name> 174 <name>name</name>
175 <cstring>CheckBoxLink</cstring> 175 <cstring>CheckBoxLink</cstring>
176 </property> 176 </property>
177 <property stdset="1"> 177 <property stdset="1">
178 <name>text</name> 178 <name>text</name>
179 <string>Link Destination:</string> 179 <string>Link Destination: root</string>
180 </property> 180 </property>
181 </widget> 181 </widget>
182 <widget> 182 <widget>
183 <class>QComboBox</class> 183 <class>QComboBox</class>
184 <property stdset="1"> 184 <property stdset="1">
185 <name>name</name> 185 <name>name</name>
@@ -715,18 +715,12 @@
715 </grid> 715 </grid>
716 </widget> 716 </widget>
717 </widget> 717 </widget>
718 </grid> 718 </grid>
719</widget> 719</widget>
720<connections> 720<connections>
721 <connection>
722 <sender>CheckBoxLink</sender>
723 <signal>toggled(bool)</signal>
724 <receiver>Form4</receiver>
725 <slot>linkEnabled(bool)</slot>
726 </connection>
727 <slot access="public">destNameChanged(const QString&amp;)</slot> 721 <slot access="public">destNameChanged(const QString&amp;)</slot>
728 <slot access="public">destUrlChanged(const QString&amp;)</slot> 722 <slot access="public">destUrlChanged(const QString&amp;)</slot>
729 <slot access="public">editDestination(int)</slot> 723 <slot access="public">editDestination(int)</slot>
730 <slot access="public">editServer(int)</slot> 724 <slot access="public">editServer(int)</slot>
731 <slot access="public">installationSettingChange(int)</slot> 725 <slot access="public">installationSettingChange(int)</slot>
732 <slot access="public">installationSettingSetName(const QString &amp;)</slot> 726 <slot access="public">installationSettingSetName(const QString &amp;)</slot>
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index b2ddf95..b23b9ea 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -1,9 +1,8 @@
1#include "pmipkg.h" 1#include "pmipkg.h"
2#include "pkdesc.h" 2#include "pkdesc.h"
3#include "pkfind.h"
4#include "pksettings.h" 3#include "pksettings.h"
5#include "package.h" 4#include "package.h"
6#include "packagelistitem.h" 5#include "packagelistitem.h"
7 6
8#include <qpe/process.h> 7#include <qpe/process.h>
9#include <qpe/resource.h> 8#include <qpe/resource.h>
@@ -14,31 +13,28 @@
14#include <qfile.h> 13#include <qfile.h>
15#include <qmultilineedit.h> 14#include <qmultilineedit.h>
16#include <qstring.h> 15#include <qstring.h>
17#include <qtextstream.h> 16#include <qtextstream.h>
18#include <qtextview.h> 17#include <qtextview.h>
19 18
19#include <qprogressbar.h>
20#include <qpushbutton.h>
21#include <qlayout.h>
22
20#include <stdlib.h> 23#include <stdlib.h>
21#include <unistd.h> 24#include <unistd.h>
22 25
23#include "mainwindow.h" 26#include "mainwindow.h"
24#include "runwindow.h"
25
26 27
27#define PARSE_FILELIST
28// #define IPKG_FILELIST
29 28
30PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) 29PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f )
31// : RunWindow ( p, name, f )
32 : QObject ( p ) 30 : QObject ( p )
33{ 31{
34 settings = s; 32 settings = s;
35 runwindow = new RunWindow ( p, name, f ); 33 runwindowopen = false;
36 linkDest = new QCopChannel( "QPE/oipkg", this ); 34 runwindow = new RunWindow( p, name, true, f );
37 connect( linkDest, SIGNAL(received(const QCString &, const QByteArray &)),
38 this, SLOT(linkDestination( const QString &, const QByteArray&)) );
39} 35}
40 36
41PmIpkg::~PmIpkg() 37PmIpkg::~PmIpkg()
42{ 38{
43} 39}
44 40
@@ -70,20 +66,23 @@ int PmIpkg::runIpkg(const QString& args)
70#ifdef SYSTEM 66#ifdef SYSTEM
71 QString redirect = "/tmp/oipkg.pipe"; 67 QString redirect = "/tmp/oipkg.pipe";
72 cmd += " | tee "+redirect+" 2>&1"; 68 cmd += " | tee "+redirect+" 2>&1";
73 pvDebug(2, "running >"+cmd+"<"); 69 pvDebug(2, "running >"+cmd+"<");
74 r = system(cmd.latin1()); 70 r = system(cmd.latin1());
75 QFile f( redirect ); 71 QFile f( redirect );
72 QString line;
73 QString oldLine;
76 while ( ! f.open(IO_ReadOnly) ) {}; 74 while ( ! f.open(IO_ReadOnly) ) {};
77 // if ( f.open(IO_ReadOnly) ) {};
78 { 75 {
79 QTextStream t( &f ); 76 QTextStream t( &f );
80 QString fp; 77 // QString fp;
81 while ( !t.eof() ) 78 while ( !t.eof() )
82 { 79 {
83 out( t.readLine() +"<br>" ); 80 line = t.readLine();
81 if ( line != oldLine ) out( line +"<br>" );
82 oldLine = line;
84 } 83 }
85 } 84 }
86 f.close(); 85 f.close();
87 out( "Finished!<br>"); 86 out( "Finished!<br>");
88#endif 87#endif
89 88
@@ -93,84 +92,69 @@ int PmIpkg::runIpkg(const QString& args)
93void PmIpkg::makeLinks(QString pack) 92void PmIpkg::makeLinks(QString pack)
94{ 93{
95 pvDebug( 2, "PmIpkg::makeLinks "+ pack); 94 pvDebug( 2, "PmIpkg::makeLinks "+ pack);
96 out( "<br>creating links<br>" ); 95 out( "<br>creating links<br>" );
97 QString dest = settings->getDestinationUrl(); 96 QString dest = settings->getDestinationUrl();
98 out("for package "+pack+" in "+dest+"<br>"); 97 out("for package "+pack+" in "+dest+"<br>");
99#ifdef IPKG_FILELIST
100 system(("ipkg -d "+dest+" files "+pack+"> /tmp/oipkg.pipe 2>&1").latin1());
101 QFile f( "/tmp/oipkg.pipe" );
102 while ( ! f.open(IO_ReadOnly) ) {};
103#endif
104#ifdef PARSE_FILELIST
105 { 98 {
106 Config cfg( "oipkg", Config::User ); 99 Config cfg( "oipkg", Config::User );
107 cfg.setGroup( "Common" ); 100 cfg.setGroup( "Common" );
108 QString statusDir = cfg.readEntry( "statusDir", "" ); 101 QString statusDir = cfg.readEntry( "statusDir", "" );
109 } 102 }
110 QString fn = dest+"/"+statusDir+"/info/"+pack+".list"; 103 QString fn = dest+"/"+statusDir+"/info/"+pack+".list";
111 QFile f( fn ); 104 QFile f( fn );
112 if ( ! f.open(IO_ReadOnly) ) 105 if ( ! f.open(IO_ReadOnly) )
113 { 106 {
114 out( "<b>Panik!</b> Could not open:<br>"+fn ); 107 out( "<b>Panik!</b> Could not open:<br>"+fn );
115 }; 108 };
116#endif
117 QTextStream t( &f ); 109 QTextStream t( &f );
118 QString fp; 110 QString fp;
119 while ( !t.eof() ) 111 while ( !t.eof() )
120 { 112 {
121 fp = t.readLine(); 113 fp = t.readLine();
122 processLinkDir( fp, dest ); 114 processLinkDir( fp, dest );
123 } 115 }
124 f.close(); 116 f.close();
125} 117}
126 118
127void PmIpkg::processLinkDir( QString file, QString dest ) 119void PmIpkg::processLinkDir( QString file, QString dest )
128{ 120{
129
130#ifdef PARSE_FILELIST
131 QString destFile = file; 121 QString destFile = file;
132 file = dest+"/"+file; 122 file = dest+"/"+file;
133#endif
134#ifdef IPKG_FILELIST
135 QString destFile = file.right( file.length() - dest.length() );
136#endif
137 QFileInfo fileInfo( file ); 123 QFileInfo fileInfo( file );
138 if ( fileInfo.isDir() ) 124 if ( fileInfo.isDir() )
139 { 125 {
140 QDir destDir( destFile ); 126 QDir destDir( destFile );
141 destDir.mkdir( destFile, true ); 127 destDir.mkdir( destFile, true );
142 QDir d( file ); 128 QDir d( file );
143 d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 129 d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
144 const QFileInfoList *list = d.entryInfoList(); 130 const QFileInfoList *list = d.entryInfoList();
145 QFileInfoListIterator it( *list ); 131 QFileInfoListIterator it( *list );
146 QFileInfo *fi; 132 QFileInfo *fi;
147 while ( (fi=it.current()) ) 133 while ( (fi=it.current()) )
148 { 134 {
149 out( "<b>"+fi->absFilePath()+"</b>" ); 135 // out( "<b>"+fi->absFilePath()+"</b>" );
150 processLinkDir( fi->absFilePath(), dest ); 136 processLinkDir( fi->absFilePath(), dest );
151 ++it; 137 ++it;
152 } 138 }
153 } else 139 } else
154 if ( fileInfo.isFile() ) 140 if ( fileInfo.isFile() )
155 { 141 {
156 const char *instFile = strdup( (file).ascii() ); 142 const char *instFile = strdup( (file).ascii() );
157 const char *linkFile = strdup( (destFile).ascii()); 143 const char *linkFile = strdup( (destFile).ascii());
158 out( "linking: "+file+" -> "+destFile ); 144// out( "linking: "+file+" -> "+destFile );
159 qDebug( "linking: %s -> %s", instFile, linkFile ); 145 qDebug( "linking: %s -> %s", instFile, linkFile );
160 symlink( instFile, linkFile ); 146 symlink( instFile, linkFile );
161 } 147 }
162} 148}
163 149
164void PmIpkg::commit( PackageList pl ) 150void PmIpkg::commit( PackageList pl )
165 { 151 {
166 runwindow->showMaximized(); 152 show( false );
167// exec();
168 runwindow->outPut->setText(""); 153 runwindow->outPut->setText("");
169 out( "<h1>Starting...</h1><br>\n"); 154 out( "<h1>"+tr("Todo")+"</h1>\n");
170 QStringList to_remove, to_install;
171 155
172 QString rem="<b>To remove:</b><br>\n"; 156 QString rem="<b>To remove:</b><br>\n";
173 QString inst="<b>To install:</b><br>\n";; 157 QString inst="<b>To install:</b><br>\n";;
174 for( Package *pack = pl.first();pack ; (pack = pl.next()) ) 158 for( Package *pack = pl.first();pack ; (pack = pl.next()) )
175 { 159 {
176 if ( pack && (pack->name() != "") && pack) 160 if ( pack && (pack->name() != "") && pack)
@@ -185,40 +169,76 @@ void PmIpkg::commit( PackageList pl )
185 to_remove.append( pack->name() ); 169 to_remove.append( pack->name() );
186 rem += pack->name()+"<br>"; 170 rem += pack->name()+"<br>";
187 } 171 }
188 } 172 }
189 } 173 }
190 174
191 out("<p>"+inst+"</p>"+"<p>"+rem+"</p>"); 175 out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>");
192 bool ok=TRUE;
193 176
194 qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); 177 qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count());
195 178
196 int jobs = to_remove.count()+to_install.count(); 179 connect( runwindow->doItButton, SIGNAL( clicked() ),
197 if ( jobs < 1 ) return; 180 SLOT( doIt() ) );
181 connect( runwindow->installButton, SIGNAL( clicked() ),
182 this, SLOT( install() ) );
183 connect( runwindow->removeButton, SIGNAL( clicked() ),
184 this, SLOT( remove() ) );
185 connect( runwindow->cancelButton, SIGNAL( clicked() ),
186 runwindow, SLOT( close() ) );
187
188 runwindow->exec();
189 // ##### If we looked in the list of files, we could send out accurate
190 // ##### messages. But we don't bother yet, and just do an "all".
191 QCopEnvelope e("QPE/System", "linkChanged(QString)");
192 QString lf = QString::null;
193 e << lf;
194 return;
195}
196
197void PmIpkg::doIt()
198{
199 remove();
200 install();
201}
198 202
199 if ( to_remove.count() ) 203
204void PmIpkg::remove()
205{
206 if ( to_remove.count() == 0 ) return;
207 show( true );
208
209 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>");
200 for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) 210 for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it)
201 if ( runIpkg("remove " + *it) != 0 ) ok = false; 211 {
212 if ( runIpkg("remove " + *it) == 0)
213 {
214
215 }else{
216 out("<b>"+tr("Error while removing")+"</b>"+*it);
217 }
218 }
219}
220
221
222void PmIpkg::install()
223{
224 if ( to_install.count() == 0 ) return;
225 show( true );
226 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"<b><br>");
202 if ( to_install.count() ) 227 if ( to_install.count() )
203 for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) 228 for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it)
204 { 229 {
205 if ( runIpkg("install " + *it) == 0 ) 230 if ( runIpkg("install " + *it) == 0 )
206 { 231 {
207 if ( settings->createLinks() ) 232 if ( settings->createLinks() )
208 makeLinks( *it ); 233 makeLinks( *it );
209 }else{ 234 }else{
210 ok = false; 235 out("<b>"+tr("Error while installing")+"</b>"+*it);
211 } 236 }
212 } 237 }
213 238
214 // ##### If we looked in the list of files, we could send out accurate
215 // ##### messages. But we don't bother yet, and just do an "all".
216 QCopEnvelope e("QPE/System", "linkChanged(QString)");
217 QString lf = QString::null;
218 e << lf;
219} 239}
220 240
221void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) 241void PmIpkg::linkDestination( const QString msg, const QByteArray dest )
222// add 3rd package parameter 242// add 3rd package parameter
223{ 243{
224 qDebug("msg="+msg+" -- "+QString(dest) ); 244 qDebug("msg="+msg+" -- "+QString(dest) );
@@ -233,15 +253,45 @@ void PmIpkg::linkDestination( const QString msg, const QByteArray dest )
233// ++it; 253// ++it;
234// } 254// }
235} 255}
236 256
237void PmIpkg::update() 257void PmIpkg::update()
238{ 258{
239 runwindow->showMaximized(); 259 show( false );
240 runIpkg( "update" ); 260 runIpkg( "update" );
261 runwindow->close();
241} 262}
242 263
243void PmIpkg::out( QString o ) 264void PmIpkg::out( QString o )
244{ 265{
245 runwindow->outPut->setText( runwindow->outPut->text()+o ); 266 runwindow->outPut->setText( runwindow->outPut->text()+o );
246 runwindow->outPut->setContentsPos(0,runwindow->outPut->contentsHeight()); 267 runwindow->outPut->setContentsPos(0,runwindow->outPut->contentsHeight());
247} 268}
269
270
271void PmIpkg::showButtons(bool b)
272{
273 if ( b )
274 {
275 runwindow->cancelButton->hide();
276 runwindow->doItButton->hide();
277 runwindow->removeButton->hide();
278 runwindow->installButton->hide();
279 }else{
280 runwindow->cancelButton->show();
281 runwindow->doItButton->show();
282 runwindow->removeButton->show();
283 runwindow->installButton->show();
284
285 }
286}
287
288void PmIpkg::show(bool b)
289{
290 if (!runwindow->isVisible())
291 runwindow->showMaximized();
292 showButtons(b);
293 if ( b )
294 runwindow->progress->show();
295 else
296 runwindow->progress->show();
297}
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index e6486ff..8718f49 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -7,40 +7,42 @@
7#include <qwidget.h> 7#include <qwidget.h>
8#include "pksettings.h" 8#include "pksettings.h"
9#include "runwindow.h" 9#include "runwindow.h"
10#include "packagelist.h" 10#include "packagelist.h"
11#include "debug.h" 11#include "debug.h"
12 12
13//#define DIA
14 13
15#include <qpe/qcopenvelope_qws.h>
16 14
17
18//class PmIpkg : public RunWindow
19class PmIpkg : public QObject 15class PmIpkg : public QObject
20{ 16{
21 Q_OBJECT 17 Q_OBJECT
22public: 18public:
23 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); 19 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 );
24 //PmIpkg( QObject*, PackageManagerSettings* );
25 ~PmIpkg(); 20 ~PmIpkg();
26 21
27 void commit( PackageList ); 22 void commit( PackageList );
28 void update(); 23 void update();
29 PackageList* getPackageList(); 24 PackageList* getPackageList();
25 void showButtons(bool b=true);
26 void show( bool buttons=true );
30 27
31private: 28private:
32 PackageManagerSettings* settings; 29 PackageManagerSettings* settings;
33 RunWindow *runwindow; 30 RunWindow *runwindow;
34 QCopChannel *linkDest; 31 QStringList to_remove;
32 QStringList to_install;
33 bool runwindowopen;
35 34
36 void makeLinks(QString); 35 void makeLinks(QString);
37 void processLinkDir( QString, QString ); 36 void processLinkDir( QString, QString );
38 37
39 int runIpkg(const QString& args); 38 int runIpkg(const QString& args);
40 void out( QString ); 39 void out( QString );
41 40
42public slots: 41public slots:
42 void doIt();
43 void install();
44 void remove();
43 void linkDestination( const QString, const QByteArray ); 45 void linkDestination( const QString, const QByteArray );
44}; 46};
45 47
46#endif 48#endif
diff --git a/noncore/unsupported/oipkg/runwindow.ui b/noncore/unsupported/oipkg/runwindow.ui
index 9113f2d..5359fe2 100644
--- a/noncore/unsupported/oipkg/runwindow.ui
+++ b/noncore/unsupported/oipkg/runwindow.ui
@@ -8,13 +8,13 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>197</width> 14 <width>344</width>
15 <height>291</height> 15 <height>291</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>running...</string> 20 <string>running...</string>
@@ -25,13 +25,13 @@
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <grid>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>5</number> 31 <number>2</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>2</number>
36 </property> 36 </property>
37 <widget row="0" column="0" > 37 <widget row="0" column="0" >
@@ -55,9 +55,117 @@
55 <name>font</name> 55 <name>font</name>
56 <font> 56 <font>
57 <pointsize>6</pointsize> 57 <pointsize>6</pointsize>
58 </font> 58 </font>
59 </property> 59 </property>
60 </widget> 60 </widget>
61 <widget row="2" column="0" >
62 <class>QLayoutWidget</class>
63 <property stdset="1">
64 <name>name</name>
65 <cstring>buttons</cstring>
66 </property>
67 <hbox>
68 <property stdset="1">
69 <name>margin</name>
70 <number>0</number>
71 </property>
72 <property stdset="1">
73 <name>spacing</name>
74 <number>6</number>
75 </property>
76 <widget>
77 <class>QPushButton</class>
78 <property stdset="1">
79 <name>name</name>
80 <cstring>doItButton</cstring>
81 </property>
82 <property stdset="1">
83 <name>sizePolicy</name>
84 <sizepolicy>
85 <hsizetype>0</hsizetype>
86 <vsizetype>0</vsizetype>
87 </sizepolicy>
88 </property>
89 <property stdset="1">
90 <name>font</name>
91 <font>
92 <pointsize>8</pointsize>
93 </font>
94 </property>
95 <property stdset="1">
96 <name>text</name>
97 <string>Do all </string>
98 </property>
99 <property stdset="1">
100 <name>autoResize</name>
101 <bool>true</bool>
102 </property>
103 </widget>
104 <widget>
105 <class>QPushButton</class>
106 <property stdset="1">
107 <name>name</name>
108 <cstring>installButton</cstring>
109 </property>
110 <property stdset="1">
111 <name>font</name>
112 <font>
113 <pointsize>8</pointsize>
114 </font>
115 </property>
116 <property stdset="1">
117 <name>text</name>
118 <string>Install</string>
119 </property>
120 <property stdset="1">
121 <name>autoResize</name>
122 <bool>true</bool>
123 </property>
124 </widget>
125 <widget>
126 <class>QPushButton</class>
127 <property stdset="1">
128 <name>name</name>
129 <cstring>removeButton</cstring>
130 </property>
131 <property stdset="1">
132 <name>font</name>
133 <font>
134 <pointsize>7</pointsize>
135 </font>
136 </property>
137 <property stdset="1">
138 <name>text</name>
139 <string>Remove</string>
140 </property>
141 <property stdset="1">
142 <name>autoResize</name>
143 <bool>true</bool>
144 </property>
145 </widget>
146 <widget>
147 <class>QPushButton</class>
148 <property stdset="1">
149 <name>name</name>
150 <cstring>cancelButton</cstring>
151 </property>
152 <property stdset="1">
153 <name>font</name>
154 <font>
155 <pointsize>8</pointsize>
156 </font>
157 </property>
158 <property stdset="1">
159 <name>text</name>
160 <string>Cancel</string>
161 </property>
162 <property stdset="1">
163 <name>autoResize</name>
164 <bool>true</bool>
165 </property>
166 </widget>
167 </hbox>
168 </widget>
61 </grid> 169 </grid>
62</widget> 170</widget>
63</UI> 171</UI>