Example #1
0
        public PreferencesDialog()
            : base("PreferencesDialog.ui", "preferences")
        {
            bool more;
            TreeIter iter;
            string effect, selected;

            transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
            CellRenderer transition_cell = new CellRendererText ();
            transition_combo.Model = transition_store;
            transition_combo.PackStart (transition_cell, true);
            transition_combo.SetCellDataFunc (transition_cell, Utils.ComboBoxCellFunc);
            LoadTransitionsIntoCombo ();

            thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
            CellRenderer thumbnail_cell = new CellRendererText ();
            thumbnail_combo.Model = thumbnail_store;
            thumbnail_combo.PackStart (thumbnail_cell, true);
            thumbnail_combo.SetCellDataFunc (thumbnail_cell, Utils.ComboBoxCellFunc);
            LoadThumbnailsIntoCombo ();

            textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
            CellRenderer textposition_cell = new CellRendererText ();
            textposition_combo.Model = textposition_store;
            textposition_combo.PackStart (textposition_cell, true);
            textposition_combo.SetCellDataFunc (textposition_cell, Utils.ComboBoxCellFunc);
            LoadTextPositionsIntoCombo ();

            projectsdir = new BrowseFile (projectsdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ProjectsDirectoryKey), false);
            videosdir = new BrowseFile (videosdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.VideosDirectoryKey), false);
            imagesdir = new BrowseFile (imagesdir_hbox, Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey), false);
            audiodir = new BrowseFile (audiodir_hbox, Mistelix.Preferences.GetStringValue (Preferences.AudioDirectoryKey), false);

            duration_spin.Value = Mistelix.Preferences.GetIntValue (Preferences.DefaultDurationKey);

            // Default Transition effect
            selected = Mistelix.Preferences.GetStringValue (Preferences.DefaultTransitionKey);
            more = transition_store.GetIterFirst (out iter);
            while (more)
            {
                effect = (string) transition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
                if (effect.Equals (selected)) {
                    transition_combo.SetActiveIter (iter);
                    break;
                }
                more = transition_store.IterNext (ref iter);
            }

            // Default thumbnail size
            int thumbnail = Mistelix.Preferences.GetIntValue (Preferences.ThumbnailSizeKey);
            int current;

            more = thumbnail_store.GetIterFirst (out iter);
            while (more)
            {
                current = (int) thumbnail_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
                if (thumbnail == current) {
                    thumbnail_combo.SetActiveIter (iter);
                    break;
                }
                more = thumbnail_store.IterNext (ref iter);
            }

            // Default text position box
            int position = Mistelix.Preferences.GetIntValue (Preferences.DefaultTextPositionKey);

            more = textposition_store.GetIterFirst (out iter);
            while (more)
            {
                current = (int) textposition_store.GetValue (iter, (int) ColumnsCombo.Column_Name);
                if (position == current) {
                    textposition_combo.SetActiveIter (iter);
                    break;
                }
                more = textposition_store.IterNext (ref iter);
            }
        }
Example #2
0
        public ThemeSelectionDialog(Project project)
            : base("ThemeSelectionDialog.ui", "themeselection")
        {
            this.project = project;
            hpaned.Position = 200; // W (left)
            selected_theme = null;
            menu_drawing_area = new MenuBackgroundPreview ();
            selectbutton_drawing_area = new ButtonPreview (project);
            highlightbutton_drawing_area = new ButtonPreview (project);

            browse_file = new BrowseFile (file_hbox, project.Details.CustomMenuBackground, true);
            browse_file.DefaultDirectory = Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey);
            menu_drawing_area.CustomMenuBackground = project.Details.CustomMenuBackground;

            color = author_label.Style.Background (StateType.Normal);
            textview_intro.ModifyBase (Gtk.StateType.Normal, color);

            Gtk.Button clean_button = new Gtk.Button (Catalog.GetString ("Clean"));
            clean_button.Clicked += delegate
            {
                browse_file.Filename = null;
                menu_drawing_area.CustomMenuBackground = null;
            };

            file_hbox.Add (clean_button);
            file_hbox.ShowAll ();

            PrepareTree ();
            backpreview_box.Add (menu_drawing_area);
            backpreview_box.ShowAll ();

            highlightbutton_box.Add (highlightbutton_drawing_area);
            highlightbutton_box.ShowAll ();

            selectbutton_box.Add (selectbutton_drawing_area);
            selectbutton_box.ShowAll ();

            browse_file.FileSelectedChanged += delegate
            {
                menu_drawing_area.CustomMenuBackground = browse_file.Filename;
            };

            Gtk.TextBuffer buffer_intro = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            textview_intro.Buffer = buffer_intro;
            buffer_intro.Text = String.Format (
                Catalog.GetString ("Menu themes define how the main DVD menu looks. Here you define the default background image and the type of buttons. For more information visit: {0}"),
                Defines.THEMES_URL);
        }