Diffstat (limited to 'noncore/unsupported/oipkg/packagelistitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 5d08bb1..149ba35 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -1,24 +1,51 @@ | |||
1 | #include "packagelistitem.h" | 1 | #include "packagelistitem.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | #include <qobject.h> | ||
5 | |||
6 | #include "debug.h" | ||
4 | 7 | ||
5 | static QPixmap *pm_uninstalled=0; | 8 | static QPixmap *pm_uninstalled=0; |
6 | static QPixmap *pm_installed=0; | 9 | static QPixmap *pm_installed=0; |
7 | static QPixmap *pm_uninstall=0; | 10 | static QPixmap *pm_uninstall=0; |
8 | static QPixmap *pm_install=0; | 11 | static QPixmap *pm_install=0; |
9 | 12 | ||
10 | PackageListItem::PackageListItem(QListView* lv, Package *pi) | 13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
11 | :QCheckListItem(lv,pi->name(),CheckBox) | 14 | :QCheckListItem(lv,pi->name(),CheckBox) |
12 | { | 15 | { |
13 | package = pi; | 16 | package = pi; |
17 | settings = s; | ||
18 | setExpandable( true ); | ||
19 | QCheckListItem *item; | ||
20 | #ifndef NEWLAYOUT | ||
21 | item = new QCheckListItem( this, QObject::tr("Name") ); | ||
22 | item->setText(1,pi->name()); | ||
23 | item = new QCheckListItem( this, QObject::tr("Description") ); | ||
24 | item->setText(1,pi->desc()+"\ntest multi\nline"); | ||
25 | item = new QCheckListItem( this, QObject::tr("Size") ); | ||
26 | item->setText(1,pi->size()); | ||
27 | item = new QCheckListItem( this, QObject::tr("Destination") ); | ||
28 | item->setText(1,pi->getDest()); | ||
29 | #endif | ||
30 | #ifdef NEWLAYOUT | ||
31 | item = new QCheckListItem( this, QObject::tr("Name: ")+pi->name() ); | ||
32 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); | ||
33 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | ||
34 | destItem = new QCheckListItem( this, "" ); | ||
35 | linkItem = new QCheckListItem( this, "" ); | ||
36 | displayDetails(); | ||
37 | #endif | ||
38 | |||
14 | if (!pm_uninstalled) { | 39 | if (!pm_uninstalled) { |
15 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 40 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
16 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 41 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
17 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 42 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
18 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 43 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
19 | } | 44 | } |
45 | #ifndef NEWLAYOUT | ||
20 | setText(1, package->shortDesc() ); | 46 | setText(1, package->shortDesc() ); |
21 | setText(2, package->size() ); | 47 | setText(2, package->size() ); |
48 | #endif | ||
22 | } | 49 | } |
23 | 50 | ||
24 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 51 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
@@ -93,5 +120,20 @@ void PackageListItem::setOn( bool b ) | |||
93 | { | 120 | { |
94 | QCheckListItem::setOn( b ); | 121 | QCheckListItem::setOn( b ); |
95 | package->toggleProcess(); | 122 | package->toggleProcess(); |
123 | // if ( b ) | ||
124 | // { | ||
125 | // if ((package->dest()).isEmpty) | ||
126 | // package->setDest( settings->getDestinationName() ); | ||
127 | // }else{ | ||
128 | // package->setDest( QObject::tr("not installed")); | ||
129 | // } | ||
130 | package->setLink( settings->createLinks() ); | ||
131 | displayDetails(); | ||
132 | } | ||
133 | |||
134 | void PackageListItem::displayDetails() | ||
135 | { | ||
136 | linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); | ||
137 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); | ||
96 | repaint(); | 138 | repaint(); |
97 | } | 139 | } |