author | tille <tille> | 2002-05-01 15:49:08 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 15:49:08 (UTC) |
commit | da94bce203afca412336a7793ff8e58e18d59108 (patch) (unidiff) | |
tree | 0bc25fd1145459656d8cc7a4897bad51f123daf9 /noncore/unsupported/oipkg/mainwindow.cpp | |
parent | fcc0cee7ae337e8179b8ba4d4b6c46b519129daa (diff) | |
download | opie-da94bce203afca412336a7793ff8e58e18d59108.zip opie-da94bce203afca412336a7793ff8e58e18d59108.tar.gz opie-da94bce203afca412336a7793ff8e58e18d59108.tar.bz2 |
handles different versions of the same package
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 06828e0..4865c39 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -42,50 +42,48 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
42 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | 42 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); |
43 | //wait = new QMessageBox(this); | 43 | //wait = new QMessageBox(this); |
44 | // wait->setText(tr("Please wait")); | 44 | // wait->setText(tr("Please wait")); |
45 | ipkg = new PmIpkg( settings, this ); | 45 | ipkg = new PmIpkg( settings, this ); |
46 | // settings->setIpkg( ipkg ); | 46 | // settings->setIpkg( ipkg ); |
47 | packageList.setSettings( settings ); | 47 | packageList.setSettings( settings ); |
48 | packageListSearch.setSettings( settings ); | 48 | packageListSearch.setSettings( settings ); |
49 | packageList.update(); | 49 | packageList.update(); |
50 | makeMenu(); | 50 | makeMenu(); |
51 | makeChannel(); | 51 | makeChannel(); |
52 | //opie is hardcoded default ;) | 52 | //opie is hardcoded default ;) |
53 | for (int i=0;i<section->count();i++) | 53 | for (int i=0;i<section->count();i++) |
54 | if (section->text(i)=="opie") | 54 | if (section->text(i)=="opie") |
55 | section->setCurrentItem(i); | 55 | section->setCurrentItem(i); |
56 | sectionChanged(); | 56 | sectionChanged(); |
57 | 57 | ||
58 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 58 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
59 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 59 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
60 | 60 | ||
61 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 61 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
62 | SLOT(removeLinks()) ); | 62 | SLOT(removeLinks()) ); |
63 | connect( settings->createLinksButton, SIGNAL( clicked()), | 63 | connect( settings->createLinksButton, SIGNAL( clicked()), |
64 | SLOT(createLinks()) ); | 64 | SLOT(createLinks()) ); |
65 | 65 | ||
66 | //rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
67 | //rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
68 | displayList(); | 66 | displayList(); |
69 | } | 67 | } |
70 | 68 | ||
71 | void MainWindow::makeMenu() | 69 | void MainWindow::makeMenu() |
72 | { | 70 | { |
73 | 71 | ||
74 | QPEToolBar *toolBar = new QPEToolBar( this ); | 72 | QPEToolBar *toolBar = new QPEToolBar( this ); |
75 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 73 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
76 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 74 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
77 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 75 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
78 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 76 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
79 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 77 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
80 | 78 | ||
81 | setToolBarsMovable( false ); | 79 | setToolBarsMovable( false ); |
82 | toolBar->setHorizontalStretchable( true ); | 80 | toolBar->setHorizontalStretchable( true ); |
83 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 81 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
84 | menuBar->insertItem( tr( "View" ), viewMenu ); | 82 | menuBar->insertItem( tr( "View" ), viewMenu ); |
85 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 83 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
86 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 84 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
87 | 85 | ||
88 | QLabel *spacer = new QLabel( "", toolBar ); | 86 | QLabel *spacer = new QLabel( "", toolBar ); |
89 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 87 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
90 | toolBar->setStretchableWidget( spacer ); | 88 | toolBar->setStretchableWidget( spacer ); |
91 | 89 | ||
@@ -265,50 +263,53 @@ void MainWindow::updateList() | |||
265 | packageList.clear(); | 263 | packageList.clear(); |
266 | ipkg->update(); | 264 | ipkg->update(); |
267 | packageList.update(); | 265 | packageList.update(); |
268 | t->stop(); | 266 | t->stop(); |
269 | // wait->hide(); | 267 | // wait->hide(); |
270 | } | 268 | } |
271 | 269 | ||
272 | void MainWindow::filterList() | 270 | void MainWindow::filterList() |
273 | { | 271 | { |
274 | //wait->show(); | 272 | //wait->show(); |
275 | QString f = ""; | 273 | QString f = ""; |
276 | if ( findAction->isOn() ) f = findEdit->text(); | 274 | if ( findAction->isOn() ) f = findEdit->text(); |
277 | packageList.filterPackages( f ); | 275 | packageList.filterPackages( f ); |
278 | //wait->hide(); | 276 | //wait->hide(); |
279 | } | 277 | } |
280 | 278 | ||
281 | void MainWindow::displayList() | 279 | void MainWindow::displayList() |
282 | { | 280 | { |
283 | //wait->hide(); | 281 | //wait->hide(); |
284 | filterList(); | 282 | filterList(); |
285 | listViewPackages->clear(); | 283 | listViewPackages->clear(); |
286 | Package *pack = packageList.first(); | 284 | Package *pack = packageList.first(); |
287 | PackageListItem *item; | 285 | PackageListItem *item; |
288 | 286 | ||
287 | // if (!rootLocal) | ||
288 | // { | ||
289 | QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | 289 | QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); |
290 | QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | 290 | QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); |
291 | // } | ||
291 | while( pack ) | 292 | while( pack ) |
292 | { | 293 | { |
293 | item = new PackageListItem( rootLocal, pack, settings ); | 294 | item = new PackageListItem( rootLocal, pack, settings ); |
294 | pack = packageList.next(); | 295 | pack = packageList.next(); |
295 | } | 296 | } |
296 | pack = packageListSearch.first(); | 297 | pack = packageListSearch.first(); |
297 | while( pack ) | 298 | while( pack ) |
298 | { | 299 | { |
299 | item = new PackageListItem( rootSearch, pack, settings ); | 300 | item = new PackageListItem( rootSearch, pack, settings ); |
300 | pack = packageListSearch.next(); | 301 | pack = packageListSearch.next(); |
301 | } | 302 | } |
302 | } | 303 | } |
303 | 304 | ||
304 | void MainWindow::sectionChanged() | 305 | void MainWindow::sectionChanged() |
305 | { | 306 | { |
306 | disconnect( section, SIGNAL( activated(int) ), | 307 | disconnect( section, SIGNAL( activated(int) ), |
307 | this, SLOT( sectionChanged() ) ); | 308 | this, SLOT( sectionChanged() ) ); |
308 | disconnect( subsection, SIGNAL(activated(int) ), | 309 | disconnect( subsection, SIGNAL(activated(int) ), |
309 | this, SLOT( subSectionChanged() ) ); | 310 | this, SLOT( subSectionChanged() ) ); |
310 | subsection->clear(); | 311 | subsection->clear(); |
311 | packageList.setSection( section->currentText() ); | 312 | packageList.setSection( section->currentText() ); |
312 | setSubSections(); | 313 | setSubSections(); |
313 | connect( section, SIGNAL( activated(int) ), | 314 | connect( section, SIGNAL( activated(int) ), |
314 | this, SLOT( sectionChanged() ) ); | 315 | this, SLOT( sectionChanged() ) ); |