summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp41
1 files changed, 21 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
@@ -17,49 +17,50 @@
17#include <qlabel.h> 17#include <qlabel.h>
18#include <qfile.h> 18#include <qfile.h>
19#include <qlistview.h> 19#include <qlistview.h>
20#include <qtextview.h> 20#include <qtextview.h>
21#include <qcheckbox.h> 21#include <qcheckbox.h>
22#include <qlineedit.h> 22#include <qlineedit.h>
23#include <qtabwidget.h> 23#include <qtabwidget.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qmessagebox.h> 25#include <qmessagebox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28 28
29#include "pksettingsbase.h" 29#include "pksettingsbase.h"
30#include "utils.h" 30#include "utils.h"
31#include "packagelistitem.h" 31#include "packagelistitem.h"
32 32
33 33
34MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : 34MainWindow::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 );
48 packageListSearch.setSettings( settings ); 49 packageListSearch.setSettings( settings );
49 packageList.update(); 50 packageList.update();
50 makeMenu(); 51 makeMenu();
51 makeChannel(); 52 makeChannel();
52 //opie is hardcoded default ;) 53 //opie is hardcoded default ;)
53 for (int i=0;i<section->count();i++) 54 for (int i=0;i<section->count();i++)
54 if (section->text(i)=="opie") 55 if (section->text(i)=="opie")
55 section->setCurrentItem(i); 56 section->setCurrentItem(i);
56 sectionChanged(); 57 sectionChanged();
57 58
58 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); 59 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) );
59 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); 60 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) );
60 61
61 connect( settings->removeLinksButton, SIGNAL( clicked()), 62 connect( settings->removeLinksButton, SIGNAL( clicked()),
62 SLOT(removeLinks()) ); 63 SLOT(removeLinks()) );
63 connect( settings->createLinksButton, SIGNAL( clicked()), 64 connect( settings->createLinksButton, SIGNAL( clicked()),
64 SLOT(createLinks()) ); 65 SLOT(createLinks()) );
65 66
@@ -259,68 +260,68 @@ void MainWindow::updateList()
259 //wait->show(); 260 //wait->show();
260 QTimer *t = new QTimer( this ); 261 QTimer *t = new QTimer( this );
261 connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); 262 connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) );
262 t->start( 0, false ); 263 t->start( 0, false );
263 packageList.clear(); 264 packageList.clear();
264 ipkg->update(); 265 ipkg->update();
265 packageList.update(); 266 packageList.update();
266 t->stop(); 267 t->stop();
267 // wait->hide(); 268 // wait->hide();
268} 269}
269 270
270void MainWindow::filterList() 271void MainWindow::filterList()
271{ 272{
272 //wait->show(); 273 //wait->show();
273 QString f = ""; 274 QString f = "";
274 if ( findAction->isOn() ) f = findEdit->text(); 275 if ( findAction->isOn() ) f = findEdit->text();
275 packageList.filterPackages( f ); 276 packageList.filterPackages( f );
276 //wait->hide(); 277 //wait->hide();
277} 278}
278 279
279void MainWindow::displayList() 280void 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
305void MainWindow::sectionChanged() 306void MainWindow::sectionChanged()
306{ 307{
307 disconnect( section, SIGNAL( activated(int) ), 308 disconnect( section, SIGNAL( activated(int) ),
308 this, SLOT( sectionChanged() ) ); 309 this, SLOT( sectionChanged() ) );
309 disconnect( subsection, SIGNAL(activated(int) ), 310 disconnect( subsection, SIGNAL(activated(int) ),
310 this, SLOT( subSectionChanged() ) ); 311 this, SLOT( subSectionChanged() ) );
311 subsection->clear(); 312 subsection->clear();
312 packageList.setSection( section->currentText() ); 313 packageList.setSection( section->currentText() );
313 setSubSections(); 314 setSubSections();
314 connect( section, SIGNAL( activated(int) ), 315 connect( section, SIGNAL( activated(int) ),
315 this, SLOT( sectionChanged() ) ); 316 this, SLOT( sectionChanged() ) );
316 connect( subsection, SIGNAL(activated(int) ), 317 connect( subsection, SIGNAL(activated(int) ),
317 this, SLOT( subSectionChanged() ) ); 318 this, SLOT( subSectionChanged() ) );
318 displayList(); 319 displayList();
319} 320}
320 321
321void MainWindow::subSectionChanged() 322void MainWindow::subSectionChanged()
322{ 323{
323 disconnect( section, SIGNAL( activated(int) ), 324 disconnect( section, SIGNAL( activated(int) ),
324 this, SLOT( sectionChanged() ) ); 325 this, SLOT( sectionChanged() ) );
325 disconnect( subsection, SIGNAL(activated(int) ), 326 disconnect( subsection, SIGNAL(activated(int) ),
326 this, SLOT( subSectionChanged() ) ); 327 this, SLOT( subSectionChanged() ) );