Mercurial > audlegacy
diff src/audacious/util.c @ 2514:7934ac463591 trunk
[svn] - removed unused function bmp_menu_translate()
- removed playlist_file_selection_browser() and replaced it with
make_filebrowser()
- modified make_filebrowser() behaviour
- adapted equalizer file loading/saving functions to new
make_filebrowser()
author | mf0102 |
---|---|
date | Tue, 13 Feb 2007 06:09:50 -0800 |
parents | 59661bd074b4 |
children | 299be5908480 |
line wrap: on
line diff
--- a/src/audacious/util.c Tue Feb 13 05:48:33 2007 -0800 +++ b/src/audacious/util.c Tue Feb 13 06:09:50 2007 -0800 @@ -408,7 +408,7 @@ vfs_file_get_contents(filename, &buffer, &filesize); - if (buffer == NULL) + if (buffer == NULL) return NULL; open_buffer = g_strdup(filename); @@ -490,6 +490,22 @@ } GArray * +read_ini_array(const gchar * filename, const gchar * section, + const gchar * key) +{ + gchar *temp; + GArray *a; + + if ((temp = read_ini_string(filename, section, key)) == NULL) { + g_free(temp); + return NULL; + } + a = string_to_garray(temp); + g_free(temp); + return a; +} + +GArray * string_to_garray(const gchar * str) { GArray *array; @@ -512,22 +528,6 @@ return (array); } -GArray * -read_ini_array(const gchar * filename, const gchar * section, - const gchar * key) -{ - gchar *temp; - GArray *a; - - if ((temp = read_ini_string(filename, section, key)) == NULL) { - g_free(temp); - return NULL; - } - a = string_to_garray(temp); - g_free(temp); - return a; -} - void glist_movedown(GList * list) { @@ -583,21 +583,6 @@ return font; } -#ifdef ENABLE_NLS -gchar * -bmp_menu_translate(const gchar * path, gpointer func_data) -{ - gchar *translation = gettext(path); - - if (!translation || *translation != '/') { - g_warning("Bad translation for menupath: %s", path); - translation = (gchar *) path; - } - - return translation; -} -#endif - /* text_get_extents() taken from The GIMP (C) Spencer Kimball, Peter * Mattis et al */ gboolean @@ -692,42 +677,31 @@ } GtkWidget * -make_filebrowser(const gchar * title, - gboolean save) +make_filebrowser(const gchar *title, gboolean save) { GtkWidget *dialog; GtkWidget *button; - GtkWidget *button_close; g_return_val_if_fail(title != NULL, NULL); dialog = gtk_file_chooser_dialog_new(title, GTK_WINDOW(mainwin), - GTK_FILE_CHOOSER_ACTION_OPEN, NULL, NULL); - if (save) - gtk_file_chooser_set_action(GTK_FILE_CHOOSER(dialog), - GTK_FILE_CHOOSER_ACTION_SAVE); - - if (!save) - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE); + save ? + GTK_FILE_CHOOSER_ACTION_SAVE : + GTK_FILE_CHOOSER_ACTION_OPEN, + NULL, NULL); - g_signal_connect(dialog, "destroy", - G_CALLBACK(gtk_widget_destroyed), &dialog); + button = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, + GTK_RESPONSE_REJECT); - button_close = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, - GTK_RESPONSE_REJECT); - gtk_button_set_use_stock(GTK_BUTTON(button_close), TRUE); - GTK_WIDGET_SET_FLAGS(button_close, GTK_CAN_DEFAULT); - g_signal_connect_swapped(button_close, "clicked", - G_CALLBACK(gtk_widget_destroy), dialog); + gtk_button_set_use_stock(GTK_BUTTON(button), TRUE); + GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); button = gtk_dialog_add_button(GTK_DIALOG(dialog), save ? GTK_STOCK_SAVE : GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT); + gtk_button_set_use_stock(GTK_BUTTON(button), TRUE); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); - gtk_window_set_default(GTK_WINDOW(dialog), button); - - gtk_widget_show(dialog); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); return dialog; }