diff --git a/bygfoot.glade b/bygfoot.glade index eecc60a7..6ef1610b 100644 --- a/bygfoot.glade +++ b/bygfoot.glade @@ -69,7 +69,7 @@ - + True gtk-open 1 @@ -137,7 +137,7 @@ - + True gtk-preferences 1 @@ -291,7 +291,7 @@ True All Out Defend True - True + False @@ -301,7 +301,7 @@ True Defend True - True + False menu_all_out_defend @@ -312,7 +312,7 @@ True Balanced True - True + False menu_all_out_defend @@ -323,7 +323,7 @@ True Attack True - True + False menu_all_out_defend @@ -358,7 +358,7 @@ True Best True - True + False @@ -368,7 +368,7 @@ True Good True - True + False menu_scout_best @@ -379,7 +379,7 @@ True Average True - True + False menu_scout_best @@ -414,7 +414,7 @@ True Best True - True + False @@ -424,7 +424,7 @@ True Good True - True + False menu_physio_best @@ -435,7 +435,7 @@ True Average True - True + False menu_physio_best @@ -470,7 +470,7 @@ True On True - True + False @@ -480,7 +480,7 @@ True Off True - True + False menu_boost_on @@ -696,7 +696,7 @@ - + True gtk-go-forward 1 @@ -718,7 +718,7 @@ - + True gtk-go-back 1 @@ -740,7 +740,7 @@ - + True gtk-justify-fill 1 @@ -791,13 +791,13 @@ - + True _Help True - + @@ -807,6 +807,48 @@ + + + + True + Contributors + True + + + + + True + gtk-add + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Help + True + + + + + True + gtk-help + 1 + 0.5 + 0.5 + 0 + 0 + + + + @@ -1070,37 +1112,6 @@ - - - 2 - True - Help (H) - True - GTK_RELIEF_NORMAL - True - - - - - - True - gtk-help - 4 - 0.5 - 0.5 - 0 - 0 - - - - - 0 - False - False - GTK_PACK_END - - - True diff --git a/bygfoot_misc.glade b/bygfoot_misc.glade index a3ab3c4d..d5788ec2 100644 --- a/bygfoot_misc.glade +++ b/bygfoot_misc.glade @@ -1449,148 +1449,6 @@ - - 6 - True - Bygfoot help - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - 550 - 650 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - True - False - 0 - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 5 - - - - - - 0 - True - True - - - - - - 2 - True - Esc / Return / Space - True - GTK_RELIEF_NORMAL - True - - - - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-close - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Close - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - - 5 True diff --git a/bygfoot_misc2.glade b/bygfoot_misc2.glade index f2dfb086..ca096eab 100644 --- a/bygfoot_misc2.glade +++ b/bygfoot_misc2.glade @@ -1904,4 +1904,272 @@ + + 5 + True + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + True + 400 + 400 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + + True + False + 3 + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 5 + + + + True + bygfoot_icon.png + 0.5 + 0.5 + 0 + 5 + + + 0 + False + False + + + + + + True + True + + False + False + GTK_JUSTIFY_CENTER + False + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + False + False + + + + + + True + About + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + + + + + False + True + + + + + + True + Contributors + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + + True + False + 3 + + + + True + gtk-help + 6 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + True + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + True + + False + False + GTK_JUSTIFY_LEFT + True + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + False + False + + + + + + True + Help + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + 0 + True + True + + + + + + True + Esc + True + gtk-close + True + GTK_RELIEF_NORMAL + True + + + + + 0 + False + False + + + + + + diff --git a/src/bygfoot.h b/src/bygfoot.h index 3cc1fab3..a90cecf7 100644 --- a/src/bygfoot.h +++ b/src/bygfoot.h @@ -119,6 +119,7 @@ typedef struct *contract, *menu_player, *user_management, - *wdebug; + *wdebug, + *help; } Windows; #endif diff --git a/src/callbacks.c b/src/callbacks.c index 1bb22944..0bcfcbbf 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -83,11 +83,29 @@ on_menu_quit_activate (GtkMenuItem *menuitem, } + + +void +on_menu_help_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + window_show_help(2); +} + + +void +on_menu_contributors_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + window_show_help(1); +} + + void on_menu_about_activate (GtkMenuItem *menuitem, gpointer user_data) { - + window_show_help(0); } @@ -162,14 +180,6 @@ on_button_new_week_clicked (GtkButton *button, } -void -on_button_help_clicked (GtkButton *button, - gpointer user_data) -{ - -} - - gboolean on_player_list1_button_press_event (GtkWidget *widget, GdkEventButton *event, @@ -888,4 +898,3 @@ on_button_quit_button_press_event (GtkWidget *widget, return FALSE; } - diff --git a/src/callbacks.h b/src/callbacks.h index cd67d3c1..507c50ae 100644 --- a/src/callbacks.h +++ b/src/callbacks.h @@ -57,10 +57,6 @@ void on_button_new_week_clicked (GtkButton *button, gpointer user_data); -void -on_button_help_clicked (GtkButton *button, - gpointer user_data); - gboolean on_player_list2_button_press_event (GtkWidget *widget, GdkEventButton *event, @@ -262,3 +258,11 @@ gboolean on_button_quit_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data); + +void +on_menu_help_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menu_contributors_activate (GtkMenuItem *menuitem, + gpointer user_data); diff --git a/src/file.c b/src/file.c index b52f2465..138ca942 100644 --- a/src/file.c +++ b/src/file.c @@ -359,8 +359,8 @@ file_get_next_opt_line(FILE *fil, gchar *opt_name, gchar *opt_value) if(buf[0] != '#' && strlen(buf) != 0) { - if(strlen(buf) > 100) - g_warning("\n the text file I'm reading contains a line longer than 100 chars.\n\n"); + if(strlen(buf) > 1000) + g_warning("\n the text file I'm reading contains a line longer than 1000 chars.\n\n"); for(i=0;ilist->len;i++) + { + if(g_str_has_prefix(g_array_index(help_list->list, Option, i).name->str, + "string_help_text1")) + gtk_label_set_text(label_help_text1, + g_array_index(help_list->list, Option, i).string_value->str); + else if(g_str_has_prefix(g_array_index(help_list->list, Option, i).name->str, + "string_help_desc")) + g_string_append_printf(text, "\n%s\n", + g_array_index(help_list->list, Option, i).string_value->str); + else if(g_str_has_prefix(g_array_index(help_list->list, Option, i).name->str, + "string_help_url")) + g_string_append_printf(text, "%s\n", + g_array_index(help_list->list, Option, i).string_value->str); + } + + gtk_label_set_text(label_help_text2, text->str); + g_string_free(text, TRUE); +} diff --git a/src/game_gui.h b/src/game_gui.h index bb664b28..d73d5580 100644 --- a/src/game_gui.h +++ b/src/game_gui.h @@ -3,6 +3,7 @@ #include "bygfoot.h" #include "live_game_struct.h" +#include "option_struct.h" #define setsav1 gtk_widget_set_sensitive(lookup_widget(window.main, "button_save"), FALSE) #define setsav0 gtk_widget_set_sensitive(lookup_widget(window.main, "button_save"), TRUE) @@ -57,4 +58,7 @@ game_gui_write_check_items(void); void game_gui_read_check_items(GtkWidget *widget); +void +game_gui_set_help_labels(const OptionList *help_list); + #endif diff --git a/src/interface.c b/src/interface.c index e631d97e..6484284b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -38,7 +38,7 @@ create_main_window (void) GtkWidget *menu_new; GtkWidget *menu_open; GtkWidget *menu_load_last_save; - GtkWidget *image311; + GtkWidget *image335; GtkWidget *menu_save; GtkWidget *menu_save_as; GtkWidget *trennlinie1; @@ -46,7 +46,7 @@ create_main_window (void) GtkWidget *menu_options; GtkWidget *menu_options_menu; GtkWidget *menu_preferences; - GtkWidget *image312; + GtkWidget *image336; GtkWidget *trennlinie7; GtkWidget *menu_job_offers; GtkWidget *menu_live_game; @@ -114,18 +114,22 @@ create_main_window (void) GtkWidget *menu_user_show_history; GtkWidget *trennlinie9; GtkWidget *menu_next_user; - GtkWidget *image313; + GtkWidget *image337; GtkWidget *menu_previous_user; - GtkWidget *image314; + GtkWidget *image338; GtkWidget *menu_manage_users; - GtkWidget *image315; + GtkWidget *image339; GtkWidget *menu_finances_stadium; GtkWidget *menu_finances_stadium_menu; GtkWidget *menu_show_finances; GtkWidget *menu_show_stadium; - GtkWidget *menu_help; - GtkWidget *menu_help_menu; + GtkWidget *menu_help1; + GtkWidget *menu_help1_menu; GtkWidget *menu_about; + GtkWidget *menu_contributors; + GtkWidget *image340; + GtkWidget *menu_help; + GtkWidget *image341; GtkWidget *hbox1; GtkWidget *button_load; GtkWidget *image11; @@ -144,8 +148,6 @@ create_main_window (void) GtkWidget *vseparator16; GtkWidget *button_new_week; GtkWidget *image23; - GtkWidget *button_help; - GtkWidget *image39; GtkWidget *entry_message; GtkWidget *hseparator1; GtkWidget *eventbox_main_info; @@ -250,9 +252,9 @@ create_main_window (void) GDK_l, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); - image311 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); - gtk_widget_show (image311); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image311); + image335 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); + gtk_widget_show (image335); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_load_last_save), image335); menu_save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group); gtk_widget_show (menu_save); @@ -285,9 +287,9 @@ create_main_window (void) GDK_p, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image312 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); - gtk_widget_show (image312); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image312); + image336 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); + gtk_widget_show (image336); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_preferences), image336); trennlinie7 = gtk_separator_menu_item_new (); gtk_widget_show (trennlinie7); @@ -377,25 +379,21 @@ create_main_window (void) menu_all_out_defend_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_all_out_defend)); gtk_widget_show (menu_all_out_defend); gtk_container_add (GTK_CONTAINER (menu_playing_style_menu), menu_all_out_defend); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_all_out_defend), TRUE); menu_defend = gtk_radio_menu_item_new_with_mnemonic (menu_all_out_defend_group, _("Defend")); menu_all_out_defend_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_defend)); gtk_widget_show (menu_defend); gtk_container_add (GTK_CONTAINER (menu_playing_style_menu), menu_defend); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_defend), TRUE); menu_balanced = gtk_radio_menu_item_new_with_mnemonic (menu_all_out_defend_group, _("Balanced")); menu_all_out_defend_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_balanced)); gtk_widget_show (menu_balanced); gtk_container_add (GTK_CONTAINER (menu_playing_style_menu), menu_balanced); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_balanced), TRUE); menu_attack = gtk_radio_menu_item_new_with_mnemonic (menu_all_out_defend_group, _("Attack")); menu_all_out_defend_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_attack)); gtk_widget_show (menu_attack); gtk_container_add (GTK_CONTAINER (menu_playing_style_menu), menu_attack); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_attack), TRUE); menu_all_out_attack = gtk_radio_menu_item_new_with_mnemonic (menu_all_out_defend_group, _("All Out Attack")); menu_all_out_defend_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_all_out_attack)); @@ -414,19 +412,16 @@ create_main_window (void) menu_scout_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_scout_best)); gtk_widget_show (menu_scout_best); gtk_container_add (GTK_CONTAINER (menu_scout_menu), menu_scout_best); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_scout_best), TRUE); menu_scout_good = gtk_radio_menu_item_new_with_mnemonic (menu_scout_best_group, _("Good")); menu_scout_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_scout_good)); gtk_widget_show (menu_scout_good); gtk_container_add (GTK_CONTAINER (menu_scout_menu), menu_scout_good); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_scout_good), TRUE); menu_scout_average = gtk_radio_menu_item_new_with_mnemonic (menu_scout_best_group, _("Average")); menu_scout_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_scout_average)); gtk_widget_show (menu_scout_average); gtk_container_add (GTK_CONTAINER (menu_scout_menu), menu_scout_average); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_scout_average), TRUE); menu_scout_bad = gtk_radio_menu_item_new_with_mnemonic (menu_scout_best_group, _("Bad")); menu_scout_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_scout_bad)); @@ -445,19 +440,16 @@ create_main_window (void) menu_physio_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_physio_best)); gtk_widget_show (menu_physio_best); gtk_container_add (GTK_CONTAINER (menu_physio_menu), menu_physio_best); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_physio_best), TRUE); menu_physio_good = gtk_radio_menu_item_new_with_mnemonic (menu_physio_best_group, _("Good")); menu_physio_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_physio_good)); gtk_widget_show (menu_physio_good); gtk_container_add (GTK_CONTAINER (menu_physio_menu), menu_physio_good); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_physio_good), TRUE); menu_physio_average = gtk_radio_menu_item_new_with_mnemonic (menu_physio_best_group, _("Average")); menu_physio_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_physio_average)); gtk_widget_show (menu_physio_average); gtk_container_add (GTK_CONTAINER (menu_physio_menu), menu_physio_average); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_physio_average), TRUE); menu_physio_bad = gtk_radio_menu_item_new_with_mnemonic (menu_physio_best_group, _("Bad")); menu_physio_best_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_physio_bad)); @@ -476,13 +468,11 @@ create_main_window (void) menu_boost_on_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_boost_on)); gtk_widget_show (menu_boost_on); gtk_container_add (GTK_CONTAINER (menu_boost_menu), menu_boost_on); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_boost_on), TRUE); menu_boost_off = gtk_radio_menu_item_new_with_mnemonic (menu_boost_on_group, _("Off")); menu_boost_on_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_boost_off)); gtk_widget_show (menu_boost_off); gtk_container_add (GTK_CONTAINER (menu_boost_menu), menu_boost_off); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_boost_off), TRUE); menu_boost_anti = gtk_radio_menu_item_new_with_mnemonic (menu_boost_on_group, _("Anti")); menu_boost_on_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_boost_anti)); @@ -602,9 +592,9 @@ create_main_window (void) GDK_F9, 0, GTK_ACCEL_VISIBLE); - image313 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU); - gtk_widget_show (image313); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image313); + image337 = gtk_image_new_from_stock ("gtk-go-forward", GTK_ICON_SIZE_MENU); + gtk_widget_show (image337); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_next_user), image337); menu_previous_user = gtk_image_menu_item_new_with_mnemonic (_("Previous user")); gtk_widget_show (menu_previous_user); @@ -613,9 +603,9 @@ create_main_window (void) GDK_F8, 0, GTK_ACCEL_VISIBLE); - image314 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU); - gtk_widget_show (image314); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image314); + image338 = gtk_image_new_from_stock ("gtk-go-back", GTK_ICON_SIZE_MENU); + gtk_widget_show (image338); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_previous_user), image338); menu_manage_users = gtk_image_menu_item_new_with_mnemonic (_("Manage users")); gtk_widget_show (menu_manage_users); @@ -624,9 +614,9 @@ create_main_window (void) GDK_F12, 0, GTK_ACCEL_VISIBLE); - image315 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU); - gtk_widget_show (image315); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image315); + image339 = gtk_image_new_from_stock ("gtk-justify-fill", GTK_ICON_SIZE_MENU); + gtk_widget_show (image339); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_manage_users), image339); menu_finances_stadium = gtk_menu_item_new_with_mnemonic (_("Fin_Stad")); gtk_widget_show (menu_finances_stadium); @@ -649,16 +639,32 @@ create_main_window (void) GDK_f, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - menu_help = gtk_menu_item_new_with_mnemonic (_("_Help")); - gtk_widget_show (menu_help); - gtk_container_add (GTK_CONTAINER (menubar1), menu_help); + menu_help1 = gtk_menu_item_new_with_mnemonic (_("_Help")); + gtk_widget_show (menu_help1); + gtk_container_add (GTK_CONTAINER (menubar1), menu_help1); - menu_help_menu = gtk_menu_new (); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_help), menu_help_menu); + menu_help1_menu = gtk_menu_new (); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_help1), menu_help1_menu); menu_about = gtk_image_menu_item_new_from_stock ("gtk-dialog-info", accel_group); gtk_widget_show (menu_about); - gtk_container_add (GTK_CONTAINER (menu_help_menu), menu_about); + gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_about); + + menu_contributors = gtk_image_menu_item_new_with_mnemonic (_("Contributors")); + gtk_widget_show (menu_contributors); + gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_contributors); + + image340 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image340); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_contributors), image340); + + menu_help = gtk_image_menu_item_new_with_mnemonic (_("Help")); + gtk_widget_show (menu_help); + gtk_container_add (GTK_CONTAINER (menu_help1_menu), menu_help); + + image341 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); + gtk_widget_show (image341); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_help), image341); hbox1 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox1); @@ -761,19 +767,6 @@ create_main_window (void) gtk_widget_show (image23); gtk_container_add (GTK_CONTAINER (button_new_week), image23); - button_help = gtk_button_new (); - gtk_widget_show (button_help); - gtk_box_pack_end (GTK_BOX (hbox1), button_help, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (button_help), 2); - gtk_tooltips_set_tip (tooltips, button_help, _("Help (H)"), NULL); - gtk_widget_add_accelerator (button_help, "clicked", accel_group, - GDK_h, 0, - GTK_ACCEL_VISIBLE); - - image39 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (image39); - gtk_container_add (GTK_CONTAINER (button_help), image39); - entry_message = gtk_entry_new (); gtk_widget_show (entry_message); gtk_box_pack_start (GTK_BOX (hbox1), entry_message, TRUE, TRUE, 5); @@ -1206,6 +1199,12 @@ create_main_window (void) g_signal_connect ((gpointer) menu_about, "activate", G_CALLBACK (on_menu_about_activate), NULL); + g_signal_connect ((gpointer) menu_contributors, "activate", + G_CALLBACK (on_menu_contributors_activate), + NULL); + g_signal_connect ((gpointer) menu_help, "activate", + G_CALLBACK (on_menu_help_activate), + NULL); g_signal_connect ((gpointer) button_load, "clicked", G_CALLBACK (on_button_load_clicked), NULL); @@ -1230,9 +1229,6 @@ create_main_window (void) g_signal_connect ((gpointer) button_new_week, "clicked", G_CALLBACK (on_button_new_week_clicked), NULL); - g_signal_connect ((gpointer) button_help, "clicked", - G_CALLBACK (on_button_help_clicked), - NULL); g_signal_connect ((gpointer) eventbox_style, "button_press_event", G_CALLBACK (on_eventbox_style_button_press_event), NULL); @@ -1273,7 +1269,7 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_new, "menu_new"); GLADE_HOOKUP_OBJECT (main_window, menu_open, "menu_open"); GLADE_HOOKUP_OBJECT (main_window, menu_load_last_save, "menu_load_last_save"); - GLADE_HOOKUP_OBJECT (main_window, image311, "image311"); + GLADE_HOOKUP_OBJECT (main_window, image335, "image335"); GLADE_HOOKUP_OBJECT (main_window, menu_save, "menu_save"); GLADE_HOOKUP_OBJECT (main_window, menu_save_as, "menu_save_as"); GLADE_HOOKUP_OBJECT (main_window, trennlinie1, "trennlinie1"); @@ -1281,7 +1277,7 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_options, "menu_options"); GLADE_HOOKUP_OBJECT (main_window, menu_options_menu, "menu_options_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_preferences, "menu_preferences"); - GLADE_HOOKUP_OBJECT (main_window, image312, "image312"); + GLADE_HOOKUP_OBJECT (main_window, image336, "image336"); GLADE_HOOKUP_OBJECT (main_window, trennlinie7, "trennlinie7"); GLADE_HOOKUP_OBJECT (main_window, menu_job_offers, "menu_job_offers"); GLADE_HOOKUP_OBJECT (main_window, menu_live_game, "menu_live_game"); @@ -1345,18 +1341,22 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, menu_user_show_history, "menu_user_show_history"); GLADE_HOOKUP_OBJECT (main_window, trennlinie9, "trennlinie9"); GLADE_HOOKUP_OBJECT (main_window, menu_next_user, "menu_next_user"); - GLADE_HOOKUP_OBJECT (main_window, image313, "image313"); + GLADE_HOOKUP_OBJECT (main_window, image337, "image337"); GLADE_HOOKUP_OBJECT (main_window, menu_previous_user, "menu_previous_user"); - GLADE_HOOKUP_OBJECT (main_window, image314, "image314"); + GLADE_HOOKUP_OBJECT (main_window, image338, "image338"); GLADE_HOOKUP_OBJECT (main_window, menu_manage_users, "menu_manage_users"); - GLADE_HOOKUP_OBJECT (main_window, image315, "image315"); + GLADE_HOOKUP_OBJECT (main_window, image339, "image339"); GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium, "menu_finances_stadium"); GLADE_HOOKUP_OBJECT (main_window, menu_finances_stadium_menu, "menu_finances_stadium_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_show_finances, "menu_show_finances"); GLADE_HOOKUP_OBJECT (main_window, menu_show_stadium, "menu_show_stadium"); - GLADE_HOOKUP_OBJECT (main_window, menu_help, "menu_help"); - GLADE_HOOKUP_OBJECT (main_window, menu_help_menu, "menu_help_menu"); + GLADE_HOOKUP_OBJECT (main_window, menu_help1, "menu_help1"); + GLADE_HOOKUP_OBJECT (main_window, menu_help1_menu, "menu_help1_menu"); GLADE_HOOKUP_OBJECT (main_window, menu_about, "menu_about"); + GLADE_HOOKUP_OBJECT (main_window, menu_contributors, "menu_contributors"); + GLADE_HOOKUP_OBJECT (main_window, image340, "image340"); + GLADE_HOOKUP_OBJECT (main_window, menu_help, "menu_help"); + GLADE_HOOKUP_OBJECT (main_window, image341, "image341"); GLADE_HOOKUP_OBJECT (main_window, hbox1, "hbox1"); GLADE_HOOKUP_OBJECT (main_window, button_load, "button_load"); GLADE_HOOKUP_OBJECT (main_window, image11, "image11"); @@ -1375,8 +1375,6 @@ create_main_window (void) GLADE_HOOKUP_OBJECT (main_window, vseparator16, "vseparator16"); GLADE_HOOKUP_OBJECT (main_window, button_new_week, "button_new_week"); GLADE_HOOKUP_OBJECT (main_window, image23, "image23"); - GLADE_HOOKUP_OBJECT (main_window, button_help, "button_help"); - GLADE_HOOKUP_OBJECT (main_window, image39, "image39"); GLADE_HOOKUP_OBJECT (main_window, entry_message, "entry_message"); GLADE_HOOKUP_OBJECT (main_window, hseparator1, "hseparator1"); GLADE_HOOKUP_OBJECT (main_window, eventbox_main_info, "eventbox_main_info"); diff --git a/src/misc2_callbacks.c b/src/misc2_callbacks.c index 01f25db6..e4b28858 100644 --- a/src/misc2_callbacks.c +++ b/src/misc2_callbacks.c @@ -15,7 +15,6 @@ #include "user.h" #include "window.h" - gboolean on_button_cancel_clicked (GtkWidget *widget, GdkEvent *event, @@ -357,3 +356,21 @@ on_window_user_management_delete_event (GtkWidget *widget, return FALSE; } + +gboolean +on_window_help_delete_event (GtkWidget *widget, + GdkEvent *event, + gpointer user_data) +{ + on_button_help_close_clicked(NULL, NULL); + + return FALSE; +} + + +void +on_button_help_close_clicked (GtkButton *button, + gpointer user_data) +{ + window_destroy(&window.help, FALSE); +} diff --git a/src/misc2_callbacks.h b/src/misc2_callbacks.h index 05183482..3c2eabda 100644 --- a/src/misc2_callbacks.h +++ b/src/misc2_callbacks.h @@ -115,4 +115,13 @@ gboolean on_window_user_management_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data); + +gboolean +on_window_help_delete_event (GtkWidget *widget, + GdkEvent *event, + gpointer user_data); + +void +on_button_help_close_clicked (GtkButton *button, + gpointer user_data); #endif diff --git a/src/misc2_interface.c b/src/misc2_interface.c index 0bdf94cf..da3a3bcd 100644 --- a/src/misc2_interface.c +++ b/src/misc2_interface.c @@ -980,3 +980,145 @@ create_window_debug (void) return window_debug; } +GtkWidget* +create_window_help (void) +{ + GtkWidget *window_help; + GtkWidget *vbox23; + GtkWidget *notebook1; + GtkWidget *vbox24; + GtkWidget *image12; + GtkWidget *label_about; + GtkWidget *label49; + GtkWidget *scrolledwindow4; + GtkWidget *treeview_contributors; + GtkWidget *label50; + GtkWidget *vbox25; + GtkWidget *image13; + GtkWidget *label_help_text1; + GtkWidget *label_help_text2; + GtkWidget *label51; + GtkWidget *button_help_close; + GtkAccelGroup *accel_group; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); + + accel_group = gtk_accel_group_new (); + + window_help = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (window_help), 5); + gtk_window_set_title (GTK_WINDOW (window_help), _("window1")); + gtk_window_set_position (GTK_WINDOW (window_help), GTK_WIN_POS_CENTER); + gtk_window_set_modal (GTK_WINDOW (window_help), TRUE); + gtk_window_set_default_size (GTK_WINDOW (window_help), 400, 400); + + vbox23 = gtk_vbox_new (FALSE, 3); + gtk_widget_show (vbox23); + gtk_container_add (GTK_CONTAINER (window_help), vbox23); + + notebook1 = gtk_notebook_new (); + gtk_widget_show (notebook1); + gtk_box_pack_start (GTK_BOX (vbox23), notebook1, TRUE, TRUE, 0); + + vbox24 = gtk_vbox_new (FALSE, 5); + gtk_widget_show (vbox24); + gtk_container_add (GTK_CONTAINER (notebook1), vbox24); + gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (notebook1), vbox24, + FALSE, FALSE, GTK_PACK_START); + + image12 = create_pixmap (window_help, "bygfoot_icon.png"); + gtk_widget_show (image12); + gtk_box_pack_start (GTK_BOX (vbox24), image12, FALSE, FALSE, 0); + gtk_misc_set_padding (GTK_MISC (image12), 0, 5); + + label_about = gtk_label_new (""); + gtk_widget_show (label_about); + gtk_box_pack_start (GTK_BOX (vbox24), label_about, FALSE, FALSE, 0); + GTK_WIDGET_SET_FLAGS (label_about, GTK_CAN_FOCUS); + gtk_label_set_justify (GTK_LABEL (label_about), GTK_JUSTIFY_CENTER); + gtk_label_set_selectable (GTK_LABEL (label_about), TRUE); + + label49 = gtk_label_new (_("About")); + gtk_widget_show (label49); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label49); + + scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow4); + gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow4); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN); + + treeview_contributors = gtk_tree_view_new (); + gtk_widget_show (treeview_contributors); + gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview_contributors); + + label50 = gtk_label_new (_("Contributors")); + gtk_widget_show (label50); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label50); + + vbox25 = gtk_vbox_new (FALSE, 3); + gtk_widget_show (vbox25); + gtk_container_add (GTK_CONTAINER (notebook1), vbox25); + gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (notebook1), vbox25, + FALSE, FALSE, GTK_PACK_START); + + image13 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_DIALOG); + gtk_widget_show (image13); + gtk_box_pack_start (GTK_BOX (vbox25), image13, FALSE, FALSE, 0); + + label_help_text1 = gtk_label_new (""); + gtk_widget_show (label_help_text1); + gtk_box_pack_start (GTK_BOX (vbox25), label_help_text1, FALSE, FALSE, 0); + gtk_label_set_line_wrap (GTK_LABEL (label_help_text1), TRUE); + + label_help_text2 = gtk_label_new (""); + gtk_widget_show (label_help_text2); + gtk_box_pack_start (GTK_BOX (vbox25), label_help_text2, FALSE, FALSE, 0); + GTK_WIDGET_SET_FLAGS (label_help_text2, GTK_CAN_FOCUS); + gtk_label_set_line_wrap (GTK_LABEL (label_help_text2), TRUE); + gtk_label_set_selectable (GTK_LABEL (label_help_text2), TRUE); + + label51 = gtk_label_new (_("Help")); + gtk_widget_show (label51); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label51); + + button_help_close = gtk_button_new_from_stock ("gtk-close"); + gtk_widget_show (button_help_close); + gtk_box_pack_start (GTK_BOX (vbox23), button_help_close, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, button_help_close, _("Esc"), NULL); + gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, + GDK_Escape, 0, + GTK_ACCEL_VISIBLE); + + g_signal_connect ((gpointer) window_help, "delete_event", + G_CALLBACK (on_window_help_delete_event), + NULL); + g_signal_connect ((gpointer) button_help_close, "clicked", + G_CALLBACK (on_button_help_close_clicked), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (window_help, window_help, "window_help"); + GLADE_HOOKUP_OBJECT (window_help, vbox23, "vbox23"); + GLADE_HOOKUP_OBJECT (window_help, notebook1, "notebook1"); + GLADE_HOOKUP_OBJECT (window_help, vbox24, "vbox24"); + GLADE_HOOKUP_OBJECT (window_help, image12, "image12"); + GLADE_HOOKUP_OBJECT (window_help, label_about, "label_about"); + GLADE_HOOKUP_OBJECT (window_help, label49, "label49"); + GLADE_HOOKUP_OBJECT (window_help, scrolledwindow4, "scrolledwindow4"); + GLADE_HOOKUP_OBJECT (window_help, treeview_contributors, "treeview_contributors"); + GLADE_HOOKUP_OBJECT (window_help, label50, "label50"); + GLADE_HOOKUP_OBJECT (window_help, vbox25, "vbox25"); + GLADE_HOOKUP_OBJECT (window_help, image13, "image13"); + GLADE_HOOKUP_OBJECT (window_help, label_help_text1, "label_help_text1"); + GLADE_HOOKUP_OBJECT (window_help, label_help_text2, "label_help_text2"); + GLADE_HOOKUP_OBJECT (window_help, label51, "label51"); + GLADE_HOOKUP_OBJECT (window_help, button_help_close, "button_help_close"); + GLADE_HOOKUP_OBJECT_NO_REF (window_help, tooltips, "tooltips"); + + gtk_window_add_accel_group (GTK_WINDOW (window_help), accel_group); + + return window_help; +} + diff --git a/src/misc2_interface.h b/src/misc2_interface.h index 1d0f8f85..61f31247 100644 --- a/src/misc2_interface.h +++ b/src/misc2_interface.h @@ -10,3 +10,4 @@ GtkWidget* create_window_yesno (void); GtkWidget* create_window_contract (void); GtkWidget* create_window_user_management (void); GtkWidget* create_window_debug (void); +GtkWidget* create_window_help (void); diff --git a/src/misc_callbacks.c b/src/misc_callbacks.c index c55e4600..aa5661f9 100644 --- a/src/misc_callbacks.c +++ b/src/misc_callbacks.c @@ -181,14 +181,6 @@ on_button_live_close_clicked (GtkButton *button, } -void -on_button_help_close_clicked (GtkButton *button, - gpointer user_data) -{ - -} - - void on_button_pause_clicked (GtkButton *button, gpointer user_data) diff --git a/src/misc_callbacks.h b/src/misc_callbacks.h index 452b5be5..4b5a7896 100644 --- a/src/misc_callbacks.h +++ b/src/misc_callbacks.h @@ -57,10 +57,6 @@ void on_button_live_close_clicked (GtkButton *button, gpointer user_data); -void -on_button_help_close_clicked (GtkButton *button, - gpointer user_data); - void on_button_pause_clicked (GtkButton *button, gpointer user_data); diff --git a/src/misc_interface.c b/src/misc_interface.c index 84d7d97b..8437256e 100644 --- a/src/misc_interface.c +++ b/src/misc_interface.c @@ -825,99 +825,6 @@ create_window_live (void) return window_live; } -GtkWidget* -create_help_window (void) -{ - GtkWidget *help_window; - GtkWidget *vbox27; - GtkWidget *scrolledwindow5; - GtkWidget *text_view_help; - GtkWidget *button_help_close; - GtkWidget *alignment11; - GtkWidget *hbox40; - GtkWidget *image40; - GtkWidget *label59; - GtkAccelGroup *accel_group; - GtkTooltips *tooltips; - - tooltips = gtk_tooltips_new (); - - accel_group = gtk_accel_group_new (); - - help_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (help_window), 6); - gtk_window_set_title (GTK_WINDOW (help_window), _("Bygfoot help")); - gtk_window_set_position (GTK_WINDOW (help_window), GTK_WIN_POS_CENTER); - gtk_window_set_default_size (GTK_WINDOW (help_window), 550, 650); - - vbox27 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox27); - gtk_container_add (GTK_CONTAINER (help_window), vbox27); - - scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwindow5); - gtk_box_pack_start (GTK_BOX (vbox27), scrolledwindow5, TRUE, TRUE, 0); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_SHADOW_IN); - - text_view_help = gtk_text_view_new (); - gtk_widget_show (text_view_help); - gtk_container_add (GTK_CONTAINER (scrolledwindow5), text_view_help); - gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view_help), FALSE); - gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view_help), GTK_WRAP_WORD); - gtk_text_view_set_indent (GTK_TEXT_VIEW (text_view_help), 5); - - button_help_close = gtk_button_new (); - gtk_widget_show (button_help_close); - gtk_box_pack_start (GTK_BOX (vbox27), button_help_close, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (button_help_close), 2); - gtk_tooltips_set_tip (tooltips, button_help_close, _("Esc / Return / Space"), NULL); - gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, - GDK_Escape, 0, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, - GDK_Return, 0, - GTK_ACCEL_VISIBLE); - gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, - GDK_space, 0, - GTK_ACCEL_VISIBLE); - - alignment11 = gtk_alignment_new (0.5, 0.5, 0, 0); - gtk_widget_show (alignment11); - gtk_container_add (GTK_CONTAINER (button_help_close), alignment11); - - hbox40 = gtk_hbox_new (FALSE, 2); - gtk_widget_show (hbox40); - gtk_container_add (GTK_CONTAINER (alignment11), hbox40); - - image40 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (image40); - gtk_box_pack_start (GTK_BOX (hbox40), image40, FALSE, FALSE, 0); - - label59 = gtk_label_new_with_mnemonic (_("Close")); - gtk_widget_show (label59); - gtk_box_pack_start (GTK_BOX (hbox40), label59, FALSE, FALSE, 0); - - g_signal_connect ((gpointer) button_help_close, "clicked", - G_CALLBACK (on_button_help_close_clicked), - NULL); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (help_window, help_window, "help_window"); - GLADE_HOOKUP_OBJECT (help_window, vbox27, "vbox27"); - GLADE_HOOKUP_OBJECT (help_window, scrolledwindow5, "scrolledwindow5"); - GLADE_HOOKUP_OBJECT (help_window, text_view_help, "text_view_help"); - GLADE_HOOKUP_OBJECT (help_window, button_help_close, "button_help_close"); - GLADE_HOOKUP_OBJECT (help_window, alignment11, "alignment11"); - GLADE_HOOKUP_OBJECT (help_window, hbox40, "hbox40"); - GLADE_HOOKUP_OBJECT (help_window, image40, "image40"); - GLADE_HOOKUP_OBJECT (help_window, label59, "label59"); - GLADE_HOOKUP_OBJECT_NO_REF (help_window, tooltips, "tooltips"); - - gtk_window_add_accel_group (GTK_WINDOW (help_window), accel_group); - - return help_window; -} - GtkWidget* create_window_stadium (void) { diff --git a/src/misc_interface.h b/src/misc_interface.h index 48c4fde1..92da4231 100644 --- a/src/misc_interface.h +++ b/src/misc_interface.h @@ -6,5 +6,4 @@ GtkWidget* create_window_startup (void); GtkWidget* create_window_file_sel (void); GtkWidget* create_window_font_sel (void); GtkWidget* create_window_live (void); -GtkWidget* create_help_window (void); GtkWidget* create_window_stadium (void); diff --git a/src/treeview.c b/src/treeview.c index 20e854ed..6bcef6f2 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -2290,3 +2290,52 @@ treeview_create_country_list(const GPtrArray *country_list) return GTK_TREE_MODEL(ls); } + +/** Show the list of contributors in the help window.*/ +void +treeview_show_contributors(const OptionList *help_list) +{ + GtkTreeView *treeview = GTK_TREE_VIEW(lookup_widget(window.help, "treeview_contributors")); + GtkListStore *ls = gtk_list_store_new(1, G_TYPE_STRING); + GtkTreeIter iter; + GtkTreeViewColumn *col; + GtkCellRenderer *renderer; + gint i; + gchar buf[SMALL]; + + gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview), + GTK_SELECTION_NONE); + gtk_tree_view_set_rules_hint(treeview, FALSE); + gtk_tree_view_set_headers_visible(treeview, FALSE); + + col = gtk_tree_view_column_new(); + gtk_tree_view_append_column(treeview, col); + renderer = treeview_helper_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_add_attribute(col, renderer, + "markup", 0); + + for(i=0;ilist->len;i++) + { + gtk_list_store_append(ls, &iter); + + if(g_str_has_prefix(g_array_index(help_list->list, Option, i).name->str, + "string_contrib_title")) + { + sprintf(buf, "\n%s", + const_app("string_help_window_title_attribute"), + g_array_index(help_list->list, Option, i).string_value->str); + gtk_list_store_set(ls, &iter, 0, buf, -1); + } + else if(g_str_has_prefix(g_array_index(help_list->list, Option, i).name->str, + "string_contrib_")) + { + strcpy(buf, g_array_index(help_list->list, Option, i).string_value->str); + gtk_list_store_set(ls, &iter, 0, buf, -1); + } + + } + + gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(ls)); + g_object_unref(ls); +} diff --git a/src/treeview.h b/src/treeview.h index 3262d345..e34e99ab 100644 --- a/src/treeview.h +++ b/src/treeview.h @@ -202,4 +202,7 @@ treeview_create_season_history_champions(GtkListStore *ls, const GArray* league_ GtkTreeModel* treeview_create_country_list(const GPtrArray *country_list); +void +treeview_show_contributors(const OptionList *help_list); + #endif diff --git a/src/user.c b/src/user.c index c89f190f..f107cf42 100644 --- a/src/user.c +++ b/src/user.c @@ -710,7 +710,7 @@ user_history_to_string(const UserHistory *history, gchar *buf) team_of_id(history->team_id)->name->str); break; case USER_HISTORY_END_SEASON: - sprintf(buf, "You finish the season in %s on rank %d.", + sprintf(buf, "You finish the season in the %s on rank %d.", league_cup_get_name_string(history->value1), history->value2); break; diff --git a/src/window.c b/src/window.c index 4ce7dc8a..dbb7bb89 100644 --- a/src/window.c +++ b/src/window.c @@ -16,6 +16,40 @@ #include "user.h" #include "window.h" +/** Show the help/about window. + @param page Which notebook page to display. */ +void +window_show_help(gint page) +{ + gchar buf[SMALL]; + gchar *help_file = file_find_support_file("bygfoot_help", TRUE); + OptionList help_list; + + if(help_file == NULL) + { + game_gui_show_warning("Didn't find file 'bygfoot_help'."); + return; + } + + help_list.list = NULL; + help_list.datalist = NULL; + file_load_opt_file(help_file, &help_list); + + window_create(WINDOW_HELP); + + sprintf(buf, "Bygfoot Football Manager\n%s\n(c) 2005 Győző Both (gyboth@bygfoot.com)\nhttp://bygfoot.sourceforge.net", VERS); + gtk_label_set_text(GTK_LABEL(lookup_widget(window.help, "label_about")), buf); + + treeview_show_contributors(&help_list); + + game_gui_set_help_labels(&help_list); + + gtk_notebook_set_current_page(GTK_NOTEBOOK(lookup_widget(window.help, "notebook1")), page); + + g_free(help_file); + free_option_list(&help_list, FALSE); +} + /** Show the country selection window. All files with prefix 'country_' from $HOME/.bygfoot/definitions are appended to a combo box. @@ -379,6 +413,13 @@ window_create(gint window_type) wind = window.wdebug; strcpy(buf, "Bygfoot debug window"); break; + case WINDOW_HELP: + if(window.help != NULL) + g_warning("window_create: called on already existing window\n"); + else + window.help = create_window_help(); + wind = window.help; + break; } gtk_window_set_title(GTK_WINDOW(wind), buf); diff --git a/src/window.h b/src/window.h index 501fa81b..880c230e 100644 --- a/src/window.h +++ b/src/window.h @@ -22,9 +22,13 @@ enum Windows WINDOW_CONTRACT, WINDOW_USER_MANAGEMENT, WINDOW_DEBUG, + WINDOW_HELP, WINDOW_END }; +void +window_show_help(gint page); + void window_show_startup(void); diff --git a/support_files/bygfoot_app b/support_files/bygfoot_app index 4cb5dcb7..d405fce5 100644 --- a/support_files/bygfoot_app +++ b/support_files/bygfoot_app @@ -6,6 +6,9 @@ # treeview background and foreground colours ###### ################################################### +# font attributes for the help window +string_help_window_title_attribute size='large' + # colours of the live game commentary for the away team string_treeview_live_game_commentary_away_fg black string_treeview_live_game_commentary_away_bg lightgrey diff --git a/support_files/definitions/scotland/league_scotland2.xml b/support_files/definitions/scotland/league_scotland2.xml index ce5a3ba9..d789a747 100644 --- a/support_files/definitions/scotland/league_scotland2.xml +++ b/support_files/definitions/scotland/league_scotland2.xml @@ -22,7 +22,7 @@ 9 10 scotland3 - promotion + relegation diff --git a/support_files/pixmaps/bygfoot_icon.png b/support_files/pixmaps/bygfoot_icon.png index d3b792b5..6b544f5a 100644 Binary files a/support_files/pixmaps/bygfoot_icon.png and b/support_files/pixmaps/bygfoot_icon.png differ