Exemplo n.º 1
0
		static void ShowCodecsDialog ()
		{
			CodecsChoiceDialog ccd = new CodecsChoiceDialog ();
			int response = ccd.Run ();
			if (response == (int)ResponseType.Accept) {
				try {
					System.Diagnostics.Process.Start (Constants.WEBSITE);
				} catch {
				}
			}
			ccd.Destroy ();
		}
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            CoreServices.Init ();

            InitGtk ();

            /* Init GStreamer */
            GStreamer.Init ();
            //if (!GStreamer.CheckInstallation ())
            //	return;

            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler (OnException);
            Version version = Assembly.GetExecutingAssembly ().GetName ().Version;

            try {
                AddinsManager.Initialize (Config.PluginsConfigDir, Config.PluginsDir);
                AddinsManager.LoadConfigModifierAddins ();
                Config.DrawingToolkit = new CairoBackend ();
                Config.EventsBroker = new EventsBroker ();
                Config.MultimediaToolkit = new MultimediaToolkit ();
                Config.GUIToolkit = new GUIToolkit (version);
                bool haveCodecs = AddinsManager.RegisterGStreamerPlugins ();
                AddinsManager.LoadExportProjectAddins (Config.GUIToolkit.MainController);
                AddinsManager.LoadMultimediaBackendsAddins (Config.MultimediaToolkit);
                AddinsManager.LoadUIBackendsAddins (Config.GUIToolkit);
                AddinsManager.LoadServicesAddins ();
                Config.GUIToolkit.Register<IPlayerView, PlayerView> (0);

                if (!haveCodecs) {
                    CodecsChoiceDialog ccd = new CodecsChoiceDialog ();
                    int response = ccd.Run ();
                    if (response == (int) ResponseType.Accept) {
                        try {
                            System.Diagnostics.Process.Start (Constants.WEBSITE);
                        } catch {
                        }
                    }
                    ccd.Destroy ();
                }
                try {
                    CoreServices.Start (Config.GUIToolkit, Config.MultimediaToolkit);
                } catch (DBLockedException locked) {
                    string msg = Catalog.GetString ("The database seems to be locked by another instance and " +
                        "the application will be closed.");
                    Config.GUIToolkit.ErrorMessage (msg);
                    Log.Exception (locked);
                    return;
                }
                AddinsManager.LoadDashboards (Config.CategoriesTemplatesProvider);
                AddinsManager.LoadImportProjectAddins (CoreServices.ProjectsImporter);

                ConfigureOSXApp ();

                Application.Run ();
            }  catch (AddinRequestShutdownException arse) {
                // Abort gracefully
            } catch (Exception ex) {
                ProcessExecutionError (ex);
            } finally {
                try {
                    AddinsManager.ShutdownMultimediaBackends ();
                } catch {
                }
            }
        }