示例#1
0
文件: Do.cs 项目: codecopy/core-1
        internal static void Main(string [] args)
        {
            Catalog.Init("gnome-do", AssemblyInfo.LocaleDirectory);
            Gtk.Application.Init();

            // We are conservative with the log at first.
            Log.DisplayLevel = LogLevel.Error;
            if (CorePreferences.PeekDebug)
            {
                Log.DisplayLevel = LogLevel.Debug;
            }

            PluginManager.Initialize();
            Services.System.EnsureSingleApplicationInstance();

            Preferences = new CorePreferences();

            // Now we can set the preferred log level.
            if (Preferences.QuietStart)
            {
                Log.DisplayLevel = LogLevel.Error;
            }
            // Check for debug again in case QuietStart is also set.
            if (Preferences.Debug)
            {
                Log.DisplayLevel = LogLevel.Debug;
            }

            try {
                Services.System.SetProcessName("gnome-do");
            } catch (Exception e) {
                Log.Error("Failed to set process name: {0}", e.Message);
            }

            Controller.Initialize();
            UniverseManager.Initialize();

            if (!Preferences.QuietStart)
            {
                Controller.Summon();
            }

            Gtk.Application.Run();

            RelevanceProvider.Serialize(RelevanceProvider.DefaultProvider);
        }