summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp51
1 files changed, 20 insertions, 31 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 0422d65..b668660 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -35,22 +35,25 @@ 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 listViewPackages->addList( tr("local"), &packageList ); 41 listViewPackages->addList( tr("feeds"), &packageListServers );
42 listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); 42 listViewPackages->addList( tr("ipkgfind"), &packageListSearch );
43 listViewPackages->addList( tr("documents"), &packageListDocLnk );
43 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); 44 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton);
44 //wait = new QMessageBox(this); 45 //wait = new QMessageBox(this);
45 // wait->setText(tr("Please wait")); 46 // wait->setText(tr("Please wait"));
46 ipkg = new PmIpkg( settings, this ); 47 ipkg = new PmIpkg( settings, this );
47// settings->setIpkg( ipkg ); 48// settings->setIpkg( ipkg );
48 packageList.setSettings( settings ); 49 packageListServers.setSettings( settings );
49 packageListSearch.setSettings( settings ); 50 packageListSearch.setSettings( settings );
50 packageList.update(); 51 packageListDocLnk.setSettings( settings );
52 packageListServers.update();
53 packageListDocLnk.update();
51 makeMenu(); 54 makeMenu();
52 makeChannel(); 55 makeChannel();
53 //opie is hardcoded default ;) 56 //opie is hardcoded default ;)
54 for (int i=0;i<section->count();i++) 57 for (int i=0;i<section->count();i++)
55 if (section->text(i)=="opie") 58 if (section->text(i)=="opie")
56 section->setCurrentItem(i); 59 section->setCurrentItem(i);
@@ -241,15 +244,16 @@ MainWindow::~MainWindow()
241 cfg.writeEntry( "destBar", !destBar->isHidden() ); 244 cfg.writeEntry( "destBar", !destBar->isHidden() );
242 245
243} 246}
244 247
245void MainWindow::runIpkg() 248void MainWindow::runIpkg()
246{ 249{
247 packageList.allPackages(); 250 packageListServers.allPackages();
248 ipkg->loadList( packageListSearch ); 251 ipkg->loadList( packageListSearch );
249 ipkg->commit( packageList ); 252 ipkg->loadList( packageListDocLnk );
253 ipkg->commit( packageListServers );
250 // ##### If we looked in the list of files, we could send out accurate 254 // ##### If we looked in the list of files, we could send out accurate
251 // ##### messages. But we don't bother yet, and just do an "all". 255 // ##### messages. But we don't bother yet, and just do an "all".
252 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 256 QCopEnvelope e("QPE/System", "linkChanged(QString)");
253 QString lf = QString::null; 257 QString lf = QString::null;
254 e << lf; 258 e << lf;
255 displayList(); 259 displayList();
@@ -258,62 +262,47 @@ void MainWindow::runIpkg()
258void MainWindow::updateList() 262void MainWindow::updateList()
259{ 263{
260 //wait->show(); 264 //wait->show();
261 QTimer *t = new QTimer( this ); 265 QTimer *t = new QTimer( this );
262 connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); 266 connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) );
263 t->start( 0, false ); 267 t->start( 0, false );
264 packageList.clear(); 268 packageListServers.clear();
269 packageListSearch.clear();
270 packageListDocLnk.clear();
265 ipkg->update(); 271 ipkg->update();
266 packageList.update(); 272 packageListServers.update();
273 packageListSearch.update();
274 packageListDocLnk.update();
267 t->stop(); 275 t->stop();
268 // wait->hide(); 276 // wait->hide();
269} 277}
270 278
271void MainWindow::filterList() 279void MainWindow::filterList()
272{ 280{
273 //wait->show(); 281 //wait->show();
274 QString f = ""; 282 QString f = "";
275 if ( findAction->isOn() ) f = findEdit->text(); 283 if ( findAction->isOn() ) f = findEdit->text();
276 packageList.filterPackages( f ); 284 packageListServers.filterPackages( f );
277 //wait->hide(); 285 //wait->hide();
278} 286}
279 287
280void MainWindow::displayList() 288void MainWindow::displayList()
281{ 289{
282 //wait->hide(); 290 //wait->hide();
283 filterList(); 291 filterList();
284 listViewPackages->display(); 292 listViewPackages->display();
285//// if (!rootLocal)
286//// {
287 //QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local"));
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 )
300// {
301 // item = new PackageListItem( rootSearch, pack, settings );
302// pack = packageListSearch.next();
303 // }
304} 293}
305 294
306void MainWindow::sectionChanged() 295void MainWindow::sectionChanged()
307{ 296{
308 disconnect( section, SIGNAL( activated(int) ), 297 disconnect( section, SIGNAL( activated(int) ),
309 this, SLOT( sectionChanged() ) ); 298 this, SLOT( sectionChanged() ) );
310 disconnect( subsection, SIGNAL(activated(int) ), 299 disconnect( subsection, SIGNAL(activated(int) ),
311 this, SLOT( subSectionChanged() ) ); 300 this, SLOT( subSectionChanged() ) );
312 subsection->clear(); 301 subsection->clear();
313 packageList.setSection( section->currentText() ); 302 packageListServers.setSection( section->currentText() );
314 setSubSections(); 303 setSubSections();
315 connect( section, SIGNAL( activated(int) ), 304 connect( section, SIGNAL( activated(int) ),
316 this, SLOT( sectionChanged() ) ); 305 this, SLOT( sectionChanged() ) );
317 connect( subsection, SIGNAL(activated(int) ), 306 connect( subsection, SIGNAL(activated(int) ),
318 this, SLOT( subSectionChanged() ) ); 307 this, SLOT( subSectionChanged() ) );
319 displayList(); 308 displayList();
@@ -322,30 +311,30 @@ void MainWindow::sectionChanged()
322void MainWindow::subSectionChanged() 311void MainWindow::subSectionChanged()
323{ 312{
324 disconnect( section, SIGNAL( activated(int) ), 313 disconnect( section, SIGNAL( activated(int) ),
325 this, SLOT( sectionChanged() ) ); 314 this, SLOT( sectionChanged() ) );
326 disconnect( subsection, SIGNAL(activated(int) ), 315 disconnect( subsection, SIGNAL(activated(int) ),
327 this, SLOT( subSectionChanged() ) ); 316 this, SLOT( subSectionChanged() ) );
328 packageList.setSubSection( subsection->currentText() ); 317 packageListServers.setSubSection( subsection->currentText() );
329 connect( section, SIGNAL( activated(int) ), 318 connect( section, SIGNAL( activated(int) ),
330 this, SLOT( sectionChanged() ) ); 319 this, SLOT( sectionChanged() ) );
331 connect( subsection, SIGNAL(activated(int) ), 320 connect( subsection, SIGNAL(activated(int) ),
332 this, SLOT( subSectionChanged() ) ); 321 this, SLOT( subSectionChanged() ) );
333 displayList(); 322 displayList();
334} 323}
335 324
336void MainWindow::setSections() 325void MainWindow::setSections()
337{ 326{
338 section->clear(); 327 section->clear();
339 section->insertStringList( packageList.getSections() ); 328 section->insertStringList( packageListServers.getSections() );
340} 329}
341 330
342void MainWindow::setSubSections() 331void MainWindow::setSubSections()
343{ 332{
344 subsection->clear(); 333 subsection->clear();
345 subsection->insertStringList( packageList.getSubSections() ); 334 subsection->insertStringList( packageListServers.getSubSections() );
346} 335}
347 336
348 337
349void MainWindow::showSettings() 338void MainWindow::showSettings()
350{ 339{
351 if ( settings->showDialog( 0 ) ) 340 if ( settings->showDialog( 0 ) )