changeset 19566:57d350900136

Tooltips can be for the buddylist or for conversation windows. A more appropriate fix for #2723.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 01 Sep 2007 23:50:22 +0000
parents 4691b5f80ac8
children b99a158ea85e
files Doxyfile.in autogen.sh doc/TracHeader.html finch/finch.c finch/libgnt/gntmenu.c finch/libgnt/test/Makefile finch/libgnt/test/file.c finch/libgnt/test/menu.c finch/libgnt/test/tv.c libpurple/Makefile.am libpurple/certificate.h libpurple/conversation.h libpurple/eventloop.c libpurple/example/nullclient.c libpurple/ft.c libpurple/plugins/autoaccept.c libpurple/plugins/dbus-example.c libpurple/plugins/statenotify.c libpurple/proxy.c libpurple/util.c pidgin/gtkblist.c pidgin/gtkimhtml.c pidgin/gtkmain.c pidgin/gtkplugin.c pidgin/plugins/perl/common/GtkDialogs.xs
diffstat 25 files changed, 166 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/Doxyfile.in	Sat Sep 01 23:09:41 2007 +0000
+++ b/Doxyfile.in	Sat Sep 01 23:50:22 2007 +0000
@@ -293,7 +293,7 @@
 # alphabetically by member name. If set to NO the members will appear in 
 # declaration order.
 
-SORT_MEMBER_DOCS       = YES
+SORT_MEMBER_DOCS       = NO
 
 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
 # brief documentation of file, namespace and class members alphabetically 
@@ -310,7 +310,7 @@
 # Note: This option applies only to the class list, not to the 
 # alphabetical list.
 
-SORT_BY_SCOPE_NAME     = YES
+SORT_BY_SCOPE_NAME     = NO
 
 # The GENERATE_TODOLIST tag can be used to enable (YES) or 
 # disable (NO) the todo list. This list is created by putting \todo 
@@ -756,7 +756,7 @@
 # contain links (just like the HTML output) instead of page references 
 # This makes the output suitable for online browsing using a pdf viewer.
 
-PDF_HYPERLINKS         = NO
+PDF_HYPERLINKS         = YES
 
 # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
 # plain latex in the generated Makefile. Set this option to YES to get a 
@@ -1039,7 +1039,7 @@
 # option is superceded by the HAVE_DOT option below. This is only a fallback. It is 
 # recommended to install and use dot, since it yields more powerful graphs.
 
-CLASS_DIAGRAMS         = YES
+CLASS_DIAGRAMS         = NO
 
 # If set to YES, the inheritance and collaboration graphs will hide 
 # inheritance and usage relations if the target is undocumented 
--- a/autogen.sh	Sat Sep 01 23:09:41 2007 +0000
+++ b/autogen.sh	Sat Sep 01 23:50:22 2007 +0000
@@ -57,13 +57,21 @@
 	fi
 done
 
+echo "stage 1"
 libtoolize -c -f --automake
+echo "stage 2"
 glib-gettextize --force --copy
+echo "stage 3"
 intltoolize --force --copy
+echo "stage 4"
 aclocal $ACLOCAL_FLAGS || exit;
+echo "stage 5"
 autoheader || exit;
+echo "stage 6"
 automake --add-missing --copy;
+echo "stage 7"
 autoconf || exit;
+echo "stage 8"
 automake || exit;
 
 echo;
--- a/doc/TracHeader.html	Sat Sep 01 23:09:41 2007 +0000
+++ b/doc/TracHeader.html	Sat Sep 01 23:50:22 2007 +0000
@@ -1,2 +1,2 @@
+<link type="text/css" rel="stylesheet" href="doxygen.css" />
 
-
--- a/finch/finch.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/finch.c	Sat Sep 01 23:50:22 2007 +0000
@@ -171,12 +171,20 @@
 	return closure->result;
 }
 
+static gboolean
+gnt_input_remove(guint tag)
+{
+	if ((gint)tag <= 0)
+		return FALSE;
+	return g_source_remove(tag);
+}
+
 static PurpleEventLoopUiOps eventloop_ops =
 {
 	g_timeout_add,
 	g_source_remove,
 	gnt_input_add,
-	g_source_remove,
+	gnt_input_remove,
 	NULL, /* input_get_error */
 #if GLIB_CHECK_VERSION(2,14,0)
 	g_timeout_add_seconds,
--- a/finch/libgnt/gntmenu.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/libgnt/gntmenu.c	Sat Sep 01 23:50:22 2007 +0000
@@ -286,6 +286,7 @@
 				sub = sub->submenu;
 			}
 			gnt_widget_draw(widget);
+			gnt_widget_activate(GNT_WIDGET(menu));
 			return TRUE;
 		}
 	} else {
--- a/finch/libgnt/test/Makefile	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/libgnt/test/Makefile	Sat Sep 01 23:50:22 2007 +0000
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=`pkg-config --cflags gobject-2.0 gmodule-2.0` -g -I../ -DSTANDALONE
+CFLAGS=`pkg-config --cflags gobject-2.0 gmodule-2.0` -g -I../ -DSTANDALONE -I/usr/include/ncursesw/
 LDFLAGS=`pkg-config --libs gobject-2.0 gmodule-2.0 gnt` -pg
 
 EXAMPLES=combo focus tv multiwin keys menu parse
--- a/finch/libgnt/test/file.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/libgnt/test/file.c	Sat Sep 01 23:50:22 2007 +0000
@@ -14,7 +14,7 @@
 	gnt_init();
 
 	GntWidget *w = gnt_file_sel_new();
-	gnt_file_sel_set_current_location(GNT_FILE_SEL(w), "/home/");
+	gnt_file_sel_set_current_location(GNT_FILE_SEL(w), "asd/home/asdasd/qweqweasd");
 	gnt_file_sel_set_dirs_only(GNT_FILE_SEL(w), TRUE);
 	gnt_file_sel_set_multi_select(GNT_FILE_SEL(w), TRUE);
 	gnt_widget_show(w);
--- a/finch/libgnt/test/menu.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/libgnt/test/menu.c	Sat Sep 01 23:50:22 2007 +0000
@@ -24,9 +24,6 @@
 
 	gnt_menu_add_item(GNT_MENU(menu), GNT_MENU_ITEM(item));
 
-	item = gnt_menuitem_new("Edit");
-	gnt_menu_add_item(GNT_MENU(menu), GNT_MENU_ITEM(item));
-
 	item = gnt_menuitem_new("Help");
 	gnt_menu_add_item(GNT_MENU(menu), GNT_MENU_ITEM(item));
 
@@ -53,6 +50,14 @@
 	gnt_menu_add_item(GNT_MENU(sub), GNT_MENU_ITEM(item));
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), dothis, NULL);
 
+	item = gnt_menuitem_new("asd");
+	gnt_menuitem_set_trigger(GNT_MENU_ITEM(item), 'k');
+	gnt_menu_add_item(GNT_MENU(sub), GNT_MENU_ITEM(item));
+	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), dothis, NULL);
+
+	item = gnt_menuitem_new("Edit");
+	gnt_menu_add_item(GNT_MENU(menu), GNT_MENU_ITEM(item));
+
 	gnt_screen_menu_show(menu);
 
 	GntWidget *win = gnt_window_new();
--- a/finch/libgnt/test/tv.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/finch/libgnt/test/tv.c	Sat Sep 01 23:50:22 2007 +0000
@@ -7,6 +7,28 @@
 #include "gnttextview.h"
 #include "gntutils.h"
 
+static test()
+{
+    GntWidget *win;
+    GntWidget *tv;
+    GntWidget *entry;
+
+    win = gnt_window_box_new(FALSE, TRUE);
+    tv = gnt_text_view_new();
+    gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(tv), "line1\nline2\nline3\n", GNT_TEXT_FLAG_NORMAL);
+    gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(tv),"line4\n\nline5\n\nline6\n\n",
+GNT_TEXT_FLAG_NORMAL);
+
+    gnt_text_view_scroll(GNT_TEXT_VIEW(tv), 10);
+    gnt_box_add_widget(GNT_BOX(win), tv);
+
+    entry = gnt_entry_new("");
+    gnt_text_view_attach_scroll_widget(GNT_TEXT_VIEW(tv),entry);
+    gnt_box_add_widget(GNT_BOX(win), entry);
+
+    gnt_widget_show(win);
+}
+
 static gboolean
 key_pressed(GntWidget *w, const char *key, GntWidget *view)
 {
@@ -118,7 +140,38 @@
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD);
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 4th line\n", GNT_TEXT_FLAG_NORMAL);
 
-	gnt_util_parse_xhtml_to_textview("<p><b>Ohoy hoy!!</b><br/><p>I think this is going to</p> <u> WORK!!! </u><a href='www.google.com'>check this out!!</a></p>", GNT_TEXT_VIEW(view));
+	gnt_util_parse_xhtml_to_textview("<p><b>Ohoy hoy!!</b><br/><p>I think this is going to</p> <u> WORK!!! </u><a href='www.google.com'><b>check this out!!</b></a></p>", GNT_TEXT_VIEW(view));
+
+	gnt_util_parse_xhtml_to_textview("<html>\
+  <head>\
+    <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\
+    <title>Conversation with user@gmail.com at Sun Jun  3 14:58:54 2007 on aluink@gmail.com/Gaim (jabber)</title>\
+  </head>\
+  <body>\
+    <h3>Conversation with user@gmail.com at Sun Jun  3 14:58:54 2007 on aluink@gmail.com/Gaim (jabber)</h3>\
+    <font color=\"#A82F2F\">\
+      <font size=\"2\">(14:58:54)</font>\
+      <b>user@gmail.com:</b>\
+    </font>\
+\
+\
+\
+    <html xmlns='http://jabber.org/protocol/xhtml-im'>\
+      <body xmlns='http://www.w3.org/1999/xhtml'>Some message from user\
+      </body>\
+    </html><br/>\
+\
+\
+\
+    <font color=\"#16569E\">\
+      <font size=\"2\">(15:03:19)</font> \
+      <b>aluink:</b>\
+    </font> Some more stuff from me<br/>                               \
+  </body>\
+</html>", GNT_TEXT_VIEW(view));
+
+
+test();
 
 #ifdef STANDALONE
 	gnt_main();
--- a/libpurple/Makefile.am	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/Makefile.am	Sat Sep 01 23:50:22 2007 +0000
@@ -1,4 +1,5 @@
 EXTRA_DIST = \
+		example/ \
 		dbus-analyze-functions.py \
 		dbus-analyze-types.py \
 		purple-notifications-example \
@@ -29,7 +30,7 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = purple.pc
 
-SUBDIRS = $(GCONF_DIR) plugins protocols tests . example
+SUBDIRS = plugins protocols
 
 purple_coresources = \
 	account.c \
--- a/libpurple/certificate.h	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/certificate.h	Sat Sep 01 23:50:22 2007 +0000
@@ -771,6 +771,16 @@
 void
 purple_certificate_display_x509(PurpleCertificate *crt);
 
+/**
+ * Initialize the certificate subsystem.
+ */
+void purple_certificates_init(void);
+
+/**
+ * Uninitialize the certificate subsystem.
+ */
+void purple_certificates_uninit(void);
+
 
 #ifdef __cplusplus
 }
--- a/libpurple/conversation.h	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/conversation.h	Sat Sep 01 23:50:22 2007 +0000
@@ -667,7 +667,7 @@
  *
  * @param conv   The conversation
  *
- * @return  A GList of PurpleConvMessage's. The must not modify the list or the data within.
+ * @return  A GList of PurpleConvMessage's. Caller must not modify the list or the data within.
  *          The list contains the newest message at the beginning, and the oldest message at
  *          the end.
  */
--- a/libpurple/eventloop.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/eventloop.c	Sat Sep 01 23:50:22 2007 +0000
@@ -67,6 +67,8 @@
 {
 	PurpleEventLoopUiOps *ops = purple_eventloop_get_ui_ops();
 
+	g_printerr("XXX: removing %d\n", tag);
+
 	return ops->input_remove(tag);
 }
 
--- a/libpurple/example/nullclient.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/example/nullclient.c	Sat Sep 01 23:50:22 2007 +0000
@@ -21,9 +21,6 @@
  *
  */
 
-/* XXX: we probably shouldn't include internal.h in examples */
-#include "internal.h"
-
 #include "account.h"
 #include "conversation.h"
 #include "core.h"
--- a/libpurple/ft.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/ft.c	Sat Sep 01 23:50:22 2007 +0000
@@ -20,7 +20,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
  */
 #include "internal.h"
 #include "dbus-maybe.h"
--- a/libpurple/plugins/autoaccept.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/plugins/autoaccept.c	Sat Sep 01 23:50:22 2007 +0000
@@ -106,12 +106,12 @@
 	node = node->parent;
 	g_return_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node));
 
-	pref = purple_prefs_get_string(PREF_PATH);
 	switch (purple_blist_node_get_int(node, "autoaccept"))
 	{
 		case FT_ASK:
 			break;
 		case FT_ACCEPT:
+			pref = purple_prefs_get_string(PREF_PATH);
 			if (ensure_path_exists(pref))
 			{
 				dirname = g_build_filename(pref, xfer->who, NULL);
--- a/libpurple/plugins/dbus-example.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/plugins/dbus-example.c	Sat Sep 01 23:50:22 2007 +0000
@@ -49,6 +49,7 @@
 #define DBUS_API_SUBJECT_TO_CHANGE
 #include "dbus-maybe.h"
 #include "dbus-bindings.h"
+#include "dbus-purple.h"
 
 typedef struct {
 	char *text;
--- a/libpurple/plugins/statenotify.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/plugins/statenotify.c	Sat Sep 01 23:50:22 2007 +0000
@@ -46,10 +46,19 @@
 	old_available = purple_status_is_available(old_status);
 
 	if (purple_prefs_get_bool("/plugins/core/statenotify/notify_away")) {
+		char *message = NULL;
+		const char *msgstatus = purple_status_get_attr_string(status, "message");
+		msgstatus = msgstatus ? msgstatus : "";
 		if (available && !old_available)
-			write_status(buddy, _("%s is no longer away."));
+			message = g_strdup_printf("%s%s%s", _("%s is no longer away"), msgstatus[0] ? ": " : ".", msgstatus);
 		else if (!available && old_available)
-			write_status(buddy, _("%s has gone away."));
+			message = g_strdup_printf("%s%s%s", ("%s has gone away"), msgstatus[0] ? ": " : ".", msgstatus);
+		else if (msgstatus[0])
+			message = g_strdup_printf("%s %s", _("%s has changed status message to:"), msgstatus);
+		else
+			message = g_strdup(_("%s has removed his status message."));
+		write_status(buddy, message);
+		g_free(message);
 	}
 }
 
--- a/libpurple/proxy.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/proxy.c	Sat Sep 01 23:50:22 2007 +0000
@@ -329,6 +329,7 @@
 
 	if (connect_data->fd >= 0)
 	{
+		g_printerr("XXX: closing %d\n", connect_data->fd);
 		close(connect_data->fd);
 		connect_data->fd = -1;
 	}
--- a/libpurple/util.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/libpurple/util.c	Sat Sep 01 23:50:22 2007 +0000
@@ -31,6 +31,14 @@
 #include "prefs.h"
 #include "util.h"
 
+#ifdef HAVE_DBUS
+#  define DBUS_API_SUBJECT_TO_CHANGE
+#  include <dbus/dbus.h>
+#  include "dbus-purple.h"
+#  include "dbus-server.h"
+#  include "dbus-bindings.h"
+#endif
+
 struct _PurpleUtilFetchUrlData
 {
 	PurpleUtilFetchUrlCallback callback;
@@ -2533,6 +2541,24 @@
 #endif
 }
 
+static gboolean
+write_dbus_file(const char *filename, const char *data, size_t size)
+{
+	DBusConnection *dbus_connection = NULL;
+	DBusMessage *msg = NULL;
+	if ((dbus_connection = purple_dbus_get_connection()) == NULL)
+		return FALSE;
+	msg = dbus_message_new_method_call(DBUS_SERVICE_PURPLE, DBUS_PATH_PURPLE,
+				DBUS_INTERFACE_PURPLE, "PurpleUtilWriteDataToFile");
+	if (msg == NULL)
+		return NULL;
+
+	dbus_message_append_args(msg, DBUS_TYPE_STRING, filename, DBUS_TYPE_STRING, data,
+			DBUS_TYPE_UINT32, size, DBUS_TYPE_INVALID);
+	dbus_connection_send(dbus_connection, msg, NULL);
+	return TRUE;
+}
+
 /*
  * This function is long and beautiful, like my--um, yeah.  Anyway,
  * it includes lots of error checking so as we don't overwrite
@@ -2546,7 +2572,12 @@
 	gboolean ret = FALSE;
 
 	g_return_val_if_fail(user_dir != NULL, FALSE);
-
+#if 0
+	if (!purple_dbus_is_owner()) {
+		if (write_dbus_file(filename, data, size))
+			return TRUE;
+	}
+#endif
 	purple_debug_info("util", "Writing file %s to directory %s\n",
 					filename, user_dir);
 
@@ -2584,7 +2615,7 @@
 	filename_temp = g_strdup_printf("%s.save", filename_full);
 
 	/* Remove an old temporary file, if one exists */
-	if (g_file_test(filename_temp, G_FILE_TEST_EXISTS))
+	if (g_file_test(filename_temp, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
 	{
 		if (g_unlink(filename_temp) == -1)
 		{
--- a/pidgin/gtkblist.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/pidgin/gtkblist.c	Sat Sep 01 23:50:22 2007 +0000
@@ -2622,6 +2622,7 @@
 	struct _pidgin_blist_node *gtknode;
 	GdkRectangle mon_size;
 	int sig;
+	const char *name;
 	
 	if (node == NULL)
 		return;
@@ -2679,8 +2680,9 @@
 
 	gtknode = node->ui_data;
 
+	name = gtk_window_get_title(GTK_WINDOW(gtk_widget_get_toplevel(widget)));
 	gtk_widget_set_app_paintable(gtkblist->tipwindow, TRUE);
-	gtk_window_set_title(GTK_WINDOW(gtkblist->tipwindow), _("Buddy List"));
+	gtk_window_set_title(GTK_WINDOW(gtkblist->tipwindow), name ? name : _("Buddy List"));
 	gtk_window_set_resizable(GTK_WINDOW(gtkblist->tipwindow), FALSE);
 	gtk_widget_set_name(gtkblist->tipwindow, "gtk-tooltips");
 	g_signal_connect(G_OBJECT(gtkblist->tipwindow), "expose_event",
--- a/pidgin/gtkimhtml.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/pidgin/gtkimhtml.c	Sat Sep 01 23:50:22 2007 +0000
@@ -2101,9 +2101,9 @@
 	}
 
 	*type = -1;
-	*len = close - string + 1;
-	*tag = g_strndup(string, *len - 1);
-	return TRUE;
+	*len = 0; //close - string + 1;
+	*tag = NULL; //g_strndup(string, *len - 1);
+	return FALSE;
 }
 
 static gchar*
--- a/pidgin/gtkmain.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/pidgin/gtkmain.c	Sat Sep 01 23:50:22 2007 +0000
@@ -877,3 +877,11 @@
 
 	return 0;
 }
+
+#undef g_file_test
+gboolean my_g_file_test(const char *file, int test)
+{
+	g_printerr("XXX: checking for %s (%d)\n", file, test);
+	return g_file_test(file, test);
+}
+
--- a/pidgin/gtkplugin.c	Sat Sep 01 23:09:41 2007 +0000
+++ b/pidgin/gtkplugin.c	Sat Sep 01 23:50:22 2007 +0000
@@ -600,6 +600,7 @@
 	plugin_details = gtk_label_new(NULL);
 	gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE);
 	gtk_container_add(GTK_CONTAINER(expander), plugin_details);
+	gtk_expander_set_expanded(GTK_EXPANDER(expander), TRUE);
 	gtk_widget_set_sensitive(expander, FALSE);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0);
 
--- a/pidgin/plugins/perl/common/GtkDialogs.xs	Sat Sep 01 23:09:41 2007 +0000
+++ b/pidgin/plugins/perl/common/GtkDialogs.xs	Sat Sep 01 23:50:22 2007 +0000
@@ -7,7 +7,8 @@
 pidgin_dialogs_destroy_all()
 
 void
-pidgin_dialogs_about()
+pidgin_dialogs_about(parent)
+	GtkWidget * parent
 
 void
 pidgin_dialogs_im()