Exemplo n.º 1
0
 def display_delete_confirm(self, delete_list):
     primary_txt = _("Delete ") + str(
         len(delete_list)) + _(" item(s) from render queue?")
     secondary_txt = _("This operation cannot be undone.")
     dialogutils.warning_confirmation(self._confirm_items_delete_callback,
                                      primary_txt,
                                      secondary_txt,
                                      self.window,
                                      data=delete_list,
                                      is_info=False)
Exemplo n.º 2
0
def _actions_callback(widget, data):
    if data == "newfromselected":
        next_index = len(PROJECT().media_log_groups)
        dialogs.new_media_log_group_name_dialog(_new_group_name_callback,
                                                next_index, True)
    elif data == "new":
        next_index = len(PROJECT().media_log_groups)
        dialogs.new_media_log_group_name_dialog(_new_group_name_callback,
                                                next_index, False)
    elif data == "delete":
        current_group_index = widgets.group_view_select.get_active() - 1
        if current_group_index < 0:
            return
        PROJECT().media_log_groups.pop(current_group_index)
        _create_group_select()
        widgets.group_view_select.set_active(0)
    elif data == "deletewithitems":
        current_group_index = widgets.group_view_select.get_active() - 1
        if current_group_index < 0:
            return
        name, items = PROJECT().media_log_groups[current_group_index]
        primary_txt = _("Delete Group and Items?")
        secondary_txt = _("Are you sure you want to delete group ") + name + _(" and ") + str(len(items)) + _(" items it contains?\n") + \
                        _("This operation cannot be undone.")
        dialogutils.warning_confirmation(_delete_with_items_dialog_callback,
                                         primary_txt, secondary_txt,
                                         gui.editor_window.window, None, True)
    elif data == "rename":
        current_group_index = widgets.group_view_select.get_active() - 1
        name, items = PROJECT().media_log_groups[current_group_index]
        dialogs.group_rename_dialog(_rename_callback, name)
    else:
        try:
            to_group_index = int(data)
        except:
            return

        current_group_index = widgets.group_view_select.get_active() - 1
        if to_group_index == current_group_index:
            return

        # Get items to move
        selected = widgets.media_log_view.get_selected_rows_list()
        log_events = get_current_filtered_events()
        move_items = []
        for row in selected:
            index = max(row)  # these are tuples, max to extract only value
            move_items.append(log_events[index])

        # Move items and update
        PROJECT().remove_from_group(current_group_index, move_items)
        PROJECT().add_to_group(to_group_index, move_items)
        widgets.group_view_select.set_active(
            to_group_index +
            1)  # 0 index items is "All" items group not a user created group
Exemplo n.º 3
0
def _delete_user_profiles_clicked(user_profiles_view):
    delete_indexes = user_profiles_view.get_selected_indexes_list()
    if len(delete_indexes) == 0:
        return

    primary_txt = _("Confirm user profile delete")
    secondary_txt = _("This operation cannot be undone.") 
    
    dialogutils.warning_confirmation(_profiles_delete_confirm_callback, primary_txt, \
                                 secondary_txt, gui.editor_window.window, \
                                (user_profiles_view, delete_indexes))
Exemplo n.º 4
0
def _kb_menu_item_selected(widget, data):
    action, data = data
    if action == "add":
        dialog, entry = dialogutils.get_single_line_text_input_dialog(30, 180, _("Add New Custom Shortcuts Group"), _("Ok"),
                                      _("User Shortcuts Group name:"), "")
        dialog.connect('response', _create_new_kb_shortcuts_group, entry)
        dialog.show_all()
    if action == "delete":
        primary_txt = _("Delete Current User Shortcuts?")
        secondary_txt = _("This operation cannot be undone.")
        shortcuts_combo, dialog = data
        dialogutils.warning_confirmation(_delete_new_kb_shortcuts_group, primary_txt, secondary_txt, dialog)
Exemplo n.º 5
0
def render_timeline():
    if len(widgets.file_panel.movie_name.get_text()) == 0:
        primary_txt = _("Render file name entry is empty")
        secondary_txt = _("You have to provide a name for the file to be rendered.")
        dialogutils.warning_message(primary_txt, secondary_txt, gui.editor_window.window)
        return   

    if os.path.exists(get_file_path()):
        primary_txt = _("File: ") + get_file_path() + _(" already exists!")
        secondary_txt = _("Do you want to overwrite existing file?")
        dialogutils.warning_confirmation(_render_overwrite_confirm_callback, primary_txt, secondary_txt, gui.editor_window.window)
    else:
        _do_rendering()
Exemplo n.º 6
0
def delete_selected_sequence():
    """
    Deletes selected sequence if confirmed and at least one will be left.
    """
    selection = gui.sequence_list_view.treeview.get_selection()
    model, iter = selection.get_selected()
    (model, rows) = selection.get_selected_rows()
    row = max(rows[0])
    name = PROJECT().sequences[row].name
    
    dialogutils.warning_confirmation(_delete_confirm_callback, 
                                 _("Are you sure you want to delete\nsequence \'") + name + _("\'?"), 
                                 _("This operation can not be undone. Sequence will be permanently lost."), 
                                 gui.editor_window.window)
Exemplo n.º 7
0
def _actions_callback(widget, data):
    if data == "newfromselected":
        next_index = len(PROJECT().media_log_groups)
        dialogs.new_media_log_group_name_dialog(_new_group_name_callback, next_index, True)
    elif data == "new":
        next_index = len(PROJECT().media_log_groups)
        dialogs.new_media_log_group_name_dialog(_new_group_name_callback, next_index, False)
    elif data == "delete":
        current_group_index = widgets.group_view_select.get_active() - 1
        if current_group_index < 0:
            return
        PROJECT().media_log_groups.pop(current_group_index)
        _create_group_select()
        widgets.group_view_select.set_active(0)
    elif data == "deletewithitems":
        current_group_index = widgets.group_view_select.get_active() - 1
        if current_group_index < 0:
            return
        name, items = PROJECT().media_log_groups[current_group_index]
        primary_txt = _("Delete Group and Items?")
        secondary_txt = _("Are you sure you want to delete group ") + name + _(" and ") + str(len(items)) + _(" items it contains?\n") + \
                        _("This operation cannot be undone.")
        dialogutils.warning_confirmation(_delete_with_items_dialog_callback,
                            primary_txt, secondary_txt, gui.editor_window.window, None, True)
    elif data == "rename":
        current_group_index = widgets.group_view_select.get_active() - 1
        name, items = PROJECT().media_log_groups[current_group_index]
        dialogs.group_rename_dialog(_rename_callback, name)
    else:
        try:
            to_group_index = int(data)
        except:
            return

        current_group_index = widgets.group_view_select.get_active() - 1
        if to_group_index == current_group_index:
            return

        # Get items to move
        selected = widgets.media_log_view.get_selected_rows_list()
        log_events = get_current_filtered_events()
        move_items = []
        for row in selected:
            index = max(row) # these are tuples, max to extract only value
            move_items.append(log_events[index])

        # Move items and update
        PROJECT().remove_from_group(current_group_index, move_items)
        PROJECT().add_to_group(to_group_index, move_items)
        widgets.group_view_select.set_active(to_group_index + 1) # 0 index items is "All" items group not a user created group
Exemplo n.º 8
0
def render_timeline():
    if len(widgets.file_panel.movie_name.get_text()) == 0:
        primary_txt = _("Render file name entry is empty")
        secondary_txt = _(
            "You have to provide a name for the file to be rendered.")
        dialogutils.warning_message(primary_txt, secondary_txt,
                                    gui.editor_window.window)
        return

    if os.path.exists(get_file_path()):
        primary_txt = _("File: ") + get_file_path() + _(" already exists!")
        secondary_txt = _("Do you want to overwrite existing file?")
        dialogutils.warning_confirmation(_render_overwrite_confirm_callback,
                                         primary_txt, secondary_txt,
                                         gui.editor_window.window)
    else:
        _do_rendering()
Exemplo n.º 9
0
    def destroy_pressed(self, widget):
        if self.warning_level == NO_WARNING:
            # Delete data
            self.destroy_data()
            return

        primaty_text = _("Confirm Destroying Cached Data!")
        if self.warning_level == PROJECT_DATA_WARNING:
            secondary_text = _(
                "Destroying this data may <b>change contents</b> of existing\nprojects or <b>make some projects unopenable!</b>"
            )
            secondary_text += "\n\n"
            secondary_text += _(
                "You can use 'File->Save Backup Snapshot...' functionality to backup projects\nso that they can be opened later before destroying this data."
            )
        else:
            secondary_text = _(
                "Destroying this data may require parts of it to be recreated later."
            )

        dialogutils.warning_confirmation(self.warning_confirmation,
                                         primaty_text, secondary_text,
                                         gui.editor_window.window, None, False,
                                         True)
Exemplo n.º 10
0
 def display_delete_confirm(self, delete_list):
     primary_txt = _("Delete ") + str(len(delete_list)) + _(" item(s) from render queue?")
     secondary_txt = _("This operation cannot be undone.")
     dialogutils.warning_confirmation(self._confirm_items_delete_callback, primary_txt, secondary_txt, self.window , data=delete_list, is_info=False)