author | drw <drw> | 2003-03-29 20:46:43 (UTC) |
---|---|---|
committer | drw <drw> | 2003-03-29 20:46:43 (UTC) |
commit | 4e17e397c6df9e4e1ac6ee8315bbbced3e3b3b49 (patch) (unidiff) | |
tree | c2e356050c9b8b6a17f917c0e7c90c169ee1ce0d | |
parent | 4bf2c892cebbf80e825a717b6240d0377a2060ac (diff) | |
download | opie-4e17e397c6df9e4e1ac6ee8315bbbced3e3b3b49.zip opie-4e17e397c6df9e4e1ac6ee8315bbbced3e3b3b49.tar.gz opie-4e17e397c6df9e4e1ac6ee8315bbbced3e3b3b49.tar.bz2 |
Move Configure option under the Actions menu, allowing me to remove the top-level menu 'Options' (which only had the Config entry under it).
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 7fa311d..b597e03 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -89,166 +89,161 @@ MainWindow :: MainWindow() | |||
89 | 89 | ||
90 | QGridLayout *layout = new QGridLayout( w ); | 90 | QGridLayout *layout = new QGridLayout( w ); |
91 | 91 | ||
92 | char text[2]; | 92 | char text[2]; |
93 | text[1] = '\0'; | 93 | text[1] = '\0'; |
94 | for ( int i = 0 ; i < 26 ; ++i ) | 94 | for ( int i = 0 ; i < 26 ; ++i ) |
95 | { | 95 | { |
96 | text[0] = 'A' + i; | 96 | text[0] = 'A' + i; |
97 | LetterPushButton *b = new LetterPushButton( text, w ); | 97 | LetterPushButton *b = new LetterPushButton( text, w ); |
98 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | 98 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); |
99 | layout->addWidget( b, i / 13, i % 13); | 99 | layout->addWidget( b, i / 13, i % 13); |
100 | } | 100 | } |
101 | 101 | ||
102 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); | 102 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); |
103 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); | 103 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); |
104 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); | 104 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); |
105 | a->addTo( jumpBar ); | 105 | a->addTo( jumpBar ); |
106 | jumpBar->hide(); | 106 | jumpBar->hide(); |
107 | 107 | ||
108 | // Packages menu | 108 | // Packages menu |
109 | QPopupMenu *popup = new QPopupMenu( this ); | 109 | QPopupMenu *popup = new QPopupMenu( this ); |
110 | 110 | ||
111 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); | 111 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); |
112 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 112 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); |
113 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); | 113 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); |
114 | a->addTo( popup ); | 114 | a->addTo( popup ); |
115 | a->addTo( bar ); | 115 | a->addTo( bar ); |
116 | 116 | ||
117 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); | 117 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); |
118 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); | 118 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); |
119 | connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); | 119 | connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); |
120 | actionUpgrade->addTo( popup ); | 120 | actionUpgrade->addTo( popup ); |
121 | actionUpgrade->addTo( bar ); | 121 | actionUpgrade->addTo( bar ); |
122 | 122 | ||
123 | iconDownload = Resource::loadPixmap( "aqpkg/download" ); | 123 | iconDownload = Resource::loadPixmap( "aqpkg/download" ); |
124 | iconRemove = Resource::loadPixmap( "aqpkg/remove" ); | 124 | iconRemove = Resource::loadPixmap( "aqpkg/remove" ); |
125 | actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 125 | actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
126 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); | 126 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); |
127 | connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); | 127 | connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); |
128 | actionDownload->addTo( popup ); | 128 | actionDownload->addTo( popup ); |
129 | actionDownload->addTo( bar ); | 129 | actionDownload->addTo( bar ); |
130 | 130 | ||
131 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); | 131 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); |
132 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); | 132 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); |
133 | connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); | 133 | connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); |
134 | a->addTo( popup ); | 134 | a->addTo( popup ); |
135 | a->addTo( bar ); | 135 | a->addTo( bar ); |
136 | 136 | ||
137 | popup->insertSeparator(); | ||
138 | |||
139 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); | ||
140 | a->setWhatsThis( tr( "Click here to configure this application." ) ); | ||
141 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); | ||
142 | a->addTo( popup ); | ||
137 | mb->insertItem( tr( "Actions" ), popup ); | 143 | mb->insertItem( tr( "Actions" ), popup ); |
138 | 144 | ||
139 | // View menu | 145 | // View menu |
140 | popup = new QPopupMenu( this ); | 146 | popup = new QPopupMenu( this ); |
141 | 147 | ||
142 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 148 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
143 | actionUninstalled->setToggleAction( TRUE ); | 149 | actionUninstalled->setToggleAction( TRUE ); |
144 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); | 150 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); |
145 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); | 151 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); |
146 | actionUninstalled->addTo( popup ); | 152 | actionUninstalled->addTo( popup ); |
147 | 153 | ||
148 | actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 154 | actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
149 | actionInstalled->setToggleAction( TRUE ); | 155 | actionInstalled->setToggleAction( TRUE ); |
150 | actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); | 156 | actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); |
151 | connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); | 157 | connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); |
152 | actionInstalled->addTo( popup ); | 158 | actionInstalled->addTo( popup ); |
153 | 159 | ||
154 | actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 160 | actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
155 | actionUpdated->setToggleAction( TRUE ); | 161 | actionUpdated->setToggleAction( TRUE ); |
156 | actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); | 162 | actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); |
157 | connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); | 163 | connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); |
158 | actionUpdated->addTo( popup ); | 164 | actionUpdated->addTo( popup ); |
159 | 165 | ||
160 | popup->insertSeparator(); | 166 | popup->insertSeparator(); |
161 | 167 | ||
162 | actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); | 168 | actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); |
163 | actionFilter->setToggleAction( TRUE ); | 169 | actionFilter->setToggleAction( TRUE ); |
164 | actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); | 170 | actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); |
165 | connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); | 171 | connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); |
166 | actionFilter->addTo( popup ); | 172 | actionFilter->addTo( popup ); |
167 | 173 | ||
168 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); | 174 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); |
169 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); | 175 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); |
170 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); | 176 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); |
171 | a->addTo( popup ); | 177 | a->addTo( popup ); |
172 | 178 | ||
173 | popup->insertSeparator(); | 179 | popup->insertSeparator(); |
174 | 180 | ||
175 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
176 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); | 182 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); |
177 | connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); | 183 | connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); |
178 | a->addTo( popup ); | 184 | a->addTo( popup ); |
179 | 185 | ||
180 | actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); | 186 | actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); |
181 | actionFindNext->setEnabled( FALSE ); | 187 | actionFindNext->setEnabled( FALSE ); |
182 | actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); | 188 | actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); |
183 | connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); | 189 | connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); |
184 | actionFindNext->addTo( popup ); | 190 | actionFindNext->addTo( popup ); |
185 | actionFindNext->addTo( findBar ); | 191 | actionFindNext->addTo( findBar ); |
186 | 192 | ||
187 | 193 | ||
188 | popup->insertSeparator(); | 194 | popup->insertSeparator(); |
189 | 195 | ||
190 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); | 196 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); |
191 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); | 197 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); |
192 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); | 198 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); |
193 | a->addTo( popup ); | 199 | a->addTo( popup ); |
194 | 200 | ||
195 | mb->insertItem( tr( "View" ), popup ); | 201 | mb->insertItem( tr( "View" ), popup ); |
196 | |||
197 | |||
198 | // Options menu | ||
199 | popup = new QPopupMenu( this ); | ||
200 | |||
201 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); | ||
202 | a->setWhatsThis( tr( "Click here to configure this application." ) ); | ||
203 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); | ||
204 | a->addTo( popup ); | ||
205 | |||
206 | mb->insertItem( tr( "Options" ), popup ); | ||
207 | 202 | ||
208 | // Finish find toolbar creation | 203 | // Finish find toolbar creation |
209 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 204 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
210 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | 205 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); |
211 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); | 206 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); |
212 | a->addTo( findBar ); | 207 | a->addTo( findBar ); |
213 | findBar->hide(); | 208 | findBar->hide(); |
214 | 209 | ||
215 | // Create widget stack and add UI widgets | 210 | // Create widget stack and add UI widgets |
216 | stack = new QWidgetStack( this ); | 211 | stack = new QWidgetStack( this ); |
217 | stack->addWidget( progressWindow, 2 ); | 212 | stack->addWidget( progressWindow, 2 ); |
218 | stack->addWidget( networkPkgWindow, 1 ); | 213 | stack->addWidget( networkPkgWindow, 1 ); |
219 | setCentralWidget( stack ); | 214 | setCentralWidget( stack ); |
220 | stack->raiseWidget( progressWindow ); | 215 | stack->raiseWidget( progressWindow ); |
221 | 216 | ||
222 | // Delayed call to finish initialization | 217 | // Delayed call to finish initialization |
223 | QTimer::singleShot( 100, this, SLOT( init() ) ); | 218 | QTimer::singleShot( 100, this, SLOT( init() ) ); |
224 | } | 219 | } |
225 | 220 | ||
226 | MainWindow :: ~MainWindow() | 221 | MainWindow :: ~MainWindow() |
227 | { | 222 | { |
228 | delete mgr; | 223 | delete mgr; |
229 | } | 224 | } |
230 | 225 | ||
231 | void MainWindow :: initMainWidget() | 226 | void MainWindow :: initMainWidget() |
232 | { | 227 | { |
233 | networkPkgWindow = new QWidget( this ); | 228 | networkPkgWindow = new QWidget( this ); |
234 | 229 | ||
235 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); | 230 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); |
236 | 231 | ||
237 | serversList = new QComboBox( networkPkgWindow ); | 232 | serversList = new QComboBox( networkPkgWindow ); |
238 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); | 233 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); |
239 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); | 234 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); |
240 | 235 | ||
241 | installedIcon = Resource::loadPixmap( "installed" ); | 236 | installedIcon = Resource::loadPixmap( "installed" ); |
242 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); | 237 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); |
243 | 238 | ||
244 | packagesList = new QListView( networkPkgWindow ); | 239 | packagesList = new QListView( networkPkgWindow ); |
245 | packagesList->addColumn( tr( "Packages" ), 225 ); | 240 | packagesList->addColumn( tr( "Packages" ), 225 ); |
246 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); | 241 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); |
247 | 242 | ||
248 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); | 243 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); |
249 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); | 244 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); |
250 | hbox1->addWidget( l ); | 245 | hbox1->addWidget( l ); |
251 | hbox1->addWidget( serversList ); | 246 | hbox1->addWidget( serversList ); |
252 | 247 | ||
253 | vbox->addWidget( packagesList ); | 248 | vbox->addWidget( packagesList ); |
254 | 249 | ||