Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
10491:9655389f4b81 | 10492:45ad1d15fab3 |
---|---|
62 * | 62 * |
63 * Etan yet again, 04 April 2004: | 63 * Etan yet again, 04 April 2004: |
64 * -Re-added Urgent option | 64 * -Re-added Urgent option |
65 * -Re-added unnotify on focus option (still needs work, as it will only | 65 * -Re-added unnotify on focus option (still needs work, as it will only |
66 * react to focus-in events when the entry or history widgets are focused) | 66 * react to focus-in events when the entry or history widgets are focused) |
67 * | |
68 * Sean, 08 January, 2005: | |
69 * -Added Raise option, formally in Gaim proper | |
67 */ | 70 */ |
68 | 71 |
69 #include "internal.h" | 72 #include "internal.h" |
70 #include "gtkgaim.h" | 73 #include "gtkgaim.h" |
74 #include "gtkprefs.h" | |
71 | 75 |
72 #include "debug.h" | 76 #include "debug.h" |
73 #include "prefs.h" | 77 #include "prefs.h" |
74 #include "signals.h" | 78 #include "signals.h" |
75 #include "version.h" | 79 #include "version.h" |
96 static void method_toggle_cb(GtkWidget *widget, gpointer data); | 100 static void method_toggle_cb(GtkWidget *widget, gpointer data); |
97 static void notify_toggle_cb(GtkWidget *widget, gpointer data); | 101 static void notify_toggle_cb(GtkWidget *widget, gpointer data); |
98 static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data); | 102 static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data); |
99 static void apply_method(); | 103 static void apply_method(); |
100 static void apply_notify(); | 104 static void apply_notify(); |
105 | |
106 /* raise function */ | |
107 static void handle_raise(GaimConvWindow *window); | |
101 | 108 |
102 /* string function */ | 109 /* string function */ |
103 static void handle_string(GaimConvWindow *window); | 110 static void handle_string(GaimConvWindow *window); |
104 | 111 |
105 /* count function */ | 112 /* count function */ |
173 handle_count(gaimwin); | 180 handle_count(gaimwin); |
174 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) | 181 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) |
175 handle_string(gaimwin); | 182 handle_string(gaimwin); |
176 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")) | 183 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")) |
177 handle_urgent(gaimwin, TRUE); | 184 handle_urgent(gaimwin, TRUE); |
185 if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_raise")) | |
186 handle_raise(gaimwin); | |
178 } | 187 } |
179 | 188 |
180 static void | 189 static void |
181 unnotify(GaimConversation *conv, gboolean reset) | 190 unnotify(GaimConversation *conv, gboolean reset) |
182 { | 191 { |
457 gtk_window_get_title(window)); | 466 gtk_window_get_title(window)); |
458 gtk_window_set_title(window, newtitle); | 467 gtk_window_set_title(window, newtitle); |
459 } | 468 } |
460 | 469 |
461 static void | 470 static void |
471 handle_raise(GaimConvWindow *gaimwin) | |
472 { | |
473 GtkWindow *window = GTK_WINDOW(GAIM_GTK_WINDOW(gaimwin)->window); | |
474 gtk_window_present(window); | |
475 } | |
476 | |
477 static void | |
462 handle_count(GaimConvWindow *gaimwin) | 478 handle_count(GaimConvWindow *gaimwin) |
463 { | 479 { |
464 GtkWindow *window; | 480 GtkWindow *window; |
465 char newtitle[256]; | 481 char newtitle[256]; |
466 | 482 |
626 | 642 |
627 /*---------- "Notification Methods" ----------*/ | 643 /*---------- "Notification Methods" ----------*/ |
628 frame = gaim_gtk_make_frame(ret, _("Notification Methods")); | 644 frame = gaim_gtk_make_frame(ret, _("Notification Methods")); |
629 vbox = gtk_vbox_new(FALSE, 5); | 645 vbox = gtk_vbox_new(FALSE, 5); |
630 gtk_container_add(GTK_CONTAINER(frame), vbox); | 646 gtk_container_add(GTK_CONTAINER(frame), vbox); |
647 | |
648 /* Raise method button */ | |
649 gaim_gtk_prefs_checkbox("R_aise window", "/plugins/gtk/X11/notify/method_raise", vbox); | |
631 | 650 |
632 /* String method button */ | 651 /* String method button */ |
633 hbox = gtk_hbox_new(FALSE, 18); | 652 hbox = gtk_hbox_new(FALSE, 18); |
634 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 653 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
635 toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:")); | 654 toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title:")); |
826 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE); | 845 gaim_prefs_add_bool("/plugins/gtk/X11/notify/type_focused", FALSE); |
827 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE); | 846 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_string", FALSE); |
828 gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); | 847 gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); |
829 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); | 848 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); |
830 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); | 849 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); |
850 gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_raise", FALSE); | |
831 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", FALSE); | 851 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", FALSE); |
832 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE); | 852 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE); |
833 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE); | 853 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_type", TRUE); |
834 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_send", TRUE); | 854 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_send", TRUE); |
835 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_switch", TRUE); | 855 gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_switch", TRUE); |