~raof/do/throwaway-app-indicator

« back to all changes in this revision

Viewing changes to Do.Interface.Linux.Docky/src/Docky.Core/Docky.Core.Default/DockletService.cs

  • Committer: Robert Dyer
  • Date: 2009-08-29 07:45:29 UTC
  • mfrom: (1295.1.10 gconf-notify)
  • Revision ID: rdyer@yamuna-20090829074529-gi0qc235wc6nsxn2
merging branch that allows GConf to notify Do of changed preferences and Do to handle them accordingly

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                                docklet.Enable ();
51
51
                        
52
52
                        docklets [docklet] = !docklets [docklet];
 
53
                        SaveConfiguration ();
53
54
                        OnAppletVisibilityChanged ();
54
55
                        return true;
55
56
                }
83
84
                public DockletService()
84
85
                {
85
86
                        prefs = Services.Preferences.Get<DockletService> ();
 
87
                        prefs.PreferencesChanged += HandlePreferencesChanged;
86
88
                        
87
89
                        AddinManager.AddExtensionNodeHandler (ExtensionPath, HandleDockletsChanged);
88
90
                        
89
91
                        BuildDocklets ();
90
92
                }
91
93
                
 
94
                void HandlePreferencesChanged (object sender, PreferencesChangedEventArgs args)
 
95
                {
 
96
                        if (args.Key != "ActiveApplets")
 
97
                                return;
 
98
                        BuildDocklets ();
 
99
                        OnAppletVisibilityChanged ();
 
100
                }
 
101
                
92
102
                void HandleDockletsChanged (object sender, ExtensionNodeEventArgs args)
93
103
                {
94
104
                        BuildDocklets ();
 
105
                        SaveConfiguration ();
95
106
                        OnAppletVisibilityChanged ();
96
107
                }
97
108
                
124
135
                        foreach (AbstractDockletItem abi in ActiveDocklets) {
125
136
                                s += abi.GetType ().Name + ";";
126
137
                        }
127
 
                        prefs.Set ("ActiveApplets", s);
 
138
                        if (s != prefs.Get ("ActiveApplets", "ClockDockItem;"))
 
139
                                prefs.Set ("ActiveApplets", s);
128
140
                }
129
141
                
130
142
                void OnAppletVisibilityChanged ()
131
143
                {
132
 
                        SaveConfiguration ();
133
144
                        if (AppletVisibilityChanged != null)
134
145
                                AppletVisibilityChanged (this, EventArgs.Empty);
135
146
                }