Ejemplo n.º 1
0
def _menu_action_pressed(widget, event):
    menu = _hamburger_menu
    guiutils.remove_children(menu)
    menu.add(
        guiutils.get_menu_item(_("Cancel Selected Render"),
                               _hamburger_item_activated, "cancel_selected"))
    menu.add(
        guiutils.get_menu_item(_("Cancel All Renders"),
                               _hamburger_item_activated, "cancel_all"))

    guiutils.add_separetor(menu)
    """ Not settable for 2.6, let's see later
    sequential_render_item = Gtk.CheckMenuItem()
    sequential_render_item.set_label(_("Render All Jobs Sequentially"))
    sequential_render_item.set_active(editorpersistance.prefs.render_jobs_sequentially)
    sequential_render_item.connect("activate", _hamburger_item_activated, "sequential_render")
    menu.add(sequential_render_item)
    """

    open_on_add_item = Gtk.CheckMenuItem()
    open_on_add_item.set_label(_("Show Jobs Panel on Adding New Job"))
    open_on_add_item.set_active(editorpersistance.prefs.open_jobs_panel_on_add)
    open_on_add_item.connect("activate", _hamburger_item_activated,
                             "open_on_add")
    menu.add(open_on_add_item)

    menu.show_all()
    menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 2
0
def display_strip_context_menu(event, hit_segment):
    global strip_popup_menu
    guiutils.remove_children(strip_popup_menu)

    sensitive = ((hit_segment != None)
                 and (get_tline_rendering_mode()
                      == appconsts.TLINE_RENDERING_REQUEST))
    item = guiutils.get_menu_item(_("Render Segment"),
                                  _strip_menu_item_callback,
                                  ("render_segment", hit_segment), sensitive)
    strip_popup_menu.append(item)

    sensitive = (len(get_renderer().segments) > 0)
    item = guiutils.get_menu_item(_("Delete All Segments"),
                                  _strip_menu_item_callback,
                                  ("delete_all", None), sensitive)
    strip_popup_menu.append(item)

    sensitive = (hit_segment != None)
    item = guiutils.get_menu_item(_("Delete Segment"),
                                  _strip_menu_item_callback,
                                  ("delete_segment", hit_segment), sensitive)
    strip_popup_menu.append(item)

    strip_popup_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 3
0
    def hamburger_launch_pressed(self, widget, event):
        menu = _hamburger_menu
        guiutils.remove_children(menu)

        menu.add(
            guiutils.get_menu_item(_("Load Render Args from a text file"),
                                   self.hamburger_item_activated,
                                   "load_from_file"))
        menu.add(
            guiutils.get_menu_item(_("Save Render Args into a text file"),
                                   self.hamburger_item_activated,
                                   "save_to_from_file"))

        guiutils.add_separetor(menu)

        menu.add(
            guiutils.get_menu_item(_("Load Render Args from Current Encoding"),
                                   self.hamburger_item_activated,
                                   "load_from_selection"))

        guiutils.add_separetor(menu)

        menu.add(
            guiutils.get_menu_item(_("Reset all Render Options to Defaults"),
                                   self.hamburger_item_activated, "reset_all"))

        menu.show_all()
        menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 4
0
def _get_workflow_tool_submenu(callback, tool_id, position):
    sub_menu = Gtk.Menu()

    tool_active = (tool_id in editorpersistance.prefs.active_tools)
    activity_item = Gtk.CheckMenuItem(_("Tool Active").encode('utf-8'))
    activity_item.set_active(tool_active)
    activity_item.connect("toggled", callback, (tool_id, "activity"))
    activity_item.show()
    sub_menu.add(activity_item)

    guiutils.add_separetor(sub_menu)

    position_item = Gtk.MenuItem.new_with_label(_("Set Position"))
    if tool_active == False:
        position_item.set_sensitive(False)
    position_item.show()

    position_menu = Gtk.Menu()

    for i in range(1, len(editorpersistance.prefs.active_tools) + 1):
        move_to_position_item = guiutils.get_menu_item(
            str(i), _workflow_menu_callback, (tool_id, str(i)))
        if i == position or position == -1:
            move_to_position_item.set_sensitive(False)
        move_to_position_item.show()
        position_menu.add(move_to_position_item)

    position_item.set_submenu(position_menu)

    sub_menu.add(position_item)

    return sub_menu
Ejemplo n.º 5
0
def display_strip_context_menu(event, hit_segment):
    global strip_popup_menu
    guiutils.remove_children(strip_popup_menu)

    sensitive = (len(get_renderer().segments) > 0)
    item = guiutils.get_menu_item(_("Delete All Segments"),
                                  _strip_menu_item_callback,
                                  ("delete_all", None), sensitive)
    strip_popup_menu.append(item)
    if hit_segment != None:
        item = guiutils.get_menu_item(_("Delete Segment"),
                                      _strip_menu_item_callback,
                                      ("delete_segment", hit_segment), True)
        strip_popup_menu.append(item)

    strip_popup_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 6
0
def _group_action_pressed(widget, event):
    actions_menu = actions_popup_menu
    guiutils.remove_children(actions_menu)      
    actions_menu.add(guiutils.get_menu_item(_("New Group..."), _actions_callback, "new"))
    actions_menu.add(guiutils.get_menu_item(_("New Group From Selected..."), _actions_callback, "newfromselected"))
    
    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Rename Current Group..."), _actions_callback, "rename")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    guiutils.add_separetor(actions_menu)
    
    move_menu_item = Gtk.MenuItem(_("Move Selected Items To Group").encode('utf-8'))
    move_menu = Gtk.Menu()
    if len(PROJECT().media_log_groups) == 0:
        move_menu.add(guiutils.get_menu_item(_("No Groups").encode('utf-8'), _actions_callback, "dummy", False))
    else:
        index = 0
        for group in PROJECT().media_log_groups:
            name, items = group
            move_menu.add(guiutils.get_menu_item(name, _actions_callback, str(index)))
            index = index + 1
    move_menu_item.set_submenu(move_menu)
    actions_menu.add(move_menu_item)
    move_menu_item.show()

    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Delete Current Group"), _actions_callback, "delete")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    actions_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 7
0
def _get_workflow_tool_submenu(callback, tool_id, position):
    sub_menu = Gtk.Menu()

    tool_active = (tool_id in editorpersistance.prefs.active_tools)
    activity_item = Gtk.CheckMenuItem(_("Tool Active").encode('utf-8'))
    activity_item.set_active(tool_active)
    activity_item.connect("toggled", callback, (tool_id, "activity"))
    activity_item.show()
    sub_menu.add(activity_item)

    guiutils.add_separetor(sub_menu)

    position_item = Gtk.MenuItem.new_with_label(_("Set Position"))
    if tool_active == False:
        position_item.set_sensitive(False)
    position_item.show()

    position_menu = Gtk.Menu()

    for i in range(1, len(editorpersistance.prefs.active_tools) + 1):
        move_to_position_item = guiutils.get_menu_item(
            str(i), _workflow_menu_callback, (tool_id, str(i)))
        if i == position or position == -1:
            move_to_position_item.set_sensitive(False)
        move_to_position_item.show()
        position_menu.add(move_to_position_item)

    position_item.set_submenu(position_menu)

    sub_menu.add(position_item)

    # Individual prefs for tools
    if tool_id == appconsts.TLINE_TOOL_OVERWRITE:
        pref_item = Gtk.CheckMenuItem(
            _("Do Box Selection and Box Move from empty press").encode(
                'utf-8'))
        pref_item.set_active(
            editorpersistance.prefs.box_for_empty_press_in_overwrite_tool)
        pref_item.connect("toggled", _TLINE_TOOL_OVERWRITE_box_selection_pref)
        pref_item.show()
        sub_menu.add(pref_item)
        guiutils.add_separetor(sub_menu)

    return sub_menu
Ejemplo n.º 8
0
def _get_workflow_tool_submenu(callback, tool_id, position):
    sub_menu = Gtk.Menu()
    
    tool_active = (tool_id in editorpersistance.prefs.active_tools)
    activity_item = Gtk.CheckMenuItem(_("Tool Active").encode('utf-8'))
    activity_item.set_active(tool_active)
    activity_item.connect("toggled", callback, (tool_id, "activity"))
    activity_item.show()
    sub_menu.add(activity_item)

    guiutils.add_separetor(sub_menu)
    
    position_item = Gtk.MenuItem.new_with_label(_("Set Position"))
    if tool_active == False:
        position_item.set_sensitive(False)
    position_item.show()

    position_menu = Gtk.Menu()
    
    for i in range(1, len(editorpersistance.prefs.active_tools) + 1):
        move_to_position_item = guiutils.get_menu_item(str(i), _workflow_menu_callback, (tool_id, str(i)))
        if i == position or position == -1:
            move_to_position_item.set_sensitive(False)
        move_to_position_item.show()
        position_menu.add(move_to_position_item)
        
    position_item.set_submenu(position_menu)

    sub_menu.add(position_item)
    
    # Individual prefs for tools
    if tool_id == appconsts.TLINE_TOOL_OVERWRITE:
        pref_item = Gtk.CheckMenuItem(_("Do Box Selection and Box Move from empty press").encode('utf-8'))
        pref_item.set_active(editorpersistance.prefs.box_for_empty_press_in_overwrite_tool)
        pref_item.connect("toggled", _TLINE_TOOL_OVERWRITE_box_selection_pref)
        pref_item.show()
        sub_menu.add(pref_item)
        guiutils.add_separetor(sub_menu)

    return sub_menu
Ejemplo n.º 9
0
def workflow_menu_launched(widget, event):
    guiutils.remove_children(_workflow_menu)

    # ---- preset
    presets_item = Gtk.MenuItem.new_with_label(_("Workflow Presets"))
    presets_item.show()

    presets_menu = Gtk.Menu()

    simplified = guiutils.get_menu_item(_("Simplified"),
                                        _workflow_menu_callback,
                                        (None, "preset simplified"))
    simplified.show()
    presets_menu.add(simplified)

    standart = guiutils.get_menu_item(_("Standard"), _workflow_menu_callback,
                                      (None, "preset standart"))
    standart.show()
    presets_menu.add(standart)

    standart = guiutils.get_menu_item(_("Film Style"), _workflow_menu_callback,
                                      (None, "preset filmstyle"))
    standart.show()
    presets_menu.add(standart)

    presets_item.set_submenu(presets_menu)
    _workflow_menu.add(presets_item)

    # --- behaviours
    guiutils.add_separetor(_workflow_menu)

    behaviours_item = Gtk.MenuItem.new_with_label(_("Behaviours"))
    behaviours_item.show()

    behaviours_menu = Gtk.Menu()

    delete_item = Gtk.MenuItem.new_with_label(_("Default Delete Action"))
    delete_item.show()

    delete_menu = Gtk.Menu()
    labels = [_("Lift"), _("Splice Out")]
    msgs = ["delete lift", "delete splice"]
    guiutils.get_radio_menu_items_group(delete_menu, labels, msgs,
                                        _workflow_menu_callback, 0)

    delete_item.set_submenu(delete_menu)
    behaviours_menu.add(delete_item)

    dnd_item = Gtk.MenuItem.new_with_label(_("Drag'n'Drop Action"))
    dnd_item.show()

    dnd_menu = Gtk.Menu()
    labels = [
        _("Always Overwrite"),
        _("Overwrite on non-V1"),
        _("Always Insert")
    ]
    msgs = ["always overwrite", "verwrite nonV1", "always insert"]
    guiutils.get_radio_menu_items_group(dnd_menu, labels, msgs,
                                        _workflow_menu_callback, 0)

    dnd_item.set_submenu(dnd_menu)
    behaviours_menu.add(dnd_item)

    behaviours_item.set_submenu(behaviours_menu)
    _workflow_menu.add(behaviours_item)

    # --- tools
    guiutils.add_separetor(_workflow_menu)

    # Active tools
    non_active_tools = range(1, 8)  # we have 7 tools currently
    for i in range(0, len(
            editorpersistance.prefs.active_tools)):  #  tool_id in _TOOLS_DATA:
        tool_id = editorpersistance.prefs.active_tools[i]
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(
            _get_workflow_tool_menu_item(_workflow_menu_callback, tool_id,
                                         tool_name, tool_icon_file, i + 1))
        non_active_tools.remove(tool_id)

    guiutils.add_separetor(_workflow_menu)

    # Non-active tools
    for tool_id in non_active_tools:
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(
            _get_workflow_tool_menu_item(_workflow_menu_callback, tool_id,
                                         tool_name, tool_icon_file, -1))

    _workflow_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 10
0
def _group_action_pressed(widget, event):
    actions_menu = actions_popup_menu
    guiutils.remove_children(actions_menu)
    actions_menu.add(
        guiutils.get_menu_item(_("New Group..."), _actions_callback, "new"))
    actions_menu.add(
        guiutils.get_menu_item(_("New Group From Selected..."),
                               _actions_callback, "newfromselected"))

    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Rename Current Group..."),
                                  _actions_callback, "rename")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    guiutils.add_separetor(actions_menu)

    move_menu_item = Gtk.MenuItem(_("Move Selected Items To Group"))
    move_menu = Gtk.Menu()
    if len(PROJECT().media_log_groups) == 0:
        move_menu.add(
            guiutils.get_menu_item(_("No Groups"), _actions_callback, "dummy",
                                   False))
    else:
        index = 0
        for group in PROJECT().media_log_groups:
            name, items = group
            move_menu.add(
                guiutils.get_menu_item(name, _actions_callback, str(index)))
            index = index + 1
    move_menu_item.set_submenu(move_menu)
    actions_menu.add(move_menu_item)
    move_menu_item.show()

    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Delete Current Group"), _actions_callback,
                                  "delete")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    guiutils.add_separetor(actions_menu)

    comments_item = Gtk.CheckMenuItem.new_with_label(
        label=_("Use Comments as Clip Names"))
    comments_item.set_active(_use_comments_for_name)
    comments_item.connect("toggled", _use_comments_toggled)
    comments_item.show()
    actions_menu.add(comments_item)

    guiutils.add_separetor(actions_menu)

    sort_item = Gtk.MenuItem(_("Sort by"))
    sort_menu = Gtk.Menu()
    time_item = Gtk.RadioMenuItem()
    time_item.set_label(_("Time"))
    time_item.set_active(True)
    time_item.show()
    time_item.connect("activate", lambda w: _sorting_changed("time"))
    sort_menu.append(time_item)

    name_item = Gtk.RadioMenuItem.new_with_label([time_item], _("File Name"))
    name_item.connect("activate", lambda w: _sorting_changed("name"))
    name_item.show()
    sort_menu.append(name_item)

    comment_item = Gtk.RadioMenuItem.new_with_label([time_item], _("Comment"))
    comment_item.connect("activate", lambda w: _sorting_changed("comment"))
    comment_item.show()
    sort_menu.append(comment_item)

    global sorting_order
    if sorting_order == TIME_SORT:
        time_item.set_active(True)
    elif sorting_order == NAME_SORT:
        name_item.set_active(True)
    else:  # "comment"
        comment_item.set_active(True)

    sort_item.set_submenu(sort_menu)
    sort_item.show()
    actions_menu.add(sort_item)

    actions_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 11
0
def workflow_menu_launched(widget, event):
    guiutils.remove_children(_workflow_menu)

    # ---- preset
    presets_item = Gtk.MenuItem.new_with_label(_("Workflow Presets"))
    presets_item.show()

    presets_menu = Gtk.Menu()

    standard = guiutils.get_menu_item(_("Standard"), _workflow_menu_callback,
                                      (None, "preset standard"))
    standard.show()
    presets_menu.add(standard)

    film_style = guiutils.get_menu_item(_("Film Style"),
                                        _workflow_menu_callback,
                                        (None, "preset filmstyle"))
    film_style.show()
    presets_menu.add(film_style)

    presets_item.set_submenu(presets_menu)
    _workflow_menu.add(presets_item)

    # --- behaviours
    guiutils.add_separetor(_workflow_menu)

    behaviours_item = Gtk.MenuItem.new_with_label(_("Behaviours"))
    behaviours_item.show()

    behaviours_menu = Gtk.Menu()

    # Delete item not currently used
    delete_item = Gtk.MenuItem.new_with_label(_("Default Delete Action"))
    delete_item.show()

    delete_menu = Gtk.Menu()
    labels = [_("Lift"), _("Splice Out")]
    msgs = ["delete lift", "delete splice"]
    _build_radio_menu_items_group(delete_menu, labels, msgs,
                                  _workflow_menu_callback, 0)

    delete_item.set_submenu(delete_menu)

    dnd_item = Gtk.MenuItem.new_with_label(_("Drag'n'Drop Action"))
    dnd_item.show()

    dnd_menu = Gtk.Menu()
    labels = [
        _("Always Overwrite Blanks"),
        _("Overwrite Blanks on non-V1 Tracks"),
        _("Always Insert")
    ]
    msgs = ["always overwrite", "overwrite nonV1", "always insert"]
    active_index = editorpersistance.prefs.dnd_action  # appconsts values correspond with order here.
    _build_radio_menu_items_group(dnd_menu, labels, msgs,
                                  _workflow_menu_callback, active_index)

    dnd_item.set_submenu(dnd_menu)
    behaviours_menu.add(dnd_item)

    default_compositing_item = Gtk.MenuItem.new_with_label(
        _("New Sequence Default Compositing Mode"))
    default_compositing_item.show()

    default_compositing_menu = Gtk.Menu()
    labels = [
        _("Top Down Free Move"),
        _("Top Down Auto Follow"),
        _("Standard Auto Follow")
    ]
    msgs = ["top down", "top down auto", "standard auto"]
    active_index = editorpersistance.prefs.default_compositing_mode  # appconsts values correspond with order here.
    _build_radio_menu_items_group(default_compositing_menu, labels, msgs,
                                  _workflow_menu_callback, active_index)

    default_compositing_item.set_submenu(default_compositing_menu)
    behaviours_menu.add(default_compositing_item)

    show_tooltips_item = Gtk.CheckMenuItem()
    show_tooltips_item.set_label(_("Show Tooltips for Tools"))
    show_tooltips_item.set_active(editorpersistance.prefs.show_tool_tooltips)
    show_tooltips_item.connect("activate", _workflow_menu_callback,
                               (None, "tooltips"))
    show_tooltips_item.show()

    behaviours_menu.append(show_tooltips_item)

    behaviours_item.set_submenu(behaviours_menu)
    _workflow_menu.add(behaviours_item)

    # --- tools
    guiutils.add_separetor(_workflow_menu)

    # Active tools
    non_active_tools = list(range(1, 12))  # we have 11 tools currently
    for i in range(0, len(
            editorpersistance.prefs.active_tools)):  #  tool_id in _TOOLS_DATA:
        tool_id = editorpersistance.prefs.active_tools[i]
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(
            _get_workflow_tool_menu_item(_workflow_menu_callback, tool_id,
                                         tool_name, tool_icon_file, i + 1))
        try:  # needed to prevent crashes when manually changing preset tools during dev
            non_active_tools.remove(tool_id)
        except:
            pass

    guiutils.add_separetor(_workflow_menu)

    # Non-active tools
    for tool_id in non_active_tools:
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(
            _get_workflow_tool_menu_item(_workflow_menu_callback, tool_id,
                                         tool_name, tool_icon_file, -1))

    _workflow_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 12
0
def _group_action_pressed(widget, event):
    actions_menu = actions_popup_menu
    guiutils.remove_children(actions_menu)      
    actions_menu.add(guiutils.get_menu_item(_("New Group..."), _actions_callback, "new"))
    actions_menu.add(guiutils.get_menu_item(_("New Group From Selected..."), _actions_callback, "newfromselected"))
    
    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Rename Current Group..."), _actions_callback, "rename")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    guiutils.add_separetor(actions_menu)
    
    move_menu_item = Gtk.MenuItem(_("Move Selected Items To Group").encode('utf-8'))
    move_menu = Gtk.Menu()
    if len(PROJECT().media_log_groups) == 0:
        move_menu.add(guiutils.get_menu_item(_("No Groups").encode('utf-8'), _actions_callback, "dummy", False))
    else:
        index = 0
        for group in PROJECT().media_log_groups:
            name, items = group
            move_menu.add(guiutils.get_menu_item(name, _actions_callback, str(index)))
            index = index + 1
    move_menu_item.set_submenu(move_menu)
    actions_menu.add(move_menu_item)
    move_menu_item.show()

    guiutils.add_separetor(actions_menu)

    item = guiutils.get_menu_item(_("Delete Current Group"), _actions_callback, "delete")
    _unsensitive_for_all_view(item)
    actions_menu.add(item)

    guiutils.add_separetor(actions_menu)
    
    sort_item = Gtk.MenuItem(_("Sort by").encode('utf-8'))
    sort_menu = Gtk.Menu()
    time_item = Gtk.RadioMenuItem()
    time_item.set_label(_("Time").encode('utf-8'))
    time_item.set_active(True)
    time_item.show()
    time_item.connect("activate", lambda w: _sorting_changed("time"))
    sort_menu.append(time_item)

    name_item = Gtk.RadioMenuItem.new_with_label([time_item], _("File Name").encode('utf-8'))
    name_item.connect("activate", lambda w: _sorting_changed("name"))
    name_item.show()
    sort_menu.append(name_item)

    comment_item = Gtk.RadioMenuItem.new_with_label([time_item], _("Comment").encode('utf-8'))
    comment_item.connect("activate", lambda w: _sorting_changed("comment"))
    comment_item.show()
    sort_menu.append(comment_item)

    global sorting_order
    if sorting_order == TIME_SORT:
        time_item.set_active(True)
    elif sorting_order == NAME_SORT:
        name_item.set_active(True)
    else:# "comment"
        comment_item.set_active(True)
        
    """
    if editorpersistance.prefs.midbar_tc_left == True:
        tc_left.set_active(True)
    else:
        tc_middle.set_active(True)
    """

    sort_item.set_submenu(sort_menu)
    sort_item.show()
    actions_menu.add(sort_item)
        
    actions_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 13
0
def workflow_menu_launched(widget, event):
    guiutils.remove_children(_workflow_menu)

    # ---- preset
    presets_item = Gtk.MenuItem.new_with_label(_("Workflow Presets"))
    presets_item.show()

    presets_menu = Gtk.Menu()
    
    standard = guiutils.get_menu_item(_("Standard"), _workflow_menu_callback, (None, "preset standard"))
    standard.show()
    presets_menu.add(standard)

    film_style = guiutils.get_menu_item(_("Film Style"), _workflow_menu_callback, (None, "preset filmstyle"))
    film_style.show()
    presets_menu.add(film_style)
    
    presets_item.set_submenu(presets_menu)
    _workflow_menu.add(presets_item)

    # --- behaviours
    guiutils.add_separetor(_workflow_menu)

    behaviours_item = Gtk.MenuItem.new_with_label(_("Behaviours"))
    behaviours_item.show()

    behaviours_menu = Gtk.Menu()
    
    delete_item = Gtk.MenuItem.new_with_label(_("Default Delete Action"))
    delete_item.show()

    delete_menu = Gtk.Menu()
    labels = [_("Lift"), _("Splice Out")]
    msgs = ["delete lift", "delete splice"]
    _build_radio_menu_items_group(delete_menu, labels, msgs, _workflow_menu_callback, 0)

    delete_item.set_submenu(delete_menu)
    #behaviours_menu.add(delete_item)

    dnd_item = Gtk.MenuItem.new_with_label(_("Drag'n'Drop Action"))
    dnd_item.show()
    
    dnd_menu = Gtk.Menu()
    labels = [_("Always Overwrite Blanks"), _("Overwrite Blanks on non-V1 Tracks"), _("Always Insert")]
    msgs = ["always overwrite", "overwrite nonV1", "always insert"]
    active_index = editorpersistance.prefs.dnd_action  #appconsts values corrspond with order here
    _build_radio_menu_items_group(dnd_menu, labels, msgs, _workflow_menu_callback, active_index)

    dnd_item.set_submenu(dnd_menu)
    behaviours_menu.add(dnd_item)

    autofollow_item = Gtk.CheckMenuItem()
    autofollow_item.set_label(_("Compositors Auto Follow"))
    autofollow_item.set_active(editorstate.auto_follow_active())
    autofollow_item.connect("activate", _workflow_menu_callback, (None, "autofollow"))
    autofollow_item.show()

    behaviours_menu.append(autofollow_item)

    show_tooltips_item = Gtk.CheckMenuItem()
    show_tooltips_item.set_label(_("Show Tooltips for Tools"))
    show_tooltips_item.set_active(editorpersistance.prefs.show_tool_tooltips)
    show_tooltips_item.connect("activate", _workflow_menu_callback, (None, "tooltips"))
    show_tooltips_item.show()

    behaviours_menu.append(show_tooltips_item)
    
    behaviours_item.set_submenu(behaviours_menu)
    _workflow_menu.add(behaviours_item)

    # --- tools
    guiutils.add_separetor(_workflow_menu)
    
    # Active tools
    non_active_tools = range(1, 12) # we have 11 tools currently
    for i in range(0, len(editorpersistance.prefs.active_tools)):#  tool_id in _TOOLS_DATA:
        tool_id = editorpersistance.prefs.active_tools[i]
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(_get_workflow_tool_menu_item(_workflow_menu_callback, tool_id, tool_name, tool_icon_file, i+1))
        try: # needed to prevent crashes when manually changing preset tools during dev, remove when those are decided upon
            non_active_tools.remove(tool_id)
        except:
            pass

    guiutils.add_separetor(_workflow_menu)
    
    # Non-active tools
    for tool_id in non_active_tools:
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(_get_workflow_tool_menu_item(_workflow_menu_callback, tool_id, tool_name, tool_icon_file, -1))
        
    _workflow_menu.popup(None, None, None, None, event.button, event.time)
Ejemplo n.º 14
0
def workflow_menu_launched(widget, event):
    guiutils.remove_children(_workflow_menu)

    # ---- preset
    presets_item = Gtk.MenuItem.new_with_label(_("Workflow Presets"))
    presets_item.show()

    presets_menu = Gtk.Menu()
    
    standard = guiutils.get_menu_item(_("Standard"), _workflow_menu_callback, (None, "preset standard"))
    standard.show()
    presets_menu.add(standard)

    film_style = guiutils.get_menu_item(_("Film Style"), _workflow_menu_callback, (None, "preset filmstyle"))
    film_style.show()
    presets_menu.add(film_style)
    
    presets_item.set_submenu(presets_menu)
    _workflow_menu.add(presets_item)

    # --- behaviours
    guiutils.add_separetor(_workflow_menu)

    behaviours_item = Gtk.MenuItem.new_with_label(_("Behaviours"))
    behaviours_item.show()

    behaviours_menu = Gtk.Menu()
    
    delete_item = Gtk.MenuItem.new_with_label(_("Default Delete Action"))
    delete_item.show()

    delete_menu = Gtk.Menu()
    labels = [_("Lift"), _("Splice Out")]
    msgs = ["delete lift", "delete splice"]
    _build_radio_menu_items_group(delete_menu, labels, msgs, _workflow_menu_callback, 0)

    delete_item.set_submenu(delete_menu)
    behaviours_menu.add(delete_item)

    dnd_item = Gtk.MenuItem.new_with_label(_("Drag'n'Drop Action"))
    dnd_item.show()
    
    dnd_menu = Gtk.Menu()
    labels = [_("Always Overwrite Blanks"), _("Overwrite Blanks on non-V1 Tracks"), _("Always Insert")]
    msgs = ["always overwrite", "overwrite nonV1", "always insert"]
    active_index =  editorpersistance.prefs.dnd_action  #appconsts values corrspond with order here
    _build_radio_menu_items_group(dnd_menu, labels, msgs, _workflow_menu_callback, active_index)

    dnd_item.set_submenu(dnd_menu)
    behaviours_menu.add(dnd_item)

    autofollow_item = Gtk.CheckMenuItem()
    autofollow_item.set_label(_("Compositors Auto Follow"))
    autofollow_item.set_active(editorstate.auto_follow_active())
    autofollow_item.connect("activate", _workflow_menu_callback, (None, "autofollow"))
    autofollow_item.show()

    behaviours_menu.append(autofollow_item)
    
    behaviours_item.set_submenu(behaviours_menu)
    _workflow_menu.add(behaviours_item)

    # --- tools
    guiutils.add_separetor(_workflow_menu)
    
    # Active tools
    non_active_tools = range(1, 11) # we have 10 tools currently
    for i in range(0, len(editorpersistance.prefs.active_tools)):#  tool_id in _TOOLS_DATA:
        tool_id = editorpersistance.prefs.active_tools[i]
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(_get_workflow_tool_menu_item(_workflow_menu_callback, tool_id, tool_name, tool_icon_file, i+1))
        try: # needed when manually changing preset tools, remove when those are decided upon
            non_active_tools.remove(tool_id)
        except:
            pass

    guiutils.add_separetor(_workflow_menu)
    
    # Non-active tools
    for tool_id in non_active_tools:
        tool_name, tool_icon_file = _TOOLS_DATA[tool_id]
        _workflow_menu.add(_get_workflow_tool_menu_item(_workflow_menu_callback, tool_id, tool_name, tool_icon_file, -1))
        
    _workflow_menu.popup(None, None, None, None, event.button, event.time)