author | tille <tille> | 2002-05-01 22:56:23 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 22:56:23 (UTC) |
commit | a3397118d3c384655bedb40210db96ca34adc0c9 (patch) (unidiff) | |
tree | 3b8d46e0e9d1203801783a7dbf92400a4ed8652a /noncore/unsupported | |
parent | 89b16f3378b783be9058852528e066dcadea953d (diff) | |
download | opie-a3397118d3c384655bedb40210db96ca34adc0c9.zip opie-a3397118d3c384655bedb40210db96ca34adc0c9.tar.gz opie-a3397118d3c384655bedb40210db96ca34adc0c9.tar.bz2 |
fixed close of local & ipkgfind
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 41 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.cpp | 36 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.h | 7 |
3 files changed, 64 insertions, 20 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 4865c39..0422d65 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -35,13 +35,14 @@ 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 | 41 | listViewPackages->addList( tr("local"), &packageList ); | |
42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | ||
42 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | 43 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); |
43 | //wait = new QMessageBox(this); | 44 | //wait = new QMessageBox(this); |
44 | // wait->setText(tr("Please wait")); | 45 | // wait->setText(tr("Please wait")); |
45 | ipkg = new PmIpkg( settings, this ); | 46 | ipkg = new PmIpkg( settings, this ); |
46 | // settings->setIpkg( ipkg ); | 47 | // settings->setIpkg( ipkg ); |
47 | packageList.setSettings( settings ); | 48 | packageList.setSettings( settings ); |
@@ -277,32 +278,32 @@ void MainWindow::filterList() | |||
277 | } | 278 | } |
278 | 279 | ||
279 | void MainWindow::displayList() | 280 | void MainWindow::displayList() |
280 | { | 281 | { |
281 | //wait->hide(); | 282 | //wait->hide(); |
282 | filterList(); | 283 | filterList(); |
283 | listViewPackages->clear(); | 284 | listViewPackages->display(); |
284 | Package *pack = packageList.first(); | 285 | //// if (!rootLocal) |
285 | PackageListItem *item; | 286 | //// { |
286 | 287 | //QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | |
287 | // if (!rootLocal) | 288 | //QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); |
289 | //// } | ||
290 | // listViewPackages->clear(); | ||
291 | // Package *pack = packageList.first(); | ||
292 | // PackageListItem *item; | ||
293 | // while( pack ) | ||
294 | // { | ||
295 | // item = new PackageListItem( rootLocal, pack, settings ); | ||
296 | // pack = packageList.next(); | ||
297 | // } | ||
298 | // pack = packageListSearch.first(); | ||
299 | // while( pack ) | ||
288 | // { | 300 | // { |
289 | QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | 301 | // item = new PackageListItem( rootSearch, pack, settings ); |
290 | QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | 302 | // pack = packageListSearch.next(); |
291 | // } | 303 | // } |
292 | while( pack ) | ||
293 | { | ||
294 | item = new PackageListItem( rootLocal, pack, settings ); | ||
295 | pack = packageList.next(); | ||
296 | } | ||
297 | pack = packageListSearch.first(); | ||
298 | while( pack ) | ||
299 | { | ||
300 | item = new PackageListItem( rootSearch, pack, settings ); | ||
301 | pack = packageListSearch.next(); | ||
302 | } | ||
303 | } | 304 | } |
304 | 305 | ||
305 | void MainWindow::sectionChanged() | 306 | void MainWindow::sectionChanged() |
306 | { | 307 | { |
307 | disconnect( section, SIGNAL( activated(int) ), | 308 | disconnect( section, SIGNAL( activated(int) ), |
308 | this, SLOT( sectionChanged() ) ); | 309 | this, SLOT( sectionChanged() ) ); |
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 26b1ce7..5137c64 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -91,6 +91,42 @@ void PackageListView::changePackageDest( int i ) | |||
91 | 91 | ||
92 | void PackageListView::toggleProcess() | 92 | void PackageListView::toggleProcess() |
93 | { | 93 | { |
94 | activePackage->toggleProcess() ; | 94 | activePackage->toggleProcess() ; |
95 | activePackageListItem->displayDetails(); | 95 | activePackageListItem->displayDetails(); |
96 | } | 96 | } |
97 | |||
98 | void PackageListView::display() | ||
99 | { | ||
100 | QDictIterator<PackageList> list( PackageLists ); | ||
101 | PackageList *packlist; | ||
102 | Package *pack; | ||
103 | PackageListItem *item; | ||
104 | QCheckListItem *rootItem; | ||
105 | QListViewItem* it; | ||
106 | QListViewItem* itdel; | ||
107 | while ( list.current() ) { | ||
108 | packlist = list.current(); | ||
109 | rootItem = rootItems.find( list.currentKey() ); | ||
110 | //rootItem->clear(); | ||
111 | it=rootItem->firstChild(); | ||
112 | while ( it ) | ||
113 | { | ||
114 | itdel = it; | ||
115 | it = it->nextSibling(); | ||
116 | delete itdel; | ||
117 | } | ||
118 | pack = packlist->first(); | ||
119 | while( pack ) | ||
120 | { | ||
121 | item = new PackageListItem( rootItem, pack, settings ); | ||
122 | pack = packlist->next(); | ||
123 | } | ||
124 | ++list; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | void PackageListView::addList( QString n, PackageList* pl) | ||
129 | { | ||
130 | PackageLists.insert(n, pl); | ||
131 | rootItems.insert(n, new QCheckListItem(this,n)); | ||
132 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h index d371a34..00c0320 100644 --- a/noncore/unsupported/oipkg/packagelistview.h +++ b/noncore/unsupported/oipkg/packagelistview.h | |||
@@ -17,38 +17,45 @@ | |||
17 | 17 | ||
18 | #ifndef PACKAGELISTVIEW_H | 18 | #ifndef PACKAGELISTVIEW_H |
19 | #define PACKAGELISTVIEW_H | 19 | #define PACKAGELISTVIEW_H |
20 | 20 | ||
21 | #include <qlistview.h> | 21 | #include <qlistview.h> |
22 | #include <qaction.h> | 22 | #include <qaction.h> |
23 | #include <qdict.h> | ||
24 | #include <qstring.h> | ||
23 | #include <qtimer.h> | 25 | #include <qtimer.h> |
24 | #include <qwidget.h> | 26 | #include <qwidget.h> |
25 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
28 | #include "packagelist.h" | ||
26 | #include "debug.h" | 29 | #include "debug.h" |
27 | 30 | ||
28 | class PackageListItem; | 31 | class PackageListItem; |
29 | class Package; | 32 | class Package; |
30 | class PackageManagerSettings; | 33 | class PackageManagerSettings; |
31 | 34 | ||
32 | class PackageListView : public QListView | 35 | class PackageListView : public QListView |
33 | { | 36 | { |
34 | Q_OBJECT | 37 | Q_OBJECT |
35 | 38 | ||
36 | public: | 39 | public: |
37 | PackageListView(QWidget*, const char*, PackageManagerSettings*); | 40 | PackageListView(QWidget*, const char*, PackageManagerSettings*); |
41 | void addList( QString, PackageList* ); | ||
38 | //~PackageListView(); | 42 | //~PackageListView(); |
39 | QTimer *popupTimer; | 43 | QTimer *popupTimer; |
40 | private: | 44 | private: |
45 | QDict<PackageList> PackageLists; | ||
46 | QDict<QCheckListItem> rootItems; | ||
41 | PackageManagerSettings *settings; | 47 | PackageManagerSettings *settings; |
42 | Package *activePackage; | 48 | Package *activePackage; |
43 | PackageListItem *activePackageListItem; | 49 | PackageListItem *activePackageListItem; |
44 | QPopupMenu *popupMenu; | 50 | QPopupMenu *popupMenu; |
45 | QPopupMenu *destsMenu; | 51 | QPopupMenu *destsMenu; |
46 | public slots: | 52 | public slots: |
47 | void showPopup(); | 53 | void showPopup(); |
48 | void changePackageDest( int ); | 54 | void changePackageDest( int ); |
49 | void setCurrent( QListViewItem* ); | 55 | void setCurrent( QListViewItem* ); |
50 | void stopTimer( QListViewItem* ); | 56 | void stopTimer( QListViewItem* ); |
51 | void toggleProcess(); | 57 | void toggleProcess(); |
58 | void display(); | ||
52 | }; | 59 | }; |
53 | 60 | ||
54 | #endif | 61 | #endif |