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 @@ -112,8 +112,13 @@ void PmIpkg::makeLinks(Package *pack) } 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; }; @@ -208,5 +213,5 @@ void PmIpkg::commit( PackageList pl ) runwindow->exec(); - return; + out("<h1>"+tr("Its now save to close this window")+"<h1>"); } @@ -315,2 +320,29 @@ void PmIpkg::show(bool b) 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 |