def fill_options(self): self.widget.get_model().clear() self.widget.append_text(current_sequence().profile.description()) profiles = mltprofiles.get_profiles() for profile in profiles: self.widget.append_text(profile[0]) self.widget.set_active(0)
def _general_options_panel(): prefs = editorpersistance.prefs # Widgets open_in_last_opened_check = Gtk.CheckButton() open_in_last_opened_check.set_active(prefs.open_in_last_opended_media_dir) open_in_last_rendered_check = Gtk.CheckButton() open_in_last_rendered_check.set_active(prefs.remember_last_render_dir) default_profile_combo = Gtk.ComboBoxText() profiles = mltprofiles.get_profiles() for profile in profiles: default_profile_combo.append_text(profile[0]) default_profile_combo.set_active(mltprofiles.get_default_profile_index()) spin_adj = Gtk.Adjustment(prefs.undos_max, editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin = Gtk.SpinButton.new_with_range(editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin.set_adjustment(spin_adj) undo_max_spin.set_numeric(True) autosave_combo = Gtk.ComboBoxText() AUTO_SAVE_OPTS = ((-1, _("No Autosave")),(1, _("1 min")),(2, _("2 min")),(5, _("5 min"))) for i in range(0, len(AUTO_SAVE_OPTS)): time, desc = AUTO_SAVE_OPTS[i] autosave_combo.append_text(desc) autosave_combo.set_active(prefs.auto_save_delay_value_index) load_order_combo = Gtk.ComboBoxText() load_order_combo.append_text(_("Absolute paths first, relative second")) load_order_combo.append_text(_("Relative paths first, absolute second")) load_order_combo.append_text(_("Absolute paths only")) load_order_combo.set_active(prefs.media_load_order) # Layout row1 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default Profile:")), default_profile_combo, PREFERENCES_LEFT)) row2 = _row(guiutils.get_checkbox_row_box(open_in_last_opened_check, Gtk.Label(label=_("Remember last media directory")))) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Undo stack size:")), undo_max_spin, PREFERENCES_LEFT)) row5 = _row(guiutils.get_checkbox_row_box(open_in_last_rendered_check, Gtk.Label(label=_("Remember last render directory")))) row6 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Autosave for crash recovery every:")), autosave_combo, PREFERENCES_LEFT)) row9 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media look-up order on load:")), load_order_combo, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) return vbox, (default_profile_combo, open_in_last_opened_check, open_in_last_rendered_check, undo_max_spin, load_order_combo)
def _get_user_profiles_panel(): # User profiles view user_profiles_list = guicomponents.ProfileListView() user_profiles_list.fill_data_model(mltprofiles.get_user_profiles()) delete_selected_button = gtk.Button(_("Delete Selected")) user_vbox = gtk.VBox(False, 2) user_vbox.pack_start(user_profiles_list, True, True, 0) user_vbox.pack_start(guiutils.get_right_justified_box([delete_selected_button]), False, False, 0) # Create profile panel default_profile_index = mltprofiles.get_default_profile_index() default_profile = mltprofiles.get_default_profile() load_profile_button = gtk.Button(_("Load Profile Values")) load_profile_combo = gtk.combo_box_new_text() profiles = mltprofiles.get_profiles() for profile in profiles: load_profile_combo.append_text(profile[0]) load_profile_combo.set_active(default_profile_index) description = gtk.Entry() description.set_text("User Created Profile") f_rate_num = gtk.Entry() f_rate_num.set_text(str(25)) f_rate_dem = gtk.Entry() f_rate_dem.set_text(str(1)) width = gtk.Entry() width.set_text(str(720)) height = gtk.Entry() height.set_text(str(576)) s_rate_num = gtk.Entry() s_rate_num.set_text(str(15)) s_rate_dem = gtk.Entry() s_rate_dem.set_text(str(16)) d_rate_num = gtk.Entry() d_rate_num.set_text(str(4)) d_rate_dem = gtk.Entry() d_rate_dem.set_text(str(3)) progressive = gtk.CheckButton() progressive.set_active(False) save_button = gtk.Button(_("Save New Profile")) widgets = (load_profile_combo, description, f_rate_num, f_rate_dem, width, height, s_rate_num, s_rate_dem, d_rate_num, d_rate_dem, progressive) _fill_new_profile_panel_widgets(default_profile, widgets) # build panel profile_row = gtk.HBox(False,0) profile_row.pack_start(load_profile_combo, False, False, 0) profile_row.pack_start(gtk.Label(), True, True, 0) profile_row.pack_start(load_profile_button, False, False, 0) row0 = guiutils.get_two_column_box(gtk.Label(_("Description.:")), description, PROFILE_MANAGER_LEFT) row1 = guiutils.get_two_column_box(gtk.Label(_("Frame rate num.:")), f_rate_num, PROFILE_MANAGER_LEFT) row2 = guiutils.get_two_column_box(gtk.Label(_("Frame rate den.:")), f_rate_dem, PROFILE_MANAGER_LEFT) row3 = guiutils.get_two_column_box(gtk.Label(_("Width:")), width, PROFILE_MANAGER_LEFT) row4 = guiutils.get_two_column_box(gtk.Label(_("Height:")), height, PROFILE_MANAGER_LEFT) row5 = guiutils.get_two_column_box(gtk.Label(_("Sample aspect num.:")), s_rate_num, PROFILE_MANAGER_LEFT) row6 = guiutils.get_two_column_box(gtk.Label(_("Sample aspect den.:")), s_rate_dem, PROFILE_MANAGER_LEFT) row7 = guiutils.get_two_column_box(gtk.Label(_("Display aspect num.:")), d_rate_num, PROFILE_MANAGER_LEFT) row8 = guiutils.get_two_column_box(gtk.Label(_("Display aspect den.:")), d_rate_dem, PROFILE_MANAGER_LEFT) row9 = guiutils.get_two_column_box(gtk.Label(_("Progressive:")), progressive, PROFILE_MANAGER_LEFT) save_row = gtk.HBox(False,0) save_row.pack_start(gtk.Label(), True, True, 0) save_row.pack_start(save_button, False, False, 0) create_vbox = gtk.VBox(False, 2) create_vbox.pack_start(profile_row, False, False, 0) create_vbox.pack_start(guiutils.get_pad_label(10, 10), False, False, 0) create_vbox.pack_start(row0, False, False, 0) create_vbox.pack_start(row1, False, False, 0) create_vbox.pack_start(row2, False, False, 0) create_vbox.pack_start(row3, False, False, 0) create_vbox.pack_start(row4, False, False, 0) create_vbox.pack_start(row5, False, False, 0) create_vbox.pack_start(row6, False, False, 0) create_vbox.pack_start(row7, False, False, 0) create_vbox.pack_start(row8, False, False, 0) create_vbox.pack_start(row9, False, False, 0) create_vbox.pack_start(guiutils.get_pad_label(10, 10), False, False, 0) create_vbox.pack_start(save_row, False, False, 0) # callbacks load_profile_button.connect("clicked",lambda w,e: _load_values_clicked(widgets), None) save_button.connect("clicked",lambda w,e: _save_profile_clicked(widgets, user_profiles_list), None) delete_selected_button.connect("clicked",lambda w,e: _delete_user_profiles_clicked(user_profiles_list), None) vbox = gtk.VBox(False, 2) vbox.pack_start(guiutils.get_named_frame(_("Create User Profile"), create_vbox), False, False, 0) vbox.pack_start(guiutils.get_named_frame(_("User Profiles"), user_vbox), True, True, 0) return (vbox, user_profiles_list)
def _general_options_panel(folder_select_clicked_cb, render_folder_select_clicked_cb): prefs = editorpersistance.prefs # Widgets open_in_last_opened_check = Gtk.CheckButton() open_in_last_opened_check.set_active(prefs.open_in_last_opended_media_dir) open_in_last_rendered_check = Gtk.CheckButton() open_in_last_rendered_check.set_active(prefs.remember_last_render_dir) default_profile_combo = Gtk.ComboBoxText() profiles = mltprofiles.get_profiles() for profile in profiles: default_profile_combo.append_text(profile[0]) default_profile_combo.set_active(mltprofiles.get_default_profile_index()) spin_adj = Gtk.Adjustment(prefs.undos_max, editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin = Gtk.SpinButton.new_with_range(editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin.set_adjustment(spin_adj) undo_max_spin.set_numeric(True) folder_select = Gtk.Button(_("Select Folder")) # thumbnails folder_select.connect("clicked" , folder_select_clicked_cb) render_folder_select = Gtk.Button(_("Select Folder")) render_folder_select.connect("clicked" , render_folder_select_clicked_cb) autosave_combo = Gtk.ComboBoxText() AUTO_SAVE_OPTS = ((-1, _("No Autosave")),(1, _("1 min")),(2, _("2 min")),(5, _("5 min"))) for i in range(0, len(AUTO_SAVE_OPTS)): time, desc = AUTO_SAVE_OPTS[i] autosave_combo.append_text(desc) autosave_combo.set_active(prefs.auto_save_delay_value_index) load_order_combo = Gtk.ComboBoxText() load_order_combo.append_text("Absolute paths first, relative second") load_order_combo.append_text("Relative paths first, absolute second") load_order_combo.append_text("Absolute paths only") load_order_combo.set_active(prefs.media_load_order) # Layout row1 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default Profile:")), default_profile_combo, PREFERENCES_LEFT)) row2 = _row(guiutils.get_checkbox_row_box(open_in_last_opened_check, Gtk.Label(label=_("Remember last media directory")))) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Undo stack size:")), undo_max_spin, PREFERENCES_LEFT)) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Thumbnail folder:")), folder_select, PREFERENCES_LEFT)) row5 = _row(guiutils.get_checkbox_row_box(open_in_last_rendered_check, Gtk.Label(label=_("Remember last render directory")))) row6 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Autosave for crash recovery every:")), autosave_combo, PREFERENCES_LEFT)) row8 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Rendered Clips folder:")), render_folder_select, PREFERENCES_LEFT)) row9 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media look-up order on load:")), load_order_combo, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) return vbox, (default_profile_combo, open_in_last_opened_check, open_in_last_rendered_check, undo_max_spin, load_order_combo)
def _general_options_panel(): prefs = editorpersistance.prefs # Widgets open_in_last_opened_check = Gtk.CheckButton() open_in_last_opened_check.set_active(prefs.open_in_last_opended_media_dir) open_in_last_rendered_check = Gtk.CheckButton() open_in_last_rendered_check.set_active(prefs.remember_last_render_dir) default_profile_combo = Gtk.ComboBoxText() profiles = mltprofiles.get_profiles() for profile in profiles: default_profile_combo.append_text(profile[0]) default_profile_combo.set_active(mltprofiles.get_default_profile_index()) spin_adj = Gtk.Adjustment(value=prefs.undos_max, lower=editorpersistance.UNDO_STACK_MIN, upper=editorpersistance.UNDO_STACK_MAX, step_incr=1) undo_max_spin = Gtk.SpinButton.new_with_range(editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin.set_adjustment(spin_adj) undo_max_spin.set_numeric(True) autosave_combo = Gtk.ComboBoxText() # Aug-2019 - SvdB - AS - This is now initialized in app.main # Using editorpersistance.prefs.AUTO_SAVE_OPTS as source # AUTO_SAVE_OPTS = ((-1, _("No Autosave")),(1, _("1 min")),(2, _("2 min")),(5, _("5 min"))) for i in range(0, len(editorpersistance.prefs.AUTO_SAVE_OPTS)): time, desc = editorpersistance.prefs.AUTO_SAVE_OPTS[i] autosave_combo.append_text(desc) autosave_combo.set_active(prefs.auto_save_delay_value_index) load_order_combo = Gtk.ComboBoxText() load_order_combo.append_text(_("Absolute paths first, relative second")) load_order_combo.append_text(_("Relative paths first, absolute second")) load_order_combo.append_text(_("Absolute paths only")) load_order_combo.set_active(prefs.media_load_order) render_folder_select = Gtk.FileChooserButton.new (_("Select Default Render Folder"), Gtk.FileChooserAction.SELECT_FOLDER) if prefs.default_render_directory == None or prefs.default_render_directory == appconsts.USER_HOME_DIR \ or (not os.path.exists(prefs.default_render_directory)) \ or (not os.path.isdir(prefs.default_render_directory)): render_folder_select.set_current_folder_uri(os.path.expanduser("~") + "/") else: render_folder_select.set_current_folder_uri(prefs.default_render_directory) disk_cache_warning_combo = Gtk.ComboBoxText() disk_cache_warning_combo.append_text(_("Off")) disk_cache_warning_combo.append_text(_("500 MB")) disk_cache_warning_combo.append_text(_("1 GB")) disk_cache_warning_combo.append_text(_("2 GB")) disk_cache_warning_combo.set_active(prefs.disk_space_warning) # Layout row1 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default Profile:")), default_profile_combo, PREFERENCES_LEFT)) row2 = _row(guiutils.get_checkbox_row_box(open_in_last_opened_check, Gtk.Label(label=_("Remember last media directory")))) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Undo stack size:")), undo_max_spin, PREFERENCES_LEFT)) row5 = _row(guiutils.get_checkbox_row_box(open_in_last_rendered_check, Gtk.Label(label=_("Remember last render directory")))) row6 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Autosave for crash recovery every:")), autosave_combo, PREFERENCES_LEFT)) row9 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media look-up order on load:")), load_order_combo, PREFERENCES_LEFT)) row10 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default render directory:")), render_folder_select, PREFERENCES_LEFT)) row11 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Warning on Disk Cache Size:")), disk_cache_warning_combo, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row10, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row11, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Aug-2019 - SvdB - AS - Added autosave_combo return vbox, ( default_profile_combo, open_in_last_opened_check, open_in_last_rendered_check, undo_max_spin, load_order_combo, autosave_combo, render_folder_select, disk_cache_warning_combo)
def _general_options_panel(folder_select_clicked_cb, render_folder_select_clicked_cb): prefs = editorpersistance.prefs # Widgets open_in_last_opened_check = gtk.CheckButton() open_in_last_opened_check.set_active(prefs.open_in_last_opended_media_dir) open_in_last_rendered_check = gtk.CheckButton() open_in_last_rendered_check.set_active(prefs.remember_last_render_dir) default_profile_combo = gtk.combo_box_new_text() profiles = mltprofiles.get_profiles() for profile in profiles: default_profile_combo.append_text(profile[0]) default_profile_combo.set_active(mltprofiles.get_default_profile_index()) spin_adj = gtk.Adjustment(prefs.undos_max, editorpersistance.UNDO_STACK_MIN, editorpersistance.UNDO_STACK_MAX, 1) undo_max_spin = gtk.SpinButton(spin_adj) undo_max_spin.set_numeric(True) folder_select = gtk.Button(_("Select Folder")) # thumbnails folder_select.connect("clicked", folder_select_clicked_cb) render_folder_select = gtk.Button(_("Select Folder")) render_folder_select.connect("clicked", render_folder_select_clicked_cb) autosave_combo = gtk.combo_box_new_text() for i in range(0, len(editorpersistance.prefs.AUTO_SAVE_OPTS)): time, desc = editorpersistance.prefs.AUTO_SAVE_OPTS[i] autosave_combo.append_text(desc) autosave_combo.set_active(prefs.auto_save_delay_value_index) load_order_combo = gtk.combo_box_new_text() load_order_combo.append_text("Absolute paths first, relative second") load_order_combo.append_text("Relative paths first, absolute second") load_order_combo.append_text("Absolute paths only") load_order_combo.set_active(prefs.media_load_order) # Layout row1 = guiutils.get_two_column_box(gtk.Label(_("Default Profile:")), default_profile_combo, PREFERENCES_LEFT) row2 = guiutils.get_checkbox_row_box( open_in_last_opened_check, gtk.Label(_("Remember last media directory"))) row3 = guiutils.get_two_column_box(gtk.Label(_("Undo stack size:")), undo_max_spin, PREFERENCES_LEFT) row4 = guiutils.get_two_column_box(gtk.Label(_("Thumbnail folder:")), folder_select, PREFERENCES_LEFT) row5 = guiutils.get_checkbox_row_box( open_in_last_rendered_check, gtk.Label(_("Remember last render directory"))) row6 = guiutils.get_two_column_box( gtk.Label(_("Autosave for crash recovery every:")), autosave_combo, PREFERENCES_LEFT) row8 = guiutils.get_two_column_box(gtk.Label(_("Rendered Clips folder:")), render_folder_select, PREFERENCES_LEFT) row9 = guiutils.get_two_column_box( gtk.Label(_("Media look-up order on load:")), load_order_combo, PREFERENCES_LEFT) vbox = gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(gtk.Label(), True, True, 0) align = gtk.Alignment(0.5, 0.5, 1.0, 1.0) align.set_padding(12, 0, 12, 12) align.add(vbox) return align, (default_profile_combo, open_in_last_opened_check, open_in_last_rendered_check, undo_max_spin, load_order_combo)