~ubuntu-branches/ubuntu/precise/gnome-control-center/precise-updates

« back to all changes in this revision

Viewing changes to .pc/98_default_sound_theme.patch/panels/sound/gvc-sound-theme-chooser.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Jeremy Bicha, Ken VanDine
  • Date: 2012-02-15 23:16:31 UTC
  • mfrom: (1.1.56)
  • Revision ID: package-import@ubuntu.com-20120215231631-vk7me0mhofpsq0hp
Tags: 1:3.3.5-0ubuntu1
* Upload the new serie, that will bring in quite some fixes, we revert
  some problematic or risky changes as well
* The new version includes those fixes:
  - "Change Password in User Accounts panel focuses "New password" field, 
     skipping "Current password"" (lp: #821759)
  - The dialog to add online accounts should have a title 
    (lp: #822380)
  - "Remove Profile" button clickable in Color panel when 
     no profile selected (lp: #869603)
  - Move Removable Media into System Info (lp: #835880)
  - Sound preferences: mouse scrolling balance only works for right.
    (lp: #918017)
  - gnome-control-center SIGSEGV in actualize_printers_list() 
    (lp: #903009)
  - selecting preffered applications is not an info (lp: #890143)
  - Add a keyboard shortcut by default for take screenshot of a selection"
    (lp: #625518)
* debian/patches/revert_git_datetime_port.patch:
  - revert use of datetimed, we don't use systemd and ubuntu-system-service 
    doesn't support it yet
* debian/patches/revert_git_drop_library.patch:
  - consolidate "01_allow_external_panels.patch", don't drop the library
    we use it from other components on ubuntu, the patch will be improved
    later to not use a copy of files like it does in that version
* debian/patches/revert_git_stop_using_gconf.patch,
  debian/patches/revert_ua_gsettings.patch,
  debian/patches/revert_git_keyboard_gsettings.patch:
  - revert keyboard porting to gsettings, compiz still use gconf and we
    didn't update gnome-shell to the new serie (yet)

[ Jeremy Bicha ]
* New upstream release (Thanks Rico Tzchichholz!)
* debian/control.in:
  - Bump minimum dependency versions and add libwacom dependency
* debian/rules: Build without -Wl,-z,defs
* debian/watch: Watch for unstable releases
* Refreshed patches:
  - 01_allow_external_panels.patch
  - 04_add_theme_selection.patch
  - 50_ubuntu_systemwide_prefs.patch
  - 58_ubuntu_icon_views_redesign.patch
  - 59_install_gcm_components_on_demand.patch
  - 91_configure_cheese.patch
* Dropped upstream patches:
  - 00git_handle_media_dialog_close.patch
  - 03_show_wacom_under_unity.patch
  - 90_git_sound_tab_order.patch
  - 91_git_build_use_fontconfig.patch
  - 92_git_minimal_output_height.patch
  - 93_change_window_role_on_panel_change.patch
  - 94_git_adding_shortcuts.patch
  - 95_git_ctrlw_shortcut.patch
  - git_extra_keywords.patch

[ Ken VanDine ]
* debian/patches/96_sound_nua_panel.patch
  - refreshed with latest changes from ronoc

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <canberra-gtk.h>
34
34
#include <libxml/tree.h>
35
35
 
36
 
#include <gconf/gconf-client.h>
 
36
#include <gsettings-desktop-schemas/gdesktop-enums.h>
37
37
 
38
38
#include "gvc-sound-theme-chooser.h"
39
39
#include "sound-theme-file-utils.h"
44
44
{
45
45
        GtkWidget *treeview;
46
46
        GtkWidget *selection_box;
47
 
        GConfClient *client;
 
47
        GSettings *settings;
48
48
        GSettings *sound_settings;
49
 
        guint metacity_dir_id;
50
49
        char *current_theme;
51
50
        char *current_parent;
52
51
};
62
61
#define INPUT_SOUNDS_KEY           "input-feedback-sounds"
63
62
#define SOUND_THEME_KEY            "theme-name"
64
63
 
65
 
#define KEY_METACITY_DIR           "/apps/metacity/general"
66
 
#define AUDIO_BELL_KEY             KEY_METACITY_DIR "/audible_bell"
 
64
#define WM_SCHEMA                  "org.gnome.desktop.wm.preferences"
 
65
#define AUDIO_BELL_KEY             "audible-bell"
67
66
 
68
67
#define DEFAULT_ALERT_ID        "__default"
69
68
#define CUSTOM_THEME_NAME       "__custom"
731
730
}
732
731
 
733
732
static void
734
 
on_key_changed (GConfClient          *client,
735
 
                guint                 cnxn_id,
736
 
                GConfEntry           *entry,
737
 
                GvcSoundThemeChooser *chooser)
 
733
on_audible_bell_changed (GSettings            *settings,
 
734
                         const char           *key,
 
735
                         GvcSoundThemeChooser *chooser)
738
736
{
739
 
        const char *key;
740
 
 
741
 
        key = gconf_entry_get_key (entry);
742
 
 
743
 
        if (! g_str_has_prefix (key, KEY_METACITY_DIR)) {
744
 
                return;
745
 
        }
746
 
 
747
 
        if (strcmp (key, AUDIO_BELL_KEY) == 0) {
748
 
                update_theme (chooser);
749
 
        }
 
737
        update_theme (chooser);
750
738
}
751
739
 
752
740
static void
776
764
 
777
765
        chooser->priv = GVC_SOUND_THEME_CHOOSER_GET_PRIVATE (chooser);
778
766
 
779
 
        chooser->priv->client = gconf_client_get_default ();
 
767
        chooser->priv->settings = g_settings_new (WM_SCHEMA);
780
768
        chooser->priv->sound_settings = g_settings_new (KEY_SOUNDS_SCHEMA);
781
769
 
782
770
        str = g_strdup_printf ("<b>%s</b>", _("C_hoose an alert sound:"));
812
800
 
813
801
        g_signal_connect (G_OBJECT (chooser->priv->sound_settings), "changed",
814
802
                          G_CALLBACK (on_sound_settings_changed), chooser);
815
 
        gconf_client_add_dir (chooser->priv->client, KEY_METACITY_DIR,
816
 
                              GCONF_CLIENT_PRELOAD_ONELEVEL,
817
 
                              NULL);
818
 
        chooser->priv->metacity_dir_id = gconf_client_notify_add (chooser->priv->client,
819
 
                                                                  KEY_METACITY_DIR,
820
 
                                                                  (GConfClientNotifyFunc)on_key_changed,
821
 
                                                                  chooser, NULL, NULL);
 
803
        g_signal_connect (chooser->priv->settings, "changed::" AUDIO_BELL_KEY,
 
804
                          G_CALLBACK (on_audible_bell_changed), chooser);
822
805
}
823
806
 
824
807
static void
832
815
        sound_theme_chooser = GVC_SOUND_THEME_CHOOSER (object);
833
816
 
834
817
        if (sound_theme_chooser->priv != NULL) {
835
 
                if (sound_theme_chooser->priv->metacity_dir_id > 0) {
836
 
                        gconf_client_notify_remove (sound_theme_chooser->priv->client,
837
 
                                                    sound_theme_chooser->priv->metacity_dir_id);
838
 
                        sound_theme_chooser->priv->metacity_dir_id = 0;
839
 
                }
840
 
                g_object_unref (sound_theme_chooser->priv->client);
 
818
                g_object_unref (sound_theme_chooser->priv->settings);
841
819
                g_object_unref (sound_theme_chooser->priv->sound_settings);
842
 
                sound_theme_chooser->priv->client = NULL;
843
820
        }
844
821
 
845
822
        G_OBJECT_CLASS (gvc_sound_theme_chooser_parent_class)->finalize (object);