summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/main.cpp6
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp4
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp153
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h5
-rw-r--r--noncore/unsupported/oipkg/runwindow.ui118
5 files changed, 80 insertions, 206 deletions
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp
index d98bcaa..bb3d1db 100644
--- a/noncore/unsupported/oipkg/main.cpp
+++ b/noncore/unsupported/oipkg/main.cpp
@@ -1,24 +1,24 @@
1 1
2#include "mainwindow.h" 2#include "mainwindow.h"
3 3
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qstring.h> 5#include <qstring.h>
6#include <qmessagebox.h> 6//#include <qmessagebox.h>
7int debugLevel; 7int debugLevel;
8 8
9int main( int argc, char ** argv ) 9int main( int argc, char ** argv )
10{ 10{
11 11
12 debugLevel = 2; 12 debugLevel = 2;
13 if (argc > 1) 13 if (argc > 1)
14 { 14 {
15 debugLevel = QString ( argv[1] ).toInt(); 15 debugLevel = QString ( argv[1] ).toInt();
16 qDebug("setting debug level to %i",debugLevel); 16 qDebug("setting debug level to %i",debugLevel);
17 } 17 }
18 QPEApplication a( argc, argv ); 18 QPEApplication a( argc, argv );
19 MainWindow mw; 19 MainWindow mw;
20 if (argc > 2) 20// if (argc > 2)
21 QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); 21 // QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!");
22 a.showMainDocumentWidget( &mw ); 22 a.showMainDocumentWidget( &mw );
23 return a.exec(); 23 return a.exec();
24} 24}
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 55f915d..2fa91e3 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -72,50 +72,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
72 SLOT(createLinks()) ); 72 SLOT(createLinks()) );
73 73
74 pvDebug(9,"displayList"); 74 pvDebug(9,"displayList");
75 displayList(); 75 displayList();
76} 76}
77 77
78void MainWindow::makeMenu() 78void MainWindow::makeMenu()
79{ 79{
80 80
81 QPEToolBar *toolBar = new QPEToolBar( this ); 81 QPEToolBar *toolBar = new QPEToolBar( this );
82 QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); 82 QPEMenuBar *menuBar = new QPEMenuBar( toolBar );
83 QPopupMenu *srvMenu = new QPopupMenu( menuBar ); 83 QPopupMenu *srvMenu = new QPopupMenu( menuBar );
84 QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 84 QPopupMenu *viewMenu = new QPopupMenu( menuBar );
85 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 85 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
86 // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); 86 // QPopupMenu *sectMenu = new QPopupMenu( menuBar );
87 87
88 setToolBarsMovable( false ); 88 setToolBarsMovable( false );
89 toolBar->setHorizontalStretchable( true ); 89 toolBar->setHorizontalStretchable( true );
90 menuBar->insertItem( tr( "Package" ), srvMenu ); 90 menuBar->insertItem( tr( "Package" ), srvMenu );
91 menuBar->insertItem( tr( "View" ), viewMenu ); 91 menuBar->insertItem( tr( "View" ), viewMenu );
92 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 92 menuBar->insertItem( tr( "Settings" ), cfgMenu );
93 // menuBar->insertItem( tr( "Sections" ), sectMenu ); 93 // menuBar->insertItem( tr( "Sections" ), sectMenu );
94 94
95 QLabel *spacer = new QLabel( "", toolBar ); 95 QLabel *spacer = new QLabel( "", toolBar );
96 spacer->setBackgroundColor( toolBar->backgroundColor() ); 96// spacer->setBackgroundColor( toolBar->backgroundColor() );
97 toolBar->setStretchableWidget( spacer ); 97// toolBar->setStretchableWidget( spacer );
98 98
99 99
100 runAction = new QAction( tr( "Apply" ), 100 runAction = new QAction( tr( "Apply" ),
101 Resource::loadPixmap( "oipkg/install" ), 101 Resource::loadPixmap( "oipkg/install" ),
102 QString::null, 0, this, 0 ); 102 QString::null, 0, this, 0 );
103 connect( runAction, SIGNAL( activated() ), 103 connect( runAction, SIGNAL( activated() ),
104 this, SLOT( runIpkg() ) ); 104 this, SLOT( runIpkg() ) );
105 runAction->addTo( toolBar ); 105 runAction->addTo( toolBar );
106 runAction->addTo( srvMenu ); 106 runAction->addTo( srvMenu );
107 107
108 srvMenu->insertSeparator (); 108 srvMenu->insertSeparator ();
109 109
110 updateAction = new QAction( tr( "Update" ), 110 updateAction = new QAction( tr( "Update" ),
111 Resource::loadIconSet( "oipkg/update" ), 111 Resource::loadIconSet( "oipkg/update" ),
112 QString::null, 0, this, 0 ); 112 QString::null, 0, this, 0 );
113 connect( updateAction, SIGNAL( activated() ), 113 connect( updateAction, SIGNAL( activated() ),
114 this , SLOT( updateList() ) ); 114 this , SLOT( updateList() ) );
115 updateAction->addTo( toolBar ); 115 updateAction->addTo( toolBar );
116 updateAction->addTo( srvMenu ); 116 updateAction->addTo( srvMenu );
117 117
118 QAction *cfgact; 118 QAction *cfgact;
119 119
120 cfgact = new QAction( tr( "Setups" ), 120 cfgact = new QAction( tr( "Setups" ),
121 QString::null, 0, this, 0 ); 121 QString::null, 0, this, 0 );
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 5996e63..75f93cf 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -1,154 +1,143 @@
1#include "pmipkg.h" 1#include "pmipkg.h"
2#include "pksettings.h" 2#include "pksettings.h"
3#include "package.h" 3#include "package.h"
4#include "packagelistitem.h" 4#include "packagelistitem.h"
5 5
6#include <qpe/process.h> 6#include <qpe/process.h>
7#include <qpe/resource.h> 7#include <qpe/resource.h>
8#include <qpe/config.h> 8#include <qpe/config.h>
9#include <qpe/stringutil.h> 9#include <qpe/stringutil.h>
10#include <qpe/qpeapplication.h>
10#include <qdir.h> 11#include <qdir.h>
11#include <qfile.h> 12#include <qfile.h>
12#include <qgroupbox.h> 13#include <qgroupbox.h>
13#include <qmultilineedit.h> 14#include <qmultilineedit.h>
14#include <qstring.h> 15#include <qstring.h>
15#include <qcheckbox.h> 16#include <qcheckbox.h>
16#include <qtextstream.h> 17#include <qtextstream.h>
17#include <qtextview.h> 18#include <qtextview.h>
18 19
19#include <qprogressbar.h> 20#include <qprogressbar.h>
20#include <qpushbutton.h> 21#include <qpushbutton.h>
21#include <qlayout.h> 22#include <qlayout.h>
22 23
23#include <stdlib.h> 24#include <stdlib.h>
24#include <unistd.h> 25#include <unistd.h>
25 26
26#include "mainwindow.h" 27#include "mainwindow.h"
27 28
28 29
29PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) 30PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f )
30 : QObject ( p ) 31 : QObject ( p )
31{ 32{
32 settings = s; 33 settings = s;
33 runwindow = new RunWindow( p, name, true, f ); 34 runwindow = new RunWindow( p, name, true, f );
34} 35}
35 36
36PmIpkg::~PmIpkg() 37PmIpkg::~PmIpkg()
37{ 38{
38} 39}
39 40
40//#define PROC 41bool PmIpkg::runIpkg(const QString& args, const QString& dest )
41#define SYSTEM
42#define QT_QPROCESS_DEBUG
43int PmIpkg::runIpkg(const QString& args, const QString& dest )
44{ 42{
45 pvDebug(2,"PmIpkg::runIpkg "+args); 43 bool ret=false;
46 QDir::setCurrent("/tmp"); 44 QDir::setCurrent("/tmp");
47#ifdef PROC
48 QString cmd;
49#endif
50#ifdef SYSTEM
51 QString cmd = "/usr/bin/ipkg "; 45 QString cmd = "/usr/bin/ipkg ";
52#endif
53 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 46 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
54 if ( dest == "" ) 47 if ( dest == "" )
55 cmd += " -dest "+settings->getDestinationName(); 48 cmd += " -dest "+settings->getDestinationName();
56 else 49 else
57 cmd += " -dest "+ dest; 50 cmd += " -dest "+ dest;
58 51
59 cmd += " -force-defaults "; 52 cmd += " -force-defaults ";
60 53
61 if (installDialog->_force_depends) 54 if (installDialog->_force_depends)
62 { 55 {
63 if (installDialog->_force_depends->isChecked()) 56 if (installDialog->_force_depends->isChecked())
64 cmd += " -force-depends "; 57 cmd += " -force-depends ";
65 if (installDialog->_force_reinstall->isChecked()) 58 if (installDialog->_force_reinstall->isChecked())
66 cmd += " -force-reinstall "; 59 cmd += " -force-reinstall ";
67 if (installDialog->_force_remove->isChecked()) 60 if (installDialog->_force_remove->isChecked())
68 cmd += " -force-removal-of-essential-packages "; 61 cmd += " -force-removal-of-essential-packages ";
69 } 62 }
70 63
71 out( "<hr><br>Starting to "+ args+"<br>\n"); 64 out( "Starting to "+ args+"\n");
72 cmd += args; 65 cmd += args;
73 int r = 0; 66 out( "running:\n"+cmd+"\n" );
74#ifdef PROC 67 pvDebug(2,"running:"+cmd);
75 QString o = "start"; 68 qApp->processEvents();
76 Process *ipkg = new Process(QStringList() << "ipkg" << cmd ); 69 FILE *fp;
77 out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); 70 char line[130];
78 QString description; 71 QString lineStr, lineStrOld;
79 r = ipkg->exec("",o); 72 sleep(1);
80 out( o ); 73 cmd +=" 2>&1";
81#endif 74 fp = popen( (const char *) cmd, "r");
82#ifdef SYSTEM 75 if ( !fp ) {
83 out( "running:<br>\n"+cmd+"<br>\n" ); 76 qDebug("Could not execute '" + cmd + "'! err=%d", fp);
84 QString redirect = "/tmp/oipkg.pipe"; 77 pclose(fp);
85 cmd += " 2>&1 | tee "+redirect+" 2>&1"; 78 out("\nError while executing "+ cmd+"\n\n");
86 pvDebug(2, "running >"+cmd+"<"); 79 return false;
87 r = system(cmd.latin1()); 80 } else {
88 QFile f( redirect ); 81 while ( fgets( line, sizeof line, fp)) {
89 QString line; 82 lineStr = line;
90 QString oldLine; 83 lineStr=lineStr.left(lineStr.length()-1);
91 while ( ! f.open(IO_ReadOnly) ) {}; 84 //Configuring opie-oipkg...Done
92 QTextStream t( &f ); 85 if (lineStr.contains("Done"))
93 while ( !t.eof() ) 86 ret = true;
94 { 87 if (lineStr!=lineStrOld)
95 line = t.readLine(); 88 out(lineStr);
96 if ( line != oldLine ) 89 lineStrOld = lineStr;
97 { 90 }
98 out( line +"<br>" ); 91 pclose(fp);
99 oldLine = line; 92 }
100 } 93 //out( "Finished!");
101 } 94 pvDebug(2,QString(ret?"success\n":"failure\n"));
102 f.close(); 95 return ret;
103 out( "Finished!<br>");
104#endif
105
106 return r;
107} 96}
108 97
109void PmIpkg::makeLinks(Package *pack) 98void PmIpkg::makeLinks(Package *pack)
110{ 99{
111 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 100 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
112 linkPackage( pack->name(), pack->dest() ); 101 linkPackage( pack->name(), pack->dest() );
113} 102}
114 103
115QStringList* PmIpkg::getList( QString packFileName, QString d ) 104QStringList* PmIpkg::getList( QString packFileName, QString d )
116{ 105{
117 QString dest = settings->getDestinationUrlByName( d ); 106 QString dest = settings->getDestinationUrlByName( d );
118 dest = dest==""?d:dest; 107 dest = dest==""?d:dest;
119 if (dest == "/" ) return 0; 108 if (dest == "/" ) return 0;
120 { 109 {
121 Config cfg( "oipkg", Config::User ); 110 Config cfg( "oipkg", Config::User );
122 cfg.setGroup( "Common" ); 111 cfg.setGroup( "Common" );
123 QString statusDir = cfg.readEntry( "statusDir", "" ); 112 QString statusDir = cfg.readEntry( "statusDir", "" );
124 } 113 }
125 packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; 114 packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list";
126 QFile f( packFileName ); 115 QFile f( packFileName );
127 if ( ! f.open(IO_ReadOnly) ) 116 if ( ! f.open(IO_ReadOnly) )
128 { 117 {
129 pvDebug(1," Panik! Could not open"); 118 pvDebug(1," Panik! Could not open");
130 out( "<b>Panik!</b> Could not open:<br>"+packFileName ); 119 out( "Panik!\n Could not open:\n"+packFileName );
131 return (QStringList*)0; 120 return (QStringList*)0;
132 } 121 }
133 QStringList *fileList = new QStringList(); 122 QStringList *fileList = new QStringList();
134 QTextStream t( &f ); 123 QTextStream t( &f );
135 while ( !t.eof() ) 124 while ( !t.eof() )
136 { 125 {
137 *fileList += t.readLine(); 126 *fileList += t.readLine();
138 } 127 }
139 return fileList; 128 return fileList;
140} 129}
141 130
142void PmIpkg::linkPackage( QString packFileName, QString dest ) 131void PmIpkg::linkPackage( QString packFileName, QString dest )
143{ 132{
144 QStringList *fileList = getList( packFileName, dest ); 133 QStringList *fileList = getList( packFileName, dest );
145 processFileList( fileList, dest ); 134 processFileList( fileList, dest );
146 delete fileList; 135 delete fileList;
147} 136}
148 137
149void PmIpkg::processFileList( QStringList *fileList, QString d ) 138void PmIpkg::processFileList( QStringList *fileList, QString d )
150{ 139{
151 if (!fileList) return; 140 if (!fileList) return;
152 for (uint i=0; i < fileList->count(); i++) 141 for (uint i=0; i < fileList->count(); i++)
153 { 142 {
154 QString dest = settings->getDestinationUrlByName( d ); 143 QString dest = settings->getDestinationUrlByName( d );
@@ -222,184 +211,174 @@ void PmIpkg::loadList( PackageList *pl )
222 } 211 }
223} 212}
224 213
225void PmIpkg::commit() 214void PmIpkg::commit()
226 { 215 {
227 int sizecount = 0; 216 int sizecount = 0;
228 installDialog = new InstallDialog(settings,0,0,true); 217 installDialog = new InstallDialog(settings,0,0,true);
229 QCheckListItem *toRemoveItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); 218 QCheckListItem *toRemoveItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") );
230 QCheckListItem *toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); 219 QCheckListItem *toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") );
231 toRemoveItem->setOpen( true ); 220 toRemoveItem->setOpen( true );
232 toInstallItem->setOpen( true ); 221 toInstallItem->setOpen( true );
233 for (uint i=0; i < to_remove.count(); i++) 222 for (uint i=0; i < to_remove.count(); i++)
234 { 223 {
235 sizecount += 1; 224 sizecount += 1;
236 toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); 225 toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) );
237 } 226 }
238 for (uint i=0; i < to_install.count(); i++) 227 for (uint i=0; i < to_install.count(); i++)
239 { 228 {
240 sizecount += to_install.at(i)->size().toInt(); 229 sizecount += to_install.at(i)->size().toInt();
241 toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); 230 toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) );
242 } 231 }
243 runwindow->progress->setTotalSteps(sizecount); 232 runwindow->progress->setTotalSteps(sizecount);
244 qDebug("Install size %i",sizecount); 233 qDebug("Install size %i",sizecount);
245 installDialog->showMaximized(); 234 installDialog->showMaximized();
235 installDialog->show();
246 if ( installDialog->exec() ) doIt(); 236 if ( installDialog->exec() ) doIt();
247 installDialog->close(); 237 installDialog->close();
248 runwindow->showMaximized(); 238 runwindow->showMaximized();
249 out(tr("<b>All done.</b>")); 239 runwindow->show();
240 out(tr("\nAll done."));
250} 241}
251 242
252void PmIpkg::doIt() 243void PmIpkg::doIt()
253{ 244{
254 show( true ); 245 runwindow->progress->setProgress(0);
246 show();
255 remove(); 247 remove();
256 install(); 248 install();
257} 249}
258 250
259 251
260void PmIpkg::remove() 252void PmIpkg::remove()
261{ 253{
262 if ( to_remove.count() == 0 ) return; 254 if ( to_remove.count() == 0 ) return;
263 255
264 out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); 256 out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
265 257
266 QStringList *fileList; 258 QStringList *fileList;
267 for (uint i=0; i < to_remove.count(); i++) 259 for (uint i=0; i < to_remove.count(); i++)
268 { 260 {
269 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 261 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
270 if ( runIpkg("remove " + to_remove.at(i)->name(), to_remove.at(i)->dest() ) == 0) 262 if ( runIpkg("remove " + to_remove.at(i)->name(), to_remove.at(i)->dest() ))
271 { 263 {
272 runwindow->progress->setProgress( 1 ); 264 runwindow->progress->setProgress( 1 );
273 linkOpp = removeLink; 265 linkOpp = removeLink;
274 if ( to_remove.at(i)->link() ) 266 if ( to_remove.at(i)->link() )
275 { 267 {
276 out( "<br>removing links<br>" ); 268 out( "\nremoving links\n" );
277 out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"<br>" ); 269 out( "for package "+to_remove.at(i)->name()+" in "+to_remove.at(i)->dest()+"\n" );
278 processFileList( fileList, to_remove.at(i)->dest() ); 270 processFileList( fileList, to_remove.at(i)->dest() );
279 } 271 }
280 to_remove.at(i)->processed(); 272 to_remove.at(i)->processed();
281 to_remove.take( i ); 273 to_remove.take( i );
282 out("<br><hr>"); 274 out("\n\n");
283 }else{ 275 }else{
284 out("<b>"+tr("Error while removing")+"</b><hr>"+to_remove.at(i)->name()); 276 out(tr("Error while removing")+to_remove.at(i)->name()+"\n");
285 } 277 }
286 if ( to_remove.at(i)->link() )delete fileList; 278 if ( to_remove.at(i)->link() )delete fileList;
287 } 279 }
288 to_remove.clear(); 280 to_remove.clear();
289 out("<br>"); 281 out("\n");
290} 282}
291 283
292 284
293void PmIpkg::install() 285void PmIpkg::install()
294{ 286{
295 if ( to_install.count() == 0 ) return; 287 if ( to_install.count() == 0 ) return;
296 out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); 288 out(tr("Installing")+"\n"+tr("please wait")+"\n");
297 for (uint i=0; i < to_install.count(); i++) 289 for (uint i=0; i < to_install.count(); i++)
298 { 290 {
299 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ) == 0 ) 291 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
300 { 292 {
301 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 293 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
302 linkOpp = createLink; 294 linkOpp = createLink;
303 if ( to_install.at(i)->link() ) 295 if ( to_install.at(i)->link() )
304 { 296 {
305 out( "<br>creating links<br>" ); 297 out( "\ncreating links\n" );
306 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"<br>" ); 298 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"\n" );
307 makeLinks( to_install.at(i) ); 299 makeLinks( to_install.at(i) );
308 } 300 }
309 to_install.at(i)->processed(); 301 to_install.at(i)->processed();
310 to_install.take( i ); 302 to_install.take( i );
311 out("<br><hr>"); 303 out("\n\n");
312 }else{ 304 }else{
313 out("<b>"+tr("Error while installing")+"</b><hr>"+to_install.at(i)->name()); 305 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
314 } 306 }
315 } 307 }
316 out("<br>"); 308 out("\n");
317 to_install.clear(); 309 to_install.clear();
318} 310}
319 311
320void PmIpkg::createLinks( const QString &dest ) 312void PmIpkg::createLinks( const QString &dest )
321{ 313{
322 pvDebug(2,"PmIpkg::createLinks "+dest); 314 pvDebug(2,"PmIpkg::createLinks "+dest);
323 linkOpp=createLink; 315 linkOpp=createLink;
324 QString url = settings->getDestinationUrlByName( dest ); 316 QString url = settings->getDestinationUrlByName( dest );
325 url = url==""?dest:url; 317 url = url==""?dest:url;
326 processLinkDir( "/opt", url ); 318 processLinkDir( "/opt", url );
327 processLinkDir( "/usr", url ); 319 processLinkDir( "/usr", url );
328} 320}
329 321
330void PmIpkg::removeLinks( const QString &dest ) 322void PmIpkg::removeLinks( const QString &dest )
331{ 323{
332 pvDebug(2,"PmIpkg::removeLinks "+dest); 324 pvDebug(2,"PmIpkg::removeLinks "+dest);
333 linkOpp=removeLink; 325 linkOpp=removeLink;
334 QString url = settings->getDestinationUrlByName( dest ); 326 QString url = settings->getDestinationUrlByName( dest );
335 url = url==""?dest:url; 327 url = url==""?dest:url;
336 processLinkDir( "/opt", url ); 328 processLinkDir( "/opt", url );
337 processLinkDir( "/usr", url ); 329 processLinkDir( "/usr", url );
338} 330}
339 331
340void PmIpkg::update() 332void PmIpkg::update()
341{ 333{
342 show( false ); 334 show();
343 runIpkg( "update" ); 335 runIpkg( "update" );
344 runwindow->close(); 336 runwindow->close();
345} 337}
346 338
347void PmIpkg::out( QString o ) 339void PmIpkg::out( QString o )
348{ 340{
349 runwindow->outPut->append(o); 341 runwindow->outPut->append(o);
350 //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); 342 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE);
351 //runwindow->outPut->setText( runwindow->outPut->text()+o );
352 runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight());
353} 343}
354 344
355 345
356void PmIpkg::showButtons(bool b)
357{
358 if ( b )
359 {
360 runwindow->cancelButton->hide();
361 runwindow->doItButton->hide();
362 runwindow->removeButton->hide();
363 runwindow->installButton->hide();
364 }else{
365 runwindow->cancelButton->show();
366 runwindow->doItButton->show();
367 runwindow->removeButton->show();
368 runwindow->installButton->show();
369 346
370 }
371}
372 347
373void PmIpkg::show(bool b) 348void PmIpkg::show()
374{ 349{
375 if (!runwindow->isVisible()) 350 if (!runwindow->isVisible())
351 {
376 runwindow->showMaximized(); 352 runwindow->showMaximized();
377 showButtons(b); 353 runwindow->show();
378 if ( !b ) 354 }
379 runwindow->progress->hide(); 355 runwindow->outPut->setText("");
380 else 356 //showButtons(b);
381 runwindow->progress->show(); 357 //if ( !b )
358 // runwindow->progress->hide();
359// else
360 // runwindow->progress->show();
382} 361}
383 362
384void PmIpkg::installFile(const QString &fileName, const QString &dest) 363void PmIpkg::installFile(const QString &fileName, const QString &dest)
385{ 364{
386 365
387 to_install.clear(); 366 to_install.clear();
388 to_remove.clear(); 367 to_remove.clear();
389 pvDebug( 2,"PmIpkg::installFile "+ fileName); 368 pvDebug( 2,"PmIpkg::installFile "+ fileName);
390 Package *p = new Package(fileName,settings); 369 Package *p = new Package(fileName,settings);
391 if ( dest!="") p->setDest( dest ); 370 if ( dest!="") p->setDest( dest );
392 to_install.append( p ); 371 to_install.append( p );
393 commit(); 372 commit();
394 delete p; 373 delete p;
395} 374}
396 375
397void PmIpkg::removeFile(const QString &fileName, const QString &dest) 376void PmIpkg::removeFile(const QString &fileName, const QString &dest)
398{ 377{
399 378
400 to_install.clear(); 379 to_install.clear();
401 to_remove.clear(); 380 to_remove.clear();
402 pvDebug( 2,"PmIpkg::removeFile "+ fileName); 381 pvDebug( 2,"PmIpkg::removeFile "+ fileName);
403 Package *p = new Package(fileName,settings); 382 Package *p = new Package(fileName,settings);
404 if ( dest!="") p->setDest( dest ); 383 if ( dest!="") p->setDest( dest );
405 to_remove.append( p ); 384 to_remove.append( p );
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index 7bc62f1..f8ac39a 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -6,59 +6,58 @@
6#include <qlist.h> 6#include <qlist.h>
7#include <qstring.h> 7#include <qstring.h>
8#include <qwidget.h> 8#include <qwidget.h>
9#include "pksettings.h" 9#include "pksettings.h"
10#include "runwindow.h" 10#include "runwindow.h"
11#include "packagelist.h" 11#include "packagelist.h"
12#include "installdialog.h" 12#include "installdialog.h"
13#include "debug.h" 13#include "debug.h"
14 14
15#define createLink 0 15#define createLink 0
16#define removeLink 1 16#define removeLink 1
17 17
18class Package; 18class Package;
19class PmIpkg : public QObject 19class PmIpkg : public QObject
20{ 20{
21 Q_OBJECT 21 Q_OBJECT
22public: 22public:
23 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); 23 PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 );
24 ~PmIpkg(); 24 ~PmIpkg();
25 25
26 int linkOpp; 26 int linkOpp;
27 void loadList( PackageList* ); 27 void loadList( PackageList* );
28 void commit(); 28 void commit();
29 void update(); 29 void update();
30 void showButtons(bool b=true); 30 void show();
31 void show( bool buttons=true );
32 31
33public slots: 32public slots:
34 void doIt(); 33 void doIt();
35 void install(); 34 void install();
36 void remove(); 35 void remove();
37 void installFile(const QString &fileName, const QString &dest=""); 36 void installFile(const QString &fileName, const QString &dest="");
38 void removeFile(const QString &fileName, const QString &dest=""); 37 void removeFile(const QString &fileName, const QString &dest="");
39 void createLinks( const QString &dest ); 38 void createLinks( const QString &dest );
40 void removeLinks( const QString &dest ); 39 void removeLinks( const QString &dest );
41 40
42private: 41private:
43 PackageManagerSettings* settings; 42 PackageManagerSettings* settings;
44 RunWindow *runwindow; 43 RunWindow *runwindow;
45 InstallDialog *installDialog; 44 InstallDialog *installDialog;
46 QList<Package> to_remove; 45 QList<Package> to_remove;
47 QList<Package> to_install; 46 QList<Package> to_install;
48 QString fileNameToInstall; 47 QString fileNameToInstall;
49 QCheckBox *_force_reinstall; 48 QCheckBox *_force_reinstall;
50 QCheckBox *_force_remove; 49 QCheckBox *_force_remove;
51 QCheckBox *_force_depends; 50 QCheckBox *_force_depends;
52 void startDialog(); 51 void startDialog();
53 void makeLinks(Package*); 52 void makeLinks(Package*);
54 void linkPackage( QString, QString ); 53 void linkPackage( QString, QString );
55 void processLinkDir( QString , QString ); 54 void processLinkDir( QString , QString );
56 int runIpkg(const QString& args, const QString& dest="" ); 55 bool runIpkg(const QString& args, const QString& dest="" );
57 void out( QString ); 56 void out( QString );
58 QStringList* getList( QString, QString ); 57 QStringList* getList( QString, QString );
59 void processFileList( QStringList*, QString ); 58 void processFileList( QStringList*, QString );
60 59
61 60
62}; 61};
63 62
64#endif 63#endif
diff --git a/noncore/unsupported/oipkg/runwindow.ui b/noncore/unsupported/oipkg/runwindow.ui
index 8582ce8..839e151 100644
--- a/noncore/unsupported/oipkg/runwindow.ui
+++ b/noncore/unsupported/oipkg/runwindow.ui
@@ -1,171 +1,67 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>RunWindow</class> 2<class>RunWindow</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>RunWindow</cstring> 7 <cstring>RunWindow</cstring>
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>344</width> 14 <width>340</width>
15 <height>442</height> 15 <height>442</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>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
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>2</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" >
38 <class>QProgressBar</class> 38 <class>QProgressBar</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>progress</cstring> 41 <cstring>progress</cstring>
42 </property> 42 </property>
43 <property stdset="1"> 43 <property stdset="1">
44 <name>progress</name> 44 <name>progress</name>
45 <number>0</number> 45 <number>0</number>
46 </property> 46 </property>
47 </widget> 47 </widget>
48 <widget row="3" column="0" >
49 <class>QLayoutWidget</class>
50 <property stdset="1">
51 <name>name</name>
52 <cstring>buttons</cstring>
53 </property>
54 <hbox>
55 <property stdset="1">
56 <name>margin</name>
57 <number>0</number>
58 </property>
59 <property stdset="1">
60 <name>spacing</name>
61 <number>6</number>
62 </property>
63 <widget>
64 <class>QPushButton</class>
65 <property stdset="1">
66 <name>name</name>
67 <cstring>doItButton</cstring>
68 </property>
69 <property stdset="1">
70 <name>sizePolicy</name>
71 <sizepolicy>
72 <hsizetype>0</hsizetype>
73 <vsizetype>0</vsizetype>
74 </sizepolicy>
75 </property>
76 <property stdset="1">
77 <name>font</name>
78 <font>
79 <pointsize>8</pointsize>
80 </font>
81 </property>
82 <property stdset="1">
83 <name>text</name>
84 <string>Do all </string>
85 </property>
86 <property stdset="1">
87 <name>autoResize</name>
88 <bool>false</bool>
89 </property>
90 </widget>
91 <widget>
92 <class>QPushButton</class>
93 <property stdset="1">
94 <name>name</name>
95 <cstring>installButton</cstring>
96 </property>
97 <property stdset="1">
98 <name>font</name>
99 <font>
100 <pointsize>8</pointsize>
101 </font>
102 </property>
103 <property stdset="1">
104 <name>text</name>
105 <string>Install</string>
106 </property>
107 <property stdset="1">
108 <name>autoResize</name>
109 <bool>true</bool>
110 </property>
111 </widget>
112 <widget>
113 <class>QPushButton</class>
114 <property stdset="1">
115 <name>name</name>
116 <cstring>removeButton</cstring>
117 </property>
118 <property stdset="1">
119 <name>font</name>
120 <font>
121 <pointsize>7</pointsize>
122 </font>
123 </property>
124 <property stdset="1">
125 <name>text</name>
126 <string>Remove</string>
127 </property>
128 <property stdset="1">
129 <name>autoResize</name>
130 <bool>true</bool>
131 </property>
132 </widget>
133 <widget>
134 <class>QPushButton</class>
135 <property stdset="1">
136 <name>name</name>
137 <cstring>cancelButton</cstring>
138 </property>
139 <property stdset="1">
140 <name>font</name>
141 <font>
142 <pointsize>8</pointsize>
143 </font>
144 </property>
145 <property stdset="1">
146 <name>text</name>
147 <string>Cancel</string>
148 </property>
149 <property stdset="1">
150 <name>autoResize</name>
151 <bool>true</bool>
152 </property>
153 </widget>
154 </hbox>
155 </widget>
156 <widget row="1" column="0" > 48 <widget row="1" column="0" >
157 <class>QTextView</class> 49 <class>QMultiLineEdit</class>
158 <property stdset="1"> 50 <property stdset="1">
159 <name>name</name> 51 <name>name</name>
160 <cstring>outPut</cstring> 52 <cstring>outPut</cstring>
161 </property> 53 </property>
162 <property stdset="1"> 54 <property stdset="1">
163 <name>font</name> 55 <name>font</name>
164 <font> 56 <font>
165 <pointsize>6</pointsize> 57 <pointsize>8</pointsize>
166 </font> 58 </font>
167 </property> 59 </property>
60 <property stdset="1">
61 <name>wordWrap</name>
62 <enum>WidgetWidth</enum>
63 </property>
168 </widget> 64 </widget>
169 </grid> 65 </grid>
170</widget> 66</widget>
171</UI> 67</UI>