-rw-r--r-- | noncore/unsupported/oipkg/TODO | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 18 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 5 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 40 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 4 |
5 files changed, 65 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO index 744cba4..b07542a 100644 --- a/noncore/unsupported/oipkg/TODO +++ b/noncore/unsupported/oipkg/TODO | |||
@@ -1 +1,2 @@ | |||
1 | * setDocument function | ||
1 | * Settings Class | 2 | * Settings Class |
@@ -8 +9,2 @@ | |||
8 | * manage links | 9 | * manage links |
10 | * dependency checking \ No newline at end of file | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 25ca889..e3abf36 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -35,2 +35,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
35 | 35 | ||
36 | channel = new QCopChannel( "QPE/Application/oipkg", this ); | ||
37 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | ||
38 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | ||
39 | |||
36 | makeMenu(); | 40 | makeMenu(); |
@@ -418 +422,15 @@ void MainWindow::stopTimer( QListViewItem* ) | |||
418 | } | 422 | } |
423 | |||
424 | void MainWindow::setDocument(const QString &fileName) | ||
425 | { | ||
426 | ipkg->installFile( fileName ); | ||
427 | } | ||
428 | |||
429 | void MainWindow::receive(const QCString &msg, const QByteArray &arg) | ||
430 | { | ||
431 | pvDebug(3, "QCop "+msg); | ||
432 | if ( msg == "setDocument(QString)" ) | ||
433 | { | ||
434 | setDocument( QString(arg) ); | ||
435 | } | ||
436 | } \ No newline at end of file | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index adc5e78..34943f2 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -18,2 +18,3 @@ class QListView; | |||
18 | class PackageListItem; | 18 | class PackageListItem; |
19 | class QCopChannel; | ||
19 | 20 | ||
@@ -28,2 +29,4 @@ public: | |||
28 | 29 | ||
30 | QCopChannel *channel; | ||
31 | |||
29 | protected slots: | 32 | protected slots: |
@@ -38,2 +41,3 @@ protected slots: | |||
38 | void showSettingsDst(); | 41 | void showSettingsDst(); |
42 | void setDocument (const QString &); | ||
39 | 43 | ||
@@ -51,2 +55,3 @@ public slots: | |||
51 | void stopTimer( QListViewItem* ); | 55 | void stopTimer( QListViewItem* ); |
56 | void receive (const QCString &, const QByteArray &); | ||
52 | 57 | ||
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 | |||
@@ -113,6 +113,11 @@ void PmIpkg::makeLinks(Package *pack) | |||
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; |
@@ -209,3 +214,3 @@ void PmIpkg::commit( PackageList pl ) | |||
209 | runwindow->exec(); | 214 | runwindow->exec(); |
210 | return; | 215 | out("<h1>"+tr("Its now save to close this window")+"<h1>"); |
211 | } | 216 | } |
@@ -316 +321,28 @@ void PmIpkg::show(bool b) | |||
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 | ||
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index c57adb7..8e06f4c 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -33,4 +33,6 @@ private: | |||
33 | bool runwindowopen; | 33 | bool runwindowopen; |
34 | QString fileNameToInstall; | ||
34 | 35 | ||
35 | void makeLinks(Package*); | 36 | void makeLinks(Package*); |
37 | void linkPackage( QString, QString ); | ||
36 | void processLinkDir( QString, QString ); | 38 | void processLinkDir( QString, QString ); |
@@ -42,3 +44,5 @@ public slots: | |||
42 | void install(); | 44 | void install(); |
45 | void installFileName(); | ||
43 | void remove(); | 46 | void remove(); |
47 | void installFile(const QString &fileName); | ||
44 | void linkDestination( const QString, const QByteArray ); | 48 | void linkDestination( const QString, const QByteArray ); |