Revision e6c103a84c5a0058d7cee9ba55a6f681aa40d3c9

sadrul at pidgin.im sadrul at pidgin.im
Mon Mar 26 00:19:51 EDT 2007


o   -----------------------------------------------------------------
|   Revision: e6c103a84c5a0058d7cee9ba55a6f681aa40d3c9
|   Ancestor: c79ea8b858fadec3c624069b09acc2d3841d9d2c
|   Author: sadrul at pidgin.im
|   Date: 2007-03-26T04:06:15
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           finch/gntrequest.c finch/libgnt/gntfilesel.c
|   
|   ChangeLog: 
|   
|   use file select dialog
|   
|   ============================================================
|   --- finch/gntrequest.c	c6f9322d6cbe66f46eca21e2311e9415f50aead7
|   +++ finch/gntrequest.c	7d34a05e7573c17085b8d98091752ba19b21fc9a
|   @@ -28,6 +28,7 @@
|    #include <gntcheckbox.h>
|    #include <gntcombobox.h>
|    #include <gntentry.h>
|   +#include <gntfilesel.h>
|    #include <gntlabel.h>
|    #include <gntline.h>
|    #include <gnttree.h>
|   @@ -39,7 +40,7 @@ typedef struct
|    typedef struct
|    {
|    	void *user_data;
|   -	GntWidget *entry, *dialog;
|   +	GntWidget *dialog;
|    	GCallback *cbs;
|    } PurpleGntFileRequest;
|    
|   @@ -549,8 +550,10 @@ file_ok_cb(GntWidget *wid, gpointer fq)
|    file_ok_cb(GntWidget *wid, gpointer fq)
|    {
|    	PurpleGntFileRequest *data = fq;
|   +	char *file = gnt_file_sel_get_selected_file(GNT_FILE_SEL(data->dialog));
|    	if (data->cbs[0] != NULL)
|   -		((PurpleRequestFileCb)data->cbs[0])(data->user_data, gnt_entry_get_text(GNT_ENTRY(data->entry)));
|   +		((PurpleRequestFileCb)data->cbs[0])(data->user_data, file);
|   +	g_free(file);
|    
|    	purple_request_close(PURPLE_REQUEST_FILE, data->dialog);
|    }
|   @@ -568,8 +571,8 @@ finch_request_file(const char *title, co
|    				GCallback ok_cb, GCallback cancel_cb,
|    				void *user_data)
|    {
|   -	GntWidget *window = gnt_vbox_new(FALSE);
|   -	GntWidget *entry, *hbox, *button;
|   +	GntWidget *window = gnt_file_sel_new();
|   +	GntFileSel *sel = GNT_FILE_SEL(window);
|    	PurpleGntFileRequest *data = g_new0(PurpleGntFileRequest, 1);
|    
|    	data->user_data = user_data;
|   @@ -577,31 +580,12 @@ finch_request_file(const char *title, co
|    	data->cbs[0] = ok_cb;
|    	data->cbs[1] = cancel_cb;
|    	data->dialog = window;
|   -	data->entry = entry = gnt_entry_new(g_strconcat(purple_home_dir(), G_DIR_SEPARATOR_S, filename, NULL));
|   -	gnt_widget_set_size(entry, 30, 1);
|   -	gnt_box_set_toplevel(GNT_BOX(window), TRUE);
|    	gnt_box_set_title(GNT_BOX(window), title ? title : (savedialog ? _("Save File...") : _("Open File...")));
|   -#if 0
|   -	/* After the string freeze */
|   -	gnt_box_add_widget(GNT_BOX(window), gnt_label_new(_("Please enter a full path for a file")));
|   -#endif
|   -	gnt_box_add_widget(GNT_BOX(window), entry);
|   -
|   -	hbox = gnt_hbox_new(TRUE);
|   -	gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID);
|   -
|   -	button = gnt_button_new(_("Cancel"));
|   -	g_signal_connect(G_OBJECT(button), "activate",
|   -		G_CALLBACK(file_cancel_cb), data);
|   -	gnt_box_add_widget(GNT_BOX(hbox), button);
|   -
|   -	button = gnt_button_new(_("OK"));
|   -	g_signal_connect(G_OBJECT(button), "activate",
|   -		G_CALLBACK(file_ok_cb), data);
|   -	gnt_box_add_widget(GNT_BOX(hbox), button);
|   -
|   -	gnt_box_add_widget(GNT_BOX(window), hbox);
|   -
|   +	gnt_file_sel_set_current_location(sel, purple_home_dir());  /* XXX: */
|   +	g_signal_connect(G_OBJECT(sel->cancel), "activate",
|   +			G_CALLBACK(file_cancel_cb), data);
|   +	g_signal_connect(G_OBJECT(sel->select), "activate",
|   +			G_CALLBACK(file_ok_cb), data);
|    	g_signal_connect_swapped(G_OBJECT(window), "destroy",
|    			G_CALLBACK(file_request_destroy), data);
|    
|   ============================================================
|   --- finch/libgnt/gntfilesel.c	56f6b22fc0b1f4298e52eb68f8d4785f3f069a04
|   +++ finch/libgnt/gntfilesel.c	c7efb481d2495dfbbf09e74d06bae247dcfd914c
|   @@ -492,27 +492,3 @@ GList *gnt_file_sel_get_selected_multi_f
|    	return list;
|    }
|    
|   -void gnt_file_sel_set_multi_select(GntFileSel *sel, gboolean set)
|   -{
|   -	sel->multiselect = set;
|   -}
|   -
|   -GList *gnt_file_sel_get_selected_multi_files(GntFileSel *sel)
|   -{
|   -	GList *list = NULL, *iter;
|   -	char *str = gnt_file_sel_get_selected_file(sel);
|   -
|   -	for (iter = sel->tags; iter; iter = iter->next) {
|   -		list = g_list_prepend(list, g_strdup(iter->data));
|   -		if (g_utf8_collate(str, iter->data)) {
|   -			g_free(str);
|   -			str = NULL;
|   -		}
|   -	}
|   -	if (str)
|   -		list = g_list_prepend(list, str);
|   -	list = g_list_reverse(list);
|   -	return list;
|   -}
|   -
|   -

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from e6c103a84c5a0058d7cee9ba55a6f681aa40d3c9


More information about the Commits mailing list