From cd652289d32a74ba924be394dd175575018fc8d2 Mon Sep 17 00:00:00 2001 From: gyboth Date: Mon, 24 Nov 2008 17:34:18 +0000 Subject: [PATCH] Added left click action in tables and fixtures view. --- ChangeLog | 7 +++++-- src/callback_func.c | 2 +- src/callbacks.c | 25 ++++++++++++++++++++++++- src/treeview.c | 4 ++-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62c3b06a..e46f4b3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,12 @@ 06/12/2008: v2.3.1 - updated Chinese translations - updated Romanian translation - - added Multiple tables for leagues feature + - added possibility for multiple tables in leagues (think + apertura/clausura in south america) - added joined leagues feature (think conferences in US sports) - - Solved some minor bugs + - solved some minor bugs + - added clicking in tables and fixtures mode (switches to the + other view, respectively) 06/11/2008: v2.3.0 - added flag for Montenegro (thanks to Mihai Floran) diff --git a/src/callback_func.c b/src/callback_func.c index aa4299ab..3bb99ba3 100644 --- a/src/callback_func.c +++ b/src/callback_func.c @@ -288,7 +288,7 @@ callback_show_tables(gint type) gint clid = -1; if(type == SHOW_CURRENT) - clid = team_get_table_clid(current_user.tm); + clid = stat1; else if(type == SHOW_NEXT_LEAGUE) clid = league_cup_get_next_clid(stat1, FALSE); else if(type == SHOW_PREVIOUS_LEAGUE) diff --git a/src/callbacks.c b/src/callbacks.c index 916387ee..a18ddfa1 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -401,6 +401,9 @@ void on_menu_fixtures_activate (GtkMenuItem *menuitem, gpointer user_data) { + game_gui_print_message( + _("Left click to show table.")); + stat0 = STATUS_SHOW_FIXTURES; callback_show_fixtures(SHOW_TEAM); @@ -430,7 +433,11 @@ on_menu_tables_activate (GtkMenuItem *menuitem, return; } + game_gui_print_message( + _("Left click to show fixtures.")); + stat0 = STATUS_SHOW_TABLES; + stat1 = team_get_table_clid(current_user.tm); callback_show_tables(SHOW_CURRENT); gui_set_arrows(); @@ -702,8 +709,24 @@ on_treeview_right_button_press_event (GtkWidget *widget, setsav0; } break; - } + case STATUS_SHOW_TABLES: + stat0 = STATUS_SHOW_FIXTURES; + stat2 = week; + stat3 = week_round; + callback_show_fixtures(SHOW_CURRENT); + break; + case STATUS_SHOW_FIXTURES: + if(stat1 >= ID_CUP_START && cup_has_tables(stat1) == -1) + game_gui_print_message(_("Cup has no tables.")); + else + { + stat0 = STATUS_SHOW_TABLES; + callback_show_tables(SHOW_CURRENT); + } + break; + } + gui_set_arrows(); return TRUE; diff --git a/src/treeview.c b/src/treeview.c index 52ab032a..9bb9c5ae 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -1041,7 +1041,7 @@ treeview_set_up_fixtures(GtkTreeView *treeview) GtkCellRenderer *renderer; gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview), - GTK_SELECTION_NONE); + GTK_SELECTION_SINGLE); gtk_tree_view_set_rules_hint(treeview, FALSE); gtk_tree_view_set_headers_visible(treeview, FALSE); @@ -1258,7 +1258,7 @@ treeview_set_up_table(GtkTreeView *treeview) _("PTS")}; gtk_tree_selection_set_mode(gtk_tree_view_get_selection(treeview), - GTK_SELECTION_NONE); + GTK_SELECTION_SINGLE); gtk_tree_view_set_rules_hint(treeview, FALSE); gtk_tree_view_set_headers_visible(treeview, TRUE);