author | sandman <sandman> | 2003-03-21 21:12:14 (UTC) |
---|---|---|
committer | sandman <sandman> | 2003-03-21 21:12:14 (UTC) |
commit | d11cf5483fbfa87a7be65891df2625def351f3a4 (patch) (unidiff) | |
tree | 53ec1a4fefcd7a2fc37bd64a0bae3ce378c5ef7d | |
parent | 633fbff7e3d85a5fc16bd3ed3283723c44acb2aa (diff) | |
download | opie-d11cf5483fbfa87a7be65891df2625def351f3a4.zip opie-d11cf5483fbfa87a7be65891df2625def351f3a4.tar.gz opie-d11cf5483fbfa87a7be65891df2625def351f3a4.tar.bz2 |
fix for bug #647:
Programs are sorted by their internal name and not by the translated name
(in the O-Menu)
-rw-r--r-- | core/launcher/startmenu.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 2871233..28c8b97 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -194,65 +194,73 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
194 | } else { | 194 | } else { |
195 | new_menu = (QPopupMenu*)1; | 195 | new_menu = (QPopupMenu*)1; |
196 | } | 196 | } |
197 | typpop.insert(*tit, new_menu); | 197 | typpop.insert(*tit, new_menu); |
198 | } | 198 | } |
199 | if ( tit == typs. begin ( )) | 199 | if ( tit == typs. begin ( )) |
200 | break; | 200 | break; |
201 | } | 201 | } |
202 | QListIterator<AppLnk> it( folder->children() ); | 202 | QListIterator<AppLnk> it( folder->children() ); |
203 | bool f=TRUE; | 203 | bool f=TRUE; |
204 | for ( ; it.current(); ++it ) { | 204 | for ( ; it.current(); ++it ) { |
205 | AppLnk *app = it.current(); | 205 | AppLnk *app = it.current(); |
206 | if ( app->type() == "Separator" ) { // No tr | 206 | if ( app->type() == "Separator" ) { // No tr |
207 | if ( lot ) { | 207 | if ( lot ) { |
208 | menu->insertSeparator(); | 208 | menu->insertSeparator(); |
209 | } | 209 | } |
210 | } else { | 210 | } else { |
211 | f = FALSE; | 211 | f = FALSE; |
212 | QString t = app->type(); | 212 | QString t = app->type(); |
213 | QPopupMenu* pmenu = typpop.find(t); | 213 | QPopupMenu* pmenu = typpop.find(t); |
214 | if ( ltabs ) { | 214 | if ( ltabs ) { |
215 | if ( !pmenu && lot ) | 215 | if ( !pmenu && lot ) |
216 | pmenu = menu; | 216 | pmenu = menu; |
217 | } else { | 217 | } else { |
218 | if ( !pmenu ) | 218 | if ( !pmenu ) |
219 | pmenu = menu; | 219 | pmenu = menu; |
220 | else | 220 | else |
221 | pmenu = 0; | 221 | pmenu = 0; |
222 | } | 222 | } |
223 | if ( pmenu ) { | 223 | if ( pmenu ) { |
224 | QString t = app->name(); | 224 | QString t = app->name(); |
225 | t.replace(QRegExp("&"),"&&"); // escape shortcut character | 225 | t.replace(QRegExp("&"),"&&"); // escape shortcut character |
226 | pmenu->insertItem( app->pixmap(), t, app->id() ); | 226 | |
227 | int index = -1; | ||
228 | |||
229 | for ( index = 0; index < pmenu-> count ( ); index++ ) { | ||
230 | if ( pmenu-> text ( pmenu-> idAt ( index )). compare ( t ) > 0 ) | ||
231 | break; | ||
232 | } | ||
233 | |||
234 | pmenu->insertItem( app->pixmap(), t, app->id(), index ); | ||
227 | } | 235 | } |
228 | result=TRUE; | 236 | result=TRUE; |
229 | } | 237 | } |
230 | } | 238 | } |
231 | } | 239 | } |
232 | 240 | ||
233 | if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries | 241 | if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries |
234 | menu-> removeItem ( sepId ); | 242 | menu-> removeItem ( sepId ); |
235 | sepId = 0; | 243 | sepId = 0; |
236 | } | 244 | } |
237 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | 245 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later |
238 | sepId = menu-> insertSeparator ( ); | 246 | sepId = menu-> insertSeparator ( ); |
239 | 247 | ||
240 | return result; | 248 | return result; |
241 | } | 249 | } |
242 | 250 | ||
243 | 251 | ||
244 | void StartMenu::launch ( ) | 252 | void StartMenu::launch ( ) |
245 | { | 253 | { |
246 | int y = mapToGlobal ( QPoint ( )). y ( ) - launchMenu-> sizeHint ( ). height ( ); | 254 | int y = mapToGlobal ( QPoint ( )). y ( ) - launchMenu-> sizeHint ( ). height ( ); |
247 | 255 | ||
248 | if ( launchMenu-> isVisible ( )) { | 256 | if ( launchMenu-> isVisible ( )) { |
249 | launchMenu-> hide ( ); | 257 | launchMenu-> hide ( ); |
250 | } | 258 | } |
251 | else { | 259 | else { |
252 | QWidget *active = qApp-> activeWindow ( ); | 260 | QWidget *active = qApp-> activeWindow ( ); |
253 | if ( active && active-> isPopup ( )) | 261 | if ( active && active-> isPopup ( )) |
254 | active-> close ( ); | 262 | active-> close ( ); |
255 | 263 | ||
256 | launchMenu-> popup ( QPoint ( 1, y )); | 264 | launchMenu-> popup ( QPoint ( 1, y )); |
257 | } | 265 | } |
258 | } | 266 | } |