author | tille <tille> | 2002-04-27 14:35:48 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-27 14:35:48 (UTC) |
commit | 320532727fc7dfbe9760d0eea0e17b8e1230fc8e (patch) (side-by-side diff) | |
tree | d65575cdd4c89e6a531b178de04198f39d8276c0 /noncore/unsupported/oipkg/pmipkg.cpp | |
parent | db90999f6298c1107888f062f2c25cb8817b528a (diff) | |
download | opie-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.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 |