Revision 88322be73f5336575c98479b2270ab9fcf2a8a75

sadrul at pidgin.im sadrul at pidgin.im
Sun Mar 25 20:26:30 EDT 2007


o   -----------------------------------------------------------------
|   Revision: 88322be73f5336575c98479b2270ab9fcf2a8a75
|   Ancestor: 41f65a78d919384ad599d73c656a367d92292a41
|   Author: sadrul at pidgin.im
|   Date: 2007-03-20T11:52:46
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           finch/gntrequest.c finch/libgnt/gntfilesel.c
|           finch/libgnt/gntfilesel.h libpurple/example/nullclient.c
|           libpurple/plugins/Makefile.am
|           libpurple/plugins/perl/common/Makefile.PL.in
|           pidgin/Makefile.am pidgin/gtkutils.c
|           pidgin/pixmaps/Makefile.am
|   
|   ChangeLog: 
|   
|   Use the file selector for request-file.
|   
|   ============================================================
|   --- finch/gntrequest.c	bca60696cf91c487a204237b474459a8a62320b4
|   +++ finch/gntrequest.c	7eb073ed0e8ba6133d280d556733eded48a90892
|   @@ -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,15 @@ 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);
|   +	gnt_file_sel_set_current_location(sel, purple_home_dir());  /* XXX: may be remember the position and restore here? */
|    
|   -	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_signal_connect(G_OBJECT(sel->cancel), "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_signal_connect(G_OBJECT(sel->select), "activate",
|    		G_CALLBACK(file_ok_cb), data);
|   -	gnt_box_add_widget(GNT_BOX(hbox), button);
|    
|   -	gnt_box_add_widget(GNT_BOX(window), hbox);
|   -
|    	g_signal_connect_swapped(G_OBJECT(window), "destroy",
|    			G_CALLBACK(file_request_destroy), data);
|    
|   ============================================================
|   --- finch/libgnt/gntfilesel.c	5cd1751de2cc8ba264bd489e345ac5fc6e757c6d
|   +++ finch/libgnt/gntfilesel.c	58f2ed3b397e958ce1563261b74282d6b4c980c3
|   @@ -375,3 +375,23 @@ gboolean gnt_file_sel_get_dirs_only(GntF
|    	return sel->dirsonly;
|    }
|    
|   +char *gnt_file_sel_get_selected_file(GntFileSel *sel)
|   +{
|   +	char *ret;
|   +	const char *tmp;
|   +	tmp = (const char*)gnt_tree_get_selection_data(sel->dirsonly ? GNT_TREE(sel->dirs) : GNT_TREE(sel->files));
|   +	ret = g_strdup_printf("%s%s%s", sel->current, sel->current[1] ? G_DIR_SEPARATOR_S : "", tmp ? tmp : "");
|   +	return ret;
|   +}
|   +
|   +void gnt_file_sel_set_must_exist(GntFileSel *sel, gboolean must)
|   +{
|   +	/*XXX: What do I do with this? */
|   +	sel->must_exist = must;
|   +}
|   +
|   +gboolean gnt_file_sel_get_must_exist(GntFileSel *sel)
|   +{
|   +	return sel->must_exist;
|   +}
|   +
|   ============================================================
|   --- finch/libgnt/gntfilesel.h	af313756974c65a7203b81ec0a933fb56822c69c
|   +++ finch/libgnt/gntfilesel.h	c6794035f21b4ad598d6888ef661b26358f10f42
|   @@ -63,6 +63,12 @@ gboolean gnt_file_sel_get_dirs_only(GntF
|    
|    gboolean gnt_file_sel_get_dirs_only(GntFileSel *sel);
|    
|   +void gnt_file_sel_set_must_exist(GntFileSel *sel, gboolean must);
|   +
|   +gboolean gnt_file_sel_get_must_exist(GntFileSel *sel);
|   +
|   +char *gnt_file_sel_get_selected_file(GntFileSel *sel);  /* The returned value should be free'd */
|   +
|    G_END_DECLS
|    
|    #endif /* GNT_FILE_SEL_H */
|   ============================================================
|   --- libpurple/example/nullclient.c	9831fafc26136c280e5098de8f00e1065269fb3e
|   +++ libpurple/example/nullclient.c	eedf1d3b3a5799f9ca43a3cc17fd43ee2cc92c25
|   @@ -28,7 +28,6 @@
|    #include "ft.h"
|    #include "log.h"
|    #include "notify.h"
|   -#include "prefix.h"
|    #include "prefs.h"
|    #include "prpl.h"
|    #include "pounce.h"
|   ============================================================
|   --- libpurple/plugins/Makefile.am	8f2c8fa3826c7c8e797405d1fb4d137b4414b29c
|   +++ libpurple/plugins/Makefile.am	7703eafe96bc31dde40094ab923d4336e1330b5a
|   @@ -18,7 +18,6 @@ SUBDIRS = \
|    
|    SUBDIRS = \
|    	$(MONO_DIR) \
|   -	$(PERL_DIR) \
|    	ssl \
|    	$(TCL_DIR)
|    
|   ============================================================
|   --- libpurple/plugins/perl/common/Makefile.PL.in	7a0705424e46446a1cfe4fefb3ed19ef5eb66c26
|   +++ libpurple/plugins/perl/common/Makefile.PL.in	bf6e95f01121b5cce8e39b58fe61d799d723ca4c
|   @@ -9,7 +9,7 @@ WriteMakefile(
|        ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
|          (ABSTRACT_FROM => '@srcdir@/Purple.pm', # retrieve abstract from module
|           AUTHOR     => 'Purple <http://pidgin.im/>') : ()),
|   -    'LIBS'		=> [''], # e.g., '-lm'
|   +    'LIBS'		=> ['@GLIB_LIBS@', ''], # e.g., '-lm'
|        'DEFINE'		=> '@DEBUG_CFLAGS@', # e.g., '-DHAVE_SOMETHING'
|        'INC'		=> '-I. -I at srcdir@ -I at top_srcdir@ -I at top_srcdir@/libpurple @GLIB_CFLAGS@', # e.g., '-I. -I/usr/include/other'
|        'OBJECT'		=> '$(O_FILES)', # link all the C files too
|   ============================================================
|   --- pidgin/Makefile.am	d042b3f488b5aea66655febe502b40c8f8901cb2
|   +++ pidgin/Makefile.am	7127aae5df9bc2147cff7b4f0e50aebb72dd2763
|   @@ -63,7 +63,7 @@ pkgconfig_DATA = pidgin.pc
|    pkgconfigdir = $(libdir)/pkgconfig
|    pkgconfig_DATA = pidgin.pc
|    
|   -SUBDIRS = pixmaps plugins sounds
|   +SUBDIRS = plugins 
|    
|    bin_PROGRAMS = pidgin
|    
|   ============================================================
|   --- pidgin/gtkutils.c	d0dcf9781b0bdafffc603d243f863488664937de
|   +++ pidgin/gtkutils.c	498d69b314b0b8c17c6ff3a01d1b13cce8ffce1f
|   @@ -3139,3 +3139,4 @@ gtk_tree_path_new_from_indices (gint fir
|    	return path;
|    }
|    #endif
|   +
|   ============================================================
|   --- pidgin/pixmaps/Makefile.am	2a81bf42b50476a099681ce7fb80f497b8b59271
|   +++ pidgin/pixmaps/Makefile.am	dd3df40962798c7cdc22f050bbada152bb63b40f
|   @@ -50,13 +50,13 @@ EXTRA_DIST = \
|    		gaim.ico			
|    
|    
|   -gaimbuttonpixdir = $(datadir)/pixmaps/gaim/buttons
|   +gaimbuttonpixdir = $(datadir)/pixmaps/pidgin/buttons
|    gaimbuttonpix_DATA = about_menu.png accounts.png change-bgcolor-small.png change-fgcolor-small.png edit.png info.png insert-image-small.png insert-link-small.png insert-smiley-small.png pause.png text_bigger.png text_normal.png text_smaller.png send-im.png
|    
|    gaimiconpixdir = $(datadir)/pixmaps/pidgin/icons
|    gaimiconpix_DATA = window-icon.png
|    
|   -gaimdistpixdir = $(datadir)/pixmaps/gaim
|   +gaimdistpixdir = $(datadir)/pixmaps/pidgin
|    gaimdistpix_DATA = logo.png tb_drag_arrow_down.xpm tb_drag_arrow_left.xpm tb_drag_arrow_right.xpm tb_drag_arrow_up.xpm typed.png typing.png status-online.png status-offline.png status-away.png status-invisible.png status-typing0.png status-typing1.png status-typing2.png status-typing3.png status-connect0.png status-connect1.png status-connect2.png status-connect3.png phone.png insert-image.png
|    
|    

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


More information about the Commits mailing list