From 1fc1ea7829200b995504913fb03b79c413dbde0c Mon Sep 17 00:00:00 2001 From: gyboth Date: Mon, 16 May 2005 07:09:53 +0000 Subject: [PATCH] "Free corrections." --- bygfoot.glade | 6 +++++- bygfoot_misc.glade | 2 ++ bygfoot_misc2.glade | 4 ++++ src/free.c | 21 +++++++++++++++++++-- src/free.h | 3 +++ src/interface.c | 2 +- src/misc2_interface.c | 14 ++++++++++++++ src/misc_callbacks.c | 1 - src/misc_interface.c | 6 ++++++ 9 files changed, 54 insertions(+), 5 deletions(-) diff --git a/bygfoot.glade b/bygfoot.glade index 02b6bcb8..eecc60a7 100644 --- a/bygfoot.glade +++ b/bygfoot.glade @@ -1003,7 +1003,7 @@ 2 True - Show my last games and a preview of my next games (F1) + Show a preview of my next games (F1) True GTK_RELIEF_NORMAL True @@ -1801,6 +1801,7 @@ True + False Previous league/cup (1) True GTK_RELIEF_NORMAL @@ -1830,6 +1831,7 @@ True + False Next league/cup (2) True GTK_RELIEF_NORMAL @@ -1859,6 +1861,7 @@ True + False Previous (Q) True GTK_RELIEF_NORMAL @@ -1888,6 +1891,7 @@ True + False Next (W) True GTK_RELIEF_NORMAL diff --git a/bygfoot_misc.glade b/bygfoot_misc.glade index 5e4bd1f7..9203d736 100644 --- a/bygfoot_misc.glade +++ b/bygfoot_misc.glade @@ -681,6 +681,7 @@ True + Load the last game that was saved or loaded. True GTK_RELIEF_NORMAL True @@ -1329,6 +1330,7 @@ True + Change live game speed. The lower the value the faster the live game. True 1 0 diff --git a/bygfoot_misc2.glade b/bygfoot_misc2.glade index c88dfafa..f2dfb086 100644 --- a/bygfoot_misc2.glade +++ b/bygfoot_misc2.glade @@ -18,6 +18,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST + @@ -801,6 +802,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST + @@ -1483,6 +1485,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST + @@ -1546,6 +1549,7 @@ True + Click on a user to remove him from the game. True True False diff --git a/src/free.c b/src/free.c index 58e84ba8..df89fc52 100644 --- a/src/free.c +++ b/src/free.c @@ -10,12 +10,25 @@ void free_memory(void) { free_variables(); + free_transfer_list(); free_country(FALSE); free_users(FALSE); free_live_game(&live_game_temp); free_support_dirs(); } +/** Free the transfer list. */ +void +free_transfer_list(void) +{ + gint i, j; + + for(i=0;ilen;i++) + g_array_free(g_array_index(transfer_list, Transfer, i).offers, TRUE); + + free_g_array(&transfer_list); +} + /** Free the memory occupied by the season stats. */ void free_season_stats(gboolean reset) @@ -55,6 +68,9 @@ free_season_stats(gboolean reset) g_array_index( g_array_index(season_stats, SeasonStat, i).cup_champs, ChampStat, j).team_name, TRUE); } + + g_array_free(g_array_index(season_stats, SeasonStat, i).cup_champs, TRUE); + g_array_free(g_array_index(season_stats, SeasonStat, i).league_champs, TRUE); } free_g_array(&season_stats); @@ -196,6 +212,7 @@ free_country(gboolean reset) free_leagues_array(&ligs, reset); free_cups_array(&cps, reset); free_g_ptr_array(&acps); + if(reset) acps = g_ptr_array_new(); } @@ -428,14 +445,14 @@ free_variables(void) { free_g_string_array(&player_names); - free_g_array(&transfer_list); - free_option_list(&options, FALSE); free_option_list(&constants, FALSE); free_option_list(&constants_app, FALSE); free_g_string(&save_file); + g_rand_free(rand_generator); + free_season_stats(FALSE); } diff --git a/src/free.h b/src/free.h index 62bc7420..8e35fda8 100644 --- a/src/free.h +++ b/src/free.h @@ -84,4 +84,7 @@ free_league_stats(LeagueStat *stats); void free_season_stats(gboolean reset); +void +free_transfer_list(void); + #endif diff --git a/src/interface.c b/src/interface.c index c3cbee28..e631d97e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -734,7 +734,7 @@ create_main_window (void) gtk_widget_show (button_preview); gtk_box_pack_start (GTK_BOX (hbox1), button_preview, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (button_preview), 2); - gtk_tooltips_set_tip (tooltips, button_preview, _("Show my last games and a preview of my next games (F1)"), NULL); + gtk_tooltips_set_tip (tooltips, button_preview, _("Show a preview of my next games (F1)"), NULL); gtk_widget_add_accelerator (button_preview, "clicked", accel_group, GDK_F1, 0, GTK_ACCEL_VISIBLE); diff --git a/src/misc2_interface.c b/src/misc2_interface.c index 853b2090..0bdf94cf 100644 --- a/src/misc2_interface.c +++ b/src/misc2_interface.c @@ -247,6 +247,9 @@ create_window_job_offer (void) gtk_widget_show (label30); gtk_box_pack_start (GTK_BOX (hbox8), label30, FALSE, FALSE, 0); + g_signal_connect ((gpointer) window_job_offer, "delete_event", + G_CALLBACK (on_window_job_offer_delete_event), + NULL); g_signal_connect ((gpointer) button_ok, "clicked", G_CALLBACK (on_button_offer_ok_clicked), NULL); @@ -464,6 +467,9 @@ create_window_digits (void) GDK_Escape, 0, GTK_ACCEL_VISIBLE); + g_signal_connect ((gpointer) window_digits, "delete_event", + G_CALLBACK (on_window_digits_delete_event), + NULL); g_signal_connect ((gpointer) button_digits_ok, "clicked", G_CALLBACK (on_button_digits_ok_clicked), NULL); @@ -756,6 +762,9 @@ create_window_user_management (void) GtkWidget *label45; GtkWidget *hseparator9; GtkWidget *button_user_management_close; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); window_user_management = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window_user_management), 5); @@ -795,6 +804,7 @@ create_window_user_management (void) treeview_user_management_users = gtk_tree_view_new (); gtk_widget_show (treeview_user_management_users); gtk_container_add (GTK_CONTAINER (viewport1), treeview_user_management_users); + gtk_tooltips_set_tip (tooltips, treeview_user_management_users, _("Click on a user to remove him from the game."), NULL); vbox21 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox21); @@ -849,6 +859,9 @@ create_window_user_management (void) gtk_widget_show (button_user_management_close); gtk_box_pack_start (GTK_BOX (vbox19), button_user_management_close, FALSE, FALSE, 0); + g_signal_connect ((gpointer) window_user_management, "delete_event", + G_CALLBACK (on_window_user_management_delete_event), + NULL); g_signal_connect ((gpointer) treeview_user_management_users, "button_press_event", G_CALLBACK (on_treeview_user_management_users_button_press_event), NULL); @@ -888,6 +901,7 @@ create_window_user_management (void) GLADE_HOOKUP_OBJECT (window_user_management, label45, "label45"); GLADE_HOOKUP_OBJECT (window_user_management, hseparator9, "hseparator9"); GLADE_HOOKUP_OBJECT (window_user_management, button_user_management_close, "button_user_management_close"); + GLADE_HOOKUP_OBJECT_NO_REF (window_user_management, tooltips, "tooltips"); return window_user_management; } diff --git a/src/misc_callbacks.c b/src/misc_callbacks.c index 32455812..0193f565 100644 --- a/src/misc_callbacks.c +++ b/src/misc_callbacks.c @@ -319,4 +319,3 @@ on_combo_country_changed (GtkComboBox *combobox, misc_callback_show_team_list(GTK_WIDGET(combobox), buf); g_free(buf); } - diff --git a/src/misc_interface.c b/src/misc_interface.c index 070ed419..1b3b798f 100644 --- a/src/misc_interface.c +++ b/src/misc_interface.c @@ -310,6 +310,7 @@ create_window_startup (void) button_startup_resume = gtk_button_new (); gtk_widget_show (button_startup_resume); gtk_box_pack_start (GTK_BOX (vbox2), button_startup_resume, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, button_startup_resume, _("Load the last game that was saved or loaded."), NULL); alignment21 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment21); @@ -564,6 +565,9 @@ create_window_live (void) GtkObject *spinbutton_speed_adj; GtkWidget *spinbutton_speed; GtkAccelGroup *accel_group; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); accel_group = gtk_accel_group_new (); @@ -716,6 +720,7 @@ create_window_live (void) spinbutton_speed = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_speed_adj), 1, 0); gtk_widget_show (spinbutton_speed); gtk_box_pack_end (GTK_BOX (hbox48), spinbutton_speed, FALSE, TRUE, 0); + gtk_tooltips_set_tip (tooltips, spinbutton_speed, _("Change live game speed. The lower the value the faster the live game."), NULL); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_speed), TRUE); g_signal_connect ((gpointer) window_live, "delete_event", @@ -768,6 +773,7 @@ create_window_live (void) GLADE_HOOKUP_OBJECT (window_live, label73, "label73"); GLADE_HOOKUP_OBJECT (window_live, button_live_close, "button_live_close"); GLADE_HOOKUP_OBJECT (window_live, spinbutton_speed, "spinbutton_speed"); + GLADE_HOOKUP_OBJECT_NO_REF (window_live, tooltips, "tooltips"); gtk_window_add_accel_group (GTK_WINDOW (window_live), accel_group);