summaryrefslogtreecommitdiff
authordrw <drw>2004-02-13 15:14:22 (UTC)
committer drw <drw>2004-02-13 15:14:22 (UTC)
commitf3cf623e76060c8f4ee7c2eef241de02d63a2614 (patch) (unidiff)
tree949651c743a703448e4109e8189c78a1db7143ea
parent97bdea970b2fb017eef7d3b03d7a316eb216266b (diff)
downloadopie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.zip
opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.gz
opie-f3cf623e76060c8f4ee7c2eef241de02d63a2614.tar.bz2
Fix handling of filtering options in View menu
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog4
-rw-r--r--noncore/settings/packagemanager/mainwindow.cpp51
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,21 +1,25 @@
12004-02-13 Dan Williams <drw@handhelds.org>
2
3 * Fix handling of filtering options in View menu
4
12004-02-12 Dan Williams <drw@handhelds.org> 52004-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
72004-01-23 Dan Williams <drw@handhelds.org> 112004-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
132004-01-20 Dan Williams <drw@handhelds.org> 172004-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
17 21
182004-01-13 Dan Williams <drw@handhelds.org> 222004-01-13 Dan Williams <drw@handhelds.org>
19 23
20 * Released version 0.1.0 24 * Released version 0.1.0
21 * Initial check-in of new package management client to eventually replace AQPkg 25 * Initial check-in of new package management client to eventually replace AQPkg
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
@@ -192,60 +192,60 @@ void MainWindow::initUI()
192 192
193 // View menu 193 // View menu
194 popup = new QPopupMenu( this ); 194 popup = new QPopupMenu( this );
195 195
196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); 196 m_actionShowNotInstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 );
197 m_actionShowNotInstalled->setToggleAction( true ); 197 m_actionShowNotInstalled->setToggleAction( true );
198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); 198 m_actionShowNotInstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) );
199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) ); 199 connect( m_actionShowNotInstalled, SIGNAL(activated()), this, SLOT(slotShowNotInstalled()) );
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
244 // Finish find toolbar creation 244 // Finish find toolbar creation
245 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 245 a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
246 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); 246 a->setWhatsThis( tr( "Click here to hide the find toolbar." ) );
247 connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) ); 247 connect( a, SIGNAL(activated()), this, SLOT(slotFindHideToolbar()) );
248 a->addTo( &m_findBar ); 248 a->addTo( &m_findBar );
249 m_findBar.hide(); 249 m_findBar.hide();
250} 250}
251 251
@@ -533,129 +533,166 @@ void MainWindow::slotCloseDlg()
533 e << lf; 533 e << lf;
534} 534}
535 535
536void MainWindow::slotConfigure() 536void MainWindow::slotConfigure()
537{ 537{
538 if ( m_packman.configureDlg( false ) ) 538 if ( m_packman.configureDlg( false ) )
539 { 539 {
540 if ( PromptDlg::ask( tr( "Config updated" ), 540 if ( PromptDlg::ask( tr( "Config updated" ),
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
550void MainWindow::slotShowNotInstalled() 550void 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
570void MainWindow::slotShowInstalled() 571void 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
590void MainWindow::slotShowUpdated() 592void 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
610void MainWindow::slotFilterChange() 613void 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,
613 m_filterCategory ); 616 m_filterCategory );
614 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) 617 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted )
615 { 618 {
616 m_filterName = dlg.name(); 619 m_filterName = dlg.name();
617 m_filterServer = dlg.server(); 620 m_filterServer = dlg.server();
618 m_filterDest = dlg.destination(); 621 m_filterDest = dlg.destination();
619 m_filterStatus = dlg.status(); 622 m_filterStatus = dlg.status();
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
631void MainWindow::slotFilter( bool isOn ) 634void 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
649void MainWindow::slotFindShowToolbar() 686void MainWindow::slotFindShowToolbar()
650{ 687{
651 m_findBar.show(); 688 m_findBar.show();
652 m_findEdit->setFocus(); 689 m_findEdit->setFocus();
653} 690}
654 691
655void MainWindow::slotFindHideToolbar() 692void MainWindow::slotFindHideToolbar()
656{ 693{
657 m_findBar.hide(); 694 m_findBar.hide();
658} 695}
659 696
660void MainWindow::slotFindChanged( const QString &findText ) 697void MainWindow::slotFindChanged( const QString &findText )
661{ 698{