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 | |||
@@ -106,20 +106,25 @@ void PmIpkg::makeLinks(Package *pack) | |||
106 | out( "<br>creating links<br>" ); | 106 | out( "<br>creating links<br>" ); |
107 | out("for package "+pack->name()+" in "+dest+"<br>"); | 107 | out("for package "+pack->name()+" in "+dest+"<br>"); |
108 | { | 108 | { |
109 | Config cfg( "oipkg", Config::User ); | 109 | Config cfg( "oipkg", Config::User ); |
110 | cfg.setGroup( "Common" ); | 110 | cfg.setGroup( "Common" ); |
111 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 111 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
112 | } | 112 | } |
113 | QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list"; | 113 | QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list"; |
114 | QFile f( fn ); | 114 | linkPackage( fn, dest ); |
115 | if ( ! f.open(IO_ReadOnly) ) | 115 | } |
116 | |||
117 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | ||
118 | { | ||
119 | QFile f( packFileName ); | ||
120 | if ( ! f.open(IO_ReadOnly) ) | ||
116 | { | 121 | { |
117 | out( "<b>Panik!</b> Could not open:<br>"+fn ); | 122 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); |
118 | return; | 123 | return; |
119 | }; | 124 | }; |
120 | QTextStream t( &f ); | 125 | QTextStream t( &f ); |
121 | QString fp; | 126 | QString fp; |
122 | while ( !t.eof() ) | 127 | while ( !t.eof() ) |
123 | { | 128 | { |
124 | fp = t.readLine(); | 129 | fp = t.readLine(); |
125 | processLinkDir( fp, dest ); | 130 | processLinkDir( fp, dest ); |
@@ -202,17 +207,17 @@ void PmIpkg::commit( PackageList pl ) | |||
202 | connect( runwindow->installButton, SIGNAL( clicked() ), | 207 | connect( runwindow->installButton, SIGNAL( clicked() ), |
203 | this, SLOT( install() ) ); | 208 | this, SLOT( install() ) ); |
204 | connect( runwindow->removeButton, SIGNAL( clicked() ), | 209 | connect( runwindow->removeButton, SIGNAL( clicked() ), |
205 | this, SLOT( remove() ) ); | 210 | this, SLOT( remove() ) ); |
206 | connect( runwindow->cancelButton, SIGNAL( clicked() ), | 211 | connect( runwindow->cancelButton, SIGNAL( clicked() ), |
207 | runwindow, SLOT( close() ) ); | 212 | runwindow, SLOT( close() ) ); |
208 | 213 | ||
209 | runwindow->exec(); | 214 | runwindow->exec(); |
210 | return; | 215 | out("<h1>"+tr("Its now save to close this window")+"<h1>"); |
211 | } | 216 | } |
212 | 217 | ||
213 | void PmIpkg::doIt() | 218 | void PmIpkg::doIt() |
214 | { | 219 | { |
215 | remove(); | 220 | remove(); |
216 | install(); | 221 | install(); |
217 | } | 222 | } |
218 | 223 | ||
@@ -309,8 +314,35 @@ void PmIpkg::show(bool b) | |||
309 | if (!runwindow->isVisible()) | 314 | if (!runwindow->isVisible()) |
310 | runwindow->showMaximized(); | 315 | runwindow->showMaximized(); |
311 | showButtons(b); | 316 | showButtons(b); |
312 | if ( b ) | 317 | if ( b ) |
313 | runwindow->progress->hide(); | 318 | runwindow->progress->hide(); |
314 | else | 319 | else |
315 | runwindow->progress->show(); | 320 | runwindow->progress->show(); |
316 | } | 321 | } |
322 | |||
323 | void PmIpkg::installFile(const QString &fileName) | ||
324 | { | ||
325 | pvDebug( 2,"PmIpkg::installFile "+ fileName); | ||
326 | show( false ); | ||
327 | runwindow->outPut->setText(""); | ||
328 | fileNameToInstall = fileName; | ||
329 | runwindow->doItButton->hide(); | ||
330 | runwindow->removeButton->hide(); | ||
331 | out("<b>"+tr("Install: ")+fileName); | ||
332 | connect( runwindow->installButton, SIGNAL( clicked() ), | ||
333 | this, SLOT( installFileName() ) ); | ||
334 | connect( runwindow->cancelButton, SIGNAL( clicked() ), | ||
335 | runwindow, SLOT( close() ) ); | ||
336 | |||
337 | runwindow->exec(); | ||
338 | } | ||
339 | |||
340 | void PmIpkg::installFileName() | ||
341 | { | ||
342 | if ( !QFile::exists( fileNameToInstall ) ) return; | ||
343 | out(tr("Installing pacakge ")+fileNameToInstall+"<br>"+tr("please wait")+"</b><br>"); | ||
344 | runIpkg("install " + fileNameToInstall ); | ||
345 | if ( settings->createLinks() ) | ||
346 | linkPackage( fileNameToInstall, settings->getDestinationUrl() ); | ||
347 | out("<h1>"+tr("Its now save to close this window")+"<h1>"); | ||
348 | } \ No newline at end of file | ||