|
From: <sa...@us...> - 2006-09-01 02:09:30
|
Revision: 17104
http://svn.sourceforge.net/gaim/?rev=17104&view=rev
Author: sadrul
Date: 2006-08-31 19:07:23 -0700 (Thu, 31 Aug 2006)
Log Message:
-----------
Add option in gntgf to set the URGENT hint for the terminal's window (in X).
Unescape the status-string in the statusbox.
Modified Paths:
--------------
trunk/configure.ac
trunk/console/gntblist.c
trunk/console/libgnt/gntbox.c
trunk/console/plugins/Makefile.am
trunk/console/plugins/gntgf.c
trunk/doc/gntgaim.1.in
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/configure.ac 2006-09-01 02:07:23 UTC (rev 17104)
@@ -680,6 +680,11 @@
x_incpath_add="-I$x_includes"
fi
+PKG_CHECK_MODULES(X11, x11,
+ [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])], [AC_MSG_RESULT(no)])
+AC_SUBST(X11_LIBS)
+AC_SUBST(X11_CFLAGS)
+
dnl #######################################################################
dnl # Check for DBUS libraries
dnl #######################################################################
@@ -823,21 +828,6 @@
if test "x$enable_gtk" = "xyes"; then
-AC_PATH_XTRA
-# We can't assume that $x_libraries will be set, because autoconf does not
-# set it in the case when the X libraries are in a standard place.
-# Ditto for $x_includes
-if test X"$x_libraries" = X"" || test X"$x_libraries" = XNONE; then
- x_libpath_add=
-else
- x_libpath_add="-L$x_libraries"
-fi
-if test X"$x_includes" = X"" || test X"$x_includes" = XNONE; then
- x_incpath_add=
-else
- x_incpath_add="-I$x_includes"
-fi
-
dnl #######################################################################
dnl # Check for startup notification
dnl #######################################################################
Modified: trunk/console/gntblist.c
===================================================================
--- trunk/console/gntblist.c 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/console/gntblist.c 2006-09-01 02:07:23 UTC (rev 17104)
@@ -127,7 +127,7 @@
g_return_if_fail(node != NULL);
if (list->ui_data == NULL)
- return;
+ return; /* XXX: this is probably the place to auto-join chats */
if (node->ui_data != NULL) {
gnt_tree_change_text(GNT_TREE(ggblist->tree), node,
@@ -1417,9 +1417,11 @@
StatusBoxItem *item = list->data;
if (item->type == STATUS_PRIMITIVE && item->u.prim == prim)
{
+ char *mess = gaim_unescape_html(message);
gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item);
- gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), message);
+ gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), mess);
gnt_widget_draw(ggblist->status);
+ g_free(mess);
break;
}
}
Modified: trunk/console/libgnt/gntbox.c
===================================================================
--- trunk/console/libgnt/gntbox.c 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/console/libgnt/gntbox.c 2006-09-01 02:07:23 UTC (rev 17104)
@@ -67,7 +67,6 @@
int pos, right;
char *title = g_strdup(box->title);
- mvwhline(widget->window, 0, 1, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.width - 2);
get_title_thingies(box, title, &pos, &right);
if (gnt_widget_has_focus(widget))
Modified: trunk/console/plugins/Makefile.am
===================================================================
--- trunk/console/plugins/Makefile.am 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/console/plugins/Makefile.am 2006-09-01 02:07:23 UTC (rev 17104)
@@ -1,4 +1,4 @@
-gntgf_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
+gntgf_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) $(X11_LIBS)
gnthistory_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
if PLUGINS
Modified: trunk/console/plugins/gntgf.c
===================================================================
--- trunk/console/plugins/gntgf.c 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/console/plugins/gntgf.c 2006-09-01 02:07:23 UTC (rev 17104)
@@ -33,6 +33,13 @@
#define MAX_COLS 3
+#ifdef HAVE_X11
+#define PREFS_URGENT PREFS_PREFIX "/urgent"
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
+
#include <glib.h>
#include <plugin.h>
@@ -103,7 +110,36 @@
return FALSE;
}
+#ifdef HAVE_X11
static void
+urgent()
+{
+ /* This is from deryni/tuomov's urgent_test.c */
+ Display *dpy;
+ Window id;
+ const char *ids;
+ XWMHints *hints;
+
+ ids = getenv("WINDOWID");
+ if (ids == NULL)
+ return;
+
+ id = atoi(ids);
+
+ dpy = XOpenDisplay(NULL);
+ if (dpy == NULL)
+ return;
+
+ hints = XGetWMHints(dpy, id);
+ hints->flags|=XUrgencyHint;
+ XSetWMHints(dpy, id, hints);
+
+ XFlush(dpy);
+ XCloseDisplay(dpy);
+}
+#endif
+
+static void
notify(const char *fmt, ...)
{
GntWidget *window;
@@ -114,6 +150,10 @@
if (gaim_prefs_get_bool(PREFS_BEEP))
beep();
+#ifdef HAVE_X11
+ if (gaim_prefs_get_bool(PREFS_URGENT))
+ urgent();
+#endif
window = gnt_vbox_new(FALSE);
GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT);
@@ -254,9 +294,9 @@
}
static void
-beep_toggled(GntCheckBox *check, gpointer null)
+toggle_option(GntCheckBox *check, gpointer str)
{
- gaim_prefs_set_bool(PREFS_BEEP, gnt_check_box_get_checked(check));
+ gaim_prefs_set_bool(str, gnt_check_box_get_checked(check));
}
static GntWidget *
@@ -288,9 +328,16 @@
check = gnt_check_box_new(_("Beep too!"));
gnt_check_box_set_checked(GNT_CHECK_BOX(check), gaim_prefs_get_bool(PREFS_BEEP));
- g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(beep_toggled), NULL);
+ g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_BEEP);
gnt_box_add_widget(GNT_BOX(window), check);
+#ifdef HAVE_X11
+ check = gnt_check_box_new(_("Set URGENT for the terminal window."));
+ gnt_check_box_set_checked(GNT_CHECK_BOX(check), gaim_prefs_get_bool(PREFS_URGENT));
+ g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_URGENT);
+ gnt_box_add_widget(GNT_BOX(window), check);
+#endif
+
return window;
}
@@ -335,6 +382,9 @@
gaim_prefs_add_bool(PREFS_EVENT_CHAT_NICK, TRUE);
gaim_prefs_add_bool(PREFS_BEEP, TRUE);
+#ifdef HAVE_X11
+ gaim_prefs_add_bool(PREFS_URGENT, TRUE);
+#endif
}
GAIM_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info)
Modified: trunk/doc/gntgaim.1.in
===================================================================
--- trunk/doc/gntgaim.1.in 2006-08-31 22:04:16 UTC (rev 17103)
+++ trunk/doc/gntgaim.1.in 2006-09-01 02:07:23 UTC (rev 17104)
@@ -96,6 +96,9 @@
.TP
.B Alt \+ l
Refresh the windows. This is useful after resizing the terminal window.
+.TP
+.B Alt \+ 1 2 ... 0
+Jump to the 1st, 2nd ... 10th window.
.SH FILES
\fI~/.gntrc\fR: configuration file for gnt applications.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|