grim/guifications1

Parents 85f189cc71db
Children 30d0f0f6a102
A patch from a currently unknown patcher to add a guification for receiving messages. This needs work yet since it can get highly irritable...
--- a/src/gf_conf.c Fri Apr 23 10:57:29 2004 +0000
+++ b/src/gf_conf.c Sat Apr 24 08:32:34 2004 +0000
@@ -126,7 +126,16 @@
chk_btn = gf_make_check_button(gaim_prefs_get_bool(GF_PREF_BEHAVIOR_SHOW_UNIDLE), "Show _Unidle", sg);
g_signal_connect(G_OBJECT(chk_btn), "clicked", G_CALLBACK(chk_box_cb), (gpointer)GF_PREF_BEHAVIOR_SHOW_UNIDLE);
gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0);
-
+
+ /* create the messages hbox */
+ hbox = gtk_hbox_new(FALSE, 4);
+ gtk_box_pack_start(GTK_BOX(frame), hbox, FALSE, FALSE, 0);
+
+ /* create receive messages check */
+ chk_btn = gf_make_check_button(gaim_prefs_get_bool(GF_PREF_BEHAVIOR_SHOW_RECEIVE_MESSAGES), "Show _Received Messages", sg);
+ g_signal_connect(G_OBJECT(chk_btn), "clicked", G_CALLBACK(chk_box_cb), (gpointer)GF_PREF_BEHAVIOR_SHOW_RECEIVE_MESSAGES);
+ gtk_box_pack_start(GTK_BOX(hbox), chk_btn, FALSE, FALSE, 0);
+
/* create position frame */
frame = gaim_gtk_make_frame(vbox, "Position");
@@ -362,6 +371,10 @@
label = gf_add_label(edt_box, "_Unidle:", sg);
gtk_box_pack_start(GTK_BOX(frame), label, FALSE, FALSE, 0);
+ /* create receive line */
+ edt_box = make_entry(GF_PREF_MESSAGES_RECEIVE);
+ label = gf_add_label(edt_box, "_Receive:", sg);
+ gtk_box_pack_start(GTK_BOX(frame), label, FALSE, FALSE, 0);
/*******************************************************************
Advanced tab
*******************************************************************/
--- a/src/gf_prefs.c Fri Apr 23 10:57:29 2004 +0000
+++ b/src/gf_prefs.c Sat Apr 24 08:32:34 2004 +0000
@@ -37,6 +37,7 @@
gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_BACK, TRUE);
gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_IDLE, TRUE);
gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_UNIDLE, TRUE);
+ gaim_prefs_add_bool(GF_PREF_BEHAVIOR_SHOW_RECEIVE_MESSAGES, TRUE);
gaim_prefs_add_int(GF_PREF_BEHAVIOR_WINDOW_POS, window_position_se);
gaim_prefs_add_bool(GF_PREF_BEHAVIOR_WINDOW_VERTICAL, TRUE);
gaim_prefs_add_int(GF_PREF_BEHAVIOR_TIMEOUT, 6);
@@ -75,6 +76,7 @@
gaim_prefs_add_string(GF_PREF_MESSAGES_BACK, "is now back");
gaim_prefs_add_string(GF_PREF_MESSAGES_IDLE, "is now idle");
gaim_prefs_add_string(GF_PREF_MESSAGES_UNIDLE, "is no longer idle");
+ gaim_prefs_add_string(GF_PREF_MESSAGES_RECEIVE, "messaged you");
/* add advanced tree */
gaim_prefs_add_none(GF_PREF_ADVANCED_ROOT);
--- a/src/gf_prefs.h Fri Apr 23 10:57:29 2004 +0000
+++ b/src/gf_prefs.h Sat Apr 24 08:32:34 2004 +0000
@@ -31,6 +31,7 @@
#define GF_PREF_BEHAVIOR_SHOW_BACK "/plugins/gtk/amc_grim/guifications/behavior/back"
#define GF_PREF_BEHAVIOR_SHOW_IDLE "/plugins/gtk/amc_grim/guifications/behavior/idle"
#define GF_PREF_BEHAVIOR_SHOW_UNIDLE "/plugins/gtk/amc_grim/guifications/behavior/unidle"
+#define GF_PREF_BEHAVIOR_SHOW_RECEIVE_MESSAGES "/plugins/gtk/amc_grim/guifications/behavior/rcvmsg"
#define GF_PREF_BEHAVIOR_WINDOW_POS "/plugins/gtk/amc_grim/guifications/behavior/pos"
#define GF_PREF_BEHAVIOR_WINDOW_VERTICAL "/plugins/gtk/amc_grim/guifications/behavior/vertical"
#define GF_PREF_BEHAVIOR_TIMEOUT "/plugins/gtk/amc_grim/guifications/behavior/timeout"
@@ -63,6 +64,7 @@
#define GF_PREF_MESSAGES_BACK "/plugins/gtk/amc_grim/guifications/messages/back"
#define GF_PREF_MESSAGES_IDLE "/plugins/gtk/amc_grim/guifications/messages/idle"
#define GF_PREF_MESSAGES_UNIDLE "/plugins/gtk/amc_grim/guifications/messages/unidle"
+#define GF_PREF_MESSAGES_RECEIVE "/plugins/gtk/amc_grim/guifications/messages/receive"
#define GF_PREF_ADVANCED_ROOT "/plugins/gtk/amc_grim/guifications/advanced"
#define GF_PREF_ADVANCED_DELAY "/plugins/gtk/amc_grim/guifications/advanced/delay"
#define GF_PREF_ADVANCED_RELEASE "/plugins/gtk/amc_grim/guifications/advanced/release_notification"
--- a/src/gf_types.h Fri Apr 23 10:57:29 2004 +0000
+++ b/src/gf_types.h Sat Apr 24 08:32:34 2004 +0000
@@ -26,6 +26,7 @@
gf_event_back,
gf_event_idle,
gf_event_unidle,
+ gf_event_rcv_msg,
gf_event_custom
} gf_event;
--- a/src/guifications.c Fri Apr 23 10:57:29 2004 +0000
+++ b/src/guifications.c Sat Apr 24 08:32:34 2004 +0000
@@ -69,6 +69,8 @@
static void gf_account(GaimAccount *account, void *data);
static gint gf_rem_account(gpointer account);
static void gf_event_cb(GaimBuddy *buddy, gpointer data);
+static gboolean gf_event_cb2(GaimAccount *account, char **sender,
+ char **message, int *flags, void *data);
static void make_gf_window();
static gint rem_guification(gpointer pguification);
static void destroy_guification(GtkWidget *guification);
@@ -135,6 +137,7 @@
static gboolean
gf_load(GaimPlugin *plugin) {
void *blist = gaim_blist_get_handle();
+ void *conversation = gaim_conversations_get_handle();
gaim_signal_connect(gaim_accounts_get_handle(), "account-connecting", plugin, GAIM_CALLBACK(gf_account), NULL);
gaim_signal_connect(gaim_connections_get_handle(), "signed-on", plugin, GAIM_CALLBACK(gf_signed_on), NULL);
@@ -145,7 +148,8 @@
gaim_signal_connect(blist, "buddy-back", plugin, GAIM_CALLBACK(gf_event_cb), (gpointer)gf_event_back);
gaim_signal_connect(blist, "buddy-idle", plugin, GAIM_CALLBACK(gf_event_cb), (gpointer)gf_event_idle);
gaim_signal_connect(blist, "buddy-unidle", plugin, GAIM_CALLBACK(gf_event_cb), (gpointer)gf_event_unidle);
-
+ gaim_signal_connect(conversation, "received-im-msg", plugin, GAIM_CALLBACK(gf_event_cb2), (gpointer)gf_event_rcv_msg);
+
if (gaim_connections_get_all())
gf_release_check();
@@ -159,6 +163,13 @@
return TRUE;
}
+static gboolean
+gf_event_cb2(GaimAccount *account, char **sender,
+ char **message, int *flags, void *data) {
+ gf_event_cb(gaim_find_buddy(account,*sender),data);
+ return FALSE;
+
+}
static void
gf_event_cb(GaimBuddy *buddy, gpointer data) {
gf_event gf_new_event = (gf_event)data;
@@ -202,6 +213,10 @@
if (!gaim_prefs_get_bool(GF_PREF_BEHAVIOR_SHOW_UNIDLE))
return;
break;
+ case gf_event_rcv_msg:
+ if (!gaim_prefs_get_bool(GF_PREF_BEHAVIOR_SHOW_RECEIVE_MESSAGES))
+ return;
+ break;
case gf_event_custom:
return;
}
@@ -381,6 +396,7 @@
case gf_event_back: message = g_strdup(gaim_prefs_get_string(GF_PREF_MESSAGES_BACK)); break;
case gf_event_idle: message = g_strdup(gaim_prefs_get_string(GF_PREF_MESSAGES_IDLE)); break;
case gf_event_unidle: message = g_strdup(gaim_prefs_get_string(GF_PREF_MESSAGES_UNIDLE)); break;
+ case gf_event_rcv_msg: message = g_strdup(gaim_prefs_get_string(GF_PREF_MESSAGES_RECEIVE)); break;
case gf_event_custom: return NULL; break; /* not yet implemented */
}