236
244
priv->checkbutton_show_smileys,
238
246
G_SETTINGS_BIND_DEFAULT);
239
#ifdef HAVE_LIBINDICATE
240
g_settings_bind (priv->gsettings_ui,
241
EMPATHY_PREFS_UI_USE_LIBINDICATE,
242
priv->checkbutton_use_libindicate,
244
G_SETTINGS_BIND_DEFAULT);
246
gtk_widget_hide (GTK_WIDGET (priv->checkbutton_use_libindicate));
249
247
g_settings_bind (priv->gsettings_chat,
250
248
EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS,
251
249
priv->checkbutton_show_contacts_in_rooms,
580
571
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
581
572
GtkTreeView *view;
582
573
GtkTreeModel *model;
586
value = g_settings_get_string (priv->gsettings_chat,
587
EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES);
574
GList *enabled_codes;
576
enabled_codes = empathy_spell_get_enabled_language_codes ();
578
g_settings_set_boolean (priv->gsettings_chat,
579
EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED,
580
enabled_codes != NULL);
582
if (enabled_codes == NULL)
592
vlanguages = g_strsplit (value, ",", -1);
595
585
view = GTK_TREE_VIEW (priv->treeview_spell_checker);
596
586
model = gtk_tree_view_get_model (view);
598
588
gtk_tree_model_foreach (model,
599
589
(GtkTreeModelForeachFunc) preferences_languages_load_foreach,
602
g_strfreev (vlanguages);
592
g_list_free (enabled_codes);
606
596
preferences_languages_load_foreach (GtkTreeModel *model,
607
597
GtkTreePath *path,
608
598
GtkTreeIter *iter,
614
602
gboolean found = FALSE;
616
604
if (!languages) {
653
preferences_preview_theme_append_message (EmpathyChatView *view,
654
EmpathyContact *sender,
655
EmpathyContact *receiver,
658
EmpathyMessage *message;
660
message = g_object_new (EMPATHY_TYPE_MESSAGE,
662
"receiver", receiver,
666
empathy_chat_view_append_message (view, message);
667
g_object_unref (message);
671
preferences_preview_theme_changed_cb (EmpathyThemeManager *manager,
672
EmpathyPreferences *preferences)
674
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
677
EmpathyContact *juliet;
678
EmpathyContact *romeo;
680
DEBUG ("Theme changed, update preview widget");
682
if (priv->chat_theme_preview != NULL) {
683
gtk_widget_destroy (GTK_WIDGET (priv->chat_theme_preview));
685
priv->chat_theme_preview = empathy_theme_manager_create_view (manager);
686
gtk_container_add (GTK_CONTAINER (priv->sw_chat_theme_preview),
687
GTK_WIDGET (priv->chat_theme_preview));
688
gtk_widget_show (GTK_WIDGET (priv->chat_theme_preview));
690
/* FIXME: It is ugly to add a fake conversation like that.
691
* Would be cool if we could request a TplLogManager for a fake
693
dbus = tp_dbus_daemon_dup (NULL);
694
account = tp_account_new (dbus,
695
TP_ACCOUNT_OBJECT_PATH_BASE "cm/jabber/account", NULL);
696
juliet = g_object_new (EMPATHY_TYPE_CONTACT,
699
/* translators: Contact name for the chat theme preview */
700
"alias", _("Juliet"),
703
romeo = g_object_new (EMPATHY_TYPE_CONTACT,
706
/* translators: Contact name for the chat theme preview */
711
preferences_preview_theme_append_message (priv->chat_theme_preview,
712
/* translators: Quote from Romeo & Julier, for chat theme preview */
713
juliet, romeo, _("O Romeo, Romeo, wherefore art thou Romeo?"));
714
preferences_preview_theme_append_message (priv->chat_theme_preview,
715
/* translators: Quote from Romeo & Julier, for chat theme preview */
716
juliet, romeo, _("Deny thy father and refuse thy name;"));
717
preferences_preview_theme_append_message (priv->chat_theme_preview,
718
/* translators: Quote from Romeo & Julier, for chat theme preview */
719
juliet, romeo, _("Or if thou wilt not, be but sworn my love"));
720
preferences_preview_theme_append_message (priv->chat_theme_preview,
721
/* translators: Quote from Romeo & Julier, for chat theme preview */
722
juliet, romeo, _("And I'll no longer be a Capulet."));
723
preferences_preview_theme_append_message (priv->chat_theme_preview,
724
/* translators: Quote from Romeo & Julier, for chat theme preview */
725
romeo, juliet, _("Shall I hear more, or shall I speak at this?"));
727
/* translators: Quote from Romeo & Julier, for chat theme preview */
728
empathy_chat_view_append_event (priv->chat_theme_preview, _("Juliet has disconnected"));
730
g_object_unref (juliet);
731
g_object_unref (romeo);
732
g_object_unref (account);
733
g_object_unref (dbus);
737
preferences_theme_changed_cb (GtkComboBox *combo,
738
EmpathyPreferences *preferences)
740
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
743
if (gtk_combo_box_get_active_iter (combo, &iter)) {
749
model = gtk_combo_box_get_model (combo);
750
gtk_tree_model_get (model, &iter,
751
COL_THEME_IS_ADIUM, &is_adium,
752
COL_THEME_NAME, &name,
753
COL_THEME_ADIUM_PATH, &path,
756
g_settings_set_string (priv->gsettings_chat,
757
EMPATHY_PREFS_CHAT_THEME,
760
g_settings_set_string (priv->gsettings_chat,
761
EMPATHY_PREFS_CHAT_ADIUM_PATH,
667
771
preferences_theme_notify_cb (GSettings *gsettings,
668
772
const gchar *key,
669
773
gpointer user_data)
676
780
GtkTreeModel *model;
677
781
GtkTreeIter iter;
678
782
gboolean found = FALSE;
680
785
conf_name = g_settings_get_string (gsettings, EMPATHY_PREFS_CHAT_THEME);
681
786
conf_path = g_settings_get_string (gsettings, EMPATHY_PREFS_CHAT_ADIUM_PATH);
683
788
combo = GTK_COMBO_BOX (priv->combobox_chat_theme);
684
789
model = gtk_combo_box_get_model (combo);
685
if (gtk_tree_model_get_iter_first (model, &iter)) {
790
for (ok = gtk_tree_model_get_iter_first (model, &iter);
792
ok = gtk_tree_model_iter_next (model, &iter)) {
686
793
gboolean is_adium;
691
gtk_tree_model_get (model, &iter,
692
COL_COMBO_IS_ADIUM, &is_adium,
693
COL_COMBO_NAME, &name,
694
COL_COMBO_PATH, &path,
697
if (!tp_strdiff (name, conf_name)) {
698
if (tp_strdiff (name, "adium") ||
699
!tp_strdiff (path, conf_path)) {
701
gtk_combo_box_set_active_iter (combo, &iter);
710
} while (gtk_tree_model_iter_next (model, &iter));
797
gtk_tree_model_get (model, &iter,
798
COL_THEME_IS_ADIUM, &is_adium,
799
COL_THEME_NAME, &name,
800
COL_THEME_ADIUM_PATH, &path,
803
if (!tp_strdiff (name, conf_name) &&
804
(!is_adium || !tp_strdiff (path, conf_path))) {
806
gtk_combo_box_set_active_iter (combo, &iter);
713
813
/* Fallback to the first one. */
725
preferences_theme_changed_cb (GtkComboBox *combo,
726
EmpathyPreferences *preferences)
728
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
735
if (gtk_combo_box_get_active_iter (combo, &iter)) {
736
model = gtk_combo_box_get_model (combo);
738
gtk_tree_model_get (model, &iter,
739
COL_COMBO_IS_ADIUM, &is_adium,
740
COL_COMBO_NAME, &name,
741
COL_COMBO_PATH, &path,
744
g_settings_set_string (priv->gsettings_chat,
745
EMPATHY_PREFS_CHAT_THEME,
747
if (is_adium == TRUE)
748
g_settings_set_string (priv->gsettings_chat,
749
EMPATHY_PREFS_CHAT_ADIUM_PATH,
757
825
preferences_themes_setup (EmpathyPreferences *preferences)
759
827
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
769
837
cell_layout = GTK_CELL_LAYOUT (combo);
771
839
/* Create the model */
772
store = gtk_list_store_new (COL_COMBO_COUNT,
773
G_TYPE_BOOLEAN, /* Is an Adium theme */
774
G_TYPE_STRING, /* Display name */
775
G_TYPE_STRING, /* Theme name */
776
G_TYPE_STRING); /* Theme path */
840
store = gtk_list_store_new (COL_THEME_COUNT,
841
G_TYPE_STRING, /* Display name */
842
G_TYPE_STRING, /* Theme name */
843
G_TYPE_BOOLEAN, /* Is an Adium theme */
844
G_TYPE_STRING); /* Adium theme path */
777
845
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
778
COL_COMBO_VISIBLE_NAME, GTK_SORT_ASCENDING);
846
COL_THEME_VISIBLE_NAME, GTK_SORT_ASCENDING);
780
848
/* Fill the model */
781
849
themes = empathy_theme_manager_get_themes ();
782
850
for (i = 0; themes[i]; i += 2) {
783
851
gtk_list_store_insert_with_values (store, NULL, -1,
784
COL_COMBO_IS_ADIUM, FALSE,
785
COL_COMBO_VISIBLE_NAME, _(themes[i + 1]),
786
COL_COMBO_NAME, themes[i],
787
COL_COMBO_PATH, NULL,
852
COL_THEME_VISIBLE_NAME, _(themes[i + 1]),
853
COL_THEME_NAME, themes[i],
854
COL_THEME_IS_ADIUM, FALSE,
801
868
if (name != NULL && path != NULL) {
802
869
gtk_list_store_insert_with_values (store, NULL, -1,
803
COL_COMBO_IS_ADIUM, TRUE,
804
COL_COMBO_VISIBLE_NAME, name,
805
COL_COMBO_NAME, "adium",
806
COL_COMBO_PATH, path,
870
COL_THEME_VISIBLE_NAME, name,
871
COL_THEME_NAME, "adium",
872
COL_THEME_IS_ADIUM, TRUE,
873
COL_THEME_ADIUM_PATH, path,
809
876
g_hash_table_unref (info);
901
970
"notebook", &priv->notebook,
902
971
"checkbutton_show_smileys", &priv->checkbutton_show_smileys,
903
972
"checkbutton_show_contacts_in_rooms", &priv->checkbutton_show_contacts_in_rooms,
904
"checkbutton_use_libindicate", &priv->checkbutton_use_libindicate,
973
"vbox_chat_theme", &priv->vbox_chat_theme,
905
974
"combobox_chat_theme", &priv->combobox_chat_theme,
975
"sw_chat_theme_preview", &priv->sw_chat_theme_preview,
906
976
"checkbutton_separate_chat_windows", &priv->checkbutton_separate_chat_windows,
907
977
"checkbutton_events_notif_area", &priv->checkbutton_events_notif_area,
908
978
"checkbutton_autoconnect", &priv->checkbutton_autoconnect,