Mercurial > audlegacy
changeset 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 | 1e6d2d719876 |
children | 319b10203d7c |
files | ChangeLog src/audacious/build_stamp.c src/audacious/ui_equalizer.c src/audacious/ui_playlist.c src/audacious/util.c src/audacious/util.h |
diffstat | 6 files changed, 216 insertions(+), 277 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Feb 13 05:48:33 2007 -0800 +++ b/ChangeLog Tue Feb 13 06:09:50 2007 -0800 @@ -1,3 +1,13 @@ +2007-02-13 13:48:33 +0000 Yoshiki Yazawa <yaz@cc.rim.or.jp> + revision [4036] + - delete id3 tag feature has been added. + - debug code in id3_render_paddedstring() which had prevented proper id3v1 rendering has been removed. + + trunk/src/libid3tag/file.c | 50 ++++++++++++++++++++++++++++++++++++------- + trunk/src/libid3tag/render.c | 5 +--- + 2 files changed, 45 insertions(+), 10 deletions(-) + + 2007-02-12 22:26:29 +0000 William Pitcock <nenolod@sacredspiral.co.uk> revision [4034] - unbreak relative path support. closes #791.
--- a/src/audacious/build_stamp.c Tue Feb 13 05:48:33 2007 -0800 +++ b/src/audacious/build_stamp.c Tue Feb 13 06:09:50 2007 -0800 @@ -1,2 +1,2 @@ #include <glib.h> -const gchar *svn_stamp = "20070212-4034"; +const gchar *svn_stamp = "20070213-4036";
--- a/src/audacious/ui_equalizer.c Tue Feb 13 05:48:33 2007 -0800 +++ b/src/audacious/ui_equalizer.c Tue Feb 13 06:09:50 2007 -0800 @@ -975,45 +975,45 @@ static void equalizerwin_delete_selected_presets(GtkTreeView *view, gchar *filename) { - gchar *text; + gchar *text; - GtkTreeSelection *selection = gtk_tree_view_get_selection(view); - GtkTreeModel *model = gtk_tree_view_get_model(view); + GtkTreeSelection *selection = gtk_tree_view_get_selection(view); + GtkTreeModel *model = gtk_tree_view_get_model(view); - /* - * first we are making a list of the selected rows, then we convert this - * list into a list of GtkTreeRowReferences, so that when you delete an - * item you can still access the other items - * finally we iterate through all GtkTreeRowReferences, convert them to - * GtkTreeIters and delete those one after the other - */ + /* + * first we are making a list of the selected rows, then we convert this + * list into a list of GtkTreeRowReferences, so that when you delete an + * item you can still access the other items + * finally we iterate through all GtkTreeRowReferences, convert them to + * GtkTreeIters and delete those one after the other + */ - GList *list = gtk_tree_selection_get_selected_rows(selection, &model); - GList *rrefs = NULL; - GList *litr; + GList *list = gtk_tree_selection_get_selected_rows(selection, &model); + GList *rrefs = NULL; + GList *litr; - for (litr = list; litr; litr = litr->next) - { - GtkTreePath *path = litr->data; - rrefs = g_list_append(rrefs, gtk_tree_row_reference_new(model, path)); - } + for (litr = list; litr; litr = litr->next) + { + GtkTreePath *path = litr->data; + rrefs = g_list_append(rrefs, gtk_tree_row_reference_new(model, path)); + } - for (litr = rrefs; litr; litr = litr->next) - { - GtkTreeRowReference *ref = litr->data; - GtkTreePath *path = gtk_tree_row_reference_get_path(ref); - GtkTreeIter iter; - gtk_tree_model_get_iter(model, &iter, path); + for (litr = rrefs; litr; litr = litr->next) + { + GtkTreeRowReference *ref = litr->data; + GtkTreePath *path = gtk_tree_row_reference_get_path(ref); + GtkTreeIter iter; + gtk_tree_model_get_iter(model, &iter, path); - gtk_tree_model_get(model, &iter, 0, &text, -1); + gtk_tree_model_get(model, &iter, 0, &text, -1); - if (filename == "eq.preset") - equalizer_presets = equalizerwin_delete_preset(equalizer_presets, text, filename); - else if (filename == "eq.auto_preset") - equalizer_auto_presets = equalizerwin_delete_preset(equalizer_auto_presets, text, filename); + if (filename == "eq.preset") + equalizer_presets = equalizerwin_delete_preset(equalizer_presets, text, filename); + else if (filename == "eq.auto_preset") + equalizer_auto_presets = equalizerwin_delete_preset(equalizer_auto_presets, text, filename); - gtk_list_store_remove(GTK_LIST_STORE(model), &iter); - } + gtk_list_store_remove(GTK_LIST_STORE(model), &iter); + } } @@ -1105,25 +1105,25 @@ static void equalizerwin_save_select(GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *col, gpointer data) + GtkTreeViewColumn *col, gpointer data) { gchar *text; - GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); - GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); + GtkTreeModel *model; + GtkTreeIter iter; - if (selection) - { - if (gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_tree_model_get(model, &iter, 0, &text, -1); - gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_entry), text); - equalizerwin_save_ok(NULL, NULL); + if (selection) + { + if (gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gtk_tree_model_get(model, &iter, 0, &text, -1); + gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_entry), text); + equalizerwin_save_ok(NULL, NULL); - g_free(text); - } - } + g_free(text); + } + } } static void @@ -1131,35 +1131,35 @@ { gchar *text; - GtkTreeView* view = GTK_TREE_VIEW(data); - GtkTreeSelection *selection = gtk_tree_view_get_selection(view); - GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeView* view = GTK_TREE_VIEW(data); + GtkTreeSelection *selection = gtk_tree_view_get_selection(view); + GtkTreeModel *model; + GtkTreeIter iter; - if (selection) - { - if (gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_tree_model_get(model, &iter, 0, &text, -1); - equalizerwin_load_preset(equalizer_presets, text); + if (selection) + { + if (gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gtk_tree_model_get(model, &iter, 0, &text, -1); + equalizerwin_load_preset(equalizer_presets, text); - g_free(text); - } - } + g_free(text); + } + } gtk_widget_destroy(equalizerwin_load_window); } static void equalizerwin_load_select(GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *col, gpointer data) + GtkTreeViewColumn *col, gpointer data) { - equalizerwin_load_ok(NULL, treeview); + equalizerwin_load_ok(NULL, treeview); } static void equalizerwin_delete_delete(GtkWidget *widget, gpointer data) { - equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.preset"); + equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.preset"); } static void @@ -1177,25 +1177,25 @@ static void equalizerwin_save_auto_select(GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *col, gpointer data) + GtkTreeViewColumn *col, gpointer data) { gchar *text; - GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); - GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview); + GtkTreeModel *model; + GtkTreeIter iter; - if (selection) - { - if (gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_tree_model_get(model, &iter, 0, &text, -1); - gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), text); - equalizerwin_save_auto_ok(NULL, NULL); + if (selection) + { + if (gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gtk_tree_model_get(model, &iter, 0, &text, -1); + gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), text); + equalizerwin_save_auto_ok(NULL, NULL); - g_free(text); - } - } + g_free(text); + } + } } static void @@ -1203,68 +1203,38 @@ { gchar *text; - GtkTreeView *view = GTK_TREE_VIEW(data); - GtkTreeSelection *selection = gtk_tree_view_get_selection(view); - GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeView *view = GTK_TREE_VIEW(data); + GtkTreeSelection *selection = gtk_tree_view_get_selection(view); + GtkTreeModel *model; + GtkTreeIter iter; - if (selection) - { - if (gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_tree_model_get(model, &iter, 0, &text, -1); - equalizerwin_load_preset(equalizer_auto_presets, text); + if (selection) + { + if (gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gtk_tree_model_get(model, &iter, 0, &text, -1); + equalizerwin_load_preset(equalizer_auto_presets, text); - g_free(text); - } - } + g_free(text); + } + } gtk_widget_destroy(equalizerwin_load_auto_window); } static void equalizerwin_load_auto_select(GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *col, gpointer data) + GtkTreeViewColumn *col, gpointer data) { - equalizerwin_load_auto_ok(NULL, treeview); + equalizerwin_load_auto_ok(NULL, treeview); } static void equalizerwin_delete_auto_delete(GtkWidget *widget, gpointer data) { - equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.auto_preset"); + equalizerwin_delete_selected_presets(GTK_TREE_VIEW(data), "eq.auto_preset"); } -typedef void (*ResponseHandler)(const gchar *filename); - -static void -equalizerwin_file_chooser_on_response(GtkWidget * dialog, - gint response, - gpointer data) -{ - GtkFileChooser *file_chooser = GTK_FILE_CHOOSER(dialog); - ResponseHandler handler = (ResponseHandler) data; - gchar *filename; - - gtk_widget_hide(dialog); - - switch (response) - { - case GTK_RESPONSE_ACCEPT: - filename = gtk_file_chooser_get_filename(file_chooser); - handler(filename); - g_free(filename); - break; - - case GTK_RESPONSE_REJECT: - break; - } - - gtk_widget_destroy(dialog); -} - - - static void load_preset_file(const gchar *filename) { @@ -1376,15 +1346,15 @@ GCallback select_row_func) { GtkWidget *vbox, *scrolled_window, *bbox, *view; - GtkWidget *button_cancel, *button_action; + GtkWidget *button_cancel, *button_action; GList *node; - GtkListStore *store; - GtkTreeIter iter; - GtkTreeModel *model; - GtkCellRenderer *renderer; - GtkTreeSelection *selection; - GtkTreeSortable *sortable; + GtkListStore *store; + GtkTreeIter iter; + GtkTreeModel *model; + GtkCellRenderer *renderer; + GtkTreeSelection *selection; + GtkTreeSortable *sortable; @@ -1407,37 +1377,37 @@ GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - /* fill the store with the names of all available presets */ - store = gtk_list_store_new(1, G_TYPE_STRING); - for (node = preset_list; node; node = g_list_next(node)) - { - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - 0, ((EqualizerPreset*)node->data)->name, - -1); - } - model = GTK_TREE_MODEL(store); + /* fill the store with the names of all available presets */ + store = gtk_list_store_new(1, G_TYPE_STRING); + for (node = preset_list; node; node = g_list_next(node)) + { + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + 0, ((EqualizerPreset*)node->data)->name, + -1); + } + model = GTK_TREE_MODEL(store); - sortable = GTK_TREE_SORTABLE(store); - gtk_tree_sortable_set_sort_column_id(sortable, 0, GTK_SORT_ASCENDING); + sortable = GTK_TREE_SORTABLE(store); + gtk_tree_sortable_set_sort_column_id(sortable, 0, GTK_SORT_ASCENDING); - view = gtk_tree_view_new(); - renderer = gtk_cell_renderer_text_new(); - gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, - _("Presets"), renderer, - "text", 0, NULL); - gtk_tree_view_set_model(GTK_TREE_VIEW(view), model); - g_object_unref(model); + view = gtk_tree_view_new(); + renderer = gtk_cell_renderer_text_new(); + gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, + _("Presets"), renderer, + "text", 0, NULL); + gtk_tree_view_set_model(GTK_TREE_VIEW(view), model); + g_object_unref(model); - selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); - gtk_tree_selection_set_mode(selection, sel_mode); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + gtk_tree_selection_set_mode(selection, sel_mode); - gtk_container_add(GTK_CONTAINER(scrolled_window), view); + gtk_container_add(GTK_CONTAINER(scrolled_window), view); gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0); if (entry) { @@ -1461,8 +1431,8 @@ g_signal_connect(button_action, "clicked", G_CALLBACK(action_func), view); GTK_WIDGET_SET_FLAGS(button_action, GTK_CAN_DEFAULT); - if (select_row_func) - g_signal_connect(view, "row-activated", G_CALLBACK(select_row_func), NULL); + if (select_row_func) + g_signal_connect(view, "row-activated", G_CALLBACK(select_row_func), NULL); gtk_box_pack_start(GTK_BOX(bbox), button_action, TRUE, TRUE, 0); @@ -1602,33 +1572,48 @@ action_equ_load_preset_file(void) { GtkWidget *dialog; + gchar *filename; dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); - g_signal_connect(dialog , "response", - G_CALLBACK(equalizerwin_file_chooser_on_response), - load_preset_file); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + load_preset_file(filename); + g_free(filename); + } + gtk_widget_destroy(dialog); } void action_equ_load_preset_eqf(void) { GtkWidget *dialog; + gchar *filename; dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); - g_signal_connect(dialog, "response", - G_CALLBACK(equalizerwin_file_chooser_on_response), - load_winamp_file); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + load_winamp_file(filename); + g_free(filename); + } + gtk_widget_destroy(dialog); } void action_equ_import_winamp_presets(void) { GtkWidget *dialog; + gchar *filename; dialog = make_filebrowser(Q_("Load equalizer preset"), FALSE); - g_signal_connect(dialog, "response", - G_CALLBACK(equalizerwin_file_chooser_on_response), - import_winamp_file); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + import_winamp_file(filename); + g_free(filename); + } + gtk_widget_destroy(dialog); } void @@ -1678,21 +1663,25 @@ void action_equ_save_default_preset(void) { - equalizer_presets = equalizerwin_save_preset(equalizer_presets, Q_("Default"), - "eq.preset"); + equalizer_presets = + equalizerwin_save_preset(equalizer_presets, Q_("Default"), "eq.preset"); } void action_equ_save_preset_file(void) { GtkWidget *dialog; + gchar *filename; gchar *songname; Playlist *playlist = playlist_get_active(); dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE); - g_signal_connect(dialog, "response", - G_CALLBACK(equalizerwin_file_chooser_on_response), - save_preset_file); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + save_preset_file(filename); + g_free(filename); + } songname = playlist_get_filename(playlist, playlist_get_position(playlist)); if (songname) { @@ -1703,17 +1692,24 @@ eqname); g_free(eqname); } + + gtk_widget_destroy(dialog); } void action_equ_save_preset_eqf(void) { GtkWidget *dialog; + gchar *filename; dialog = make_filebrowser(Q_("Save equalizer preset"), TRUE); - g_signal_connect(dialog, "response", - G_CALLBACK(equalizerwin_file_chooser_on_response), - save_winamp_file); + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + save_winamp_file(filename); + g_free(filename); + } + gtk_widget_destroy(dialog); } void
--- a/src/audacious/ui_playlist.c Tue Feb 13 05:48:33 2007 -0800 +++ b/src/audacious/ui_playlist.c Tue Feb 13 06:09:50 2007 -0800 @@ -879,57 +879,24 @@ playlist_set_current_name(playlist, filename); } -static GtkWidget * -playlist_file_selection_browser(const gchar *title, - const gchar *default_filename, - GtkFileChooserAction action) -{ - GtkWidget *dialog; - GtkWidget *button; - - dialog = gtk_file_chooser_dialog_new(title, GTK_WINDOW(mainwin), - action, NULL, NULL); - - if (default_filename) - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), - default_filename); - - button = gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, - GTK_RESPONSE_REJECT); - - 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), - (action == GTK_FILE_CHOOSER_ACTION_OPEN) ? - GTK_STOCK_OPEN : GTK_STOCK_SAVE, - GTK_RESPONSE_ACCEPT); - - gtk_button_set_use_stock(GTK_BUTTON(button), TRUE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - - return dialog; -} - static gchar * playlist_file_selection_load(const gchar * title, const gchar * default_filename) { - static GtkWidget *dialog = NULL; + GtkWidget *dialog; gchar *filename; g_return_val_if_fail(title != NULL, NULL); - if (!dialog) - dialog = playlist_file_selection_browser(title, default_filename, - GTK_FILE_CHOOSER_ACTION_OPEN); + dialog = make_filebrowser(title, FALSE); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); else filename = NULL; - gtk_widget_hide(dialog); + gtk_widget_destroy(dialog); return filename; } @@ -937,21 +904,20 @@ playlist_file_selection_save(const gchar * title, const gchar * default_filename) { - static GtkWidget *dialog = NULL; + GtkWidget *dialog; gchar *filename; g_return_val_if_fail(title != NULL, NULL); - if (!dialog) - dialog = playlist_file_selection_browser(title, default_filename, - GTK_FILE_CHOOSER_ACTION_SAVE); + dialog = make_filebrowser(title, TRUE); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), default_filename); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); else filename = NULL; - gtk_widget_hide(dialog); + gtk_widget_destroy(dialog); return filename; }
--- 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; }
--- a/src/audacious/util.h Tue Feb 13 05:48:33 2007 -0800 +++ b/src/audacious/util.h Tue Feb 13 06:09:50 2007 -0800 @@ -73,14 +73,7 @@ guint gint_count_digits(gint n); -#if ENABLE_NLS -gchar *bmp_menu_translate(const gchar * path, gpointer func_data); -#else -# define bmp_menu_translate NULL -#endif - -GtkWidget *make_filebrowser(const gchar * title, - gboolean save); +GtkWidget *make_filebrowser(const gchar *title, gboolean save); typedef struct { gint x; @@ -116,10 +109,10 @@ gchar *audacious_get_localdir(void); -void audacious_menu_main_show( gint x , gint y , guint button , guint time ); +void audacious_menu_main_show(gint x, gint y, guint button, guint time); -gchar* fileinfo_recursive_get_image(const gchar* path, - const gchar* file_name, gint depth); +gchar *fileinfo_recursive_get_image(const gchar *path, const gchar *file_name, + gint depth); G_END_DECLS