コード例 #1
0
ファイル: SlideShow.cs プロジェクト: GNOME/mistelix
        // Check if the audio uses a supported format
        public bool AudioSupportedFormat(out string msg)
        {
            Dependencies dependencies;
            string format;

            format = Backends.GStreamer.DetectMedia.GetType (AudioFile);
            Logger.Debug ("SlideShow.SupportedFormat. Filename {0} is {1}", AudioFile, format);

            dependencies = new Dependencies ();

            if (String.Compare (format, "application/x-id3", StringComparison.OrdinalIgnoreCase) == 0)
            {
                if (dependencies.MP3Support == false)
                {
                    msg = String.Format (Catalog.GetString ("The file '{0}' is encoded in MP3 but you do not have the right codec installed."), AudioFile);
                    return false;
                }
            }

            msg = string.Empty;
            return true;
        }
コード例 #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 ();
        }
コード例 #3
0
        public override ResponseType RunModal()
        {
            List <Dependencies.Dependency> status;
            Gdk.Color color;
            Pixbuf image;
            const int icon_size = 16;

            if (dependencies == null)
                dependencies = new Dependencies ();

            status = dependencies.Status;

            CellRendererText action_cell = new CellRendererText ();
            action_cell.WrapWidth = 300;
            action_cell.WrapMode = Pango.WrapMode.Word;

            CellRendererPixbuf status_cell = new CellRendererPixbuf ();
            status_cell.StockSize = (uint)Gtk.IconSize.Menu;

            treeview.AppendColumn (Catalog.GetString ("Status"), status_cell, "pixbuf", COL_STATUS);
            treeview.AppendColumn (Catalog.GetString ("Dependency"), new CellRendererText (), "text", COL_DEPEN);
            treeview.AppendColumn (Catalog.GetString ("Action"), action_cell, "text", COL_ACTION);

            treeview.Model = store  = new ListStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));

            for (int row = 0; row < status.Count; row++)
            {
                if (status[row].Available)
                    image = Gtk.IconTheme.Default.LoadIcon ("gtk-yes", icon_size, (Gtk.IconLookupFlags) 0);
                else
                    image = Gtk.IconTheme.Default.LoadIcon ("gtk-no", icon_size, (Gtk.IconLookupFlags) 0);

                store.AppendValues (image, status[row].Component, status[row].Action);
            }

            text_buffer.Text = dependencies.CapabilitiesSummary;

            Gtk.Label label = new Gtk.Label ();
            dependencies_vbox.Add (label);
            label.ShowAll ();
            color = label.Style.Background (StateType.Normal);
            dependencies_vbox.Remove (label);

            textview_intro.ModifyBase (Gtk.StateType.Normal, color);
            capabilitiesview.ModifyBase (Gtk.StateType.Normal, color);
            return base.RunModal ();
        }