Пример #1
0
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"))

    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"))
Пример #2
0
    def __init__(self, extension_label):
        self.quality_selector = RenderQualitySelector()
        self.quality_selector.widget.set_size_request(110, 34)
        self.quality_selector.update_quality_selection(0)
        self.audio_desc = Gtk.Label()
        self.encoding_selector = RenderEncodingSelector(
            self.quality_selector, extension_label, self.audio_desc)
        self.encoding_selector.encoding_selection_changed()

        self.sample_rate_selector = RenderAudioRateSelector()

        # Aug-2019 - SvdB - BB
        self.speaker_image = guiutils.get_image("audio_desc_icon")

        quality_row = Gtk.HBox()
        quality_row.pack_start(self.quality_selector.widget, False, False, 0)
        quality_row.pack_start(Gtk.Label(), True, True, 0)
        quality_row.pack_start(self.speaker_image, False, False, 0)
        quality_row.pack_start(self.sample_rate_selector.widget, False, False,
                               0)
        quality_row.pack_start(self.audio_desc, False, False, 0)

        self.vbox = Gtk.VBox(False, 2)
        self.vbox.pack_start(self.encoding_selector.widget, False, False, 0)
        self.vbox.pack_start(quality_row, False, False, 0)
Пример #3
0
def get_media_log_events_panel(events_list_view):
    global widgets

    group_actions_menu = guicomponents.HamburgerPressLaunch(
        _group_action_pressed)
    guiutils.set_margins(group_actions_menu.widget, 10, 0, 2, 18)

    star_check = Gtk.CheckButton()
    star_check.set_active(True)
    star_check.connect("clicked", lambda w: media_log_filtering_changed())
    widgets.star_check = star_check

    star_label = Gtk.Image()
    # Aug-2019 - SvdB - BB
    star_label.set_from_file(respaths.IMAGE_PATH + guiutils.get_image_name(
        "star", double_height=editorpersistance.prefs.double_track_hights))

    star_not_active_check = Gtk.CheckButton()
    star_not_active_check.set_active(True)
    star_not_active_check.connect("clicked",
                                  lambda w: media_log_filtering_changed())
    widgets.star_not_active_check = star_not_active_check

    star_not_active_label = Gtk.Image()
    # Aug-2019 - SvdB - BB
    star_not_active_label.set_from_file(
        respaths.IMAGE_PATH + guiutils.get_image_name(
            "star_not_active",
            double_height=editorpersistance.prefs.double_track_hights))

    star_button = Gtk.Button()
    # Aug-2019 - SvdB - BB
    star_button.set_image(guiutils.get_image("star"))
    star_button.connect("clicked", lambda w: media_log_star_button_pressed())

    no_star_button = Gtk.Button()
    # Aug-2019 - SvdB - BB
    no_star_button.set_image(guiutils.get_image("star_not_active"))
    no_star_button.connect("clicked",
                           lambda w: media_log_no_star_button_pressed())

    widgets.group_box = Gtk.HBox()
    _create_group_select()
    widgets.group_view_select.set_active(0)

    row1 = Gtk.HBox()
    row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0)
    row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0)
    row1.pack_start(widgets.group_box, False, True, 0)
    row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0)
    row1.pack_start(star_check, False, True, 0)
    row1.pack_start(star_label, False, True, 0)
    row1.pack_start(guiutils.get_pad_label(6, 12), False, True, 0)
    row1.pack_start(star_not_active_check, False, True, 0)
    row1.pack_start(star_not_active_label, False, True, 0)
    row1.pack_start(guiutils.pad_label(12, 12), False, False, 0)
    row1.pack_start(star_button, False, True, 0)
    row1.pack_start(no_star_button, False, True, 0)
    row1.pack_start(Gtk.Label(), True, True, 0)

    # Aug-2019 - SvdB - BB
    prefs = editorpersistance.prefs
    size_adj = 1
    if prefs.double_track_hights:
        size_adj = 2
    widgets.log_range = Gtk.Button()
    widgets.log_range.set_image(guiutils.get_image("log_range"))
    widgets.log_range.set_size_request(80, 30)
    widgets.log_range.connect("clicked", lambda w: log_range_clicked())

    delete_button = Gtk.Button()
    delete_button.set_image(guiutils.get_image("delete_log_range"))
    delete_button.set_size_request(80, 30)
    delete_button.connect("clicked", lambda w: delete_selected())

    insert_displayed = Gtk.Button()
    insert_displayed.set_image(guiutils.get_image("insert_media_log"))
    insert_displayed.set_size_request(80, 22)
    insert_displayed.connect("clicked", lambda w: insert_selected_log_events())

    append_displayed = Gtk.Button()
    append_displayed.set_image(guiutils.get_image("append_media_log"))
    append_displayed.set_size_request(80, 22)
    append_displayed.connect("clicked", lambda w: append_log_events())

    row2 = Gtk.HBox()
    row2.pack_start(group_actions_menu.widget, False, True, 0)
    row2.pack_start(widgets.log_range, False, True, 0)
    row2.pack_start(delete_button, False, True, 0)
    row2.pack_start(Gtk.Label(), True, True, 0)
    row2.pack_start(insert_displayed, False, True, 0)
    row2.pack_start(append_displayed, False, True, 0)

    panel = Gtk.VBox()
    panel.pack_start(row1, False, True, 0)
    panel.pack_start(events_list_view, True, True, 0)
    panel.pack_start(row2, False, True, 0)
    panel.set_size_request(400, 10)

    star_check.set_tooltip_text(_("Display starred ranges"))
    star_not_active_check.set_tooltip_text(_("Display non-starred ranges"))
    star_button.set_tooltip_text(_("Set selected ranges starred"))
    no_star_button.set_tooltip_text(_("Set selected ranges non-starred"))
    widgets.log_range.set_tooltip_text(_("Log current marked range"))
    delete_button.set_tooltip_text(_("Delete selected ranges"))
    insert_displayed.set_tooltip_text(_("Insert selected ranges on Timeline"))
    append_displayed.set_tooltip_text(_("Append displayed ranges on Timeline"))

    dnd.connect_range_log(events_list_view.treeview)

    return panel