]> git.0d.be Git - empathy.git/commitdiff
Modify code to handle new preferences.
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 30 Jan 2009 17:07:23 +0000 (17:07 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 30 Jan 2009 17:07:23 +0000 (17:07 +0000)
svn path=/trunk/; revision=2281

data/empathy.schemas.in
libempathy-gtk/empathy-conf.h
src/empathy-preferences.c
src/empathy-preferences.glade

index e8ed676e0a6a84e4053f39013aa10de8e9c55b37..43a2f81a5fce5d531b1ad104a2df574e6854ff79 100644 (file)
     </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>
index 2c361f468d934926787a3416516e0994d767d768..2051a7f3809fb9a3972c74111a4be83419451156 100644 (file)
@@ -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"
index 3fe94987072da00fd24d39522d6d5146a4738def..0ad8e9bdf0edbaaa0bd7468f90e0003a03075a64 100644 (file)
@@ -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;
@@ -185,6 +189,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);
@@ -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,
index e5dd045106330da772782e7cf13cba95ccd5af12..b794a20473d723e8554607bd18be11589c28d18d 100644 (file)
                         <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>