Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 40 |
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 @@ -110,12 +110,17 @@ void PmIpkg::makeLinks(Package *pack) cfg.setGroup( "Common" ); QString statusDir = cfg.readEntry( "statusDir", "" ); } QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list"; - QFile f( fn ); - if ( ! f.open(IO_ReadOnly) ) + linkPackage( fn, dest ); +} + +void PmIpkg::linkPackage( QString packFileName, QString dest ) +{ + QFile f( packFileName ); + if ( ! f.open(IO_ReadOnly) ) { - out( "<b>Panik!</b> Could not open:<br>"+fn ); + out( "<b>Panik!</b> Could not open:<br>"+packFileName ); return; }; QTextStream t( &f ); QString fp; @@ -206,9 +211,9 @@ void PmIpkg::commit( PackageList pl ) connect( runwindow->cancelButton, SIGNAL( clicked() ), runwindow, SLOT( close() ) ); runwindow->exec(); - return; + out("<h1>"+tr("Its now save to close this window")+"<h1>"); } void PmIpkg::doIt() { @@ -313,4 +318,31 @@ void PmIpkg::show(bool b) runwindow->progress->hide(); else runwindow->progress->show(); } + +void PmIpkg::installFile(const QString &fileName) +{ + pvDebug( 2,"PmIpkg::installFile "+ fileName); + show( false ); + runwindow->outPut->setText(""); + fileNameToInstall = fileName; + runwindow->doItButton->hide(); + runwindow->removeButton->hide(); + out("<b>"+tr("Install: ")+fileName); + connect( runwindow->installButton, SIGNAL( clicked() ), + this, SLOT( installFileName() ) ); + connect( runwindow->cancelButton, SIGNAL( clicked() ), + runwindow, SLOT( close() ) ); + + runwindow->exec(); +} + +void PmIpkg::installFileName() +{ + if ( !QFile::exists( fileNameToInstall ) ) return; + out(tr("Installing pacakge ")+fileNameToInstall+"<br>"+tr("please wait")+"</b><br>"); + runIpkg("install " + fileNameToInstall ); + if ( settings->createLinks() ) + linkPackage( fileNameToInstall, settings->getDestinationUrl() ); + out("<h1>"+tr("Its now save to close this window")+"<h1>"); +}
\ No newline at end of file |