Diffstat (limited to 'noncore/unsupported/oipkg/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 51 |
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 | |||
@@ -38,16 +38,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
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 ;) |
@@ -244,9 +247,10 @@ MainWindow::~MainWindow() | |||
244 | 247 | ||
245 | void MainWindow::runIpkg() | 248 | void 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)"); |
@@ -261,9 +265,13 @@ void MainWindow::updateList() | |||
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 | } |
@@ -273,7 +281,7 @@ void MainWindow::filterList() | |||
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 | ||
@@ -282,25 +290,6 @@ void MainWindow::displayList() | |||
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 | ||
306 | void MainWindow::sectionChanged() | 295 | void MainWindow::sectionChanged() |
@@ -310,7 +299,7 @@ void MainWindow::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() ) ); |
@@ -325,7 +314,7 @@ void MainWindow::subSectionChanged() | |||
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) ), |
@@ -336,13 +325,13 @@ void MainWindow::subSectionChanged() | |||
336 | void MainWindow::setSections() | 325 | void MainWindow::setSections() |
337 | { | 326 | { |
338 | section->clear(); | 327 | section->clear(); |
339 | section->insertStringList( packageList.getSections() ); | 328 | section->insertStringList( packageListServers.getSections() ); |
340 | } | 329 | } |
341 | 330 | ||
342 | void MainWindow::setSubSections() | 331 | void 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 | ||