summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp40
1 files changed, 36 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 3b31b4d..45c89c5 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -108,16 +108,21 @@ void PmIpkg::makeLinks(Package *pack)
108 { 108 {
109 Config cfg( "oipkg", Config::User ); 109 Config cfg( "oipkg", Config::User );
110 cfg.setGroup( "Common" ); 110 cfg.setGroup( "Common" );
111 QString statusDir = cfg.readEntry( "statusDir", "" ); 111 QString statusDir = cfg.readEntry( "statusDir", "" );
112 } 112 }
113 QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list"; 113 QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list";
114 QFile f( fn ); 114 linkPackage( fn, dest );
115 if ( ! f.open(IO_ReadOnly) ) 115}
116
117void PmIpkg::linkPackage( QString packFileName, QString dest )
118{
119 QFile f( packFileName );
120 if ( ! f.open(IO_ReadOnly) )
116 { 121 {
117 out( "<b>Panik!</b> Could not open:<br>"+fn ); 122 out( "<b>Panik!</b> Could not open:<br>"+packFileName );
118 return; 123 return;
119 }; 124 };
120 QTextStream t( &f ); 125 QTextStream t( &f );
121 QString fp; 126 QString fp;
122 while ( !t.eof() ) 127 while ( !t.eof() )
123 { 128 {
@@ -204,13 +209,13 @@ void PmIpkg::commit( PackageList pl )
204 connect( runwindow->removeButton, SIGNAL( clicked() ), 209 connect( runwindow->removeButton, SIGNAL( clicked() ),
205 this, SLOT( remove() ) ); 210 this, SLOT( remove() ) );
206 connect( runwindow->cancelButton, SIGNAL( clicked() ), 211 connect( runwindow->cancelButton, SIGNAL( clicked() ),
207 runwindow, SLOT( close() ) ); 212 runwindow, SLOT( close() ) );
208 213
209 runwindow->exec(); 214 runwindow->exec();
210 return; 215 out("<h1>"+tr("Its now save to close this window")+"<h1>");
211} 216}
212 217
213void PmIpkg::doIt() 218void PmIpkg::doIt()
214{ 219{
215 remove(); 220 remove();
216 install(); 221 install();
@@ -311,6 +316,33 @@ void PmIpkg::show(bool b)
311 showButtons(b); 316 showButtons(b);
312 if ( b ) 317 if ( b )
313 runwindow->progress->hide(); 318 runwindow->progress->hide();
314 else 319 else
315 runwindow->progress->show(); 320 runwindow->progress->show();
316} 321}
322
323void PmIpkg::installFile(const QString &fileName)
324{
325 pvDebug( 2,"PmIpkg::installFile "+ fileName);
326 show( false );
327 runwindow->outPut->setText("");
328 fileNameToInstall = fileName;
329 runwindow->doItButton->hide();
330 runwindow->removeButton->hide();
331 out("<b>"+tr("Install: ")+fileName);
332 connect( runwindow->installButton, SIGNAL( clicked() ),
333 this, SLOT( installFileName() ) );
334 connect( runwindow->cancelButton, SIGNAL( clicked() ),
335 runwindow, SLOT( close() ) );
336
337 runwindow->exec();
338}
339
340void PmIpkg::installFileName()
341{
342 if ( !QFile::exists( fileNameToInstall ) ) return;
343 out(tr("Installing pacakge ")+fileNameToInstall+"<br>"+tr("please wait")+"</b><br>");
344 runIpkg("install " + fileNameToInstall );
345 if ( settings->createLinks() )
346 linkPackage( fileNameToInstall, settings->getDestinationUrl() );
347 out("<h1>"+tr("Its now save to close this window")+"<h1>");
348} \ No newline at end of file