73#define GTK_STOCK_EDIT NULL
81 gboolean is_sensitive);
85 gboolean is_sensitive);
94 gboolean is_sensitive);
270 {
"MENU_IMPROVEMENTS",
N_(
"_Improvements"), 0, 0,
272 {
"MENU_CIVILIZATION",
N_(
"C_ivilization"), 0, 0,
274 {
"MENU_BATTLE_GROUPS",
N_(
"_Battle Groups"), 0, 0,
277 {
"CLEAR_CHAT_LOGS",
N_(
"_Clear Chat Log"), 0, 0,
279 {
"SAVE_CHAT_LOGS",
N_(
"Save Chat _Log"), 0, 0,
281 {
"LOCAL_OPTIONS",
N_(
"_Local Client"), 0, 0,
283 {
"MESSAGE_OPTIONS",
N_(
"_Message"), 0, 0,
285 {
"SERVER_OPTIONS",
N_(
"_Remote Server"), 0, 0,
287 {
"SAVE_OPTIONS",
N_(
"Save Options _Now"), 0, 0,
289 {
"RELOAD_TILESET",
N_(
"_Reload Tileset"),
290 GDK_KEY_r, GDK_MOD1_MASK | GDK_CONTROL_MASK,
292 {
"GAME_SAVE",
N_(
"_Save Game"), GDK_KEY_s, GDK_CONTROL_MASK,
294 {
"GAME_SAVE_AS",
N_(
"Save Game _As..."), 0, 0,
296 {
"MAPIMG_SAVE",
N_(
"Save Map _Image"), 0, 0,
298 {
"MAPIMG_SAVE_AS",
N_(
"Save _Map Image As..."), 0, 0,
301 {
"QUIT",
N_(
"_Quit"), GDK_KEY_q, GDK_CONTROL_MASK,
303 {
"FIND_CITY",
N_(
"_Find City"), GDK_KEY_f, GDK_CONTROL_MASK,
305 {
"WORKLISTS",
N_(
"Work_lists"),
306 GDK_KEY_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
308 {
"CLIENT_LUA_SCRIPT",
N_(
"Client _Lua Script"), 0, 0,
310 {
"MAP_VIEW",
N_(
"?noun:_View"), GDK_KEY_F1, 0,
312 {
"REPORT_UNITS",
N_(
"_Units"), GDK_KEY_F2, 0,
314 {
"REPORT_NATIONS",
N_(
"_Nations"), GDK_KEY_F3, 0,
316 {
"REPORT_CITIES",
N_(
"_Cities"), GDK_KEY_F4, 0,
318 {
"REPORT_WOW",
N_(
"_Wonders of the World"), GDK_KEY_F7, 0,
320 {
"REPORT_TOP_CITIES",
N_(
"Top _Five Cities"), GDK_KEY_F8, 0,
322 {
"REPORT_MESSAGES",
N_(
"_Messages"), GDK_KEY_F9, 0,
324 {
"REPORT_DEMOGRAPHIC",
N_(
"_Demographics"), GDK_KEY_F11, 0,
329 {
"BATTLE_GROUP_SELECT_0",
N_(
"Select Battle Group 1"),
330 GDK_KEY_F1, GDK_SHIFT_MASK,
332 {
"BATTLE_GROUP_ASSIGN_0",
N_(
"Assign Battle Group 1"),
333 GDK_KEY_F1, GDK_CONTROL_MASK,
335 {
"BATTLE_GROUP_APPEND_0",
N_(
"Append to Battle Group 1"),
336 GDK_KEY_F1, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
338 {
"BATTLE_GROUP_SELECT_1",
N_(
"Select Battle Group 2"),
339 GDK_KEY_F2, GDK_SHIFT_MASK,
341 {
"BATTLE_GROUP_ASSIGN_1",
N_(
"Assign Battle Group 2"),
342 GDK_KEY_F2, GDK_CONTROL_MASK,
344 {
"BATTLE_GROUP_APPEND_1",
N_(
"Append to Battle Group 2"),
345 GDK_KEY_F2, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
347 {
"BATTLE_GROUP_SELECT_2",
N_(
"Select Battle Group 3"),
348 GDK_KEY_F3, GDK_SHIFT_MASK,
350 {
"BATTLE_GROUP_ASSIGN_2",
N_(
"Assign Battle Group 3"),
351 GDK_KEY_F3, GDK_CONTROL_MASK,
353 {
"BATTLE_GROUP_APPEND_2",
N_(
"Append to Battle Group 3"),
354 GDK_KEY_F3, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
356 {
"BATTLE_GROUP_SELECT_3",
N_(
"Select Battle Group 4"),
357 GDK_KEY_F4, GDK_SHIFT_MASK,
359 {
"BATTLE_GROUP_ASSIGN_3",
N_(
"Assign Battle Group 4"),
360 GDK_KEY_F4, GDK_CONTROL_MASK,
362 {
"BATTLE_GROUP_APPEND_3",
N_(
"Append to Battle Group 4"),
363 GDK_KEY_F4, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
366 {
"HELP_OVERVIEW",
N_(
"?help:Overview"), 0, 0,
368 {
"HELP_PLAYING",
N_(
"Strategy and Tactics"), 0, 0,
370 {
"HELP_POLICIES",
N_(
"Policies"), 0, 0,
372 {
"HELP_TERRAIN",
N_(
"Terrain"), 0, 0,
374 {
"HELP_ECONOMY",
N_(
"Economy"), 0, 0,
376 {
"HELP_CITIES",
N_(
"Cities"), 0, 0,
378 {
"HELP_IMPROVEMENTS",
N_(
"City Improvements"), 0, 0,
380 {
"HELP_WONDERS",
N_(
"Wonders of the World"), 0, 0,
382 {
"HELP_UNITS",
N_(
"Units"), 0, 0,
384 {
"HELP_COMBAT",
N_(
"Combat"), 0, 0,
386 {
"HELP_ZOC",
N_(
"Zones of Control"), 0, 0,
388 {
"HELP_GOVERNMENT",
N_(
"Government"), 0, 0,
390 {
"HELP_DIPLOMACY",
N_(
"Diplomacy"), 0, 0,
392 {
"HELP_TECH",
N_(
"Technology"), 0, 0,
394 {
"HELP_SPACE_RACE",
N_(
"Space Race"), 0, 0,
396 {
"HELP_RULESET",
N_(
"About Current Ruleset"), 0, 0,
398 {
"HELP_TILESET",
N_(
"About Current Tileset"), 0, 0,
400 {
"HELP_NATIONS",
N_(
"About Nations"), 0, 0,
402 {
"HELP_CONNECTING",
N_(
"Connecting"), 0, 0,
404 {
"HELP_CONTROLS",
N_(
"Controls"), 0, 0,
406 {
"HELP_CMA",
N_(
"Citizen Governor"), 0, 0,
408 {
"HELP_CHATLINE",
N_(
"Chatline"), 0, 0,
410 {
"HELP_WORKLIST_EDITOR",
N_(
"Worklist Editor"), 0, 0,
412 {
"HELP_LANGUAGES",
N_(
"Languages"), 0, 0,
414 {
"HELP_COPYING",
N_(
"Copying"), 0, 0,
416 {
"HELP_ABOUT",
N_(
"About Freeciv"), 0, 0,
418 {
"SAVE_OPTIONS_ON_EXIT",
N_(
"Save Options on _Exit"), 0, 0,
420 {
"EDIT_MODE",
N_(
"_Editing Mode"), GDK_KEY_e, GDK_CONTROL_MASK,
422 {
"SHOW_CITY_OUTLINES",
N_(
"Cit_y Outlines"), GDK_KEY_y, GDK_CONTROL_MASK,
424 {
"SHOW_CITY_OUTPUT",
N_(
"City Output"), GDK_KEY_v, GDK_CONTROL_MASK,
426 {
"SHOW_MAP_GRID",
N_(
"Map _Grid"), GDK_KEY_g, GDK_CONTROL_MASK,
428 {
"SHOW_NATIONAL_BORDERS",
N_(
"National _Borders"), GDK_KEY_b, GDK_CONTROL_MASK,
430 {
"SHOW_NATIVE_TILES",
N_(
"Native Tiles"), GDK_KEY_n, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
432 {
"SHOW_CITY_FULL_BAR",
N_(
"City Full Bar"), 0, 0,
434 {
"SHOW_CITY_NAMES",
N_(
"City _Names"), GDK_KEY_n, GDK_CONTROL_MASK,
436 {
"SHOW_CITY_GROWTH",
N_(
"City G_rowth"), GDK_KEY_o, GDK_CONTROL_MASK,
438 {
"SHOW_CITY_PRODUCTIONS",
N_(
"City _Production"), GDK_KEY_p, GDK_CONTROL_MASK,
440 {
"SHOW_CITY_BUY_COST",
N_(
"City Buy Cost"), 0, 0,
442 {
"SHOW_CITY_TRADE_ROUTES",
N_(
"City Tra_deroutes"), GDK_KEY_d, GDK_CONTROL_MASK,
444 {
"SHOW_TERRAIN",
N_(
"_Terrain"), 0, 0,
446 {
"SHOW_COASTLINE",
N_(
"C_oastline"), 0, 0,
448 {
"SHOW_PATHS",
N_(
"_Paths"), 0, 0,
450 {
"SHOW_IRRIGATION",
N_(
"_Irrigation"), 0, 0,
452 {
"SHOW_MINES",
N_(
"_Mines"), 0, 0,
454 {
"SHOW_BASES",
N_(
"_Bases"), 0, 0,
456 {
"SHOW_RESOURCES",
N_(
"_Resources"), 0, 0,
458 {
"SHOW_HUTS",
N_(
"_Huts"), 0, 0,
460 {
"SHOW_POLLUTION",
N_(
"Po_llution & Fallout"), 0, 0,
462 {
"SHOW_CITIES",
N_(
"Citi_es"), 0, 0,
464 {
"SHOW_UNITS",
N_(
"_Units"), 0, 0,
466 {
"SHOW_UNIT_SOLID_BG",
N_(
"Unit Solid Background"), 0, 0,
468 {
"SHOW_UNIT_SHIELDS",
N_(
"Unit shields"), 0, 0,
470 {
"SHOW_STACK_SIZE",
N_(
"Unit Stack Size"),
471 GDK_KEY_plus, GDK_CONTROL_MASK,
473 {
"SHOW_FOCUS_UNIT",
N_(
"Focu_s Unit"), 0, 0,
475 {
"SHOW_FOG_OF_WAR",
N_(
"Fog of _War"), 0, 0,
477 {
"FULL_SCREEN",
N_(
"_Fullscreen"), GDK_KEY_Return, GDK_MOD1_MASK,
480 {
"RECALC_BORDERS",
N_(
"Recalculate _Borders"), 0, 0,
482 {
"TOGGLE_FOG",
N_(
"Toggle Fog of _War"), GDK_KEY_w,
483 GDK_CONTROL_MASK | GDK_SHIFT_MASK,
485 {
"SCENARIO_PROPERTIES",
N_(
"Game/Scenario Properties"), 0, 0,
487 {
"SAVE_SCENARIO",
N_(
"Save Scenario"), 0, 0,
490 {
"CENTER_VIEW",
N_(
"_Center View"), GDK_KEY_c, 0,
492 {
"REPORT_ECONOMY",
N_(
"_Economy"), GDK_KEY_F5, 0,
494 {
"REPORT_RESEARCH",
N_(
"_Research"), GDK_KEY_F6, 0,
496 {
"POLICIES",
N_(
"_Policies..."),
497 GDK_KEY_p, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
499 {
"REPORT_SPACESHIP",
N_(
"_Spaceship"), GDK_KEY_F12, 0,
501 {
"REPORT_ACHIEVEMENTS",
N_(
"_Achievements"), GDK_KEY_asterisk, 0,
508 {
"MENU_BUILD_BASE",
N_(
"Build _Base"), 0, 0, NULL,
MGROUP_UNIT },
509 {
"MENU_BUILD_PATH",
N_(
"Build _Path"), 0, 0, NULL,
MGROUP_UNIT },
510 {
"SELECT_SINGLE",
N_(
"_Single Unit (Unselect Others)"), GDK_KEY_z, 0,
512 {
"SELECT_ALL_ON_TILE",
N_(
"_All On Tile"), GDK_KEY_v, 0,
514 {
"SELECT_SAME_TYPE_TILE",
N_(
"Same Type on _Tile"),
515 GDK_KEY_v, GDK_SHIFT_MASK,
517 {
"SELECT_SAME_TYPE_CONT",
N_(
"Same Type on _Continent"),
518 GDK_KEY_c, GDK_SHIFT_MASK,
520 {
"SELECT_SAME_TYPE",
N_(
"Same Type _Everywhere"), GDK_KEY_x, GDK_SHIFT_MASK,
522 {
"SELECT_DLG",
N_(
"Unit Selection Dialog"), 0, 0,
524 {
"UNIT_WAIT",
N_(
"_Wait"), GDK_KEY_w, 0,
526 {
"UNIT_DONE",
N_(
"_Done"), GDK_KEY_space, 0,
528 {
"UNIT_GOTO",
N_(
"_Go to"), GDK_KEY_g, 0,
530 {
"MENU_GOTO_AND",
N_(
"Go to a_nd..."), 0, 0, NULL,
MGROUP_UNIT },
531 {
"UNIT_GOTO_CITY",
N_(
"Go _to/Airlift to City..."), GDK_KEY_t, 0,
533 {
"UNIT_RETURN",
N_(
"_Return to Nearest City"), GDK_KEY_g, GDK_SHIFT_MASK,
535 {
"UNIT_EXPLORE",
N_(
"Auto E_xplore"), GDK_KEY_x, 0,
537 {
"UNIT_PATROL",
N_(
"_Patrol"), GDK_KEY_q, 0,
539 {
"UNIT_SENTRY",
N_(
"_Sentry"), GDK_KEY_s, 0,
541 {
"UNIT_UNSENTRY",
N_(
"Uns_entry All On Tile"), GDK_KEY_s, GDK_SHIFT_MASK,
543 {
"UNIT_BOARD",
N_(
"_Load"), GDK_KEY_l, 0,
545 {
"UNIT_DEBOARD",
N_(
"_Unload"), GDK_KEY_u, 0,
547 {
"UNIT_UNLOAD_TRANSPORTER",
N_(
"U_nload All From Transporter"),
548 GDK_KEY_t, GDK_SHIFT_MASK,
550 {
"UNIT_HOMECITY",
N_(
"Set _Home City"), GDK_KEY_h, 0,
552 {
"UNIT_UPGRADE",
N_(
"Upgr_ade"), GDK_KEY_u, GDK_SHIFT_MASK,
554 {
"UNIT_CONVERT",
N_(
"C_onvert"), GDK_KEY_o, GDK_SHIFT_MASK,
556 {
"UNIT_DISBAND",
N_(
"_Disband"), GDK_KEY_d, GDK_SHIFT_MASK,
558 {
"BUILD_CITY",
N_(
"_Build City"), GDK_KEY_b, 0,
560 {
"AUTO_SETTLER",
N_(
"_Auto Settler"), GDK_KEY_a, 0,
562 {
"BUILD_ROAD",
N_(
"Build _Road"), GDK_KEY_r, 0,
564 {
"BUILD_IRRIGATION",
N_(
"Build _Irrigation"), GDK_KEY_i, 0,
566 {
"CULTIVATE",
N_(
"Cultivate"), GDK_KEY_i, GDK_SHIFT_MASK,
568 {
"BUILD_MINE",
N_(
"Build _Mine"), GDK_KEY_m, 0,
570 {
"PLANT",
N_(
"Plant"), GDK_KEY_m, GDK_SHIFT_MASK,
572 {
"CONNECT_ROAD",
N_(
"Connect With Roa_d"), GDK_KEY_r, GDK_CONTROL_MASK,
574 {
"CONNECT_RAIL",
N_(
"Connect With Rai_l"), GDK_KEY_l, GDK_CONTROL_MASK,
576 {
"CONNECT_MAGLEV",
N_(
"Connect With _Maglev"), GDK_KEY_m, GDK_CONTROL_MASK,
578 {
"CONNECT_IRRIGATION",
N_(
"Connect With Irri_gation"),
579 GDK_KEY_i, GDK_CONTROL_MASK,
581 {
"TRANSFORM_TERRAIN",
N_(
"Transf_orm Terrain"), GDK_KEY_o, 0,
583 {
"CLEAN_POLLUTION",
N_(
"Clean _Pollution"), GDK_KEY_p, 0,
585 {
"CLEAN_FALLOUT",
N_(
"Clean _Nuclear Fallout"), GDK_KEY_n, 0,
587 {
"FORTIFY",
N_(
"Fortify"), GDK_KEY_f, 0,
589 {
"BUILD_FORTRESS",
N_(
"Build Fortress"), GDK_KEY_f, GDK_SHIFT_MASK,
591 {
"BUILD_AIRBASE",
N_(
"Build Airbase"), GDK_KEY_e, GDK_SHIFT_MASK,
593 {
"DO_PARADROP",
N_(
"P_aradrop"), GDK_KEY_j, 0,
595 {
"DO_PILLAGE",
N_(
"_Pillage"), GDK_KEY_p, GDK_SHIFT_MASK,
597 {
"DIPLOMAT_ACTION",
N_(
"_Do..."), GDK_KEY_d, 0,
600 {
"MENU_GOVERNMENT",
N_(
"_Government"), 0, 0,
602 {
"TAX_RATE",
N_(
"_Tax Rates..."), GDK_KEY_t, GDK_CONTROL_MASK,
604 {
"START_REVOLUTION",
N_(
"_Revolution..."),
605 GDK_KEY_g, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
706 gtk_widget_destroy(dialog);
707 if (response == GTK_RESPONSE_OK) {
723 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_WARNING,
724 GTK_BUTTONS_OK_CANCEL,
725 _(
"Leaving a local game will end it!"));
727 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
728 g_signal_connect(dialog,
"response",
730 gtk_window_present(GTK_WINDOW(dialog));
1566 struct action *paction = g_object_get_data(G_OBJECT(
item),
"end_action");
1573 struct impr_type *pbuilding = g_object_get_data(G_OBJECT(
item),
1581 struct advance *ptech = g_object_get_data(G_OBJECT(
item),
1588 case ASTK_EXTRA_NOT_THERE:
1734 ACTION_HELP_WONDER)) {
1760 bool building_road =
FALSE;
1765 building_road =
TRUE;
1813 if (proad != NULL) {
1829 if (prail != NULL) {
1845 if (pmaglev != NULL) {
1861 if (extra_type_list_size(
extras) > 0) {
1889 if (pextra != NULL) {
2057 const char *key = gtk_buildable_get_name(
item);
2061 gtk_menu_item_set_label(GTK_MENU_ITEM(
item),
2063 gtk_menu_item_set_use_underline(GTK_MENU_ITEM(
item),
TRUE);
2064 if (info->
cb != NULL) {
2065 g_signal_connect(
item,
"activate", info->
cb, NULL);
2068 if (info->
accel != 0) {
2069 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(
item));
2075 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(
item), buf);
2080 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(
item)),
2089 gtk_menu_item_set_label(GTK_MENU_ITEM(
item),
key);
2097 static char filename[256];
2100 if ((
name = getenv(
"FREECIV_MENUS"))
2104 log_error(
"Gtk menus: file definition not found");
2117 GtkWidget *menubar = NULL;
2118 GError *error = NULL;
2122 log_error(
"Gtk menus: %s", error->message);
2123 g_error_free(error);
2131 while (next != NULL) {
2132 GObject *obj = next->data;
2134 if (GTK_IS_MENU_ITEM(obj)) {
2135 if (!GTK_IS_SEPARATOR_MENU_ITEM(obj)) {
2138 }
else if (GTK_IS_MENU(obj)) {
2139 const char *
key = gtk_buildable_get_name(GTK_BUILDABLE(obj));
2141 if (
key[0] ==
'<') {
2142 GtkAccelGroup *ac_group = gtk_menu_get_accel_group(GTK_MENU(obj));
2144 if (ac_group == NULL) {
2145 ac_group = gtk_accel_group_new();
2146 gtk_menu_set_accel_group(GTK_MENU(obj), ac_group);
2149 gtk_window_add_accel_group(GTK_WINDOW(window), ac_group);
2151 gtk_menu_set_accel_path(GTK_MENU(obj),
key);
2160 menubar = GTK_WIDGET(gtk_builder_get_object(
ui_builder,
"MENU"));
2161 gtk_widget_set_visible(menubar,
TRUE);
2162 gtk_widget_show_all(menubar);
2165#ifndef FREECIV_DEBUG
2194 GtkCheckMenuItem *
item = GTK_CHECK_MENU_ITEM(gtk_builder_get_object(
ui_builder,
key));
2197 gtk_check_menu_item_set_active(
item, is_active);
2205 gboolean is_sensitive)
2210 gtk_widget_set_sensitive(
item, is_sensitive);
2218 gboolean is_sensitive)
2232#ifndef FREECIV_DEBUG
2234 gboolean is_visible,
2235 gboolean is_sensitive)
2240 gtk_widget_set_visible(
item, is_visible);
2241 gtk_widget_set_sensitive(
item, is_sensitive);
2250 const gchar *new_label)
2255 gtk_menu_item_set_label(GTK_MENU_ITEM(
item), new_label);
2303 enum unit_activity activity)
2319 struct unit_list *punits = NULL;
2320 bool units_all_same_tile =
TRUE, units_all_same_type =
TRUE;
2322 char acttext[128], irrtext[128], mintext[128], transtext[128];
2323 char cultext[128], plantext[128];
2327 struct extra_type_list *
extras;
2334 const struct tile *ptile = NULL;
2338 fc_assert((ptile==NULL) == (ptype==NULL));
2339 if (ptile || ptype) {
2341 units_all_same_tile =
FALSE;
2344 units_all_same_type =
FALSE;
2368 if (proad != NULL) {
2370 snprintf(road_buf,
sizeof(road_buf),
_(
"Connect With %s"),
2376 if (proad != NULL) {
2377 snprintf(road_buf,
sizeof(road_buf),
_(
"Connect With %s"),
2383 if (proad != NULL) {
2384 snprintf(road_buf,
sizeof(road_buf),
_(
"Connect With %s"),
2398 if ((menu =
find_menu(
"<MENU>/GOVERNMENT"))) {
2402 list = gtk_container_get_children(GTK_CONTAINER(menu));
2403 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2404 pgov = g_object_get_data(G_OBJECT(iter->data),
"government");
2406 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2411 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2425 if ((menu =
find_menu(
"<MENU>/BUILD_BASE"))) {
2429 list = gtk_container_get_children(GTK_CONTAINER(menu));
2430 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2431 pextra = g_object_get_data(G_OBJECT(iter->data),
"base");
2432 if (NULL != pextra) {
2433 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2443 if ((menu =
find_menu(
"<MENU>/BUILD_PATH"))) {
2447 list = gtk_container_get_children(GTK_CONTAINER(menu));
2448 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2449 pextra = g_object_get_data(G_OBJECT(iter->data),
"road");
2450 if (NULL != pextra) {
2451 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
2461 if ((menu =
find_menu(
"<MENU>/GOTO_AND"))) {
2465 bool can_do_something =
FALSE;
2471 list = gtk_container_get_children(GTK_CONTAINER(menu));
2472 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2473 paction = g_object_get_data(G_OBJECT(iter->data),
"end_action");
2474 if (NULL != paction) {
2477 gtk_widget_set_visible(GTK_WIDGET(iter->data),
TRUE);
2478 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
TRUE);
2479 can_do_something =
TRUE;
2481 gtk_widget_set_visible(GTK_WIDGET(iter->data),
FALSE);
2482 gtk_widget_set_sensitive(GTK_WIDGET(iter->data),
FALSE);
2515 ACTIVITY_FORTIFYING));
2555 if (proad != NULL) {
2562 conn_possible =
FALSE;
2567 if (proad != NULL) {
2574 conn_possible =
FALSE;
2579 if (proad != NULL) {
2586 conn_possible =
FALSE;
2592 if (extra_type_list_size(
extras) > 0) {
2595 tgt = extra_type_list_get(
extras, 0);
2598 conn_possible =
FALSE;
2609 bool city_on_tile =
FALSE;
2615 city_on_tile =
TRUE;
2635 char road_item[500];
2643 if (pextra != NULL) {
2648 if (pextra != NULL) {
2650 snprintf(road_item,
sizeof(road_item),
_(
"Build %s"),
2658 if (units_all_same_type) {
2659 struct unit *
punit = unit_list_get(punits, 0);
2664 fc_snprintf(acttext,
sizeof(acttext),
_(
"Upgr_ade to %s"),
2674 if (
'\0' != acttext[0]) {
2682 if (units_all_same_type) {
2683 struct unit *
punit = unit_list_get(punits, 0);
2686 fc_snprintf(acttext,
sizeof(acttext),
_(
"C_onvert to %s"),
2695 if (
'\0' != acttext[0]) {
2701 if (units_all_same_tile) {
2702 struct unit *first = unit_list_get(punits, 0);
2714 if (pextra != NULL) {
2719 if (pextra != NULL) {
2721 snprintf(irrtext,
sizeof(irrtext),
_(
"Build %s"),
2731 fc_snprintf(cultext,
sizeof(cultext),
_(
"Change to %s"),
2733 ACTIVITY_CULTIVATE));
2746 if (pextra != NULL) {
2751 if (pextra != NULL) {
2753 snprintf(mintext,
sizeof(mintext),
_(
"Build %s"),
2763 fc_snprintf(plantext,
sizeof(plantext),
_(
"Change to %s"),
2771 fc_snprintf(transtext,
sizeof(transtext),
_(
"Transf_orm to %s"),
2773 ACTIVITY_TRANSFORM));
2798 const guint accel_key,
2799 const GdkModifierType accel_mods)
2801 const char *path = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(
item));
2806 fc_snprintf(buf,
sizeof(buf),
"<MENU>/GOTO_AND/%s",
2808 gtk_menu_item_set_accel_path(GTK_MENU_ITEM(
item), buf);
2813 gtk_accel_map_add_entry(gtk_menu_item_get_accel_path(GTK_MENU_ITEM(
item)),
2814 accel_key, accel_mods);
2824 GtkWidget *sub_menu;
2826 list = gtk_container_get_children(GTK_CONTAINER(menu));
2827 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2828 if ((sub_menu = gtk_menu_item_get_submenu(iter->data)) != NULL) {
2830 gtk_widget_destroy(sub_menu);
2832 gtk_widget_destroy(GTK_WIDGET(iter->data));
2872 if ((menu =
find_menu(
"<MENU>/GOVERNMENT"))) {
2878 list = gtk_container_get_children(GTK_CONTAINER(menu));
2879 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2880 if (g_object_get_data(G_OBJECT(iter->data),
"government") != NULL
2881 || GTK_IS_SEPARATOR_MENU_ITEM(iter->data)) {
2882 gtk_widget_destroy(GTK_WIDGET(iter->data));
2888 item = gtk_separator_menu_item_new();
2889 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
2890 gtk_widget_show(
item);
2899 item = gtk_image_menu_item_new_with_label(buf);
2900 g_object_set_data(G_OBJECT(
item),
"government", g);
2906 image = gtk_image_new_from_pixbuf(pb);
2908 gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(
item), image);
2909 gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(
item),
TRUE);
2910 gtk_widget_show(image);
2913 g_signal_connect(
item,
"activate",
2915 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
2916 gtk_widget_show(
item);
2921 if ((menu =
find_menu(
"<MENU>/BUILD_BASE"))) {
2926 list = gtk_container_get_children(GTK_CONTAINER(menu));
2927 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2928 gtk_widget_destroy(GTK_WIDGET(iter->data));
2934 if (pextra->buildable) {
2936 g_object_set_data(G_OBJECT(
item),
"base", pextra);
2938 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
2939 gtk_widget_show(
item);
2944 if ((menu =
find_menu(
"<MENU>/BUILD_PATH"))) {
2949 list = gtk_container_get_children(GTK_CONTAINER(menu));
2950 for (iter =
list; NULL != iter; iter = g_list_next(iter)) {
2951 gtk_widget_destroy(GTK_WIDGET(iter->data));
2957 if (pextra->buildable) {
2959 g_object_set_data(G_OBJECT(
item),
"road", pextra);
2961 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
2962 gtk_widget_show(
item);
2968 if ((menu =
find_menu(
"<MENU>/GOTO_AND"))) {
2976 for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) {
2992 item = gtk_menu_item_new_with_mnemonic(
2994 g_object_set_data(G_OBJECT(
item),
"end_action", paction);
2997 GtkWidget *sub_target_menu = gtk_menu_new();
2999#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
3000 GtkWidget *sub_item = gtk_menu_item_new_with_label(_sub_target_name_); \
3001 g_object_set_data(G_OBJECT(sub_item), "end_action", paction); \
3002 g_object_set_data(G_OBJECT(sub_item), _sub_target_key_, _sub_target_); \
3003 g_signal_connect(sub_item, "activate", \
3004 G_CALLBACK(unit_goto_and_callback), paction); \
3005 gtk_menu_shell_append(GTK_MENU_SHELL(sub_target_menu), sub_item); \
3006 gtk_widget_show(sub_item);
3022 case ASTK_EXTRA_NOT_THERE:
3043#undef CREATE_SUB_ITEM
3045 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), sub_target_menu);
3047 g_signal_connect(
item,
"activate",
3050#define ADD_OLD_ACCELERATOR(wanted_action_id, accel_key, accel_mods) \
3051 if (act_id == wanted_action_id) { \
3052 menu_unit_goto_and_add_accel(item, act_id, accel_key, accel_mods); \
3063 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
3064 gtk_widget_show(
item);
bool action_removes_extra(const struct action *paction, const struct extra_type *pextra)
const char * action_id_rule_name(action_id act_id)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
bool action_creates_extra(const struct action *paction, const struct extra_type *pextra)
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
static struct action * action_by_number(action_id act_id)
#define action_iterate_end
#define action_id_get_actor_kind(act_id)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_id_has_complex_target(act_id)
struct @124::my_agent entries[MAX_AGENTS]
enum client_states client_state(void)
void send_report_request(enum report_type type)
bool can_client_issue_orders(void)
bool client_has_player(void)
bool can_client_change_view(void)
bool can_units_do_connect(struct unit_list *punits, enum unit_activity activity, struct extra_type *tgt)
static struct fc_sockaddr_list * list
void disconnect_from_server(void)
void send_save_game(const char *filename)
bool is_server_running(void)
bool can_client_access_hack(void)
bool can_conn_enable_editing(const struct connection *pconn)
void key_coastline_toggle(void)
void key_irrigation_toggle(void)
void key_unit_sentry(void)
void key_city_output_toggle(void)
void request_unit_return(struct unit *punit)
void request_unit_fortify(struct unit *punit)
void key_editor_recalculate_borders(void)
void key_roads_rails_toggle(void)
void request_unit_caravan_action(struct unit *punit, action_id action)
void key_focus_unit_toggle(void)
void key_unit_auto_explore(void)
void key_unit_auto_settle(void)
void key_unit_connect(enum unit_activity activity, struct extra_type *tgt)
void key_city_full_bar_toggle(void)
void key_bases_toggle(void)
void key_map_native_toggle(void)
void key_resources_toggle(void)
void request_unit_goto(enum unit_orders last_order, action_id act_id, int sub_tgt_id)
void key_unit_paradrop(void)
struct unit_list * get_units_in_focus(void)
void key_unit_shields_toggle(void)
void key_city_productions_toggle(void)
void key_unit_plant(void)
void key_unit_fortress(void)
void key_unit_pillage(void)
void request_unit_unload(struct unit *pcargo)
void key_editor_toggle_fogofwar(void)
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
void key_unit_irrigate(void)
void request_unit_build_city(struct unit *punit)
void key_unit_unload_all(void)
void key_cities_toggle(void)
void key_city_outlines_toggle(void)
void key_unit_homecity(void)
void key_unit_patrol(void)
void key_unit_solid_bg_toggle(void)
void key_terrain_toggle(void)
void key_unit_wakeup_others(void)
void key_unit_stack_size_toggle(void)
void key_huts_toggle(void)
void key_fog_of_war_toggle(void)
void key_units_toggle(void)
void key_unit_select_battlegroup(int battlegroup, bool append)
void key_map_grid_toggle(void)
void key_pollution_toggle(void)
void key_city_growth_toggle(void)
void key_unit_action_select_tgt(void)
void key_unit_fallout(void)
void key_city_buycost_toggle(void)
int get_num_units_in_focus(void)
void key_unit_transform(void)
void key_city_trade_routes_toggle(void)
void key_city_names_toggle(void)
void request_unit_select(struct unit_list *punits, enum unit_select_type_mode seltype, enum unit_select_location_mode selloc)
void key_unit_airbase(void)
void key_unit_convert(void)
void key_editor_toggle(void)
void key_unit_assign_battlegroup(int battlegroup, bool append)
void key_unit_cultivate(void)
void key_mines_toggle(void)
void key_map_borders_toggle(void)
#define can_unit_do_activity_targeted_client(_punit_, _act_, _tgt_)
#define can_units_do_activity_targeted_client(_punits_, _act_, _tgt_)
#define can_units_do_activity_client(_punits_, _act_)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
bool editor_is_active(void)
const char * government_name_translation(const struct government *pgovern)
bool untargeted_revolution_allowed(void)
bool can_change_to_government(struct player *pplayer, const struct government *gov)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
void log_output_window(void)
void clear_output_window(void)
void city_report_dialog_popup(bool raise)
void unit_select_dialog_popup(struct tile *ptile)
void popup_upgrade_dialog(struct unit_list *punits)
void popup_disband_dialog(struct unit_list *punits)
void editgui_refresh(void)
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
struct property_editor * editprop_get_property_editor(void)
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
void popup_find_dialog(void)
void popup_multiplier_dialog(void)
void popup_rates_dialog(void)
void popup_goto_dialog(void)
void fullscreen_opt_refresh(struct option *poption)
gboolean map_canvas_focus(void)
void popup_quit_dialog(void)
#define GUI_GTK_OPTION(optname)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
void popup_help_dialog_string(const char *item)
void luaconsole_dialog_popup(bool raise)
void center_on_unit(void)
void popup_messageopt_dialog(void)
void meswin_dialog_popup(bool raise)
void option_dialog_popup(const char *name, const struct option_set *poptset)
void save_mapimg_dialog_popup(void)
void mapimg_client_save(const char *filename)
void save_game_dialog_popup(void)
void save_scenario_dialog_popup(void)
void popup_players_dialog(bool raise)
void science_report_dialog_popup(bool raise)
void economy_report_dialog_popup(bool raise)
void units_report_dialog_popup(bool raise)
void science_report_dialog_popdown(void)
void popup_spaceship_dialog(struct player *pplayer)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
bool request_transport(struct unit *cargo, struct tile *ptile)
void popup_worklists_report(void)
void popup_revolution_dialog(void)
#define HELP_TERRAIN_ITEM
#define HELP_LANGUAGES_ITEM
#define HELP_CONNECTING_ITEM
#define HELP_TILESET_ITEM
#define HELP_CHATLINE_ITEM
#define HELP_RULESET_ITEM
#define HELP_GOVERNMENT_ITEM
#define HELP_MULTIPLIER_ITEM
#define HELP_PLAYING_ITEM
#define HELP_IMPROVEMENTS_ITEM
#define HELP_WORKLIST_EDITOR_ITEM
#define HELP_WONDERS_ITEM
#define HELP_SPACE_RACE_ITEM
#define HELP_COPYING_ITEM
#define HELP_OVERVIEW_ITEM
#define HELP_NATIONS_ITEM
#define HELP_DIPLOMACY_ITEM
#define HELP_ECONOMY_ITEM
#define HELP_CONTROLS_ITEM
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define log_error(message,...)
struct terrain_misc terrain_control
Multiplier_type_id multiplier_count(void)
const struct option_set * server_optset
const struct option_set * client_optset
void options_save(option_save_log_callback log_cb)
struct client_options gui_options
@ REPORT_WONDERS_OF_THE_WORLD
struct extra_type * road_extra_get(const struct road_type *proad)
struct road_type * road_by_gui_type(enum road_gui_type gui_type)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
const struct strvec * get_data_dirs(void)
struct packet_game_info info
struct government * government_during_revolution
bool draw_city_productions
bool draw_fortress_airbase
bool draw_unit_stack_size
bool draw_city_trade_routes
bool save_options_on_exit
bool solid_color_behind_units
enum borders_mode borders
struct terrain * cultivate_result
struct terrain * plant_result
struct terrain * transform_result
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
const char * advance_name_translation(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_iterate(_start, _p)
#define advance_iterate_end
void tile_virtual_destroy(struct tile *vtile)
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
struct tile * tile_virtual_new(const struct tile *ptile)
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
struct sprite * get_government_sprite(const struct tileset *t, const struct government *gov)
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
bool unit_can_est_trade_route_here(const struct unit *punit)
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
bool can_unit_do_autosettlers(const struct unit *punit)
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
bool units_are_occupied(const struct unit_list *punits)
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_unload(const struct unit_list *punits)
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
bool units_can_load(const struct unit_list *punits)
bool can_units_do_on_map(const struct civ_map *nmap, const struct unit_list *punits, bool(can_fn)(const struct civ_map *nmap, const struct unit *punit))
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)