-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.cpp | 2 |
6 files changed, 7 insertions, 31 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 1c56aae..9c4c752 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -32,29 +32,25 @@ | |||
32 | 32 | ||
33 | 33 | ||
34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
35 | QMainWindow( parent, name, f ) | 35 | QMainWindow( parent, name, f ) |
36 | { | 36 | { |
37 | setCaption( tr("Package Manager") ); | 37 | setCaption( tr("Package Manager") ); |
38 | settings = new PackageManagerSettings(this,0,TRUE); | 38 | settings = new PackageManagerSettings(this,0,TRUE); |
39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
40 | setCentralWidget( listViewPackages ); | 40 | setCentralWidget( listViewPackages ); |
41 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 41 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); |
43 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 43 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
44 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | ||
45 | //wait = new QMessageBox(this); | ||
46 | // wait->setText(tr("Please wait")); | ||
47 | ipkg = new PmIpkg( settings, this ); | 44 | ipkg = new PmIpkg( settings, this ); |
48 | // settings->setIpkg( ipkg ); | ||
49 | packageListServers.setSettings( settings ); | 45 | packageListServers.setSettings( settings ); |
50 | packageListSearch.setSettings( settings ); | 46 | packageListSearch.setSettings( settings ); |
51 | packageListDocLnk.setSettings( settings ); | 47 | packageListDocLnk.setSettings( settings ); |
52 | pvDebug(9,"packageListServers.update"); | 48 | pvDebug(9,"packageListServers.update"); |
53 | packageListServers.update(); | 49 | packageListServers.update(); |
54 | pvDebug(9,"packageListDocLnk.update"); | 50 | pvDebug(9,"packageListDocLnk.update"); |
55 | packageListDocLnk.update(); | 51 | packageListDocLnk.update(); |
56 | pvDebug(9,"makeMenu"); | 52 | pvDebug(9,"makeMenu"); |
57 | makeMenu(); | 53 | makeMenu(); |
58 | makeChannel(); | 54 | makeChannel(); |
59 | //opie is hardcoded default ;) | 55 | //opie is hardcoded default ;) |
60 | //pvDebug(9,"section->setCurrentItem"); | 56 | //pvDebug(9,"section->setCurrentItem"); |
@@ -260,51 +256,42 @@ void MainWindow::runIpkg() | |||
260 | ipkg->commit(); | 256 | ipkg->commit(); |
261 | ipkg->clearLists(); | 257 | ipkg->clearLists(); |
262 | // ##### If we looked in the list of files, we could send out accurate | 258 | // ##### If we looked in the list of files, we could send out accurate |
263 | // ##### messages. But we don't bother yet, and just do an "all". | 259 | // ##### messages. But we don't bother yet, and just do an "all". |
264 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 260 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
265 | QString lf = QString::null; | 261 | QString lf = QString::null; |
266 | e << lf; | 262 | e << lf; |
267 | displayList(); | 263 | displayList(); |
268 | } | 264 | } |
269 | 265 | ||
270 | void MainWindow::updateList() | 266 | void MainWindow::updateList() |
271 | { | 267 | { |
272 | //wait->show(); | ||
273 | QTimer *t = new QTimer( this ); | ||
274 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | ||
275 | t->start( 0, false ); | ||
276 | packageListServers.clear(); | 268 | packageListServers.clear(); |
277 | packageListSearch.clear(); | 269 | packageListSearch.clear(); |
278 | packageListDocLnk.clear(); | 270 | packageListDocLnk.clear(); |
279 | ipkg->update(); | 271 | ipkg->update(); |
280 | packageListServers.update(); | 272 | packageListServers.update(); |
281 | packageListSearch.update(); | 273 | packageListSearch.update(); |
282 | packageListDocLnk.update(); | 274 | packageListDocLnk.update(); |
283 | t->stop(); | ||
284 | // wait->hide(); | ||
285 | } | 275 | } |
286 | 276 | ||
287 | void MainWindow::filterList() | 277 | void MainWindow::filterList() |
288 | { | 278 | { |
289 | //wait->show(); | ||
290 | QString f = ""; | 279 | QString f = ""; |
291 | if ( findAction->isOn() ) f = findEdit->text(); | 280 | if ( findAction->isOn() ) f = findEdit->text(); |
292 | packageListServers.filterPackages( f ); | 281 | packageListServers.filterPackages( f ); |
293 | //wait->hide(); | ||
294 | } | 282 | } |
295 | 283 | ||
296 | void MainWindow::displayList() | 284 | void MainWindow::displayList() |
297 | { | 285 | { |
298 | //wait->hide(); | ||
299 | filterList(); | 286 | filterList(); |
300 | listViewPackages->display(); | 287 | listViewPackages->display(); |
301 | } | 288 | } |
302 | 289 | ||
303 | void MainWindow::sectionChanged() | 290 | void MainWindow::sectionChanged() |
304 | { | 291 | { |
305 | disconnect( section, SIGNAL( activated(int) ), | 292 | disconnect( section, SIGNAL( activated(int) ), |
306 | this, SLOT( sectionChanged() ) ); | 293 | this, SLOT( sectionChanged() ) ); |
307 | disconnect( subsection, SIGNAL(activated(int) ), | 294 | disconnect( subsection, SIGNAL(activated(int) ), |
308 | this, SLOT( subSectionChanged() ) ); | 295 | this, SLOT( subSectionChanged() ) ); |
309 | subsection->clear(); | 296 | subsection->clear(); |
310 | packageListServers.setSection( section->currentText() ); | 297 | packageListServers.setSection( section->currentText() ); |
@@ -399,35 +386,24 @@ void MainWindow::searchClose() | |||
399 | void MainWindow::destShow(bool b) | 386 | void MainWindow::destShow(bool b) |
400 | { | 387 | { |
401 | if (b) destBar->show(); | 388 | if (b) destBar->show(); |
402 | else destBar->hide(); | 389 | else destBar->hide(); |
403 | destAction->setOn( b ); | 390 | destAction->setOn( b ); |
404 | } | 391 | } |
405 | 392 | ||
406 | void MainWindow::destClose() | 393 | void MainWindow::destClose() |
407 | { | 394 | { |
408 | destAction->setOn( false ); | 395 | destAction->setOn( false ); |
409 | } | 396 | } |
410 | 397 | ||
411 | void MainWindow::rotateUpdateIcon() | ||
412 | { | ||
413 | pvDebug(2, "MainWindow::rotateUpdateIcon"); | ||
414 | if ( updateIcon ) | ||
415 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update" ) ); | ||
416 | else | ||
417 | updateAction->setIconSet( Resource::loadIconSet( "oipkg/update2" ) ); | ||
418 | updateIcon = !updateIcon; | ||
419 | } | ||
420 | |||
421 | |||
422 | void MainWindow::setDocument(const QString &fileName) | 398 | void MainWindow::setDocument(const QString &fileName) |
423 | { | 399 | { |
424 | if ( !QFile::exists( fileName ) ) return; | 400 | if ( !QFile::exists( fileName ) ) return; |
425 | ipkg->installFile( fileName ); | 401 | ipkg->installFile( fileName ); |
426 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 402 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
427 | QString lf = QString::null; | 403 | QString lf = QString::null; |
428 | e << lf; | 404 | e << lf; |
429 | exit; | 405 | exit; |
430 | } | 406 | } |
431 | 407 | ||
432 | 408 | ||
433 | void MainWindow::makeChannel() | 409 | void MainWindow::makeChannel() |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index ce3e761..4a5e8bf 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -80,18 +80,15 @@ private: | |||
80 | QAction *searchAction; | 80 | QAction *searchAction; |
81 | QAction *searchCommit; | 81 | QAction *searchCommit; |
82 | QPEToolBar *searchBar; | 82 | QPEToolBar *searchBar; |
83 | QLineEdit *searchEdit; | 83 | QLineEdit *searchEdit; |
84 | QAction *sectionAction; | 84 | QAction *sectionAction; |
85 | QPEToolBar *sectionBar; | 85 | QPEToolBar *sectionBar; |
86 | QComboBox *section; | 86 | QComboBox *section; |
87 | QComboBox *subsection; | 87 | QComboBox *subsection; |
88 | QAction *destAction; | 88 | QAction *destAction; |
89 | QPEToolBar *destBar; | 89 | QPEToolBar *destBar; |
90 | QComboBox *destination; | 90 | QComboBox *destination; |
91 | QCheckBox* CheckBoxLink; | 91 | QCheckBox* CheckBoxLink; |
92 | // QMessageBox *wait; | ||
93 | private slots: | ||
94 | void rotateUpdateIcon(); | ||
95 | }; | 92 | }; |
96 | 93 | ||
97 | #endif | 94 | #endif |
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 4542e42..8c5f0ea 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -41,24 +41,25 @@ Package::Package( QStringList pack, PackageManagerSettings *s ) | |||
41 | { | 41 | { |
42 | init(s); | 42 | init(s); |
43 | parsePackage( pack ); | 43 | parsePackage( pack ); |
44 | } | 44 | } |
45 | 45 | ||
46 | Package::Package( QString n, PackageManagerSettings *s ) | 46 | Package::Package( QString n, PackageManagerSettings *s ) |
47 | { | 47 | { |
48 | init(s); | 48 | init(s); |
49 | if ( !QFile::exists( n ) ) | 49 | if ( !QFile::exists( n ) ) |
50 | { | 50 | { |
51 | _name = QString( n ); | 51 | _name = QString( n ); |
52 | }else{ | 52 | }else{ |
53 | pvDebug(2,"remote file: "+n); | ||
53 | parseIpkgFile( n ); | 54 | parseIpkgFile( n ); |
54 | _useFileName = true; | 55 | _useFileName = true; |
55 | _fileName = QString( n ); | 56 | _fileName = QString( n ); |
56 | } | 57 | } |
57 | } | 58 | } |
58 | 59 | ||
59 | Package::Package( Package *pi ) | 60 | Package::Package( Package *pi ) |
60 | { | 61 | { |
61 | init(pi->settings); | 62 | init(pi->settings); |
62 | copyValues( pi ); | 63 | copyValues( pi ); |
63 | } | 64 | } |
64 | 65 | ||
@@ -333,25 +334,26 @@ void Package::processed() | |||
333 | else _status = "installed"; | 334 | else _status = "installed"; |
334 | } | 335 | } |
335 | 336 | ||
336 | QString Package::dest() | 337 | QString Package::dest() |
337 | { | 338 | { |
338 | if ( installed()||(!installed() && _toProcess) ) | 339 | if ( installed()||(!installed() && _toProcess) ) |
339 | return _dest!=""?_dest:settings->getDestinationName(); | 340 | return _dest!=""?_dest:settings->getDestinationName(); |
340 | else return ""; | 341 | else return ""; |
341 | } | 342 | } |
342 | 343 | ||
343 | void Package::setDest( QString d ) | 344 | void Package::setDest( QString d ) |
344 | { | 345 | { |
345 | _dest = d; | 346 | if ( d == "remote") _useFileName = true; |
347 | else _dest = d; | ||
346 | } | 348 | } |
347 | 349 | ||
348 | void Package::setOn() | 350 | void Package::setOn() |
349 | { | 351 | { |
350 | _toProcess = true; | 352 | _toProcess = true; |
351 | } | 353 | } |
352 | 354 | ||
353 | bool Package::link() | 355 | bool Package::link() |
354 | { | 356 | { |
355 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; | 357 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; |
356 | return _link; | 358 | return _link; |
357 | } | 359 | } |
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 8f835b7..1b572e0 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -166,27 +166,27 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
166 | QFile f( filename ); | 166 | QFile f( filename ); |
167 | if ( !f.open(IO_ReadOnly) ) return; | 167 | if ( !f.open(IO_ReadOnly) ) return; |
168 | QTextStream *statusStream = new QTextStream( &f ); | 168 | QTextStream *statusStream = new QTextStream( &f ); |
169 | while ( !statusStream ->eof() ) | 169 | while ( !statusStream ->eof() ) |
170 | { | 170 | { |
171 | QString line = statusStream->readLine(); | 171 | QString line = statusStream->readLine(); |
172 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) | 172 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) |
173 | { | 173 | { |
174 | //end of package | 174 | //end of package |
175 | if ( ! packEntry.isEmpty() ) | 175 | if ( ! packEntry.isEmpty() ) |
176 | { | 176 | { |
177 | Package *p = new Package( packEntry, settings ); | 177 | Package *p = new Package( packEntry, settings ); |
178 | p->setDest( dest ); | ||
179 | if ( p ) | 178 | if ( p ) |
180 | { | 179 | { |
180 | p->setDest( dest ); | ||
181 | insertPackage( p ); | 181 | insertPackage( p ); |
182 | packEntry.clear(); | 182 | packEntry.clear(); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | }else{ | 185 | }else{ |
186 | packEntry << line; | 186 | packEntry << line; |
187 | }; | 187 | }; |
188 | } | 188 | } |
189 | delete statusStream; | 189 | delete statusStream; |
190 | return; | 190 | return; |
191 | } | 191 | } |
192 | 192 | ||
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index c743a49..55047d5 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -24,30 +24,31 @@ PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManager | |||
24 | :QCheckListItem(lvi,pi->name(),CheckBox) | 24 | :QCheckListItem(lvi,pi->name(),CheckBox) |
25 | { | 25 | { |
26 | init(pi,s); | 26 | init(pi,s); |
27 | } | 27 | } |
28 | 28 | ||
29 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | 29 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) |
30 | { | 30 | { |
31 | package = pi; | 31 | package = pi; |
32 | settings = s; | 32 | settings = s; |
33 | setExpandable( true ); | 33 | setExpandable( true ); |
34 | QCheckListItem *item; | 34 | QCheckListItem *item; |
35 | nameItem = new QCheckListItem( this, "" ); | 35 | nameItem = new QCheckListItem( this, "" ); |
36 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); | ||
36 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | 37 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); |
37 | destItem = new QCheckListItem( this, "" ); | 38 | destItem = new QCheckListItem( this, "" ); |
38 | linkItem = new QCheckListItem( this, "" ); | 39 | linkItem = new QCheckListItem( this, "" ); |
39 | statusItem = new QCheckListItem( this, "" ); | 40 | statusItem = new QCheckListItem( this, "" ); |
40 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); | 41 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); |
41 | item = new QCheckListItem( otherItem, QObject::tr("Description: ")+pi->desc() ); | 42 | item = new QCheckListItem( otherItem, QObject::tr("Install Name: ")+pi->installName() ); |
42 | QDict<QString> *fields = pi->getFields(); | 43 | QDict<QString> *fields = pi->getFields(); |
43 | QDictIterator<QString> it( *fields ); | 44 | QDictIterator<QString> it( *fields ); |
44 | while ( it.current() ) { | 45 | while ( it.current() ) { |
45 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); | 46 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); |
46 | ++it; | 47 | ++it; |
47 | } | 48 | } |
48 | displayDetails(); | 49 | displayDetails(); |
49 | 50 | ||
50 | if (!pm_uninstalled) | 51 | if (!pm_uninstalled) |
51 | { | 52 | { |
52 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 53 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
53 | pm_uninstalled_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOld")); | 54 | pm_uninstalled_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOld")); |
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index e37f256..bb29e80 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -36,14 +36,14 @@ void PackageListRemote::update() | |||
36 | 36 | ||
37 | // use file for output | 37 | // use file for output |
38 | cmd += " --output-document="+redirect; | 38 | cmd += " --output-document="+redirect; |
39 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | 39 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= |
40 | QString server="http://ipkgfind.handhelds.org/"; | 40 | QString server="http://ipkgfind.handhelds.org/"; |
41 | cmd += " \""+server+"/packages.phtml"; | 41 | cmd += " \""+server+"/packages.phtml"; |
42 | cmd += "?format=pda&searchtype=package§ion="; | 42 | cmd += "?format=pda&searchtype=package§ion="; |
43 | cmd += "&query="+searchString; | 43 | cmd += "&query="+searchString; |
44 | cmd += "\""; | 44 | cmd += "\""; |
45 | 45 | ||
46 | pvDebug(4,"search :"+cmd); | 46 | pvDebug(4,"search :"+cmd); |
47 | r = system(cmd.latin1()); | 47 | r = system(cmd.latin1()); |
48 | readFileEntries( redirect ); | 48 | readFileEntries( redirect, "remote" ); |
49 | } | 49 | } |