<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39913 >
This also fixes the bug that the editor main menu was improperly disabled sometimes. HIG [page 43] explicitly says: Do not disable menu titles. Allow the user to explore the menu, even though there might be no available items on it at that time. With the Editing Mode under Edit, Editing Mode can be disabled instead. The items below it are disabled until Editing Mode is enabled (as now). Attempted to fix gui-win32 in passing (without testing), but no others.
Index: client/gui-gtk-2.0/menu.c =================================================================== --- client/gui-gtk-2.0/menu.c (revision 14078) +++ client/gui-gtk-2.0/menu.c (working copy) @@ -766,28 +766,39 @@ { "/" N_("Game") "/" N_("_Quit"), NULL, game_menu_callback, MENU_GAME_QUIT, "<StockItem>", GTK_STOCK_QUIT }, - /* Government menu ... */ - { "/" N_("Gover_nment"), NULL, + /* was Government menu ... */ + { "/" N_("_Edit"), NULL, NULL, 0, "<Branch>" }, - { "/" N_("Government") "/tearoff1", NULL, + { "/" N_("_Edit") "/tearoff1", NULL, NULL, 0, "<Tearoff>" }, - { "/" N_("Government") "/" N_("_Tax Rates"), "<shift>t", + { "/" N_("_Edit") "/" N_("Tax Rates"), "<shift>t", government_menu_callback, MENU_GOVERNMENT_TAX_RATE }, - { "/" N_("Government") "/sep1", NULL, + { "/" N_("_Edit") "/sep1", NULL, NULL, 0, "<Separator>" }, - { "/" N_("Government") "/" N_("_Find City"), "<shift>f", + { "/" N_("_Edit") "/" N_("Find City"), "<shift>f", government_menu_callback, MENU_GOVERNMENT_FIND_CITY }, - { "/" N_("Government") "/" N_("_Worklists"), "<control>l", + { "/" N_("_Edit") "/" N_("Worklists"), "<control>l", government_menu_callback, MENU_GOVERNMENT_WORKLISTS }, - { "/" N_("Government") "/sep2", NULL, + { "/" N_("_Edit") "/sep2", NULL, NULL, 0, "<Separator>" }, - { "/" N_("Government") "/" N_("_Change Government"), NULL, + { "/" N_("_Edit") "/" N_("_Government"), NULL, NULL, 0, "<Branch>" }, - { "/" N_("Government") "/" N_("_Change Government") "/" N_("_Revolution..."), + { "/" N_("_Edit") "/" N_("_Government") "/" N_("Revolution..."), "<shift>r", government_menu_callback, MENU_GOVERNMENT_REVOLUTION }, - { "/" N_("_Government") "/" N_("_Change Government") "/sep1", NULL, + { "/" N_("_Edit") "/" N_("_Government") "/sep1", NULL, NULL, 0, "<Separator>" }, + /* was Editor menu */ + { "/" N_("_Edit") "/tearoff2", NULL, NULL, 0, "<Tearoff>" }, + { "/" N_("_Edit") "/" N_("Editing _Mode"), NULL, + editor_menu_callback, MENU_EDITOR_TOGGLE, "<CheckItem>" }, + { "/" N_("_Edit") "/" N_("Editing _Tools"), NULL, + editor_menu_callback, MENU_EDITOR_TOOLS }, + { "/" N_("_Edit") "/" N_("Recalculate _Borders"), NULL, + editor_menu_callback, MENU_EDITOR_RECALCULATE_BORDERS }, + { "/" N_("_Edit") "/" N_("Regenerate _Water"), NULL, + editor_menu_callback, MENU_EDITOR_REGENERATE_WATER }, + /* View menu ... */ { "/" N_("_View"), NULL, NULL, 0, "<Branch>" }, @@ -955,18 +966,6 @@ { "/" N_("Reports") "/" N_("S_paceship"), "F12", reports_menu_callback, MENU_REPORT_SPACESHIP }, - /* Editor menu */ - { "/" N_("_Editor"), NULL, NULL, 0, "<Branch>" }, - { "/" N_("_Editor") "/tearoff1", NULL, NULL, 0, "<Tearoff>" }, - { "/" N_("_Editor") "/" N_("_Editing Mode"), NULL, - editor_menu_callback, MENU_EDITOR_TOGGLE, "<CheckItem>" }, - { "/" N_("_Editor") "/" N_("_Tools"), NULL, - editor_menu_callback, MENU_EDITOR_TOOLS }, - { "/" N_("_Editor") "/" N_("Recalculate _Borders"), NULL, - editor_menu_callback, MENU_EDITOR_RECALCULATE_BORDERS }, - { "/" N_("_Editor") "/" N_("Regenerate _Water"), NULL, - editor_menu_callback, MENU_EDITOR_REGENERATE_WATER }, - /* Help menu ... */ { "/" N_("_Help"), NULL, NULL, 0, "<Branch>" }, @@ -1268,14 +1267,13 @@ menus_set_sensitive("<main>/_Game/L_eave", aconnection.established); if (!can_client_change_view()) { - menus_set_sensitive("<main>/_Reports", FALSE); - menus_set_sensitive("<main>/_Government", FALSE); + menus_set_sensitive("<main>/_Edit", FALSE); menus_set_sensitive("<main>/_View", FALSE); menus_set_sensitive("<main>/_Orders", FALSE); - menus_set_sensitive("<main>/_Editor", FALSE); + menus_set_sensitive("<main>/_Reports", FALSE); } else { const char *path = - menu_path_remove_uline("<main>/_Government/_Change Government"); + menu_path_remove_uline("<main>/_Edit/_Government"); GtkWidget *parent = gtk_item_factory_get_widget(item_factory, path); bool attached_to_player = (game.player_ptr != NULL); @@ -1320,18 +1318,31 @@ } menus_set_sensitive("<main>/_Reports", TRUE); - menus_set_sensitive("<main>/_Government", TRUE); + menus_set_sensitive("<main>/_Edit", TRUE); menus_set_sensitive("<main>/_View", TRUE); menus_set_sensitive("<main>/_Orders", can_client_issue_orders()); - menus_set_sensitive("<main>/_Government/_Tax Rates", + menus_set_sensitive("<main>/_Edit/Tax Rates", game.info.changable_tax && can_client_issue_orders()); - menus_set_sensitive("<main>/_Government/_Worklists", + menus_set_sensitive("<main>/_Edit/Worklists", can_client_issue_orders()); - menus_set_sensitive("<main>/_Government/_Change Government", + menus_set_sensitive("<main>/_Edit/_Government", can_client_issue_orders()); + menu_updating = TRUE; + + menus_set_active("<main>/_Edit/Editing _Mode", + can_conn_enable_editing(&aconnection)); + menus_set_sensitive("<main>/_Edit/Editing _Tools", + can_conn_edit(&aconnection)); + menus_set_sensitive("<main>/_Edit/Recalculate _Borders", + can_conn_edit(&aconnection)); + menus_set_sensitive("<main>/_Edit/Regenerate _Water", + can_conn_edit(&aconnection)); + + menu_updating = FALSE; + /* If the client is not attached to a player these reports are * disabled. */ menus_set_sensitive("<main>/_Reports/_Cities", attached_to_player); @@ -1368,19 +1379,6 @@ menus_set_active("<main>/_View/_Full Screen", fullscreen_mode); - menu_updating = TRUE; - - menus_set_sensitive("<main>/_Editor", - can_conn_enable_editing(&aconnection)); - menus_set_sensitive("<main>/_Editor/_Tools", - can_conn_edit(&aconnection)); - menus_set_sensitive("<main>/_Editor/_Recalculate Borders", - can_conn_edit(&aconnection)); - menus_set_active("<main>/_Editor/Editing Mode", - can_conn_edit(&aconnection)); - - menu_updating = FALSE; - /* Remaining part of this function: Update Orders menu */ if (!can_client_issue_orders()) { Index: client/gui-win32/menu.c =================================================================== --- client/gui-win32/menu.c (revision 14078) +++ client/gui-win32/menu.c (working copy) @@ -318,13 +318,13 @@ {NULL, 0}, - {N_("Gov_ernment"), IDM_SUBMENU}, + {N_("_Edit"), IDM_SUBMENU}, {N_("Tax Rates") "\tShift+T", IDM_GOVERNMENT_TAX_RATE}, { "", IDM_SEPARATOR}, - {N_("_Find City") "\tCtl+F", IDM_GOVERNMENT_FIND_CITY}, - {N_("Work_lists") "\tCtl+W", IDM_GOVERNMENT_WORKLISTS}, + {N_("Find City") "\tCtl+F", IDM_GOVERNMENT_FIND_CITY}, + {N_("Worklists") "\tCtl+W", IDM_GOVERNMENT_WORKLISTS}, { "", IDM_SEPARATOR}, - {N_("_Change Government"), IDM_SUBMENU}, + {N_("_Government"), IDM_SUBMENU}, {N_("_Revolution"), IDM_GOVERNMENT_REVOLUTION}, {"", IDM_SEPARATOR}, {NULL, 0},
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev