Mercurial > pidgin
changeset 9505:12ce3d23c662
[gaim-migrate @ 10332]
Seriously, look at the code added/code removed ratio.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 10 Jul 2004 19:25:41 +0000 |
parents | 2d4301c90aed |
children | c6ecd07aed6f |
files | src/gtkpounce.c |
diffstat | 1 files changed, 9 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkpounce.c Sat Jul 10 19:08:46 2004 +0000 +++ b/src/gtkpounce.c Sat Jul 10 19:25:41 2004 +0000 @@ -30,6 +30,7 @@ #include "debug.h" #include "notify.h" #include "prpl.h" +#include "request.h" #include "server.h" #include "sound.h" @@ -110,58 +111,24 @@ } static void -pounce_update_entry_fields(GtkWidget *w, gpointer data) +pounce_update_entry_fields(void *user_data, const char *filename) { - const char *filename; - GHashTable *args; - GtkFileSelection *filesel; - - args = (GHashTable *)data; - filesel = GTK_FILE_SELECTION(g_hash_table_lookup(args, "filesel")); + GtkWidget *entry = (GtkWidget *)user_data; - filename = gtk_file_selection_get_filename(filesel); - - if (gaim_gtk_check_if_dir(filename, filesel)) - return; - - if (filename != NULL) - gtk_entry_set_text(GTK_ENTRY(g_hash_table_lookup(args, "entry")), - filename); - - gtk_widget_destroy(GTK_WIDGET(filesel)); - g_hash_table_destroy(args); + gtk_entry_set_text(GTK_ENTRY(entry), filename); } static void -filesel(GtkWidget *w, gpointer data) +filesel(GtkWidget *widget, gpointer data) { - GtkWidget *filesel; GtkWidget *entry; - GHashTable *args; + const gchar *name; entry = (GtkWidget *)data; - - filesel = gtk_file_selection_new(_("Select a file")); - gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel), - gtk_entry_get_text(GTK_ENTRY(entry))); - gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filesel)); - gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION(filesel), FALSE); - - args = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(args, "filesel", filesel); - g_hash_table_insert(args, "entry", entry); + name = gtk_entry_get_text(GTK_ENTRY(entry)); - g_signal_connect( - GTK_OBJECT(GTK_FILE_SELECTION(filesel)->ok_button), "clicked", - G_CALLBACK(pounce_update_entry_fields), args); - g_signal_connect_swapped( - G_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button), "clicked", - G_CALLBACK(g_hash_table_destroy), args); - g_signal_connect_swapped( - G_OBJECT(GTK_FILE_SELECTION(filesel)->cancel_button), "clicked", - G_CALLBACK(gtk_widget_destroy), filesel); - - gtk_widget_show(filesel); + gaim_request_file(entry, _("Select a file"), name, FALSE, + G_CALLBACK(pounce_update_entry_fields), NULL, entry); } static void