aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-preferences.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-03 23:49:10 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-04 17:10:20 +0800
commit2e7a0efc837d4b38290dffbd04a1c9d70df64db2 (patch)
treec779badde862e83bac3fa393bafa4183c584f6ba /src/empathy-preferences.c
parentd801233c1f25596c429d75d03ec6282d1b3828e2 (diff)
downloadgsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar.gz
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar.bz2
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar.lz
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar.xz
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.tar.zst
gsoc2013-empathy-2e7a0efc837d4b38290dffbd04a1c9d70df64db2.zip
Use the new enum everywhere
And use strings for the --show-preferences argument.
Diffstat (limited to 'src/empathy-preferences.c')
-rw-r--r--src/empathy-preferences.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index dd3aaee13..4b3e0766f 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -1226,11 +1226,11 @@ empathy_preferences_init (EmpathyPreferences *preferences)
preferences_sound_load (preferences);
if (empathy_spell_supported ()) {
- page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 5);
+ page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), EMPATHY_PREFERENCES_TAB_SPELL);
gtk_widget_show (page);
}
- page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 4);
+ page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), EMPATHY_PREFERENCES_TAB_LOCATION);
#ifdef HAVE_GEOCLUE
gtk_widget_show (page);
#else
@@ -1238,6 +1238,28 @@ empathy_preferences_init (EmpathyPreferences *preferences)
#endif
}
+static EmpathyPreferencesTab
+empathy_preferences_tab_from_string (const gchar *str)
+{
+ if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_GENERAL))
+ return EMPATHY_PREFERENCES_TAB_GENERAL;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_NOTIFICATIONS))
+ return EMPATHY_PREFERENCES_TAB_NOTIFICATIONS;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_SOUNDS))
+ return EMPATHY_PREFERENCES_TAB_SOUNDS;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_CALLS))
+ return EMPATHY_PREFERENCES_TAB_CALLS;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_LOCATION))
+ return EMPATHY_PREFERENCES_TAB_LOCATION;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_SPELL))
+ return EMPATHY_PREFERENCES_TAB_SPELL;
+ else if (!tp_strdiff (str, EMPATHY_PREFERENCES_STR_TAB_THEMES))
+ return EMPATHY_PREFERENCES_TAB_THEMES;
+
+ g_warn_if_reached ();
+ return -1;
+}
+
GtkWidget *
empathy_preferences_new (GtkWindow *parent)
{
@@ -1257,9 +1279,10 @@ empathy_preferences_new (GtkWindow *parent)
void
empathy_preferences_show_tab (EmpathyPreferences *self,
- gint tab)
+ const gchar *page)
{
EmpathyPreferencesPriv *priv = GET_PRIV (self);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), tab);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
+ empathy_preferences_tab_from_string (page));
}