コード例 #1
0
ファイル: mistelix.cs プロジェクト: GNOME/mistelix
 void OnCheckDependencies(object sender, EventArgs args)
 {
     CheckDependenciesDialog dialog = new CheckDependenciesDialog (project);
     dialog.RunModal ();
 }
コード例 #2
0
ファイル: mistelix.cs プロジェクト: GNOME/mistelix
        void OnBuildProject(object sender, EventArgs args)
        {
            Dependencies dependencies;
            bool support;
            string msg_audio;

            dependencies = new Dependencies ();

            if (project.AudioSupportedFormat (out msg_audio) == false)
            {
                string msg;

                msg = String.Format (Catalog.GetString (
                    // Translators: {0} is the error message
                    "{0}\n\nGo to 'Check Mistelix's Dependencies Requirements' dialog and make sure that you have the right audio codecs installed.\n\nIf you continue, your project will have no audio."),
                    msg_audio);

                MessageDialog md = new MessageDialog (app_window,
                              	DialogFlags.Modal, MessageType.Warning,
                              	ButtonsType.Ok, false, msg);

                md.Run ();
                md.Destroy ();
            }

            if (project.Details.Type == ProjectType.DVD)
                support = dependencies.DvdSupport;
            else
                support = dependencies.TheoraSupport;

            if (support == false) {
                CheckDependenciesDialog dependencies_dialog = new CheckDependenciesDialog (project);
                dependencies_dialog.Dependencies = dependencies;
                dependencies_dialog.RunModal ();
                return;
            }

            if (project.Details.Type == ProjectType.DVD) {
                if (project.Buttons.Count == 0) {
                    String msg;

                    msg = Catalog.GetString ("A DVD project needs at least one button item. You can create a button by dragging a project element into the main DVD menu area.");
                    MessageDialog md = new MessageDialog (app_window,
                                      	DialogFlags.Modal, MessageType.Warning,
                                      	ButtonsType.Ok, msg);

                    md.Run ();
                    md.Destroy ();
                    return;
                }
                if (project.Details.Theme == null) {
                    String msg;

                    msg = Catalog.GetString ("A DVD project needs a theme. Use the 'Select DVD Menu Theme' menu option to select a theme.");
                    MessageDialog md = new MessageDialog (app_window,
                                      	DialogFlags.Modal, MessageType.Warning,
                                      	ButtonsType.Ok, msg);

                    md.Run ();
                    md.Destroy ();
                    return;

                }
            }

            BuildProjectDialog build_dialog = new BuildProjectDialog (project);
            build_dialog.RunModal ();
        }