main_pref_window.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <libheraia.h>
00030
00031 static gboolean pref_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data);
00032 static void main_pref_window_connect_signals(heraia_window_t *main_window);
00033
00034
00035 static void on_mp_tb_fp_bt_toggled(GtkToggleToolButton *toolbutton, gpointer data);
00036 static void on_mp_tb_display_bt_toggled(GtkToggleToolButton *toolbutton, gpointer data);
00037
00038
00039 static void on_mp_thousand_bt_toggled(GtkToggleButton *togglebutton, gpointer data);
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 static gboolean pref_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data)
00053 {
00054 heraia_window_t *main_window = (heraia_window_t *) data;
00055 GtkWidget *pref_window = NULL;
00056
00057 if (main_window != NULL && main_window->win_prop != NULL && main_window->win_prop->main_pref_window != NULL)
00058 {
00059 pref_window = heraia_get_widget(main_window->xmls->main, "main_preferences_window");
00060 save_preferences(main_window);
00061 record_and_hide_dialog_box(pref_window, main_window->win_prop->main_pref_window);
00062 }
00063
00064 return TRUE;
00065 }
00066
00067
00068
00069
00070
00071
00072 static void main_pref_window_connect_signals(heraia_window_t *main_window)
00073 {
00074
00075 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "main_preferences_window")), "delete-event",
00076 G_CALLBACK(pref_window_delete), main_window);
00077
00078
00079 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "mp_tb_fp_bt")), "toggled",
00080 G_CALLBACK(on_mp_tb_fp_bt_toggled), main_window);
00081
00082
00083 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "mp_tb_display_bt")), "toggled",
00084 G_CALLBACK(on_mp_tb_display_bt_toggled), main_window);
00085
00086
00087 g_signal_connect(G_OBJECT(heraia_get_widget(main_window->xmls->main, "mp_thousand_bt")), "toggled",
00088 G_CALLBACK(on_mp_thousand_bt_toggled), main_window);
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 static void on_mp_tb_fp_bt_toggled(GtkToggleToolButton *toolbutton, gpointer data)
00104 {
00105 heraia_window_t *main_window = (heraia_window_t *) data;
00106 GtkWidget *notebook = NULL;
00107
00108 if (main_window != NULL && main_window->xmls != NULL && main_window->xmls->main != NULL)
00109 {
00110 notebook = heraia_get_widget(main_window->xmls->main, "mp_first_notebook");
00111 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
00112 }
00113 }
00114
00115
00116
00117
00118
00119
00120
00121
00122 static void on_mp_tb_display_bt_toggled(GtkToggleToolButton *toolbutton, gpointer data)
00123 {
00124 heraia_window_t *main_window = (heraia_window_t *) data;
00125 GtkWidget *notebook = NULL;
00126
00127 if (main_window != NULL && main_window->xmls != NULL && main_window->xmls->main != NULL)
00128 {
00129
00130 notebook = heraia_get_widget(main_window->xmls->main, "mp_first_notebook");
00131 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 1);
00132 }
00133 }
00134
00135
00136
00137
00138
00139
00140
00141 static void on_mp_thousand_bt_toggled(GtkToggleButton *togglebutton, gpointer data)
00142 {
00143 heraia_window_t *main_window = (heraia_window_t *) data;
00144
00145 refresh_file_labels(main_window);
00146 }
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 void main_pref_window_init_interface(heraia_window_t *main_window)
00157 {
00158 main_pref_window_connect_signals(main_window);
00159 }