pidgin/plugins/mailchk.c

changeset 15562
8c8249fe5e3c
parent 15435
4b933b06d75e
child 15884
4de1981757fc
equal deleted inserted replaced
15561:bdb019a1f485 15562:8c8249fe5e3c
58 GaimBuddyList *list = gaim_get_blist(); 58 GaimBuddyList *list = gaim_get_blist();
59 59
60 if (count == -1) 60 if (count == -1)
61 return FALSE; 61 return FALSE;
62 62
63 if (!list || !GAIM_IS_GTK_BLIST(list) || !(GAIM_GTK_BLIST(list)->vbox)) 63 if (!list || !GAIM_IS_GTK_BLIST(list) || !(PIDGIN_BLIST(list)->vbox))
64 return TRUE; 64 return TRUE;
65 65
66 if (!mail) { 66 if (!mail) {
67 /* guess we better build it then :P */ 67 /* guess we better build it then :P */
68 GtkWidget *vbox = GAIM_GTK_BLIST(list)->vbox; 68 GtkWidget *vbox = PIDGIN_BLIST(list)->vbox;
69 69
70 mail = gtk_label_new("No mail messages."); 70 mail = gtk_label_new("No mail messages.");
71 gtk_box_pack_start(GTK_BOX(vbox), mail, FALSE, FALSE, 0); 71 gtk_box_pack_start(GTK_BOX(vbox), mail, FALSE, FALSE, 0);
72 gtk_box_reorder_child(GTK_BOX(vbox), mail, 1); 72 gtk_box_reorder_child(GTK_BOX(vbox), mail, 1);
73 g_signal_connect(G_OBJECT(mail), "destroy", G_CALLBACK(destroy_cb), NULL); 73 g_signal_connect(G_OBJECT(mail), "destroy", G_CALLBACK(destroy_cb), NULL);
99 99
100 static void 100 static void
101 signoff_cb(GaimConnection *gc) 101 signoff_cb(GaimConnection *gc)
102 { 102 {
103 GaimBuddyList *list = gaim_get_blist(); 103 GaimBuddyList *list = gaim_get_blist();
104 if ((!list || !GAIM_IS_GTK_BLIST(list) || !GAIM_GTK_BLIST(list)->vbox) && timer) { 104 if ((!list || !GAIM_IS_GTK_BLIST(list) || !PIDGIN_BLIST(list)->vbox) && timer) {
105 g_source_remove(timer); 105 g_source_remove(timer);
106 timer = 0; 106 timer = 0;
107 } 107 }
108 } 108 }
109 109
120 if (!check_timeout(NULL)) { 120 if (!check_timeout(NULL)) {
121 gaim_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER"); 121 gaim_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER");
122 return FALSE; 122 return FALSE;
123 } 123 }
124 124
125 if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox) 125 if (list && GAIM_IS_GTK_BLIST(list) && PIDGIN_BLIST(list)->vbox)
126 timer = g_timeout_add(2000, check_timeout, NULL); 126 timer = g_timeout_add(2000, check_timeout, NULL);
127 127
128 gaim_signal_connect(conn_handle, "signed-on", 128 gaim_signal_connect(conn_handle, "signed-on",
129 plugin, GAIM_CALLBACK(signon_cb), NULL); 129 plugin, GAIM_CALLBACK(signon_cb), NULL);
130 gaim_signal_connect(conn_handle, "signed-off", 130 gaim_signal_connect(conn_handle, "signed-off",
150 { 150 {
151 GAIM_PLUGIN_MAGIC, 151 GAIM_PLUGIN_MAGIC,
152 GAIM_MAJOR_VERSION, 152 GAIM_MAJOR_VERSION,
153 GAIM_MINOR_VERSION, 153 GAIM_MINOR_VERSION,
154 GAIM_PLUGIN_STANDARD, 154 GAIM_PLUGIN_STANDARD,
155 GAIM_GTK_PLUGIN_TYPE, 155 PIDGIN_PLUGIN_TYPE,
156 0, 156 0,
157 NULL, 157 NULL,
158 GAIM_PRIORITY_DEFAULT, 158 GAIM_PRIORITY_DEFAULT,
159 MAILCHK_PLUGIN_ID, 159 MAILCHK_PLUGIN_ID,
160 N_("Mail Checker"), 160 N_("Mail Checker"),

mercurial