summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
authortille <tille>2002-04-27 14:35:48 (UTC)
committer tille <tille>2002-04-27 14:35:48 (UTC)
commit320532727fc7dfbe9760d0eea0e17b8e1230fc8e (patch) (side-by-side diff)
treed65575cdd4c89e6a531b178de04198f39d8276c0 /noncore/unsupported/oipkg/pmipkg.cpp
parentdb90999f6298c1107888f062f2c25cb8817b528a (diff)
downloadopie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.zip
opie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.tar.gz
opie-320532727fc7dfbe9760d0eea0e17b8e1230fc8e.tar.bz2
added setDocument and a qcop call to install a file
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
@@ -111,10 +111,15 @@ void PmIpkg::makeLinks(Package *pack)
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 );
@@ -207,7 +212,7 @@ void PmIpkg::commit( PackageList pl )
runwindow, SLOT( close() ) );
runwindow->exec();
- return;
+ out("<h1>"+tr("Its now save to close this window")+"<h1>");
}
void PmIpkg::doIt()
@@ -314,3 +319,30 @@ void PmIpkg::show(bool b)
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