92 |
|
|
93 |
/* update the menu items of an optionmenu */ |
/* update the menu items of an optionmenu */ |
94 |
void |
void |
95 |
updateoptionmenu (GtkWidget * optionmenu, gchar ** split) |
updateoptionmenu (GtkWidget * optionmenu, gchar **split) |
96 |
{ |
{ |
|
GtkWidget *menu, *menuitem; |
|
97 |
gint index = 0; |
gint index = 0; |
98 |
|
|
|
menu = gtk_menu_new (); |
|
99 |
for (;;) |
for (;;) |
100 |
{ |
{ |
101 |
if (split[index] == NULL) |
if (split[index] == NULL) |
102 |
break; |
break; |
103 |
menuitem = gtk_menu_item_new_with_label (split[index]); |
gtk_combo_box_append_text (GTK_COMBO_BOX(optionmenu), split[index]); |
104 |
gtk_widget_show (menuitem); |
index++; |
105 |
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); |
} |
|
index++; |
|
|
} |
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu); |
|
106 |
} |
} |
107 |
|
|
108 |
/* removing leading and trailing whitespaces from an array of strings */ |
/* removing leading and trailing whitespaces from an array of strings */ |
112 |
gint index = 0; |
gint index = 0; |
113 |
|
|
114 |
for (;;) |
for (;;) |
115 |
{ |
{ |
116 |
if (split[index] == NULL) |
if (split[index] == NULL) |
117 |
break; |
break; |
118 |
g_strstrip (split[index]); |
g_strstrip (split[index]); |
119 |
index++; |
index++; |
120 |
} |
} |
121 |
} |
} |
122 |
|
|
123 |
/* clear statusbar */ |
/* clear statusbar */ |
129 |
statusbar = lookup_widget (mainwindow, "statusbar"); |
statusbar = lookup_widget (mainwindow, "statusbar"); |
130 |
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 1); |
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 1); |
131 |
gtk_statusbar_push (GTK_STATUSBAR (statusbar), 1, _("Ready.")); |
gtk_statusbar_push (GTK_STATUSBAR (statusbar), 1, _("Ready.")); |
132 |
gtk_timeout_remove (statusbartimer); |
g_source_remove (statusbartimer); |
133 |
state.statustimer = FALSE; |
state.statustimer = FALSE; |
134 |
return FALSE; |
return FALSE; |
135 |
} |
} |
144 |
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 1); |
gtk_statusbar_pop (GTK_STATUSBAR (statusbar), 1); |
145 |
gtk_statusbar_push (GTK_STATUSBAR (statusbar), 1, string); |
gtk_statusbar_push (GTK_STATUSBAR (statusbar), 1, string); |
146 |
if (state.statustimer) |
if (state.statustimer) |
147 |
gtk_timeout_remove (statusbartimer); |
g_source_remove (statusbartimer); |
148 |
statusbartimer = gtk_timeout_add (30000, statusbar_timeout, NULL); |
statusbartimer = g_timeout_add (30000, statusbar_timeout, NULL); |
149 |
state.statustimer = TRUE; |
state.statustimer = TRUE; |
150 |
} |
} |
151 |
|
|
212 |
bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu"); |
bandoptionmenu = lookup_widget (mainwindow, "bandoptionmenu"); |
213 |
modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu"); |
modeoptionmenu = lookup_widget (mainwindow, "modeoptionmenu"); |
214 |
preferences.modeoptionmenu = |
preferences.modeoptionmenu = |
215 |
gtk_option_menu_get_history (GTK_OPTION_MENU (modeoptionmenu)); |
gtk_combo_box_get_active (GTK_COMBO_BOX(modeoptionmenu)); |
216 |
preferences.bandoptionmenu = |
preferences.bandoptionmenu = |
217 |
gtk_option_menu_get_history (GTK_OPTION_MENU (bandoptionmenu)); |
gtk_combo_box_get_active (GTK_COMBO_BOX(bandoptionmenu)); |
218 |
view_toolbar = lookup_widget (mainwindow, "view_toolbar"); |
view_toolbar = lookup_widget (mainwindow, "view_toolbar"); |
219 |
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(view_toolbar))) |
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(view_toolbar))) |
220 |
preferences.viewtoolbar = 1; |
preferences.viewtoolbar = 1; |