summaryrefslogtreecommitdiff
authortille <tille>2002-11-10 22:50:50 (UTC)
committer tille <tille>2002-11-10 22:50:50 (UTC)
commit9337c912158da3ad2fcda7ee1120c9357faddf8b (patch) (unidiff)
treec5800efad3f90cfc9901db0337039eb883c0cf28
parentf6cabaaa364ee6d894462c0902734e434715fc58 (diff)
downloadopie-9337c912158da3ad2fcda7ee1120c9357faddf8b.zip
opie-9337c912158da3ad2fcda7ee1120c9357faddf8b.tar.gz
opie-9337c912158da3ad2fcda7ee1120c9357faddf8b.tar.bz2
here it's...
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/listviewitemoipkg.cpp38
-rw-r--r--noncore/unsupported/oipkg/listviewitemoipkg.h33
-rw-r--r--noncore/unsupported/oipkg/mainwindow.h1
-rw-r--r--noncore/unsupported/oipkg/oipkg.pro2
-rw-r--r--noncore/unsupported/oipkg/package.cpp98
-rw-r--r--noncore/unsupported/oipkg/package.h22
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp34
-rw-r--r--noncore/unsupported/oipkg/packagelist.h20
-rw-r--r--noncore/unsupported/oipkg/packagelistdoclnk.cpp2
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp95
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.h32
-rw-r--r--noncore/unsupported/oipkg/packagelistlocal.cpp2
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp91
-rw-r--r--noncore/unsupported/oipkg/packagelistview.h13
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp10
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h8
16 files changed, 309 insertions, 192 deletions
diff --git a/noncore/unsupported/oipkg/listviewitemoipkg.cpp b/noncore/unsupported/oipkg/listviewitemoipkg.cpp
new file mode 100644
index 0000000..30b5a5e
--- a/dev/null
+++ b/noncore/unsupported/oipkg/listviewitemoipkg.cpp
@@ -0,0 +1,38 @@
1#include "listviewitemoipkg.h"
2#include "packagelistview.h"
3
4#include <qlistview.h>
5
6ListViewItemOipkg::ListViewItemOipkg(QListView *parent, QString name, QCheckListItem::Type qct, Type type)
7 : QCheckListItem(parent,name,qct)
8{
9 _type = type;
10}
11ListViewItemOipkg::ListViewItemOipkg(QListView *parent, QString name, Type type)
12 : QCheckListItem(parent,name,CheckBox)
13{
14 _type = type;
15}
16
17ListViewItemOipkg::ListViewItemOipkg(ListViewItemOipkg *parent, QString name, Type type)
18 : QCheckListItem(parent,name,CheckBox)
19{
20 _type = type;
21}
22
23ListViewItemOipkg::ListViewItemOipkg(PackageListView *parent, QString name, Type type)
24 : QCheckListItem(parent,name,Controller)
25{
26 _type = type;
27}
28
29ListViewItemOipkg::ListViewItemOipkg(ListViewItemOipkg *parent, Type type, QString name)
30 : QCheckListItem(parent,name,Controller)
31{
32 _type = type;
33}
34
35ListViewItemOipkg::~ListViewItemOipkg()
36{
37// delete _popupMenu;
38}
diff --git a/noncore/unsupported/oipkg/listviewitemoipkg.h b/noncore/unsupported/oipkg/listviewitemoipkg.h
new file mode 100644
index 0000000..4f7d2d7
--- a/dev/null
+++ b/noncore/unsupported/oipkg/listviewitemoipkg.h
@@ -0,0 +1,33 @@
1#ifndef LISTVIEWITEMOIPKG_H
2#define LISTVIEWITEMOIPKG_H
3
4#include <qpopupmenu.h>
5#include <qstring.h>
6#include <qlistview.h>
7#include <qcheckbox.h>
8
9class PackageListItem;
10class PackageListView;
11
12class ListViewItemOipkg : public QObject, public QCheckListItem
13{
14Q_OBJECT
15public:
16 enum Type {Package, Feed, Attribute};
17
18 ListViewItemOipkg(QListView *parent, QString name, QCheckListItem::Type qct, Type type);ListViewItemOipkg(QListView *parent, QString name, Type type);
19 ListViewItemOipkg(ListViewItemOipkg *parent, QString name, Type type);
20 ListViewItemOipkg(PackageListView *parent, QString name, Type type);
21 ListViewItemOipkg(ListViewItemOipkg *parent, Type type, QString name);
22 ~ListViewItemOipkg();
23
24 int getType() {return _type;};
25 virtual QPopupMenu* getPopupMenu() {return 0;};
26protected slots:
27 virtual void menuAction(int ) {};
28protected:
29 int _type;
30 static QPopupMenu* _popupMenu;
31};
32
33#endif
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h
index 354c585..f32352b 100644
--- a/noncore/unsupported/oipkg/mainwindow.h
+++ b/noncore/unsupported/oipkg/mainwindow.h
@@ -20,2 +20,3 @@
20 20
21#include "package.h"
21#include "packagelist.h" 22#include "packagelist.h"
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro
index 986cbcd..230df2c 100644
--- a/noncore/unsupported/oipkg/oipkg.pro
+++ b/noncore/unsupported/oipkg/oipkg.pro
@@ -10,2 +10,3 @@ HEADERS = mainwindow.h \
10 utils.h \ 10 utils.h \
11 listviewitemoipkg.h \
11 packagelistitem.h \ 12 packagelistitem.h \
@@ -22,2 +23,3 @@ SOURCES = main.cpp \
22 installdialog.cpp \ 23 installdialog.cpp \
24 listviewitemoipkg.cpp \
23 packagelistremote.cpp \ 25 packagelistremote.cpp \
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 3effb73..e020601 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -20,3 +20,3 @@
20 20
21Package::Package( QObject *parent, const char *name ) 21OipkgPackage::OipkgPackage( QObject *parent, const char *name )
22 : QObject(parent,name) 22 : QObject(parent,name)
@@ -26,3 +26,3 @@ Package::Package( QObject *parent, const char *name )
26 26
27Package::~Package() 27OipkgPackage::~OipkgPackage()
28{ 28{
@@ -30,6 +30,5 @@ Package::~Package()
30 30
31Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) 31OipkgPackage::OipkgPackage( PackageManagerSettings *s, QObject *parent, const char *name )
32 : QObject(parent,name) 32 : QObject(parent,name)
33{ 33{
34 Package(parent,name);
35 init(s); 34 init(s);
@@ -37,3 +36,3 @@ Package::Package( PackageManagerSettings *s, QObject *parent, const char *name )
37 36
38void Package::init( PackageManagerSettings *s ) 37void OipkgPackage::init( PackageManagerSettings *s )
39{ 38{
@@ -56,3 +55,3 @@ void Package::init( PackageManagerSettings *s )
56 55
57Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) 56OipkgPackage::OipkgPackage( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name )
58 : QObject(parent,name) 57 : QObject(parent,name)
@@ -63,3 +62,3 @@ Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent,
63 62
64Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) 63OipkgPackage::OipkgPackage( QString n, PackageManagerSettings *s, QObject *parent, const char *name )
65 : QObject(parent,name) 64 : QObject(parent,name)
@@ -78,3 +77,3 @@ Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const c
78 77
79Package::Package( Package *pi, QObject *parent, const char *name ) 78OipkgPackage::OipkgPackage( OipkgPackage *pi, QObject *parent, const char *name )
80 : QObject(parent,name) 79 : QObject(parent,name)
@@ -86,3 +85,3 @@ Package::Package( Package *pi, QObject *parent, const char *name )
86 85
87void Package::setValue( QString n, QString t ) 86void OipkgPackage::setValue( QString n, QString t )
88{ 87{
@@ -139,3 +138,3 @@ void Package::setValue( QString n, QString t )
139 138
140QString Package::name() 139QString OipkgPackage::name()
141{ 140{
@@ -146,3 +145,3 @@ QString Package::name()
146 145
147QString Package::installName() 146QString OipkgPackage::installName()
148{ 147{
@@ -152,3 +151,3 @@ QString Package::installName()
152 151
153QString Package::packageName() 152QString OipkgPackage::packageName()
154{ 153{
@@ -160,3 +159,3 @@ QString Package::packageName()
160 159
161bool Package::installed() 160bool OipkgPackage::installed()
162{ 161{
@@ -174,3 +173,3 @@ bool Package::installed()
174 { 173 {
175 QDictIterator<Package> other( *_versions ); 174 QDictIterator<OipkgPackage> other( *_versions );
176 while ( other.current() ) 175 while ( other.current() )
@@ -186,3 +185,3 @@ bool Package::installed()
186 185
187bool Package::otherInstalled() 186bool OipkgPackage::otherInstalled()
188{ 187{
@@ -190,3 +189,3 @@ bool Package::otherInstalled()
190 { 189 {
191 QDictIterator<Package> other( *_versions ); 190 QDictIterator<OipkgPackage> other( *_versions );
192 while ( other.current() ) 191 while ( other.current() )
@@ -200,3 +199,3 @@ bool Package::otherInstalled()
200 199
201void Package::setDesc( QString s ) 200void OipkgPackage::setDesc( QString s )
202{ 201{
@@ -206,3 +205,3 @@ void Package::setDesc( QString s )
206 205
207QString Package::desc() 206QString OipkgPackage::desc()
208{ 207{
@@ -211,3 +210,3 @@ QString Package::desc()
211 210
212QString Package::shortDesc() 211QString OipkgPackage::shortDesc()
213{ 212{
@@ -216,3 +215,3 @@ QString Package::shortDesc()
216 215
217QString Package::size() 216QString OipkgPackage::size()
218{ 217{
@@ -222,3 +221,3 @@ QString Package::size()
222 221
223QString Package::version() 222QString OipkgPackage::version()
224{ 223{
@@ -227,3 +226,3 @@ QString Package::version()
227 226
228QString Package::sizeUnits() 227QString OipkgPackage::sizeUnits()
229{ 228{
@@ -243,3 +242,3 @@ QString Package::sizeUnits()
243 242
244bool Package::toProcess() 243bool OipkgPackage::toProcess()
245{ 244{
@@ -248,3 +247,3 @@ bool Package::toProcess()
248 247
249bool Package::toRemove() 248bool OipkgPackage::toRemove()
250{ 249{
@@ -254,3 +253,3 @@ bool Package::toRemove()
254 253
255bool Package::toInstall() 254bool OipkgPackage::toInstall()
256{ 255{
@@ -260,3 +259,3 @@ bool Package::toInstall()
260 259
261void Package::toggleProcess() 260void OipkgPackage::toggleProcess()
262{ 261{
@@ -266,4 +265,3 @@ void Package::toggleProcess()
266 265
267 266void OipkgPackage::copyValues( OipkgPackage* pack )
268void Package::copyValues( Package* pack )
269{ 267{
@@ -283,3 +281,3 @@ void Package::copyValues( Package* pack )
283 281
284QString Package::section() 282QString OipkgPackage::section()
285{ 283{
@@ -288,3 +286,3 @@ QString Package::section()
288 286
289void Package::setSection( QString s) 287void OipkgPackage::setSection( QString s)
290{ 288{
@@ -301,3 +299,3 @@ void Package::setSection( QString s)
301 299
302QString Package::subSection() 300QString OipkgPackage::subSection()
303{ 301{
@@ -306,3 +304,3 @@ QString Package::subSection()
306 304
307void Package::parsePackage( QStringList pack ) 305void OipkgPackage::parsePackage( QStringList pack )
308{ 306{
@@ -325,3 +323,3 @@ void Package::parsePackage( QStringList pack )
325 323
326QString Package::details() 324QString OipkgPackage::details()
327{ 325{
@@ -364,3 +362,3 @@ QString Package::details()
364 362
365void Package::processed() 363void OipkgPackage::processed()
366{ 364{
@@ -372,3 +370,3 @@ void Package::processed()
372 370
373QString Package::dest() 371QString OipkgPackage::dest()
374{ 372{
@@ -379,3 +377,3 @@ QString Package::dest()
379 377
380void Package::setDest( QString d ) 378void OipkgPackage::setDest( QString d )
381{ 379{
@@ -385,3 +383,3 @@ void Package::setDest( QString d )
385 383
386void Package::setOn() 384void OipkgPackage::setOn()
387{ 385{
@@ -390,3 +388,3 @@ void Package::setOn()
390 388
391bool Package::link() 389bool OipkgPackage::link()
392{ 390{
@@ -396,3 +394,3 @@ bool Package::link()
396 394
397void Package::setLink(bool b) 395void OipkgPackage::setLink(bool b)
398{ 396{
@@ -401,3 +399,3 @@ void Package::setLink(bool b)
401 399
402void Package::parseIpkgFile( QString file) 400void OipkgPackage::parseIpkgFile( QString file)
403{ 401{
@@ -427,3 +425,3 @@ void Package::parseIpkgFile( QString file)
427 425
428//QString Package::getPackageName() 426//QString OipkgPackage::getPackageName()
429//{ 427//{
@@ -433,3 +431,3 @@ void Package::parseIpkgFile( QString file)
433 431
434void Package::instalFromFile(bool iff) 432void OipkgPackage::instalFromFile(bool iff)
435{ 433{
@@ -438,3 +436,3 @@ void Package::instalFromFile(bool iff)
438 436
439void Package::setName(QString n) 437void OipkgPackage::setName(QString n)
440{ 438{
@@ -443,3 +441,3 @@ void Package::setName(QString n)
443 441
444QDict<QString>* Package::getFields() 442QDict<QString>* OipkgPackage::getFields()
445{ 443{
@@ -448,3 +446,3 @@ QDict<QString>* Package::getFields()
448 446
449QString Package::status() 447QString OipkgPackage::status()
450{ 448{
@@ -453,6 +451,6 @@ QString Package::status()
453 451
454bool Package::isOld() 452bool OipkgPackage::isOld()
455{ 453{
456 if (!_versions) return false; 454 if (!_versions) return false;
457 QDictIterator<Package> other( *_versions ); 455 QDictIterator<OipkgPackage> other( *_versions );
458 while ( other.current() ) { 456 while ( other.current() ) {
@@ -464,3 +462,3 @@ bool Package::isOld()
464 462
465bool Package::hasVersions() 463bool OipkgPackage::hasVersions()
466{ 464{
@@ -470,3 +468,3 @@ bool Package::hasVersions()
470 468
471QDict<Package>* Package::getOtherVersions() 469QDict<OipkgPackage>* OipkgPackage::getOtherVersions()
472{ 470{
@@ -475,3 +473,3 @@ QDict<Package>* Package::getOtherVersions()
475 473
476void Package::setOtherVersions(QDict<Package> *v) 474void OipkgPackage::setOtherVersions(QDict<OipkgPackage> *v)
477{ 475{
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h
index c147420..2334c31 100644
--- a/noncore/unsupported/oipkg/package.h
+++ b/noncore/unsupported/oipkg/package.h
@@ -21,3 +21,3 @@
21 21
22class Package : public QObject 22class OipkgPackage : public QObject
23{ 23{
@@ -25,11 +25,11 @@ class Package : public QObject
25 public: 25 public:
26 Package(QObject *parent=0, const char *name=0); 26 OipkgPackage(QObject *parent=0, const char *name=0);
27 Package(PackageManagerSettings *s, QObject *parent=0, const char *name=0); 27 OipkgPackage(PackageManagerSettings *s, QObject *parent=0, const char *name=0);
28 ~Package(); 28 ~OipkgPackage();
29 Package( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); 29 OipkgPackage( QStringList, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
30 Package( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ); 30 OipkgPackage( QString, PackageManagerSettings *s, QObject *parent=0, const char *name=0 );
31 Package( Package*s, QObject *parent=0, const char *name=0 ); 31 OipkgPackage( OipkgPackage*s, QObject *parent=0, const char *name=0 );
32 32
33 void setValue( QString, QString ); 33 void setValue( QString, QString );
34 void copyValues( Package* ); 34 void copyValues( OipkgPackage* );
35 35
@@ -68,4 +68,4 @@ class Package : public QObject
68 68
69 QDict<Package>* getOtherVersions(); 69 QDict<OipkgPackage>* getOtherVersions();
70 void setOtherVersions(QDict<Package>*); 70 void setOtherVersions(QDict<OipkgPackage>*);
71 71
@@ -92,3 +92,3 @@ private:
92 QDict<QString> _values; 92 QDict<QString> _values;
93 QDict<Package> *_versions; 93 QDict<OipkgPackage> *_versions;
94 bool _useFileName; 94 bool _useFileName;
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index edb9cc5..5f79ec1 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -18,3 +18,3 @@
18 18
19static QDict<Package> *packageListAll; 19static QDict<OipkgPackage> *packageListAll;
20static int packageListAllRefCount = 0; 20static int packageListAllRefCount = 0;
@@ -25,3 +25,3 @@ PackageList::PackageList(QObject *parent, const char *name)
25 empty=true; 25 empty=true;
26 if (!packageListAll) packageListAll = new QDict<Package>(); 26 if (!packageListAll) packageListAll = new QDict<OipkgPackage>();
27 packageListAllRefCount++; 27 packageListAllRefCount++;
@@ -48,6 +48,6 @@ PackageList::~PackageList()
48/** Inserts a package into the list */ 48/** Inserts a package into the list */
49void PackageList::insertPackage( Package* pack ) 49void PackageList::insertPackage( OipkgPackage* pack )
50{ 50{
51 if (!pack) return; 51 if (!pack) return;
52 Package* p = packageListAll->find( pack->name() ); 52 OipkgPackage* p = packageListAll->find( pack->name() );
53 if ( p ) 53 if ( p )
@@ -62,3 +62,3 @@ void PackageList::insertPackage( Package* pack )
62 } else { 62 } else {
63 QDict<Package> *packver = p->getOtherVersions(); 63 QDict<OipkgPackage> *packver = p->getOtherVersions();
64 // p->setName( pack->name()+"["+p->version()+"]" ); 64 // p->setName( pack->name()+"["+p->version()+"]" );
@@ -66,3 +66,3 @@ void PackageList::insertPackage( Package* pack )
66 { 66 {
67 packver = new QDict<Package>(); 67 packver = new QDict<OipkgPackage>();
68 packver->insert( pack->name(), p ); 68 packver->insert( pack->name(), p );
@@ -89,5 +89,5 @@ void PackageList::filterPackages( QString f )
89 packageList.clear(); 89 packageList.clear();
90 QDictIterator<Package> filterIter( origPackageList ); 90 QDictIterator<OipkgPackage> filterIter( origPackageList );
91 filterIter.toFirst(); 91 filterIter.toFirst();
92 Package *pack= filterIter.current() ; 92 OipkgPackage *pack= filterIter.current() ;
93 while ( pack ) 93 while ( pack )
@@ -107,3 +107,3 @@ void PackageList::filterPackages( QString f )
107 107
108Package* PackageList::find( QString n ) 108OipkgPackage* PackageList::find( QString n )
109{ 109{
@@ -112,3 +112,3 @@ Package* PackageList::find( QString n )
112 112
113Package* PackageList::first() 113OipkgPackage* PackageList::first()
114 { 114 {
@@ -118,3 +118,3 @@ Package* PackageList::first()
118 118
119Package* PackageList::next() 119OipkgPackage* PackageList::next()
120{ 120{
@@ -149,3 +149,3 @@ void PackageList::setSubSection( QString ssec )
149 149
150void PackageList::updateSections( Package* pack ) 150void PackageList::updateSections( OipkgPackage* pack )
151{ 151{
@@ -184,3 +184,3 @@ void PackageList::readFileEntries( QString filename, QString dest )
184 { 184 {
185 Package *p = new Package( packEntry, settings ); 185 OipkgPackage *p = new OipkgPackage( packEntry, settings );
186 if ( p ) 186 if ( p )
@@ -199,3 +199,3 @@ void PackageList::readFileEntries( QString filename, QString dest )
199 { 199 {
200 Package *p = new Package( packEntry, settings ); 200 OipkgPackage *p = new OipkgPackage( packEntry, settings );
201 if ( p ) 201 if ( p )
@@ -216,3 +216,3 @@ void PackageList::setSettings( PackageManagerSettings *s )
216 216
217Package* PackageList::getByName( QString n ) 217OipkgPackage* PackageList::getByName( QString n )
218{ 218{
@@ -230,5 +230,5 @@ void PackageList::allPackages()
230 packageList.clear(); 230 packageList.clear();
231 QDictIterator<Package> filterIter( origPackageList ); 231 QDictIterator<OipkgPackage> filterIter( origPackageList );
232 filterIter.toFirst(); 232 filterIter.toFirst();
233 Package *pack= filterIter.current() ; 233 OipkgPackage *pack= filterIter.current() ;
234 while ( pack ) 234 while ( pack )
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h
index 0c13688..88a8793 100644
--- a/noncore/unsupported/oipkg/packagelist.h
+++ b/noncore/unsupported/oipkg/packagelist.h
@@ -26,6 +26,6 @@ public:
26 virtual ~PackageList(); 26 virtual ~PackageList();
27 void insertPackage( Package* ); 27 void insertPackage( OipkgPackage* );
28 Package* find( QString ); 28 OipkgPackage* find( QString );
29 Package* next(); 29 OipkgPackage* next();
30 Package* first(); 30 OipkgPackage* first();
31 31
@@ -35,3 +35,3 @@ public:
35 void filterPackages( QString ); 35 void filterPackages( QString );
36 Package* getByName( QString ); 36 OipkgPackage* getByName( QString );
37 void clear(); 37 void clear();
@@ -39,3 +39,3 @@ public:
39 39
40 QDict<Package> *versions; 40 QDict<OipkgPackage> *versions;
41 41
@@ -51,5 +51,5 @@ protected:
51 PackageManagerSettings *settings; 51 PackageManagerSettings *settings;
52 QDict<Package> packageList; 52 QDict<OipkgPackage> packageList;
53 QDict<Package> origPackageList; 53 QDict<OipkgPackage> origPackageList;
54 QDictIterator<Package> packageIter; 54 QDictIterator<OipkgPackage> packageIter;
55 55
@@ -63,3 +63,3 @@ protected:
63 63
64 void updateSections( Package* ); 64 void updateSections( OipkgPackage* );
65 void readFileEntries( QString file, QString dest="" ); 65 void readFileEntries( QString file, QString dest="" );
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
index 76e91ff..a7a6f70 100644
--- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp
+++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp
@@ -50,3 +50,3 @@ void PackageListDocLnk::update()
50 { 50 {
51 insertPackage( new Package(pack->file(), settings ) ); 51 insertPackage( new OipkgPackage(pack->file(), settings ) );
52 } 52 }
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 03bf477..4380393 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -13,2 +13,4 @@
13#include <qobject.h> 13#include <qobject.h>
14#include <qpopupmenu.h>
15#include <qaction.h>
14 16
@@ -25,4 +27,10 @@ static QPixmap *pm_uninstalled_installed_old=0;
25 27
26PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) 28PackageListItem::PackageListItem(ListViewItemOipkg *parent, QString name, Type ittype)
27 :QCheckListItem(lv,pi->name(),CheckBox) 29 : ListViewItemOipkg(parent,name,ittype)
30{
31
32}
33
34PackageListItem::PackageListItem(QListView* lv, OipkgPackage *pi, PackageManagerSettings *s)
35 :ListViewItemOipkg(lv,pi->name(),ListViewItemOipkg::Package)
28{ 36{
@@ -31,4 +39,4 @@ PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSetti
31 39
32PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) 40PackageListItem::PackageListItem(ListViewItemOipkg *lvi, OipkgPackage *pi, PackageManagerSettings *s)
33 :QCheckListItem(lvi,pi->name(),CheckBox) 41 :ListViewItemOipkg(lvi,pi->name(),ListViewItemOipkg::Package)
34{ 42{
@@ -36,5 +44,12 @@ PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManager
36} 44}
45PackageListItem::~PackageListItem()
46{
47 delete popupMenu;
48 delete destsMenu;
49}
37 50
38void PackageListItem::init( Package *pi, PackageManagerSettings *s) 51void PackageListItem::init( OipkgPackage *pi, PackageManagerSettings *s)
39{ 52{
53 popupMenu = new QPopupMenu( 0 );
54 destsMenu = new QPopupMenu( 0 );
40 package = pi; 55 package = pi;
@@ -42,11 +57,11 @@ void PackageListItem::init( Package *pi, PackageManagerSettings *s)
42 setExpandable( true ); 57 setExpandable( true );
43 QCheckListItem *item; 58 ListViewItemOipkg *item;
44 nameItem = new QCheckListItem( this, "" ); 59 nameItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute,"name" );
45 item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); 60 item = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, QObject::tr("Description: ")+pi->desc() );
46 item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); 61 item = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, QObject::tr("Size: ")+pi->size() );
47 destItem = new QCheckListItem( this, "" ); 62 destItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, "dest" );
48 linkItem = new QCheckListItem( this, "" ); 63 linkItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, "link" );
49 statusItem = new QCheckListItem( this, "" ); 64 statusItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, "status" );
50 QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); 65 ListViewItemOipkg *otherItem = new ListViewItemOipkg( this, ListViewItemOipkg::Attribute, QObject::tr("other") );
51 item = new QCheckListItem( otherItem, QObject::tr("Install Name: ")+pi->installName() ); 66 item = new ListViewItemOipkg( otherItem, ListViewItemOipkg::Attribute, QObject::tr("Install Name: ")+pi->installName() );
52 QDict<QString> *fields = pi->getFields(); 67 QDict<QString> *fields = pi->getFields();
@@ -54,3 +69,3 @@ void PackageListItem::init( Package *pi, PackageManagerSettings *s)
54 while ( it.current() ) { 69 while ( it.current() ) {
55 item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); 70 item = new ListViewItemOipkg( otherItem, ListViewItemOipkg::Attribute, QString(it.currentKey()+": "+*it.current()) );
56 ++it; 71 ++it;
@@ -174 +189,51 @@ void PackageListItem::displayDetails()
174} 189}
190
191QPopupMenu* PackageListItem::getPopupMenu()
192{
193 popupMenu->clear();
194 destsMenu->clear();
195
196 QAction *popupAction;
197 qDebug("PackageListItem::showPopup ");
198
199 if (!package->installed()){
200 popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
201 QStringList dests = settings->getDestinationNames();
202 QString ad = settings->getDestinationName();
203 for (uint i = 0; i < dests.count(); i++ )
204 {
205 popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 );
206 popupAction->addTo( destsMenu );
207 if ( dests[i] == ad && getPackage()->toInstall() )
208 {
209 popupAction->setToggleAction( true );
210 popupAction->setOn(true);
211 }
212 }
213 connect( destsMenu, SIGNAL( activated( int ) ),
214 this, SLOT( menuAction( int ) ) );
215 popupMenu->popup( QCursor::pos() );
216 }else{
217 popupMenu->insertItem( QObject::tr("Remove"));
218 connect( popupMenu, SIGNAL( activated( int ) ),
219 this, SLOT( menuAction( int ) ) );
220 popupMenu->popup( QCursor::pos() );
221 }
222 return popupMenu;
223}
224
225void PackageListItem::menuAction( int i )
226{
227 if (package->installed()){
228 package->setDest( destsMenu->text(i) );
229 package->setLink( settings->createLinks() );
230 }
231 package->setOn();
232 displayDetails();
233}
234
235//void PackageListItem::toggleProcess()
236//{
237// package->toggleProcess() ;
238// displayDetails();
239//} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h
index dba44f7..ca0cf17 100644
--- a/noncore/unsupported/oipkg/packagelistitem.h
+++ b/noncore/unsupported/oipkg/packagelistitem.h
@@ -12,6 +12,5 @@
12 12
13#include "package.h"
14 13
15#include <qstring.h> 14#include <qstring.h>
16#include <qlistview.h> 15//#include <qlistview.h>
17#include <qpainter.h> 16#include <qpainter.h>
@@ -20,10 +19,18 @@
20 19
20#include "listviewitemoipkg.h"
21#include "package.h"
21#include "pksettings.h" 22#include "pksettings.h"
22 23
23class PackageListItem 24class QPopupMenu;
24: public QCheckListItem 25
26class PackageListItem : public ListViewItemOipkg
25{ 27{
26public: 28public:
27 PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); 29 PackageListItem(ListViewItemOipkg *parent, QString name, Type ittype);
28 PackageListItem(QListView*, Package*, PackageManagerSettings*); 30 PackageListItem(
31 ListViewItemOipkg *parent,
32 OipkgPackage *pack,
33 PackageManagerSettings *s);
34 PackageListItem(QListView*, OipkgPackage*, PackageManagerSettings*);
35 ~PackageListItem();
29 void paintCell( QPainter*, const QColorGroup&, int, int, int ); 36 void paintCell( QPainter*, const QColorGroup&, int, int, int );
@@ -32,3 +39,3 @@ public:
32 QString key( int, bool ) const; 39 QString key( int, bool ) const;
33 Package* getPackage() { return package; } ; 40 OipkgPackage* getPackage() { return package; } ;
34 QString getName() { return package->name(); } ; 41 QString getName() { return package->name(); } ;
@@ -39,3 +46,7 @@ public:
39private: 46private:
40 void init(Package*, PackageManagerSettings*); 47 QPopupMenu *popupMenu;
48 QPopupMenu *destsMenu;
49 void init(OipkgPackage*, PackageManagerSettings*);
50 virtual QPopupMenu* getPopupMenu();
51 static QPopupMenu *_destsMenu;
41 QCheckListItem *nameItem; 52 QCheckListItem *nameItem;
@@ -45,3 +56,6 @@ private:
45 PackageManagerSettings *settings; 56 PackageManagerSettings *settings;
46 Package *package; 57 OipkgPackage *package;
58protected slots:
59 // void toggleProcess();
60 virtual void menuAction( int );
47}; 61};
diff --git a/noncore/unsupported/oipkg/packagelistlocal.cpp b/noncore/unsupported/oipkg/packagelistlocal.cpp
index b8a19253..2fe75bc 100644
--- a/noncore/unsupported/oipkg/packagelistlocal.cpp
+++ b/noncore/unsupported/oipkg/packagelistlocal.cpp
@@ -71,3 +71,3 @@ void PackageListLocal::update()
71 parseStatus(); 71 parseStatus();
72 pvDebug( 2, "parseList"); 72 pvDebug( 2, "parseList "+listsDir);
73 parseList(); 73 parseList();
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 0d6fa80..3c7435d 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -14,2 +14,3 @@
14 14
15#include "listviewitemoipkg.h"
15#include "packagelistitem.h" 16#include "packagelistitem.h"
@@ -21,4 +22,2 @@ PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettin
21 settings = s; 22 settings = s;
22 popupMenu = new QPopupMenu( this );
23 destsMenu = new QPopupMenu( popupMenu );
24 popupTimer = new QTimer( this ); 23 popupTimer = new QTimer( this );
@@ -43,18 +42,24 @@ void PackageListView::setCurrent( QListViewItem* p )
43{ 42{
44 if ( !p ) return; 43 qDebug("PackageListView::setCurrent ");
45 activePackageListItem = (PackageListItem*)p; 44 activeItem = (ListViewItemOipkg*)p;
46 activePackage = activePackageListItem->getPackage(); 45
47 if (!activePackage) 46 if ( activeItem != 0 ) popupTimer->start( 750, true );
48 { 47
49 // QDictIterator<QCheckListItem> it( rootItems ); 48// if ( activeItem->getType() != ListViewItemOipkg::Package ){
50 // while ( it.current() ) 49// qDebug("PackageListView::setCurrent !p ");
50// activePackage = 0;
51 // activePackageListItem = 0;
52// qDebug("PackageListView::setCurrent returning ");
53// return;
54// };
55// activePackageListItem = (PackageListItem*)p;
56// activePackage = activePackageListItem->getPackage();
57// if (activePackage == 0 )
51// { 58// {
52 // if ( it.current()==p ) 59// qDebug("PackageListView::setCurrent if (!activePackage)");
53 // pvDebug(2,"current item"); 60// return;
54 // ++it;
55 // } 61 // }
56 62
57 return; 63
58 } 64 qDebug("PackageListView::setCurrent popupTimer->start");
59 popupTimer->start( 750, true );
60} 65}
@@ -64,33 +69,7 @@ void PackageListView::showPopup()
64{ 69{
65 popupMenu->clear(); 70 qDebug("PackageListView::showPopup");
66 destsMenu->clear(); 71 QPopupMenu *popup = activeItem->getPopupMenu();
67 72 if (popup == 0) return;
68 QAction *popupAction; 73 popup->popup( QCursor::pos() );
69 if ( !activePackage->installed() ) 74 qDebug("PackageListView::showPopup");
70 {
71 popupMenu->insertItem( tr("Install to"), destsMenu );
72 QStringList dests = settings->getDestinationNames();
73 QString ad = settings->getDestinationName();
74 for (uint i = 0; i < dests.count(); i++ )
75 {
76 popupAction = new QAction( dests[i], QString::null, 0, this, 0 );
77 popupAction->addTo( destsMenu );
78 if ( dests[i] == ad && activePackage->toInstall() )
79 {
80 popupAction->setToggleAction( true );
81 popupAction->setOn(true);
82 };
83 }
84 connect( destsMenu, SIGNAL( activated( int ) ),
85 this, SLOT( changePackageDest( int ) ) );
86 }else{
87 popupAction = new QAction( tr("Remove"),QString::null, 0, this, 0 );
88 popupAction->addTo( popupMenu );
89 connect( popupAction, SIGNAL( activated() ),
90 this , SLOT( toggleProcess() ) );
91 popupAction = new QAction( tr("Reinstall"),QString::null, 0, this, 0 );
92 popupAction->addTo( popupMenu );
93 popupAction->setEnabled( false );
94 }
95 popupMenu->popup( QCursor::pos() );
96} 75}
@@ -103,16 +82,2 @@ void PackageListView::stopTimer( QListViewItem* )
103 82
104void PackageListView::changePackageDest( int i )
105{
106 activePackage->setDest( destsMenu->text(i) );
107 activePackage->setOn();
108 activePackage->setLink( settings->createLinks() );
109 activePackageListItem->displayDetails();
110}
111
112void PackageListView::toggleProcess()
113{
114 activePackage->toggleProcess() ;
115 activePackageListItem->displayDetails();
116}
117
118void PackageListView::display() 83void PackageListView::display()
@@ -121,5 +86,5 @@ void PackageListView::display()
121 PackageList *packlist; 86 PackageList *packlist;
122 Package *pack; 87 OipkgPackage *pack;
123 PackageListItem *item; 88 PackageListItem *item;
124 QCheckListItem *rootItem; 89 ListViewItemOipkg *rootItem;
125 QListViewItem* it; 90 QListViewItem* it;
@@ -150,3 +115,3 @@ void PackageListView::addList( QString n, PackageList* pl)
150 PackageLists.insert(n, pl); 115 PackageLists.insert(n, pl);
151 QCheckListItem *item = new QCheckListItem(this,n); 116 ListViewItemOipkg *item = new ListViewItemOipkg(this,n,ListViewItemOipkg::Feed);
152 rootItems.insert(n, item); 117 rootItems.insert(n, item);
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h
index 3c09ba8..17dcb95 100644
--- a/noncore/unsupported/oipkg/packagelistview.h
+++ b/noncore/unsupported/oipkg/packagelistview.h
@@ -20,2 +20,3 @@
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21#include "listviewitemoipkg.h"
21#include "packagelist.h" 22#include "packagelist.h"
@@ -24,4 +25,5 @@
24class PackageListItem; 25class PackageListItem;
25class Package; 26class OipkgPackage;
26class PackageManagerSettings; 27class PackageManagerSettings;
28//class ListViewItemOipkg;
27 29
@@ -38,6 +40,7 @@ private:
38 QDict<PackageList> PackageLists; 40 QDict<PackageList> PackageLists;
39 QDict<QCheckListItem> rootItems; 41 QDict<ListViewItemOipkg> rootItems;
40 PackageManagerSettings *settings; 42 PackageManagerSettings *settings;
41 Package *activePackage; 43// OipkgPackage *activePackage;
42 PackageListItem *activePackageListItem; 44// PackageListItem *activePackageListItem;
45 ListViewItemOipkg *activeItem;
43 QPopupMenu *popupMenu; 46 QPopupMenu *popupMenu;
@@ -46,6 +49,4 @@ public slots:
46 void showPopup(); 49 void showPopup();
47 void changePackageDest( int );
48 void setCurrent( QListViewItem* ); 50 void setCurrent( QListViewItem* );
49 void stopTimer( QListViewItem* ); 51 void stopTimer( QListViewItem* );
50 void toggleProcess();
51 void display(); 52 void display();
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 2ed313c..cfaadbf 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -116,3 +116,3 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
116 116
117void PmIpkg::makeLinks(Package *pack) 117void PmIpkg::makeLinks(OipkgPackage *pack)
118{ 118{
@@ -234,3 +234,3 @@ void PmIpkg::loadList( PackageList *pl )
234 { 234 {
235 for( Package *pack = pl->first();pack ; (pack = pl->next()) ) 235 for( OipkgPackage *pack = pl->first();pack ; (pack = pl->next()) )
236 { 236 {
@@ -293,3 +293,3 @@ void PmIpkg::remove()
293 293
294 QStringList *fileList; 294 QStringList *fileList = new QStringList;
295 for (uint i=0; i < to_remove.count(); i++) 295 for (uint i=0; i < to_remove.count(); i++)
@@ -416,3 +416,3 @@ void PmIpkg::installFile(const QString &fileName, const QString &dest)
416 pvDebug( 2,"PmIpkg::installFile "+ fileName); 416 pvDebug( 2,"PmIpkg::installFile "+ fileName);
417 Package *p = new Package(fileName,settings); 417 OipkgPackage *p = new OipkgPackage(fileName,settings);
418 if ( dest!="") p->setDest( dest ); 418 if ( dest!="") p->setDest( dest );
@@ -429,3 +429,3 @@ void PmIpkg::removeFile(const QString &fileName, const QString &dest)
429 pvDebug( 2,"PmIpkg::removeFile "+ fileName); 429 pvDebug( 2,"PmIpkg::removeFile "+ fileName);
430 Package *p = new Package(fileName,settings); 430 OipkgPackage *p = new OipkgPackage(fileName,settings);
431 if ( dest!="") p->setDest( dest ); 431 if ( dest!="") p->setDest( dest );
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index 2f4d6ae..cb0759a 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -25,3 +25,3 @@
25 25
26class Package; 26class OipkgPackage;
27class PmIpkg : public QObject 27class PmIpkg : public QObject
@@ -55,5 +55,5 @@ private:
55 InstallDialog *installDialog; 55 InstallDialog *installDialog;
56 QList<Package> to_remove; 56 QList<OipkgPackage> to_remove;
57 QList<Package> to_install; 57 QList<OipkgPackage> to_install;
58 void makeLinks(Package*); 58 void makeLinks(OipkgPackage*);
59 void linkPackage( QString, QString ); 59 void linkPackage( QString, QString );