def get_top_level_project_info_panel(): project_name_label = Gtk.Label(label=PROJECT().name) name_row = guiutils.get_left_justified_box([project_name_label]) name_panel = guiutils.get_named_frame(_("Project"), name_row, 0, 6, 4, _("A <b>Project</b> contains one or more <b>Sequences</b> of edited media and a collection of media files stored in <b>Bins.</b>")) profile = PROJECT().profile desc_label = Gtk.Label(label=profile.description()) info_box = guicomponents.get_profile_info_small_box(profile) vbox = Gtk.VBox() vbox.pack_start(guiutils.get_left_justified_box([desc_label]), False, True, 0) vbox.pack_start(info_box, False, True, 0) profile_panel = guiutils.get_named_frame(_("Profile"), vbox, 0, 6, 4, _("<b>Profile</b> determines frame rate per second, image size in pixels and pixel aspect ratio for all <b>Sequences</b> in <b>Project</b> .")) events_list = ProjectEventListView() events_list.fill_data_model() events_panel = guiutils.get_named_frame(_("Project Events"), events_list, 0) project_info_vbox = Gtk.VBox() project_info_vbox.pack_start(name_panel, False, True, 0) project_info_vbox.pack_start(profile_panel, False, True, 0) guiutils.set_margins(project_info_vbox, 4,4,4,4) widgets.project_name_label = project_name_label widgets.desc_label = desc_label widgets.info_box = info_box widgets.events_list = events_list return project_info_vbox
def preferences_dialog(): dialog = Gtk.Dialog(_("Editor Preferences"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT, _("OK").encode('utf-8'), Gtk.ResponseType.ACCEPT)) gen_opts_panel, gen_opts_widgets = _general_options_panel(_thumbs_select_clicked, _renders_select_clicked) edit_prefs_panel, edit_prefs_widgets = _edit_prefs_panel() playback_prefs_panel, playback_prefs_widgets = _playback_prefs_panel() view_pres_panel, view_pref_widgets = _view_prefs_panel() # Jan-2017 - SvdB performance_panel, performance_widgets = _performance_panel() # Apr-2017 - SvdB #shortcuts_panel, shortcuts_widgets = _shortcuts_panel() notebook = Gtk.Notebook() notebook.set_size_request(PREFERENCES_WIDTH, PREFERENCES_HEIGHT) notebook.append_page(gen_opts_panel, Gtk.Label(label=_("General"))) notebook.append_page(edit_prefs_panel, Gtk.Label(label=_("Editing"))) notebook.append_page(playback_prefs_panel, Gtk.Label(label=_("Playback"))) notebook.append_page(view_pres_panel, Gtk.Label(label=_("View"))) notebook.append_page(performance_panel, Gtk.Label(label=_("Performance"))) #notebook.append_page(shortcuts_panel, Gtk.Label(label=_("Shortcuts"))) guiutils.set_margins(notebook, 4, 24, 6, 0) dialog.connect('response', _preferences_dialog_callback, (gen_opts_widgets, edit_prefs_widgets, playback_prefs_widgets, view_pref_widgets, \ performance_widgets)) dialog.vbox.pack_start(notebook, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) # Jul-2016 - SvdB - The next line is to get rid of the message "GtkDialog mapped without a transient parent. This is discouraged." dialog.set_transient_for(gui.editor_window.window) dialog.show_all()
def get_alignment2(panel): alignment = Gtk.Frame.new("") #Gtk.Frame.new(None) alignment.add(panel) alignment.set_shadow_type(Gtk.ShadowType.NONE) guiutils.set_margins(alignment, 6, 24, 12, 12) return alignment
def get_workflow_select_item(self, item_number, workflow_name, item_text): name = Gtk.Label(workflow_name) name.set_use_markup(True) guiutils.set_margins(name, 0, 8, 0, 0) label = Gtk.Label(item_text) label.set_use_markup(True) label.set_justify(Gtk.Justification.CENTER) item_vbox = Gtk.VBox(False, 2) item_vbox.pack_start(guiutils.get_centered_box([name]), False, False, 0) item_vbox.pack_start(guiutils.get_centered_box([label]), False, False, 0) guiutils.set_margins(item_vbox, 12, 18, 12, 12) widget = Gtk.EventBox() widget.connect("button-press-event", lambda w,e: self.selected_callback(w, item_number)) #widget.connect("button-release-event", lambda w,e: release_callback(self, w, e)) widget.set_can_focus(True) widget.add_events(Gdk.EventMask.KEY_PRESS_MASK) widget.add(item_vbox) widget.item_number = item_number self.set_item_color(widget) return widget
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 _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 get_clip_effects_editor_panel(group_combo_box, effects_list_view): create_widgets() stack_label = guiutils.bold_label(_("Clip Filters Stack")) label_row = guiutils.get_left_justified_box([stack_label]) guiutils.set_margins(label_row, 0, 4, 0, 0) ad_buttons_box = Gtk.HBox(True,1) ad_buttons_box.pack_start(widgets.add_effect_b, True, True, 0) ad_buttons_box.pack_start(widgets.del_effect_b, True, True, 0) stack_buttons_box = Gtk.HBox(False,1) stack_buttons_box.pack_start(ad_buttons_box, True, True, 0) stack_buttons_box.pack_start(widgets.toggle_all, False, False, 0) effect_stack = widgets.effect_stack_view for group in mltfilters.groups: group_name, filters_array = group group_combo_box.append_text(group_name) group_combo_box.set_active(0) # Same callback function works for filter select window too group_combo_box.connect("changed", lambda w,e: _group_selection_changed(w,effects_list_view), None) widgets.group_combo = group_combo_box widgets.effect_list_view = effects_list_view set_enabled(False) exit_button_vbox = Gtk.VBox(False, 2) exit_button_vbox.pack_start(widgets.exit_button, False, False, 0) info_row = Gtk.HBox(False, 2) info_row.pack_start(widgets.hamburger_launcher.widget, False, False, 0) info_row.pack_start(Gtk.Label(), True, True, 0) info_row.pack_start(widgets.clip_info, False, False, 0) info_row.pack_start(Gtk.Label(), True, True, 0) combo_row = Gtk.HBox(False, 2) combo_row.pack_start(group_combo_box, True, True, 0) group_name, filters_array = mltfilters.groups[0] effects_list_view.fill_data_model(filters_array) effects_list_view.treeview.get_selection().select_path("0") effects_vbox = Gtk.VBox(False, 2) effects_vbox.pack_start(label_row, False, False, 0) effects_vbox.pack_start(stack_buttons_box, False, False, 0) effects_vbox.pack_start(effect_stack, True, True, 0) effects_vbox.pack_start(combo_row, False, False, 0) effects_vbox.pack_start(effects_list_view, True, True, 0) widgets.group_combo.set_tooltip_text(_("Select Filter Group")) widgets.effect_list_view.set_tooltip_text(_("Current group Filters")) return effects_vbox, info_row
def create_widgets(): """ Widgets for editing compositing properties. """ widgets.compositor_info = guicomponents.CompositorInfoPanel() widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch(_hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 4, 6, 6, 0) # Edit area widgets.empty_label = Gtk.Label(label=_("No Compositor")) widgets.value_edit_box = Gtk.VBox() widgets.value_edit_box.pack_start(widgets.empty_label, True, True, 0) widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.add(widgets.value_edit_box) widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE)
def _create_info_dialog(): dialog = Gtk.Window(Gtk.WindowType.TOPLEVEL) dialog.set_title(_("Loading Media Import Project")) info_label = Gtk.Label(label="") status_box = Gtk.HBox(False, 2) status_box.pack_start(info_label, False, False, 0) status_box.pack_start(Gtk.Label(), True, True, 0) progress_bar = Gtk.ProgressBar() progress_bar.set_fraction(0.2) progress_bar.set_pulse_step(0.1) est_box = Gtk.HBox(False, 2) est_box.pack_start(Gtk.Label(label=""),False, False, 0) est_box.pack_start(Gtk.Label(), True, True, 0) progress_vbox = Gtk.VBox(False, 2) progress_vbox.pack_start(status_box, False, False, 0) progress_vbox.pack_start(progress_bar, True, True, 0) progress_vbox.pack_start(est_box, False, False, 0) alignment = guiutils.set_margins(progress_vbox, 12, 12, 12, 12) dialog.add(alignment) dialog.set_default_size(400, 70) dialog.set_position(Gtk.WindowPosition.CENTER) dialog.show_all() # Make refs available for updates dialog.progress_bar = progress_bar dialog.info = info_label global _info_window _info_window = dialog
def clip_render_progress_dialog(callback, title, text, progress_bar, parent_window): dialog = Gtk.Dialog(title, parent_window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT)) dialog.text_label = Gtk.Label(label=text) dialog.text_label.set_use_markup(True) text_box = Gtk.HBox(False, 2) text_box.pack_start(dialog.text_label,False, False, 0) text_box.pack_start(Gtk.Label(), True, True, 0) status_box = Gtk.HBox(False, 2) status_box.pack_start(text_box, False, False, 0) status_box.pack_start(Gtk.Label(), True, True, 0) progress_vbox = Gtk.VBox(False, 2) progress_vbox.pack_start(status_box, False, False, 0) progress_vbox.pack_start(guiutils.get_pad_label(10, 10), False, False, 0) progress_vbox.pack_start(progress_bar, False, False, 0) alignment = guiutils.set_margins(progress_vbox, 12, 12, 12, 12) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialog.set_default_size(500, 125) alignment.show_all() dialog.connect('response', callback) dialog.show() return dialog
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 _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 _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 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 create_widgets(): """ Widgets for editing clip effects properties. """ widgets.clip_info = guicomponents.ClipInfoPanel() widgets.exit_button = Gtk.Button() icon = Gtk.Image.new_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU) widgets.exit_button.set_image(icon) widgets.exit_button.connect("clicked", lambda w: _quit_editing_clip_clicked()) widgets.exit_button.set_tooltip_text(_("Quit editing Clip in editor")) widgets.effect_stack_view = guicomponents.FilterSwitchListView(lambda ts: effect_selection_changed(), toggle_filter_active, dnd_row_deleted, dnd_row_inserted) widgets.effect_stack_view.treeview.connect("button-press-event", lambda w,e, wtf: stack_view_pressed(), None) gui.effect_stack_list_view = widgets.effect_stack_view widgets.value_edit_box = Gtk.VBox() widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE) widgets.value_edit_frame.add(widgets.value_edit_box) widgets.add_effect_b = Gtk.Button() widgets.add_effect_b.set_image(Gtk.Image.new_from_file(respaths.IMAGE_PATH + "filter_add.png")) widgets.del_effect_b = Gtk.Button() widgets.del_effect_b.set_image(Gtk.Image.new_from_file(respaths.IMAGE_PATH + "filter_delete.png")) widgets.toggle_all = Gtk.Button() widgets.toggle_all.set_image(Gtk.Image.new_from_file(respaths.IMAGE_PATH + "filters_all_toggle.png")) widgets.add_effect_b.connect("clicked", lambda w,e: add_effect_pressed(), None) widgets.del_effect_b.connect("clicked", lambda w,e: delete_effect_pressed(), None) widgets.toggle_all.connect("clicked", lambda w: toggle_all_pressed()) widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch(_hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 6, 8, 1, 0) # These are created elsewhere and then monkeypatched here widgets.group_combo = None widgets.effect_list_view = None widgets.clip_info.set_tooltip_text(_("Clip being edited")) widgets.effect_stack_view.set_tooltip_text(_("Clip Filter Stack")) widgets.add_effect_b.set_tooltip_text(_("Add Filter to Clip Filter Stack")) widgets.del_effect_b.set_tooltip_text(_("Delete Filter from Clip Filter Stack")) widgets.toggle_all.set_tooltip_text(_("Toggle all Filters On/Off"))
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) # 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")))) 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) 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)
def get_fade_panel(fade_data): type_combo_box = Gtk.ComboBoxText() type_combo_box.append_text(_("Fade In")) type_combo_box.append_text(_("Fade Out")) type_combo_box.set_active(0) type_row = get_two_column_box(Gtk.Label(label=_("Type:")), type_combo_box) color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(0,0,0,1)) color_button_box = guiutils.get_left_justified_box([color_button]) color_label = Gtk.Label(label=_("Color:")) color_row = get_two_column_box(color_label, color_button_box) length_entry = Gtk.Entry() fade_length = 30 if editorstate.fade_length > 0: # use last invocation length if available fade_length = editorstate.fade_length length_entry.set_text(str(fade_length)) length_row = get_two_column_box(Gtk.Label(label=_("Length:")), length_entry) # Encoding widgets encodings_cb = Gtk.ComboBoxText() for encoding in renderconsumer.encoding_options: encodings_cb.append_text(encoding.name) encodings_cb.set_active(0) quality_cb = Gtk.ComboBoxText() transition_widgets = (encodings_cb, quality_cb) encodings_cb.connect("changed", lambda w,e: _transition_encoding_changed(transition_widgets), None) _fill_transition_quality_combo_box(transition_widgets, 10) _set_saved_encoding(transition_widgets) # Build panel edit_vbox = Gtk.VBox(False, 2) edit_vbox.pack_start(type_row, False, False, 0) edit_vbox.pack_start(length_row, False, False, 0) edit_vbox.pack_start(color_row, False, False, 0) enconding_vbox = Gtk.VBox(False, 2) enconding_vbox.pack_start(encodings_cb, False, False, 0) enconding_vbox.pack_start(quality_cb, False, False, 0) vbox = Gtk.VBox(False, 2) vbox.pack_start(get_named_frame(_("Transition Options"), edit_vbox), True, True, 0) vbox.pack_start(get_named_frame(_("Encoding"), enconding_vbox), True, True, 0) alignment = guiutils.set_margins(vbox, 12, 24, 12, 12) return (alignment, type_combo_box, length_entry, encodings_cb, quality_cb, color_button)
def show_disk_management_dialog(): dialog = Gtk.Dialog(_("Disk Cache Manager"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Close").encode('utf-8'), Gtk.ResponseType.CLOSE)) global _panels _panels = _get_disk_dir_panels() pane = Gtk.VBox(True, 2) for panel in _panels: pane.pack_start(panel.vbox, True, True, 0) guiutils.set_margins(pane, 12, 24, 12, 12) dialog.connect('response', dialogutils.dialog_destroy) dialog.vbox.pack_start(pane, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.show_all() return dialog
def __init__(self): self.dialog = Gtk.Dialog(_("Creating Proxy Files"), gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Stop").encode('utf-8'), Gtk.ResponseType.REJECT)) self.render_progress_bar = Gtk.ProgressBar() self.render_progress_bar.set_text("0 %") prog_align = guiutils.set_margins(self.render_progress_bar, 0, 0, 6, 0) prog_align.set_size_request(550, 30) self.elapsed_value = Gtk.Label() self.current_render_value = Gtk.Label() self.items_value = Gtk.Label() est_label = guiutils.get_right_justified_box([guiutils.bold_label(_("Elapsed:"))]) current_label = guiutils.get_right_justified_box([guiutils.bold_label(_("Current Media File:"))]) items_label = guiutils.get_right_justified_box([guiutils.bold_label(_("Rendering Item:"))]) est_label.set_size_request(250, 20) current_label.set_size_request(250, 20) items_label.set_size_request(250, 20) info_vbox = Gtk.VBox(False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([est_label, self.elapsed_value]), False, False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([current_label, self.current_render_value]), False, False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([items_label, self.items_value]), False, False, 0) progress_vbox = Gtk.VBox(False, 2) progress_vbox.pack_start(info_vbox, False, False, 0) progress_vbox.pack_start(guiutils.get_pad_label(10, 8), False, False, 0) progress_vbox.pack_start(prog_align, False, False, 0) alignment = guiutils.set_margins(progress_vbox, 12, 12, 12, 12) alignment.show_all() self.dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(self.dialog.vbox) self.dialog.connect('response', self.stop_pressed) self.dialog.show()
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 get_named_frame(name, widget, left_padding=12, right_padding=6, right_out_padding=4): """ Gnome style named panel """ if name != None: label = guiutils.bold_label(name) label.set_justify(Gtk.Justification.LEFT) label_box = Gtk.HBox() label_box.pack_start(label, False, False, 0) label_box.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(widget, right_padding, 0, left_padding, 0) frame = Gtk.VBox() if name != None: frame.pack_start(label_box, False, False, 0) frame.pack_start(widget, True, True, 0) guiutils.set_margins(frame, 4, 4, 0, right_out_padding) return frame
def get_media_files_panel(media_list_view, add_cb, del_cb, col_changed_cb, hamburger_launch_pressed, filtering_cb): hamburger_launcher = guicomponents.HamburgerPressLaunch(hamburger_launch_pressed) guiutils.set_margins(hamburger_launcher.widget, 2, 0, 4, 12) columns_img = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "columns.png") columns_launcher = guicomponents.PressLaunch(col_changed_cb, columns_img, w=22, h=22) columns_launcher.surface_y = 6 columns_launcher.widget.set_tooltip_text(_("Number of Media File columns.")) all_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_all_files.png") audio_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_audio_files.png") graphics_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_graphics_files.png") video_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_video_files.png") imgseq_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_imgseq_files.png") pattern_pixbuf = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "show_pattern_producers.png") files_filter_launcher = guicomponents.ImageMenuLaunch(filtering_cb, [all_pixbuf, video_pixbuf, audio_pixbuf, graphics_pixbuf, imgseq_pixbuf, pattern_pixbuf], 24, 22) files_filter_launcher.surface_x = 3 files_filter_launcher.surface_y = 4 files_filter_launcher.widget.set_tooltip_text(_("Visible Media File types.")) gui.media_view_filter_selector = files_filter_launcher bin_info = guicomponents.BinInfoPanel() buttons_box = Gtk.HBox(False,1) buttons_box.pack_start(hamburger_launcher.widget, False, False, 0) buttons_box.pack_start(guiutils.get_pad_label(4, 4), False, False, 0) buttons_box.pack_start(columns_launcher.widget, False, False, 0) buttons_box.pack_start(files_filter_launcher.widget, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) buttons_box.pack_start(bin_info, False, False, 0) #buttons_box.pack_start(Gtk.Label(), True, True, 0) panel = Gtk.VBox() panel.pack_start(media_list_view, True, True, 0) panel.pack_start(buttons_box, False, True, 0) return (panel, bin_info)
def profiles_manager_dialog(): dialog = Gtk.Dialog(_("Profiles Manager"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Close Manager").encode('utf-8'), Gtk.ResponseType.CLOSE)) panel2, user_profiles_view = _get_user_profiles_panel() guiutils.set_margins(panel2, 12, 14, 12, 6) panel1 = _get_factory_profiles_panel(user_profiles_view) guiutils.set_margins(panel1, 12, 12, 12, 12) pane = Gtk.HBox(True, 2) pane.pack_start(panel1, True, True, 0) pane.pack_start(panel2, True, True, 0) pane.set_size_request(PROFILES_WIDTH * 2, PROFILES_HEIGHT) pane.show_all() dialog.connect('response', dialogutils.dialog_destroy) dialog.vbox.pack_start(pane, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.show_all() return dialog
def render_progress_dialog(callback, parent_window, frame_rates_match=True): dialog = Gtk.Dialog(_("Render Progress"), parent_window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT)) dialog.status_label = Gtk.Label() dialog.remaining_time_label = Gtk.Label() dialog.passed_time_label = Gtk.Label() dialog.progress_bar = Gtk.ProgressBar() status_box = Gtk.HBox(False, 2) status_box.pack_start(dialog.status_label,False, False, 0) status_box.pack_start(Gtk.Label(), True, True, 0) remaining_box = Gtk.HBox(False, 2) remaining_box.pack_start(dialog.remaining_time_label,False, False, 0) remaining_box.pack_start(Gtk.Label(), True, True, 0) passed_box = Gtk.HBox(False, 2) passed_box.pack_start(dialog.passed_time_label,False, False, 0) passed_box.pack_start(Gtk.Label(), True, True, 0) if frame_rates_match == False: warning_icon = Gtk.Image.new_from_stock(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.MENU) warning_text = Gtk.Label(label=_("Project and Render Profile FPS values are not same. Rendered file may have A/V sync issues.")) warning_box = Gtk.HBox(False, 2) warning_box.pack_start(warning_icon,False, False, 0) warning_box.pack_start(warning_text,False, False, 0) warning_box.pack_start(Gtk.Label(), True, True, 0) progress_vbox = Gtk.VBox(False, 2) progress_vbox.pack_start(status_box, False, False, 0) progress_vbox.pack_start(remaining_box, False, False, 0) progress_vbox.pack_start(passed_box, False, False, 0) if frame_rates_match == False: progress_vbox.pack_start(guiutils.get_pad_label(10, 10), False, False, 0) progress_vbox.pack_start(warning_box, False, False, 0) progress_vbox.pack_start(guiutils.get_pad_label(10, 10), False, False, 0) progress_vbox.pack_start(dialog.progress_bar, False, False, 0) alignment = guiutils.set_margins(progress_vbox, 12, 12, 12, 12) dialog.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialog.set_default_size(500, 125) alignment.show_all() dialog.connect('response', callback) dialog.show() return dialog
def __init__(self): # Window self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL) self.window.connect("delete-event", lambda w, e:_start_single_render_shutdown()) app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladesinglerendericon.png") self.window.set_icon(app_icon) self.est_time_left = Gtk.Label() self.current_render = Gtk.Label() self.current_render_time = Gtk.Label() est_r = guiutils.get_right_justified_box([guiutils.bold_label(_("Estimated Left:"))]) current_r = guiutils.get_right_justified_box([guiutils.bold_label(_("File:"))]) current_r_t = guiutils.get_right_justified_box([guiutils.bold_label(_("Elapsed:"))]) est_r.set_size_request(250, 20) current_r.set_size_request(250, 20) current_r_t.set_size_request(250, 20) info_vbox = Gtk.VBox(False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([current_r, self.current_render]), False, False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([current_r_t, self.current_render_time]), False, False, 0) info_vbox.pack_start(guiutils.get_left_justified_box([est_r, self.est_time_left]), False, False, 0) self.stop_render_button = Gtk.Button(_("Stop Render")) self.stop_render_button.connect("clicked", lambda w, e: _start_single_render_shutdown(), None) self.render_progress_bar = Gtk.ProgressBar() self.progress_label = Gtk.Label("0 %") button_row = Gtk.HBox(False, 0) button_row.pack_start(self.progress_label, False, False, 0) button_row.pack_start(Gtk.Label(), True, True, 0) button_row.pack_start(self.stop_render_button, False, False, 0) top_vbox = Gtk.VBox(False, 0) top_vbox.pack_start(info_vbox, False, False, 0) top_vbox.pack_start(guiutils.get_pad_label(12, 12), False, False, 0) top_vbox.pack_start(self.render_progress_bar, False, False, 0) top_vbox.pack_start(guiutils.get_pad_label(12, 12), False, False, 0) top_vbox.pack_start(button_row, False, False, 0) top_align = guiutils.set_margins(top_vbox, 12, 12, 12, 12) top_align.set_size_request(SINGLE_WINDOW_WIDTH, 20) # Set pane and show window self.window.add(top_align) self.window.set_title(_("Flowblade Timeline Render")) self.window.set_position(Gtk.WindowPosition.CENTER) self.window.show_all()
def preferences_dialog(): dialog = Gtk.Dialog(_("Editor Preferences"), None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel").encode('utf-8'), Gtk.ResponseType.REJECT, _("OK").encode('utf-8'), Gtk.ResponseType.ACCEPT)) gen_opts_panel, gen_opts_widgets = _general_options_panel(_thumbs_select_clicked, _renders_select_clicked) edit_prefs_panel, edit_prefs_widgets = _edit_prefs_panel() view_pres_panel, view_pref_widgets = _view_prefs_panel() notebook = Gtk.Notebook() notebook.set_size_request(PREFERENCES_WIDTH, PREFERENCES_HEIGHT) notebook.append_page(gen_opts_panel, Gtk.Label(label=_("General"))) notebook.append_page(edit_prefs_panel, Gtk.Label(label=_("Editing"))) notebook.append_page(view_pres_panel, Gtk.Label(label=_("View"))) guiutils.set_margins(notebook, 4, 24, 6, 0) dialog.connect('response', _preferences_dialog_callback, (gen_opts_widgets, edit_prefs_widgets, view_pref_widgets)) dialog.vbox.pack_start(notebook, True, True, 0) dialogutils.set_outer_margins(dialog.vbox) dialogutils.default_behaviour(dialog) dialog.show_all()
def get_master_meter(): _init_level_filters(False) global _master_volume_meter, _update_ticker _master_volume_meter = MasterVolumeMeter() if _update_ticker.running == False: _update_ticker.start_ticker() align = guiutils.set_margins(_master_volume_meter.widget, 3, 3, 3, 3) frame = Gtk.Frame() frame.add(align) frame.set_shadow_type(Gtk.ShadowType.ETCHED_OUT) return frame
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) # Script area self.program_label = Gtk.Label() self.program_event_box = Gtk.EventBox() self.program_event_box.add(self.program_label) self.program_event_box.connect("button-press-event", programs_menu_lauched) self.programs_menu = toolguicomponents.PressLaunch(programs_menu_lauched) programs_row = Gtk.HBox() programs_row.pack_start(self.programs_menu.widget, False, False, 0) programs_row.pack_start(self.program_event_box, False, False, 0) programs_row.pack_start(Gtk.Label(), True, True, 0) self.editors_box = Gtk.VBox(False, 2) self.editors_box.pack_start(Gtk.Label(), False, False, 0) self.editors_container = Gtk.VBox(False, 2) self.editors_container.pack_start(self.editors_box, False, False, 0) self.close_button = guiutils.get_sized_button(_("Close"), 150, 32) self.close_button.connect("clicked", lambda w: _shutdown()) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(self.close_button, False, False, 0) # Build window pane = Gtk.VBox(False, 2) pane.pack_start(programs_row, False, False, 0) pane.pack_start(self.editors_container, 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(_("Node Compositor Programs")) self.set_position(Gtk.WindowPosition.CENTER) self.show_all()
def get_render_folder_select_panel(current_folder_path): texts_panel = get_two_text_panel(_("Select folder for rendered clips."), _("Old rendered clips in this or other projects will") + _(" still be available,\nthis only affects rendered files that are created from now on.\n") + _("\nSetting your home folder as folder for rendered clips is not allowed.")) out_folder = Gtk.FileChooserButton("Select Folder") out_folder.set_action(Gtk.FileChooserAction.SELECT_FOLDER) if current_folder_path != None: out_folder.set_current_folder(current_folder_path) out_folder_align = guiutils.set_margins(out_folder, 12, 24, 12, 12) panel = Gtk.VBox() panel.pack_start(texts_panel, False, False, 0) panel.pack_start(out_folder_align, False, False, 0) return (panel, out_folder)
def get_re_render_all_panel(rerender_list, unrenderable): rerendercount_label = Gtk.Label(label=_("Transitions / Fades to be rerendered:")) rerendercount_value = Gtk.Label(label=str(len(rerender_list))) rerendercount_row = get_two_column_box(rerendercount_label, rerendercount_value) if unrenderable > 0: unrenderable_info = _("There are ") + str(unrenderable) + _(" Transitions / Fades that cannot be rerendered, either because they are\ncreated with Flowblade version <=1.14 or the source clips are no longer on timeline.") unrenderable_info_label = Gtk.Label(unrenderable_info) info_vbox = Gtk.VBox(False, 2) info_vbox.pack_start(rerendercount_row, False, False, 0) if unrenderable > 0: info_vbox.pack_start(guiutils.pad_label(12,12), False, False, 0) info_vbox.pack_start(unrenderable_info_label, False, False, 0) # Encoding widgets encodings_cb = Gtk.ComboBoxText() for encoding in renderconsumer.encoding_options: encodings_cb.append_text(encoding.name) encodings_cb.set_active(0) quality_cb = Gtk.ComboBoxText() transition_widgets = (encodings_cb, quality_cb) encodings_cb.connect("changed", lambda w,e: _transition_encoding_changed(transition_widgets), None) _fill_transition_quality_combo_box(transition_widgets, 10) _set_saved_encoding(transition_widgets) enconding_vbox = Gtk.VBox(False, 2) enconding_vbox.pack_start(encodings_cb, False, False, 0) enconding_vbox.pack_start(quality_cb, False, False, 0) vbox = Gtk.VBox(False, 2) vbox.pack_start(get_named_frame(_("Info"), info_vbox), True, True, 0) vbox.pack_start(get_named_frame(_("Encoding"), enconding_vbox), True, True, 0) alignment = guiutils.set_margins(vbox, 12, 24, 12, 12) alignment.set_size_request(450, 120) return (alignment, encodings_cb, quality_cb)
def set_outer_margins(cont): guiutils.set_margins(cont, 0, 6, 0, 6)
def change_animation(self): # ---------------- PROPERTY EDITING # We are using existing property edit code to create value editors. # We will need present a lot of dummy data and monkeypatch objects to make that # pipeline do our bidding for natron animations value editing. clip = None filter_index = -1 track = None clip_index = -1 editable_properties = propertyedit.get_filter_editable_properties(clip, _animation_instance, filter_index, track, clip_index, compositor_filter=False) self.editable_properties = editable_properties edit_panel = Gtk.VBox(False, 2) edit_panel.set_size_request(EDIT_PANEL_WIDTH, EDIT_PANEL_HEIGHT) guiutils.set_margins(edit_panel, 4, 4, 4, 4) if len(editable_properties) > 0: # Create editor row for each editable property for ep in editable_properties: # We are not interfacing with mlt objects or clip's filter arrays # and we need make functions accessing those no-ops. # We are only interested in saving value as string and then later interpreting # it somehow to use as input when modifying natron project. self.modify_editable_properties(ep) editor_row = propertyeditorbuilder.get_editor_row(ep) if editor_row == None: continue # Set keyframe editor widget to be updated for frame changes if such is created try: editor_type = ep.args[propertyeditorbuilder.EDITOR] except KeyError: editor_type = propertyeditorbuilder.SLIDER # this is the default value edit_panel.pack_start(editor_row, False, False, 0) if not hasattr(editor_row, "no_separator"): edit_panel.pack_start(guicomponents.EditorSeparator().widget, False, False, 0) edit_panel.pack_start(Gtk.Label(), True, True, 0) edit_panel.show_all() scroll_window = Gtk.ScrolledWindow() scroll_window.add_with_viewport(edit_panel) scroll_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll_window.show_all() if self.value_edit_box != None: self.value_edit_frame.remove(self.value_edit_box) self.value_edit_frame.add(scroll_window) self.value_edit_box = scroll_window # ---------------- GUI UPDATES global _current_preview_surface _current_preview_surface = None self.animation_label.set_text(_animation_instance.info.name) self.render_status_info.set_markup("<small>" + self.status_no_render + "</small>") self.pos_bar.update_display_from_producer(_animation_instance) # duck typing as mlt.Producer for pos bar, need data methods are in NatronAnimationInstance self.range_in.set_value(_animation_instance.range_in) self.range_out.set_value(_animation_instance.range_out) _animation_instance.current_frame = _animation_instance.range_in self.set_position(_animation_instance.range_in) self.preview_monitor.queue_draw()
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) #---- LEFT PANEL hamburger_launcher_surface = cairo.ImageSurface.create_from_png(respaths.IMAGE_PATH + "hamburger.png") self.hamburger_launcher = guicomponents.PressLaunch(_hamburger_launch_pressed, hamburger_launcher_surface) guiutils.set_margins(self.hamburger_launcher.widget, 0, 8, 0, 8) # Animation selector menu launcher row self.animation_label = Gtk.Label(_animation_instance.info.name) self.present_event_box = Gtk.EventBox() self.present_event_box.add(self.animation_label) self.present_event_box.connect("button-press-event", animations_menu_launched) self.script_menu = toolguicomponents.PressLaunch(animations_menu_launched) selector_row = Gtk.HBox(False, 2) selector_row.pack_start(self.hamburger_launcher.widget, False, False, 0) selector_row.pack_start(self.present_event_box, False, False, 0) selector_row.pack_start(self.script_menu.widget, False, False, 0) selector_row.set_margin_top(2) # Edit area self.value_edit_frame = Gtk.Frame() self.value_edit_frame.set_shadow_type(Gtk.ShadowType.IN) self.value_edit_frame.set_size_request(EDIT_PANEL_WIDTH+ 10, EDIT_PANEL_HEIGHT + 10) self.value_edit_box = None #---- RIGHT PANEL 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) preview_info_row.set_size_request(200, 10) # Monitor self.preview_monitor = cairoarea.CairoDrawableArea2(MONITOR_WIDTH, MONITOR_HEIGHT, self._draw_preview) # Position control panel 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.preview_button = Gtk.Button(_("Preview Frame")) self.preview_button.connect("clicked", lambda w: render_preview_frame()) control_panel = Gtk.HBox(False, 2) control_panel.pack_start(pos_bar_frame, True, True, 0) control_panel.pack_start(guiutils.pad_label(2, 2), False, False, 0) control_panel.pack_start(self.preview_button, False, False, 0) # Range setting in_label = Gtk.Label(_("Start:")) self.range_in = Gtk.SpinButton.new_with_range(1, 249, 1) out_label = Gtk.Label(_("End:")) self.range_out = Gtk.SpinButton.new_with_range(2, 250, 1) self.range_in.set_value(1) self.range_out.set_value(250) self.range_in.connect("value-changed", self.range_changed) self.range_out.connect("value-changed", self.range_changed) pos_label = Gtk.Label(_("Frame:")) self.pos_info = Gtk.Label(_("1")) range_row = Gtk.HBox(False, 2) range_row.pack_start(in_label, False, False, 0) range_row.pack_start(self.range_in, False, False, 0) range_row.pack_start(Gtk.Label(), True, True, 0) range_row.pack_start(pos_label, False, False, 0) range_row.pack_start(self.pos_info, False, False, 0) range_row.pack_start(Gtk.Label(), True, True, 0) range_row.pack_start(out_label, False, False, 0) range_row.pack_start(self.range_out, False, False, 0) range_row.set_margin_bottom(24) range_row.set_margin_left(5) # Render panel 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) format_label = Gtk.Label(_("Natron Render Format:")) self.format_selector = Gtk.ComboBoxText() # filled later when current sequence known for format_desc in NATRON_RENDER_FORMATS: self.format_selector.append_text(format_desc) self.format_selector.set_active(NATRON_DEFAULT_RENDER_FORMAT) format_select_row = Gtk.HBox(False, 2) format_select_row.pack_start(format_label, False, False, 0) format_select_row.pack_start(guiutils.pad_label(12, 2), False, False, 0) format_select_row.pack_start(self.format_selector, False, False, 0) format_select_row.set_margin_top(24) self.render_percentage = Gtk.Label("") self.status_no_render = _("Set 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(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(format_select_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) render_vbox.set_margin_left(8) # Bottomrow self.load_anim = Gtk.Button(_("Load Animation")) self.load_anim.connect("clicked", lambda w:load_script_dialog(_load_script_dialog_callback)) self.save_anim = Gtk.Button(_("Save Animation")) self.save_anim.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()) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(self.load_anim, False, False, 0) editor_buttons_row.pack_start(self.save_anim, 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 left_panel = Gtk.VBox(False, 2) left_panel.pack_start(selector_row, False, False, 0) left_panel.pack_start(self.value_edit_frame, True, True, 0) right_panel = Gtk.VBox(False, 0) right_panel.pack_start(preview_info_row, False, False, 0) right_panel.pack_start(self.preview_monitor, False, False, 0) right_panel.pack_start(control_panel, False, False, 0) right_panel.pack_start(range_row, False, False, 0) right_panel.pack_start(render_vbox, True, True, 0) right_panel.set_margin_left(4) sides_pane = Gtk.HBox(False, 2) sides_pane.pack_start(left_panel, False, False, 0) sides_pane.pack_start(right_panel, False, False, 0) pane = Gtk.VBox(False, 2) pane.pack_start(sides_pane, False, False, 0) pane.pack_start(editor_buttons_row, False, False, 0) align = guiutils.set_margins(pane, 2, 12, 12, 12) # Connect global key listener #self.connect("key-press-event", _global_key_down_listener) # Set pane and show window self.add(align) self.set_title(_("Natron Animations")) self.set_position(Gtk.WindowPosition.CENTER) #self.set_widgets_sensitive(False) self.show_all() self.set_resizable(False) #self.set_active_state(False) self.update_render_status_info() self.change_animation()
def __init__(self, kf_editor, property_editor_widgets_create_func, value_labels ): # kf_editor is keyframeeditor.RotoMaskKeyFrameEditor GObject.GObject.__init__(self) self.set_modal(True) self.set_transient_for(gui.editor_window.window) self.set_title(_("RotoMaskEditor")) self.connect("delete-event", lambda w, e: close_rotomask()) if editorstate.screen_size_small_height() == True: global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT TEXT_LAYER_LIST_HEIGHT = 150 TEXT_VIEW_HEIGHT = 180 VIEW_EDITOR_HEIGHT = 450 if editorstate.screen_size_small_height() == True: global VIEW_EDITOR_WIDTH VIEW_EDITOR_WIDTH = 680 editor_widgets = property_editor_widgets_create_func() self.block_updates = False self.kf_editor = kf_editor self.kf_editor.set_parent_editor(self) self.value_labels = value_labels self.view_editor = vieweditor.ViewEditor(PLAYER().profile, VIEW_EDITOR_WIDTH, VIEW_EDITOR_HEIGHT) self.view_editor.draw_safe_area = False self.tc_display = guicomponents.MonitorTCDisplay() self.tc_display.use_internal_frame = True self.tc_display.widget.set_valign(Gtk.Align.CENTER) kf_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "roto_kf_edit_mode.png") move_mode_img = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "roto_move_mode.png") self.kf_mode_button = Gtk.ToggleButton() self.kf_mode_button.set_image(kf_mode_img) self.kf_mode_button.set_active( True) # we start with vieweditorlayer.ROTO_POINT_MODE edit mode self.kf_mode_button.connect("clicked", self._kf_mode_clicked) self.move_mode_button = Gtk.ToggleButton() self.move_mode_button.set_image(move_mode_img) self.move_mode_button.connect("clicked", self._move_mode_clicked) self.scale_selector = vieweditor.ScaleSelector(self) self.view_editor.scale_select = self.scale_selector timeline_box = Gtk.HBox() timeline_box.pack_start(self.tc_display.widget, False, False, 0) timeline_box.pack_start(Gtk.Label(), True, True, 0) timeline_box.pack_start(self.kf_mode_button, False, False, 0) timeline_box.pack_start(self.move_mode_button, False, False, 0) timeline_box.pack_start(Gtk.Label(), True, True, 0) timeline_box.pack_start(self.scale_selector, False, False, 0) timeline_box.set_margin_top(6) timeline_box.set_margin_bottom(6) mask_type_label = Gtk.Label(_("Mask Type:")) mask_type_combo_box = Gtk.ComboBoxText() mask_type_combo_box.append_text(_("Curve Mask")) mask_type_combo_box.append_text(_("Line Mask")) mask_type_combo_box.set_active(0) mask_type_combo_box.connect("changed", self.mask_type_selection_changed) allow_adding_check = Gtk.CheckButton() allow_adding_check.set_active( False ) # This shows value of self.roto_mask_layer.allow_adding_points, False is default allow_adding_check.connect("toggled", self.allow_adding_toggled) allow_adding_label = Gtk.Label( _("Allow to add points to closed masks")) save_rotodata_b = guiutils.get_sized_button(_("Close Tool"), 150, 32) save_rotodata_b.connect("clicked", lambda w: self._save_rotodata_pressed()) prop_editor_row1 = Gtk.HBox() prop_editor_row1.pack_start(Gtk.Label(), True, True, 0) prop_editor_row1.pack_start(mask_type_label, False, False, 0) prop_editor_row1.pack_start(guiutils.pad_label(4, 4), False, False, 0) prop_editor_row1.pack_start(mask_type_combo_box, False, False, 0) prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0) prop_editor_row1.pack_start(editor_widgets[0], False, False, 0) prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0) prop_editor_row1.pack_start(editor_widgets[3], False, False, 0) prop_editor_row1.pack_start(guiutils.pad_label(24, 20), False, False, 0) prop_editor_row1.pack_start(editor_widgets[4], False, False, 0) prop_editor_row1.pack_start(Gtk.Label(), True, True, 0) prop_editor_row2 = Gtk.HBox() prop_editor_row2.pack_start(Gtk.Label(), True, True, 0) prop_editor_row2.pack_start(editor_widgets[1], False, False, 0) prop_editor_row2.pack_start(guiutils.pad_label(24, 20), False, False, 0) prop_editor_row2.pack_start(editor_widgets[2], False, False, 0) prop_editor_row2.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(allow_adding_check, False, False, 0) editor_buttons_row.pack_start(guiutils.pad_label(4, 2), False, False, 0) editor_buttons_row.pack_start(allow_adding_label, False, False, 0) editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(save_rotodata_b, False, False, 0) editor_panel = Gtk.VBox() editor_panel.pack_start(self.view_editor, True, True, 0) editor_panel.pack_start(timeline_box, False, False, 0) editor_panel.pack_start(kf_editor, False, False, 0) editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0) editor_panel.pack_start(prop_editor_row1, False, False, 0) editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0) editor_panel.pack_start(prop_editor_row2, False, False, 0) editor_panel.pack_start(guiutils.pad_label(2, 12), False, False, 0) editor_panel.pack_start(editor_buttons_row, False, False, 0) editor_row = Gtk.HBox() editor_row.pack_start(editor_panel, True, True, 0) alignment = guiutils.set_margins(editor_row, 8, 8, 8, 8) self.add(alignment) self.view_editor.clear_layers() # NOTE: we start with vieweditorlayer.ROTO_POINT_MODE edit mode, see __init()__ self.roto_mask_layer = vieweditorlayer.RotoMaskEditLayer( self.view_editor, self.kf_editor.clip_editor, kf_editor.editable_property, self) self.view_editor.add_layer(self.roto_mask_layer) self.view_editor.activate_layer(0) self.show_all() self.kf_editor.active_keyframe_changed() self.connect("size-allocate", lambda w, e: self.window_resized()) self.connect("window-state-event", lambda w, e: self.window_resized()) self.connect("key-press-event", self.key_down) self.window_resized()
def __init__(self, callback, clip, container_action, program_info_json): GObject.GObject.__init__(self) self.connect("delete-event", lambda w, e: self.cancel()) self.callback = callback self.clip = clip self.container_action = container_action self.orig_program_info_json = copy.deepcopy(program_info_json) self.preview_frame = -1 # -1 used as flag that no preview renders ongoing and new one can be started # Create panels for objects editors = [] blender_objects = program_info_json["objects"] materials = program_info_json["materials"] curves = program_info_json["curves"] self.editors = editors objs_panel = _get_panel_and_create_editors(blender_objects, _("Objects"), editors) materials_panel = _get_panel_and_create_editors( materials, _("Materials"), editors) curves_panel = _get_panel_and_create_editors(curves, _("Curves"), editors) pane = Gtk.VBox(False, 2) if objs_panel != None: pane.pack_start(objs_panel, False, False, 0) if materials_panel != None: pane.pack_start(materials_panel, False, False, 0) if curves_panel != None: pane.pack_start(curves_panel, False, False, 0) # Put in scrollpane if too many editors for screensize. n_editors = len(editors) add_scroll = False if editorstate.screen_size_small_height() == True and n_editors > 4: add_scroll = True h = 500 elif editorstate.screen_size_small_height( ) == True and editorstate.screen_size_large_height( ) == False and n_editors > 5: add_scroll = True h = 600 elif editorstate.screen_size_large_height() == True and n_editors > 6: add_scroll = True h = 700 if add_scroll == True: sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) sw.add(pane) sw.set_size_request(400, h) if add_scroll == True: editors_panel = sw else: editors_panel = pane cancel_b = guiutils.get_sized_button(_("Cancel"), 150, 32) cancel_b.connect("clicked", lambda w: self.cancel()) save_b = guiutils.get_sized_button(_("Save Changes"), 150, 32) save_b.connect("clicked", lambda w: self.save()) buttons_box = Gtk.HBox(False, 2) buttons_box.pack_start(Gtk.Label(), True, True, 0) buttons_box.pack_start(cancel_b, False, False, 0) buttons_box.pack_start(save_b, False, False, 0) self.preview_panel = PreviewPanel(self, clip) preview_box = Gtk.VBox(False, 2) preview_box.pack_start(self.preview_panel, True, True, 0) preview_box.pack_start(guiutils.pad_label(2, 24), False, False, 0) preview_box.pack_start(buttons_box, False, False, 0) main_box = Gtk.HBox(False, 2) main_box.pack_start( guiutils.get_named_frame(_("Editors"), editors_panel), False, False, 0) main_box.pack_start( guiutils.get_named_frame(_("Preview"), preview_box), False, False, 0) alignment = guiutils.set_margins( main_box, 8, 8, 8, 8) #dialogutils.get_default_alignment(main_box) self.set_modal(True) self.set_transient_for(gui.editor_window.window) self.set_position(Gtk.WindowPosition.CENTER) self.set_title( _("Blender Project Edit - ") + self.container_action.container_data.get_program_name() + ".blend") self.set_resizable(False) self.add(alignment) self.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 run(self): Gdk.threads_enter() updater.set_info_icon(Gtk.STOCK_OPEN) dialog = dialogs.load_dialog() persistance.load_dialog = dialog Gdk.threads_leave() ticker = utils.Ticker(_load_pulse_bar, 0.15) ticker.start_ticker() old_project = editorstate.project try: editorstate.project_is_loading = True project = persistance.load_project(self.filename) sequence.set_track_counts(project) editorstate.project_is_loading = False except persistance.FileProducerNotFoundError as e: print "did not find file:", e self._error_stop(dialog, ticker) Gdk.threads_enter() primary_txt = _("Media asset was missing!") secondary_txt = _("Path of missing asset:") + "\n <b>" + e.value + "</b>\n\n" + \ _("Relative search for replacement file in sub folders of project file failed.") + "\n\n" + \ _("To load the project you will need to either:") + "\n" + \ u"\u2022" + " " + _("Open project in 'Media Relinker' tool to relink media assets to new files, or") + "\n" + \ u"\u2022" + " " + _("Place a file with the same exact name and path on the hard drive") open_label = Gtk.Label(_("Open project in Media Relinker tool")) self.open_check = Gtk.CheckButton() self.open_check.set_active(True) check_row = Gtk.HBox(False, 1) check_row.pack_start(Gtk.Label(), True, True, 0) check_row.pack_start(self.open_check, False, False, 0) check_row.pack_start(open_label, False, False, 0) guiutils.set_margins(check_row, 24, 0, 0, 0) panels = [check_row] dialogutils.warning_message_with_panels( primary_txt, secondary_txt, gui.editor_window.window, False, self._missing_file_dialog_callback, panels) editorstate.project = old_project # persistance.load_project() changes this, # we simply change it back as no GUI or other state is yet changed Gdk.threads_leave() return except persistance.ProjectProfileNotFoundError as e: self._error_stop(dialog, ticker) primary_txt = _("Profile with Description: '") + e.value + _( "' was not found on load!") secondary_txt = _("It is possible to load the project by creating a User Profile with exactly the same Description\nas the missing profile. ") + "\n\n" + \ _("User Profiles can be created by selecting 'Edit->Profiles Manager'.") dialogutils.warning_message(primary_txt, secondary_txt, None, is_info=False) editorstate.project = old_project # persistance.load_project() changes this, # we simply change it back as no GUI or other state is yet changed return Gdk.threads_enter() dialog.info.set_text(_("Opening")) Gdk.threads_leave() time.sleep(0.3) Gdk.threads_enter() app.open_project(project) if self.block_recent_files: # naming flipped ???? editorpersistance.add_recent_project_path(self.filename) editorpersistance.fill_recents_menu_widget( gui.editor_window.uimanager.get_widget( '/MenuBar/FileMenu/OpenRecent'), open_recent_project) Gdk.threads_leave() Gdk.threads_enter() updater.set_info_icon(None) dialog.destroy() Gdk.threads_leave() ticker.stop_ticker()
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 __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_button = Gtk.Button(_("Load Project For Relinking")) load_button.connect("clicked", lambda w: self.load_button_clicked()) project_row = Gtk.HBox(False, 2) project_row.pack_start(load_button, False, False, 0) project_row.pack_start(Gtk.Label(), True, True, 0) self.missing_label = guiutils.bold_label("<b>" + _("Original Media Missing:") + "</b> ") self.found_label = guiutils.bold_label("<b>" + _("Original Media Found:") + "</b> ") self.missing_count = Gtk.Label() self.found_count = Gtk.Label() self.proj = guiutils.bold_label("<b>" + _("Project:") + "</b> ") self.project_label = Gtk.Label(label=_("<not loaded>")) missing_info = guiutils.get_left_justified_box( [self.missing_label, guiutils.pad_label(2, 2), self.missing_count]) missing_info.set_size_request(250, 2) found_info = guiutils.get_left_justified_box( [self.found_label, guiutils.pad_label(2, 2), self.found_count]) status_row = Gtk.HBox(False, 2) status_row.pack_start(missing_info, False, False, 0) status_row.pack_start(found_info, False, False, 0) status_row.pack_start(Gtk.Label(), True, True, 0) status_row.pack_start(guiutils.pad_label(30, 12), False, False, 0) status_row.pack_start(self.proj, False, False, 0) status_row.pack_start(guiutils.pad_label(4, 12), False, False, 0) status_row.pack_start(self.project_label, False, False, 0) self.relink_list = MediaRelinkListView() self.find_button = Gtk.Button(_("Set File Relink Path")) self.find_button.connect("clicked", lambda w: _set_button_pressed()) self.delete_button = Gtk.Button(_("Delete File Relink Path")) self.delete_button.connect("clicked", lambda w: _delete_button_pressed()) self.display_combo = Gtk.ComboBoxText() self.display_combo.append_text(_("Display Missing Media Files")) self.display_combo.append_text(_("Display Found Media Files")) self.display_combo.set_active(0) self.display_combo.connect("changed", self.display_list_changed) buttons_row = Gtk.HBox(False, 2) buttons_row.pack_start(self.display_combo, False, False, 0) buttons_row.pack_start(Gtk.Label(), True, True, 0) buttons_row.pack_start(self.delete_button, False, False, 0) buttons_row.pack_start(guiutils.pad_label(4, 4), False, False, 0) buttons_row.pack_start(self.find_button, False, False, 0) self.save_button = Gtk.Button(_("Save Relinked Project As...")) self.save_button.connect("clicked", lambda w: _save_project_pressed()) cancel_button = Gtk.Button(_("Close")) cancel_button.connect("clicked", lambda w: _shutdown()) dialog_buttons_box = Gtk.HBox(True, 2) dialog_buttons_box.pack_start(cancel_button, True, True, 0) dialog_buttons_box.pack_start(self.save_button, False, False, 0) dialog_buttons_row = Gtk.HBox(False, 2) dialog_buttons_row.pack_start(Gtk.Label(), True, True, 0) dialog_buttons_row.pack_start(dialog_buttons_box, False, False, 0) pane = Gtk.VBox(False, 2) pane.pack_start(project_row, False, False, 0) pane.pack_start(guiutils.pad_label(24, 24), False, False, 0) pane.pack_start(status_row, False, False, 0) pane.pack_start(guiutils.pad_label(24, 2), False, False, 0) pane.pack_start(self.relink_list, False, False, 0) pane.pack_start(buttons_row, False, False, 0) pane.pack_start(guiutils.pad_label(24, 24), False, False, 0) pane.pack_start(dialog_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(_("Media Relinker")) self.set_position(Gtk.WindowPosition.CENTER) self.show_all() self.set_resizable(False) self.set_active_state()
def __init__(self): GObject.GObject.__init__(self) # Datamodel: icon, text, text self.storemodel = Gtk.ListStore(GdkPixbuf.Pixbuf, str, str, str, str, str) # Scroll container self.scroll = Gtk.ScrolledWindow() self.scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.scroll.set_shadow_type(Gtk.ShadowType.ETCHED_IN) # View self.treeview = Gtk.TreeView(self.storemodel) self.treeview.set_property("rules_hint", True) self.treeview.set_headers_visible(True) tree_sel = self.treeview.get_selection() tree_sel.set_mode(Gtk.SelectionMode.MULTIPLE) self.treeview.connect("button-press-event", log_list_view_button_press) self.treeview.connect("row-activated", display_log_clip_double_click_listener) # Column views self.icon_col_1 = Gtk.TreeViewColumn("icon1") self.icon_col_1.set_title(_("Star")) self.text_col_1 = Gtk.TreeViewColumn("text1") self.text_col_1.set_title(_("Event")) self.text_col_2 = Gtk.TreeViewColumn("text2") self.text_col_2.set_title(_("Comment")) self.text_col_3 = Gtk.TreeViewColumn("text3") self.text_col_3.set_title(_("File Name")) self.text_col_4 = Gtk.TreeViewColumn("text4") self.text_col_4.set_title(_("Mark In")) self.text_col_5 = Gtk.TreeViewColumn("text5") self.text_col_5.set_title(_("Mark Out")) self.text_col_6 = Gtk.TreeViewColumn("text6") self.text_col_6.set_title(_("Date")) # Cell renderers self.icon_rend_1 = Gtk.CellRendererPixbuf() self.icon_rend_1.props.xpad = 6 self.text_rend_1 = Gtk.CellRendererText() self.text_rend_1.set_property("ellipsize", Pango.EllipsizeMode.END) self.text_rend_2 = Gtk.CellRendererText() self.text_rend_2.set_property("yalign", 0.0) self.text_rend_2.set_property("editable", True) self.text_rend_2.connect("edited", log_item_name_edited, (self.storemodel, 2)) self.text_rend_3 = Gtk.CellRendererText() self.text_rend_3.set_property("yalign", 0.0) self.text_rend_4 = Gtk.CellRendererText() self.text_rend_4.set_property("yalign", 0.0) self.text_rend_5 = Gtk.CellRendererText() self.text_rend_5.set_property("yalign", 0.0) self.text_rend_6 = Gtk.CellRendererText() self.text_rend_6.set_property("yalign", 0.0) # Build column views self.icon_col_1.set_expand(False) self.icon_col_1.set_spacing(5) self.text_col_1.set_min_width(20) self.icon_col_1.pack_start(self.icon_rend_1, False) self.icon_col_1.add_attribute(self.icon_rend_1, 'pixbuf', 0) self.text_col_2.set_expand(True) self.text_col_2.set_sizing(Gtk.TreeViewColumnSizing.GROW_ONLY) self.text_col_2.set_min_width(150) self.text_col_2.pack_start(self.text_rend_2, True) self.text_col_2.add_attribute(self.text_rend_2, "text", 1) self.text_col_3.set_expand(True) self.text_col_3.pack_start(self.text_rend_3, True) self.text_col_3.add_attribute(self.text_rend_3, "text", 2) self.text_col_4.set_expand(True) self.text_col_4.pack_start(self.text_rend_4, True) self.text_col_4.add_attribute(self.text_rend_4, "text", 3) self.text_col_5.set_expand(True) self.text_col_5.pack_start(self.text_rend_5, True) self.text_col_5.add_attribute(self.text_rend_5, "text", 4) self.text_col_6.set_expand(True) self.text_col_6.pack_start(self.text_rend_6, True) self.text_col_6.add_attribute(self.text_rend_6, "text", 5) # Add column views to view self.treeview.append_column(self.icon_col_1) self.treeview.append_column(self.text_col_2) self.treeview.append_column(self.text_col_3) self.treeview.append_column(self.text_col_4) self.treeview.append_column(self.text_col_5) self.treeview.append_column(self.text_col_6) # Build widget graph and display self.scroll.add(self.treeview) self.pack_start(self.scroll, True, True, 0) guiutils.set_margins(self, 6, 6, 0, 0) self.scroll.show_all()
def __init__(self): GObject.GObject.__init__(self) self.set_title(_("Titler")) self.connect("delete-event", lambda w, e:close_titler()) if editorstate.screen_size_small_height() == True: global TEXT_LAYER_LIST_HEIGHT, TEXT_VIEW_HEIGHT, VIEW_EDITOR_HEIGHT TEXT_LAYER_LIST_HEIGHT = 150 TEXT_VIEW_HEIGHT = 180 VIEW_EDITOR_HEIGHT = 450 if editorstate.screen_size_small_height() == True: global VIEW_EDITOR_WIDTH VIEW_EDITOR_WIDTH = 680 self.block_updates = False self.view_editor = vieweditor.ViewEditor(PLAYER().profile, VIEW_EDITOR_WIDTH, VIEW_EDITOR_HEIGHT) self.view_editor.active_layer_changed_listener = self.active_layer_changed self.guides_toggle = vieweditor.GuidesViewToggle(self.view_editor) add_b = Gtk.Button(_("Add")) del_b = Gtk.Button(_("Delete")) add_b.connect("clicked", lambda w:self._add_layer_pressed()) del_b.connect("clicked", lambda w:self._del_layer_pressed()) add_del_box = Gtk.HBox() add_del_box = Gtk.HBox(True,1) add_del_box.pack_start(add_b, True, True, 0) add_del_box.pack_start(del_b, True, True, 0) center_h_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "center_horizontal.png") center_v_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "center_vertical.png") center_h = Gtk.Button() center_h.set_image(center_h_icon) center_h.connect("clicked", lambda w:self._center_h_pressed()) center_v = Gtk.Button() center_v.set_image(center_v_icon) center_v.connect("clicked", lambda w:self._center_v_pressed()) self.layer_list = TextLayerListView(self._layer_selection_changed, self._layer_visibility_toggled) self.layer_list.set_size_request(TEXT_LAYER_LIST_WIDTH, TEXT_LAYER_LIST_HEIGHT) self.text_view = Gtk.TextView() self.text_view.set_pixels_above_lines(2) self.text_view.set_left_margin(2) self.text_view.get_buffer().connect("changed", self._text_changed) self.sw = Gtk.ScrolledWindow() self.sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS) self.sw.add(self.text_view) self.sw.set_size_request(TEXT_VIEW_WIDTH, TEXT_VIEW_HEIGHT) scroll_frame = Gtk.Frame() scroll_frame.add(self.sw) self.tc_display = guicomponents.MonitorTCDisplay() self.tc_display.use_internal_frame = True self.tc_display.widget.set_valign(Gtk.Align.CENTER) self.pos_bar = positionbar.PositionBar() self.pos_bar.set_listener(self.position_listener) self.pos_bar.update_display_from_producer(PLAYER().producer) self.pos_bar.mouse_release_listener = self.pos_bar_mouse_released 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_valign(Gtk.Align.CENTER) font_map = PangoCairo.font_map_get_default() unsorted_families = font_map.list_families() if len(unsorted_families) == 0: print "No font families found in system! Titler will not work." self.font_families = sorted(unsorted_families, key=lambda family: family.get_name()) self.font_family_indexes_for_name = {} combo = Gtk.ComboBoxText() indx = 0 for family in self.font_families: combo.append_text(family.get_name()) self.font_family_indexes_for_name[family.get_name()] = indx indx += 1 combo.set_active(0) self.font_select = combo self.font_select.connect("changed", self._edit_value_changed) adj = Gtk.Adjustment(float(DEFAULT_FONT_SIZE), float(1), float(300), float(1)) self.size_spin = Gtk.SpinButton() self.size_spin.set_adjustment(adj) self.size_spin.connect("changed", self._edit_value_changed) self.size_spin.connect("key-press-event", self._key_pressed_on_widget) font_main_row = Gtk.HBox() font_main_row.pack_start(self.font_select, True, True, 0) font_main_row.pack_start(guiutils.pad_label(5, 5), False, False, 0) font_main_row.pack_start(self.size_spin, False, False, 0) self.bold_font = Gtk.ToggleButton() self.italic_font = Gtk.ToggleButton() bold_icon = Gtk.Image.new_from_stock(Gtk.STOCK_BOLD, Gtk.IconSize.BUTTON) italic_icon = Gtk.Image.new_from_stock(Gtk.STOCK_ITALIC, Gtk.IconSize.BUTTON) self.bold_font.set_image(bold_icon) self.italic_font.set_image(italic_icon) self.bold_font.connect("clicked", self._edit_value_changed) self.italic_font.connect("clicked", self._edit_value_changed) self.left_align = Gtk.RadioButton(None) self.center_align = Gtk.RadioButton.new_from_widget(self.left_align) self.right_align = Gtk.RadioButton.new_from_widget(self.left_align) left_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_LEFT, Gtk.IconSize.BUTTON) center_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_CENTER, Gtk.IconSize.BUTTON) right_icon = Gtk.Image.new_from_stock(Gtk.STOCK_JUSTIFY_RIGHT, Gtk.IconSize.BUTTON) self.left_align.set_image(left_icon) self.center_align.set_image(center_icon) self.right_align.set_image(right_icon) self.left_align.set_mode(False) self.center_align.set_mode(False) self.right_align.set_mode(False) self.left_align.connect("clicked", self._edit_value_changed) self.center_align.connect("clicked", self._edit_value_changed) self.right_align.connect("clicked", self._edit_value_changed) self.color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(red=1.0, green=1.0, blue=1.0, alpha=1.0)) self.color_button.connect("color-set", self._edit_value_changed) self.fill_on = Gtk.CheckButton() self.fill_on.set_active(True) self.fill_on.connect("toggled", self._edit_value_changed) buttons_box = Gtk.HBox() buttons_box.pack_start(Gtk.Label(), True, True, 0) buttons_box.pack_start(self.bold_font, False, False, 0) buttons_box.pack_start(self.italic_font, False, False, 0) buttons_box.pack_start(guiutils.pad_label(5, 5), False, False, 0) buttons_box.pack_start(self.left_align, False, False, 0) buttons_box.pack_start(self.center_align, False, False, 0) buttons_box.pack_start(self.right_align, False, False, 0) buttons_box.pack_start(guiutils.pad_label(15, 5), False, False, 0) buttons_box.pack_start(self.color_button, False, False, 0) buttons_box.pack_start(guiutils.pad_label(2, 1), False, False, 0) buttons_box.pack_start(self.fill_on, False, False, 0) buttons_box.pack_start(Gtk.Label(), True, True, 0) outline_label = Gtk.Label(_("<b>Outline</b>")) outline_label.set_use_markup(True) outline_size = Gtk.Label(_("Size:")) self.out_line_color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(red=0.3, green=0.3, blue=0.3, alpha=1.0)) self.out_line_color_button.connect("color-set", self._edit_value_changed) adj2 = Gtk.Adjustment(float(3), float(1), float(50), float(1)) self.out_line_size_spin = Gtk.SpinButton() self.out_line_size_spin.set_adjustment(adj2) self.out_line_size_spin.connect("changed", self._edit_value_changed) self.out_line_size_spin.connect("key-press-event", self._key_pressed_on_widget) self.outline_on = Gtk.CheckButton() self.outline_on.set_active(False) self.outline_on.connect("toggled", self._edit_value_changed) outline_box = Gtk.HBox() outline_box.pack_start(outline_label, False, False, 0) outline_box.pack_start(guiutils.pad_label(15, 1), False, False, 0) outline_box.pack_start(outline_size, False, False, 0) outline_box.pack_start(guiutils.pad_label(2, 1), False, False, 0) outline_box.pack_start(self.out_line_size_spin, False, False, 0) outline_box.pack_start(guiutils.pad_label(15, 1), False, False, 0) outline_box.pack_start(self.out_line_color_button, False, False, 0) outline_box.pack_start(guiutils.pad_label(2, 1), False, False, 0) outline_box.pack_start(self.outline_on, False, False, 0) outline_box.pack_start(Gtk.Label(), True, True, 0) shadow_label = Gtk.Label(_("<b>Shadow</b>")) shadow_label.set_use_markup(True) shadow_opacity_label = Gtk.Label(_("Opacity:")) shadow_xoff = Gtk.Label(_("X Off:")) shadow_yoff = Gtk.Label(_("Y Off:")) self.shadow_opa_spin = Gtk.SpinButton() adj3 = Gtk.Adjustment(float(100), float(1), float(100), float(1)) self.shadow_opa_spin.set_adjustment(adj3) self.shadow_opa_spin.connect("changed", self._edit_value_changed) self.shadow_opa_spin.connect("key-press-event", self._key_pressed_on_widget) self.shadow_xoff_spin = Gtk.SpinButton() adj4 = Gtk.Adjustment(float(3), float(1), float(100), float(1)) self.shadow_xoff_spin.set_adjustment(adj4) self.shadow_xoff_spin.connect("changed", self._edit_value_changed) self.shadow_xoff_spin.connect("key-press-event", self._key_pressed_on_widget) self.shadow_yoff_spin = Gtk.SpinButton() adj5 = Gtk.Adjustment(float(3), float(1), float(100), float(1)) self.shadow_yoff_spin.set_adjustment(adj5) self.shadow_yoff_spin.connect("changed", self._edit_value_changed) self.shadow_yoff_spin.connect("key-press-event", self._key_pressed_on_widget) self.shadow_on = Gtk.CheckButton() self.shadow_on.set_active(False) self.shadow_on.connect("toggled", self._edit_value_changed) self.shadow_color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(red=0.3, green=0.3, blue=0.3, alpha=1.0)) self.shadow_color_button.connect("color-set", self._edit_value_changed) shadow_box_1 = Gtk.HBox() shadow_box_1.pack_start(shadow_label, False, False, 0) shadow_box_1.pack_start(guiutils.pad_label(15, 1), False, False, 0) shadow_box_1.pack_start(shadow_opacity_label, False, False, 0) shadow_box_1.pack_start(self.shadow_opa_spin, False, False, 0) shadow_box_1.pack_start(guiutils.pad_label(15, 1), False, False, 0) shadow_box_1.pack_start(self.shadow_color_button, False, False, 0) shadow_box_1.pack_start(guiutils.pad_label(2, 1), False, False, 0) shadow_box_1.pack_start(self.shadow_on, False, False, 0) shadow_box_1.pack_start(Gtk.Label(), True, True, 0) shadow_box_2 = Gtk.HBox() shadow_box_2.pack_start(shadow_xoff, False, False, 0) shadow_box_2.pack_start(self.shadow_xoff_spin, False, False, 0) shadow_box_2.pack_start(guiutils.pad_label(15, 1), False, False, 0) shadow_box_2.pack_start(shadow_yoff, False, False, 0) shadow_box_2.pack_start(self.shadow_yoff_spin, False, False, 0) shadow_box_2.pack_start(Gtk.Label(), True, True, 0) load_layers = Gtk.Button(_("Load Layers")) load_layers.connect("clicked", lambda w:self._load_layers_pressed()) save_layers = Gtk.Button(_("Save Layers")) save_layers.connect("clicked", lambda w:self._save_layers_pressed()) clear_layers = Gtk.Button(_("Clear All")) clear_layers.connect("clicked", lambda w:self._clear_layers_pressed()) layers_save_buttons_row = Gtk.HBox() layers_save_buttons_row.pack_start(save_layers, False, False, 0) layers_save_buttons_row.pack_start(load_layers, False, False, 0) layers_save_buttons_row.pack_start(Gtk.Label(), True, True, 0) adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1)) self.x_pos_spin = Gtk.SpinButton() self.x_pos_spin.set_adjustment(adj) self.x_pos_spin.connect("changed", self._position_value_changed) self.x_pos_spin.connect("key-press-event", self._key_pressed_on_widget) adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1)) self.y_pos_spin = Gtk.SpinButton() self.y_pos_spin.set_adjustment(adj) self.y_pos_spin.connect("changed", self._position_value_changed) self.y_pos_spin.connect("key-press-event", self._key_pressed_on_widget) adj = Gtk.Adjustment(float(0), float(0), float(3000), float(1)) self.rotation_spin = Gtk.SpinButton() self.rotation_spin.set_adjustment(adj) self.rotation_spin.connect("changed", self._position_value_changed) self.rotation_spin.connect("key-press-event", self._key_pressed_on_widget) undo_pos = Gtk.Button() undo_icon = Gtk.Image.new_from_stock(Gtk.STOCK_UNDO, Gtk.IconSize.BUTTON) undo_pos.set_image(undo_icon) next_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "next_frame_s.png") prev_icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "prev_frame_s.png") prev_frame = Gtk.Button() prev_frame.set_image(prev_icon) prev_frame.connect("clicked", lambda w:self._prev_frame_pressed()) next_frame = Gtk.Button() next_frame.set_image(next_icon) next_frame.connect("clicked", lambda w:self._next_frame_pressed()) self.scale_selector = vieweditor.ScaleSelector(self) timeline_box = Gtk.HBox() timeline_box.pack_start(self.tc_display.widget, False, False, 0) timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0) timeline_box.pack_start(pos_bar_frame, True, True, 0) timeline_box.pack_start(guiutils.pad_label(12, 12), False, False, 0) timeline_box.pack_start(prev_frame, False, False, 0) timeline_box.pack_start(next_frame, False, False, 0) timeline_box.pack_start(self.guides_toggle, False, False, 0) timeline_box.pack_start(self.scale_selector, False, False, 0) timeline_box.set_margin_top(6) timeline_box.set_margin_bottom(6) positions_box = Gtk.HBox() positions_box.pack_start(Gtk.Label(), True, True, 0) positions_box.pack_start(Gtk.Label(label="X:"), False, False, 0) positions_box.pack_start(self.x_pos_spin, False, False, 0) positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0) positions_box.pack_start(Gtk.Label(label="Y:"), False, False, 0) positions_box.pack_start(self.y_pos_spin, False, False, 0) #positions_box.pack_start(Gtk.Label(label=_("Angle")), False, False, 0) #positions_box.pack_start(self.rotation_spin, False, False, 0) positions_box.pack_start(guiutils.pad_label(40, 5), False, False, 0) positions_box.pack_start(center_h, False, False, 0) positions_box.pack_start(center_v, False, False, 0) positions_box.pack_start(Gtk.Label(), True, True, 0) controls_panel_1 = Gtk.VBox() controls_panel_1.pack_start(add_del_box, False, False, 0) controls_panel_1.pack_start(self.layer_list, False, False, 0) controls_panel_1.pack_start(layers_save_buttons_row, False, False, 0) controls_panel_2 = Gtk.VBox() controls_panel_2.pack_start(scroll_frame, True, True, 0) controls_panel_2.pack_start(font_main_row, False, False, 0) controls_panel_2.pack_start(buttons_box, False, False, 0) controls_panel_2.pack_start(guiutils.pad_label(40, 1), False, False, 0) controls_panel_2.pack_start(outline_box, False, False, 0) controls_panel_2.pack_start(guiutils.pad_label(40, 1), False, False, 0) controls_panel_2.pack_start(shadow_box_1, False, False, 0) controls_panel_2.pack_start(shadow_box_2, False, False, 0) controls_panel = Gtk.VBox() controls_panel.pack_start(guiutils.get_named_frame(_("Active Layer"),controls_panel_2), True, True, 0) controls_panel.pack_start(guiutils.get_named_frame(_("Layers"),controls_panel_1), False, False, 0) view_editor_editor_buttons_row = Gtk.HBox() view_editor_editor_buttons_row.pack_start(positions_box, False, False, 0) view_editor_editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) keep_label = Gtk.Label(label=_("Keep Layers When Closed")) self.keep_layers_check = Gtk.CheckButton() self.keep_layers_check.set_active(_keep_titler_data) self.keep_layers_check.connect("toggled", self._keep_layers_toggled) open_label = Gtk.Label(label=_("Open Saved Title In Bin")) self.open_in_current_check = Gtk.CheckButton() self.open_in_current_check.set_active(_open_saved_in_bin) self.open_in_current_check.connect("toggled", self._open_saved_in_bin) exit_b = guiutils.get_sized_button(_("Close"), 150, 32) exit_b.connect("clicked", lambda w:close_titler()) save_titles_b = guiutils.get_sized_button(_("Save Title Graphic"), 150, 32) save_titles_b.connect("clicked", lambda w:self._save_title_pressed()) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(keep_label, False, False, 0) editor_buttons_row.pack_start(self.keep_layers_check, False, False, 0) editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False, 0) editor_buttons_row.pack_start(open_label, False, False, 0) editor_buttons_row.pack_start(self.open_in_current_check, False, False, 0) editor_buttons_row.pack_start(guiutils.pad_label(24, 2), False, False, 0) editor_buttons_row.pack_start(exit_b, False, False, 0) editor_buttons_row.pack_start(save_titles_b, False, False, 0) editor_panel = Gtk.VBox() editor_panel.pack_start(self.view_editor, True, True, 0) editor_panel.pack_start(timeline_box, False, False, 0) editor_panel.pack_start(guiutils.get_in_centering_alignment(view_editor_editor_buttons_row), False, False, 0) editor_panel.pack_start(guiutils.pad_label(2, 24), True, True, 0) editor_panel.pack_start(editor_buttons_row, False, False, 0) editor_row = Gtk.HBox() editor_row.pack_start(controls_panel, False, False, 0) editor_row.pack_start(editor_panel, True, True, 0) alignment = guiutils.set_margins(editor_row, 8,8,8,8) self.add(alignment) self.layer_list.fill_data_model() self._update_gui_with_active_layer_data() self.show_all() self.connect("size-allocate", lambda w, e:self.window_resized()) self.connect("window-state-event", lambda w, e:self.window_resized())
def get_clip_effects_editor_panel(group_combo_box, effects_list_view): create_widgets() stack_label = guiutils.bold_label(_("Clip Filters Stack")) label_row = guiutils.get_left_justified_box([stack_label]) guiutils.set_margins(label_row, 0, 4, 0, 0) effect_stack = widgets.effect_stack_view for group in mltfilters.groups: group_name, filters_array = group group_combo_box.append_text(group_name) group_combo_box.set_active(0) # Same callback function works for filter select window too group_combo_box.connect( "changed", lambda w, e: _group_selection_changed(w, effects_list_view), None) widgets.group_combo = group_combo_box widgets.effect_list_view = effects_list_view set_enabled(False) exit_button_vbox = Gtk.VBox(False, 2) exit_button_vbox.pack_start(widgets.exit_button, False, False, 0) info_row = Gtk.HBox(False, 2) info_row.pack_start(widgets.hamburger_launcher.widget, False, False, 0) info_row.pack_start(Gtk.Label(), True, True, 0) info_row.pack_start(widgets.clip_info, False, False, 0) info_row.pack_start(Gtk.Label(), True, True, 0) combo_row = Gtk.HBox(False, 2) combo_row.pack_start(group_combo_box, True, True, 0) group_name, filters_array = mltfilters.groups[0] effects_list_view.fill_data_model(filters_array) effects_list_view.treeview.get_selection().select_path("0") effects_vbox = Gtk.VBox(False, 2) if editorstate.SCREEN_HEIGHT < 1023: stack_buttons_box = Gtk.HBox(False, 1) stack_buttons_box.pack_start(widgets.del_effect_b, True, True, 0) stack_buttons_box.pack_start(widgets.toggle_all, False, False, 0) stack_buttons_box.pack_start(guiutils.pad_label(8, 10), False, False, 0) stack_buttons_box.pack_start(widgets.add_filter_mask.widget, False, False, 0) stack_buttons_box.pack_start(guiutils.pad_label(8, 10), False, False, 0) guiutils.set_margins(stack_buttons_box, 4, 4, 0, 0) stack_vbox = Gtk.VBox(False, 2) stack_vbox.pack_start(stack_buttons_box, False, False, 0) stack_vbox.pack_start(effect_stack, True, True, 0) add_buttons_box = Gtk.HBox(True, 1) add_buttons_box.pack_start(widgets.add_effect_b, True, True, 0) add_buttons_box.pack_start(Gtk.Label(), True, True, 0) guiutils.set_margins(add_buttons_box, 4, 4, 0, 0) groups_vbox = Gtk.VBox(False, 2) groups_vbox.pack_start(add_buttons_box, False, False, 0) groups_vbox.pack_start(combo_row, False, False, 0) groups_vbox.pack_start(effects_list_view, True, True, 0) notebook = Gtk.Notebook() notebook.append_page(stack_vbox, Gtk.Label(label=_("Stack"))) notebook.append_page(groups_vbox, Gtk.Label(label=_("Filters"))) effects_vbox.pack_start(notebook, True, True, 0) else: ad_buttons_box = Gtk.HBox(True, 1) ad_buttons_box.pack_start(widgets.add_effect_b, True, True, 0) ad_buttons_box.pack_start(widgets.del_effect_b, True, True, 0) stack_buttons_box = Gtk.HBox(False, 1) stack_buttons_box.pack_start(ad_buttons_box, True, True, 0) stack_buttons_box.pack_start(widgets.toggle_all, False, False, 0) stack_buttons_box.pack_start(widgets.add_filter_mask.widget, False, False, 0) effects_vbox.pack_start(label_row, False, False, 0) effects_vbox.pack_start(stack_buttons_box, False, False, 0) effects_vbox.pack_start(effect_stack, True, True, 0) effects_vbox.pack_start(combo_row, False, False, 0) effects_vbox.pack_start(effects_list_view, True, True, 0) widgets.group_combo.set_tooltip_text(_("Select Filter Group")) widgets.effect_list_view.set_tooltip_text(_("Current group Filters")) return effects_vbox, info_row
def create_widgets(): """ Widgets for editing clip effects properties. """ # Aug-2019 - SvdB - BB prefs = editorpersistance.prefs widgets.clip_info = guicomponents.ClipInfoPanel() widgets.exit_button = Gtk.Button() icon = Gtk.Image.new_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU) widgets.exit_button.set_image(icon) widgets.exit_button.connect("clicked", lambda w: _quit_editing_clip_clicked()) widgets.exit_button.set_tooltip_text(_("Quit editing Clip in editor")) widgets.effect_stack_view = guicomponents.FilterSwitchListView( lambda ts: effect_selection_changed(), toggle_filter_active, dnd_row_deleted, dnd_row_inserted) widgets.effect_stack_view.treeview.connect( "button-press-event", lambda w, e, wtf: stack_view_pressed(), None) gui.effect_stack_list_view = widgets.effect_stack_view widgets.value_edit_box = Gtk.VBox() widgets.value_edit_frame = Gtk.Frame() widgets.value_edit_frame.set_shadow_type(Gtk.ShadowType.NONE) widgets.value_edit_frame.add(widgets.value_edit_box) widgets.add_effect_b = Gtk.Button() widgets.add_effect_b.set_image(guiutils.get_image("filter_add")) widgets.del_effect_b = Gtk.Button() widgets.del_effect_b.set_image(guiutils.get_image("filter_delete")) widgets.toggle_all = Gtk.Button() widgets.toggle_all.set_image(guiutils.get_image("filters_all_toggle")) filter_mask_surfaces = [ guiutils.get_cairo_image("filters_mask_add"), guiutils.get_cairo_image("filters_mask_add_not_active") ] widgets.add_filter_mask = guicomponents.HamburgerPressLaunch( _filter_mask_launch_pressed, filter_mask_surfaces, 26) guiutils.set_margins(widgets.add_filter_mask.widget, 10, 0, 1, 0) widgets.add_effect_b.connect("clicked", lambda w, e: add_effect_pressed(), None) widgets.del_effect_b.connect("clicked", lambda w, e: delete_effect_pressed(), None) widgets.toggle_all.connect("clicked", lambda w: toggle_all_pressed()) widgets.hamburger_launcher = guicomponents.HamburgerPressLaunch( _hamburger_launch_pressed) guiutils.set_margins(widgets.hamburger_launcher.widget, 6, 8, 1, 0) # These are created elsewhere and then monkeypatched here widgets.group_combo = None widgets.effect_list_view = None widgets.clip_info.set_tooltip_text(_("Clip being edited")) widgets.effect_stack_view.set_tooltip_text(_("Clip Filter Stack")) widgets.add_effect_b.set_tooltip_text(_("Add Filter to Clip Filter Stack")) widgets.del_effect_b.set_tooltip_text( _("Delete Filter from Clip Filter Stack")) widgets.toggle_all.set_tooltip_text(_("Toggle all Filters On/Off")) widgets.add_filter_mask.widget.set_tooltip_text(_("Add Filter Mask"))
def get_default_alignment(panel): alignment = Gtk.Frame.new("") #Gtk.Frame.new(None) alignment.add(panel) alignment.set_shadow_type(Gtk.ShadowType.NONE) guiutils.set_margins(alignment, 12, 24, 12, 18) return alignment
def __init__(self): Gtk.Dialog.__init__(self, _("Workflow First Run Wizard"), gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Select Preset Workflow and Continue").encode('utf-8'), Gtk.ResponseType.ACCEPT)) self.selection = STANDARD_PRESET info_label_text_1 = _("<b>Welcome to Flowblade 2.0</b>") info_label_1 = Gtk.Label(info_label_text_1) info_label_1.set_use_markup(True) info_label_text_2 = _("<b>Flowblade 2.0</b> comes with a configurable workflow.") info_label_2 = Gtk.Label(info_label_text_2) info_label_2.set_use_markup(True) INDENT = " " info_label_text_6 = INDENT + u"\u2022" + _(" You can select which <b>tools</b> you want to use.\n") + \ INDENT + u"\u2022" + _(" Many timeline edit <b>behaviours</b> are configurable.\n") info_label_6 = Gtk.Label(info_label_text_6) info_label_6.set_use_markup(True) info_label_text_3 = _("<b>Select Workflow Preset</b>") info_label_3 = Gtk.Label(info_label_text_3) info_label_3.set_use_markup(True) guiutils.set_margins(info_label_3, 0, 4, 0, 0) info_label_text_7 = _("You can change and configure individual tools and behaviours <b>anytime</b>") info_label_7 = Gtk.Label(info_label_text_7) info_label_7.set_use_markup(True) info_label_text_4 = _(" by pressing ") info_label_4 = Gtk.Label(info_label_text_4) info_label_4.set_use_markup(True) icon = Gtk.Image.new_from_file(respaths.IMAGE_PATH + "workflow.png") info_label_text_5 = _(" icon.") info_label_5 = Gtk.Label(info_label_text_5) workflow_name = _("<b>Standard</b>") stadard_preset_workflow_text_1 = _("Standard workflow has the <b>Move</b> tool as default tool\nand presents a workflow\nsimilar to most video editors.") workflow_select_item_1 = self.get_workflow_select_item(STANDARD_PRESET, workflow_name, stadard_preset_workflow_text_1) workflow_name = _("<b>Film Style</b>") filmstyle_preset_workflow_text_2 = _("Film Style workflow has the <b>Insert</b> tool as default tool\nand employs insert style editing.\nThis was the workflow in previous versions of the application.") workflow_select_item_2 = self.get_workflow_select_item(FILM_STYLE_PRESET, workflow_name, filmstyle_preset_workflow_text_2) self.workflow_items = [workflow_select_item_1, workflow_select_item_2] panel_vbox = Gtk.VBox(False, 2) panel_vbox.pack_start(guiutils.get_pad_label(24, 12), False, False, 0) panel_vbox.pack_start(guiutils.get_centered_box([info_label_1]), False, False, 0) panel_vbox.pack_start(guiutils.get_pad_label(24, 12), False, False, 0) panel_vbox.pack_start(guiutils.get_left_justified_box([info_label_2]), False, False, 0) panel_vbox.pack_start(guiutils.get_left_justified_box([info_label_6]), False, False, 0) panel_vbox.pack_start(guiutils.get_pad_label(24, 24), False, False, 0) panel_vbox.pack_start(guiutils.get_centered_box([info_label_3]), False, False, 0) panel_vbox.pack_start(workflow_select_item_1, False, False, 0) panel_vbox.pack_start(workflow_select_item_2, False, False, 0) panel_vbox.pack_start(guiutils.get_pad_label(24, 48), False, False, 0) panel_vbox.pack_start(guiutils.get_centered_box([info_label_7]), False, False, 0) panel_vbox.pack_start(guiutils.get_centered_box([info_label_4, icon, info_label_5]), False, False, 0) panel_vbox.pack_start(guiutils.get_pad_label(24, 24), False, False, 0) alignment = dialogutils.get_alignment2(panel_vbox) self.vbox.pack_start(alignment, True, True, 0) dialogutils.set_outer_margins(self.vbox) dialogs._default_behaviour(self) self.connect('response', self.done) 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 _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 _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 _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 __init__(self): self.dialog = Gtk.Dialog( _("Proxy Manager"), gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Close Manager"), Gtk.ResponseType.CLOSE)) # Encoding self.enc_select = Gtk.ComboBoxText() encodings = renderconsumer.proxy_encodings if len( encodings ) < 1: # no encoding options available, system does not have right codecs # display info pass for encoption in encodings: self.enc_select.append_text(encoption.name) current_enc = editorstate.PROJECT().proxy_data.encoding if current_enc >= len( encodings): # current encoding selection not available current_enc = 0 editorstate.PROJECT().proxy_data.encoding = 0 self.enc_select.set_active(current_enc) self.enc_select.connect( "changed", lambda w, e: self.encoding_changed(w.get_active()), None) self.size_select = Gtk.ComboBoxText() self.size_select.append_text(_("Project Image Size")) self.size_select.append_text(_("Half Project Image Size")) self.size_select.append_text(_("Quarter Project Image Size")) self.size_select.set_active(editorstate.PROJECT().proxy_data.size) self.size_select.connect( "changed", lambda w, e: self.size_changed(w.get_active()), None) row_enc = Gtk.HBox(False, 2) row_enc.pack_start(Gtk.Label(), True, True, 0) row_enc.pack_start(self.enc_select, False, False, 0) row_enc.pack_start(self.size_select, False, False, 0) row_enc.pack_start(Gtk.Label(), True, True, 0) vbox_enc = Gtk.VBox(False, 2) vbox_enc.pack_start(row_enc, False, False, 0) vbox_enc.pack_start(guiutils.pad_label(8, 12), False, False, 0) panel_encoding = guiutils.get_named_frame(_("Proxy Encoding"), vbox_enc) # Mode media_files = editorstate.PROJECT().media_files video_files = 0 proxy_files = 0 for k, media_file in media_files.items(): if media_file.type == appconsts.VIDEO: video_files = video_files + 1 if media_file.has_proxy_file == True or media_file.is_proxy_file == True: proxy_files = proxy_files + 1 proxy_status_label = Gtk.Label(label=_("Proxy Stats:")) proxy_status_value = Gtk.Label(label=str(proxy_files) + _(" proxy file(s) for ") + str(video_files) + _(" video file(s)")) row_proxy_status = guiutils.get_two_column_box_right_pad( proxy_status_label, proxy_status_value, 150, 150) proxy_mode_label = Gtk.Label(label=_("Current Proxy Mode:")) self.proxy_mode_value = Gtk.Label() self.set_mode_display_value() row_proxy_mode = guiutils.get_two_column_box_right_pad( proxy_mode_label, self.proxy_mode_value, 150, 150) self.convert_progress_bar = Gtk.ProgressBar() self.convert_progress_bar.set_text(_("Press Button to Change Mode")) self.use_button = Gtk.Button(_("Use Proxy Media")) self.dont_use_button = Gtk.Button(_("Use Original Media")) self.set_convert_buttons_state() self.use_button.connect("clicked", lambda w: _convert_to_proxy_project()) self.dont_use_button.connect( "clicked", lambda w: _convert_to_original_media_project()) c_box_2 = Gtk.HBox(True, 8) c_box_2.pack_start(self.use_button, True, True, 0) c_box_2.pack_start(self.dont_use_button, True, True, 0) row2_onoff = Gtk.HBox(False, 2) row2_onoff.pack_start(Gtk.Label(), True, True, 0) row2_onoff.pack_start(c_box_2, False, False, 0) row2_onoff.pack_start(Gtk.Label(), True, True, 0) vbox_onoff = Gtk.VBox(False, 2) vbox_onoff.pack_start(row_proxy_status, False, False, 0) vbox_onoff.pack_start(row_proxy_mode, False, False, 0) vbox_onoff.pack_start(guiutils.pad_label(12, 12), False, False, 0) vbox_onoff.pack_start(self.convert_progress_bar, False, False, 0) vbox_onoff.pack_start(row2_onoff, False, False, 0) panel_onoff = guiutils.get_named_frame(_("Project Proxy Mode"), vbox_onoff) # Pane vbox = Gtk.VBox(False, 2) vbox.pack_start(panel_encoding, False, False, 0) vbox.pack_start(panel_onoff, False, False, 0) guiutils.set_margins(vbox, 8, 12, 12, 12) self.dialog.vbox.pack_start(vbox, True, True, 0) dialogutils.set_outer_margins(self.dialog.vbox) self.dialog.connect('response', dialogutils.dialog_destroy) self.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 _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 __init__(self, autosave_file): self.is_shutting_down = False # Window self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL) self.window.connect("delete-event", lambda w, e: self.close_window()) app_icon = GdkPixbuf.Pixbuf.new_from_file(respaths.IMAGE_PATH + "flowbladebatchappicon.png") self.window.set_icon(app_icon) self.last_saved_job = None self.start_time = time.monotonic() self.autosave_file = autosave_file self.render_progress_bar = Gtk.ProgressBar() self.render_progress_bar.set_text("0 %") prog_align = guiutils.set_margins(self.render_progress_bar, 0, 0, 6, 0) prog_align.set_size_request(550, 30) self.elapsed_value = Gtk.Label() self.current_render_value = Gtk.Label() self.items_value = Gtk.Label() est_label = guiutils.get_right_justified_box( [guiutils.bold_label(_("Elapsed:"))]) items_label = guiutils.get_right_justified_box( [guiutils.bold_label(_("Jobs Remaining Item:"))]) current_label = guiutils.get_right_justified_box( [guiutils.bold_label(_("Current Job:"))]) est_label.set_size_request(250, 20) current_label.set_size_request(250, 20) items_label.set_size_request(250, 20) self.status_label = Gtk.Label() self.status_label.set_text(_("Rendering")) cancel_button = Gtk.Button(_("Cancel All Jobs")) cancel_button.connect("clicked", lambda w: self.cancel_all()) control_row = Gtk.HBox(False, 0) control_row.pack_start(self.status_label, False, False, 0) control_row.pack_start(Gtk.Label(), True, True, 0) control_row.pack_start(cancel_button, False, False, 0) info_vbox = Gtk.VBox(False, 0) info_vbox.pack_start( guiutils.get_left_justified_box([est_label, self.elapsed_value]), False, False, 0) info_vbox.pack_start( guiutils.get_left_justified_box([items_label, self.items_value]), False, False, 0) info_vbox.pack_start( guiutils.get_left_justified_box( [current_label, self.current_render_value]), False, False, 0) progress_vbox = Gtk.VBox(False, 2) progress_vbox.pack_start(info_vbox, False, False, 0) progress_vbox.pack_start(guiutils.get_pad_label(10, 8), False, False, 0) progress_vbox.pack_start(prog_align, False, False, 0) progress_vbox.pack_start(control_row, False, False, 0) alignment = guiutils.set_margins(progress_vbox, 12, 12, 12, 12) alignment.show_all() # Set pane and show window self.window.add(alignment) self.window.set_title(_("Jobs Render Progress")) self.window.set_position(Gtk.WindowPosition.CENTER) self.window.show_all()
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) timeline_start_end_button = Gtk.CheckButton() if hasattr(prefs, 'timeline_start_end'): timeline_start_end_button.set_active(prefs.timeline_start_end) 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(value=prefs.ffwd_rev_shift, lower=1, upper=10, step_incr=1) else: spin_adj = Gtk.Adjustment(value=1, lower=1, upper=10, step_incr=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(value=prefs.ffwd_rev_ctrl, lower=1, upper=10, step_incr=1) else: spin_adj = Gtk.Adjustment(value=10, lower=1, upper=10, step_incr=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(value=prefs.ffwd_rev_caps, lower=1, upper=10, step_incr=1) else: spin_adj = Gtk.Adjustment(value=1, lower=1, upper=10, step_incr=1) ffwd_rev_caps_spin = Gtk.SpinButton() ffwd_rev_caps_spin.set_adjustment(spin_adj) ffwd_rev_caps_spin.set_numeric(True) loop_clips = Gtk.CheckButton() loop_clips.set_active(prefs.loop_clips) # Layout 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")))) row10 = _row(guiutils.get_checkbox_row_box(play_pause_button, Gtk.Label(label=_("Enable single Play/Pause button")))) row11 = _row(guiutils.get_checkbox_row_box(timeline_start_end_button, Gtk.Label(label=_("Enable To Start and To End buttons")))) 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")))) row18 = _row(guiutils.get_checkbox_row_box(loop_clips, Gtk.Label(label=_("Loop Media Clips on Monitor")))) vbox = Gtk.VBox(False, 2) vbox.pack_start(row17, False, False, 0) vbox.pack_start(row18, False, False, 0) vbox.pack_start(row2, False, False, 0) vbox.pack_start(row13, False, False, 0) vbox.pack_start(row10, False, False, 0) vbox.pack_start(row11, False, False, 0) 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) return vbox, (auto_center_on_stop, play_pause_button, timeline_start_end_button, auto_center_on_updown, ffwd_rev_shift_spin, ffwd_rev_ctrl_spin, ffwd_rev_caps_spin, follow_move_range, loop_clips)
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 _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 print(index) 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(row8, 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, args_panel): GObject.GObject.__init__(self) #self.connect("delete-event", lambda w, e:close_audio_monitor()) self.args_panel = args_panel self.opts_view = Gtk.TextView() self.opts_view.set_sensitive(True) self.opts_view.set_pixels_above_lines(2) self.opts_view.set_left_margin(2) self.opts_view.set_buffer(self.args_panel.text_buffer) sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) sw.add(self.opts_view) sw.set_size_request(*FFMPEG_VIEW_SIZE) scroll_frame = Gtk.Frame() scroll_frame.add(sw) scroll_frame.set_size_request(400, 300) self.load_selection_button = Gtk.Button(_("Load Selection")) self.load_selection_button.connect("clicked", lambda w: self.args_panel.display_selection_callback()) self.ext_label = Gtk.Label(label=_("Ext.:")) self.ext_label.set_sensitive(False) self.ext_entry = Gtk.Entry() self.ext_entry.set_width_chars(5) self.ext_entry.set_text(self.args_panel.ext) self.load_selection_button.set_tooltip_text(_("Load render options from currently selected encoding")) self.opts_view.set_tooltip_text(_("Edit render options")) opts_buttons_row = Gtk.HBox(False) opts_buttons_row.pack_start(self.load_selection_button, False, False, 0) opts_buttons_row.pack_start(guiutils.get_pad_label(4, 2), False, False, 0) opts_buttons_row.pack_start(self.ext_label, False, False, 0) opts_buttons_row.pack_start(guiutils.get_pad_label(4, 2), False, False, 0) opts_buttons_row.pack_start(self.ext_entry, False, False, 0) cancel_b = guiutils.get_sized_button(_("Cancel"), 150, 32) cancel_b.connect("clicked", lambda w: self.args_panel.cancel_args_edit()) set_args_b = guiutils.get_sized_button(_("Set Args"), 150, 32) set_args_b.connect("clicked", lambda w:self.args_panel.do_args_edit()) editor_buttons_row = Gtk.HBox() editor_buttons_row.pack_start(Gtk.Label(), True, True, 0) editor_buttons_row.pack_start(cancel_b, False, False, 0) editor_buttons_row.pack_start(set_args_b, False, False, 0) pane = Gtk.VBox(False, 1) pane.pack_start(scroll_frame, True, True, 0) pane.pack_start(opts_buttons_row, False, True, 0) pane.pack_start(guiutils.get_pad_label(4, 12), False, True, 0) pane.pack_start(editor_buttons_row, False, True, 0) align = guiutils.set_margins(pane, 12, 12, 12, 12) # Set pane and show window self.add(align) self.set_title(_("Render Args")) self.show_all() self.set_resizable(False) self.set_keep_above(True) # Perhaps configurable later
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 __init__(self, files_to_render, already_have_proxies, not_video_files, is_proxy_file, other_project_proxies, proxy_w, proxy_h, proxy_file_extension): dialog_title = _("Proxy Render Info") self.files_to_render = files_to_render self.other_project_proxies = other_project_proxies self.already_have_proxies = already_have_proxies self.proxy_w = proxy_w self.proxy_h = proxy_h self.proxy_file_extension = proxy_file_extension self.issues = 1 if (len(files_to_render) + len(already_have_proxies) + len(other_project_proxies)) == 0 and not_video_files > 0: self.dialog = Gtk.Dialog( dialog_title, gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Close"), Gtk.ResponseType.CLOSE)) info_box = dialogutils.get_warning_message_dialog_panel( _("Nothing will be rendered"), _("No video files were selected.\nOnly video files can have proxy files." ), True) self.dialog.connect('response', dialogutils.dialog_destroy) else: self.dialog = Gtk.Dialog( dialog_title, gui.editor_window.window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, (_("Cancel"), Gtk.ResponseType.CANCEL, _("Do Render Action"), Gtk.ResponseType.OK)) self.dialog.connect('response', self.response) rows = "" if len(already_have_proxies) > 0 and len( other_project_proxies) > 0: text = _( "Proxies exist that were created by this and other projects for " ) + str( len(already_have_proxies) + len(other_project_proxies)) + _(" file(s).\n") rows = rows + self.issues_str() + text elif len(already_have_proxies) > 0 and len( other_project_proxies) == 0: text = _("Proxies have already been created for ") + str( len(already_have_proxies)) + _(" file(s).\n") rows = rows + self.issues_str() + text elif len(other_project_proxies) > 0: text = _( "Proxies exist that were created by other projects for " ) + str(len(other_project_proxies)) + _(" file(s).\n") rows = rows + self.issues_str() + text if not_video_files > 0: text = _("You are trying to create proxies for ") + str( not_video_files) + _(" non-video file(s).\n") rows = rows + self.issues_str() + text if is_proxy_file > 0: text = _("You are trying to create proxies for ") + str( not_video_files) + _(" proxy file(s).\n") rows = rows + self.issues_str() + text issues_box = dialogutils.get_warning_message_dialog_panel( _("There are some issues with proxy render request"), rows, True) proxy_mode = editorstate.PROJECT().proxy_data.proxy_mode if proxy_mode == appconsts.USE_PROXY_MEDIA: info_label = Gtk.Label( _("<b>Rerendering proxies currently not possible!</b>\nChange to 'Use Original Media' mode to rerender proxies." )) info_label.set_use_markup(True) info_row = guiutils.get_left_justified_box( [guiutils.get_pad_label(24, 10), info_label]) self.action_select = Gtk.ComboBoxText() self.action_select.append_text( _("Render Unrendered Possible & Use existing")) if proxy_mode != appconsts.USE_PROXY_MEDIA: self.action_select.append_text(_("Rerender All Possible")) self.action_select.set_active(0) action_row = guiutils.get_left_justified_box([ guiutils.get_pad_label(24, 10), Gtk.Label(label=_("Select Render Action: ")), self.action_select ]) info_box = Gtk.VBox() info_box.pack_start(issues_box, False, False, 0) if proxy_mode == appconsts.USE_PROXY_MEDIA: info_box.pack_start(info_row, False, False, 0) info_box.pack_start(guiutils.get_pad_label(12, 24), False, False, 0) info_box.pack_start(action_row, False, False, 0) guiutils.set_margins(info_box, 12, 48, 12, 0) self.dialog.vbox.pack_start(info_box, True, True, 0) dialogutils.set_outer_margins(self.dialog.vbox) self.dialog.show_all()
def get_transition_panel(trans_data): type_combo_box = Gtk.ComboBoxText() name, t_service_id = mlttransitions.rendered_transitions[0] type_combo_box.append_text(name) name, t_service_id = mlttransitions.rendered_transitions[1] type_combo_box.append_text(name) name, t_service_id = mlttransitions.rendered_transitions[2] type_combo_box.append_text(name) type_combo_box.set_active(0) type_row = get_two_column_box(Gtk.Label(label=_("Type:")), type_combo_box) wipe_luma_combo_box = Gtk.ComboBoxText() keys = mlttransitions.wipe_lumas.keys() keys.sort() for k in keys: wipe_luma_combo_box.append_text(k) wipe_luma_combo_box.set_active(0) wipe_label = Gtk.Label(label=_("Wipe Pattern:")) wipe_row = get_two_column_box(wipe_label, wipe_luma_combo_box) color_button = Gtk.ColorButton.new_with_rgba(Gdk.RGBA(0, 0, 0, 1)) color_button_box = guiutils.get_left_justified_box([color_button]) color_label = Gtk.Label(label=_("Dip Color:")) color_row = get_two_column_box(color_label, color_button_box) wipe_luma_combo_box.set_sensitive(False) color_button.set_sensitive(False) wipe_label.set_sensitive(False) color_label.set_sensitive(False) transition_type_widgets = (type_combo_box, wipe_luma_combo_box, color_button, wipe_label, color_label) type_combo_box.connect( "changed", lambda w, e: _transition_type_changed(transition_type_widgets), None) length_entry = Gtk.Entry() trans_length = 30 if editorstate.transition_length > 0: # use last invocation length if available trans_length = editorstate.transition_length length_entry.set_text(str(trans_length)) length_row = get_two_column_box(Gtk.Label(label=_("Length:")), length_entry) filler = Gtk.Label() filler.set_size_request(10, 10) out_clip_label = Gtk.Label(label=_("First Clip Out Handle:")) out_clip_value = Gtk.Label(label=str(trans_data["from_handle"]) + _(" frame(s)")) in_clip_label = Gtk.Label(label=_("Second Clip In Handle:")) in_clip_value = Gtk.Label(label=str(trans_data["to_handle"]) + _(" frame(s)")) out_handle_row = get_two_column_box(out_clip_label, out_clip_value) in_handle_row = get_two_column_box(in_clip_label, in_clip_value) # Encoding widgets encodings_cb = Gtk.ComboBoxText() for encoding in renderconsumer.encoding_options: encodings_cb.append_text(encoding.name) encodings_cb.set_active(0) quality_cb = Gtk.ComboBoxText() transition_widgets = (encodings_cb, quality_cb) encodings_cb.connect( "changed", lambda w, e: _transition_encoding_changed(transition_widgets), None) _fill_transition_quality_combo_box(transition_widgets, 10) _set_saved_encoding(transition_widgets) # Build panel edit_vbox = Gtk.VBox(False, 2) edit_vbox.pack_start(type_row, False, False, 0) edit_vbox.pack_start(length_row, False, False, 0) edit_vbox.pack_start(wipe_row, False, False, 0) edit_vbox.pack_start(color_row, False, False, 0) data_vbox = Gtk.VBox(False, 2) data_vbox.pack_start(out_handle_row, False, False, 0) data_vbox.pack_start(in_handle_row, False, False, 0) enconding_vbox = Gtk.VBox(False, 2) enconding_vbox.pack_start(encodings_cb, False, False, 0) enconding_vbox.pack_start(quality_cb, False, False, 0) vbox = Gtk.VBox(False, 2) vbox.pack_start(get_named_frame(_("Transition Options"), edit_vbox), True, True, 0) vbox.pack_start(get_named_frame(_("Encoding"), enconding_vbox), True, True, 0) vbox.pack_start(get_named_frame(_("Media Overlap info"), data_vbox), True, True, 0) alignment = guiutils.set_margins(vbox, 12, 24, 12, 12) return (alignment, type_combo_box, length_entry, encodings_cb, quality_cb, wipe_luma_combo_box, color_button)