diff options
-rw-r--r-- | data/empathy.schemas.in | 38 | ||||
-rw-r--r-- | libempathy-gtk/empathy-conf.h | 3 | ||||
-rw-r--r-- | src/empathy-preferences.c | 24 | ||||
-rw-r--r-- | src/empathy-preferences.glade | 2 |
4 files changed, 62 insertions, 5 deletions
diff --git a/data/empathy.schemas.in b/data/empathy.schemas.in index e8ed676e0..43a2f81a5 100644 --- a/data/empathy.schemas.in +++ b/data/empathy.schemas.in @@ -217,15 +217,45 @@ </schema> <schema> - <key>/schemas/apps/empathy/notifications/popup_when_contact_available</key> - <applyto>/apps/empathy/notifications/popup_when_contact_available</applyto> + <key>/schemas/apps/empathy/notifications/notifications_enabled</key> + <applyto>/apps/empathy/notifications/notifications_enabled</applyto> <owner>empathy</owner> <type>bool</type> <default>true</default> <locale name="C"> - <short>Enable popup when contact is available</short> + <short>Enable popup notifications for new messages</short> <long> - Whether or not to show a popup when a contact becomes available. + Whether or not to show a popup notification when receiving a new + message. + </long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/empathy/notifications/notifications_disabled_away</key> + <applyto>/apps/empathy/notifications/notifications_disabled_away</applyto> + <owner>empathy</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Disable popup notifications when away</short> + <long> + Whether or not to show popup notifications when away or busy. + </long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/empathy/notifications/notifications_focus</key> + <applyto>/apps/empathy/notifications/notifications_focus</applyto> + <owner>empathy</owner> + <type>bool</type> + <default>false</default> + <locale name="C"> + <short>Popup notifications if the chat isn't focused</short> + <long> + Whether or not to show a popup notification when receiving a new + message even if the chat is already opened, but not focused. </long> </locale> </schema> diff --git a/libempathy-gtk/empathy-conf.h b/libempathy-gtk/empathy-conf.h index 2c361f468..2051a7f38 100644 --- a/libempathy-gtk/empathy-conf.h +++ b/libempathy-gtk/empathy-conf.h @@ -45,6 +45,9 @@ struct _EmpathyConfClass { }; #define EMPATHY_PREFS_PATH "/apps/empathy" +#define EMPATHY_PREFS_NOTIFICATIONS_ENABLED EMPATHY_PREFS_PATH "/notifications/notifications_enabled" +#define EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY EMPATHY_PREFS_PATH "/notifications/notifications_disabled_away" +#define EMPATHY_PREFS_NOTIFICATIONS_FOCUS EMPATHY_PREFS_PATH "/notifications/notifications_focus" #define EMPATHY_PREFS_SOUNDS_ENABLED EMPATHY_PREFS_PATH "/sounds/sounds_enabled" #define EMPATHY_PREFS_SOUNDS_DISABLED_AWAY EMPATHY_PREFS_PATH "/sounds/sounds_disabled_away" #define EMPATHY_PREFS_SOUNDS_INCOMING_MESSAGE EMPATHY_PREFS_PATH "/sounds/sounds_incoming_message" diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index 3fe949870..0ad8e9bdf 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -59,6 +59,10 @@ typedef struct { GtkWidget *checkbutton_sounds_disabled_away; GtkWidget *treeview_sounds; + GtkWidget *checkbutton_notifications_enabled; + GtkWidget *checkbutton_notifications_disabled_away; + GtkWidget *checkbutton_notifications_focus; + GtkWidget *treeview_spell_checker; GList *notify_ids; @@ -186,6 +190,23 @@ preferences_setup_widgets (EmpathyPreferences *preferences) guint id; preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_NOTIFICATIONS_ENABLED, + preferences->checkbutton_notifications_enabled); + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_NOTIFICATIONS_DISABLED_AWAY, + preferences->checkbutton_notifications_disabled_away); + preferences_hookup_toggle_button (preferences, + EMPATHY_PREFS_NOTIFICATIONS_FOCUS, + preferences->checkbutton_notifications_focus); + + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_NOTIFICATIONS_ENABLED, + preferences->checkbutton_notifications_disabled_away); + preferences_hookup_sensitivity (preferences, + EMPATHY_PREFS_NOTIFICATIONS_ENABLED, + preferences->checkbutton_notifications_focus); + + preferences_hookup_toggle_button (preferences, EMPATHY_PREFS_SOUNDS_ENABLED, preferences->checkbutton_sounds_enabled); preferences_hookup_toggle_button (preferences, @@ -1061,6 +1082,9 @@ empathy_preferences_show (GtkWindow *parent) "checkbutton_autoconnect", &preferences->checkbutton_autoconnect, "radiobutton_contact_list_sort_by_name", &preferences->radiobutton_contact_list_sort_by_name, "radiobutton_contact_list_sort_by_state", &preferences->radiobutton_contact_list_sort_by_state, + "checkbutton_notifications_enabled", &preferences->checkbutton_notifications_enabled, + "checkbutton_notifications_disabled_away", &preferences->checkbutton_notifications_disabled_away, + "checkbutton_notifications_focus", &preferences->checkbutton_notifications_focus, "checkbutton_sounds_enabled", &preferences->checkbutton_sounds_enabled, "checkbutton_sounds_disabled_away", &preferences->checkbutton_sounds_disabled_away, "treeview_sounds", &preferences->treeview_sounds, diff --git a/src/empathy-preferences.glade b/src/empathy-preferences.glade index e5dd04510..b794a2047 100644 --- a/src/empathy-preferences.glade +++ b/src/empathy-preferences.glade @@ -269,7 +269,7 @@ <property name="visible">True</property> <property name="spacing">6</property> <child> - <widget class="GtkCheckButton" id="checkbutton_notifications_away"> + <widget class="GtkCheckButton" id="checkbutton_notifications_disabled_away"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Disable notifications when _away or busy</property> |