author | drw <drw> | 2003-01-10 21:07:59 (UTC) |
---|---|---|
committer | drw <drw> | 2003-01-10 21:07:59 (UTC) |
commit | 3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac (patch) (unidiff) | |
tree | a6cb5e1cc109fc9ec54aca9b61726111771f08bf /noncore/settings/aqpkg/mainwin.cpp | |
parent | 1c7ae0ce09caf37c3c7d5d284eee390940143a26 (diff) | |
download | opie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.zip opie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.tar.gz opie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.tar.bz2 |
Made find dialog a toolbar, fixed show options under View menu
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 166 |
1 files changed, 77 insertions, 89 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 4aa83b5..e184f6b 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -14,28 +14,30 @@ | |||
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include <iostream> | 18 | #include <iostream> |
19 | using namespace std; | 19 | using namespace std; |
20 | 20 | ||
21 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
22 | #include <qpe/qpetoolbar.h> | 22 | #include <qpe/qpetoolbar.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | 24 | ||
25 | #include <qaction.h> | 25 | #include <qaction.h> |
26 | #include <qlineedit.h> | ||
26 | #include <qmenubar.h> | 27 | #include <qmenubar.h> |
27 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
28 | #include <qpopupmenu.h> | 29 | #include <qpopupmenu.h> |
29 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qwhatsthis.h> | ||
30 | #include <qwidgetstack.h> | 32 | #include <qwidgetstack.h> |
31 | 33 | ||
32 | #include "mainwin.h" | 34 | #include "mainwin.h" |
33 | #include "progresswidget.h" | 35 | #include "progresswidget.h" |
34 | #include "datamgr.h" | 36 | #include "datamgr.h" |
35 | #include "networkpkgmgr.h" | 37 | #include "networkpkgmgr.h" |
36 | #include "settingsimpl.h" | 38 | #include "settingsimpl.h" |
37 | #include "helpwindow.h" | 39 | #include "helpwindow.h" |
38 | #include "utils.h" | 40 | #include "utils.h" |
39 | #include "global.h" | 41 | #include "global.h" |
40 | 42 | ||
41 | MainWindow :: MainWindow() | 43 | MainWindow :: MainWindow() |
@@ -47,24 +49,33 @@ MainWindow :: MainWindow() | |||
47 | progressWindow = new ProgressWidget( this ); | 49 | progressWindow = new ProgressWidget( this ); |
48 | networkPkgWindow = new NetworkPackageManager( this ); | 50 | networkPkgWindow = new NetworkPackageManager( this ); |
49 | 51 | ||
50 | // Build menu and tool bars | 52 | // Build menu and tool bars |
51 | setToolBarsMovable( FALSE ); | 53 | setToolBarsMovable( FALSE ); |
52 | 54 | ||
53 | QPEToolBar *bar = new QPEToolBar( this ); | 55 | QPEToolBar *bar = new QPEToolBar( this ); |
54 | bar->setHorizontalStretchable( TRUE ); | 56 | bar->setHorizontalStretchable( TRUE ); |
55 | QPEMenuBar *mb = new QPEMenuBar( bar ); | 57 | QPEMenuBar *mb = new QPEMenuBar( bar ); |
56 | mb->setMargin( 0 ); | 58 | mb->setMargin( 0 ); |
57 | bar = new QPEToolBar( this ); | 59 | bar = new QPEToolBar( this ); |
58 | 60 | ||
61 | // Find toolbar | ||
62 | findBar = new QPEToolBar( this ); | ||
63 | addToolBar( findBar, QMainWindow::Top, true ); | ||
64 | findBar->setHorizontalStretchable( true ); | ||
65 | findEdit = new QLineEdit( findBar ); | ||
66 | QWhatsThis::add( findEdit, tr( "Type the text to search for here." ) ); | ||
67 | findBar->setStretchableWidget( findEdit ); | ||
68 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( findPackage( const QString & ) ) ); | ||
69 | |||
59 | // Packages menu | 70 | // Packages menu |
60 | QPopupMenu *popup = new QPopupMenu( this ); | 71 | QPopupMenu *popup = new QPopupMenu( this ); |
61 | 72 | ||
62 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); | 73 | QAction *a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); |
63 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 74 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); |
64 | connect( a, SIGNAL( activated() ), networkPkgWindow, SLOT( updateServer() ) ); | 75 | connect( a, SIGNAL( activated() ), networkPkgWindow, SLOT( updateServer() ) ); |
65 | a->addTo( popup ); | 76 | a->addTo( popup ); |
66 | a->addTo( bar ); | 77 | a->addTo( bar ); |
67 | 78 | ||
68 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); | 79 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); |
69 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); | 80 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); |
70 | connect( actionUpgrade, SIGNAL( activated() ), networkPkgWindow, SLOT( upgradePackages() ) ); | 81 | connect( actionUpgrade, SIGNAL( activated() ), networkPkgWindow, SLOT( upgradePackages() ) ); |
@@ -82,89 +93,103 @@ MainWindow :: MainWindow() | |||
82 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); | 93 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); |
83 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); | 94 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); |
84 | connect( a, SIGNAL( activated() ), networkPkgWindow, SLOT( applyChanges() ) ); | 95 | connect( a, SIGNAL( activated() ), networkPkgWindow, SLOT( applyChanges() ) ); |
85 | a->addTo( popup ); | 96 | a->addTo( popup ); |
86 | a->addTo( bar ); | 97 | a->addTo( bar ); |
87 | 98 | ||
88 | mb->insertItem( tr( "Packages" ), popup ); | 99 | mb->insertItem( tr( "Packages" ), popup ); |
89 | 100 | ||
90 | // Search menu | 101 | // Search menu |
91 | popup = new QPopupMenu( this ); | 102 | popup = new QPopupMenu( this ); |
92 | 103 | ||
93 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 104 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
94 | a->setWhatsThis( tr( "Click here to search for a specific package." ) ); | 105 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); |
95 | connect( a, SIGNAL( activated() ), this, SLOT( searchForPackage() ) ); | 106 | connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); |
96 | a->addTo( popup ); | 107 | a->addTo( popup ); |
97 | 108 | ||
98 | a = new QAction( tr( "Find next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 109 | actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); |
99 | a->setWhatsThis( tr( "Click here to search for the next package." ) ); | 110 | actionFindNext->setEnabled( FALSE ); |
100 | connect( a, SIGNAL( activated() ), this, SLOT( repeatSearchForPackage() ) ); | 111 | actionFindNext->setWhatsThis( tr( "Click here to search for the package name containing the text you are searching for." ) ); |
101 | a->addTo( popup ); | 112 | connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); |
113 | actionFindNext->addTo( popup ); | ||
114 | actionFindNext->addTo( findBar ); | ||
102 | 115 | ||
103 | // Show 'quick jump' keypad? | 116 | // Show 'quick jump' keypad? |
104 | 117 | ||
105 | popup->insertSeparator(); | 118 | popup->insertSeparator(); |
106 | 119 | ||
107 | a = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); | 120 | actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); |
108 | a->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); | 121 | actionFilter->setToggleAction( TRUE ); |
109 | connect( a, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); | 122 | actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); |
110 | a->addTo( popup ); | 123 | connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); |
124 | actionFilter->addTo( popup ); | ||
111 | 125 | ||
112 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); | 126 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); |
113 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); | 127 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); |
114 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); | 128 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); |
115 | a->addTo( popup ); | 129 | a->addTo( popup ); |
116 | 130 | ||
117 | mb->insertItem( tr( "Search" ), popup ); | 131 | mb->insertItem( tr( "Search" ), popup ); |
118 | 132 | ||
119 | 133 | ||
120 | // View menu | 134 | // View menu |
121 | popup = new QPopupMenu( this ); | 135 | popup = new QPopupMenu( this ); |
122 | 136 | ||
123 | a = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 137 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
124 | a->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); | 138 | actionUninstalled->setToggleAction( TRUE ); |
125 | connect( a, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); | 139 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); |
126 | a->addTo( popup ); | 140 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); |
141 | actionUninstalled->addTo( popup ); | ||
127 | 142 | ||
128 | a = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 143 | actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
129 | a->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); | 144 | actionInstalled->setToggleAction( TRUE ); |
130 | connect( a, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); | 145 | actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); |
131 | a->addTo( popup ); | 146 | connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); |
147 | actionInstalled->addTo( popup ); | ||
132 | 148 | ||
133 | a = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 149 | actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
134 | a->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); | 150 | actionUpdated->setToggleAction( TRUE ); |
135 | connect( a, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); | 151 | actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); |
136 | a->addTo( popup ); | 152 | connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); |
153 | actionUpdated->addTo( popup ); | ||
137 | 154 | ||
138 | popup->insertSeparator(); | 155 | popup->insertSeparator(); |
139 | 156 | ||
140 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 ); | 157 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 ); |
141 | a->setWhatsThis( tr( "Click here to configure this application." ) ); | 158 | a->setWhatsThis( tr( "Click here to configure this application." ) ); |
142 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); | 159 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); |
143 | a->addTo( popup ); | 160 | a->addTo( popup ); |
144 | 161 | ||
145 | popup->insertSeparator(); | 162 | popup->insertSeparator(); |
146 | 163 | ||
147 | a = new QAction( tr( "Help" ), Resource::loadPixmap( "help_icon" ), QString::null, 0, this, 0 ); | 164 | a = new QAction( tr( "Help" ), Resource::loadPixmap( "help_icon" ), QString::null, 0, this, 0 ); |
148 | a->setWhatsThis( tr( "Click here for help." ) ); | 165 | a->setWhatsThis( tr( "Click here for help." ) ); |
149 | connect( a, SIGNAL( activated() ), this, SLOT( displayHelp() ) ); | 166 | connect( a, SIGNAL( activated() ), this, SLOT( displayHelp() ) ); |
150 | a->addTo( popup ); | 167 | a->addTo( popup ); |
151 | 168 | ||
152 | a = new QAction( tr( "About" ), Resource::loadPixmap( "UtilsIcon" ), QString::null, 0, this, 0 ); | 169 | a = new QAction( tr( "About" ), Resource::loadPixmap( "UtilsIcon" ), QString::null, 0, this, 0 ); |
153 | a->setWhatsThis( tr( "Click here for software version information." ) ); | 170 | a->setWhatsThis( tr( "Click here for software version information." ) ); |
154 | connect( a, SIGNAL( activated() ), this, SLOT( displayAbout() ) ); | 171 | connect( a, SIGNAL( activated() ), this, SLOT( displayAbout() ) ); |
155 | a->addTo( popup ); | 172 | a->addTo( popup ); |
156 | 173 | ||
157 | mb->insertItem( tr( "View" ), popup ); | 174 | mb->insertItem( tr( "View" ), popup ); |
175 | |||
176 | // Finish find toolbar creation | ||
177 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | ||
178 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | ||
179 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); | ||
180 | a->addTo( findBar ); | ||
181 | findBar->hide(); | ||
158 | 182 | ||
183 | |||
159 | // Create widget stack and add UI widgets | 184 | // Create widget stack and add UI widgets |
160 | stack = new QWidgetStack( this ); | 185 | stack = new QWidgetStack( this ); |
161 | stack->addWidget( progressWindow, 2 ); | 186 | stack->addWidget( progressWindow, 2 ); |
162 | stack->addWidget( networkPkgWindow, 1 ); | 187 | stack->addWidget( networkPkgWindow, 1 ); |
163 | setCentralWidget( stack ); | 188 | setCentralWidget( stack ); |
164 | stack->raiseWidget( progressWindow ); | 189 | stack->raiseWidget( progressWindow ); |
165 | 190 | ||
166 | // Delayed call to finish initialization | 191 | // Delayed call to finish initialization |
167 | QTimer::singleShot( 100, this, SLOT( init() ) ); | 192 | QTimer::singleShot( 100, this, SLOT( init() ) ); |
168 | } | 193 | } |
169 | 194 | ||
170 | MainWindow :: ~MainWindow() | 195 | MainWindow :: ~MainWindow() |
@@ -210,125 +235,88 @@ void MainWindow :: displaySettings() | |||
210 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); | 235 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); |
211 | if ( dlg->showDlg( 0 ) ) | 236 | if ( dlg->showDlg( 0 ) ) |
212 | networkPkgWindow->updateData(); | 237 | networkPkgWindow->updateData(); |
213 | delete dlg; | 238 | delete dlg; |
214 | } | 239 | } |
215 | 240 | ||
216 | void MainWindow :: displayHelp() | 241 | void MainWindow :: displayHelp() |
217 | { | 242 | { |
218 | HelpWindow *dlg = new HelpWindow( this ); | 243 | HelpWindow *dlg = new HelpWindow( this ); |
219 | dlg->exec(); | 244 | dlg->exec(); |
220 | delete dlg; | 245 | delete dlg; |
221 | } | 246 | } |
247 | |||
248 | void MainWindow :: displayFindBar() | ||
249 | { | ||
250 | findBar->show(); | ||
251 | findEdit->setFocus(); | ||
252 | } | ||
222 | 253 | ||
223 | void MainWindow :: searchForPackage() | 254 | void MainWindow :: repeatFind() |
224 | { | 255 | { |
225 | networkPkgWindow->searchForPackage( false ); | 256 | networkPkgWindow->searchForPackage( findEdit->text() ); |
226 | } | 257 | } |
227 | 258 | ||
228 | void MainWindow :: repeatSearchForPackage() | 259 | void MainWindow :: findPackage( const QString &text ) |
229 | { | 260 | { |
230 | networkPkgWindow->searchForPackage( true ); | 261 | actionFindNext->setEnabled( !text.isEmpty() ); |
262 | networkPkgWindow->searchForPackage( text ); | ||
263 | } | ||
264 | |||
265 | void MainWindow :: hideFindBar() | ||
266 | { | ||
267 | findBar->hide(); | ||
231 | } | 268 | } |
232 | 269 | ||
233 | void MainWindow :: displayAbout() | 270 | void MainWindow :: displayAbout() |
234 | { | 271 | { |
235 | QMessageBox::about( this, tr( "About AQPkg" ), tr( VERSION_TEXT ) ); | 272 | QMessageBox::about( this, tr( "About AQPkg" ), tr( VERSION_TEXT ) ); |
236 | } | 273 | } |
237 | 274 | ||
238 | |||
239 | void MainWindow :: filterUninstalledPackages() | 275 | void MainWindow :: filterUninstalledPackages() |
240 | { | 276 | { |
241 | bool val; | 277 | networkPkgWindow->showOnlyUninstalledPackages( actionUninstalled->isOn() ); |
242 | if ( filter->isItemChecked( mnuShowUninstalledPkgsId ) ) | 278 | actionInstalled->setOn( FALSE ); |
243 | { | 279 | actionUpdated->setOn( FALSE ); |
244 | val = false; | ||
245 | filter->setItemChecked( mnuShowUninstalledPkgsId, false ); | ||
246 | } | ||
247 | else | ||
248 | { | ||
249 | val = true; | ||
250 | filter->setItemChecked( mnuShowUninstalledPkgsId, true ); | ||
251 | } | ||
252 | |||
253 | filter->setItemChecked( mnuShowInstalledPkgsId, false ); | ||
254 | networkPkgWindow->showOnlyInstalledPackages( false ); | ||
255 | filter->setItemChecked( mnuShowUpgradedPkgsId, false ); | ||
256 | networkPkgWindow->showUpgradedPackages( false ); | ||
257 | |||
258 | networkPkgWindow->showOnlyUninstalledPackages( val ); | ||
259 | |||
260 | } | 280 | } |
261 | 281 | ||
262 | void MainWindow :: filterInstalledPackages() | 282 | void MainWindow :: filterInstalledPackages() |
263 | { | 283 | { |
264 | bool val; | 284 | actionUninstalled->setOn( FALSE ); |
265 | if ( filter->isItemChecked( mnuShowInstalledPkgsId ) ) | 285 | networkPkgWindow->showOnlyInstalledPackages( actionInstalled->isOn() ); |
266 | { | 286 | actionUpdated->setOn( FALSE ); |
267 | val = false; | ||
268 | filter->setItemChecked( mnuShowInstalledPkgsId, false ); | ||
269 | } | ||
270 | else | ||
271 | { | ||
272 | val = true; | ||
273 | filter->setItemChecked( mnuShowInstalledPkgsId, true ); | ||
274 | } | ||
275 | |||
276 | filter->setItemChecked( mnuShowUninstalledPkgsId, false ); | ||
277 | networkPkgWindow->showOnlyUninstalledPackages( false ); | ||
278 | filter->setItemChecked( mnuShowUpgradedPkgsId, false ); | ||
279 | networkPkgWindow->showUpgradedPackages( false ); | ||
280 | |||
281 | networkPkgWindow->showOnlyInstalledPackages( val ); | ||
282 | } | 287 | } |
283 | 288 | ||
284 | void MainWindow :: filterUpgradedPackages() | 289 | void MainWindow :: filterUpgradedPackages() |
285 | { | 290 | { |
286 | bool val; | 291 | actionUninstalled->setOn( FALSE ); |
287 | if ( filter->isItemChecked( mnuShowUpgradedPkgsId ) ) | 292 | actionInstalled->setOn( FALSE ); |
288 | { | 293 | networkPkgWindow->showUpgradedPackages( actionUpdated->isOn() ); |
289 | val = false; | ||
290 | filter->setItemChecked( mnuShowUpgradedPkgsId, false ); | ||
291 | } | ||
292 | else | ||
293 | { | ||
294 | val = true; | ||
295 | filter->setItemChecked( mnuShowUpgradedPkgsId, true ); | ||
296 | } | ||
297 | |||
298 | filter->setItemChecked( mnuShowUninstalledPkgsId, false ); | ||
299 | networkPkgWindow->showOnlyUninstalledPackages( false ); | ||
300 | filter->setItemChecked( mnuShowInstalledPkgsId, false ); | ||
301 | networkPkgWindow->showOnlyInstalledPackages( false ); | ||
302 | |||
303 | networkPkgWindow->showUpgradedPackages( val ); | ||
304 | } | 294 | } |
305 | 295 | ||
306 | void MainWindow :: setFilterCategory() | 296 | void MainWindow :: setFilterCategory() |
307 | { | 297 | { |
308 | if ( networkPkgWindow->setFilterCategory( ) ) | 298 | if ( networkPkgWindow->setFilterCategory() ) |
309 | filter->setItemChecked( mnuFilterByCategory, true ); | 299 | actionFilter->setOn( TRUE ); |
310 | } | 300 | } |
311 | 301 | ||
312 | void MainWindow :: filterCategory() | 302 | void MainWindow :: filterCategory() |
313 | { | 303 | { |
314 | if ( filter->isItemChecked( mnuFilterByCategory ) ) | 304 | if ( !actionFilter->isOn() ) |
315 | { | 305 | { |
316 | networkPkgWindow->filterByCategory( false ); | 306 | networkPkgWindow->filterByCategory( FALSE ); |
317 | filter->setItemChecked( mnuFilterByCategory, false ); | ||
318 | } | 307 | } |
319 | else | 308 | else |
320 | { | 309 | { |
321 | if ( networkPkgWindow->filterByCategory( true ) ) | 310 | actionFilter->setOn( networkPkgWindow->filterByCategory( TRUE ) ); |
322 | filter->setItemChecked( mnuFilterByCategory, true ); | ||
323 | } | 311 | } |
324 | } | 312 | } |
325 | 313 | ||
326 | void MainWindow :: raiseMainWidget() | 314 | void MainWindow :: raiseMainWidget() |
327 | { | 315 | { |
328 | stack->raiseWidget( networkPkgWindow ); | 316 | stack->raiseWidget( networkPkgWindow ); |
329 | } | 317 | } |
330 | 318 | ||
331 | void MainWindow :: raiseProgressWidget() | 319 | void MainWindow :: raiseProgressWidget() |
332 | { | 320 | { |
333 | stack->raiseWidget( progressWindow ); | 321 | stack->raiseWidget( progressWindow ); |
334 | } | 322 | } |