summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Side-by-side diff
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)
{
Config cfg( "oipkg", Config::User );
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;
while ( !t.eof() )
{
@@ -204,13 +209,13 @@ void PmIpkg::commit( PackageList pl )
connect( runwindow->removeButton, SIGNAL( clicked() ),
this, SLOT( remove() ) );
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()
{
remove();
install();
@@ -311,6 +316,33 @@ void PmIpkg::show(bool b)
showButtons(b);
if ( 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