mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-01-28 14:39:22 +01:00
"Progressbar pics."
This commit is contained in:
parent
2e9476b04c
commit
534684b3c3
@ -7,6 +7,10 @@
|
||||
- added definition for the World Cup 2006 Germany
|
||||
- minor definition system improvements
|
||||
- boost costs money
|
||||
- reworked the Brazilian definition, making it more like it is in
|
||||
reality
|
||||
- added some nice pictures to the progress bar shown when
|
||||
calculating results or loading/saving games
|
||||
|
||||
|
||||
09/10/2005: v1.9.1
|
||||
|
File diff suppressed because one or more lines are too long
@ -629,22 +629,52 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes"></property>
|
||||
<property name="type">GTK_WINDOW_POPUP</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
|
||||
<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_NORMAL</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_SPLASHSCREEN</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkProgressBar" id="progressbar">
|
||||
<widget class="GtkVBox" id="vbox28">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
|
||||
<property name="fraction">0</property>
|
||||
<property name="pulse_step">0.10000000149</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image_match">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkProgressBar" id="progressbar">
|
||||
<property name="width_request">200</property>
|
||||
<property name="height_request">20</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
|
||||
<property name="fraction">0</property>
|
||||
<property name="pulse_step">0.10000000149</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -107,6 +107,19 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHSeparator" id="hseparator5">
|
||||
<property name="width_request">1</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton_maximize">
|
||||
<property name="visible">True</property>
|
||||
@ -147,6 +160,39 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton_show_progress_pics">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Whether to show pictures on top of the progressbar when loading/saving or calculating results</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Show progressbar pictures</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>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHSeparator" id="hseparator6">
|
||||
<property name="width_request">1</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton_skip">
|
||||
<property name="visible">True</property>
|
||||
|
20
src/file.c
20
src/file.c
@ -527,6 +527,26 @@ file_get_first_support_dir(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Return the first support directory which has the given suffix.*/
|
||||
const gchar*
|
||||
file_get_first_support_dir_suffix(const gchar *suffix)
|
||||
{
|
||||
GList *elem = support_directories;
|
||||
|
||||
while (elem)
|
||||
{
|
||||
if(g_str_has_suffix((gchar*)elem->data, suffix))
|
||||
return (const gchar*)elem->data;
|
||||
|
||||
elem = elem->next;
|
||||
}
|
||||
|
||||
g_warning("file_get_first_support_dir_suffix: no dir with suffix %s found.",
|
||||
suffix);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Compress the files starting with the prefix.
|
||||
@param destfile The name of the file to create. */
|
||||
void
|
||||
|
@ -82,6 +82,9 @@ file_my_system(const gchar *command);
|
||||
const gchar*
|
||||
file_get_first_support_dir(void);
|
||||
|
||||
const gchar*
|
||||
file_get_first_support_dir_suffix(const gchar *suffix);
|
||||
|
||||
void
|
||||
file_compress_files(const gchar *destfile, const gchar *prefix);
|
||||
|
||||
|
@ -56,9 +56,10 @@ gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append)
|
||||
/* Show a window with a progress bar.
|
||||
@param value The value of the progress bar. If set to 1
|
||||
or < 0 the progress bar window gets destroyed.
|
||||
@param text The text to show in the progress bar. */
|
||||
@param text The text to show in the progress bar.
|
||||
@param pictype What kind of picture to show above the progress bar. */
|
||||
void
|
||||
gui_show_progress(gfloat value, gchar *text)
|
||||
gui_show_progress(gfloat value, const gchar *text, gint pictype)
|
||||
{
|
||||
GtkProgressBar *progressbar = NULL;
|
||||
|
||||
@ -69,7 +70,8 @@ gui_show_progress(gfloat value, gchar *text)
|
||||
}
|
||||
|
||||
if(window.progress == NULL)
|
||||
window_create(WINDOW_PROGRESS);
|
||||
window_show_progress(pictype);
|
||||
|
||||
progressbar = GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"));
|
||||
|
||||
if(value >= 0 && value < 1)
|
||||
|
11
src/gui.h
11
src/gui.h
@ -26,11 +26,20 @@
|
||||
|
||||
#include "bygfoot.h"
|
||||
|
||||
/** What kind of pictures we on top of the progress bar. */
|
||||
enum PicType
|
||||
{
|
||||
PIC_TYPE_NONE = 0,
|
||||
PIC_TYPE_SAVE,
|
||||
PIC_TYPE_LOAD,
|
||||
PIC_TYPE_MATCHPIC
|
||||
};
|
||||
|
||||
void
|
||||
gui_label_set_text_from_int(GtkLabel *label, gint number, gboolean append);
|
||||
|
||||
void
|
||||
gui_show_progress(gfloat value, gchar *text);
|
||||
gui_show_progress(gfloat value, const gchar *text, gint pictype);
|
||||
|
||||
void
|
||||
gui_set_arrow_pair(gint pair, gboolean state);
|
||||
|
@ -130,9 +130,9 @@ language_compare_country_files(gconstpointer a, gconstpointer b, gpointer data)
|
||||
|
||||
if(strcmp(def1, def2) == 0)
|
||||
return_value = 0;
|
||||
else if(strcmp(prefdef, def1) == 0)
|
||||
else if(prefdef != NULL && strcmp(prefdef, def1) == 0)
|
||||
return_value = -1;
|
||||
else if(strcmp(prefdef, def2) == 0)
|
||||
else if(prefdef != NULL && strcmp(prefdef, def2) == 0)
|
||||
return_value = 1;
|
||||
else
|
||||
{
|
||||
@ -176,6 +176,9 @@ language_pick_country(GPtrArray *country_files)
|
||||
gpointer prefdef = NULL;
|
||||
const gchar *lang = g_getenv("LANG");
|
||||
|
||||
if(lang == NULL)
|
||||
lang = g_getenv("LC_ALL");
|
||||
|
||||
if(lang != NULL)
|
||||
for(i=0;i<codes->len;i++)
|
||||
{
|
||||
|
@ -65,7 +65,8 @@ load_save_save_game(const gchar *filename)
|
||||
if(debug > 60)
|
||||
printf("load_save_save options\n");
|
||||
|
||||
gui_show_progress(0, _("Saving options..."));
|
||||
gui_show_progress(0, _("Saving options..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
sprintf(buf, "%s___options", prefix);
|
||||
file_save_opt_file(buf, &options);
|
||||
@ -78,7 +79,8 @@ load_save_save_game(const gchar *filename)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Saving leagues and cups..."));
|
||||
_("Saving leagues and cups..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
xml_loadsave_leagues_cups_write(prefix);
|
||||
|
||||
@ -88,7 +90,8 @@ load_save_save_game(const gchar *filename)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Saving users..."));
|
||||
_("Saving users..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
xml_loadsave_users_write(prefix);
|
||||
|
||||
@ -98,7 +101,8 @@ load_save_save_game(const gchar *filename)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Saving transfer list..."));
|
||||
_("Saving transfer list..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
xml_loadsave_transfers_write(prefix);
|
||||
|
||||
@ -108,7 +112,8 @@ load_save_save_game(const gchar *filename)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Saving season stats..."));
|
||||
_("Saving season stats..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
xml_loadsave_season_stats_write(prefix);
|
||||
|
||||
@ -118,14 +123,16 @@ load_save_save_game(const gchar *filename)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Saving miscellaneous..."));
|
||||
_("Saving miscellaneous..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
xml_loadsave_misc_write(prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Compressing savegame..."));
|
||||
_("Compressing savegame..."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
sprintf(buf, "%s___", prefix);
|
||||
file_compress_files(fullname, buf);
|
||||
@ -133,14 +140,16 @@ load_save_save_game(const gchar *filename)
|
||||
if(debug > 60)
|
||||
printf("load_save_save done \n");
|
||||
|
||||
gui_show_progress(1, _("Done."));
|
||||
gui_show_progress(1, _("Done."),
|
||||
PIC_TYPE_SAVE);
|
||||
|
||||
load_save_last_save_set(fullname);
|
||||
|
||||
g_free(prefix);
|
||||
g_free(fullname);
|
||||
|
||||
gui_show_progress(-1, "");
|
||||
gui_show_progress(-1, "",
|
||||
PIC_TYPE_SAVE);
|
||||
setsav1;
|
||||
}
|
||||
|
||||
@ -184,7 +193,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
if(window.main != NULL)
|
||||
gtk_widget_hide(window.main);
|
||||
|
||||
gui_show_progress(0, _("Uncompressing savegame..."));
|
||||
gui_show_progress(0, _("Uncompressing savegame..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
file_decompress(fullname);
|
||||
|
||||
@ -194,7 +204,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading options..."));
|
||||
_("Loading options..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
sprintf(buf, "%s%s%s___options", dirname, G_DIR_SEPARATOR_S, prefix);
|
||||
file_load_opt_file(buf, &options);
|
||||
@ -208,7 +219,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading leagues and cups..."));
|
||||
_("Loading leagues and cups..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
xml_loadsave_leagues_cups_read(dirname, prefix);
|
||||
|
||||
@ -218,7 +230,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading users..."));
|
||||
_("Loading users..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
xml_load_users(dirname, prefix);
|
||||
|
||||
@ -228,7 +241,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading transfer list..."));
|
||||
_("Loading transfer list..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
xml_load_transfers(dirname, prefix);
|
||||
|
||||
@ -238,7 +252,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading season stats..."));
|
||||
_("Loading season stats..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
xml_loadsave_season_stats_read(dirname, prefix);
|
||||
|
||||
@ -248,14 +263,16 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
_("Loading miscellaneous..."));
|
||||
_("Loading miscellaneous..."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
xml_loadsave_misc_read(dirname, prefix);
|
||||
|
||||
if(debug > 60)
|
||||
printf("load_save_load done \n");
|
||||
|
||||
gui_show_progress(1, _("Done."));
|
||||
gui_show_progress(1, _("Done."),
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
sprintf(buf, "%s%s%s___*", dirname, G_DIR_SEPARATOR_S, prefix);
|
||||
file_remove_files(buf);
|
||||
@ -264,7 +281,8 @@ load_save_load_game(const gchar* filename, gboolean create_main_window)
|
||||
|
||||
load_save_last_save_set(fullname);
|
||||
|
||||
gui_show_progress(-1, "");
|
||||
gui_show_progress(-1, "",
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
if(create_main_window)
|
||||
{
|
||||
|
@ -282,18 +282,32 @@ GtkWidget*
|
||||
create_window_progress (void)
|
||||
{
|
||||
GtkWidget *window_progress;
|
||||
GtkWidget *vbox28;
|
||||
GtkWidget *image_match;
|
||||
GtkWidget *progressbar;
|
||||
|
||||
window_progress = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_position (GTK_WINDOW (window_progress), GTK_WIN_POS_CENTER);
|
||||
gtk_window_set_position (GTK_WINDOW (window_progress), GTK_WIN_POS_CENTER_ALWAYS);
|
||||
gtk_window_set_modal (GTK_WINDOW (window_progress), TRUE);
|
||||
gtk_window_set_type_hint (GTK_WINDOW (window_progress), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
|
||||
|
||||
vbox28 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox28);
|
||||
gtk_container_add (GTK_CONTAINER (window_progress), vbox28);
|
||||
|
||||
image_match = create_pixmap (window_progress, NULL);
|
||||
gtk_widget_show (image_match);
|
||||
gtk_box_pack_start (GTK_BOX (vbox28), image_match, FALSE, FALSE, 0);
|
||||
|
||||
progressbar = gtk_progress_bar_new ();
|
||||
gtk_widget_show (progressbar);
|
||||
gtk_container_add (GTK_CONTAINER (window_progress), progressbar);
|
||||
gtk_box_pack_start (GTK_BOX (vbox28), progressbar, FALSE, FALSE, 0);
|
||||
gtk_widget_set_size_request (progressbar, 200, 20);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (window_progress, window_progress, "window_progress");
|
||||
GLADE_HOOKUP_OBJECT (window_progress, vbox28, "vbox28");
|
||||
GLADE_HOOKUP_OBJECT (window_progress, image_match, "image_match");
|
||||
GLADE_HOOKUP_OBJECT (window_progress, progressbar, "progressbar");
|
||||
|
||||
return window_progress;
|
||||
|
@ -41,6 +41,7 @@ enum BooleanOptions
|
||||
BOOL_OPT_SAVE_OVERWRITE,
|
||||
BOOL_OPT_MAXIMIZE,
|
||||
BOOL_OPT_PREFER_MESS,
|
||||
BOOL_OPT_PROGRESSBAR_PICS,
|
||||
BOOL_OPT_SKIP,
|
||||
BOOL_OPT_AUTOSAVE,
|
||||
BOOL_OPT_SHOW_LIVE,
|
||||
@ -122,6 +123,11 @@ option_gui_write_bool_widgets(gint **bool_options, GtkToggleButton **bool_widget
|
||||
GTK_TOGGLE_BUTTON(lookup_widget(window.options, "checkbutton_pref_mess"));
|
||||
bool_options[BOOL_OPT_PREFER_MESS] = opt_intp("int_opt_prefer_messages");
|
||||
|
||||
bool_widgets[BOOL_OPT_PROGRESSBAR_PICS] =
|
||||
GTK_TOGGLE_BUTTON(lookup_widget(window.options,
|
||||
"checkbutton_show_progress_pics"));
|
||||
bool_options[BOOL_OPT_PROGRESSBAR_PICS] = opt_intp("int_opt_progressbar_pics");
|
||||
|
||||
bool_widgets[BOOL_OPT_SKIP] =
|
||||
GTK_TOGGLE_BUTTON(lookup_widget(window.options, "checkbutton_skip"));
|
||||
bool_options[BOOL_OPT_SKIP] = opt_intp("int_opt_skip");
|
||||
|
@ -37,8 +37,11 @@ create_window_options (void)
|
||||
GtkWidget *checkbutton_conf_quit;
|
||||
GtkWidget *checkbutton_conf_unfit;
|
||||
GtkWidget *checkbutton_save_overwrite;
|
||||
GtkWidget *hseparator5;
|
||||
GtkWidget *checkbutton_maximize;
|
||||
GtkWidget *checkbutton_pref_mess;
|
||||
GtkWidget *checkbutton_show_progress_pics;
|
||||
GtkWidget *hseparator6;
|
||||
GtkWidget *checkbutton_skip;
|
||||
GtkWidget *vseparator1;
|
||||
GtkWidget *table1;
|
||||
@ -231,6 +234,11 @@ create_window_options (void)
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton_save_overwrite, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, checkbutton_save_overwrite, _("Whether 'Save' overwrites the current save file or pops up a 'Save as' window"), NULL);
|
||||
|
||||
hseparator5 = gtk_hseparator_new ();
|
||||
gtk_widget_show (hseparator5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), hseparator5, FALSE, FALSE, 0);
|
||||
gtk_widget_set_size_request (hseparator5, 1, 10);
|
||||
|
||||
checkbutton_maximize = gtk_check_button_new_with_mnemonic (_("Maximize main window"));
|
||||
gtk_widget_show (checkbutton_maximize);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton_maximize, FALSE, FALSE, 0);
|
||||
@ -241,6 +249,16 @@ create_window_options (void)
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton_pref_mess, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, checkbutton_pref_mess, _("Whether to show warnings and such in the message area in the main window when possible"), NULL);
|
||||
|
||||
checkbutton_show_progress_pics = gtk_check_button_new_with_mnemonic (_("Show progressbar pictures"));
|
||||
gtk_widget_show (checkbutton_show_progress_pics);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton_show_progress_pics, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, checkbutton_show_progress_pics, _("Whether to show pictures on top of the progressbar when loading/saving or calculating results"), NULL);
|
||||
|
||||
hseparator6 = gtk_hseparator_new ();
|
||||
gtk_widget_show (hseparator6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), hseparator6, FALSE, FALSE, 0);
|
||||
gtk_widget_set_size_request (hseparator6, 1, 10);
|
||||
|
||||
checkbutton_skip = gtk_check_button_new_with_mnemonic (_("Skip weeks without user matches"));
|
||||
gtk_widget_show (checkbutton_skip);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton_skip, FALSE, FALSE, 0);
|
||||
@ -1069,8 +1087,11 @@ create_window_options (void)
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_conf_quit, "checkbutton_conf_quit");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_conf_unfit, "checkbutton_conf_unfit");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_save_overwrite, "checkbutton_save_overwrite");
|
||||
GLADE_HOOKUP_OBJECT (window_options, hseparator5, "hseparator5");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_maximize, "checkbutton_maximize");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_pref_mess, "checkbutton_pref_mess");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_show_progress_pics, "checkbutton_show_progress_pics");
|
||||
GLADE_HOOKUP_OBJECT (window_options, hseparator6, "hseparator6");
|
||||
GLADE_HOOKUP_OBJECT (window_options, checkbutton_skip, "checkbutton_skip");
|
||||
GLADE_HOOKUP_OBJECT (window_options, vseparator1, "vseparator1");
|
||||
GLADE_HOOKUP_OBJECT (window_options, table1, "table1");
|
||||
|
@ -265,6 +265,7 @@ end_week_round_results(void)
|
||||
(gfloat)fixture_get_number_of_matches(week, week_round);
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
{
|
||||
for(j=0;j<lig(i).fixtures->len;j++)
|
||||
if(g_array_index(lig(i).fixtures, Fixture, j).week_number == week &&
|
||||
g_array_index(lig(i).fixtures, Fixture, j).week_round_number == week_round &&
|
||||
@ -278,10 +279,13 @@ end_week_round_results(void)
|
||||
g_array_index(lig(i).fixtures, Fixture, j).teams[0]->name,
|
||||
buf,
|
||||
g_array_index(lig(i).fixtures, Fixture, j).teams[1]->name);
|
||||
gui_show_progress((gfloat)done / num_matches, buf2);
|
||||
gui_show_progress((gfloat)done / num_matches, buf2,
|
||||
PIC_TYPE_MATCHPIC);
|
||||
|
||||
if(debug > 120)
|
||||
printf("%s \n", buf2);
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<acps->len;i++)
|
||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||
@ -298,13 +302,14 @@ end_week_round_results(void)
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[0]->name,
|
||||
buf,
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[1]->name);
|
||||
gui_show_progress((gfloat)done / num_matches, buf2);
|
||||
gui_show_progress((gfloat)done / num_matches, buf2,
|
||||
PIC_TYPE_MATCHPIC);
|
||||
if(debug > 120)
|
||||
printf("%s \n", buf2);
|
||||
}
|
||||
}
|
||||
|
||||
gui_show_progress(-1, "");
|
||||
gui_show_progress(-1, "", PIC_TYPE_MATCHPIC);
|
||||
}
|
||||
|
||||
/** Sort league and cup tables. */
|
||||
|
@ -105,7 +105,8 @@ strategy_compare_players(gconstpointer a,
|
||||
/** Check whether a lineup described in the prematch using the given
|
||||
formation can be made with the players. */
|
||||
gboolean
|
||||
query_strategy_formation_possible(const GPtrArray *players, const StrategyPrematch *prematch,
|
||||
query_strategy_formation_possible(const GPtrArray *players,
|
||||
const StrategyPrematch *prematch,
|
||||
gint formation)
|
||||
{
|
||||
gint i, pos[3] = {0, 0, 0};
|
||||
@ -557,7 +558,8 @@ strategy_live_game_apply_action(LiveGame *match, gint team_idx,
|
||||
tm->style + 2);
|
||||
}
|
||||
|
||||
if(action->boost != -100 && tm->boost != action->boost)
|
||||
if((action->boost != -100 && tm->boost != action->boost) &&
|
||||
(action->boost != 1 || !sett_int("int_opt_disable_boost_on")))
|
||||
{
|
||||
tm->boost = action->boost;
|
||||
live_game_event_team_change(team_idx,
|
||||
|
54
src/window.c
54
src/window.c
@ -33,6 +33,7 @@
|
||||
#include "live_game.h"
|
||||
#include "load_save.h"
|
||||
#include "main.h"
|
||||
#include "maths.h"
|
||||
#include "misc_callback_func.h"
|
||||
#include "misc_interface.h"
|
||||
#include "misc2_interface.h"
|
||||
@ -65,6 +66,59 @@
|
||||
/* _("News")); */
|
||||
/* } */
|
||||
|
||||
/** Show the window with the progress bar,
|
||||
sometimes with a nice picture. */
|
||||
void
|
||||
window_show_progress(gint pictype)
|
||||
{
|
||||
GPtrArray *pics = NULL;
|
||||
const gchar *picdir = NULL;
|
||||
gchar buf[SMALL];
|
||||
GtkImage *image = NULL;
|
||||
|
||||
window_create(WINDOW_PROGRESS);
|
||||
|
||||
if(pictype == PIC_TYPE_NONE ||
|
||||
!opt_int("int_opt_progressbar_pics"))
|
||||
return;
|
||||
|
||||
image = GTK_IMAGE(lookup_widget(window.progress,
|
||||
"image_match"));
|
||||
|
||||
switch(pictype)
|
||||
{
|
||||
default:
|
||||
g_warning("window_show_progress: unknown picture type %d",
|
||||
pictype);
|
||||
break;
|
||||
case PIC_TYPE_SAVE:
|
||||
gtk_image_set_from_stock(image, GTK_STOCK_FLOPPY,
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
break;
|
||||
case PIC_TYPE_LOAD:
|
||||
gtk_image_set_from_stock(image, GTK_STOCK_OPEN,
|
||||
GTK_ICON_SIZE_DIALOG);
|
||||
break;
|
||||
case PIC_TYPE_MATCHPIC:
|
||||
picdir = file_get_first_support_dir_suffix("pics");
|
||||
|
||||
if(picdir == NULL)
|
||||
return;
|
||||
|
||||
pics = file_dir_get_contents(picdir, "match", "");
|
||||
|
||||
if(pics->len != 0)
|
||||
{
|
||||
sprintf(buf, "%s%s%s", picdir, G_DIR_SEPARATOR_S,
|
||||
(gchar*)g_ptr_array_index(pics, math_rndi(0, pics->len - 1)));
|
||||
gtk_image_set_from_file(image, buf);
|
||||
}
|
||||
|
||||
free_gchar_array(&pics);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Show the betting window. */
|
||||
void
|
||||
window_show_bets(void)
|
||||
|
@ -108,4 +108,7 @@ window_main_load_geometry(void);
|
||||
void
|
||||
window_show_bets(void);
|
||||
|
||||
void
|
||||
window_show_progress(gint pictype);
|
||||
|
||||
#endif
|
||||
|
@ -80,7 +80,8 @@ xml_load_league(const gchar *dirname, const gchar *basename)
|
||||
new.name);
|
||||
gui_show_progress(
|
||||
gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"))), buf);
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"))), buf,
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
if(debug > 80)
|
||||
printf("%s\n", buf);
|
||||
@ -113,7 +114,8 @@ xml_load_cup(Cup *cup, const gchar *dirname, const gchar *basename)
|
||||
cup->name);
|
||||
gui_show_progress(
|
||||
gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"))), buf);
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"))), buf,
|
||||
PIC_TYPE_LOAD);
|
||||
|
||||
if(debug > 80)
|
||||
printf("%s\n", buf);
|
||||
|
@ -524,21 +524,10 @@ void
|
||||
xml_strategy_load_strategies(void)
|
||||
{
|
||||
gint i, j, k;
|
||||
GList *elem = support_directories;
|
||||
const gchar *strategydir = NULL;
|
||||
const gchar *strategydir = file_get_first_support_dir_suffix("strategy");
|
||||
GPtrArray *files = NULL;
|
||||
gchar buf[SMALL];
|
||||
|
||||
while (elem)
|
||||
{
|
||||
if(g_str_has_suffix((gchar*)elem->data, "strategy"))
|
||||
{
|
||||
strategydir = (const gchar*)elem->data;
|
||||
break;
|
||||
}
|
||||
elem = elem->next;
|
||||
}
|
||||
|
||||
if(strategydir == NULL)
|
||||
main_exit_program(EXIT_STRATEGY_ERROR,
|
||||
"xml_strategy_load_strategies: strategy directory not found.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user