-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 23 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 75 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 11 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/settings.h | 5 |
6 files changed, 98 insertions, 21 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 54ee115..c803ca0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -89,9 +89,9 @@ void MainWindow::makeMenu() | |||
89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
90 | toolBar->setStretchableWidget( spacer ); | 90 | toolBar->setStretchableWidget( spacer ); |
91 | 91 | ||
92 | 92 | ||
93 | runAction = new QAction( tr( "Commit" ), | 93 | runAction = new QAction( tr( "Apply" ), |
94 | Resource::loadPixmap( "oipkg/install" ), | 94 | Resource::loadPixmap( "oipkg/install" ), |
95 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
96 | connect( runAction, SIGNAL( activated() ), | 96 | connect( runAction, SIGNAL( activated() ), |
97 | this, SLOT( runIpkg() ) ); | 97 | this, SLOT( runIpkg() ) ); |
@@ -170,21 +170,17 @@ void MainWindow::makeMenu() | |||
170 | findEdit = new QLineEdit( findBar, "findEdit" ); | 170 | findEdit = new QLineEdit( findBar, "findEdit" ); |
171 | findBar->setStretchableWidget( findEdit ); | 171 | findBar->setStretchableWidget( findEdit ); |
172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 172 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
173 | this, SLOT( displayList() ) ); | 173 | this, SLOT( displayList() ) ); |
174 | //a = new QAction( tr( "Filter" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 174 | |
175 | // connect( a, SIGNAL( activated() ), this, SLOT( filterList() ) ); | ||
176 | // a->addTo( findBar ); | ||
177 | // a->addTo( edit ); | ||
178 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 175 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
179 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); | 176 | connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); |
180 | a->addTo( findBar ); | 177 | a->addTo( findBar ); |
181 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); | 178 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); |
182 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 179 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
183 | findAction->setToggleAction( true ); | 180 | findAction->setToggleAction( true ); |
184 | findAction->setOn( true ); | 181 | findAction->setOn( true ); |
185 | findAction->addTo( viewMenu ); | 182 | findAction->addTo( viewMenu ); |
186 | |||
187 | } | 183 | } |
188 | 184 | ||
189 | MainWindow::~MainWindow() | 185 | MainWindow::~MainWindow() |
190 | { | 186 | { |
@@ -192,16 +188,20 @@ MainWindow::~MainWindow() | |||
192 | 188 | ||
193 | void MainWindow::runIpkg() | 189 | void MainWindow::runIpkg() |
194 | { | 190 | { |
195 | ipkg->commit( packageList ); | 191 | ipkg->commit( packageList ); |
196 | updateList(); //to remove | 192 | // updateList(); //to remove |
197 | } | 193 | } |
198 | 194 | ||
199 | void MainWindow::updateList() | 195 | void MainWindow::updateList() |
200 | { | 196 | { |
197 | QTimer *t = new QTimer( this ); | ||
198 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | ||
199 | t->start( 0, false ); | ||
201 | packageList.clear(); | 200 | packageList.clear(); |
202 | ipkg->update(); | 201 | ipkg->update(); |
203 | getList(); | 202 | getList(); |
203 | t->stop(); | ||
204 | } | 204 | } |
205 | 205 | ||
206 | void MainWindow::getList() | 206 | void MainWindow::getList() |
207 | { | 207 | { |
@@ -345,4 +345,13 @@ void MainWindow::findClose() | |||
345 | { | 345 | { |
346 | findAction->setOn( false ); | 346 | findAction->setOn( false ); |
347 | } | 347 | } |
348 | 348 | ||
349 | void MainWindow::rotateUpdateIcon() | ||
350 | { | ||
351 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | ||
352 | if ( updateIcon ) | ||
353 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | ||
354 | else | ||
355 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | ||
356 | updateIcon = !updateIcon; | ||
357 | } | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 0c1e474..892d5e8 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -2,8 +2,9 @@ | |||
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 <qpopupmenu.h> | 7 | #include <qpopupmenu.h> |
7 | 8 | ||
8 | #include "packagelist.h" | 9 | #include "packagelist.h" |
9 | #include "pmipkg.h" | 10 | #include "pmipkg.h" |
@@ -68,7 +69,10 @@ private: | |||
68 | QPEToolBar *sectionBar; | 69 | QPEToolBar *sectionBar; |
69 | QComboBox *section; | 70 | QComboBox *section; |
70 | QComboBox *subsection; | 71 | QComboBox *subsection; |
71 | QPopupMenu *popupMenu; | 72 | QPopupMenu *popupMenu; |
73 | bool updateIcon; | ||
74 | private slots: | ||
75 | void rotateUpdateIcon(); | ||
72 | }; | 76 | }; |
73 | 77 | ||
74 | #endif | 78 | #endif |
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index cda352a..2982f1c 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h | |||
@@ -18,9 +18,8 @@ public: | |||
18 | QString getLinkDestinationName(); | 18 | QString getLinkDestinationName(); |
19 | bool createLinks(); | 19 | bool createLinks(); |
20 | QStringList getActiveServers(); | 20 | QStringList getActiveServers(); |
21 | QStringList getDestinationUrls(); | 21 | QStringList getDestinationUrls(); |
22 | |||
23 | private: | 22 | private: |
24 | QIntDict<QString> serverurlDic; | 23 | QIntDict<QString> serverurlDic; |
25 | QIntDict<QString> destinationurlDic; | 24 | QIntDict<QString> destinationurlDic; |
26 | int ipkg_old; | 25 | int ipkg_old; |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index b23b9ea..eae73ad 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -42,8 +42,16 @@ PmIpkg::~PmIpkg() | |||
42 | #define SYSTEM | 42 | #define SYSTEM |
43 | int PmIpkg::runIpkg(const QString& args) | 43 | int PmIpkg::runIpkg(const QString& args) |
44 | { | 44 | { |
45 | pvDebug(2,"PmIpkg::runIpkg "+args); | 45 | pvDebug(2,"PmIpkg::runIpkg "+args); |
46 | |||
47 | //to make script ipkg happy | ||
48 | pvDebug(2, "cd "+settings->getDestinationUrl()+"/tmp/ipkg"); | ||
49 | if (!QDir::setCurrent(settings->getDestinationUrl()+"/tmp/ipkg")) | ||
50 | { | ||
51 | QDir instDir = QDir(settings->getDestinationUrl()+"/tmp/ipkg"); | ||
52 | instDir.mkdir(settings->getDestinationUrl()+"/tmp/ipkg"); | ||
53 | } | ||
46 | #ifdef PROC | 54 | #ifdef PROC |
47 | QStringList cmd = "/usr/bin/ipkg "; | 55 | QStringList cmd = "/usr/bin/ipkg "; |
48 | #endif | 56 | #endif |
49 | #ifdef SYSTEM | 57 | #ifdef SYSTEM |
@@ -152,22 +160,37 @@ void PmIpkg::commit( PackageList pl ) | |||
152 | show( false ); | 160 | show( false ); |
153 | runwindow->outPut->setText(""); | 161 | runwindow->outPut->setText(""); |
154 | out( "<h1>"+tr("Todo")+"</h1>\n"); | 162 | out( "<h1>"+tr("Todo")+"</h1>\n"); |
155 | 163 | ||
164 | to_install.clear(); | ||
165 | to_remove.clear(); | ||
166 | int sizecount = 0; | ||
156 | QString rem="<b>To remove:</b><br>\n"; | 167 | QString rem="<b>To remove:</b><br>\n"; |
157 | QString inst="<b>To install:</b><br>\n";; | 168 | QString inst="<b>To install:</b><br>\n";; |
158 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 169 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
159 | { | 170 | { |
160 | if ( pack && (pack->name() != "") && pack) | 171 | if ( pack && (pack->name() != "") && pack) |
161 | { | 172 | { |
162 | if ( pack->toInstall() ) | 173 | if ( pack->toInstall() ) |
163 | { | 174 | { |
175 | #ifndef NEWLIST | ||
164 | to_install.append( pack->name() ); | 176 | to_install.append( pack->name() ); |
177 | #endif | ||
178 | #ifdef NEWLIST | ||
179 | to_install.append( pack ); | ||
180 | sizecount += pack->size().toInt(); | ||
181 | #endif | ||
165 | inst += pack->name()+"<br>"; | 182 | inst += pack->name()+"<br>"; |
166 | } | 183 | } |
167 | if ( pack->toRemove() ) | 184 | if ( pack->toRemove() ) |
168 | { | 185 | { |
186 | #ifndef NEWLIST | ||
169 | to_remove.append( pack->name() ); | 187 | to_remove.append( pack->name() ); |
188 | #endif | ||
189 | #ifdef NEWLIST | ||
190 | to_remove.append( pack ); | ||
191 | sizecount += 1; | ||
192 | #endif | ||
170 | rem += pack->name()+"<br>"; | 193 | rem += pack->name()+"<br>"; |
171 | } | 194 | } |
172 | } | 195 | } |
173 | } | 196 | } |
@@ -175,8 +198,10 @@ void PmIpkg::commit( PackageList pl ) | |||
175 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>"); | 198 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p><hl>"); |
176 | 199 | ||
177 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); | 200 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); |
178 | 201 | ||
202 | runwindow->progress->setTotalSteps( sizecount ); | ||
203 | |||
179 | connect( runwindow->doItButton, SIGNAL( clicked() ), | 204 | connect( runwindow->doItButton, SIGNAL( clicked() ), |
180 | SLOT( doIt() ) ); | 205 | SLOT( doIt() ) ); |
181 | connect( runwindow->installButton, SIGNAL( clicked() ), | 206 | connect( runwindow->installButton, SIGNAL( clicked() ), |
182 | this, SLOT( install() ) ); | 207 | this, SLOT( install() ) ); |
@@ -206,37 +231,67 @@ void PmIpkg::remove() | |||
206 | if ( to_remove.count() == 0 ) return; | 231 | if ( to_remove.count() == 0 ) return; |
207 | show( true ); | 232 | show( true ); |
208 | 233 | ||
209 | out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); | 234 | out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); |
210 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) | 235 | |
211 | { | 236 | #ifndef NEWLIST |
237 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) | ||
238 | { | ||
212 | if ( runIpkg("remove " + *it) == 0) | 239 | if ( runIpkg("remove " + *it) == 0) |
213 | { | 240 | { |
214 | 241 | ||
215 | }else{ | 242 | }else{ |
216 | out("<b>"+tr("Error while removing")+"</b>"+*it); | 243 | out("<b>"+tr("Error while removing")+"</b>"+*it); |
217 | } | 244 | } |
218 | } | 245 | } |
246 | #endif | ||
247 | #ifdef NEWLIST | ||
248 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | ||
249 | { | ||
250 | if ( runIpkg("remove " + it->name()) == 0) | ||
251 | { | ||
252 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | ||
253 | it->processed(); | ||
254 | runwindow->progress->setProgress( 1 ); | ||
255 | }else{ | ||
256 | out("<b>"+tr("Error while removing")+"</b>"+it->name()); | ||
257 | } | ||
258 | } | ||
259 | #endif | ||
219 | } | 260 | } |
220 | 261 | ||
221 | 262 | ||
222 | void PmIpkg::install() | 263 | void PmIpkg::install() |
223 | { | 264 | { |
224 | if ( to_install.count() == 0 ) return; | 265 | if ( to_install.count() == 0 ) return; |
225 | show( true ); | 266 | show( true ); |
226 | out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"<b><br>"); | 267 | out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); |
227 | if ( to_install.count() ) | 268 | #ifndef NEWLIST |
228 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) | 269 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) |
229 | { | 270 | { |
230 | if ( runIpkg("install " + *it) == 0 ) | 271 | if ( runIpkg("install " + *it) == 0 ) |
231 | { | 272 | { |
232 | if ( settings->createLinks() ) | 273 | if ( settings->createLinks() ) |
233 | makeLinks( *it ); | 274 | makeLinks( *it ); |
234 | }else{ | 275 | }else{ |
235 | out("<b>"+tr("Error while installing")+"</b>"+*it); | 276 | out("<b>"+tr("Error while installing")+"</b>"+*it); |
236 | } | 277 | } |
237 | } | 278 | } |
238 | 279 | #endif | |
280 | #ifdef NEWLIST | ||
281 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | ||
282 | { | ||
283 | if ( runIpkg("install " + it->name()) == 0 ) | ||
284 | { | ||
285 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | ||
286 | if ( settings->createLinks() ) | ||
287 | makeLinks( it->name() ); | ||
288 | it->processed(); | ||
289 | }else{ | ||
290 | out("<b>"+tr("Error while installing")+"</b>"+it->name()); | ||
291 | } | ||
292 | } | ||
293 | #endif | ||
239 | } | 294 | } |
240 | 295 | ||
241 | void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) | 296 | void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) |
242 | // add 3rd package parameter | 297 | // add 3rd package parameter |
@@ -289,9 +344,9 @@ void PmIpkg::show(bool b) | |||
289 | { | 344 | { |
290 | if (!runwindow->isVisible()) | 345 | if (!runwindow->isVisible()) |
291 | runwindow->showMaximized(); | 346 | runwindow->showMaximized(); |
292 | showButtons(b); | 347 | showButtons(b); |
293 | if ( b ) | 348 | //if ( b ) |
294 | runwindow->progress->show(); | 349 | runwindow->progress->hide(); |
295 | else | 350 | // else |
296 | runwindow->progress->show(); | 351 | // runwindow->progress->show(); |
297 | } | 352 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 8718f49..2692017 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -2,17 +2,18 @@ | |||
2 | #define PMIPKG_H | 2 | #define PMIPKG_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qlist.h> | ||
6 | #include <qstring.h> | 7 | #include <qstring.h> |
7 | #include <qwidget.h> | 8 | #include <qwidget.h> |
8 | #include "pksettings.h" | 9 | #include "pksettings.h" |
9 | #include "runwindow.h" | 10 | #include "runwindow.h" |
10 | #include "packagelist.h" | 11 | #include "packagelist.h" |
11 | #include "debug.h" | 12 | #include "debug.h" |
12 | 13 | ||
13 | 14 | //#define NEWLIST | |
14 | 15 | class Package; | |
15 | class PmIpkg : public QObject | 16 | class PmIpkg : public QObject |
16 | { | 17 | { |
17 | Q_OBJECT | 18 | Q_OBJECT |
18 | public: | 19 | public: |
@@ -27,10 +28,16 @@ public: | |||
27 | 28 | ||
28 | private: | 29 | private: |
29 | PackageManagerSettings* settings; | 30 | PackageManagerSettings* settings; |
30 | RunWindow *runwindow; | 31 | RunWindow *runwindow; |
32 | #ifndef NEWLIST | ||
31 | QStringList to_remove; | 33 | QStringList to_remove; |
32 | QStringList to_install; | 34 | QStringList to_install; |
35 | #endif | ||
36 | #ifdef NEWLIST | ||
37 | QList<Package> to_remove; | ||
38 | QList<Package> to_install; | ||
39 | #endif | ||
33 | bool runwindowopen; | 40 | bool runwindowopen; |
34 | 41 | ||
35 | void makeLinks(QString); | 42 | void makeLinks(QString); |
36 | void processLinkDir( QString, QString ); | 43 | void processLinkDir( QString, QString ); |
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index d4b1072..5df522b 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h | |||
@@ -4,9 +4,10 @@ | |||
4 | #include "pksettingsbase.h" | 4 | #include "pksettingsbase.h" |
5 | #include <qintdict.h> | 5 | #include <qintdict.h> |
6 | 6 | ||
7 | 7 | ||
8 | class PackageManagerSettings : private PackageManagerSettingsBase | 8 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | //class PackageManagerSettings : private PackageManagerSettingsBase | ||
9 | { | 10 | { |
10 | // Q_OBJECT | 11 | // Q_OBJECT |
11 | public: | 12 | public: |
12 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 13 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
@@ -18,8 +19,10 @@ public: | |||
18 | QString getLinkDestinationName(); | 19 | QString getLinkDestinationName(); |
19 | bool createLinks(); | 20 | bool createLinks(); |
20 | QStringList getActiveServers(); | 21 | QStringList getActiveServers(); |
21 | QStringList getDestinationUrls(); | 22 | QStringList getDestinationUrls(); |
23 | /** No descriptions */ | ||
24 | QComboBox getActiveDestinationCombo(); | ||
22 | 25 | ||
23 | private: | 26 | private: |
24 | QIntDict<QString> serverurlDic; | 27 | QIntDict<QString> serverurlDic; |
25 | QIntDict<QString> destinationurlDic; | 28 | QIntDict<QString> destinationurlDic; |