author | tille <tille> | 2002-04-27 14:35:48 (UTC) |
---|---|---|
committer | tille <tille> | 2002-04-27 14:35:48 (UTC) |
commit | 320532727fc7dfbe9760d0eea0e17b8e1230fc8e (patch) (unidiff) | |
tree | d65575cdd4c89e6a531b178de04198f39d8276c0 /noncore/unsupported | |
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
-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 | 38 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 4 |
5 files changed, 64 insertions, 3 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,8 +1,10 @@ | |||
1 | * setDocument function | ||
1 | * Settings Class | 2 | * Settings Class |
2 | * tr() ;) | 3 | * tr() ;) |
3 | * Dialog to display ipkg output live | 4 | * Dialog to display ipkg output live |
4 | * parse "to install" and "to remove" from status | 5 | * parse "to install" and "to remove" from status |
5 | * install local file | 6 | * install local file |
6 | * qcop | 7 | * qcop |
7 | * error handling | 8 | * error handling |
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 | |||
@@ -12,48 +12,52 @@ | |||
12 | #include <qmessagebox.h> | 12 | #include <qmessagebox.h> |
13 | #include <qpopupmenu.h> | 13 | #include <qpopupmenu.h> |
14 | #include <qtoolbutton.h> | 14 | #include <qtoolbutton.h> |
15 | #include <qstring.h> | 15 | #include <qstring.h> |
16 | #include <qlabel.h> | 16 | #include <qlabel.h> |
17 | #include <qlistview.h> | 17 | #include <qlistview.h> |
18 | #include <qtextview.h> | 18 | #include <qtextview.h> |
19 | #include <qlineedit.h> | 19 | #include <qlineedit.h> |
20 | #include <qtabwidget.h> | 20 | #include <qtabwidget.h> |
21 | #include <qcombobox.h> | 21 | #include <qcombobox.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | 23 | ||
24 | #include "pksettingsbase.h" | 24 | #include "pksettingsbase.h" |
25 | #include "packagelistitem.h" | 25 | #include "packagelistitem.h" |
26 | 26 | ||
27 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 27 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
28 | QMainWindow( parent, name, f ) | 28 | QMainWindow( parent, name, f ) |
29 | { | 29 | { |
30 | setCaption( tr("Package Manager") ); | 30 | setCaption( tr("Package Manager") ); |
31 | 31 | ||
32 | listViewPackages = new QListView( this,0,0 ); | 32 | listViewPackages = new QListView( this,0,0 ); |
33 | listViewPackages->setSelectionMode(QListView::NoSelection); | 33 | listViewPackages->setSelectionMode(QListView::NoSelection); |
34 | setCentralWidget( listViewPackages ); | 34 | setCentralWidget( listViewPackages ); |
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(); |
37 | #ifdef NEWLAYOUT | 41 | #ifdef NEWLAYOUT |
38 | listViewPackages->addColumn( tr("Package") ); | 42 | listViewPackages->addColumn( tr("Package") ); |
39 | listViewPackages->setRootIsDecorated( true ); | 43 | listViewPackages->setRootIsDecorated( true ); |
40 | #endif | 44 | #endif |
41 | #ifndef NEWLAYOUT | 45 | #ifndef NEWLAYOUT |
42 | QFontMetrics fm = fontMetrics(); | 46 | QFontMetrics fm = fontMetrics(); |
43 | int wlw = width()*2; | 47 | int wlw = width()*2; |
44 | int w0 = fm.width(tr("Package"))+30; | 48 | int w0 = fm.width(tr("Package"))+30; |
45 | // int w0 = fm.width(tr("Package"))+30; | 49 | // int w0 = fm.width(tr("Package"))+30; |
46 | int w2 = fm.width("00000")+4; | 50 | int w2 = fm.width("00000")+4; |
47 | int w1 = wlw-w2-w0-24; | 51 | int w1 = wlw-w2-w0-24; |
48 | listViewPackages->addColumn( tr("Package"), w0 ); | 52 | listViewPackages->addColumn( tr("Package"), w0 ); |
49 | listViewPackages->addColumn( tr("Description"), w1 ); | 53 | listViewPackages->addColumn( tr("Description"), w1 ); |
50 | listViewPackages->addColumn( tr("Size"), w2 ); | 54 | listViewPackages->addColumn( tr("Size"), w2 ); |
51 | listViewPackages->setColumnWidthMode(0,QListView::Manual); | 55 | listViewPackages->setColumnWidthMode(0,QListView::Manual); |
52 | listViewPackages->setColumnWidthMode(1,QListView::Manual); | 56 | listViewPackages->setColumnWidthMode(1,QListView::Manual); |
53 | listViewPackages->setColumnWidthMode(2,QListView::Manual); | 57 | listViewPackages->setColumnWidthMode(2,QListView::Manual); |
54 | listViewPackages->setSelectionMode( QListView::Multi ); | 58 | listViewPackages->setSelectionMode( QListView::Multi ); |
55 | #endif | 59 | #endif |
56 | connect( section, SIGNAL( activated(int) ), | 60 | connect( section, SIGNAL( activated(int) ), |
57 | this, SLOT( sectionChanged() ) ); | 61 | this, SLOT( sectionChanged() ) ); |
58 | connect( subsection, SIGNAL(activated(int) ), | 62 | connect( subsection, SIGNAL(activated(int) ), |
59 | this, SLOT( subSectionChanged() ) ); | 63 | this, SLOT( subSectionChanged() ) ); |
@@ -395,24 +399,38 @@ void MainWindow::showPopup() | |||
395 | QStringList dests = settings->getDestinationNames(); | 399 | QStringList dests = settings->getDestinationNames(); |
396 | for (uint i = 0; i < dests.count(); i++ ) | 400 | for (uint i = 0; i < dests.count(); i++ ) |
397 | { | 401 | { |
398 | popupAction = new QAction( dests[i], QString::null, 0, this, 0 ); | 402 | popupAction = new QAction( dests[i], QString::null, 0, this, 0 ); |
399 | popupAction->addTo( destsMenu ); | 403 | popupAction->addTo( destsMenu ); |
400 | } | 404 | } |
401 | connect( destsMenu, SIGNAL( activated( int ) ), | 405 | connect( destsMenu, SIGNAL( activated( int ) ), |
402 | this, SLOT( changePackageDest( int ) ) ); | 406 | this, SLOT( changePackageDest( int ) ) ); |
403 | popupMenu->popup( QCursor::pos() ); | 407 | popupMenu->popup( QCursor::pos() ); |
404 | } | 408 | } |
405 | 409 | ||
406 | void MainWindow::changePackageDest( int i ) | 410 | void MainWindow::changePackageDest( int i ) |
407 | { | 411 | { |
408 | activePackage->setDest( destsMenu->text(i) ); | 412 | activePackage->setDest( destsMenu->text(i) ); |
409 | activePackage->setOn(); | 413 | activePackage->setOn(); |
410 | activePackage->setLink( settings->createLinks() ); | 414 | activePackage->setLink( settings->createLinks() ); |
411 | activePackageListItem->displayDetails(); | 415 | activePackageListItem->displayDetails(); |
412 | } | 416 | } |
413 | 417 | ||
414 | void MainWindow::stopTimer( QListViewItem* ) | 418 | void MainWindow::stopTimer( QListViewItem* ) |
415 | { | 419 | { |
416 | pvDebug( 5, "stop timer" ); | 420 | pvDebug( 5, "stop timer" ); |
417 | popupTimer->stop(); | 421 | popupTimer->stop(); |
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 | |||
@@ -1,75 +1,80 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qpopupmenu.h> | 7 | #include <qpopupmenu.h> |
8 | 8 | ||
9 | #include "packagelist.h" | 9 | #include "packagelist.h" |
10 | #include "pmipkg.h" | 10 | #include "pmipkg.h" |
11 | #include "pksettings.h" | 11 | #include "pksettings.h" |
12 | #include "pkdesc.h" | 12 | #include "pkdesc.h" |
13 | 13 | ||
14 | class QComboBox; | 14 | class QComboBox; |
15 | class QPEToolBar; | 15 | class QPEToolBar; |
16 | class QLineEdit; | 16 | class QLineEdit; |
17 | class QListView; | 17 | class QListView; |
18 | class PackageListItem; | 18 | class PackageListItem; |
19 | class QCopChannel; | ||
19 | 20 | ||
20 | class MainWindow : public QMainWindow | 21 | class MainWindow : public QMainWindow |
21 | { | 22 | { |
22 | Q_OBJECT | 23 | Q_OBJECT |
23 | 24 | ||
24 | 25 | ||
25 | public: | 26 | public: |
26 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 27 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
27 | ~MainWindow(); | 28 | ~MainWindow(); |
28 | 29 | ||
30 | QCopChannel *channel; | ||
31 | |||
29 | protected slots: | 32 | protected slots: |
30 | void runIpkg(); | 33 | void runIpkg(); |
31 | void getList(); | 34 | void getList(); |
32 | void updateList(); | 35 | void updateList(); |
33 | void displayList(); | 36 | void displayList(); |
34 | void subSectionChanged(); | 37 | void subSectionChanged(); |
35 | void sectionChanged(); | 38 | void sectionChanged(); |
36 | void showSettings(); | 39 | void showSettings(); |
37 | void showSettingsSrv(); | 40 | void showSettingsSrv(); |
38 | void showSettingsDst(); | 41 | void showSettingsDst(); |
42 | void setDocument (const QString &); | ||
39 | 43 | ||
40 | public slots: | 44 | public slots: |
41 | void showDetails(); | 45 | void showDetails(); |
42 | void toggleActivePackage(); | 46 | void toggleActivePackage(); |
43 | void setCurrent( QListViewItem* ); | 47 | void setCurrent( QListViewItem* ); |
44 | void sectionClose(); | 48 | void sectionClose(); |
45 | void sectionShow(bool); | 49 | void sectionShow(bool); |
46 | void findClose(); | 50 | void findClose(); |
47 | void findShow(bool); | 51 | void findShow(bool); |
48 | void filterList(); | 52 | void filterList(); |
49 | void showPopup(); | 53 | void showPopup(); |
50 | void changePackageDest( int ); | 54 | void changePackageDest( int ); |
51 | void stopTimer( QListViewItem* ); | 55 | void stopTimer( QListViewItem* ); |
56 | void receive (const QCString &, const QByteArray &); | ||
52 | 57 | ||
53 | private: | 58 | private: |
54 | void makeMenu(); | 59 | void makeMenu(); |
55 | void setSections(); | 60 | void setSections(); |
56 | void setSubSections(); | 61 | void setSubSections(); |
57 | 62 | ||
58 | PmIpkg* ipkg; | 63 | PmIpkg* ipkg; |
59 | PackageManagerSettings *settings; | 64 | PackageManagerSettings *settings; |
60 | PackageDetails* details; | 65 | PackageDetails* details; |
61 | PackageList packageList; | 66 | PackageList packageList; |
62 | Package *activePackage; | 67 | Package *activePackage; |
63 | PackageListItem *activePackageListItem; | 68 | PackageListItem *activePackageListItem; |
64 | QAction *runAction; | 69 | QAction *runAction; |
65 | QAction *detailsAction; | 70 | QAction *detailsAction; |
66 | QAction *updateAction; | 71 | QAction *updateAction; |
67 | QAction *findAction; | 72 | QAction *findAction; |
68 | QAction *sectionAction; | 73 | QAction *sectionAction; |
69 | QListView *listViewPackages; | 74 | QListView *listViewPackages; |
70 | QPEToolBar *findBar; | 75 | QPEToolBar *findBar; |
71 | QLineEdit *findEdit; | 76 | QLineEdit *findEdit; |
72 | QPEToolBar *sectionBar; | 77 | QPEToolBar *sectionBar; |
73 | QComboBox *section; | 78 | QComboBox *section; |
74 | QComboBox *subsection; | 79 | QComboBox *subsection; |
75 | QTimer *popupTimer; | 80 | QTimer *popupTimer; |
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 | |||
@@ -90,52 +90,57 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
90 | oldLine = line; | 90 | oldLine = line; |
91 | } | 91 | } |
92 | } | 92 | } |
93 | // } | 93 | // } |
94 | f.close(); | 94 | f.close(); |
95 | out( "Finished!<br>"); | 95 | out( "Finished!<br>"); |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | return r; | 98 | return r; |
99 | } | 99 | } |
100 | 100 | ||
101 | void PmIpkg::makeLinks(Package *pack) | 101 | void PmIpkg::makeLinks(Package *pack) |
102 | { | 102 | { |
103 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 103 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
104 | QString dest = settings->getDestinationUrlByName( pack->dest() ); | 104 | QString dest = settings->getDestinationUrlByName( pack->dest() ); |
105 | if (dest == "/" ) return; | 105 | if (dest == "/" ) return; |
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 | } | ||
116 | |||
117 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | ||
118 | { | ||
119 | QFile f( packFileName ); | ||
115 | if ( ! f.open(IO_ReadOnly) ) | 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 ); |
126 | } | 131 | } |
127 | f.close(); | 132 | f.close(); |
128 | } | 133 | } |
129 | 134 | ||
130 | void PmIpkg::processLinkDir( QString file, QString dest ) | 135 | void PmIpkg::processLinkDir( QString file, QString dest ) |
131 | { | 136 | { |
132 | if ( dest == "???" ) return; | 137 | if ( dest == "???" ) return; |
133 | QString destFile = file; | 138 | QString destFile = file; |
134 | file = dest+"/"+file; | 139 | file = dest+"/"+file; |
135 | if (file == dest) return; | 140 | if (file == dest) return; |
136 | QFileInfo fileInfo( file ); | 141 | QFileInfo fileInfo( file ); |
137 | if ( fileInfo.isDir() ) | 142 | if ( fileInfo.isDir() ) |
138 | { | 143 | { |
139 | QDir destDir( destFile ); | 144 | QDir destDir( destFile ); |
140 | destDir.mkdir( destFile, true ); | 145 | destDir.mkdir( destFile, true ); |
141 | QDir d( file ); | 146 | QDir d( file ); |
@@ -186,49 +191,49 @@ void PmIpkg::commit( PackageList pl ) | |||
186 | { | 191 | { |
187 | to_remove.append( pack ); | 192 | to_remove.append( pack ); |
188 | sizecount += 1; | 193 | sizecount += 1; |
189 | rem += pack->name()+"<br>"; | 194 | rem += pack->name()+"<br>"; |
190 | } | 195 | } |
191 | } | 196 | } |
192 | } | 197 | } |
193 | 198 | ||
194 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>"); | 199 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>"); |
195 | 200 | ||
196 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); | 201 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); |
197 | 202 | ||
198 | runwindow->progress->setTotalSteps( sizecount ); | 203 | runwindow->progress->setTotalSteps( sizecount ); |
199 | 204 | ||
200 | connect( runwindow->doItButton, SIGNAL( clicked() ), | 205 | connect( runwindow->doItButton, SIGNAL( clicked() ), |
201 | SLOT( doIt() ) ); | 206 | SLOT( doIt() ) ); |
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 | ||
219 | 224 | ||
220 | void PmIpkg::remove() | 225 | void PmIpkg::remove() |
221 | { | 226 | { |
222 | if ( to_remove.count() == 0 ) return; | 227 | if ( to_remove.count() == 0 ) return; |
223 | show( true ); | 228 | show( true ); |
224 | 229 | ||
225 | out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); | 230 | out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); |
226 | 231 | ||
227 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 232 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
228 | { | 233 | { |
229 | if ( runIpkg("remove " + it->name()) == 0) | 234 | if ( runIpkg("remove " + it->name()) == 0) |
230 | { | 235 | { |
231 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | 236 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); |
232 | it->processed(); | 237 | it->processed(); |
233 | runwindow->progress->setProgress( 1 ); | 238 | runwindow->progress->setProgress( 1 ); |
234 | }else{ | 239 | }else{ |
@@ -293,24 +298,51 @@ void PmIpkg::showButtons(bool b) | |||
293 | { | 298 | { |
294 | runwindow->cancelButton->hide(); | 299 | runwindow->cancelButton->hide(); |
295 | runwindow->doItButton->hide(); | 300 | runwindow->doItButton->hide(); |
296 | runwindow->removeButton->hide(); | 301 | runwindow->removeButton->hide(); |
297 | runwindow->installButton->hide(); | 302 | runwindow->installButton->hide(); |
298 | }else{ | 303 | }else{ |
299 | runwindow->cancelButton->show(); | 304 | runwindow->cancelButton->show(); |
300 | runwindow->doItButton->show(); | 305 | runwindow->doItButton->show(); |
301 | runwindow->removeButton->show(); | 306 | runwindow->removeButton->show(); |
302 | runwindow->installButton->show(); | 307 | runwindow->installButton->show(); |
303 | 308 | ||
304 | } | 309 | } |
305 | } | 310 | } |
306 | 311 | ||
307 | void PmIpkg::show(bool b) | 312 | void PmIpkg::show(bool b) |
308 | { | 313 | { |
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 | ||
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 | |||
@@ -10,38 +10,42 @@ | |||
10 | #include "runwindow.h" | 10 | #include "runwindow.h" |
11 | #include "packagelist.h" | 11 | #include "packagelist.h" |
12 | #include "debug.h" | 12 | #include "debug.h" |
13 | 13 | ||
14 | class Package; | 14 | class Package; |
15 | class PmIpkg : public QObject | 15 | class PmIpkg : public QObject |
16 | { | 16 | { |
17 | Q_OBJECT | 17 | Q_OBJECT |
18 | public: | 18 | public: |
19 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 19 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
20 | ~PmIpkg(); | 20 | ~PmIpkg(); |
21 | 21 | ||
22 | void commit( PackageList ); | 22 | void commit( PackageList ); |
23 | void update(); | 23 | void update(); |
24 | PackageList* getPackageList(); | 24 | PackageList* getPackageList(); |
25 | void showButtons(bool b=true); | 25 | void showButtons(bool b=true); |
26 | void show( bool buttons=true ); | 26 | void show( bool buttons=true ); |
27 | 27 | ||
28 | private: | 28 | private: |
29 | PackageManagerSettings* settings; | 29 | PackageManagerSettings* settings; |
30 | RunWindow *runwindow; | 30 | RunWindow *runwindow; |
31 | QList<Package> to_remove; | 31 | QList<Package> to_remove; |
32 | QList<Package> to_install; | 32 | QList<Package> to_install; |
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 ); |
37 | int runIpkg(const QString& args, const QString& dest="" ); | 39 | int runIpkg(const QString& args, const QString& dest="" ); |
38 | void out( QString ); | 40 | void out( QString ); |
39 | 41 | ||
40 | public slots: | 42 | public slots: |
41 | void doIt(); | 43 | void doIt(); |
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 ); |
45 | }; | 49 | }; |
46 | 50 | ||
47 | #endif | 51 | #endif |