comparison pidgin/gtkconv.c @ 32735:01741f87cc1e

Automatically load the Default conversation theme and use it if a theme can't be found.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 04 Mar 2012 02:16:12 +0000
parents dfcad7368179
children 2efee7ca90be
comparison
equal deleted inserted replaced
32734:dfcad7368179 32735:01741f87cc1e
189 static GList *away_list = NULL; 189 static GList *away_list = NULL;
190 static GList *busy_list = NULL; 190 static GList *busy_list = NULL;
191 static GList *xa_list = NULL; 191 static GList *xa_list = NULL;
192 static GList *offline_list = NULL; 192 static GList *offline_list = NULL;
193 static GHashTable *prpl_lists = NULL; 193 static GHashTable *prpl_lists = NULL;
194
195 static PurpleTheme *default_conv_theme = NULL;
194 196
195 static gboolean update_send_to_selection(PidginWindow *win); 197 static gboolean update_send_to_selection(PidginWindow *win);
196 static void generate_send_to_items(PidginWindow *win); 198 static void generate_send_to_items(PidginWindow *win);
197 199
198 /* Prototypes. <-- because Paco-Paco hates this comment. */ 200 /* Prototypes. <-- because Paco-Paco hates this comment. */
5738 #endif 5740 #endif
5739 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE; 5741 gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
5740 gtkconv->unseen_count = 0; 5742 gtkconv->unseen_count = 0;
5741 theme = purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme"), "conversation"); 5743 theme = purple_theme_manager_find_theme(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme"), "conversation");
5742 if (!theme) 5744 if (!theme)
5743 theme = purple_theme_manager_find_theme("Default", "conversation"); 5745 theme = default_conv_theme;
5744 gtkconv->theme = PIDGIN_CONV_THEME(g_object_ref(theme)); 5746 gtkconv->theme = PIDGIN_CONV_THEME(g_object_ref(theme));
5745 gtkconv->last_flags = 0; 5747 gtkconv->last_flags = 0;
5746 5748
5747 if (conv_type == PURPLE_CONV_TYPE_IM) { 5749 if (conv_type == PURPLE_CONV_TYPE_IM) {
5748 gtkconv->u.im = g_malloc0(sizeof(PidginImPane)); 5750 gtkconv->u.im = g_malloc0(sizeof(PidginImPane));
8432 void 8434 void
8433 pidgin_conversations_init(void) 8435 pidgin_conversations_init(void)
8434 { 8436 {
8435 void *handle = pidgin_conversations_get_handle(); 8437 void *handle = pidgin_conversations_get_handle();
8436 void *blist_handle = purple_blist_get_handle(); 8438 void *blist_handle = purple_blist_get_handle();
8439 char *theme_dir;
8437 8440
8438 /* Conversations */ 8441 /* Conversations */
8439 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); 8442 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
8440 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/themes"); 8443 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/themes");
8441 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE); 8444 purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", TRUE);
8721 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); 8724 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
8722 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", handle, 8725 purple_signal_connect(purple_conversations_get_handle(), "wrote-chat-msg", handle,
8723 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL); 8726 PURPLE_CALLBACK(wrote_msg_update_unseen_cb), NULL);
8724 8727
8725 purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_CONV_THEME_LOADER, "type", "conversation", NULL)); 8728 purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_CONV_THEME_LOADER, "type", "conversation", NULL));
8729 theme_dir = g_build_filename(DATADIR, "pidgin", "theme", NULL);
8730 default_conv_theme = purple_theme_manager_load_theme(theme_dir, "conversation");
8731 g_free(theme_dir);
8726 8732
8727 { 8733 {
8728 /* Set default tab colors */ 8734 /* Set default tab colors */
8729 GString *str = g_string_new(NULL); 8735 GString *str = g_string_new(NULL);
8730 GtkSettings *settings = gtk_settings_get_default(); 8736 GtkSettings *settings = gtk_settings_get_default();