1
1
mirror of https://github.com/tstellar/bygfoot.git synced 2025-02-15 02:50:46 +01:00

Prettier country selection box.

This commit is contained in:
gyboth 2005-05-07 14:19:52 +00:00
parent af4df838fc
commit d494cfca6a
14 changed files with 174 additions and 106 deletions

View File

@ -14,6 +14,11 @@
<property name="default_height">600</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_team_selection_cancel_clicked" last_modification_time="Wed, 12 May 2004 15:48:03 GMT"/>
<child>
@ -133,40 +138,14 @@
</child>
<child>
<widget class="GtkCombo" id="combo_country">
<widget class="GtkComboBoxEntry" id="combo_country">
<property name="visible">True</property>
<property name="value_in_list">False</property>
<property name="allow_empty">True</property>
<property name="case_sensitive">False</property>
<property name="enable_arrow_keys">True</property>
<property name="enable_arrows_always">False</property>
<child internal-child="entry">
<widget class="GtkEntry" id="combo_country_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="changed" handler="on_combo_country_entry_changed" last_modification_time="Thu, 09 Dec 2004 12:48:36 GMT"/>
</widget>
</child>
<child internal-child="list">
<widget class="GtkList" id="combo-list1">
<property name="visible">True</property>
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
</widget>
</child>
<signal name="changed" handler="on_combo_country_changed" last_modification_time="Sat, 07 May 2005 14:00:34 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
@ -215,6 +194,8 @@
<widget class="GtkEventBox" id="eventbox1">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Play normal league games and cups</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkHBox" id="hbox2">
@ -230,6 +211,7 @@
<property name="label" translatable="yes">Top league</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@ -249,6 +231,7 @@
<property name="label" translatable="yes">Current league</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@ -269,6 +252,7 @@
<property name="label" translatable="yes">Bottom league</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@ -356,6 +340,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_add_player_clicked" last_modification_time="Fri, 25 Feb 2005 16:22:19 GMT"/>
<child>
@ -365,6 +350,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox55">
@ -455,6 +444,7 @@
<property name="tooltip" translatable="yes">Space</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_team_selection_ok_clicked" last_modification_time="Fri, 25 Feb 2005 16:22:55 GMT"/>
<accelerator key="space" modifiers="0" signal="clicked"/>
@ -465,6 +455,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox53">
@ -528,6 +522,7 @@
<property name="tooltip" translatable="yes">Esc</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_team_selection_cancel_clicked" last_modification_time="Wed, 12 May 2004 15:44:37 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
@ -538,6 +533,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox5">
@ -601,6 +600,7 @@
<property name="tooltip" translatable="yes">Ctrl-O</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_team_selection_load_clicked" last_modification_time="Fri, 06 Feb 2004 17:05:28 GMT"/>
<accelerator key="o" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
@ -611,6 +611,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox6">
@ -679,6 +683,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_startup_resume_clicked" last_modification_time="Wed, 06 Apr 2005 10:52:45 GMT"/>
<child>
@ -688,6 +693,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox68">
@ -756,6 +765,11 @@
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="show_fileops">True</property>
<signal name="delete_event" handler="on_fsel_window_delete_event" last_modification_time="Fri, 06 Feb 2004 17:57:00 GMT"/>
@ -766,6 +780,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_fsel_cancel_clicked" last_modification_time="Fri, 06 Feb 2004 11:59:21 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
</widget>
@ -778,6 +793,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_fsel_ok_clicked" last_modification_time="Fri, 06 Feb 2004 11:59:35 GMT"/>
<accelerator key="Return" modifiers="0" signal="clicked"/>
</widget>
@ -793,6 +809,11 @@
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_button_font_sel_cancel_clicked" last_modification_time="Sat, 07 Feb 2004 16:24:38 GMT"/>
<child internal-child="cancel_button">
@ -801,6 +822,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_font_sel_cancel_clicked" last_modification_time="Sat, 07 Feb 2004 16:23:50 GMT"/>
</widget>
</child>
@ -811,6 +833,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_font_sel_apply_clicked" last_modification_time="Sat, 07 Feb 2004 16:22:16 GMT"/>
</widget>
</child>
@ -821,6 +844,7 @@
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_font_sel_ok_clicked" last_modification_time="Sat, 07 Feb 2004 16:22:11 GMT"/>
</widget>
</child>
@ -850,6 +874,11 @@
<property name="default_height">550</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_live_window_delete_event" last_modification_time="Fri, 18 Jun 2004 16:46:46 GMT"/>
<child>
@ -893,6 +922,8 @@
<child>
<widget class="GtkEventBox" id="eventbox_poss0">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkLabel" id="label78">
@ -947,6 +978,8 @@
<child>
<widget class="GtkEventBox" id="eventbox_poss1">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkLabel" id="label79">
@ -1128,6 +1161,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_pause_clicked" last_modification_time="Fri, 07 Jan 2005 13:35:11 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
@ -1138,6 +1172,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox51">
@ -1199,6 +1237,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_resume_clicked" last_modification_time="Sat, 08 Jan 2005 11:22:05 GMT"/>
<accelerator key="Return" modifiers="0" signal="clicked"/>
@ -1209,6 +1248,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox52">
@ -1273,6 +1316,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_live_close_clicked" last_modification_time="Sat, 08 Jan 2005 11:24:05 GMT"/>
</widget>
<packing>
@ -1324,6 +1368,11 @@
<property name="default_height">650</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox27">
@ -1345,6 +1394,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">True</property>
@ -1372,6 +1423,7 @@
<property name="tooltip" translatable="yes">Esc / Return / Space</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_help_close_clicked" last_modification_time="Wed, 11 Feb 2004 12:37:17 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
<accelerator key="Return" modifiers="0" signal="clicked"/>
@ -1384,6 +1436,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox40">
@ -1452,6 +1508,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_window_stadium_delete_event" last_modification_time="Sat, 09 Apr 2005 08:49:40 GMT"/>
<child>
@ -2121,6 +2182,7 @@
<property name="tooltip" translatable="yes">Return</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_stadium_ok_clicked" last_modification_time="Thu, 17 Mar 2005 13:26:43 GMT"/>
<accelerator key="Return" modifiers="0" signal="clicked"/>
@ -2131,6 +2193,10 @@
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox67">
@ -2195,6 +2261,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_stadium_cancel_clicked" last_modification_time="Thu, 17 Mar 2005 14:21:02 GMT"/>
<accelerator key="Escape" modifiers="0" signal="clicked"/>
</widget>

View File

@ -31,6 +31,7 @@ cup_new(gboolean new_id)
new.add_week = 0;
new.last_week = -1;
new.week_gap = 1;
new.yellow_red = 1000;
new.skill_diff = 0;
new.overall_teams = -1;
@ -75,7 +76,7 @@ cup_round_new(void)
new.replay = 0;
new.neutral = FALSE;
new.round_robin_number_of_groups = 0;
new.round_robin_number_of_advance = -1;
new.round_robin_number_of_advance = 1;
new.round_robin_number_of_best_advance = 0;
new.tables = g_array_new(FALSE, FALSE, sizeof(Table));
@ -137,12 +138,12 @@ cup_get_choose_team_league_cup(const CupChooseTeam *ct,
sscanf(ct->sid->str, "%[^0-9]%d", trash, &idx);
if(g_str_has_prefix(ct->sid->str, "league"))
if(g_str_has_prefix(ct->sid->str, "LEAGUE"))
{
*league = &lig(idx - 1);
*cup = NULL;
}
else if(g_str_has_prefix(ct->sid->str, "cup") && strlen(ct->sid->str) < 6)
else if(g_str_has_prefix(ct->sid->str, "CUP"))
{
*cup = &cp(idx - 1);
*league = NULL;

View File

@ -27,7 +27,7 @@ league_new(gboolean new_id)
new.id = (new_id) ? league_id_new : -1;
new.average_skill = -1;
new.average_skill = 7000;
new.prom_rel.prom_games_dest_sid = g_string_new("");
new.prom_rel.prom_games_loser_sid = g_string_new("");

View File

@ -184,20 +184,6 @@ on_button_help_close_clicked (GtkButton *button,
}
void
on_combo_country_entry_changed (GtkEditable *editable,
gpointer user_data)
{
GtkWidget *combo_country_entry =
lookup_widget(GTK_WIDGET(editable), "combo_country_entry");
const gchar *entry_text = gtk_entry_get_text(GTK_ENTRY(combo_country_entry));
if(strlen(entry_text) == 0)
return;
misc_callback_show_team_list(GTK_WIDGET(editable), entry_text);
}
void
on_button_pause_clicked (GtkButton *button,
gpointer user_data)
@ -310,3 +296,17 @@ on_window_stadium_delete_event (GtkWidget *widget,
return TRUE;
}
void
on_combo_country_changed (GtkComboBox *combobox,
gpointer user_data)
{
GtkTreeIter iter;
gchar *buf = NULL;
gtk_combo_box_get_active_iter(combobox, &iter);
gtk_tree_model_get(gtk_combo_box_get_model(combobox), &iter, 1, &buf, -1);
misc_callback_show_team_list(GTK_WIDGET(combobox), buf);
g_free(buf);
}

View File

@ -61,10 +61,6 @@ void
on_button_help_close_clicked (GtkButton *button,
gpointer user_data);
void
on_combo_country_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_button_pause_clicked (GtkButton *button,
gpointer user_data);
@ -117,9 +113,13 @@ on_spinbutton_capacity_button_press_event
void
on_button_startup_resume_clicked (GtkButton *button,
gpointer user_data);
#endif
gboolean
on_window_stadium_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
on_combo_country_changed (GtkComboBox *combobox,
gpointer user_data);
#endif

View File

@ -40,7 +40,6 @@ create_window_startup (void)
GtkWidget *vbox34;
GtkWidget *label69;
GtkWidget *combo_country;
GtkWidget *combo_country_entry;
GtkWidget *hseparator11;
GtkWidget *label4;
GtkWidget *eventbox1;
@ -137,17 +136,11 @@ create_window_startup (void)
label69 = gtk_label_new (_("Choose country"));
gtk_widget_show (label69);
gtk_box_pack_start (GTK_BOX (vbox34), label69, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label69), GTK_JUSTIFY_LEFT);
gtk_misc_set_padding (GTK_MISC (label69), 0, 5);
combo_country = gtk_combo_new ();
g_object_set_data (G_OBJECT (GTK_COMBO (combo_country)->popwin),
"GladeParentKey", combo_country);
combo_country = gtk_combo_box_entry_new ();
gtk_widget_show (combo_country);
gtk_box_pack_start (GTK_BOX (vbox34), combo_country, FALSE, FALSE, 0);
combo_country_entry = GTK_COMBO (combo_country)->entry;
gtk_widget_show (combo_country_entry);
gtk_box_pack_start (GTK_BOX (vbox34), combo_country, TRUE, TRUE, 0);
hseparator11 = gtk_hseparator_new ();
gtk_widget_show (hseparator11);
@ -157,7 +150,6 @@ create_window_startup (void)
label4 = gtk_label_new (_("Start in"));
gtk_widget_show (label4);
gtk_box_pack_start (GTK_BOX (vbox2), label4, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label4), 0.05, 0.5);
eventbox1 = gtk_event_box_new ();
@ -203,7 +195,6 @@ create_window_startup (void)
label75 = gtk_label_new (_("Player name"));
gtk_widget_show (label75);
gtk_box_pack_start (GTK_BOX (hbox54), label75, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label75), GTK_JUSTIFY_LEFT);
entry_player_name = gtk_entry_new ();
gtk_widget_show (entry_player_name);
@ -230,7 +221,6 @@ create_window_startup (void)
label76 = gtk_label_new_with_mnemonic (_("Add player"));
gtk_widget_show (label76);
gtk_box_pack_start (GTK_BOX (hbox55), label76, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label76), GTK_JUSTIFY_LEFT);
hseparator13 = gtk_hseparator_new ();
gtk_widget_show (hseparator13);
@ -266,7 +256,6 @@ create_window_startup (void)
label74 = gtk_label_new_with_mnemonic (_("Start"));
gtk_widget_show (label74);
gtk_box_pack_start (GTK_BOX (hbox53), label74, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label74), GTK_JUSTIFY_LEFT);
team_selection_cancel = gtk_button_new ();
gtk_widget_show (team_selection_cancel);
@ -292,7 +281,6 @@ create_window_startup (void)
label2 = gtk_label_new_with_mnemonic (_("Cancel"));
gtk_widget_show (label2);
gtk_box_pack_start (GTK_BOX (hbox5), label2, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
team_selection_load = gtk_button_new ();
gtk_widget_show (team_selection_load);
@ -318,7 +306,6 @@ create_window_startup (void)
label5 = gtk_label_new_with_mnemonic (_("Load game"));
gtk_widget_show (label5);
gtk_box_pack_start (GTK_BOX (hbox6), label5, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
button_startup_resume = gtk_button_new ();
gtk_widget_show (button_startup_resume);
@ -339,7 +326,6 @@ create_window_startup (void)
label108 = gtk_label_new_with_mnemonic (_("_Resume last game"));
gtk_widget_show (label108);
gtk_box_pack_start (GTK_BOX (hbox68), label108, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label108), GTK_JUSTIFY_LEFT);
g_signal_connect ((gpointer) window_startup, "delete_event",
G_CALLBACK (on_team_selection_cancel_clicked),
@ -350,8 +336,8 @@ create_window_startup (void)
g_signal_connect ((gpointer) treeview_startup, "row_activated",
G_CALLBACK (on_team_selection_tv_row_activated),
NULL);
g_signal_connect ((gpointer) combo_country_entry, "changed",
G_CALLBACK (on_combo_country_entry_changed),
g_signal_connect ((gpointer) combo_country, "changed",
G_CALLBACK (on_combo_country_changed),
NULL);
g_signal_connect ((gpointer) entry_player_name, "activate",
G_CALLBACK (on_entry_player_name_activate),
@ -384,7 +370,6 @@ create_window_startup (void)
GLADE_HOOKUP_OBJECT (window_startup, vbox34, "vbox34");
GLADE_HOOKUP_OBJECT (window_startup, label69, "label69");
GLADE_HOOKUP_OBJECT (window_startup, combo_country, "combo_country");
GLADE_HOOKUP_OBJECT (window_startup, combo_country_entry, "combo_country_entry");
GLADE_HOOKUP_OBJECT (window_startup, hseparator11, "hseparator11");
GLADE_HOOKUP_OBJECT (window_startup, label4, "label4");
GLADE_HOOKUP_OBJECT (window_startup, eventbox1, "eventbox1");
@ -448,6 +433,7 @@ create_window_file_sel (void)
gtk_container_set_border_width (GTK_CONTAINER (window_file_sel), 10);
gtk_window_set_position (GTK_WINDOW (window_file_sel), GTK_WIN_POS_CENTER);
gtk_window_set_modal (GTK_WINDOW (window_file_sel), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (window_file_sel), GDK_WINDOW_TYPE_HINT_DIALOG);
button_fsel_ok = GTK_FILE_SELECTION (window_file_sel)->ok_button;
gtk_widget_show (button_fsel_ok);
@ -499,6 +485,7 @@ create_window_font_sel (void)
gtk_container_set_border_width (GTK_CONTAINER (window_font_sel), 5);
gtk_window_set_position (GTK_WINDOW (window_font_sel), GTK_WIN_POS_CENTER);
gtk_window_set_modal (GTK_WINDOW (window_font_sel), TRUE);
gtk_window_set_type_hint (GTK_WINDOW (window_font_sel), GDK_WINDOW_TYPE_HINT_DIALOG);
button_font_sel_ok = GTK_FONT_SELECTION_DIALOG (window_font_sel)->ok_button;
gtk_widget_show (button_font_sel_ok);
@ -613,7 +600,6 @@ create_window_live (void)
label78 = gtk_label_new (_(" "));
gtk_widget_show (label78);
gtk_container_add (GTK_CONTAINER (eventbox_poss0), label78);
gtk_label_set_justify (GTK_LABEL (label78), GTK_JUSTIFY_LEFT);
scrolledwindow8 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow8);
@ -633,7 +619,6 @@ create_window_live (void)
label79 = gtk_label_new (_(" "));
gtk_widget_show (label79);
gtk_container_add (GTK_CONTAINER (eventbox_poss1), label79);
gtk_label_set_justify (GTK_LABEL (label79), GTK_JUSTIFY_LEFT);
hscale_area = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (5, 0, 10, 0, 0, 0)));
gtk_widget_show (hscale_area);
@ -657,7 +642,6 @@ create_window_live (void)
label80 = gtk_label_new (_("Commentary"));
gtk_widget_show (label80);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label80);
gtk_label_set_justify (GTK_LABEL (label80), GTK_JUSTIFY_LEFT);
scrolledwindow11 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow11);
@ -672,7 +656,6 @@ create_window_live (void)
label81 = gtk_label_new (_("Statistics"));
gtk_widget_show (label81);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label81);
gtk_label_set_justify (GTK_LABEL (label81), GTK_JUSTIFY_LEFT);
hbox48 = gtk_hbox_new (FALSE, 4);
gtk_widget_show (hbox48);
@ -700,7 +683,6 @@ create_window_live (void)
label72 = gtk_label_new_with_mnemonic (_("_Pause"));
gtk_widget_show (label72);
gtk_box_pack_start (GTK_BOX (hbox51), label72, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label72), GTK_JUSTIFY_LEFT);
button_resume = gtk_button_new ();
gtk_widget_show (button_resume);
@ -724,7 +706,6 @@ create_window_live (void)
label73 = gtk_label_new_with_mnemonic (_("_Resume"));
gtk_widget_show (label73);
gtk_box_pack_start (GTK_BOX (hbox52), label73, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label73), GTK_JUSTIFY_LEFT);
button_live_close = gtk_button_new_from_stock ("gtk-close");
gtk_widget_show (button_live_close);
@ -864,7 +845,6 @@ create_help_window (void)
label59 = gtk_label_new_with_mnemonic (_("Close"));
gtk_widget_show (label59);
gtk_box_pack_start (GTK_BOX (hbox40), label59, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label59), GTK_JUSTIFY_LEFT);
g_signal_connect ((gpointer) button_help_close, "clicked",
G_CALLBACK (on_button_help_close_clicked),
@ -961,7 +941,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label106, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label106), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label106), 0, 0.5);
label_stadium_status = gtk_label_new (_("label107"));
@ -969,7 +948,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label_stadium_status, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label_stadium_status), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label_stadium_status), 0, 0.5);
label101 = gtk_label_new (_("Current capacity:"));
@ -977,7 +955,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label101, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label101), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label101), 0, 0.5);
hbox69 = gtk_hbox_new (FALSE, 0);
@ -989,20 +966,17 @@ create_window_stadium (void)
label_capacity = gtk_label_new (_("label104"));
gtk_widget_show (label_capacity);
gtk_box_pack_start (GTK_BOX (hbox69), label_capacity, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_capacity), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label_capacity), 0, 0.5);
label102 = gtk_label_new (_(" seats"));
gtk_widget_show (label102);
gtk_box_pack_start (GTK_BOX (hbox69), label102, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label102), GTK_JUSTIFY_LEFT);
label103 = gtk_label_new (_("Current safety: "));
gtk_widget_show (label103);
gtk_table_attach (GTK_TABLE (table1), label103, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label103), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label103), 0, 0.5);
progressbar_safety = gtk_progress_bar_new ();
@ -1016,7 +990,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label109, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label109), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label109), 0, 0.5);
label_average_attendance = gtk_label_new (_("label110"));
@ -1024,7 +997,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label_average_attendance, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label_average_attendance), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label_average_attendance), 0, 0.5);
label111 = gtk_label_new (_("Average attendance % "));
@ -1032,7 +1004,6 @@ create_window_stadium (void)
gtk_table_attach (GTK_TABLE (table1), label111, 0, 1, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label111), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label111), 0, 0.5);
progressbar_average_attendance = gtk_progress_bar_new ();
@ -1053,7 +1024,6 @@ create_window_stadium (void)
label90 = gtk_label_new (_("Increase"));
gtk_widget_show (label90);
gtk_box_pack_start (GTK_BOX (vbox43), label90, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label90), GTK_JUSTIFY_LEFT);
hbox61 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox61);
@ -1066,7 +1036,6 @@ create_window_stadium (void)
label91 = gtk_label_new (_("Capacity (seats)"));
gtk_widget_show (label91);
gtk_box_pack_start (GTK_BOX (vbox44), label91, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label91), GTK_JUSTIFY_LEFT);
spinbutton_capacity_adj = gtk_adjustment_new (0, 0, 10000, 1, 100, 10);
spinbutton_capacity = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_capacity_adj), 1, 0);
@ -1081,22 +1050,18 @@ create_window_stadium (void)
label93 = gtk_label_new (_("Costs"));
gtk_widget_show (label93);
gtk_box_pack_start (GTK_BOX (vbox46), label93, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label93), GTK_JUSTIFY_LEFT);
label_costs_capacity = gtk_label_new (_("0"));
gtk_widget_show (label_costs_capacity);
gtk_box_pack_start (GTK_BOX (vbox46), label_costs_capacity, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_costs_capacity), GTK_JUSTIFY_LEFT);
label95 = gtk_label_new (_("Expected duration"));
gtk_widget_show (label95);
gtk_box_pack_start (GTK_BOX (vbox46), label95, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label95), GTK_JUSTIFY_LEFT);
label_duration_capacity = gtk_label_new (_("0"));
gtk_widget_show (label_duration_capacity);
gtk_box_pack_start (GTK_BOX (vbox46), label_duration_capacity, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_duration_capacity), GTK_JUSTIFY_LEFT);
vbox45 = gtk_vbox_new (FALSE, 3);
gtk_widget_show (vbox45);
@ -1105,7 +1070,6 @@ create_window_stadium (void)
label92 = gtk_label_new (_("Safety (%)"));
gtk_widget_show (label92);
gtk_box_pack_start (GTK_BOX (vbox45), label92, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label92), GTK_JUSTIFY_LEFT);
spinbutton_safety_adj = gtk_adjustment_new (0, 0, 100, 1, 5, 10);
spinbutton_safety = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_safety_adj), 1, 0);
@ -1120,22 +1084,18 @@ create_window_stadium (void)
label94 = gtk_label_new (_("Costs"));
gtk_widget_show (label94);
gtk_box_pack_start (GTK_BOX (vbox47), label94, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label94), GTK_JUSTIFY_LEFT);
label_costs_safety = gtk_label_new (_("0"));
gtk_widget_show (label_costs_safety);
gtk_box_pack_start (GTK_BOX (vbox47), label_costs_safety, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_costs_safety), GTK_JUSTIFY_LEFT);
label96 = gtk_label_new (_("Expected duration"));
gtk_widget_show (label96);
gtk_box_pack_start (GTK_BOX (vbox47), label96, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label96), GTK_JUSTIFY_LEFT);
label_duration_safety = gtk_label_new (_("0"));
gtk_widget_show (label_duration_safety);
gtk_box_pack_start (GTK_BOX (vbox47), label_duration_safety, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label_duration_safety), GTK_JUSTIFY_LEFT);
hseparator15 = gtk_hseparator_new ();
gtk_widget_show (hseparator15);
@ -1165,7 +1125,6 @@ create_window_stadium (void)
label107 = gtk_label_new_with_mnemonic (_("Improve!"));
gtk_widget_show (label107);
gtk_box_pack_start (GTK_BOX (hbox67), label107, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label107), GTK_JUSTIFY_LEFT);
button_stadium_cancel = gtk_button_new_from_stock ("gtk-close");
gtk_widget_show (button_stadium_cancel);

View File

@ -2238,3 +2238,28 @@ treeview_show_season_history(gint page, gint season_number)
gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(model));
g_object_unref(model);
}
/** Create the model for the startup country files combo.
@param country_list The list of country files found. */
GtkTreeModel*
treeview_create_country_list(const GPtrArray *country_list)
{
gint i;
GtkListStore *ls = gtk_list_store_new(2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
GtkTreeIter iter;
gchar buf[SMALL], buf2[SMALL], trash[SMALL];
for(i=0;i<country_list->len;i++)
{
sscanf(((GString*)g_ptr_array_index(country_list, i))->str, "country_%[^.]%[.xml]",
buf2, trash);
sprintf(buf, "flag_%s.png", buf2);
gtk_list_store_append(ls, &iter);
treeview_helper_insert_icon(ls, &iter, 0, buf);
gtk_list_store_set(ls, &iter, 1,
((GString*)g_ptr_array_index(country_list, i))->str, -1);
}
return GTK_TREE_MODEL(ls);
}

View File

@ -199,4 +199,7 @@ void
treeview_create_season_history_champions(GtkListStore *ls, const GArray* league_champs,
const GArray *cup_champs);
GtkTreeModel*
treeview_create_country_list(const GPtrArray *country_list);
#endif

View File

@ -11,6 +11,8 @@
#include "option_gui.h"
#include "options_interface.h"
#include "support.h"
#include "treeview.h"
#include "treeview_helper.h"
#include "user.h"
#include "window.h"
@ -26,19 +28,30 @@ window_show_startup(void)
GtkWidget *combo_country =
lookup_widget(window_startup, "combo_country");
GPtrArray *country_files = NULL;
GList *combo_strings = NULL;
gint i;
GtkTreeModel *model = NULL;
GtkCellRenderer *renderer = NULL;
country_files = file_get_country_files();
if(country_files->len == 0)
main_exit_program(EXIT_NO_COUNTRY_FILES, "Didn't find any country definition files in the support directories.");
for(i=0;i<country_files->len;i++)
combo_strings = g_list_append(combo_strings,
((GString*)g_ptr_array_index(country_files, i))->str);
model = treeview_create_country_list(country_files);
gtk_combo_box_set_model(GTK_COMBO_BOX(combo_country), model);
g_object_unref(model);
gtk_combo_set_popdown_strings(GTK_COMBO(combo_country), combo_strings);
gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY(combo_country), 1);
gtk_cell_layout_clear(GTK_CELL_LAYOUT(combo_country));
renderer = gtk_cell_renderer_pixbuf_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_country), renderer, FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_country), renderer, "pixbuf", 0, NULL);
renderer = treeview_helper_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_country), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_country), renderer, "text", 1, NULL);
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_country), 0);
free_g_string_array(&country_files);
}

View File

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

View File

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 150 B

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B