-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/mainwindow.cpp | 51 |
2 files changed, 48 insertions, 7 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index 744122f..6ad724f 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog | |||
@@ -1,16 +1,20 @@ | |||
1 | 2004-02-13 Dan Williams <drw@handhelds.org> | ||
2 | |||
3 | * Fix handling of filtering options in View menu | ||
4 | |||
1 | 2004-02-12 Dan Williams <drw@handhelds.org> | 5 | 2004-02-12 Dan Williams <drw@handhelds.org> |
2 | 6 | ||
3 | * Package information dialog implemented | 7 | * Package information dialog implemented |
4 | * What's This app icon enabled | 8 | * What's This app icon enabled |
5 | * Changed all QDialog::exec() occurences to QPEApplication::execDialog() | 9 | * Changed all QDialog::exec() occurences to QPEApplication::execDialog() |
6 | 10 | ||
7 | 2004-01-23 Dan Williams <drw@handhelds.org> | 11 | 2004-01-23 Dan Williams <drw@handhelds.org> |
8 | 12 | ||
9 | * Added package download functionality | 13 | * Added package download functionality |
10 | * Have Opie update links after install/removal so that apps | 14 | * Have Opie update links after install/removal so that apps |
11 | will display properly in Launcher | 15 | will display properly in Launcher |
12 | 16 | ||
13 | 2004-01-20 Dan Williams <drw@handhelds.org> | 17 | 2004-01-20 Dan Williams <drw@handhelds.org> |
14 | 18 | ||
15 | * Released version 0.2.0 | 19 | * Released version 0.2.0 |
16 | * Converted to use libipkg in place of spawning ipkg process | 20 | * Converted to use libipkg in place of spawning ipkg process |
diff --git a/noncore/settings/packagemanager/mainwindow.cpp b/noncore/settings/packagemanager/mainwindow.cpp index 2cb11ba..8fd960f 100644 --- a/noncore/settings/packagemanager/mainwindow.cpp +++ b/noncore/settings/packagemanager/mainwindow.cpp | |||
@@ -200,44 +200,44 @@ void MainWindow::initUI() | |||
200 | m_actionShowNotInstalled->addTo( popup ); | 200 | m_actionShowNotInstalled->addTo( popup ); |
201 | 201 | ||
202 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 202 | m_actionShowInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
203 | m_actionShowInstalled->setToggleAction( true ); | 203 | m_actionShowInstalled->setToggleAction( true ); |
204 | m_actionShowInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); | 204 | m_actionShowInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); |
205 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); | 205 | connect( m_actionShowInstalled, SIGNAL(activated()), this, SLOT(slotShowInstalled()) ); |
206 | m_actionShowInstalled->addTo( popup ); | 206 | m_actionShowInstalled->addTo( popup ); |
207 | 207 | ||
208 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 208 | m_actionShowUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
209 | m_actionShowUpdated->setToggleAction( true ); | 209 | m_actionShowUpdated->setToggleAction( true ); |
210 | m_actionShowUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); | 210 | m_actionShowUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); |
211 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); | 211 | connect( m_actionShowUpdated, SIGNAL(activated()), this, SLOT(slotShowUpdated()) ); |
212 | m_actionShowUpdated->addTo( popup ); | 212 | m_actionShowUpdated->addTo( popup ); |
213 | 213 | ||
214 | popup->insertSeparator(); | 214 | popup->insertSeparator(); |
215 | 215 | ||
216 | a = new QAction( tr( "Configure filter" ), QString::null, 0, this, 0 ); | ||
217 | a->setWhatsThis( tr( "Click here to change package filter criteria." ) ); | ||
218 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | ||
219 | a->addTo( popup ); | ||
220 | |||
221 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), | 216 | m_actionFilter = new QAction( tr( "Filter" ), Resource::loadPixmap( "packagemanager/filter" ), |
222 | QString::null, 0, this, 0 ); | 217 | QString::null, 0, this, 0 ); |
223 | m_actionFilter->setToggleAction( true ); | 218 | m_actionFilter->setToggleAction( true ); |
224 | m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) ); | 219 | m_actionFilter->setWhatsThis( tr( "Click here to apply current filter." ) ); |
225 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); | 220 | connect( m_actionFilter, SIGNAL(toggled(bool)), this, SLOT(slotFilter(bool)) ); |
226 | m_actionFilter->addTo( popup ); | 221 | m_actionFilter->addTo( popup ); |
227 | 222 | ||
223 | a = new QAction( tr( "Filter settings" ), QString::null, 0, this, 0 ); | ||
224 | a->setWhatsThis( tr( "Click here to change the package filter criteria." ) ); | ||
225 | connect( a, SIGNAL(activated()), this, SLOT(slotFilterChange()) ); | ||
226 | a->addTo( popup ); | ||
227 | |||
228 | popup->insertSeparator(); | 228 | popup->insertSeparator(); |
229 | 229 | ||
230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 230 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
231 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); | 231 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); |
232 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); | 232 | connect( a, SIGNAL(activated()), this, SLOT(slotFindShowToolbar()) ); |
233 | a->addTo( popup ); | 233 | a->addTo( popup ); |
234 | 234 | ||
235 | m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); | 235 | m_actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); |
236 | m_actionFindNext->setEnabled( false ); | 236 | m_actionFindNext->setEnabled( false ); |
237 | m_actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); | 237 | m_actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); |
238 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); | 238 | connect( m_actionFindNext, SIGNAL(activated()), this, SLOT(slotFindNext()) ); |
239 | m_actionFindNext->addTo( popup ); | 239 | m_actionFindNext->addTo( popup ); |
240 | m_actionFindNext->addTo( &m_findBar ); | 240 | m_actionFindNext->addTo( &m_findBar ); |
241 | 241 | ||
242 | mb->insertItem( tr( "View" ), popup ); | 242 | mb->insertItem( tr( "View" ), popup ); |
243 | 243 | ||
@@ -541,72 +541,75 @@ void MainWindow::slotConfigure() | |||
541 | tr( "The configuration has been updated. Do you want to update server and package information now?" ), | 541 | tr( "The configuration has been updated. Do you want to update server and package information now?" ), |
542 | tr( "Yes" ), tr( "No" ), this ) == 1 ) | 542 | tr( "Yes" ), tr( "No" ), this ) == 1 ) |
543 | { | 543 | { |
544 | // Update package list and reload package info | 544 | // Update package list and reload package info |
545 | slotUpdate(); | 545 | slotUpdate(); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | } | 548 | } |
549 | 549 | ||
550 | void MainWindow::slotShowNotInstalled() | 550 | void MainWindow::slotShowNotInstalled() |
551 | { | 551 | { |
552 | OPackageList *packageList; | 552 | OPackageList *packageList; |
553 | if ( m_actionShowNotInstalled->isOn() ) | 553 | if ( m_actionShowNotInstalled->isOn() ) |
554 | { | 554 | { |
555 | m_actionShowInstalled->setOn( false ); | 555 | m_actionShowInstalled->setOn( false ); |
556 | m_actionShowUpdated->setOn( false ); | 556 | m_actionShowUpdated->setOn( false ); |
557 | m_actionFilter->setOn( false ); | ||
557 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 558 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
558 | OPackageManager::NotInstalled, QString::null ); | 559 | OPackageManager::NotInstalled, QString::null ); |
559 | } | 560 | } |
560 | else | 561 | else |
561 | packageList = m_packman.packages(); | 562 | packageList = m_packman.packages(); |
562 | 563 | ||
563 | if ( packageList ) | 564 | if ( packageList ) |
564 | { | 565 | { |
565 | loadPackageList( packageList, true ); | 566 | loadPackageList( packageList, true ); |
566 | delete packageList; | 567 | delete packageList; |
567 | } | 568 | } |
568 | } | 569 | } |
569 | 570 | ||
570 | void MainWindow::slotShowInstalled() | 571 | void MainWindow::slotShowInstalled() |
571 | { | 572 | { |
572 | OPackageList *packageList; | 573 | OPackageList *packageList; |
573 | if ( m_actionShowInstalled->isOn() ) | 574 | if ( m_actionShowInstalled->isOn() ) |
574 | { | 575 | { |
575 | m_actionShowNotInstalled->setOn( false ); | 576 | m_actionShowNotInstalled->setOn( false ); |
576 | m_actionShowUpdated->setOn( false ); | 577 | m_actionShowUpdated->setOn( false ); |
578 | m_actionFilter->setOn( false ); | ||
577 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 579 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
578 | OPackageManager::Installed, QString::null ); | 580 | OPackageManager::Installed, QString::null ); |
579 | } | 581 | } |
580 | else | 582 | else |
581 | packageList = m_packman.packages(); | 583 | packageList = m_packman.packages(); |
582 | 584 | ||
583 | if ( packageList ) | 585 | if ( packageList ) |
584 | { | 586 | { |
585 | loadPackageList( packageList, true ); | 587 | loadPackageList( packageList, true ); |
586 | delete packageList; | 588 | delete packageList; |
587 | } | 589 | } |
588 | } | 590 | } |
589 | 591 | ||
590 | void MainWindow::slotShowUpdated() | 592 | void MainWindow::slotShowUpdated() |
591 | { | 593 | { |
592 | OPackageList *packageList; | 594 | OPackageList *packageList; |
593 | if ( m_actionShowUpdated->isOn() ) | 595 | if ( m_actionShowUpdated->isOn() ) |
594 | { | 596 | { |
595 | m_actionShowInstalled->setOn( false ); | 597 | m_actionShowInstalled->setOn( false ); |
596 | m_actionShowNotInstalled->setOn( false ); | 598 | m_actionShowNotInstalled->setOn( false ); |
599 | m_actionFilter->setOn( false ); | ||
597 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, | 600 | packageList = m_packman.filterPackages( QString::null, QString::null, QString::null, |
598 | OPackageManager::Updated, QString::null ); | 601 | OPackageManager::Updated, QString::null ); |
599 | } | 602 | } |
600 | else | 603 | else |
601 | packageList = m_packman.packages(); | 604 | packageList = m_packman.packages(); |
602 | 605 | ||
603 | if ( packageList ) | 606 | if ( packageList ) |
604 | { | 607 | { |
605 | loadPackageList( packageList, true ); | 608 | loadPackageList( packageList, true ); |
606 | delete packageList; | 609 | delete packageList; |
607 | } | 610 | } |
608 | } | 611 | } |
609 | 612 | ||
610 | void MainWindow::slotFilterChange() | 613 | void MainWindow::slotFilterChange() |
611 | { | 614 | { |
612 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, | 615 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, |
@@ -620,34 +623,68 @@ void MainWindow::slotFilterChange() | |||
620 | m_filterCategory = dlg.category(); | 623 | m_filterCategory = dlg.category(); |
621 | m_actionFilter->setOn( true ); | 624 | m_actionFilter->setOn( true ); |
622 | slotFilter( true ); | 625 | slotFilter( true ); |
623 | } | 626 | } |
624 | else | 627 | else |
625 | { | 628 | { |
626 | m_actionFilter->setOn( false ); | 629 | m_actionFilter->setOn( false ); |
627 | slotFilter( false ); | 630 | slotFilter( false ); |
628 | } | 631 | } |
629 | } | 632 | } |
630 | 633 | ||
631 | void MainWindow::slotFilter( bool isOn ) | 634 | void MainWindow::slotFilter( bool isOn ) |
632 | { | 635 | { |
633 | OPackageList *packageList; | 636 | OPackageList *packageList; |
634 | if ( isOn ) | 637 | if ( isOn ) |
635 | { | 638 | { |
636 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | 639 | // Turn off other filtering options |
637 | m_filterStatus, m_filterCategory ); | 640 | m_actionShowNotInstalled->setOn( false ); |
641 | m_actionShowInstalled->setOn( false ); | ||
642 | m_actionShowUpdated->setOn( false ); | ||
643 | |||
644 | // If the filter settings have not been set yet, display filter dialog | ||
645 | if ( m_filterName.isNull() && m_filterServer.isNull() && m_filterDest.isNull() && | ||
646 | m_filterStatus == OPackageManager::NotDefined && m_filterCategory.isNull() ) | ||
647 | { | ||
648 | FilterDlg dlg( this, &m_packman, m_filterName, m_filterServer, m_filterDest, m_filterStatus, | ||
649 | m_filterCategory ); | ||
650 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) | ||
651 | { | ||
652 | m_filterName = dlg.name(); | ||
653 | m_filterServer = dlg.server(); | ||
654 | m_filterDest = dlg.destination(); | ||
655 | m_filterStatus = dlg.status(); | ||
656 | m_filterCategory = dlg.category(); | ||
657 | m_actionFilter->setOn( true ); | ||
658 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | ||
659 | m_filterStatus, m_filterCategory ); | ||
660 | } | ||
661 | else | ||
662 | { | ||
663 | m_actionFilter->setOn( false ); | ||
664 | packageList = m_packman.packages(); | ||
665 | } | ||
666 | } | ||
667 | else | ||
668 | { | ||
669 | m_actionFilter->setOn( true ); | ||
670 | packageList = m_packman.filterPackages( m_filterName, m_filterServer, m_filterDest, | ||
671 | m_filterStatus, m_filterCategory ); | ||
672 | } | ||
673 | |||
674 | |||
638 | } | 675 | } |
639 | else | 676 | else |
640 | packageList = m_packman.packages(); | 677 | packageList = m_packman.packages(); |
641 | 678 | ||
642 | if ( packageList ) | 679 | if ( packageList ) |
643 | { | 680 | { |
644 | loadPackageList( packageList, true ); | 681 | loadPackageList( packageList, true ); |
645 | delete packageList; | 682 | delete packageList; |
646 | } | 683 | } |
647 | } | 684 | } |
648 | 685 | ||
649 | void MainWindow::slotFindShowToolbar() | 686 | void MainWindow::slotFindShowToolbar() |
650 | { | 687 | { |
651 | m_findBar.show(); | 688 | m_findBar.show(); |
652 | m_findEdit->setFocus(); | 689 | m_findEdit->setFocus(); |
653 | } | 690 | } |