def _ising_clip_dialog(callback): dialog = gtk.Dialog(_("Create Ising Clip"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), gtk.RESPONSE_REJECT, _("Create").encode('utf-8'), gtk.RESPONSE_ACCEPT)) n_box, n_slider = guiutils.get_non_property_slider_row(0, 100, 1) bg_box, bg_slider = guiutils.get_non_property_slider_row(0, 100, 1) sg_box, sg_slider = guiutils.get_non_property_slider_row(0, 100, 1) row1 = guiutils.get_two_column_box(gtk.Label(_("Noise temperature:")), n_box, 200) row2 = guiutils.get_two_column_box(gtk.Label(_("Border growth:")), bg_box, 200) row3 = guiutils.get_two_column_box(gtk.Label(_("Spontanious growth:")), sg_box, 200) vbox = gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(gtk.Label(), True, True, 0) vbox.set_size_request(450, 150) align = gtk.Alignment(0.5, 0.5, 1.0, 1.0) align.set_padding(12, 0, 12, 12) align.add(vbox) selection_widgets = (n_slider, bg_slider, sg_slider) dialog.connect('response', callback, selection_widgets) dialog.vbox.pack_start(align, True, True, 0) dialogutils.default_behaviour(dialog) dialog.show_all()
def _ising_clip_dialog(callback): dialog = Gtk.Dialog(_("Create Ising Clip"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT, _("Create").encode('utf-8'), Gtk.ResponseType.ACCEPT)) n_box, n_slider = guiutils.get_non_property_slider_row(0, 100, 1) bg_box, bg_slider = guiutils.get_non_property_slider_row(0, 100, 1) sg_box, sg_slider = guiutils.get_non_property_slider_row(0, 100, 1) row1 = guiutils.get_two_column_box(Gtk.Label(label=_("Noise temperature:")), n_box, 200) row2 = guiutils.get_two_column_box(Gtk.Label(label=_("Border growth:")), bg_box, 200) row3 = guiutils.get_two_column_box(Gtk.Label(label=_("Spontanious growth:")), sg_box, 200) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.set_size_request(450, 150) align = guiutils.set_margins(vbox, 12, 0, 12, 12) selection_widgets = (n_slider, bg_slider, sg_slider) dialog.connect('response', callback, selection_widgets) dialog.vbox.pack_start(align, True, True, 0) dialogutils.default_behaviour(dialog) dialogutils.set_outer_margins(dialog.vbox) dialog.show_all()
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_play_in_clip_monitor = Gtk.CheckButton() auto_play_in_clip_monitor.set_active(prefs.auto_play_in_clip_monitor) auto_center_on_stop = Gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) spin_adj = Gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) trim_exit_on_empty = Gtk.CheckButton() trim_exit_on_empty.set_active(prefs.empty_click_exits_trims) quick_enter_trim = Gtk.CheckButton() quick_enter_trim.set_active(prefs.quick_enter_trims) remember_clip_frame = Gtk.CheckButton() remember_clip_frame.set_active(prefs.remember_monitor_clip_frame) overwrite_clip_drop = Gtk.ComboBoxText() active = 0 if prefs.overwrite_clip_drop == False: active = 1 overwrite_clip_drop.append_text(_("Overwrite blanks")) overwrite_clip_drop.append_text(_("Always insert")) overwrite_clip_drop.set_active(active) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) # Layout row1 = _row(guiutils.get_checkbox_row_box(auto_play_in_clip_monitor, Gtk.Label(label=_("Autoplay new Clips in Clip Monitor")))) row2 = _row(guiutils.get_checkbox_row_box(auto_center_on_stop, Gtk.Label(label=_("Center Current Frame on Playback Stop")))) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) row5 = _row(guiutils.get_checkbox_row_box(trim_exit_on_empty, Gtk.Label(label=_("Trim Modes exit on empty click")))) row6 = _row(guiutils.get_checkbox_row_box(quick_enter_trim, Gtk.Label(label=_("Quick enter Trim Modes")))) row7 = _row(guiutils.get_checkbox_row_box(remember_clip_frame, Gtk.Label(label=_("Remember Monitor Clip Frame")))) row8 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media drag'n'drop action on non-V1 tracks")), overwrite_clip_drop, PREFERENCES_LEFT)) row9 = _row(guiutils.get_checkbox_row_box(cover_delete, Gtk.Label(label=_("Cover Transition/Fade clips on delete if possible")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row7, 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, (auto_play_in_clip_monitor, auto_center_on_stop, gfx_length_spin, trim_exit_on_empty, quick_enter_trim, remember_clip_frame, overwrite_clip_drop, cover_delete)
def _color_clip_dialog(callback): dialog = gtk.Dialog(_("Create Color Clip"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), gtk.RESPONSE_REJECT, _("Create").encode('utf-8'), gtk.RESPONSE_ACCEPT)) name_entry = gtk.Entry() name_entry.set_text(_("Color Clip")) color_button = gtk.ColorButton() cb_hbox = gtk.HBox(False, 0) cb_hbox.pack_start(color_button, False, False, 4) cb_hbox.pack_start(gtk.Label(), True, True, 0) row1 = guiutils.get_two_column_box(gtk.Label(_("Clip Name:")), name_entry, 200) row2 = guiutils.get_two_column_box(gtk.Label(_("Select Color:")), cb_hbox, 200) vbox = gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, 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) selection_widgets = (name_entry, color_button) dialog.connect('response', callback, selection_widgets) dialog.vbox.pack_start(align, True, True, 0) dialogutils.default_behaviour(dialog) dialog.show_all()
def _color_clip_dialog(callback): dialog = Gtk.Dialog(_("Create Color Clip"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT, _("Create").encode('utf-8'), Gtk.ResponseType.ACCEPT)) name_entry = Gtk.Entry() name_entry.set_text(_("Color Clip")) color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(0,0,0,1)) cb_hbox = Gtk.HBox(False, 0) cb_hbox.pack_start(color_button, False, False, 4) cb_hbox.pack_start(Gtk.Label(), True, True, 0) row1 = guiutils.get_two_column_box(Gtk.Label(label=_("Clip Name:")), name_entry, 200) row2 = guiutils.get_two_column_box(Gtk.Label(label=_("Select Color:")), cb_hbox, 200) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) align = guiutils.set_margins(vbox, 12, 0, 12, 12) selection_widgets = (name_entry, color_button) dialog.connect('response', callback, selection_widgets) dialog.vbox.pack_start(vbox, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.show_all()
def export_screenshot_dialog(callback, frame, parent_window, project_name): cancel_str = _("Cancel").encode("utf-8") ok_str = _("Export Image").encode("utf-8") dialog = Gtk.Dialog( _("Export Frame Image"), parent_window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (cancel_str, Gtk.ResponseType.CANCEL, ok_str, Gtk.ResponseType.YES), ) global _screenshot_img _screenshot_img = guiutils.get_gtk_image_from_file(get_displayed_image_path(), 300) frame_frame = guiutils.get_named_frame_with_vbox(None, [_screenshot_img]) INPUT_LABELS_WITDH = 320 project_name = project_name.strip(".flb") file_name = Gtk.Entry() file_name.set_text(project_name) extension_label = Gtk.Label(label=".png") extension_label.set_size_request(35, 20) name_pack = Gtk.HBox(False, 4) name_pack.pack_start(file_name, True, True, 0) name_pack.pack_start(extension_label, False, False, 0) name_row = guiutils.get_two_column_box(Gtk.Label(label=_("Export file name:")), name_pack, INPUT_LABELS_WITDH) out_folder = Gtk.FileChooserButton(_("Select target folder")) out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) out_folder.set_current_folder(os.path.expanduser("~") + "/") folder_row = guiutils.get_two_column_box(Gtk.Label(label=_("Export folder:")), out_folder, INPUT_LABELS_WITDH) file_type_combo = Gtk.ComboBoxText() for img in _img_types: file_type_combo.append_text(img) file_type_combo.set_active(0) file_type_combo.connect("changed", _file_type_changed, extension_label) file_type_row = guiutils.get_two_column_box(Gtk.Label(label=_("Image type:")), file_type_combo, INPUT_LABELS_WITDH) file_frame = guiutils.get_named_frame_with_vbox(None, [file_type_row, name_row, folder_row]) vbox = Gtk.VBox(False, 2) vbox.pack_start(frame_frame, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 12), False, False, 0) vbox.pack_start(file_frame, False, False, 0) alignment = guiutils.set_margins(vbox, 12, 12, 12, 12) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.connect( "response", callback, (file_name, out_folder, file_type_combo, frame) ) # (file_name, out_folder, track_select_combo, cascade_check, op_combo, audio_track_select_combo)) dialog.show_all()
def _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) if prefs.buttons_style == editorpersistance.GLASS_STYLE: buttons_combo.set_active(0) else: buttons_combo.set_active(1) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Light Theme")) dark_combo.append_text(_("Dark Theme")) if prefs.dark_theme == True: dark_combo.set_active(1) else: dark_combo.set_active(0) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) # Layout row0 = _row(guiutils.get_checkbox_row_box(force_english_check, Gtk.Label(label=_("Use English texts on localized OS")))) row1 = _row(guiutils.get_checkbox_row_box(display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Icons and color optimized for:")), dark_combo, PREFERENCES_LEFT)) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) return vbox, (force_english_check, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo)
def export_screenshot_dialog(callback, frame, parent_window, project_name): cancel_str = _("Cancel").encode('utf-8') ok_str = _("Export Image").encode('utf-8') dialog = gtk.Dialog(_("Export Frame Image"), parent_window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (cancel_str, gtk.RESPONSE_CANCEL, ok_str, gtk.RESPONSE_YES)) global _screenshot_img _screenshot_img = guiutils.get_gtk_image_from_file(get_displayed_image_path(), 300) frame_frame = guiutils.get_named_frame_with_vbox(None, [_screenshot_img]) INPUT_LABELS_WITDH = 320 project_name = project_name.strip(".flb") file_name = gtk.Entry() file_name.set_text(project_name) extension_label = gtk.Label(".png") extension_label.set_size_request(35, 20) name_pack = gtk.HBox(False, 4) name_pack.pack_start(file_name, True, True, 0) name_pack.pack_start(extension_label, False, False, 0) name_row = guiutils.get_two_column_box(gtk.Label(_("Export file name:")), name_pack, INPUT_LABELS_WITDH) out_folder = gtk.FileChooserButton(_("Select target folder")) out_folder.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) out_folder.set_current_folder(os.path.expanduser("~") + "/") folder_row = guiutils.get_two_column_box(gtk.Label(_("Export folder:")), out_folder, INPUT_LABELS_WITDH) file_type_combo = gtk.combo_box_new_text() for img in _img_types: file_type_combo.append_text(img) file_type_combo.set_active(0) file_type_combo.connect("changed", _file_type_changed, extension_label) file_type_row = guiutils.get_two_column_box(gtk.Label(_("Image type:")), file_type_combo, INPUT_LABELS_WITDH) file_frame = guiutils.get_named_frame_with_vbox(None, [file_type_row, name_row, folder_row]) vbox = gtk.VBox(False, 2) vbox.pack_start(frame_frame, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 12), False, False, 0) vbox.pack_start(file_frame, False, False, 0) alignment = gtk.Alignment(0.5, 0.5, 1.0, 1.0) alignment.set_padding(12, 12, 12, 12) alignment.add(vbox) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.default_behaviour(dialog) dialog.connect('response', callback, (file_name, out_folder, file_type_combo, frame)) #(file_name, out_folder, track_select_combo, cascade_check, op_combo, audio_track_select_combo)) dialog.show_all()
def get_single_line_text_input_dialog(chars, label_width,title, ok_button_text, label, default_text): dialog = Gtk.Dialog(title, None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT, ok_button_text, Gtk.ResponseType.OK)) entry = Gtk.Entry() entry.set_width_chars(30) entry.set_text(default_text) entry.set_activates_default(True) entry_row = guiutils.get_two_column_box(Gtk.Label(label=label), entry, 180) vbox = Gtk.VBox(False, 2) vbox.pack_start(entry_row, False, False, 0) vbox.pack_start(guiutils.get_pad_label(12, 12), False, False, 0) alignment = guiutils.set_margins(vbox, 6, 24, 24, 24) dialog.vbox.pack_start(alignment, True, True, 0) set_outer_margins(dialog.vbox) default_behaviour(dialog) dialog.set_default_response(Gtk.ResponseType.ACCEPT) return (dialog, entry)
def get_single_line_text_input_dialog(chars, label_width,title, ok_button_text, label, default_text): dialog = gtk.Dialog(title, None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), gtk.RESPONSE_REJECT, ok_button_text, gtk.RESPONSE_OK)) entry = gtk.Entry(30) entry.set_width_chars(30) entry.set_text(default_text) entry.set_activates_default(True) entry_row = guiutils.get_two_column_box(gtk.Label(label), entry, 180) vbox = gtk.VBox(False, 2) vbox.pack_start(entry_row, False, False, 0) vbox.pack_start(guiutils.get_pad_label(12, 12), False, False, 0) alignment = gtk.Alignment(0.5, 0.5, 1.0, 1.0) alignment.set_padding(6, 24, 24, 24) alignment.add(vbox) dialog.vbox.pack_start(alignment, True, True, 0) default_behaviour(dialog) dialog.set_default_response(gtk.RESPONSE_ACCEPT) return (dialog, entry)
def _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) if prefs.buttons_style == editorpersistance.GLASS_STYLE: buttons_combo.set_active(0) else: buttons_combo.set_active(1) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Light Theme")) dark_combo.append_text(_("Dark Theme")) if prefs.dark_theme == True: dark_combo.set_active(1) else: dark_combo.set_active(0) # Layout row0 = guiutils.get_checkbox_row_box(force_english_check, Gtk.Label(label=_("Use English texts on localized OS"))) row1 = guiutils.get_checkbox_row_box(display_splash_check, Gtk.Label(label=_("Display splash screen"))) row2 = guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT) row3 = guiutils.get_two_column_box( Gtk.Label(label=_("Icons and color optimized for:")), dark_combo, PREFERENCES_LEFT ) vbox = Gtk.VBox(False, 2) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) align = Gtk.Alignment.new(0.5, 0.5, 1.0, 1.0) align.set_padding(12, 0, 12, 12) align.add(vbox) return align, (force_english_check, display_splash_check, buttons_combo, dark_combo)
def __init__(self, render_type_changed_callback, preset_selection_changed_callback): self.type_label = Gtk.Label(label=_("Type:")) self.presets_label = Gtk.Label(label=_("Presets:")) self.type_combo = Gtk.ComboBoxText() # filled later when current sequence known self.type_combo.append_text(_("User Defined")) self.type_combo.append_text(_("Preset File type")) self.type_combo.set_active(0) self.type_combo.connect('changed', lambda w: render_type_changed_callback()) self.presets_selector = PresetEncodingsSelector(preset_selection_changed_callback) self.vbox = Gtk.VBox(False, 2) self.vbox.pack_start(guiutils.get_two_column_box(self.type_label, self.type_combo, 80), False, False, 0) self.vbox.pack_start(guiutils.get_two_column_box(self.presets_label, self.presets_selector.widget, 80), False, False, 0)
def show_render_properties_panel(render_item): if render_item.render_data.user_args == False: enc_opt = renderconsumer.encoding_options[render_item.render_data.enc_index] enc_desc = enc_opt.name audio_desc = enc_opt.audio_desc quality_opt = enc_opt.quality_options[render_item.render_data.quality_index] quality_desc = quality_opt.name else: enc_desc = " -" quality_desc = " -" audio_desc = " -" user_args = str(render_item.render_data.user_args) start_frame, end_frame, wait_for_stop_render = get_render_range(render_item) start_str = utils.get_tc_string_with_fps(start_frame, render_item.render_data.fps) end_str = utils.get_tc_string_with_fps(end_frame, render_item.render_data.fps) LEFT_WIDTH = 200 render_item.get_display_name() row0 = guiutils.get_two_column_box(guiutils.bold_label(_("Encoding:")), Gtk.Label(label=enc_desc), LEFT_WIDTH) row1 = guiutils.get_two_column_box(guiutils.bold_label(_("Quality:")), Gtk.Label(label=quality_desc), LEFT_WIDTH) row2 = guiutils.get_two_column_box(guiutils.bold_label(_("Audio Encoding:")), Gtk.Label(label=audio_desc), LEFT_WIDTH) row3 = guiutils.get_two_column_box(guiutils.bold_label(_("Use User Args:")), Gtk.Label(label=user_args), LEFT_WIDTH) row4 = guiutils.get_two_column_box(guiutils.bold_label(_("Start:")), Gtk.Label(label=start_str), LEFT_WIDTH) row5 = guiutils.get_two_column_box(guiutils.bold_label(_("End:")), Gtk.Label(label=end_str), LEFT_WIDTH) row6 = guiutils.get_two_column_box(guiutils.bold_label(_("Frames Per Second:")), Gtk.Label(label=str(render_item.render_data.fps)), LEFT_WIDTH) row7 = guiutils.get_two_column_box(guiutils.bold_label(_("Render Profile Name:")), Gtk.Label(label=str(render_item.render_data.profile_name)), LEFT_WIDTH) row8 = guiutils.get_two_column_box(guiutils.bold_label(_("Render Profile:")), Gtk.Label(label=render_item.render_data.profile_desc), LEFT_WIDTH) vbox = Gtk.VBox(False, 2) vbox.pack_start(Gtk.Label(label=render_item.get_display_name()), False, False, 0) vbox.pack_start(guiutils.get_pad_label(12, 16), False, False, 0) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row7, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) title = _("Render Properties") dialogutils.panel_ok_dialog(title, vbox)
def __init__(self): self.out_folder = Gtk.FileChooserButton(_("Select Folder")) self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) self.out_folder.set_current_folder(os.path.expanduser("~") + "/") gui.render_out_folder = self.out_folder out_folder_row = guiutils.get_two_column_box(Gtk.Label(label=_("Folder:")), self.out_folder, 60) self.movie_name = Gtk.Entry() self.movie_name.set_text("movie") self.extension_label = Gtk.Label() name_box = Gtk.HBox(False, 8) name_box.pack_start(self.movie_name, True, True, 0) name_box.pack_start(self.extension_label, False, False, 0) movie_name_row = guiutils.get_two_column_box(Gtk.Label(label=_("Name:")), name_box, 60) self.vbox = Gtk.VBox(False, 2) self.vbox.pack_start(out_folder_row, False, False, 0) self.vbox.pack_start(movie_name_row, False, False, 0) self.out_folder.set_tooltip_text(_("Select folder to place rendered file in")) self.movie_name.set_tooltip_text(_("Give name for rendered file"))
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_play_in_clip_monitor = gtk.CheckButton() auto_play_in_clip_monitor.set_active(prefs.auto_play_in_clip_monitor) auto_center_on_stop = gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) spin_adj = gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = gtk.SpinButton(spin_adj) gfx_length_spin.set_numeric(True) trim_exit_on_empty = gtk.CheckButton() trim_exit_on_empty.set_active(prefs.empty_click_exits_trims) quick_enter_trim = gtk.CheckButton() quick_enter_trim.set_active(prefs.quick_enter_trims) remember_clip_frame = gtk.CheckButton() remember_clip_frame.set_active(prefs.remember_monitor_clip_frame) # Layout row1 = guiutils.get_checkbox_row_box(auto_play_in_clip_monitor, gtk.Label(_("Autoplay new Clips in Clip Monitor"))) row2 = guiutils.get_checkbox_row_box(auto_center_on_stop, gtk.Label(_("Center Current Frame on Playback Stop"))) row4 = guiutils.get_two_column_box(gtk.Label(_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT) row5 = guiutils.get_checkbox_row_box(trim_exit_on_empty, gtk.Label(_("Trim Modes exit on empty click"))) row6 = guiutils.get_checkbox_row_box(quick_enter_trim, gtk.Label(_("Quick enter Trim Modes"))) row7 = guiutils.get_checkbox_row_box(remember_clip_frame, gtk.Label(_("Remember Monitor Clip Frame"))) vbox = gtk.VBox(False, 2) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row7, 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, (auto_play_in_clip_monitor, auto_center_on_stop, gfx_length_spin, trim_exit_on_empty, quick_enter_trim, remember_clip_frame)
def _performance_panel(): # Jan-2017 - SvdB # Add a panel for performance settings. The first setting is allowing multiple threads to render # the files. This is used for the real_time parameter to mlt in renderconsumer.py. # The effect depends on the computer running the program. # Max. number of threads is set to number of CPU cores. Default is 1. # Allow Frame Dropping should help getting real time output on low performance computers. prefs = editorpersistance.prefs warning_icon = Gtk.Image.new_from_stock(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.DIALOG) warning_label = Gtk.Label(label=_("Changing these values may cause problems with playback and rendering.\nThe safe values are Render Threads:1, Allow Frame Dropping: No.")) # Widgets spin_adj = Gtk.Adjustment(prefs.perf_render_threads, 1, multiprocessing.cpu_count(), 1) perf_render_threads = Gtk.SpinButton() perf_render_threads.set_adjustment(spin_adj) perf_render_threads.set_numeric(True) perf_drop_frames = Gtk.CheckButton() perf_drop_frames.set_active(prefs.perf_drop_frames) # Tooltips perf_render_threads.set_tooltip_text(_("Between 1 and the number of CPU Cores")) perf_drop_frames.set_tooltip_text(_("Allow Frame Dropping for real-time rendering, when needed")) # Layout row0 = _row(guiutils.get_left_justified_box([warning_icon, warning_label])) row1 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Render Threads:")), perf_render_threads, PREFERENCES_LEFT)) row2 = _row(guiutils.get_checkbox_row_box(perf_drop_frames, Gtk.Label(label=_("Allow Frame Dropping")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row0, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 12), False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) return vbox, (perf_render_threads, perf_drop_frames)
def _color_pulse_clip_dialog(callback): dialog = Gtk.Dialog( _("Create Color Pulse Clip"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode("utf-8"), Gtk.ResponseType.REJECT, _("Create").encode("utf-8"), Gtk.ResponseType.ACCEPT), ) s1_box, s1_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) s2_box, s2_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) s3_box, s3_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) s4_box, s4_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) m1_box, m1_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) m2_box, m2_slider = guiutils.get_non_property_slider_row(0, 100, 1, 100) row1 = guiutils.get_two_column_box(Gtk.Label(label=_("Speed 1:")), s1_box, 200) row2 = guiutils.get_two_column_box(Gtk.Label(label=_("Speed 2:")), s2_box, 200) row3 = guiutils.get_two_column_box(Gtk.Label(label=_("Speed 3:")), s3_box, 200) row4 = guiutils.get_two_column_box(Gtk.Label(label=_("Speed 4:")), s4_box, 200) row5 = guiutils.get_two_column_box(Gtk.Label(label=_("Move 1:")), m1_box, 200) row6 = guiutils.get_two_column_box(Gtk.Label(label=_("Move 2:")), m2_box, 200) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.set_size_request(450, 220) align = Gtk.Alignment.new(0.5, 0.5, 1.0, 1.0) align.set_padding(12, 0, 12, 12) align.add(vbox) selection_widgets = (s1_slider, s2_slider, s3_slider, s4_slider, m1_slider, m2_slider) dialog.connect("response", callback, selection_widgets) dialog.vbox.pack_start(align, True, True, 0) dialogutils.default_behaviour(dialog) dialog.show_all()
def _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) # Feb-2017 - SvdB - For full file names show_full_file_names = Gtk.CheckButton() show_full_file_names.set_active(prefs.show_full_file_names) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) buttons_combo.append_text(_("No Decorations")) buttons_combo.set_active( prefs.buttons_style ) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Flowblade Theme")) dark_combo.append_text(_("Dark Theme")) dark_combo.append_text(_("Light Theme")) dark_combo.set_active(prefs.theme) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) window_mode_combo = Gtk.ComboBoxText() window_mode_combo.append_text(_("Single Window")) window_mode_combo.append_text(_("Two Windows")) if prefs.global_layout == appconsts.SINGLE_WINDOW: window_mode_combo.set_active(0) else: window_mode_combo.set_active(1) tracks_combo = Gtk.ComboBoxText() tracks_combo.append_text(_("Normal - 50px, 25px")) tracks_combo.append_text(_("Double for HiDPI - 100px, 50px")) tracks_combo.set_active(prefs.double_track_hights) top_row_layout = Gtk.ComboBoxText() top_row_layout.append_text(_("3 panels if width awailable")) top_row_layout.append_text(_("2 panels always")) top_row_layout.set_active(prefs.top_row_layout) # Layout row00 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Application window mode:")), window_mode_combo, PREFERENCES_LEFT)) row0 = _row(guiutils.get_checkbox_row_box(force_english_check, Gtk.Label(label=_("Use English texts on localized OS")))) row1 = _row(guiutils.get_checkbox_row_box(display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Theme request, icons and colors:")), dark_combo, PREFERENCES_LEFT)) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) row7 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Tracks Heights:")), tracks_combo, PREFERENCES_LEFT)) # Feb-2017 - SvdB - For full file names row6 = _row(guiutils.get_checkbox_row_box(show_full_file_names, Gtk.Label(label=_("Show Full File names")))) row8 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Top row layout:")), top_row_layout, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row00, False, False, 0) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row7, False, False, 0) # Feb-2017 - SvdB - For full file names vbox.pack_start(row6, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Feb-2017 - SvdB - Added code for full file names return vbox, (force_english_check, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo, window_mode_combo, show_full_file_names, tracks_combo, top_row_layout)
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets spin_adj = Gtk.Adjustment(value=prefs.default_grfx_length, lower=1, upper=15000, step_incr=1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) active = 0 if prefs.mouse_scroll_action_is_zoom == False: active = 1 mouse_scroll_action = Gtk.ComboBoxText() mouse_scroll_action.append_text(_("Zoom, Control to Scroll Horizontal")) mouse_scroll_action.append_text(_("Scroll Horizontal, Control to Zoom")) mouse_scroll_action.set_active(active) active = 0 if prefs.scroll_horizontal_dir_up_forward == False: active = 1 hor_scroll_dir = Gtk.ComboBoxText() hor_scroll_dir.append_text(_("Scroll Up Forward")) hor_scroll_dir.append_text(_("Scroll Down Forward")) hor_scroll_dir.set_active(active) active = 0 if prefs.single_click_effects_editor_load == True: active = 1 effects_editor_clip_load = Gtk.ComboBoxText() effects_editor_clip_load.append_text(_("On Double Click")) effects_editor_clip_load.append_text(_("On Single Click")) effects_editor_clip_load.set_active(active) hide_file_ext_button = Gtk.CheckButton() if hasattr(prefs, 'hide_file_ext'): hide_file_ext_button.set_active(prefs.hide_file_ext) # Layout row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) row9 = _row( guiutils.get_checkbox_row_box( cover_delete, Gtk.Label( label=_("Cover Transition/Fade clips on delete if possible")))) # Jul-2016 - SvdB - For play_pause button row11 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Mouse Middle Button Scroll Action:")), mouse_scroll_action, PREFERENCES_LEFT)) row13 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Mouse Horizontal Scroll Direction:")), hor_scroll_dir, PREFERENCES_LEFT)) row12 = _row( guiutils.get_checkbox_row_box( hide_file_ext_button, Gtk.Label(label=_("Hide file extensions when importing Clips")))) row15 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Open Clip in Effects Editor")), effects_editor_clip_load, PREFERENCES_LEFT)) # Apr-2017 - SvdB - For Fast Forward / Reverse options vbox = Gtk.VBox(False, 2) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row11, False, False, 0) vbox.pack_start(row13, False, False, 0) vbox.pack_start(row12, False, False, 0) vbox.pack_start(row15, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (gfx_length_spin, cover_delete, mouse_scroll_action, hide_file_ext_button, hor_scroll_dir, effects_editor_clip_load)
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets spin_adj = Gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) """ overwrite_clip_drop = Gtk.ComboBoxText() active = 0 if prefs.overwrite_clip_drop == False: active = 1 overwrite_clip_drop.append_text(_("Overwrite blanks")) overwrite_clip_drop.append_text(_("Always insert")) overwrite_clip_drop.set_active(active) """ kf_edit_playhead_move = Gtk.CheckButton() kf_edit_playhead_move.set_active(prefs.kf_edit_init_affects_playhead) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) active = 0 if prefs.mouse_scroll_action_is_zoom == False: active = 1 mouse_scroll_action = Gtk.ComboBoxText() mouse_scroll_action.append_text(_("Zoom, Control to Scroll Horizontal")) mouse_scroll_action.append_text(_("Scroll Horizontal, Control to Zoom")) mouse_scroll_action.set_active(active) active = 0 if prefs.scroll_horizontal_dir_up_forward == False: active = 1 hor_scroll_dir = Gtk.ComboBoxText() hor_scroll_dir.append_text(_("Scroll Up Forward")) hor_scroll_dir.append_text(_("Scroll Down Forward")) hor_scroll_dir.set_active(active) hide_file_ext_button = Gtk.CheckButton() if hasattr(prefs, 'hide_file_ext'): hide_file_ext_button.set_active(prefs.hide_file_ext) # Layout row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) #row8 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media drag'n'drop action on non-V1 tracks:")), overwrite_clip_drop, PREFERENCES_LEFT)) row9 = _row(guiutils.get_checkbox_row_box(cover_delete, Gtk.Label(label=_("Cover Transition/Fade clips on delete if possible")))) # Jul-2016 - SvdB - For play_pause button row11 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Mouse Middle Button Scroll Action:")), mouse_scroll_action, PREFERENCES_LEFT)) row13 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Mouse Horizontal Scroll Direction:")), hor_scroll_dir, PREFERENCES_LEFT)) row14 = _row(guiutils.get_checkbox_row_box(kf_edit_playhead_move, Gtk.Label(label=_("Move Playhead to Clip start on keyframe edit init")))) row12 = _row(guiutils.get_checkbox_row_box(hide_file_ext_button, Gtk.Label(label=_("Hide file extensions when importing Clips")))) # Apr-2017 - SvdB - For Fast Forward / Reverse options vbox = Gtk.VBox(False, 2) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row9, False, False, 0) #vbox.pack_start(row8, False, False, 0) vbox.pack_start(row11, False, False, 0) vbox.pack_start(row13, False, False, 0) vbox.pack_start(row14, False, False, 0) vbox.pack_start(row12, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (gfx_length_spin, cover_delete, mouse_scroll_action, hide_file_ext_button, hor_scroll_dir, kf_edit_playhead_move)
def _playback_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_center_on_stop = Gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) # Jul-2016 - SvdB - For play_pause button play_pause_button = Gtk.CheckButton() # The following test is to make sure play_pause can be used for the initial value. If not found, then leave uninitialized if hasattr(prefs, 'play_pause'): play_pause_button.set_active(prefs.play_pause) auto_center_on_updown = Gtk.CheckButton() auto_center_on_updown.set_active(prefs.center_on_arrow_move) follow_move_range = Gtk.CheckButton() follow_move_range.set_active(prefs.playback_follow_move_tline_range) # Apr-2017 - SvdB - For FF/Rev speed options if hasattr(prefs, 'ffwd_rev_shift'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_shift, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_shift_spin = Gtk.SpinButton() ffwd_rev_shift_spin.set_adjustment(spin_adj) ffwd_rev_shift_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_ctrl'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_ctrl, 1, 10, 1) else: spin_adj = Gtk.Adjustment(10, 1, 10, 1) ffwd_rev_ctrl_spin = Gtk.SpinButton() ffwd_rev_ctrl_spin.set_adjustment(spin_adj) ffwd_rev_ctrl_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_caps'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_caps, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_caps_spin = Gtk.SpinButton() ffwd_rev_caps_spin.set_adjustment(spin_adj) ffwd_rev_caps_spin.set_numeric(True) # Layout #row1 = _row(guiutils.get_checkbox_row_box(auto_play_in_clip_monitor, Gtk.Label(label=_("Autoplay new Clips in Clip Monitor")))) row2 = _row(guiutils.get_checkbox_row_box(auto_center_on_stop, Gtk.Label(label=_("Center Current Frame on Playback Stop")))) row13 = _row(guiutils.get_checkbox_row_box(auto_center_on_updown, Gtk.Label(label=_("Center Current Frame after Up/Down Arrow")))) # Jul-2016 - SvdB - For play_pause button row10 = _row(guiutils.get_checkbox_row_box(play_pause_button, Gtk.Label(label=_("Enable single Play/Pause button")))) # Apr-2017 - SvdB - For Fast Forward / Reverse options row14 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Shift Key:")), ffwd_rev_shift_spin, PREFERENCES_LEFT)) row14.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Shift Key is held (Only using KEYS).\n" \ "Enabling multiple modifier keys will multiply the set values.\n" \ "E.g. if Shift is set to " + str(prefs.ffwd_rev_shift) + " and Ctrl to " + str(prefs.ffwd_rev_ctrl) + \ ", holding Shift + Ctrl will result in up to " + str(prefs.ffwd_rev_shift * prefs.ffwd_rev_ctrl) + "x speed.\n" \ "(Effective maximum speed depends on underlying software and/or hardware limitations)")) row15 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Control Key:")), ffwd_rev_ctrl_spin, PREFERENCES_LEFT)) row15.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Ctrl Key is held (Only using KEYS).")) row16 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Caps Lock Key:")), ffwd_rev_caps_spin, PREFERENCES_LEFT)) row16.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Caps Lock is set (Only using KEYS).")) row17 = _row(guiutils.get_checkbox_row_box(follow_move_range, Gtk.Label(label=_("Move Timeline to follow Playback")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row17, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row13, False, False, 0) # Jul-2016 - SvdB - For play_pause button vbox.pack_start(row10, False, False, 0) # Apr-2017 - SvdB - For ffwd / rev speed vbox.pack_start(row14, False, False, 0) vbox.pack_start(row15, False, False, 0) vbox.pack_start(row16, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (auto_center_on_stop, play_pause_button, auto_center_on_updown, ffwd_rev_shift_spin, ffwd_rev_ctrl_spin, ffwd_rev_caps_spin, follow_move_range)
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets spin_adj = Gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) overwrite_clip_drop = Gtk.ComboBoxText() active = 0 if prefs.overwrite_clip_drop == False: active = 1 overwrite_clip_drop.append_text(_("Overwrite blanks")) overwrite_clip_drop.append_text(_("Always insert")) overwrite_clip_drop.set_active(active) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) active = 0 if prefs.mouse_scroll_action_is_zoom == False: active = 1 mouse_scroll_action = Gtk.ComboBoxText() mouse_scroll_action.append_text(_("Zoom, Control to Scroll Horizontal")) mouse_scroll_action.append_text(_("Scroll Horizontal, Control to Zoom")) mouse_scroll_action.set_active(active) hide_file_ext_button = Gtk.CheckButton() if hasattr(prefs, 'hide_file_ext'): hide_file_ext_button.set_active(prefs.hide_file_ext) # Layout row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) row8 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Media drag'n'drop action on non-V1 tracks:")), overwrite_clip_drop, PREFERENCES_LEFT)) row9 = _row( guiutils.get_checkbox_row_box( cover_delete, Gtk.Label( label=_("Cover Transition/Fade clips on delete if possible")))) # Jul-2016 - SvdB - For play_pause button row11 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Mouse Middle Button Scroll Action:")), mouse_scroll_action, PREFERENCES_LEFT)) row12 = _row( guiutils.get_checkbox_row_box( hide_file_ext_button, Gtk.Label(label=_("Hide file extensions when importing Clips")))) # Apr-2017 - SvdB - For Fast Forward / Reverse options vbox = Gtk.VBox(False, 2) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(row11, False, False, 0) vbox.pack_start(row12, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (gfx_length_spin, overwrite_clip_drop, cover_delete, mouse_scroll_action, hide_file_ext_button)
def get_two_column_box(widget1, widget2, left_width=HALF_ROW_WIDTH): return guiutils.get_two_column_box(widget1, widget2, left_width)
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 _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) force_language_combo = Gtk.ComboBoxText() force_language_combo.append_text(_("None")) force_language_combo.append_text(_("English")) force_language_combo.append_text(_("Chinese, Simplified")) force_language_combo.append_text(_("Chinese, Traditional")) force_language_combo.append_text(_("Czech")) force_language_combo.append_text(_("French")) force_language_combo.append_text(_("German")) force_language_combo.append_text(_("Hungarian")) force_language_combo.append_text(_("Italian")) force_language_combo.append_text(_("Polish")) force_language_combo.append_text(_("Russian")) force_language_combo.append_text(_("Spanish")) force_language_combo.append_text(_("Ukranian")) # THIS NEEDS TO BE UPDATED WHEN LANGUAGES ARE ADDED!!! lang_list = [ "None", "English", "zh_CN", "zh_TW", "cs", "fr", "de", "hu", "it", "pl", "ru", "es", "uk" ] active_index = lang_list.index(prefs.force_language) force_language_combo.set_active(active_index) force_language_combo.lang_codes = lang_list display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) # Feb-2017 - SvdB - For full file names show_full_file_names = Gtk.CheckButton() show_full_file_names.set_active(prefs.show_full_file_names) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) buttons_combo.append_text(_("No Decorations")) buttons_combo.set_active(prefs.buttons_style) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Flowblade Theme")) dark_combo.append_text(_("Dark Theme")) dark_combo.append_text(_("Light Theme")) dark_combo.set_active(prefs.theme) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) window_mode_combo = Gtk.ComboBoxText() window_mode_combo.append_text(_("Single Window")) window_mode_combo.append_text(_("Two Windows")) if prefs.global_layout == appconsts.SINGLE_WINDOW: window_mode_combo.set_active(0) else: window_mode_combo.set_active(1) tracks_combo = Gtk.ComboBoxText() tracks_combo.append_text(_("Normal - 50px, 25px")) tracks_combo.append_text(_("Double for HiDPI - 100px, 50px")) tracks_combo.set_active(prefs.double_track_hights) top_row_layout = Gtk.ComboBoxText() top_row_layout.append_text(_("3 panels if width (1450px+) available")) top_row_layout.append_text(_("2 panels always")) top_row_layout.set_active(prefs.top_row_layout) # Layout row00 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Application window mode:")), window_mode_combo, PREFERENCES_LEFT)) #row0 = _row(guiutils.get_checkbox_row_box(force_english_check, Gtk.Label(label=_("Use English texts on localized OS")))) row9 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Force Language:")), force_language_combo, PREFERENCES_LEFT)) row1 = _row( guiutils.get_checkbox_row_box( display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Theme request, icons and colors:")), dark_combo, PREFERENCES_LEFT)) row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) row7 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Tracks Heights:")), tracks_combo, PREFERENCES_LEFT)) # Feb-2017 - SvdB - For full file names row6 = _row( guiutils.get_checkbox_row_box( show_full_file_names, Gtk.Label(label=_("Show Full File names")))) row8 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Top row layout:")), top_row_layout, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row00, False, False, 0) #vbox.pack_start(row0, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row7, False, False, 0) # Feb-2017 - SvdB - For full file names vbox.pack_start(row6, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Feb-2017 - SvdB - Added code for full file names return vbox, (force_language_combo, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo, window_mode_combo, show_full_file_names, tracks_combo, top_row_layout)
def __init__(self): GObject.GObject.__init__(self) self.set_modal(True) self.set_transient_for(gui.editor_window.window) self.set_title(_("Add Media From Folder")) self.connect("delete-event", lambda w, e: _close_window()) file_chooser = Gtk.FileChooserButton(_("Select Folder")) file_chooser.set_size_request(250, 25) if ((editorpersistance.prefs.open_in_last_opended_media_dir == True) and (editorpersistance.prefs.last_opened_media_dir != None)): file_chooser.set_current_folder( editorpersistance.prefs.last_opened_media_dir) else: file_chooser.set_current_folder(os.path.expanduser("~") + "/") file_chooser.set_action(Gtk.FileChooserAction.SELECT_FOLDER) self.file_chooser = file_chooser row1 = guiutils.get_two_column_box( Gtk.Label(label=_("Add Media from Folder:")), file_chooser, 220) recursively_checkbox = Gtk.CheckButton() recursively_checkbox.set_active(False) recursively_label = Gtk.Label(label=_("Search subfolders")) self.recursively_checkbox = recursively_checkbox row3 = guiutils.get_checkbox_row_box(recursively_checkbox, recursively_label) action_select = Gtk.ComboBoxText() action_select.append_text(_("All Media Files")) action_select.append_text(_("Video Files")) action_select.append_text(_("Audio Files")) action_select.append_text(_("Image Files")) action_select.set_active(0) self.action_select = action_select action_label = Gtk.Label(label=_("File types to add:")) row4 = guiutils.get_two_column_box(action_label, action_select, 220) use_extension_checkbox = Gtk.CheckButton() use_extension_checkbox.set_active(False) self.use_extension_checkbox = use_extension_checkbox use_extension_label = Gtk.Label(label=_("Filter by file extension")) row5 = guiutils.get_checkbox_row_box(use_extension_checkbox, use_extension_label) extension_entry = Gtk.Entry.new() extension_entry.set_max_width_chars(6) extension_entry_box = Gtk.HBox(False, 0) extension_entry_box.pack_start(extension_entry, False, False, 0) extension_entry_box.pack_start(guiutils.pad_label(200, 10), True, True, 0) self.extension_entry = extension_entry extension_label = Gtk.Label(label=_("File extension:")) extension_entry.set_sensitive(False) extension_label.set_sensitive(False) row6 = guiutils.get_two_column_box(extension_label, extension_entry_box, 100) self.files_view = Gtk.TextView() self.files_view.set_sensitive(False) self.files_view.set_pixels_above_lines(2) self.files_view.set_left_margin(2) self.files_view.set_sensitive(False) self.files_view.set_editable(False) text_buffer = Gtk.TextBuffer() text_buffer.set_text(_("No files loaded.")) self.files_view.set_buffer(text_buffer) self.files_view.set_sensitive(False) sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) sw.add(self.files_view) sw.set_size_request(500, 200) # 500 here sets window width. scroll_frame = Gtk.Frame() scroll_frame.add(sw) load_button = Gtk.Button(_("Load Add Files Set")) load_button.connect("clicked", lambda w: _load_add_files_clicked()) self.load_info = Gtk.Label(_("Files to load: ") + _("Not Set")) row9 = Gtk.HBox(False, 0) row9.pack_start(self.load_info, False, False, 0) row9.pack_start(Gtk.Label(), True, True, 0) row9.pack_start(load_button, False, False, 0) guiutils.set_margins(row9, 4, 24, 0, 0) close_button = Gtk.Button(_("Close")) close_button.connect("clicked", lambda w: _close_clicked()) self.add_button = Gtk.Button(_("Add Media")) self.add_button.connect("clicked", lambda w: _do_folder_media_import()) self.add_button.set_sensitive(False) self.load_info_2 = Gtk.Label() row8 = Gtk.HBox(False, 0) row8.pack_start(self.load_info_2, False, False, 0) row8.pack_start(Gtk.Label(), True, True, 0) row8.pack_start(close_button, False, False, 0) row8.pack_start(self.add_button, False, False, 0) maximum_select = Gtk.ComboBoxText() maximum_select.append_text(_("29")) maximum_select.append_text(_("49")) maximum_select.append_text(_("99")) maximum_select.append_text(_("199")) maximum_select.set_active(0) self.maximum_select = maximum_select maximum_label = Gtk.Label(label=_("Max. number of files to import:")) row7 = guiutils.get_two_column_box(maximum_label, maximum_select, 220) guiutils.set_margins(row7, 0, 12, 0, 0) activateble_widgets = (action_label, action_select, extension_label, extension_entry) use_extension_checkbox.connect("toggled", _use_extension_toggled, activateble_widgets) vbox = Gtk.VBox(False, 2) vbox.pack_start(row1, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 24), False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 8), False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row7, False, False, 0) vbox.pack_start(scroll_frame, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row8, False, False, 0) alignment = guiutils.set_margins(vbox, 8, 8, 12, 12) self.add(alignment) self.set_position(Gtk.WindowPosition.CENTER) self.show_all()
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 show_reverse_dialog(media_file, default_range_render, _response_callback): folder, file_name = os.path.split(media_file.path) if media_file.is_proxy_file: folder, file_name = os.path.split(media_file.second_file_path) name, ext = os.path.splitext(file_name) dialog = Gtk.Dialog(_("Render Reverse Motion Video File"), gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, _("Render"), Gtk.ResponseType.ACCEPT)) media_file_label = Gtk.Label(label=_("Source Media File: ")) media_name = Gtk.Label(label="<b>" + media_file.name + "</b>") media_name.set_use_markup(True) SOURCE_PAD = 8 SOURCE_HEIGHT = 20 mf_row = guiutils.get_left_justified_box([media_file_label, guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), media_name]) mark_in = Gtk.Label(label=_("<b>not set</b>")) mark_out = Gtk.Label(label=_("<b>not set</b>")) if media_file.mark_in != -1: mark_in = Gtk.Label(label="<b>" + utils.get_tc_string(media_file.mark_in) + "</b>") if media_file.mark_out != -1: mark_out = Gtk.Label(label="<b>" + utils.get_tc_string(media_file.mark_out) + "</b>") mark_in.set_use_markup(True) mark_out.set_use_markup(True) fb_widgets = utils.EmptyClass() fb_widgets.file_name = Gtk.Entry() fb_widgets.file_name.set_text(name + "_REVERSE") fb_widgets.extension_label = Gtk.Label() fb_widgets.extension_label.set_size_request(45, 20) name_row = Gtk.HBox(False, 4) name_row.pack_start(fb_widgets.file_name, True, True, 0) name_row.pack_start(fb_widgets.extension_label, False, False, 4) fb_widgets.out_folder = Gtk.FileChooserButton(_("Select Target Folder")) fb_widgets.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) fb_widgets.out_folder.set_current_folder(folder) label = Gtk.Label(label=_("Speed %:")) adjustment = Gtk.Adjustment(float(-100), float(-600), float(-1), float(1)) fb_widgets.hslider = Gtk.HScale() fb_widgets.hslider.set_adjustment(adjustment) fb_widgets.hslider.set_draw_value(False) spin = Gtk.SpinButton() spin.set_numeric(True) spin.set_adjustment(adjustment) fb_widgets.hslider.set_digits(0) spin.set_digits(0) slider_hbox = Gtk.HBox(False, 4) slider_hbox.pack_start(fb_widgets.hslider, True, True, 0) slider_hbox.pack_start(spin, False, False, 4) slider_hbox.set_size_request(450,35) hbox = Gtk.HBox(False, 2) hbox.pack_start(guiutils.pad_label(8, 8), False, False, 0) hbox.pack_start(slider_hbox, False, False, 0) profile_selector = ProfileSelector() profile_selector.fill_options() profile_selector.widget.set_sensitive(True) fb_widgets.out_profile_combo = profile_selector.widget quality_selector = RenderQualitySelector() fb_widgets.quality_cb = quality_selector.widget # Encoding encoding_selector = RenderEncodingSelector(quality_selector, fb_widgets.extension_label, None) encoding_selector.encoding_selection_changed() fb_widgets.encodings_cb = encoding_selector.widget objects_list = Gtk.TreeStore(str, bool) objects_list.append(None, [_("Full Source Length"), True]) if media_file.mark_in != -1 and media_file.mark_out != -1: range_available = True else: range_available = False objects_list.append(None, [_("Source Mark In to Mark Out"), range_available]) fb_widgets.render_range = Gtk.ComboBox.new_with_model(objects_list) renderer_text = Gtk.CellRendererText() fb_widgets.render_range.pack_start(renderer_text, True) fb_widgets.render_range.add_attribute(renderer_text, "text", 0) fb_widgets.render_range.add_attribute(renderer_text, 'sensitive', 1) if default_range_render == False: fb_widgets.render_range.set_active(0) else: fb_widgets.render_range.set_active(1) fb_widgets.render_range.show() # To update rendered length display clip_length = _get_rendered_slomo_clip_length(media_file, fb_widgets.render_range, 100) clip_length_label = Gtk.Label(label=utils.get_tc_string(clip_length)) fb_widgets.hslider.connect("value-changed", _reverse_speed_changed, media_file, fb_widgets.render_range, clip_length_label) fb_widgets.render_range.connect("changed", _reverse_range_changed, media_file, fb_widgets.hslider, clip_length_label) # Build gui vbox = Gtk.VBox(False, 2) vbox.pack_start(mf_row, False, False, 0) vbox.pack_start(guiutils.get_left_justified_box([Gtk.Label(label=_("Source Mark In: ")), guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), mark_in]), False, False, 0) vbox.pack_start(guiutils.get_left_justified_box([Gtk.Label(label=_("Source Mark Out: ")), guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), mark_out]), False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(label, False, False, 0) vbox.pack_start(hbox, False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target File:")), name_row, 120), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Folder:")), fb_widgets.out_folder, 120), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Profile:")), fb_widgets.out_profile_combo, 200), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Encoding:")), fb_widgets.encodings_cb, 200), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Quality:")), fb_widgets.quality_cb, 200), False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Render Range:")), fb_widgets.render_range, 180), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Rendered Clip Length:")), clip_length_label, 180), False, False, 0) alignment = guiutils.set_margins(vbox, 6, 24, 24, 24) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.connect('response', _response_callback, fb_widgets, media_file) dialog.show_all()
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 _playback_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_center_on_stop = Gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) # Jul-2016 - SvdB - For play_pause button play_pause_button = Gtk.CheckButton() # The following test is to make sure play_pause can be used for the initial value. If not found, then leave uninitialized if hasattr(prefs, 'play_pause'): play_pause_button.set_active(prefs.play_pause) auto_center_on_updown = Gtk.CheckButton() auto_center_on_updown.set_active(prefs.center_on_arrow_move) follow_move_range = Gtk.CheckButton() follow_move_range.set_active(prefs.playback_follow_move_tline_range) # Apr-2017 - SvdB - For FF/Rev speed options if hasattr(prefs, 'ffwd_rev_shift'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_shift, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_shift_spin = Gtk.SpinButton() ffwd_rev_shift_spin.set_adjustment(spin_adj) ffwd_rev_shift_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_ctrl'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_ctrl, 1, 10, 1) else: spin_adj = Gtk.Adjustment(10, 1, 10, 1) ffwd_rev_ctrl_spin = Gtk.SpinButton() ffwd_rev_ctrl_spin.set_adjustment(spin_adj) ffwd_rev_ctrl_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_caps'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_caps, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_caps_spin = Gtk.SpinButton() ffwd_rev_caps_spin.set_adjustment(spin_adj) ffwd_rev_caps_spin.set_numeric(True) # Layout #row1 = _row(guiutils.get_checkbox_row_box(auto_play_in_clip_monitor, Gtk.Label(label=_("Autoplay new Clips in Clip Monitor")))) row2 = _row( guiutils.get_checkbox_row_box( auto_center_on_stop, Gtk.Label(label=_("Center Current Frame on Playback Stop")))) row13 = _row( guiutils.get_checkbox_row_box( auto_center_on_updown, Gtk.Label(label=_("Center Current Frame after Up/Down Arrow")))) # Jul-2016 - SvdB - For play_pause button row10 = _row( guiutils.get_checkbox_row_box( play_pause_button, Gtk.Label(label=_("Enable single Play/Pause button")))) # Apr-2017 - SvdB - For Fast Forward / Reverse options row14 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Fast Forward / Reverse Speed for Shift Key:")), ffwd_rev_shift_spin, PREFERENCES_LEFT)) row14.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Shift Key is held (Only using KEYS).\n" \ "Enabling multiple modifier keys will multiply the set values.\n" \ "E.g. if Shift is set to " + str(prefs.ffwd_rev_shift) + " and Ctrl to " + str(prefs.ffwd_rev_ctrl) + \ ", holding Shift + Ctrl will result in up to " + str(prefs.ffwd_rev_shift * prefs.ffwd_rev_ctrl) + "x speed.\n" \ "(Effective maximum speed depends on underlying software and/or hardware limitations)")) row15 = _row( guiutils.get_two_column_box( Gtk.Label( label=_("Fast Forward / Reverse Speed for Control Key:")), ffwd_rev_ctrl_spin, PREFERENCES_LEFT)) row15.set_tooltip_text( _("Speed of Forward / Reverse will be multiplied by this value if Ctrl Key is held (Only using KEYS)." )) row16 = _row( guiutils.get_two_column_box( Gtk.Label( label=_("Fast Forward / Reverse Speed for Caps Lock Key:")), ffwd_rev_caps_spin, PREFERENCES_LEFT)) row16.set_tooltip_text( _("Speed of Forward / Reverse will be multiplied by this value if Caps Lock is set (Only using KEYS)." )) row17 = _row( guiutils.get_checkbox_row_box( follow_move_range, Gtk.Label(label=_("Move Timeline to follow Playback")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row17, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row13, False, False, 0) # Jul-2016 - SvdB - For play_pause button vbox.pack_start(row10, False, False, 0) # Apr-2017 - SvdB - For ffwd / rev speed vbox.pack_start(row14, False, False, 0) vbox.pack_start(row15, False, False, 0) vbox.pack_start(row16, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (auto_center_on_stop, play_pause_button, auto_center_on_updown, ffwd_rev_shift_spin, ffwd_rev_ctrl_spin, ffwd_rev_caps_spin, follow_move_range)
def __init__(self): GObject.GObject.__init__(self) self.set_modal(True) self.set_transient_for(gui.editor_window.window) self.set_title(_("Add Media Plugin")) self.connect("delete-event", lambda w, e:_close_window()) # categories_list is list of form [("category_name", [category_items]), ...] # with category_items list of form ["item_name", ...] self.plugin_select = guicomponents.CategoriesModelComboBoxWithData(_get_categories_list()) self.plugin_select.set_changed_callback(self._plugin_selection_changed) plugin_label = Gtk.Label(label=_("Media Plugin:")) plugin_select_row = guiutils.get_two_column_box(plugin_label, self.plugin_select.widget, 220) global MONITOR_HEIGHT MONITOR_HEIGHT = int(MONITOR_WIDTH * float(current_sequence().profile.display_aspect_den()) / float(current_sequence().profile.display_aspect_num())) self.screenshot_canvas = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_screenshot) screenshot_row = guiutils.get_centered_box([self.screenshot_canvas ]) guiutils.set_margins(screenshot_row, 12, 12, 0, 0) self.frame_display = Gtk.Label(_("Clip Frame")) self.frame_display.set_margin_right(2) self.frame_select = Gtk.SpinButton.new_with_range (0, 200, 1) self.frame_select.set_value(0) self.preview_button = Gtk.Button(_("Preview")) self.preview_button.connect("clicked", lambda w: self._show_preview()) control_panel = Gtk.HBox(False, 2) control_panel.pack_start(self.frame_display, False, False, 0) control_panel.pack_start(self.frame_select, False, False, 0) control_panel.pack_start(Gtk.Label(), True, True, 0) control_panel.pack_start(self.preview_button, False, False, 0) guiutils.set_margins(control_panel, 0, 24, 0, 0) self.editors_box = Gtk.HBox(False, 0) self.editors_box.set_size_request(270, 185) self.import_select = Gtk.ComboBoxText() self.import_select.append_text(_("Add as Container Clip")) self.import_select.append_text(_("Add as Rendered Media")) self.import_select.set_active(0) self.import_select.connect("changed", lambda w: self._export_action_changed(w)) import_row = guiutils.get_left_justified_box([Gtk.Label(_("Import Action:")), guiutils.pad_label(12,12), self.import_select]) guiutils.set_margins(import_row,8,0,0,0) self.length_spin = Gtk.SpinButton.new_with_range (25, 100000, 1) self.length_spin.set_value(200) length_row = guiutils.get_left_justified_box([Gtk.Label(_("Plugin Media Length:")), guiutils.pad_label(12,12), self.length_spin]) self.encoding_button = Gtk.Button(_("Encode settings")) self.encoding_button.set_sensitive(False) self.encoding_button.connect("clicked", lambda w: self._set_encoding_button_pressed()) self.encoding_info = Gtk.Label() self.encoding_info.set_markup("<small>" + "Not set" + "</small>") self.encoding_info.set_max_width_chars(32) self.encoding_info.set_sensitive(False) encoding_row = guiutils.get_left_justified_box([self.encoding_button, guiutils.pad_label(12,12), self.encoding_info]) import_panel = Gtk.VBox(False, 2) import_panel.pack_start(length_row, False, False, 0) import_panel.pack_start(import_row, False, False, 0) import_panel.pack_start(encoding_row, False, False, 0) import_panel.pack_start(Gtk.Label(), True, True, 0) values_row = Gtk.HBox(True, 8) values_row.pack_start(self.editors_box, False, False, 0) values_row.pack_start(import_panel, False, False, 0) #values_row. close_button = guiutils.get_sized_button(_("Close"), 150, 32) close_button.connect("clicked", lambda w: _close_clicked()) self.add_button = guiutils.get_sized_button(_("Add Media Plugin"), 150, 32) self.add_button.connect("clicked", lambda w: _add_media_plugin()) #self.load_info_2 = Gtk.Label() buttons_row = Gtk.HBox(False, 0) #buttons_row.pack_start(self.load_info_2, False, False, 0) buttons_row.pack_start(Gtk.Label(), True, True, 0) buttons_row.pack_start(close_button, False, False, 0) buttons_row.pack_start(self.add_button, False, False, 0) guiutils.set_margins(buttons_row, 24, 0, 0, 0) vbox = Gtk.VBox(False, 2) vbox.pack_start(plugin_select_row, False, False, 0) vbox.pack_start(screenshot_row, False, False, 0) vbox.pack_start(control_panel, False, False, 0) vbox.pack_start(values_row, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) vbox.pack_start(buttons_row, False, False, 0) alignment = guiutils.set_margins(vbox, 8, 8, 12, 12) self.add(alignment) self.set_position(Gtk.WindowPosition.CENTER) self.show_all() self.plugin_select.set_selected(_plugins[0].name) self._display_current_render_data()
def _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) force_language_combo = Gtk.ComboBoxText() force_language_combo.append_text(_("None")) force_language_combo.append_text(_("English")) force_language_combo.append_text(_("Chinese, Simplified")) force_language_combo.append_text(_("Chinese, Traditional")) force_language_combo.append_text(_("Czech")) force_language_combo.append_text(_("French")) force_language_combo.append_text(_("German")) force_language_combo.append_text(_("Hungarian")) force_language_combo.append_text(_("Italian")) force_language_combo.append_text(_("Polish")) force_language_combo.append_text(_("Russian")) force_language_combo.append_text(_("Spanish")) force_language_combo.append_text(_("Ukranian")) # THIS NEEDS TO BE UPDATED WHEN LANGUAGES ARE ADDED!!! lang_list = [ "None", "English", "zh_CN", "zh_TW", "cs", "fr", "de", "hu", "it", "pl", "ru", "es", "uk" ] active_index = lang_list.index(prefs.force_language) force_language_combo.set_active(active_index) force_language_combo.lang_codes = lang_list display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) # Feb-2017 - SvdB - For full file names show_full_file_names = Gtk.CheckButton() show_full_file_names.set_active(prefs.show_full_file_names) # --------------------------------- Colorized icons colorized_icons = Gtk.CheckButton() colorized_icons.set_active(prefs.colorized_icons) # ------------------------------------ End of Colorized icons buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) buttons_combo.append_text(_("No Decorations")) buttons_combo.set_active(prefs.buttons_style) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Flowblade Theme Neutral")) dark_combo.append_text(_("Flowblade Theme Gray")) dark_combo.append_text(_("Flowblade Theme Blue")) dark_combo.append_text(_("Dark Theme")) dark_combo.append_text(_("Light Theme")) # The displayed options indeces do not correspond with theme const values. if prefs.theme == appconsts.FLOWBLADE_THEME_GRAY: index = 1 elif prefs.theme == appconsts.FLOWBLADE_THEME_NEUTRAL: index = 0 else: index = int(prefs.theme) + 2 dark_combo.set_active(index) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) window_mode_combo = Gtk.ComboBoxText() window_mode_combo.append_text(_("Single Window")) window_mode_combo.append_text(_("Two Windows")) if prefs.global_layout == appconsts.SINGLE_WINDOW: window_mode_combo.set_active(0) else: window_mode_combo.set_active(1) tracks_combo = Gtk.ComboBoxText() tracks_combo.append_text(_("Normal - 50px, 25px")) tracks_combo.append_text(_("Double for HiDPI - 100px, 50px")) # Aug-2019 - SvdB - BB tracks_combo.set_active(prefs.double_track_hights) top_row_layout = Gtk.ComboBoxText() top_row_layout.append_text(_("3 panels if width (1450px+) available")) top_row_layout.append_text(_("2 panels always")) top_row_layout.set_active(prefs.top_row_layout) monitors_data = utils.get_display_monitors_size_data() layout_monitor = Gtk.ComboBoxText() combined_w, combined_h = monitors_data[0] layout_monitor.append_text( _("Full Display area: ") + str(combined_w) + " x " + str(combined_h)) if len(monitors_data) >= 3: for monitor_index in range(1, len(monitors_data)): monitor_w, monitor_h = monitors_data[monitor_index] layout_monitor.append_text( _("Monitor ") + str(monitor_index) + ": " + str(monitor_w) + " x " + str(monitor_h)) layout_monitor.set_active(prefs.layout_display_index) # Layout row00 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Application window mode:")), window_mode_combo, PREFERENCES_LEFT)) row9 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Force Language:")), force_language_combo, PREFERENCES_LEFT)) row1 = _row( guiutils.get_checkbox_row_box( display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Theme request, icons and colors:")), dark_combo, PREFERENCES_LEFT)) row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) row7 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Tracks Heights:")), tracks_combo, PREFERENCES_LEFT)) # Feb-2017 - SvdB - For full file names row6 = _row( guiutils.get_checkbox_row_box( show_full_file_names, Gtk.Label(label=_("Show Full File names")))) row8 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Top row layout:")), top_row_layout, PREFERENCES_LEFT)) row10 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Do GUI layout based on:")), layout_monitor, PREFERENCES_LEFT)) row11 = _row( guiutils.get_checkbox_row_box( colorized_icons, Gtk.Label(label=_("Toolbar color icons")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row00, False, False, 0) vbox.pack_start(row10, False, False, 0) vbox.pack_start(row9, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row7, False, False, 0) # Feb-2017 - SvdB - For full file names vbox.pack_start(row6, 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) return vbox, (force_language_combo, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo, window_mode_combo, show_full_file_names, tracks_combo, top_row_layout, layout_monitor, colorized_icons)
def __init__(self): GObject.GObject.__init__(self) self.connect("delete-event", lambda w, e:_shutdown()) app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladetoolicon.png") self.set_icon(app_icon) hamburger_launcher_surface = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "hamburger.png") self.hamburger_launcher = guicomponents.PressLaunch(self.hamburger_launch_pressed, hamburger_launcher_surface) # Load media row self.load_button = Gtk.Button(_("Load Clip")) self.load_button.connect("clicked", lambda w: open_clip_dialog()) self.media_info = Gtk.Label() self.media_info.set_markup("<small>" + _("no clip loaded") + "</small>") load_row = Gtk.HBox(False, 2) load_row.pack_start(self.hamburger_launcher.widget, False, False, 0) load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0) load_row.pack_start(self.load_button, False, False, 0) load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0) load_row.pack_start(self.media_info, False, False, 0) load_row.pack_start(Gtk.Label(), True, True, 0) load_row.set_margin_bottom(4) # Clip monitor black_box = Gtk.EventBox() black_box.add(Gtk.Label()) bg_color = Gdk.Color(red=0.0, green=0.0, blue=0.0) black_box.modify_bg(Gtk.StateType.NORMAL, bg_color) self.monitor = black_box # This could be any GTK+ widget (that is not "windowless"), only its XWindow draw rect # is used to position and scale SDL overlay that actually displays video. self.monitor.set_size_request(MONITOR_WIDTH, MONITOR_HEIGHT) left_vbox = Gtk.VBox(False, 0) left_vbox.pack_start(load_row, False, False, 0) left_vbox.pack_start(self.monitor, True, True, 0) self.preview_info = Gtk.Label() self.preview_info.set_markup("<small>" + _("no preview") + "</small>" ) preview_info_row = Gtk.HBox() preview_info_row.pack_start(self.preview_info, False, False, 0) preview_info_row.pack_start(Gtk.Label(), True, True, 0) preview_info_row.set_margin_top(6) preview_info_row.set_margin_bottom(8) self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview) self.no_preview_icon = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + NO_PREVIEW_FILE) right_vbox = Gtk.VBox(False, 2) right_vbox.pack_start(preview_info_row, False, False, 0) right_vbox.pack_start(self.preview_monitor, True, True, 0) # Monitors panel monitors_panel = Gtk.HBox(False, 2) monitors_panel.pack_start(left_vbox, False, False, 0) monitors_panel.pack_start(Gtk.Label(), True, True, 0) monitors_panel.pack_start(right_vbox, False, False, 0) # Control row self.tc_display = guicomponents.MonitorTCDisplay() self.tc_display.use_internal_frame = True self.tc_display.widget.set_valign(Gtk.Align.CENTER) self.tc_display.use_internal_fps = True self.pos_bar = positionbar.PositionBar(False) self.pos_bar.set_listener(self.position_listener) pos_bar_frame = Gtk.Frame() pos_bar_frame.add(self.pos_bar.widget) pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN) pos_bar_frame.set_margin_top(5) pos_bar_frame.set_margin_bottom(4) pos_bar_frame.set_margin_left(6) pos_bar_frame.set_margin_right(2) self.control_buttons = glassbuttons.GmicButtons() pressed_callback_funcs = [prev_pressed, next_pressed, mark_in_pressed, mark_out_pressed, marks_clear_pressed, to_mark_in_pressed, to_mark_out_pressed] self.control_buttons.set_callbacks(pressed_callback_funcs) self.preview_button = Gtk.Button(_("Preview")) self.preview_button.connect("clicked", lambda w: render_preview_frame()) control_panel = Gtk.HBox(False, 2) control_panel.pack_start(self.tc_display.widget, False, False, 0) control_panel.pack_start(pos_bar_frame, True, True, 0) control_panel.pack_start(self.control_buttons.widget, False, False, 0) control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0) control_panel.pack_start(self.preview_button, False, False, 0) preview_panel = Gtk.VBox(False, 2) preview_panel.pack_start(monitors_panel, False, False, 0) preview_panel.pack_start(control_panel, False, False, 0) preview_panel.set_margin_bottom(8) # Script area self.preset_label = Gtk.Label() self.present_event_box = Gtk.EventBox() self.present_event_box.add(self.preset_label) self.present_event_box.connect("button-press-event", script_menu_lauched) self.script_menu = toolguicomponents.PressLaunch(script_menu_lauched) self.action_select = Gtk.CheckButton() self.action_select.set_active(False) self.action_label = Gtk.Label(_("Add to Script")) preset_row = Gtk.HBox(False, 2) preset_row.pack_start(self.present_event_box, False, False, 0) preset_row.pack_start(self.script_menu.widget, False, False, 0) preset_row.pack_start(guiutils.pad_label(2, 30), False, False, 0) preset_row.pack_start(Gtk.Label(), True, True, 0) preset_row.pack_start(self.action_select, False, False, 0) preset_row.pack_start(self.action_label, False, False, 0) self.script_view = Gtk.TextView() self.script_view.set_sensitive(False) self.script_view.set_pixels_above_lines(2) self.script_view.set_left_margin(2) self.script_view.set_wrap_mode(Gtk.WrapMode.CHAR) script_sw = Gtk.ScrolledWindow() script_sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) script_sw.add(self.script_view) script_sw.set_size_request(MONITOR_WIDTH - 100, 125) self.out_view = Gtk.TextView() self.out_view.set_sensitive(False) self.out_view.set_pixels_above_lines(2) self.out_view.set_left_margin(2) self.out_view.set_wrap_mode(Gtk.WrapMode.WORD) fd = Pango.FontDescription.from_string("Sans 8") self.out_view.override_font(fd) out_sw = Gtk.ScrolledWindow() out_sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) out_sw.add(self.out_view) out_sw.set_size_request(MONITOR_WIDTH - 150, 100) script_vbox = Gtk.VBox(False, 2) script_vbox.pack_start(preset_row, False, False, 0) script_vbox.pack_start(script_sw, True, True, 0) script_vbox.pack_start(out_sw, True, True, 0) # Render panel self.mark_in_label = guiutils.bold_label(_("Mark In:")) self.mark_out_label = guiutils.bold_label(_("Mark Out:")) self.length_label = guiutils.bold_label(_("Length:")) self.mark_in_info = Gtk.Label("-") self.mark_out_info = Gtk.Label("-") self.length_info = Gtk.Label("-") in_row = guiutils.get_two_column_box(self.mark_in_label, self.mark_in_info, 150) out_row = guiutils.get_two_column_box(self.mark_out_label, self.mark_out_info, 150) length_row = guiutils.get_two_column_box(self.length_label, self.length_info, 150) marks_row = Gtk.VBox(False, 2) marks_row.pack_start(in_row, True, True, 0) marks_row.pack_start(out_row, True, True, 0) marks_row.pack_start(length_row, True, True, 0) self.out_folder = Gtk.FileChooserButton(_("Select Folder")) self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) self.out_folder.connect("selection-changed", self.folder_selection_changed) self.out_label = Gtk.Label(label=_("Frames Folder:")) self.frame_name = Gtk.Entry() self.frame_name.set_text("frame") self.extension_label = Gtk.Label() self.extension_label.set_markup("<small>XXXX.png</small>") out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \ self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \ guiutils.pad_label(2, 2), self.extension_label]) self.encode_check_label = Gtk.Label(_("Encode Video")) self.encode_check = Gtk.CheckButton() self.encode_check.set_active(False) self.encode_check.connect("toggled", lambda w:self.update_encode_sensitive()) self.encode_settings_button = Gtk.Button(_("Encoding settings")) self.encode_settings_button.connect("clicked", lambda w:_encode_settings_clicked()) self.encode_desc = Gtk.Label() self.encode_desc.set_markup("<small>" + _("not set") + "</small>") self.encode_desc.set_ellipsize(Pango.EllipsizeMode.END) self.encode_desc.set_max_width_chars(32) encode_row = Gtk.HBox(False, 2) encode_row.pack_start(self.encode_check, False, False, 0) encode_row.pack_start(self.encode_check_label, False, False, 0) encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0) encode_row.pack_start(self.encode_settings_button, False, False, 0) encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0) encode_row.pack_start(self.encode_desc, False, False, 0) encode_row.pack_start(Gtk.Label(), True, True, 0) encode_row.set_margin_bottom(6) self.render_percentage = Gtk.Label("") self.status_no_render = _("Set Mark In, Mark Out and Frames Folder for valid render") self.render_status_info = Gtk.Label() self.render_status_info.set_markup("<small>" + self.status_no_render + "</small>") render_status_row = Gtk.HBox(False, 2) render_status_row.pack_start(self.render_percentage, False, False, 0) render_status_row.pack_start(Gtk.Label(), True, True, 0) render_status_row.pack_start(self.render_status_info, False, False, 0) render_status_row.set_margin_bottom(6) self.render_progress_bar = Gtk.ProgressBar() self.render_progress_bar.set_valign(Gtk.Align.CENTER) self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32) self.stop_button.connect("clicked", lambda w:abort_render()) self.render_button = guiutils.get_sized_button(_("Render"), 100, 32) self.render_button.connect("clicked", lambda w:render_output()) render_row = Gtk.HBox(False, 2) render_row.pack_start(self.render_progress_bar, True, True, 0) render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0) render_row.pack_start(self.stop_button, False, False, 0) render_row.pack_start(self.render_button, False, False, 0) render_vbox = Gtk.VBox(False, 2) render_vbox.pack_start(marks_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(encode_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(out_folder_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(render_status_row, False, False, 0) render_vbox.pack_start(render_row, False, False, 0) render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0) # Script work panel script_work_panel = Gtk.HBox(False, 2) script_work_panel.pack_start(script_vbox, False, False, 0) script_work_panel.pack_start(guiutils.pad_label(12, 2), False, False, 0) script_work_panel.pack_start(render_vbox, True, True, 0) self.load_script = Gtk.Button(_("Load Script")) self.load_script.connect("clicked", lambda w:load_script_dialog(_load_script_dialog_callback)) self.save_script = Gtk.Button(_("Save Script")) self.save_script.connect("clicked", lambda w:save_script_dialog(_save_script_dialog_callback)) exit_b = guiutils.get_sized_button(_("Close"), 150, 32) exit_b.connect("clicked", lambda w:_shutdown()) self.close_button = exit_b editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(self.load_script, False, False, 0) editor_buttons_row.pack_start(self.save_script, False, False, 0) editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(exit_b, False, False, 0) # Build window pane = Gtk.VBox(False, 2) pane.pack_start(preview_panel, False, False, 0) pane.pack_start(script_work_panel, False, False, 0) pane.pack_start(editor_buttons_row, False, False, 0) align = guiutils.set_margins(pane, 12, 12, 12, 12) script = gmicscript.get_default_script() self.script_view.get_buffer().set_text(script.script) self.preset_label.set_text(script.name) self.update_encode_sensitive() # Connect global key listener self.connect("key-press-event", _global_key_down_listener) # Set pane and show window self.add(align) self.set_title(_("G'MIC Effects")) self.set_position(Gtk.WindowPosition.CENTER) self.set_widgets_sensitive(False) self.show_all() self.set_resizable(False) self.set_active_state(False)
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_play_in_clip_monitor = Gtk.CheckButton() auto_play_in_clip_monitor.set_active(prefs.auto_play_in_clip_monitor) auto_center_on_stop = Gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) spin_adj = Gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) trim_exit_on_empty = Gtk.CheckButton() trim_exit_on_empty.set_active(prefs.empty_click_exits_trims) quick_enter_trim = Gtk.CheckButton() quick_enter_trim.set_active(prefs.quick_enter_trims) remember_clip_frame = Gtk.CheckButton() remember_clip_frame.set_active(prefs.remember_monitor_clip_frame) overwrite_clip_drop = Gtk.ComboBoxText() active = 0 if prefs.overwrite_clip_drop == False: active = 1 overwrite_clip_drop.append_text(_("Overwrite blanks")) overwrite_clip_drop.append_text(_("Always insert")) overwrite_clip_drop.set_active(active) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) # Jul-2016 - SvdB - For play_pause button play_pause_button = Gtk.CheckButton() # The following test is to make sure play_pause can be used for the initial value. If not found, then leave uninitialized if hasattr(prefs, 'play_pause'): play_pause_button.set_active(prefs.play_pause) # Layout row1 = _row( guiutils.get_checkbox_row_box( auto_play_in_clip_monitor, Gtk.Label(label=_("Autoplay new Clips in Clip Monitor")))) row2 = _row( guiutils.get_checkbox_row_box( auto_center_on_stop, Gtk.Label(label=_("Center Current Frame on Playback Stop")))) row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) row5 = _row( guiutils.get_checkbox_row_box( trim_exit_on_empty, Gtk.Label(label=_("Trim Modes exit on empty click")))) row6 = _row( guiutils.get_checkbox_row_box( quick_enter_trim, Gtk.Label(label=_("Quick enter Trim Modes")))) row7 = _row( guiutils.get_checkbox_row_box( remember_clip_frame, Gtk.Label(label=_("Remember Monitor Clip Frame")))) row8 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Media drag'n'drop action on non-V1 tracks")), overwrite_clip_drop, PREFERENCES_LEFT)) row9 = _row( guiutils.get_checkbox_row_box( cover_delete, Gtk.Label( label=_("Cover Transition/Fade clips on delete if possible")))) # Jul-2016 - SvdB - For play_pause button row10 = _row( guiutils.get_checkbox_row_box( play_pause_button, Gtk.Label(label=_("Enable single Play/Pause button")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row7, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(row9, False, False, 0) # Jul-2016 - SvdB - For play_pause button vbox.pack_start(row10, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button return vbox, (auto_play_in_clip_monitor, auto_center_on_stop, gfx_length_spin, trim_exit_on_empty, quick_enter_trim, remember_clip_frame, overwrite_clip_drop, cover_delete, play_pause_button)
def export_screenshot_dialog(callback, frame, parent_window, project_name): cancel_str = _("Cancel").encode('utf-8') ok_str = _("Export Image").encode('utf-8') dialog = gtk.Dialog( _("Export Frame Image"), parent_window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (cancel_str, gtk.RESPONSE_CANCEL, ok_str, gtk.RESPONSE_YES)) global _screenshot_img _screenshot_img = guiutils.get_gtk_image_from_file( get_displayed_image_path(), 300) frame_frame = guiutils.get_named_frame_with_vbox(None, [_screenshot_img]) INPUT_LABELS_WITDH = 320 project_name = project_name.strip(".flb") file_name = gtk.Entry() file_name.set_text(project_name) extension_label = gtk.Label(".png") extension_label.set_size_request(35, 20) name_pack = gtk.HBox(False, 4) name_pack.pack_start(file_name, True, True, 0) name_pack.pack_start(extension_label, False, False, 0) name_row = guiutils.get_two_column_box(gtk.Label(_("Export file name:")), name_pack, INPUT_LABELS_WITDH) out_folder = gtk.FileChooserButton(_("Select target folder")) out_folder.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) out_folder.set_current_folder(os.path.expanduser("~") + "/") folder_row = guiutils.get_two_column_box(gtk.Label(_("Export folder:")), out_folder, INPUT_LABELS_WITDH) file_type_combo = gtk.combo_box_new_text() for img in _img_types: file_type_combo.append_text(img) file_type_combo.set_active(0) file_type_combo.connect("changed", _file_type_changed, extension_label) file_type_row = guiutils.get_two_column_box(gtk.Label(_("Image type:")), file_type_combo, INPUT_LABELS_WITDH) file_frame = guiutils.get_named_frame_with_vbox( None, [file_type_row, name_row, folder_row]) vbox = gtk.VBox(False, 2) vbox.pack_start(frame_frame, False, False, 0) vbox.pack_start(guiutils.pad_label(12, 12), False, False, 0) vbox.pack_start(file_frame, False, False, 0) alignment = gtk.Alignment(0.5, 0.5, 1.0, 1.0) alignment.set_padding(12, 12, 12, 12) alignment.add(vbox) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.default_behaviour(dialog) dialog.connect( 'response', callback, (file_name, out_folder, file_type_combo, frame) ) #(file_name, out_folder, track_select_combo, cascade_check, op_combo, audio_track_select_combo)) dialog.show_all()
def show_slowmo_dialog(media_file, _response_callback): folder, file_name = os.path.split(media_file.path) name, ext = os.path.splitext(file_name) dialog = Gtk.Dialog(_("Render Slow/Fast Motion Video File"), gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, _("Render").encode('utf-8'), Gtk.ResponseType.ACCEPT)) media_file_label = Gtk.Label(label=_("Source Media File: ")) media_name = Gtk.Label(label="<b>" + media_file.name + "</b>") media_name.set_use_markup(True) SOURCE_PAD = 8 SOURCE_HEIGHT = 20 mf_row = guiutils.get_left_justified_box([media_file_label, guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), media_name]) mark_in = Gtk.Label(label=_("<b>not set</b>")) mark_out = Gtk.Label(label=_("<b>not set</b>")) if media_file.mark_in != -1: mark_in = Gtk.Label(label="<b>" + utils.get_tc_string(media_file.mark_in) + "</b>") if media_file.mark_out != -1: mark_out = Gtk.Label(label="<b>" + utils.get_tc_string(media_file.mark_out) + "</b>") mark_in.set_use_markup(True) mark_out.set_use_markup(True) fb_widgets = utils.EmptyClass() fb_widgets.file_name = Gtk.Entry() fb_widgets.file_name.set_text(name + "_MOTION") fb_widgets.extension_label = Gtk.Label() fb_widgets.extension_label.set_size_request(45, 20) name_row = Gtk.HBox(False, 4) name_row.pack_start(fb_widgets.file_name, True, True, 0) name_row.pack_start(fb_widgets.extension_label, False, False, 4) fb_widgets.out_folder = Gtk.FileChooserButton(_("Select Target Folder")) fb_widgets.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) fb_widgets.out_folder.set_current_folder(folder) label = Gtk.Label(label=_("Speed %:")) adjustment = Gtk.Adjustment(float(100), float(1), float(600), float(1)) fb_widgets.hslider = Gtk.HScale() fb_widgets.hslider.set_adjustment(adjustment) fb_widgets.hslider.set_draw_value(False) spin = Gtk.SpinButton() spin.set_numeric(True) spin.set_adjustment(adjustment) fb_widgets.hslider.set_digits(0) spin.set_digits(0) slider_hbox = Gtk.HBox(False, 4) slider_hbox.pack_start(fb_widgets.hslider, True, True, 0) slider_hbox.pack_start(spin, False, False, 4) slider_hbox.set_size_request(350,35) hbox = Gtk.HBox(False, 2) hbox.pack_start(guiutils.pad_label(8, 8), False, False, 0) hbox.pack_start(label, False, False, 0) hbox.pack_start(slider_hbox, False, False, 0) profile_selector = ProfileSelector() profile_selector.fill_options() profile_selector.widget.set_sensitive(True) fb_widgets.out_profile_combo = profile_selector.widget quality_selector = RenderQualitySelector() fb_widgets.quality_cb = quality_selector.widget # Encoding encoding_selector = RenderEncodingSelector(quality_selector, fb_widgets.extension_label, None) encoding_selector.encoding_selection_changed() fb_widgets.encodings_cb = encoding_selector.widget objects_list = Gtk.TreeStore(str, bool) objects_list.append(None, [_("Full Source Length"), True]) if media_file.mark_in != -1 and media_file.mark_out != -1: range_available = True else: range_available = False objects_list.append(None, [_("Source Mark In to Mark Out"), range_available]) fb_widgets.render_range = Gtk.ComboBox.new_with_model(objects_list) renderer_text = Gtk.CellRendererText() fb_widgets.render_range.pack_start(renderer_text, True) fb_widgets.render_range.add_attribute(renderer_text, "text", 0) fb_widgets.render_range.add_attribute(renderer_text, 'sensitive', 1) fb_widgets.render_range.set_active(0) fb_widgets.render_range.show() # To update rendered length display clip_length = _get_rendered_slomo_clip_length(media_file, fb_widgets.render_range, 100) clip_length_label = Gtk.Label(label=utils.get_tc_string(clip_length)) fb_widgets.hslider.connect("value-changed", _slomo_speed_changed, media_file, fb_widgets.render_range, clip_length_label) fb_widgets.render_range.connect("changed", _slomo_range_changed, media_file, fb_widgets.hslider, clip_length_label) # Build gui vbox = Gtk.VBox(False, 2) vbox.pack_start(mf_row, False, False, 0) vbox.pack_start(guiutils.get_left_justified_box([Gtk.Label(label=_("Source Mark In: ")), guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), mark_in]), False, False, 0) vbox.pack_start(guiutils.get_left_justified_box([Gtk.Label(label=_("Source_Mark Out: ")), guiutils.pad_label(SOURCE_PAD, SOURCE_HEIGHT), mark_out]), False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(hbox, False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target File:")), name_row, 120), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Folder:")), fb_widgets.out_folder, 120), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Profile:")), fb_widgets.out_profile_combo, 200), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Encoding:")), fb_widgets.encodings_cb, 200), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Target Quality:")), fb_widgets.quality_cb, 200), False, False, 0) vbox.pack_start(guiutils.pad_label(18, 12), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Render Range:")), fb_widgets.render_range, 180), False, False, 0) vbox.pack_start(guiutils.get_two_column_box(Gtk.Label(label=_("Rendered Clip Length:")), clip_length_label, 180), False, False, 0) alignment = guiutils.set_margins(vbox, 6, 24, 24, 24) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.connect('response', _response_callback, fb_widgets, media_file) dialog.show_all()
def show_render_properties_panel(render_item): if render_item.render_data.user_args == False: enc_opt = renderconsumer.encoding_options[ render_item.render_data.enc_index] enc_desc = enc_opt.name audio_desc = enc_opt.audio_desc quality_opt = enc_opt.quality_options[ render_item.render_data.quality_index] quality_desc = quality_opt.name else: enc_desc = " -" quality_desc = " -" audio_desc = " -" user_args = str(render_item.render_data.user_args) start_frame, end_frame, wait_for_stop_render = get_render_range( render_item) start_str = utils.get_tc_string_with_fps(start_frame, render_item.render_data.fps) end_str = utils.get_tc_string_with_fps(end_frame, render_item.render_data.fps) LEFT_WIDTH = 200 render_item.get_display_name() row0 = guiutils.get_two_column_box(guiutils.bold_label(_("Encoding:")), gtk.Label(enc_desc), LEFT_WIDTH) row1 = guiutils.get_two_column_box(guiutils.bold_label(_("Quality:")), gtk.Label(quality_desc), LEFT_WIDTH) row2 = guiutils.get_two_column_box( guiutils.bold_label(_("Audio Encoding:")), gtk.Label(audio_desc), LEFT_WIDTH) row3 = guiutils.get_two_column_box( guiutils.bold_label(_("Use User Args:")), gtk.Label(user_args), LEFT_WIDTH) row4 = guiutils.get_two_column_box(guiutils.bold_label(_("Start:")), gtk.Label(start_str), LEFT_WIDTH) row5 = guiutils.get_two_column_box(guiutils.bold_label(_("End:")), gtk.Label(end_str), LEFT_WIDTH) row6 = guiutils.get_two_column_box( guiutils.bold_label(_("Frames Per Second:")), gtk.Label(str(render_item.render_data.fps)), LEFT_WIDTH) row7 = guiutils.get_two_column_box( guiutils.bold_label(_("Render Profile Name:")), gtk.Label(str(render_item.render_data.profile_name)), LEFT_WIDTH) row8 = guiutils.get_two_column_box( guiutils.bold_label(_("Render Profile:")), gtk.Label(render_item.render_data.profile_desc), LEFT_WIDTH) vbox = gtk.VBox(False, 2) vbox.pack_start(gtk.Label(render_item.get_display_name()), False, False, 0) vbox.pack_start(guiutils.get_pad_label(12, 16), False, False, 0) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row7, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(gtk.Label(), True, True, 0) title = _("Render Properties") dialogutils.panel_ok_dialog(title, vbox)
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.ComboBoxText() 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(label=_("Description.:")), description, PROFILE_MANAGER_LEFT) row1 = guiutils.get_two_column_box(Gtk.Label(label=_("Frame rate num.:")), f_rate_num, PROFILE_MANAGER_LEFT) row2 = guiutils.get_two_column_box(Gtk.Label(label=_("Frame rate den.:")), f_rate_dem, PROFILE_MANAGER_LEFT) row3 = guiutils.get_two_column_box(Gtk.Label(label=_("Width:")), width, PROFILE_MANAGER_LEFT) row4 = guiutils.get_two_column_box(Gtk.Label(label=_("Height:")), height, PROFILE_MANAGER_LEFT) row5 = guiutils.get_two_column_box( Gtk.Label(label=_("Sample aspect num.:")), s_rate_num, PROFILE_MANAGER_LEFT) row6 = guiutils.get_two_column_box( Gtk.Label(label=_("Sample aspect den.:")), s_rate_dem, PROFILE_MANAGER_LEFT) row7 = guiutils.get_two_column_box( Gtk.Label(label=_("Display aspect num.:")), d_rate_num, PROFILE_MANAGER_LEFT) row8 = guiutils.get_two_column_box( Gtk.Label(label=_("Display aspect den.:")), d_rate_dem, PROFILE_MANAGER_LEFT) row9 = guiutils.get_two_column_box(Gtk.Label(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 _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) if prefs.buttons_style == editorpersistance.GLASS_STYLE: buttons_combo.set_active(0) else: buttons_combo.set_active(1) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Light Theme")) dark_combo.append_text(_("Dark Theme")) if prefs.dark_theme == True: dark_combo.set_active(1) else: dark_combo.set_active(0) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) # Layout row0 = _row( guiutils.get_checkbox_row_box( force_english_check, Gtk.Label(label=_("Use English texts on localized OS")))) row1 = _row( guiutils.get_checkbox_row_box( display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row( guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Icons and color optimized for:")), dark_combo, PREFERENCES_LEFT)) row4 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row( guiutils.get_two_column_box( Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) vbox = Gtk.VBox(False, 2) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) return vbox, (force_english_check, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo)
def _edit_prefs_panel(): prefs = editorpersistance.prefs # Widgets auto_play_in_clip_monitor = Gtk.CheckButton() auto_play_in_clip_monitor.set_active(prefs.auto_play_in_clip_monitor) auto_center_on_stop = Gtk.CheckButton() auto_center_on_stop.set_active(prefs.auto_center_on_play_stop) spin_adj = Gtk.Adjustment(prefs.default_grfx_length, 1, 15000, 1) gfx_length_spin = Gtk.SpinButton() gfx_length_spin.set_adjustment(spin_adj) gfx_length_spin.set_numeric(True) trim_exit_on_empty = Gtk.CheckButton() trim_exit_on_empty.set_active(prefs.empty_click_exits_trims) quick_enter_trim = Gtk.CheckButton() quick_enter_trim.set_active(prefs.quick_enter_trims) remember_clip_frame = Gtk.CheckButton() remember_clip_frame.set_active(prefs.remember_monitor_clip_frame) overwrite_clip_drop = Gtk.ComboBoxText() active = 0 if prefs.overwrite_clip_drop == False: active = 1 overwrite_clip_drop.append_text(_("Overwrite blanks")) overwrite_clip_drop.append_text(_("Always insert")) overwrite_clip_drop.set_active(active) cover_delete = Gtk.CheckButton() cover_delete.set_active(prefs.trans_cover_delete) # Jul-2016 - SvdB - For play_pause button play_pause_button = Gtk.CheckButton() # The following test is to make sure play_pause can be used for the initial value. If not found, then leave uninitialized if hasattr(prefs, 'play_pause'): play_pause_button.set_active(prefs.play_pause) active = 0 if prefs.mouse_scroll_action_is_zoom == False: active = 1 mouse_scroll_action = Gtk.ComboBoxText() mouse_scroll_action.append_text(_("Zoom, Control to Scroll Horizontal")) mouse_scroll_action.append_text(_("Scroll Horizontal, Control to Zoom")) mouse_scroll_action.set_active(active) hide_file_ext_button = Gtk.CheckButton() if hasattr(prefs, 'hide_file_ext'): hide_file_ext_button.set_active(prefs.hide_file_ext) auto_center_on_updown = Gtk.CheckButton() auto_center_on_updown.set_active(prefs.center_on_arrow_move) # Apr-2017 - SvdB - For FF/Rev speed options if hasattr(prefs, 'ffwd_rev_shift'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_shift, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_shift_spin = Gtk.SpinButton() ffwd_rev_shift_spin.set_adjustment(spin_adj) ffwd_rev_shift_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_ctrl'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_ctrl, 1, 10, 1) else: spin_adj = Gtk.Adjustment(10, 1, 10, 1) ffwd_rev_ctrl_spin = Gtk.SpinButton() ffwd_rev_ctrl_spin.set_adjustment(spin_adj) ffwd_rev_ctrl_spin.set_numeric(True) if hasattr(prefs, 'ffwd_rev_caps'): spin_adj = Gtk.Adjustment(prefs.ffwd_rev_caps, 1, 10, 1) else: spin_adj = Gtk.Adjustment(1, 1, 10, 1) ffwd_rev_caps_spin = Gtk.SpinButton() ffwd_rev_caps_spin.set_adjustment(spin_adj) ffwd_rev_caps_spin.set_numeric(True) # Layout row1 = _row(guiutils.get_checkbox_row_box(auto_play_in_clip_monitor, Gtk.Label(label=_("Autoplay new Clips in Clip Monitor")))) row2 = _row(guiutils.get_checkbox_row_box(auto_center_on_stop, Gtk.Label(label=_("Center Current Frame on Playback Stop")))) row13 = _row(guiutils.get_checkbox_row_box(auto_center_on_updown, Gtk.Label(label=_("Center Current Frame after Up/Down Arrow")))) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Graphics default length:")), gfx_length_spin, PREFERENCES_LEFT)) row5 = _row(guiutils.get_checkbox_row_box(trim_exit_on_empty, Gtk.Label(label=_("Trim Modes exit on empty click")))) row6 = _row(guiutils.get_checkbox_row_box(quick_enter_trim, Gtk.Label(label=_("Quick enter Trim Modes")))) row7 = _row(guiutils.get_checkbox_row_box(remember_clip_frame, Gtk.Label(label=_("Remember Monitor Clip Frame")))) row8 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Media drag'n'drop action on non-V1 tracks")), overwrite_clip_drop, PREFERENCES_LEFT)) row9 = _row(guiutils.get_checkbox_row_box(cover_delete, Gtk.Label(label=_("Cover Transition/Fade clips on delete if possible")))) # Jul-2016 - SvdB - For play_pause button row10 = _row(guiutils.get_checkbox_row_box(play_pause_button, Gtk.Label(label=_("Enable single Play/Pause button")))) row11 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Mouse Middle Button Scroll Action")), mouse_scroll_action, PREFERENCES_LEFT)) row12 = _row(guiutils.get_checkbox_row_box(hide_file_ext_button, Gtk.Label(label=_("Hide file extensions when importing Clips")))) # Apr-2017 - SvdB - For Fast Forward / Reverse options row14 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Shift Key:")), ffwd_rev_shift_spin, PREFERENCES_LEFT)) row14.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Shift Key is held (Only using KEYS).\n" \ "Enabling multiple modifier keys will multiply the set values.\n" \ "E.g. if Shift is set to " + str(prefs.ffwd_rev_shift) + " and Ctrl to " + str(prefs.ffwd_rev_ctrl) + \ ", holding Shift + Ctrl will result in up to " + str(prefs.ffwd_rev_shift * prefs.ffwd_rev_ctrl) + "x speed.\n" \ "(Effective maximum speed depends on underlying software and/or hardware limitations)")) row15 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Control Key:")), ffwd_rev_ctrl_spin, PREFERENCES_LEFT)) row15.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Ctrl Key is held (Only using KEYS).")) row16 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Fast Forward / Reverse Speed for Caps Lock Key:")), ffwd_rev_caps_spin, PREFERENCES_LEFT)) row16.set_tooltip_text(_("Speed of Forward / Reverse will be multiplied by this value if Caps Lock is set (Only using KEYS).")) vbox = Gtk.VBox(False, 2) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row6, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row13, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row7, False, False, 0) vbox.pack_start(row8, False, False, 0) vbox.pack_start(row9, False, False, 0) # Jul-2016 - SvdB - For play_pause button vbox.pack_start(row10, False, False, 0) vbox.pack_start(row11, False, False, 0) vbox.pack_start(row12, False, False, 0) # Apr-2017 - SvdB - For ffwd / rev speed vbox.pack_start(row14, False, False, 0) vbox.pack_start(row15, False, False, 0) vbox.pack_start(row16, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Jul-2016 - SvdB - Added play_pause_button # Apr-2017 - SvdB - Added ffwd / rev values return vbox, (auto_play_in_clip_monitor, auto_center_on_stop, gfx_length_spin, trim_exit_on_empty, quick_enter_trim, remember_clip_frame, overwrite_clip_drop, cover_delete, play_pause_button, mouse_scroll_action, hide_file_ext_button, auto_center_on_updown, ffwd_rev_shift_spin, ffwd_rev_ctrl_spin, ffwd_rev_caps_spin)
def _view_prefs_panel(): prefs = editorpersistance.prefs # Widgets force_english_check = Gtk.CheckButton() force_english_check.set_active(prefs.use_english_always) display_splash_check = Gtk.CheckButton() display_splash_check.set_active(prefs.display_splash_screen) # Feb-2017 - SvdB - For full file names show_full_file_names = Gtk.CheckButton() show_full_file_names.set_active(prefs.show_full_file_names) buttons_combo = Gtk.ComboBoxText() buttons_combo.append_text(_("Glass")) buttons_combo.append_text(_("Simple")) if prefs.buttons_style == editorpersistance.GLASS_STYLE: buttons_combo.set_active(0) else: buttons_combo.set_active(1) dark_combo = Gtk.ComboBoxText() dark_combo.append_text(_("Light Theme")) dark_combo.append_text(_("Dark Theme")) if prefs.dark_theme == True: dark_combo.set_active(1) else: dark_combo.set_active(0) theme_combo = Gtk.ComboBoxText() for theme in gui._THEME_COLORS: theme_combo.append_text(theme[4]) theme_combo.set_active(prefs.theme_fallback_colors) audio_levels_combo = Gtk.ComboBoxText() audio_levels_combo.append_text(_("Display All Levels")) audio_levels_combo.append_text(_("Display Levels On Request")) if prefs.display_all_audio_levels == True: audio_levels_combo.set_active(0) else: audio_levels_combo.set_active(1) window_mode_combo = Gtk.ComboBoxText() window_mode_combo.append_text(_("Single Window")) window_mode_combo.append_text(_("Two Windows")) if prefs.global_layout == appconsts.SINGLE_WINDOW: window_mode_combo.set_active(0) else: window_mode_combo.set_active(1) tracks_combo = Gtk.ComboBoxText() tracks_combo.append_text(_("Normal - 50px, 25px")) tracks_combo.append_text(_("Double for HiDPI - 100px, 50px")) tracks_combo.set_active(prefs.double_track_hights) # Layout row00 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Application window mode:")), window_mode_combo, PREFERENCES_LEFT)) row0 = _row(guiutils.get_checkbox_row_box(force_english_check, Gtk.Label(label=_("Use English texts on localized OS")))) row1 = _row(guiutils.get_checkbox_row_box(display_splash_check, Gtk.Label(label=_("Display splash screen")))) row2 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Buttons style:")), buttons_combo, PREFERENCES_LEFT)) row3 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Theme request, icons and colors:")), dark_combo, PREFERENCES_LEFT)) row4 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Theme detection fail fallback colors:")), theme_combo, PREFERENCES_LEFT)) row5 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Default audio levels display:")), audio_levels_combo, PREFERENCES_LEFT)) row7 = _row(guiutils.get_two_column_box(Gtk.Label(label=_("Tracks Heights:")), tracks_combo, PREFERENCES_LEFT)) # Feb-2017 - SvdB - For full file names row6 = _row(guiutils.get_checkbox_row_box(show_full_file_names, Gtk.Label(label=_("Show Full File names")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row00, False, False, 0) vbox.pack_start(row0, False, False, 0) vbox.pack_start(row1, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row3, False, False, 0) vbox.pack_start(row4, False, False, 0) vbox.pack_start(row5, False, False, 0) vbox.pack_start(row7, False, False, 0) # Feb-2017 - SvdB - For full file names vbox.pack_start(row6, False, False, 0) vbox.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(vbox, 12, 0, 12, 12) # Feb-2017 - SvdB - Added code for full file names return vbox, (force_english_check, display_splash_check, buttons_combo, dark_combo, theme_combo, audio_levels_combo, window_mode_combo, show_full_file_names, tracks_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 __init__(self): GObject.GObject.__init__(self) self.connect("delete-event", lambda w, e:_shutdown()) app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowblademedialinker.png") self.set_icon(app_icon) # Load media row load_button = Gtk.Button(_("Load Clip")) load_button.connect("clicked", lambda w: self.load_button_clicked()) self.media_info = Gtk.Label() self.media_info.set_markup("<small>no clip loaded</small>")#"<small>" + "video_clip.mpg, 1920x1080, 25.0fps" + "</small>" ) load_row = Gtk.HBox(False, 2) load_row.pack_start(load_button, False, False, 0) load_row.pack_start(guiutils.get_pad_label(6, 2), False, False, 0) load_row.pack_start(self.media_info, False, False, 0) load_row.pack_start(Gtk.Label(), True, True, 0) load_row.set_margin_bottom(4) # Clip monitor black_box = Gtk.EventBox() black_box.add(Gtk.Label()) bg_color = Gdk.Color(red=0.0, green=0.0, blue=0.0) black_box.modify_bg(Gtk.StateType.NORMAL, bg_color) self.monitor = black_box # This could be any GTK+ widget (that is not "windowless"), only its XWindow draw rect # is used to position and scale SDL overlay that actually displays video. self.monitor.set_size_request(MONITOR_WIDTH, MONITOR_HEIGHT) left_vbox = Gtk.VBox(False, 0) left_vbox.pack_start(load_row, False, False, 0) left_vbox.pack_start(self.monitor, True, True, 0) self.preview_info = Gtk.Label() self.preview_info.set_markup("<small>" + _("no preview") + "</small>" ) preview_info_row = Gtk.HBox() preview_info_row.pack_start(self.preview_info, False, False, 0) preview_info_row.pack_start(Gtk.Label(), True, True, 0) preview_info_row.set_margin_top(6) preview_info_row.set_margin_bottom(8) self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview) right_vbox = Gtk.VBox(False, 2) right_vbox.pack_start(preview_info_row, False, False, 0) right_vbox.pack_start(self.preview_monitor, True, True, 0) # Monitors panel monitors_panel = Gtk.HBox(False, 2) monitors_panel.pack_start(left_vbox, False, False, 0) monitors_panel.pack_start(Gtk.Label(), True, True, 0) monitors_panel.pack_start(right_vbox, False, False, 0) # Control row self.tc_display = guicomponents.MonitorTCDisplay() self.tc_display.use_internal_frame = True self.tc_display.widget.set_valign(Gtk.Align.CENTER) self.tc_display.use_internal_fps = True self.pos_bar = positionbar.PositionBar(False) self.pos_bar.set_listener(self.position_listener) pos_bar_frame = Gtk.Frame() pos_bar_frame.add(self.pos_bar.widget) pos_bar_frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN) pos_bar_frame.set_margin_top(5) pos_bar_frame.set_margin_bottom(4) pos_bar_frame.set_margin_left(6) pos_bar_frame.set_margin_right(2) self.control_buttons = glassbuttons.GmicButtons() pressed_callback_funcs = [prev_pressed, next_pressed, mark_in_pressed, mark_out_pressed, marks_clear_pressed, to_mark_in_pressed, to_mark_out_pressed] self.control_buttons.set_callbacks(pressed_callback_funcs) self.preview_button = Gtk.Button(_("Preview")) self.preview_button.connect("clicked", lambda w: render_preview_frame()) control_panel = Gtk.HBox(False, 2) control_panel.pack_start(self.tc_display.widget, False, False, 0) control_panel.pack_start(pos_bar_frame, True, True, 0) control_panel.pack_start(self.control_buttons.widget, False, False, 0) control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0) control_panel.pack_start(self.preview_button, False, False, 0) preview_panel = Gtk.VBox(False, 2) preview_panel.pack_start(monitors_panel, False, False, 0) preview_panel.pack_start(control_panel, False, False, 0) preview_panel.set_margin_bottom(8) # Script area self.preset_label = Gtk.Label("Preset Script:") self.preset_select = Gtk.ComboBoxText() self.preset_select.set_tooltip_text(_("Select Preset G'Mic script")) for gmic_script in _scripts: self.preset_select.append_text(gmic_script.name) print gmic_script.script self.preset_select.set_active(0) self.preset_select.connect('changed', lambda w: self.update_script_view()) preset_row = Gtk.HBox(False, 2) preset_row.pack_start(self.preset_label, False, False, 0) preset_row.pack_start(guiutils.pad_label(6, 12), False, False, 0) preset_row.pack_start(self.preset_select, False, False, 0) preset_row.pack_start(Gtk.Label(), True, True, 0) self.script_view = Gtk.TextView() self.script_view.set_sensitive(False) self.script_view.set_pixels_above_lines(2) self.script_view.set_left_margin(2) script_sw = Gtk.ScrolledWindow() script_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) script_sw.add(self.script_view) script_sw.set_size_request(MONITOR_WIDTH - 100, 125) self.out_view = Gtk.TextView() self.out_view.set_sensitive(False) self.out_view.set_pixels_above_lines(2) self.out_view.set_left_margin(2) fd = Pango.FontDescription.from_string("Sans 8") self.out_view.override_font(fd) out_sw = Gtk.ScrolledWindow() out_sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) out_sw.add(self.out_view) out_sw.set_size_request(MONITOR_WIDTH - 150, 100) script_vbox = Gtk.VBox(False, 2) script_vbox.pack_start(preset_row, False, False, 0) script_vbox.pack_start(script_sw, True, True, 0) script_vbox.pack_start(out_sw, True, True, 0) # Render panel self.mark_in_label = guiutils.bold_label("Mark In:") self.mark_out_label = guiutils.bold_label("Mark Out:") self.length_label = guiutils.bold_label("Length:") self.mark_in_info = Gtk.Label("-") self.mark_out_info = Gtk.Label("-") self.length_info = Gtk.Label("-") in_row = guiutils.get_two_column_box(self.mark_in_label, self.mark_in_info, 150) out_row = guiutils.get_two_column_box(self.mark_out_label, self.mark_out_info, 150) length_row = guiutils.get_two_column_box(self.length_label, self.length_info, 150) marks_row = Gtk.VBox(False, 2) marks_row.pack_start(in_row, True, True, 0) marks_row.pack_start(out_row, True, True, 0) marks_row.pack_start(length_row, True, True, 0) self.out_folder = Gtk.FileChooserButton(_("Select Folder")) self.out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) self.out_folder.set_current_folder(os.path.expanduser("~") + "/") self.out_label = Gtk.Label(label=_("Frames Folder:")) self.frame_name = Gtk.Entry() self.frame_name.set_text("frame") self.extension_label = Gtk.Label() self.extension_label.set_markup("<small>XXXX.png</small>") out_folder_row = guiutils.get_left_justified_box([self.out_label, guiutils.pad_label(12, 2), \ self.out_folder, guiutils.pad_label(24, 2), self.frame_name, \ guiutils.pad_label(2, 2), self.extension_label]) self.encode_check_label = Gtk.Label("Encode Video") self.encode_check = Gtk.CheckButton() self.encode_check.set_active(False) self.encode_settings_button = Gtk.Button(_("Encoding settings")) self.encode_desc = Gtk.Label() self.encode_desc.set_markup("<small>"+ "MPEG-2, 3000kbps" + "</small>") encode_row = Gtk.HBox(False, 2) encode_row.pack_start(self.encode_check, False, False, 0) encode_row.pack_start(self.encode_check_label, False, False, 0) encode_row.pack_start(guiutils.pad_label(48, 12), False, False, 0) encode_row.pack_start(self.encode_settings_button, False, False, 0) encode_row.pack_start(guiutils.pad_label(6, 12), False, False, 0) encode_row.pack_start(self.encode_desc, False, False, 0) encode_row.pack_start(Gtk.Label(), True, True, 0) encode_row.set_margin_bottom(6) self.render_percentage = Gtk.Label("0%") self.render_status_info = Gtk.Label() self.render_status_info.set_markup("<small>"+ "52 frames, requiring 768MB dis space, video file: ../movie.mpg" + "</small>") render_status_row = Gtk.HBox(False, 2) render_status_row.pack_start(self.render_percentage, False, False, 0) render_status_row.pack_start(Gtk.Label(), True, True, 0) render_status_row.pack_start(self.render_status_info, False, False, 0) render_status_row.set_margin_bottom(6) self.render_progress_bar = Gtk.ProgressBar() self.render_progress_bar.set_valign(Gtk.Align.CENTER) self.stop_button = guiutils.get_sized_button(_("Stop"), 100, 32) self.render_button = guiutils.get_sized_button(_("Render"), 100, 32) self.render_button.connect("clicked", lambda w:render()) render_row = Gtk.HBox(False, 2) render_row.pack_start(self.render_progress_bar, True, True, 0) render_row.pack_start(guiutils.pad_label(12, 2), False, False, 0) render_row.pack_start(self.stop_button, False, False, 0) render_row.pack_start(self.render_button, False, False, 0) render_vbox = Gtk.VBox(False, 2) render_vbox.pack_start(marks_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(encode_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(out_folder_row, False, False, 0) render_vbox.pack_start(Gtk.Label(), True, True, 0) render_vbox.pack_start(render_status_row, False, False, 0) render_vbox.pack_start(render_row, False, False, 0) render_vbox.pack_start(guiutils.pad_label(24, 24), False, False, 0) # Script work panel script_work_panel = Gtk.HBox(False, 2) script_work_panel.pack_start(script_vbox, False, False, 0) script_work_panel.pack_start(guiutils.pad_label(12, 2), False, False, 0) script_work_panel.pack_start(render_vbox, True, True, 0) self.load_script = Gtk.Button(_("Load Script")) #load_layers.connect("clicked", lambda w:self._load_layers_pressed()) self.save_script = Gtk.Button(_("Save Script")) #save_layers.connect("clicked", lambda w:self._save_layers_pressed()) info_b = guiutils.get_sized_button(_("Info"), 150, 32) exit_b = guiutils.get_sized_button(_("Close"), 150, 32) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(self.load_script, False, False, 0) editor_buttons_row.pack_start(self.save_script, False, False, 0) editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(info_b, False, False, 0) editor_buttons_row.pack_start(guiutils.pad_label(96, 2), False, False, 0) editor_buttons_row.pack_start(exit_b, False, False, 0) # Build window pane = Gtk.VBox(False, 2) pane.pack_start(preview_panel, False, False, 0) pane.pack_start(script_work_panel, False, False, 0) pane.pack_start(editor_buttons_row, False, False, 0) align = guiutils.set_margins(pane, 12, 12, 12, 12) # Set pane and show window self.add(align) self.set_title(_("G'MIC Effects")) self.set_position(Gtk.WindowPosition.CENTER) self.set_widgets_sensitive(False) self.show_all() self.set_resizable(False) self.set_active_state(False)