| 54 static void |
54 static void |
| 55 update_launcher() |
55 update_launcher() |
| 56 { |
56 { |
| 57 guint count = 0; |
57 guint count = 0; |
| 58 GList *convs = NULL; |
58 GList *convs = NULL; |
| 59 g_return_if_fail(launcher != NULL && launcher_count != LAUNCHER_COUNT_DISABLE); |
59 g_return_if_fail(launcher != NULL); |
| |
60 if (launcher_count == LAUNCHER_COUNT_DISABLE) |
| |
61 return; |
| 60 |
62 |
| 61 if (launcher_count == LAUNCHER_COUNT_MESSAGES) { |
63 if (launcher_count == LAUNCHER_COUNT_MESSAGES) { |
| 62 for (convs = purple_get_conversations(); convs != NULL; convs = convs->next) { |
64 for (convs = purple_get_conversations(); convs != NULL; convs = convs->next) { |
| 63 PurpleConversation *conv = convs->data; |
65 PurpleConversation *conv = convs->data; |
| 64 count += GPOINTER_TO_INT(purple_conversation_get_data(conv, |
66 count += GPOINTER_TO_INT(purple_conversation_get_data(conv, |
| 355 |
357 |
| 356 static void |
358 static void |
| 357 launcher_config_cb(GtkWidget *widget, gpointer data) |
359 launcher_config_cb(GtkWidget *widget, gpointer data) |
| 358 { |
360 { |
| 359 gint option = GPOINTER_TO_INT(data); |
361 gint option = GPOINTER_TO_INT(data); |
| 360 g_return_if_fail(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); |
362 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
| |
363 return; |
| 361 |
364 |
| 362 purple_prefs_set_int("/plugins/gtk/unity/launcher_count", option); |
365 purple_prefs_set_int("/plugins/gtk/unity/launcher_count", option); |
| 363 launcher_count = option; |
366 launcher_count = option; |
| 364 if (option == LAUNCHER_COUNT_DISABLE) |
367 if (option == LAUNCHER_COUNT_DISABLE) |
| 365 unity_launcher_entry_set_count_visible(launcher, FALSE); |
368 unity_launcher_entry_set_count_visible(launcher, FALSE); |
| 369 |
372 |
| 370 static void |
373 static void |
| 371 messaging_menu_config_cb(GtkWidget *widget, gpointer data) |
374 messaging_menu_config_cb(GtkWidget *widget, gpointer data) |
| 372 { |
375 { |
| 373 gint option = GPOINTER_TO_INT(data); |
376 gint option = GPOINTER_TO_INT(data); |
| 374 g_return_if_fail(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); |
377 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) |
| |
378 return; |
| 375 |
379 |
| 376 purple_prefs_set_int("/plugins/gtk/unity/messaging_menu_text", option); |
380 purple_prefs_set_int("/plugins/gtk/unity/messaging_menu_text", option); |
| 377 messaging_menu_text = option; |
381 messaging_menu_text = option; |
| 378 refill_messaging_menu(); |
382 refill_messaging_menu(); |
| 379 } |
383 } |