~ubuntu-branches/ubuntu/wily/gnome-do/wily

« back to all changes in this revision

Viewing changes to Do/src/Do.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2011-02-15 21:50:02 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110215215002-1j8ylb69o15asb06
Tags: 0.8.4-0ubuntu1
* The Race Against FF upload.  Merge from unreleased Debian git.
  Remaining Ubuntu changes:
  + debian/patches/05_disable_resize_grips.patch.diff:
    Disable resize handles for the Do windows.
  + debian/control:
    Bump gtk# build dep for HasResizeGrip API.
* New Debian changes:
* The long fortold release
  + Fixes a threadsafety issue resulting in 100% CPU usage (Closes: 565591,
    LP: #450852).
  + Proxies all keyring calls to the GTK main thread, as required by the new
    gnome-keyring (Closes: 603876, LP: #553643)
* debian/patches/00_bundledlibs.dpatch:
* debian/rules:
  + Upstream has dropped bundled gmcs binary; now 100% DFSG-free, so we don't
    have to repack the tarball or patch the buildsystem.
* debian/patches/03_disable_docky.dpatch:
  + Drop.  Docky is now gone in the upstream tarball.
* debian/rules:
* debian/control:
* debian/patches/*:
  + Switch to quilt to harmonise with other pkg-cli-* packages.
* debian/control:
  + Drop recommends on gnome-do-docklets.  Docky is now a separate package,
    so the docklets are useless for Do.
  + Bump Breaks on gnome-do-plugins to 0.8.3.  Do no longer provides the Wink
    library, which has been imported into the 0.8.3 do-plugins sources.
  + Bump standards-version; no changes needed.
  + Migrate to git and update VCS fields appropriately

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
using Do.UI;
28
28
using Do.Core;
29
29
using Do.Platform;
 
30
using Do.Platform.Common;
30
31
 
31
32
namespace Do {
32
33
 
33
34
        static class Do {
34
35
                
35
 
                static XKeybinder keybinder;
36
36
                static Controller controller;
37
37
                static UniverseManager universe_manager;
38
38
 
39
 
                public static CorePreferences Preferences { get; private set; } 
40
 
                public static CoreKeybindings Keybindings { get; private set; } 
41
 
 
 
39
                public static CorePreferences Preferences { get; private set; }
 
40
                
42
41
                internal static void Main (string [] args)
43
42
                {
44
43
                        Catalog.Init ("gnome-do", AssemblyInfo.LocaleDirectory);
55
54
 
56
55
                        Preferences = new CorePreferences ();
57
56
 
58
 
                        Keybindings = new CoreKeybindings ();
59
 
 
60
57
                        // Now we can set the preferred log level.
61
58
                        if (Preferences.QuietStart)
62
59
                                Log.DisplayLevel = LogLevel.Error;
65
62
                                Log.DisplayLevel = LogLevel.Debug;
66
63
 
67
64
                        try {
68
 
                                Util.SetProcessName ("gnome-do");
 
65
                                Services.System.SetProcessName ("gnome-do");
69
66
                        } catch (Exception e) {
70
67
                                Log.Error ("Failed to set process name: {0}", e.Message);
71
68
                        }
73
70
                        Controller.Initialize ();
74
71
                        UniverseManager.Initialize ();
75
72
                        
76
 
                        keybinder = new XKeybinder ();
77
 
                        SetupKeybindings ();
78
 
 
79
73
                        if (!Preferences.QuietStart)
80
74
                                Controller.Summon ();
81
 
                        
 
75
 
82
76
                        Gtk.Application.Run ();
83
77
                        
84
78
                        RelevanceProvider.Serialize (RelevanceProvider.DefaultProvider);
100
94
                                return universe_manager;
101
95
                        }
102
96
                }
103
 
 
104
 
                static void SummonKeyCb (object sender, PreferencesChangedEventArgs e)
105
 
                {
106
 
                        try {
107
 
                                if (e.OldValue != null)
108
 
                                        keybinder.Unbind (e.OldValue as string);
109
 
                                keybinder.Bind (Keybindings.GetKeybinding ("SummonKey"), OnActivate);
110
 
                        } catch (Exception ex) {
111
 
                                Log.Error ("Could not bind summon key: {0}", ex.Message);
112
 
                                Log.Debug (ex.StackTrace);
113
 
                        }
114
 
 
115
 
                }
116
 
                
117
 
                static void SetupKeybindings ()
118
 
                {
119
 
                        try {
120
 
                                keybinder.Bind (Keybindings.GetKeybinding ("SummonKey"), OnActivate);
121
 
                        } catch (Exception e) {
122
 
                                Log.Error ("Could not bind summon key: {0}", e.Message);
123
 
                                Log.Debug (e.StackTrace);
124
 
                        }
125
 
 
126
 
                        // Watch preferences for changes to the keybinding so we
127
 
                        // can change the binding when the user reassigns it.
128
 
                        Keybindings.RegisterNotification ("SummonKey", SummonKeyCb);
129
 
                }
130
 
                
131
 
                static void OnActivate (object sender, EventArgs e)
132
 
                {
133
 
                        controller.Summon ();
134
 
                }
135
97
        }
136
 
}
 
98
}
 
 
b'\\ No newline at end of file'