From 3145db862d3f0d15737e885432c207b5678c8dc3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 19 Mar 2023 08:09:26 +0200 Subject: [PATCH 17/17] Add tooltip for Turn Done button when fixedlength enabled Affects gtk- and Qt-clients. Requested by Alina Lenk See osdn #45887 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/gui_main.c | 54 ++++++++++++++++++++++------------ client/gui-gtk-3.0/gui_main.h | 8 +++-- client/gui-gtk-3.22/gui_main.c | 41 ++++++++++++++++++-------- client/gui-gtk-3.22/gui_main.h | 6 ++-- client/gui-gtk-3.22/mapctrl.c | 2 ++ client/gui-gtk-4.0/gui_main.c | 41 ++++++++++++++++++-------- client/gui-gtk-4.0/gui_main.h | 6 ++-- client/gui-gtk-4.0/mapctrl.c | 2 ++ client/gui-qt/fc_client.cpp | 1 + client/gui-qt/gui_main.cpp | 2 +- client/gui-qt/mapctrl.cpp | 7 +++-- client/gui-qt/mapview.cpp | 5 ++-- client/gui-qt/sidebar.cpp | 19 ++++++++++++ client/gui-qt/sidebar.h | 3 +- 14 files changed, 138 insertions(+), 59 deletions(-) diff --git a/client/gui-gtk-3.0/gui_main.c b/client/gui-gtk-3.0/gui_main.c index f105155ca5..236c10e6bc 100644 --- a/client/gui-gtk-3.0/gui_main.c +++ b/client/gui-gtk-3.0/gui_main.c @@ -1046,6 +1046,25 @@ static void setup_canvas_color_for_state(GtkStateFlags state) &get_color(tileset, COLOR_OVERVIEW_UNKNOWN)->color); } +/**********************************************************************//** + Update tooltip of the Turn Done button +**************************************************************************/ +void update_turn_done_tooltip(void) +{ + struct option *opt = optset_option_by_name(server_optset, "fixedlength"); + + if (opt != NULL && option_bool_get(opt)) { + gtk_widget_set_tooltip_text(turn_done_button, + _("Fixed length turns")); + } else { + char buf[256]; + + fc_snprintf(buf, sizeof(buf), "%s:\n%s", + _("Turn Done"), _("Shift+Return")); + gtk_widget_set_tooltip_text(turn_done_button, buf); + } +} + /**********************************************************************//** Do the heavy lifting for the widget setup. **************************************************************************/ @@ -1055,7 +1074,6 @@ static void setup_widgets(void) GtkWidget *frame, *table, *table2, *paned, *sw, *text; GtkWidget *button, *view, *vgrid, *right_vbox = NULL; int i; - char buf[256]; struct sprite *spr; GtkWidget *notebook, *statusbar; GtkWidget *dtach_lowbox = NULL; @@ -1064,9 +1082,9 @@ static void setup_widgets(void) notebook = gtk_notebook_new(); - /* stop mouse wheel notebook page switching. */ + /* Stop mouse wheel notebook page switching. */ g_signal_connect(notebook, "scroll_event", - G_CALLBACK(gtk_true), NULL); + G_CALLBACK(gtk_true), NULL); toplevel_tabs = notebook; gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE); @@ -1141,7 +1159,7 @@ static void setup_widgets(void) overview_canvas_store_height = OVERVIEW_CANVAS_STORE_HEIGHT; } - /* this holds the overview canvas, production info, etc. */ + /* This holds the overview canvas, production info, etc. */ vgrid = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid), GTK_ORIENTATION_VERTICAL); @@ -1151,7 +1169,7 @@ static void setup_widgets(void) gtk_grid_attach_next_to(GTK_GRID(hgrid), vgrid, right_vbox, GTK_POS_LEFT, 1, 1); - /* overview canvas */ + /* Overview canvas */ ahbox = detached_widget_new(); gtk_widget_set_hexpand(ahbox, FALSE); gtk_widget_set_vexpand(ahbox, FALSE); @@ -1161,15 +1179,15 @@ static void setup_widgets(void) overview_scrolled_window = gtk_scrolled_window_new(NULL, NULL); gtk_container_set_border_width(GTK_CONTAINER (overview_scrolled_window), 1); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (overview_scrolled_window), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); overview_canvas = gtk_drawing_area_new(); gtk_widget_set_halign(overview_canvas, GTK_ALIGN_CENTER); gtk_widget_set_valign(overview_canvas, GTK_ALIGN_CENTER); gtk_widget_set_size_request(overview_canvas, overview_canvas_store_width, - overview_canvas_store_height); + overview_canvas_store_height); gtk_widget_set_size_request(overview_scrolled_window, overview_canvas_store_width, - overview_canvas_store_height); + overview_canvas_store_height); gtk_widget_set_hexpand(overview_canvas, TRUE); gtk_widget_set_vexpand(overview_canvas, TRUE); @@ -1182,13 +1200,13 @@ static void setup_widgets(void) overview_canvas); g_signal_connect(overview_canvas, "draw", - G_CALLBACK(overview_canvas_draw), NULL); + G_CALLBACK(overview_canvas_draw), NULL); g_signal_connect(overview_canvas, "motion_notify_event", - G_CALLBACK(move_overviewcanvas), NULL); + G_CALLBACK(move_overviewcanvas), NULL); g_signal_connect(overview_canvas, "button_press_event", - G_CALLBACK(butt_down_overviewcanvas), NULL); + G_CALLBACK(butt_down_overviewcanvas), NULL); /* The rest */ @@ -1234,7 +1252,7 @@ static void setup_widgets(void) gtk_grid_set_column_homogeneous(GTK_GRID(table), TRUE); gtk_container_add(GTK_CONTAINER(avbox), table); - /* citizens for taxrates */ + /* Citizens for taxrates */ ebox = gtk_event_box_new(); gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE); gtk_grid_attach(GTK_GRID(table), ebox, 0, 0, 10, 1); @@ -1258,7 +1276,7 @@ static void setup_widgets(void) gtk_container_add(GTK_CONTAINER(ebox), econ_label[i]); } - /* science, environmental, govt, timeout */ + /* Science, environmental, govt, timeout */ spr = client_research_sprite(); if (spr != NULL) { bulb_label = gtk_image_new_from_surface(spr->surface); @@ -1319,7 +1337,7 @@ static void setup_widgets(void) gtk_container_add(GTK_CONTAINER(frame), timeout_label); - /* turn done */ + /* Turn done */ turn_done_button = gtk_button_new_with_label(_("Turn Done")); gtk_grid_attach(GTK_GRID(table), turn_done_button, 0, 2, 10, 1); @@ -1327,9 +1345,7 @@ static void setup_widgets(void) g_signal_connect(turn_done_button, "clicked", G_CALLBACK(end_turn_callback), NULL); - fc_snprintf(buf, sizeof(buf), "%s:\n%s", - _("Turn Done"), _("Shift+Return")); - gtk_widget_set_tooltip_text(turn_done_button, buf); + update_turn_done_tooltip(); /* Selected unit status */ @@ -2031,8 +2047,8 @@ static gboolean show_info_popup(GtkWidget *w, GdkEventButton *ev, gpointer data) **************************************************************************/ static void end_turn_callback(GtkWidget *w, gpointer data) { - gtk_widget_set_sensitive(turn_done_button, FALSE); - user_ended_turn(); + gtk_widget_set_sensitive(turn_done_button, FALSE); + user_ended_turn(); } /**********************************************************************//** diff --git a/client/gui-gtk-3.0/gui_main.h b/client/gui-gtk-3.0/gui_main.h index 9991ac8589..68612b7c62 100644 --- a/client/gui-gtk-3.0/gui_main.h +++ b/client/gui-gtk-3.0/gui_main.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ #define GUI_GTK_OPTION_STR(optname) "gui_gtk3_" #optname #define GUI_GTK_DEFAULT_THEME_NAME FC_GTK3_DEFAULT_THEME_NAME -/* network string charset conversion */ +/* Network string charset conversion */ gchar *ntoh_str(const gchar *netstr); extern PangoFontDescription *city_names_style; @@ -85,4 +85,6 @@ struct video_mode *resolution_request_get(void); bool is_gui_up(void); -#endif /* FC__GUI_MAIN_H */ +void update_turn_done_tooltip(void); + +#endif /* FC__GUI_MAIN_H */ diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index 3609404a0c..4d0f40f94a 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -1067,6 +1067,25 @@ static void setup_canvas_color_for_state(GtkStateFlags state) } #endif +/**********************************************************************//** + Update tooltip of the Turn Done button +**************************************************************************/ +void update_turn_done_tooltip(void) +{ + struct option *opt = optset_option_by_name(server_optset, "fixedlength"); + + if (opt != NULL && option_bool_get(opt)) { + gtk_widget_set_tooltip_text(turn_done_button, + _("Fixed length turns")); + } else { + char buf[256]; + + fc_snprintf(buf, sizeof(buf), "%s:\n%s", + _("Turn Done"), _("Shift+Return")); + gtk_widget_set_tooltip_text(turn_done_button, buf); + } +} + /**********************************************************************//** Do the heavy lifting for the widget setup. **************************************************************************/ @@ -1076,7 +1095,6 @@ static void setup_widgets(void) GtkWidget *frame, *table, *table2, *paned, *sw, *text; GtkWidget *button, *view, *vgrid, *right_vbox = NULL; int i; - char buf[256]; GtkWidget *notebook, *statusbar; GtkWidget *dtach_lowbox = NULL; struct sprite *spr; @@ -1085,9 +1103,9 @@ static void setup_widgets(void) notebook = gtk_notebook_new(); - /* stop mouse wheel notebook page switching. */ + /* Stop mouse wheel notebook page switching. */ g_signal_connect(notebook, "scroll_event", - G_CALLBACK(gtk_true), NULL); + G_CALLBACK(gtk_true), NULL); toplevel_tabs = notebook; gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE); @@ -1172,7 +1190,7 @@ static void setup_widgets(void) gtk_grid_attach_next_to(GTK_GRID(hgrid), vgrid, right_vbox, GTK_POS_LEFT, 1, 1); - /* overview canvas */ + /* Overview canvas */ ahbox = detached_widget_new(); gtk_widget_set_hexpand(ahbox, FALSE); gtk_widget_set_vexpand(ahbox, FALSE); @@ -1255,7 +1273,7 @@ static void setup_widgets(void) gtk_grid_set_column_homogeneous(GTK_GRID(table), TRUE); gtk_container_add(GTK_CONTAINER(avbox), table); - /* citizens for taxrates */ + /* Citizens for taxrates */ ebox = gtk_event_box_new(); gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE); gtk_grid_attach(GTK_GRID(table), ebox, 0, 0, 10, 1); @@ -1279,7 +1297,7 @@ static void setup_widgets(void) gtk_container_add(GTK_CONTAINER(ebox), econ_label[i]); } - /* science, environmental, govt, timeout */ + /* Science, environmental, govt, timeout */ spr = client_research_sprite(); if (spr != NULL) { bulb_label = gtk_image_new_from_surface(spr->surface); @@ -1351,17 +1369,14 @@ static void setup_widgets(void) gtk_container_add(GTK_CONTAINER(frame), timeout_label); - /* turn done */ + /* Turn done */ turn_done_button = gtk_button_new_with_label(_("Turn Done")); gtk_grid_attach(GTK_GRID(table), turn_done_button, 0, 2, 10, 1); g_signal_connect(turn_done_button, "clicked", G_CALLBACK(end_turn_callback), NULL); - - fc_snprintf(buf, sizeof(buf), "%s:\n%s", - _("Turn Done"), _("Shift+Return")); - gtk_widget_set_tooltip_text(turn_done_button, buf); + update_turn_done_tooltip(); /* Selected unit status */ @@ -2191,8 +2206,8 @@ static gboolean show_info_popup(GtkWidget *w, GdkEventButton *ev, gpointer data) **************************************************************************/ static void end_turn_callback(GtkWidget *w, gpointer data) { - gtk_widget_set_sensitive(turn_done_button, FALSE); - user_ended_turn(); + gtk_widget_set_sensitive(turn_done_button, FALSE); + user_ended_turn(); } /**********************************************************************//** diff --git a/client/gui-gtk-3.22/gui_main.h b/client/gui-gtk-3.22/gui_main.h index 9c107186e7..94fe58367c 100644 --- a/client/gui-gtk-3.22/gui_main.h +++ b/client/gui-gtk-3.22/gui_main.h @@ -22,7 +22,7 @@ #define GUI_GTK_OPTION_STR(optname) "gui_gtk3_22_" #optname #define GUI_GTK_DEFAULT_THEME_NAME FC_GTK3_22_DEFAULT_THEME_NAME -/* network string charset conversion */ +/* Network string charset conversion */ gchar *ntoh_str(const gchar *netstr); extern PangoFontDescription *city_names_style; @@ -85,4 +85,6 @@ struct video_mode *resolution_request_get(void); bool is_gui_up(void); -#endif /* FC__GUI_MAIN_H */ +void update_turn_done_tooltip(void); + +#endif /* FC__GUI_MAIN_H */ diff --git a/client/gui-gtk-3.22/mapctrl.c b/client/gui-gtk-3.22/mapctrl.c index 268f39abc4..d1a0b70339 100644 --- a/client/gui-gtk-3.22/mapctrl.c +++ b/client/gui-gtk-3.22/mapctrl.c @@ -209,6 +209,8 @@ void popup_newcity_dialog(struct unit *punit, const char *suggestname) void set_turn_done_button_state(bool state) { gtk_widget_set_sensitive(turn_done_button, state); + + update_turn_done_tooltip(); } /**********************************************************************//** diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index 9718303dc4..3154210bb4 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -986,6 +986,25 @@ bool terminate_signal_processing(void) return TRUE; } +/**********************************************************************//** + Update tooltip of the Turn Done button +**************************************************************************/ +void update_turn_done_tooltip(void) +{ + struct option *opt = optset_option_by_name(server_optset, "fixedlength"); + + if (opt != NULL && option_bool_get(opt)) { + gtk_widget_set_tooltip_text(turn_done_button, + _("Fixed length turns")); + } else { + char buf[256]; + + fc_snprintf(buf, sizeof(buf), "%s:\n%s", + _("Turn Done"), _("Shift+Return")); + gtk_widget_set_tooltip_text(turn_done_button, buf); + } +} + /**********************************************************************//** Do the heavy lifting for the widget setup. **************************************************************************/ @@ -995,7 +1014,6 @@ static void setup_widgets(void) GtkWidget *frame, *table, *table2, *paned, *sw, *text; GtkWidget *button, *view, *vgrid, *vbox, *right_vbox = NULL; int i; - char buf[256]; GtkWidget *notebook, *statusbar; GtkWidget *dtach_lowbox = NULL; struct sprite *spr; @@ -1043,7 +1061,7 @@ static void setup_widgets(void) gtk_widget_set_margin_start(ingame_votebar, 2); gtk_widget_set_margin_top(ingame_votebar, 2); - /* *** everything in the top *** */ + /* *** Everything in the top *** */ page = gtk_scrolled_window_new(); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(page), @@ -1098,7 +1116,7 @@ static void setup_widgets(void) GTK_POS_LEFT, 1, 1); grid_col++; - /* overview canvas */ + /* Overview canvas */ ahbox = detached_widget_new(); gtk_widget_set_hexpand(ahbox, FALSE); gtk_widget_set_vexpand(ahbox, FALSE); @@ -1111,15 +1129,15 @@ static void setup_widgets(void) gtk_widget_set_margin_top(overview_scrolled_window, 1); gtk_widget_set_margin_bottom(overview_scrolled_window, 1); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (overview_scrolled_window), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); overview_canvas = gtk_drawing_area_new(); gtk_widget_set_halign(overview_canvas, GTK_ALIGN_CENTER); gtk_widget_set_valign(overview_canvas, GTK_ALIGN_CENTER); gtk_widget_set_size_request(overview_canvas, overview_canvas_store_width, - overview_canvas_store_height); + overview_canvas_store_height); gtk_widget_set_size_request(overview_scrolled_window, overview_canvas_store_width, - overview_canvas_store_height); + overview_canvas_store_height); gtk_widget_set_hexpand(overview_canvas, TRUE); gtk_widget_set_vexpand(overview_canvas, TRUE); @@ -1189,7 +1207,7 @@ static void setup_widgets(void) gtk_grid_set_column_homogeneous(GTK_GRID(table), TRUE); gtk_box_append(GTK_BOX(avbox), table); - /* citizens for taxrates */ + /* Citizens for taxrates */ table2 = gtk_grid_new(); gtk_grid_attach(GTK_GRID(table), table2, 0, 0, 10, 1); econ_widget = table2; @@ -1208,7 +1226,7 @@ static void setup_widgets(void) gtk_grid_attach(GTK_GRID(table2), econ_label[i], i, 0, 1, 1); } - /* science, environmental, govt, timeout */ + /* Science, environmental, govt, timeout */ spr = client_research_sprite(); if (spr != NULL) { bulb_label = picture_new_from_surface(spr->surface); @@ -1272,17 +1290,14 @@ static void setup_widgets(void) gtk_frame_set_child(GTK_FRAME(frame), timeout_label); - /* turn done */ + /* Turn done */ turn_done_button = gtk_button_new_with_label(_("Turn Done")); gtk_grid_attach(GTK_GRID(table), turn_done_button, 0, 2, 10, 1); g_signal_connect(turn_done_button, "clicked", G_CALLBACK(end_turn_callback), NULL); - - fc_snprintf(buf, sizeof(buf), "%s:\n%s", - _("Turn Done"), _("Shift+Return")); - gtk_widget_set_tooltip_text(turn_done_button, buf); + update_turn_done_tooltip(); /* Selected unit status */ diff --git a/client/gui-gtk-4.0/gui_main.h b/client/gui-gtk-4.0/gui_main.h index 186618f3e8..8ee564e7b6 100644 --- a/client/gui-gtk-4.0/gui_main.h +++ b/client/gui-gtk-4.0/gui_main.h @@ -22,7 +22,7 @@ #define GUI_GTK_OPTION_STR(optname) "gui_gtk4_" #optname #define GUI_GTK_DEFAULT_THEME_NAME FC_GTK4_DEFAULT_THEME_NAME -/* network string charset conversion */ +/* Network string charset conversion */ gchar *ntoh_str(const gchar *netstr); extern PangoFontDescription *city_names_style; @@ -80,4 +80,6 @@ bool is_gui_up(void); bool terminate_signal_processing(void); -#endif /* FC__GUI_MAIN_H */ +void update_turn_done_tooltip(void); + +#endif /* FC__GUI_MAIN_H */ diff --git a/client/gui-gtk-4.0/mapctrl.c b/client/gui-gtk-4.0/mapctrl.c index 9e6065c2ed..4aa59bf385 100644 --- a/client/gui-gtk-4.0/mapctrl.c +++ b/client/gui-gtk-4.0/mapctrl.c @@ -152,6 +152,8 @@ void popup_newcity_dialog(struct unit *punit, const char *suggestname) void set_turn_done_button_state(bool state) { gtk_widget_set_sensitive(turn_done_button, state); + + update_turn_done_tooltip(); } /**********************************************************************//** diff --git a/client/gui-qt/fc_client.cpp b/client/gui-qt/fc_client.cpp index 67df000135..0efe2abfcf 100644 --- a/client/gui-qt/fc_client.cpp +++ b/client/gui-qt/fc_client.cpp @@ -1062,6 +1062,7 @@ QString fc_icons::get_path(const QString &id) void fc_game_tab_widget::resizeEvent(QResizeEvent *event) { QSize size; + size = event->size(); if (C_S_RUNNING <= client_state()) { gui()->sidebar_wdg->resize_me(size.height()); diff --git a/client/gui-qt/gui_main.cpp b/client/gui-qt/gui_main.cpp index b2fc6f59cb..fbd9c0c0a1 100644 --- a/client/gui-qt/gui_main.cpp +++ b/client/gui-qt/gui_main.cpp @@ -353,7 +353,7 @@ void qtg_real_focus_units_changed(void) } /**********************************************************************//** - Enqueue a callback to be called during an idle moment. The 'callback' + Enqueue a callback to be called during an idle moment. The 'callback' function should be called sometimes soon, and passed the 'data' pointer as its data. **************************************************************************/ diff --git a/client/gui-qt/mapctrl.cpp b/client/gui-qt/mapctrl.cpp index 2e81945b4d..fe1086b276 100644 --- a/client/gui-qt/mapctrl.cpp +++ b/client/gui-qt/mapctrl.cpp @@ -41,12 +41,13 @@ #include "shortcuts.h" extern void side_disable_endturn(bool do_restore); +extern void update_turn_done_tooltip(void); extern void qload_lua_script(); extern void qreload_lua_script(); extern "C" int city_buy_production(struct city *pcity); /**********************************************************************//** - Popup a dialog to ask for the name of a new city. The given string + Popup a dialog to ask for the name of a new city. The given string should be used as a suggestion. **************************************************************************/ void popup_newcity_dialog(struct unit *punit, const char *suggestname) @@ -74,12 +75,14 @@ void popup_newcity_dialog(struct unit *punit, const char *suggestname) } /**********************************************************************//** - A turn done button should be provided for the player. This function + A turn done button should be provided for the player. This function is called to toggle it between active/inactive. **************************************************************************/ void set_turn_done_button_state(bool state) { side_disable_endturn(state); + + update_turn_done_tooltip(); } /**********************************************************************//** diff --git a/client/gui-qt/mapview.cpp b/client/gui-qt/mapview.cpp index b1eb255ced..2c087918ac 100644 --- a/client/gui-qt/mapview.cpp +++ b/client/gui-qt/mapview.cpp @@ -1084,8 +1084,8 @@ void qtg_update_timeout_label(void) /**********************************************************************//** If do_restore is false it should change the turn button style (to - draw the user's attention to it). If called regularly from a timer - this will give a blinking turn done button. If do_restore is true + draw the user's attention to it). If called regularly from a timer + this will give a blinking turn done button. If do_restore is true this should reset the turn done button to the default style. **************************************************************************/ void update_turn_done_button(bool do_restore) @@ -1094,7 +1094,6 @@ void update_turn_done_button(bool do_restore) return; } side_blink_endturn(do_restore); - } diff --git a/client/gui-qt/sidebar.cpp b/client/gui-qt/sidebar.cpp index aa36f3b639..f38a829d48 100644 --- a/client/gui-qt/sidebar.cpp +++ b/client/gui-qt/sidebar.cpp @@ -653,6 +653,24 @@ void side_center_unit() request_center_focus_unit(); } +/**********************************************************************//** + Update tooltip of the Turn Done button +**************************************************************************/ +void update_turn_done_tooltip() +{ + struct option *opt = optset_option_by_name(server_optset, "fixedlength"); + + if (opt != NULL && option_bool_get(opt)) { + gui()->sw_endturn->setToolTip(_("Fixed length turns")); + } else { + char buf[256]; + + fc_snprintf(buf, sizeof(buf), "%s:\n%s", + _("Turn Done"), _("Shift+Return")); + gui()->sw_endturn->setToolTip(buf); + } +} + /***********************************************************************//** Disables end turn button if asked ***************************************************************************/ @@ -661,6 +679,7 @@ void side_disable_endturn(bool do_restore) if (gui()->current_page() != PAGE_GAME) { return; } + gui()->sw_endturn->disabled = !do_restore; gui()->sw_endturn->update_final_pixmap(); } diff --git a/client/gui-qt/sidebar.h b/client/gui-qt/sidebar.h index 0c30893223..14acab9e29 100644 --- a/client/gui-qt/sidebar.h +++ b/client/gui-qt/sidebar.h @@ -32,6 +32,7 @@ typedef void (*pfcn_bool)(bool); typedef void (*pfcn)(void); void side_blink_endturn(bool do_restore); +void update_turn_done_tooltip(); void side_center_unit(); void side_disable_endturn(bool do_restore); void side_finish_turn(bool nothing); @@ -52,7 +53,7 @@ public: int type = SW_STD); ~fc_sidewidget(); int get_priority(); - QPixmap* get_pixmap(); + QPixmap *get_pixmap(); void paint(QPainter *painter, QPaintEvent *event); void resize_pixmap(int width, int height); void set_custom_labels(QString l); -- 2.39.2