diff plugins/notify.c @ 10492:45ad1d15fab3

[gaim-migrate @ 11782] ChangeLogged slashed prefs. gaim_pref_removed slashed prefs. Added Raise to notify.c. I gaim_pref_renamed raise IM window on events to notify's pref. It's a hack but I'm wondering if anyone has any serious problem with that. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 09 Jan 2005 00:13:34 +0000
parents 2e01c503aa4f
children 1a65fc2d7978
line wrap: on
line diff
--- a/plugins/notify.c	Sat Jan 08 23:40:24 2005 +0000
+++ b/plugins/notify.c	Sun Jan 09 00:13:34 2005 +0000
@@ -64,10 +64,14 @@
  *  -Re-added Urgent option
  *  -Re-added unnotify on focus option (still needs work, as it will only
  *  react to focus-in events when the entry or history widgets are focused)
+ *
+ * Sean, 08 January, 2005:
+ *  -Added Raise option, formally in Gaim proper
  */
 
 #include "internal.h"
 #include "gtkgaim.h"
+#include "gtkprefs.h"
 
 #include "debug.h"
 #include "prefs.h"
@@ -99,6 +103,9 @@
 static void apply_method();
 static void apply_notify();
 
+/* raise function */
+static void handle_raise(GaimConvWindow *window);
+
 /* string function */
 static void handle_string(GaimConvWindow *window);
 
@@ -175,6 +182,8 @@
 		handle_string(gaimwin);
 	if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent"))
 		handle_urgent(gaimwin, TRUE);
+	if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_raise"))
+		handle_raise(gaimwin);
 }
 
 static void
@@ -459,6 +468,13 @@
 }
 
 static void
+handle_raise(GaimConvWindow *gaimwin)
+{
+	GtkWindow *window = GTK_WINDOW(GAIM_GTK_WINDOW(gaimwin)->window);
+	gtk_window_present(window);
+}
+
+static void
 handle_count(GaimConvWindow *gaimwin)
 {
 	GtkWindow *window;
@@ -628,6 +644,9 @@
 	frame = gaim_gtk_make_frame(ret, _("Notification Methods"));
 	vbox = gtk_vbox_new(FALSE, 5);
 	gtk_container_add(GTK_CONTAINER(frame), vbox);
+	
+	/* Raise method button */
+	gaim_gtk_prefs_checkbox("R_aise window", "/plugins/gtk/X11/notify/method_raise", vbox);
 
 	/* String method button */
 	hbox = gtk_hbox_new(FALSE, 18);
@@ -828,6 +847,7 @@
 	gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)");
 	gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE);
 	gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE);
+	gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_raise", FALSE);
 	gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", FALSE);
 	gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE);
 	gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE);