im.pidgin.pidgin: 10b5584bcb92c67e0dc20d17fd72eeaf351aaa86

wabz at pidgin.im wabz at pidgin.im
Tue Nov 27 23:01:29 EST 2007


-----------------------------------------------------------------
Revision: 10b5584bcb92c67e0dc20d17fd72eeaf351aaa86
Ancestor: 96bb0250f516ff49a03fcaa2b7720865d9668ccd
Author: wabz at pidgin.im
Date: 2007-11-28T03:51:18
Branch: im.pidgin.pidgin

Modified files:
        finch/libgnt/gntentry.c finch/libgnt/gntwm.c

ChangeLog: 

Fix cursor-next-word behaviour, noticed by jtb.
Change dump-screen binding to M-D (and have it use a file req dialog) to give delete-next-word a say in things.

-------------- next part --------------
============================================================
--- finch/libgnt/gntentry.c	d8698f95f37f000571dd6eb3d60105275658914e
+++ finch/libgnt/gntentry.c	1226b105ba750769e98f0c2828d3590fb799cf19
@@ -575,15 +575,16 @@ next_begin_word(const char *text, const 
 next_begin_word(const char *text, const char *end)
 {
 	gunichar ch = 0;
+
+	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
+		text = g_utf8_find_next_char(text, end);
+
 	ch = g_utf8_get_char(text);
 	while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
 		gunichar cur = g_utf8_get_char(text);
 		if (!SAME(ch, cur))
 			break;
 	}
-
-	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
-		text = g_utf8_find_next_char(text, end);
 	return (text ? text : end);
 }
 
============================================================
--- finch/libgnt/gntwm.c	51cf3d1d4afb82c656791e313cf2c0b45b9bde00
+++ finch/libgnt/gntwm.c	0329eb30003338d6d0833b1369c5678ab1a68289
@@ -28,6 +28,7 @@
 #include "config.h"
 
 #include <glib.h>
+#include <glib/gstdio.h>
 #include <ctype.h>
 #include <gmodule.h>
 #include <stdlib.h>
@@ -41,6 +42,7 @@
 #include "gntbox.h"
 #include "gntbutton.h"
 #include "gntentry.h"
+#include "gntfilesel.h"
 #include "gntlabel.h"
 #include "gntmenu.h"
 #include "gnttextview.h"
@@ -663,12 +665,12 @@ window_list(GntBindable *bindable, GList
 	return TRUE;
 }
 
-static gboolean
-dump_screen(GntBindable *bindable, GList *null)
+static void
+dump_file_save(GntFileSel *fs, const char *path, const char *f, gpointer n)
 {
+	FILE *file;
 	int x, y;
 	chtype old = 0, now = 0;
-	FILE *file = fopen("dump.html", "w");
 	struct {
 		char ascii;
 		char *unicode;
@@ -690,6 +692,11 @@ dump_screen(GntBindable *bindable, GList
 		{'\0', NULL}
 	};
 
+
+	if ((file = g_fopen(path, "w+")) == NULL) {
+		return;
+	}
+
 	fprintf(file, "<head>\n  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\n</head>\n<body>\n");
 	fprintf(file, "<pre>");
 	for (y = 0; y < getmaxy(stdscr); y++) {
@@ -796,6 +803,24 @@ dump_screen(GntBindable *bindable, GList
 	}
 	fprintf(file, "</pre>\n</body>");
 	fclose(file);
+	gnt_widget_destroy(GNT_WIDGET(fs));
+}
+
+static void
+dump_file_cancel(GntWidget *w, GntFileSel *fs)
+{
+	gnt_widget_destroy(GNT_WIDGET(fs));
+}
+
+static gboolean
+dump_screen(GntBindable *b, GList *null)
+{
+	GntWidget *window = gnt_file_sel_new();
+	GntFileSel *sel = GNT_FILE_SEL(window);
+	gnt_file_sel_set_suggested_filename(sel, "dump.html");
+	g_signal_connect(G_OBJECT(sel), "file_selected", G_CALLBACK(dump_file_save), NULL);
+	g_signal_connect(G_OBJECT(sel->cancel), "activate", G_CALLBACK(dump_file_cancel), sel);
+	gnt_widget_show(window);
 	return TRUE;
 }
 
@@ -1366,7 +1391,7 @@ gnt_wm_class_init(GntWMClass *klass)
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-list", window_list,
 				"\033" "w", NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "dump-screen", dump_screen,
-				"\033" "d", NULL);
+				"\033" "D", NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-left", shift_left,
 				"\033" ",", NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "shift-right", shift_right,


More information about the Commits mailing list