Example #1
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);
        }
Example #2
0
        void OnCursorChanged(object obj,  EventArgs e)
        {
            TreeModel model;
            TreeIter iter;
            TreeSelection selection = (obj as TreeView).Selection;

            if (selection.GetSelected (out model, out iter) == false)
                return;

            selected_theme = menu_drawing_area.Theme = (Theme) model.GetValue (iter, COL_OBJECT);
            selectbutton_drawing_area.ImageFile = System.IO.Path.Combine (Defines.DATA_DIR, selected_theme.ButtonSelect);
            highlightbutton_drawing_area.ImageFile = System.IO.Path.Combine (Defines.DATA_DIR, selected_theme.ButtonHighlight);

            name_label.Text = selected_theme.Name;
            author_label.Text = selected_theme.Author;

            Logger.Debug ("ThemeSelectionDialog. Selected theme {0}", selected_theme.Name);
        }