[empathy] Remove legacy themes code
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Remove legacy themes code
- Date: Mon, 2 Jul 2012 12:13:28 +0000 (UTC)
commit c7d5d6d78773d9e7cd933b326e7566a072b655d9
Author: Danielle Madeley <danielle madeley collabora co uk>
Date: Wed Jun 20 19:42:22 2012 +1000
Remove legacy themes code
data/org.gnome.Empathy.gschema.xml | 5 -
libempathy-gtk/Makefile.am | 4 -
libempathy-gtk/empathy-theme-boxes.c | 426 --------------------------------
libempathy-gtk/empathy-theme-boxes.h | 61 -----
libempathy-gtk/empathy-theme-irc.c | 143 -----------
libempathy-gtk/empathy-theme-irc.h | 62 -----
libempathy-gtk/empathy-theme-manager.c | 374 +---------------------------
libempathy/empathy-gsettings.h | 1 -
src/empathy-preferences.c | 56 +----
9 files changed, 13 insertions(+), 1119 deletions(-)
---
diff --git a/data/org.gnome.Empathy.gschema.xml b/data/org.gnome.Empathy.gschema.xml
index 9b653cc..d9810fe 100644
--- a/data/org.gnome.Empathy.gschema.xml
+++ b/data/org.gnome.Empathy.gschema.xml
@@ -170,11 +170,6 @@ present them to the user immediately.</description>
<summary>Show contact list in rooms</summary>
<description>Whether to show the contact list in chat rooms.</description>
</key>
- <key name="theme" type="s">
- <default>'classic'</default>
- <summary>Chat window theme</summary>
- <description>The theme that is used to display the conversation in chat windows.</description>
- </key>
<key name="theme-variant" type="s">
<default>''</default>
<summary>Chat window theme variant</summary>
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index ac3d3c1..e11ee23 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -88,8 +88,6 @@ libempathy_gtk_handwritten_source = \
empathy-spell.c \
empathy-status-preset-dialog.c \
empathy-string-parser.c \
- empathy-theme-boxes.c \
- empathy-theme-irc.c \
empathy-theme-manager.c \
empathy-tls-dialog.c \
empathy-ui-utils.c \
@@ -159,8 +157,6 @@ libempathy_gtk_headers = \
empathy-spell.h \
empathy-status-preset-dialog.h \
empathy-string-parser.h \
- empathy-theme-boxes.h \
- empathy-theme-irc.h \
empathy-theme-manager.h \
empathy-tls-dialog.h \
empathy-ui-utils.h \
diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c
index 1233509..a04a43a 100644
--- a/libempathy-gtk/empathy-theme-manager.c
+++ b/libempathy-gtk/empathy-theme-manager.c
@@ -37,8 +37,6 @@
#include "empathy-theme-manager.h"
#include "empathy-chat-view.h"
#include "empathy-chat-text-view.h"
-#include "empathy-theme-boxes.h"
-#include "empathy-theme-irc.h"
#include "empathy-theme-adium.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -47,7 +45,6 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeManager)
typedef struct {
GSettings *gsettings_chat;
- gchar *name;
GtkSettings *settings;
GList *boxes_views;
guint emit_changed_idle;
@@ -66,14 +63,6 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
-static const gchar *themes[] = {
- "classic", N_("Classic"),
- "simple", N_("Simple"),
- "clean", N_("Clean"),
- "blue", N_("Blue"),
- NULL
-};
-
G_DEFINE_TYPE (EmpathyThemeManager, empathy_theme_manager, G_TYPE_OBJECT);
static gboolean
@@ -85,8 +74,8 @@ theme_manager_emit_changed_idle_cb (gpointer manager)
if (priv->adium_data) {
adium_path = empathy_adium_data_get_path (priv->adium_data);
}
- DEBUG ("Emit theme-changed with: name='%s' adium_path='%s' "
- "adium_variant='%s'", priv->name, adium_path,
+ DEBUG ("Emit theme-changed with: adium_path='%s' "
+ "adium_variant='%s'", adium_path,
priv->adium_variant);
g_signal_emit (manager, signals[THEME_CHANGED], 0, NULL);
@@ -127,6 +116,7 @@ clear_list_of_views (GList **views)
}
}
+#if 0
static void
theme_manager_gdk_color_to_hex (GdkColor *gdk_color, gchar *str_color)
{
@@ -136,243 +126,7 @@ theme_manager_gdk_color_to_hex (GdkColor *gdk_color, gchar *str_color)
gdk_color->green >> 8,
gdk_color->blue >> 8);
}
-
-static EmpathyThemeIrc *
-theme_manager_create_irc_view (EmpathyThemeManager *manager)
-{
- EmpathyChatTextView *view;
- EmpathyThemeIrc *theme;
-
- theme = empathy_theme_irc_new ();
- view = EMPATHY_CHAT_TEXT_VIEW (theme);
-
- /* Define base tags */
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_SPACING,
- "size", 2000,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_TIME,
- "foreground", "darkgrey",
- "justification", GTK_JUSTIFY_CENTER,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_ACTION,
- "foreground", "brown4",
- "style", PANGO_STYLE_ITALIC,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_BODY,
- "foreground-set", FALSE,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_EVENT,
- "foreground", "PeachPuff4",
- "justification", GTK_JUSTIFY_LEFT,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_LINK,
- "foreground", "steelblue",
- "underline", PANGO_UNDERLINE_SINGLE,
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_HIGHLIGHT,
- "background", "yellow",
- NULL);
-
- /* Define IRC tags */
- empathy_chat_text_view_tag_set (view, EMPATHY_THEME_IRC_TAG_NICK_SELF,
- "foreground", "sea green",
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_THEME_IRC_TAG_NICK_OTHER,
- "foreground", "skyblue4",
- NULL);
- empathy_chat_text_view_tag_set (view, EMPATHY_THEME_IRC_TAG_NICK_HIGHLIGHT,
- "foreground", "indian red",
- "weight", PANGO_WEIGHT_BOLD,
- NULL);
-
- return theme;
-}
-
-static void on_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, EmpathyThemeManager *self);
-
-static EmpathyThemeBoxes *
-theme_manager_create_boxes_view (EmpathyThemeManager *manager)
-{
- EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
- EmpathyThemeBoxes *theme;
-
- theme = empathy_theme_boxes_new ();
- priv->boxes_views = g_list_prepend (priv->boxes_views, theme);
- g_object_weak_ref (G_OBJECT (theme),
- theme_manager_view_weak_notify_cb,
- &priv->boxes_views);
-
- g_signal_connect (G_OBJECT (theme), "style-set",
- G_CALLBACK (on_style_set_cb), manager);
-
- return theme;
-}
-
-static void
-theme_manager_update_boxes_tags (EmpathyThemeBoxes *theme,
- const gchar *header_foreground,
- const gchar *header_background,
- const gchar *header_line_background,
- const gchar *action_foreground,
- const gchar *time_foreground,
- const gchar *event_foreground,
- const gchar *link_foreground,
- const gchar *text_foreground,
- const gchar *text_background,
- const gchar *highlight_foreground)
-
-{
- EmpathyChatTextView *view = EMPATHY_CHAT_TEXT_VIEW (theme);
- GtkTextTag *tag;
-
- DEBUG ("Update view with new colors:\n"
- "header_foreground = %s\n"
- "header_background = %s\n"
- "header_line_background = %s\n"
- "action_foreground = %s\n"
- "time_foreground = %s\n"
- "event_foreground = %s\n"
- "link_foreground = %s\n"
- "text_foreground = %s\n"
- "text_background = %s\n"
- "highlight_foreground = %s\n",
- header_foreground, header_background, header_line_background,
- action_foreground, time_foreground, event_foreground,
- link_foreground, text_foreground, text_background,
- highlight_foreground);
-
-
- /* FIXME: GtkTextTag don't support to set color properties to NULL.
- * See bug #542523 */
-
- #define TAG_SET(prop, prop_set, value) \
- if (value != NULL) { \
- g_object_set (tag, prop, value, NULL); \
- } else { \
- g_object_set (tag, prop_set, FALSE, NULL); \
- }
-
- /* Define base tags */
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_HIGHLIGHT,
- "weight", PANGO_WEIGHT_BOLD,
- "pixels-above-lines", 4,
- NULL);
- TAG_SET ("paragraph-background", "paragraph-background-set", text_background);
- TAG_SET ("foreground", "foreground-set", highlight_foreground);
-
- empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_SPACING,
- "size", 3000,
- "pixels-above-lines", 8,
- NULL);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_TIME,
- "justification", GTK_JUSTIFY_CENTER,
- NULL);
- TAG_SET ("foreground", "foreground-set", time_foreground);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_ACTION,
- "style", PANGO_STYLE_ITALIC,
- "pixels-above-lines", 4,
- NULL);
- TAG_SET ("paragraph-background", "paragraph-background-set", text_background);
- TAG_SET ("foreground", "foreground-set", action_foreground);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_BODY,
- "pixels-above-lines", 4,
- NULL);
- TAG_SET ("paragraph-background", "paragraph-background-set", text_background);
- TAG_SET ("foreground", "foreground-set", text_foreground);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_EVENT,
- "justification", GTK_JUSTIFY_LEFT,
- NULL);
- TAG_SET ("foreground", "foreground-set", event_foreground);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_CHAT_TEXT_VIEW_TAG_LINK,
- "underline", PANGO_UNDERLINE_SINGLE,
- NULL);
- TAG_SET ("foreground", "foreground-set", link_foreground);
-
- /* Define BOXES tags */
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_THEME_BOXES_TAG_HEADER,
- "weight", PANGO_WEIGHT_BOLD,
- NULL);
- TAG_SET ("foreground", "foreground-set", header_foreground);
- TAG_SET ("paragraph-background", "paragraph-background-set", header_background);
- tag = empathy_chat_text_view_tag_set (view, EMPATHY_THEME_BOXES_TAG_HEADER_LINE,
- "size", 1,
- NULL);
- TAG_SET ("paragraph-background", "paragraph-background-set", header_line_background);
-
- #undef TAG_SET
-}
-
-static void
-on_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, EmpathyThemeManager *self)
-{
- EmpathyThemeManagerPriv *priv = GET_PRIV (self);
- GtkStyle *style;
- gchar color1[10];
- gchar color2[10];
- gchar color3[10];
- gchar color4[10];
-
- /* The simple theme depends on the current GTK+ theme so it has to be
- * updated if the theme changes. */
- if (tp_strdiff (priv->name, "simple"))
- return;
-
- style = gtk_widget_get_style (GTK_WIDGET (widget));
-
- theme_manager_gdk_color_to_hex (&style->base[GTK_STATE_SELECTED], color1);
- theme_manager_gdk_color_to_hex (&style->bg[GTK_STATE_SELECTED], color2);
- theme_manager_gdk_color_to_hex (&style->dark[GTK_STATE_SELECTED], color3);
- theme_manager_gdk_color_to_hex (&style->fg[GTK_STATE_SELECTED], color4);
-
- theme_manager_update_boxes_tags (EMPATHY_THEME_BOXES (widget),
- color4, /* header_foreground */
- color2, /* header_background */
- color3, /* header_line_background */
- color1, /* action_foreground */
- "darkgrey", /* time_foreground */
- "darkgrey", /* event_foreground */
- color1, /* link_foreground */
- NULL, /* text_foreground */
- NULL, /* text_background */
- NULL); /* highlight_foreground */
-}
-
-static void
-theme_manager_update_boxes_theme (EmpathyThemeManager *manager,
- EmpathyThemeBoxes *theme)
-{
- EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
-
- if (strcmp (priv->name, "simple") == 0) {
- on_style_set_cb (GTK_WIDGET (theme), NULL, manager);
- }
- else if (strcmp (priv->name, "clean") == 0) {
- theme_manager_update_boxes_tags (theme,
- "black", /* header_foreground */
- "#efefdf", /* header_background */
- "#e3e3d3", /* header_line_background */
- "brown4", /* action_foreground */
- "darkgrey", /* time_foreground */
- "darkgrey", /* event_foreground */
- "#49789e", /* link_foreground */
- NULL, /* text_foreground */
- NULL, /* text_background */
- NULL); /* highlight_foreground */
- }
- else if (strcmp (priv->name, "blue") == 0) {
- theme_manager_update_boxes_tags (theme,
- "black", /* header_foreground */
- "#88a2b4", /* header_background */
- "#7f96a4", /* header_line_background */
- "brown4", /* action_foreground */
- "darkgrey", /* time_foreground */
- "#7f96a4", /* event_foreground */
- "#49789e", /* link_foreground */
- "black", /* text_foreground */
- "#adbdc8", /* text_background */
- "black"); /* highlight_foreground */
- }
-}
+#endif
static EmpathyThemeAdium *
theme_manager_create_adium_view (EmpathyThemeManager *manager)
@@ -458,114 +212,14 @@ EmpathyChatView *
empathy_theme_manager_create_view (EmpathyThemeManager *manager)
{
EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
- EmpathyThemeBoxes *theme;
g_return_val_if_fail (EMPATHY_IS_THEME_MANAGER (manager), NULL);
- DEBUG ("Using theme %s", priv->name);
-
- if (strcmp (priv->name, "adium") == 0 && priv->adium_data != NULL) {
+ if (priv->adium_data != NULL) {
return EMPATHY_CHAT_VIEW (theme_manager_create_adium_view (manager));
}
- if (strcmp (priv->name, "classic") == 0) {
- return EMPATHY_CHAT_VIEW (theme_manager_create_irc_view (manager));
- }
-
- theme = theme_manager_create_boxes_view (manager);
- theme_manager_update_boxes_theme (manager, theme);
-
- return EMPATHY_CHAT_VIEW (theme);
-}
-
-static gboolean
-theme_manager_ensure_theme_exists (const gchar *name)
-{
- gint i;
-
- if (EMP_STR_EMPTY (name)) {
- return FALSE;
- }
-
- if (strcmp ("adium", name) == 0) {
- return TRUE;
- }
-
- for (i = 0; themes[i]; i += 2) {
- if (strcmp (themes[i], name) == 0) {
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-typedef enum {
- THEME_TYPE_IRC,
- THEME_TYPE_BOXED,
- THEME_TYPE_ADIUM,
-} ThemeType;
-
-static ThemeType
-theme_type (const gchar *name)
-{
- if (!tp_strdiff (name, "classic")) {
- return THEME_TYPE_IRC;
- } else if (!tp_strdiff (name, "adium")) {
- return THEME_TYPE_ADIUM;
- } else {
- return THEME_TYPE_BOXED;
- }
-}
-
-static void
-theme_manager_notify_name_cb (GSettings *gsettings_chat,
- const gchar *key,
- gpointer user_data)
-{
- EmpathyThemeManager *manager = EMPATHY_THEME_MANAGER (user_data);
- EmpathyThemeManagerPriv *priv = GET_PRIV (manager);
- gchar *name;
- ThemeType old_type;
- ThemeType new_type;
-
- name = g_settings_get_string (gsettings_chat, key);
-
- /* Fallback to classic theme if current setting does not exist */
- if (!theme_manager_ensure_theme_exists (name)) {
- g_free (name);
- name = g_strdup ("classic");
- }
-
- /* If theme did not change, nothing to do */
- if (!tp_strdiff (priv->name, name)) {
- g_free (name);
- return;
- }
-
- old_type = theme_type (priv->name);
- g_free (priv->name);
- priv->name = name;
- new_type = theme_type (priv->name);
-
- if (new_type == THEME_TYPE_BOXED) {
- GList *l;
-
- /* The theme changes to a boxed one, we can update boxed views */
- for (l = priv->boxes_views; l; l = l->next) {
- theme_manager_update_boxes_theme (manager,
- EMPATHY_THEME_BOXES (l->data));
- }
- }
-
- /* Do not emit theme-changed if theme type didn't change. If theme
- * changed from a boxed to another boxed, all view are updated in place.
- * If theme changed from an adium to another adium, the signal will be
- * emited from theme_manager_notify_adium_path_cb ()
- */
- if (old_type != new_type) {
- theme_manager_emit_changed (manager);
- }
+ g_return_val_if_reached (NULL);
}
static void
@@ -574,7 +228,6 @@ theme_manager_finalize (GObject *object)
EmpathyThemeManagerPriv *priv = GET_PRIV (object);
g_object_unref (priv->gsettings_chat);
- g_free (priv->name);
if (priv->emit_changed_idle != 0) {
g_source_remove (priv->emit_changed_idle);
@@ -620,15 +273,6 @@ empathy_theme_manager_init (EmpathyThemeManager *manager)
priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
- /* Take the theme name and track changes */
- g_signal_connect (priv->gsettings_chat,
- "changed::" EMPATHY_PREFS_CHAT_THEME,
- G_CALLBACK (theme_manager_notify_name_cb),
- manager);
- theme_manager_notify_name_cb (priv->gsettings_chat,
- EMPATHY_PREFS_CHAT_THEME,
- manager);
-
/* Take the adium path/variant and track changes */
g_signal_connect (priv->gsettings_chat,
"changed::" EMPATHY_PREFS_CHAT_ADIUM_PATH,
@@ -663,12 +307,6 @@ empathy_theme_manager_dup_singleton (void)
return g_object_ref (manager);
}
-const gchar **
-empathy_theme_manager_get_themes (void)
-{
- return themes;
-}
-
static void
find_themes (GList **list, const gchar *dirpath)
{
diff --git a/libempathy/empathy-gsettings.h b/libempathy/empathy-gsettings.h
index 0a7a18c..0b346ea 100644
--- a/libempathy/empathy-gsettings.h
+++ b/libempathy/empathy-gsettings.h
@@ -58,7 +58,6 @@ G_BEGIN_DECLS
#define EMPATHY_PREFS_CHAT_SCHEMA EMPATHY_PREFS_SCHEMA ".conversation"
#define EMPATHY_PREFS_CHAT_SHOW_SMILEYS "graphical-smileys"
#define EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS "show-contacts-in-rooms"
-#define EMPATHY_PREFS_CHAT_THEME "theme"
#define EMPATHY_PREFS_CHAT_THEME_VARIANT "theme-variant"
#define EMPATHY_PREFS_CHAT_ADIUM_PATH "adium-path"
#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES "spell-checker-languages"
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index 4291ffc..c410aff 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -115,8 +115,6 @@ enum {
enum {
COL_THEME_VISIBLE_NAME,
- COL_THEME_NAME,
- COL_THEME_IS_ADIUM,
COL_THEME_ADIUM_PATH,
COL_THEME_ADIUM_INFO,
COL_THEME_COUNT
@@ -836,35 +834,23 @@ preferences_theme_changed_cb (GtkComboBox *combo,
if (gtk_combo_box_get_active_iter (combo, &iter)) {
GtkTreeModel *model;
- gboolean is_adium;
- gchar *name;
gchar *path;
GHashTable *info;
+ gboolean variant;
model = gtk_combo_box_get_model (combo);
gtk_tree_model_get (model, &iter,
- COL_THEME_IS_ADIUM, &is_adium,
- COL_THEME_NAME, &name,
COL_THEME_ADIUM_PATH, &path,
COL_THEME_ADIUM_INFO, &info,
-1);
g_settings_set_string (priv->gsettings_chat,
- EMPATHY_PREFS_CHAT_THEME,
- name);
- if (is_adium) {
- gboolean variant;
+ EMPATHY_PREFS_CHAT_ADIUM_PATH,
+ path);
- g_settings_set_string (priv->gsettings_chat,
- EMPATHY_PREFS_CHAT_ADIUM_PATH,
- path);
+ variant = preferences_theme_variants_fill (preferences, info);
+ gtk_widget_set_visible (priv->hbox_chat_theme_variant, variant);
- variant = preferences_theme_variants_fill (preferences, info);
- gtk_widget_set_visible (priv->hbox_chat_theme_variant, variant);
- } else {
- gtk_widget_hide (priv->hbox_chat_theme_variant);
- }
- g_free (name);
g_free (path);
tp_clear_pointer (&info, g_hash_table_unref);
}
@@ -878,14 +864,12 @@ preferences_theme_notify_cb (GSettings *gsettings,
EmpathyPreferences *preferences = user_data;
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
GtkComboBox *combo;
- gchar *conf_name;
gchar *conf_path;
GtkTreeModel *model;
GtkTreeIter iter;
gboolean found = FALSE;
gboolean ok;
- conf_name = g_settings_get_string (gsettings, EMPATHY_PREFS_CHAT_THEME);
conf_path = g_settings_get_string (gsettings, EMPATHY_PREFS_CHAT_ADIUM_PATH);
combo = GTK_COMBO_BOX (priv->combobox_chat_theme);
@@ -893,23 +877,17 @@ preferences_theme_notify_cb (GSettings *gsettings,
for (ok = gtk_tree_model_get_iter_first (model, &iter);
ok && !found;
ok = gtk_tree_model_iter_next (model, &iter)) {
- gboolean is_adium;
- gchar *name;
gchar *path;
gtk_tree_model_get (model, &iter,
- COL_THEME_IS_ADIUM, &is_adium,
- COL_THEME_NAME, &name,
COL_THEME_ADIUM_PATH, &path,
-1);
- if (!tp_strdiff (name, conf_name) &&
- (!is_adium || !tp_strdiff (path, conf_path))) {
+ if (!tp_strdiff (path, conf_path)) {
found = TRUE;
gtk_combo_box_set_active_iter (combo, &iter);
}
- g_free (name);
g_free (path);
}
@@ -920,7 +898,6 @@ preferences_theme_notify_cb (GSettings *gsettings,
}
}
- g_free (conf_name);
g_free (conf_path);
}
@@ -932,9 +909,7 @@ preferences_themes_setup (EmpathyPreferences *preferences)
GtkCellLayout *cell_layout;
GtkCellRenderer *renderer;
GtkListStore *store;
- const gchar **themes;
GList *adium_themes;
- gint i;
preferences_theme_variants_setup (preferences);
@@ -944,23 +919,12 @@ preferences_themes_setup (EmpathyPreferences *preferences)
/* Create the model */
store = gtk_list_store_new (COL_THEME_COUNT,
G_TYPE_STRING, /* Display name */
- G_TYPE_STRING, /* Theme name */
- G_TYPE_BOOLEAN, /* Is an Adium theme */
G_TYPE_STRING, /* Adium theme path */
G_TYPE_HASH_TABLE); /* Adium theme info */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
COL_THEME_VISIBLE_NAME, GTK_SORT_ASCENDING);
/* Fill the model */
- themes = empathy_theme_manager_get_themes ();
- for (i = 0; themes[i]; i += 2) {
- gtk_list_store_insert_with_values (store, NULL, -1,
- COL_THEME_VISIBLE_NAME, _(themes[i + 1]),
- COL_THEME_NAME, themes[i],
- COL_THEME_IS_ADIUM, FALSE,
- -1);
- }
-
adium_themes = empathy_theme_manager_get_adium_themes ();
while (adium_themes != NULL) {
GHashTable *info;
@@ -974,8 +938,6 @@ preferences_themes_setup (EmpathyPreferences *preferences)
if (name != NULL && path != NULL) {
gtk_list_store_insert_with_values (store, NULL, -1,
COL_THEME_VISIBLE_NAME, name,
- COL_THEME_NAME, "adium",
- COL_THEME_IS_ADIUM, TRUE,
COL_THEME_ADIUM_PATH, path,
COL_THEME_ADIUM_INFO, info,
-1);
@@ -999,12 +961,8 @@ preferences_themes_setup (EmpathyPreferences *preferences)
/* Select the theme from the GSetting key and track changes */
preferences_theme_notify_cb (priv->gsettings_chat,
- EMPATHY_PREFS_CHAT_THEME,
+ EMPATHY_PREFS_CHAT_ADIUM_PATH,
preferences);
- g_signal_connect (priv->gsettings_chat,
- "changed::" EMPATHY_PREFS_CHAT_THEME,
- G_CALLBACK (preferences_theme_notify_cb),
- preferences);
g_signal_connect (priv->gsettings_chat,
"changed::" EMPATHY_PREFS_CHAT_ADIUM_PATH,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]