Example #1
0
 def confirm(self):
     title = N_('Rename Remote')
     question = N_('Rename remote?')
     info = (N_('Rename remote "%(current)s" to "%(new)s"?') %
             dict(current=self.remote, new=self.new_remote))
     ok_btn = N_('Rename')
     return Interaction.confirm(title, question, info, ok_btn)
Example #2
0
 def do(self):
     if not self.model.undoable():
         return
     s = selection.selection()
     if s.staged:
         items_to_undo = s.staged
     else:
         items_to_undo = s.modified
     if items_to_undo:
         if not Interaction.confirm(
                 N_('Revert Unstaged Changes?'),
                 N_('This operation drops unstaged changes.\n'
                    'These changes cannot be recovered.'),
                 N_('Revert the unstaged changes?'),
                 N_('Revert Unstaged Changes'),
                 default=True,
                 icon=resources.icon('undo.svg')):
             return
         args = []
         if not s.staged and self.model.amending():
             args.append(self.model.head)
         do(Checkout, args + ['--'] + items_to_undo)
     else:
         msg = N_('No files selected for checkout from HEAD.')
         Interaction.log(msg)
Example #3
0
 def confirm(self):
     title = N_('Rename Remote')
     question = N_('Rename remote?')
     info = (N_('Rename remote "%(current)s" to "%(new)s"?') %
             dict(current=self.remote, new=self.new_remote))
     ok_btn = N_('Rename')
     return Interaction.confirm(title, question, info, ok_btn)
Example #4
0
 def confirm(self):
     title = N_('Revert Uncommitted Changes?')
     text = N_('This operation drops uncommitted changes.\n'
               'These changes cannot be recovered.')
     info = N_('Revert the uncommitted changes?')
     ok_text = N_('Revert Uncommitted Changes')
     return Interaction.confirm(title, text, info, ok_text,
                                default=True, icon=self.icon)
Example #5
0
 def confirm(self):
     title = N_('Revert Uncommitted Changes?')
     text = N_('This operation drops uncommitted changes.\n'
               'These changes cannot be recovered.')
     info = N_('Revert the uncommitted changes?')
     ok_text = N_('Revert Uncommitted Changes')
     return Interaction.confirm(title, text, info, ok_text,
                                default=True, icon=self.icon)
Example #6
0
def should_stage_conflicts(path):
    """Inform the user that a file contains merge conflicts

    Return `True` if we should stage the path nonetheless.

    """
    title = msg = N_("Stage conflicts?")
    info = (
        N_("%s appears to contain merge conflicts.\n\n" "You should probably skip this file.\n" "Stage it anyways?")
        % path
    )
    ok_text = N_("Stage conflicts")
    cancel_text = N_("Skip")
    return Interaction.confirm(title, msg, info, ok_text, default=False, cancel_text=cancel_text)
Example #7
0
    def do(self):
        files = self.filenames
        if not files:
            return

        title = N_("Delete Files?")
        msg = N_("The following files will be deleted:") + "\n\n"
        msg += file_summary(files)
        info_txt = N_("Delete %d file(s)?") % len(files)
        ok_txt = N_("Delete Files")

        if not Interaction.confirm(title, msg, info_txt, ok_txt, default=True, icon=resources.icon("remove.svg")):
            return

        return RemoveFiles.do(self)
Example #8
0
 def delete_bookmark(self):
     """Removes a bookmark from the bookmarks list"""
     item = self.selected_item()
     if not item:
         return
     repo = item.path
     title = N_('Delete Bookmark?')
     msg = N_('Delete Bookmark?')
     info_text = N_('%s will be removed from your bookmarks.') % repo
     ok_text = N_('Delete Bookmark')
     if not Interaction.confirm(
             title, msg, info_text, ok_text, icon=qtutils.discard_icon()):
         return
     self.settings.remove_bookmark(repo)
     self.settings.save()
     self.refresh()
Example #9
0
 def delete_bookmark(self):
     """Removes a bookmark from the bookmarks list"""
     item = self.selected_item()
     if not item:
         return
     repo = item.path
     title = N_('Delete Bookmark?')
     msg = N_('Delete Bookmark?')
     info_text = N_('%s will be removed from your bookmarks.') % repo
     ok_text = N_('Delete Bookmark')
     if not Interaction.confirm(title, msg, info_text, ok_text,
                                icon=qtutils.discard_icon()):
         return
     self.settings.remove_bookmark(repo)
     self.settings.save()
     self.refresh()
Example #10
0
    def do(self):
        files = self.filenames
        if not files:
            return

        title = N_('Delete Files?')
        msg = N_('The following files will be deleted:') + '\n\n'
        msg += file_summary(files)
        info_txt = N_('Delete %d file(s)?') % len(files)
        ok_txt = N_('Delete Files')

        if not Interaction.confirm(title, msg, info_txt, ok_txt,
                                   default=True,
                                   icon=resources.icon('remove.svg')):
            return

        return RemoveFiles.do(self)
Example #11
0
    def do(self):
        files = self.filenames
        if not files:
            return

        title = N_('Delete Files?')
        msg = N_('The following files will be deleted:') + '\n\n'
        msg += file_summary(files)
        info_txt = N_('Delete %d file(s)?') % len(files)
        ok_txt = N_('Delete Files')

        if not Interaction.confirm(title, msg, info_txt, ok_txt,
                                   default=True,
                                   icon=resources.icon('remove.svg')):
            return

        return RemoveFiles.do(self)
Example #12
0
 def do(self):
     if not self.model.undoable():
         return
     s = selection.selection()
     if s.staged:
         items_to_undo = s.staged
     else:
         items_to_undo = s.modified
     if items_to_undo:
         if not Interaction.confirm(N_('Revert Unstaged Changes?'),
                                N_('This operation drops unstaged changes.\n'
                                   'These changes cannot be recovered.'),
                                N_('Revert the unstaged changes?'),
                                N_('Revert Unstaged Changes'),
                                default=True,
                                icon=resources.icon('undo.svg')):
             return
         args = []
         if not s.staged and self.model.amending():
             args.append(self.model.head)
         do(Checkout, args + ['--'] + items_to_undo)
     else:
         msg = N_('No files selected for checkout from HEAD.')
         Interaction.log(msg)
Example #13
0
 def confirm(self):
     title = N_('Delete Remote')
     question = N_('Delete remote?')
     info = N_('Delete remote "%s"') % self.remote
     ok_btn = N_('Delete')
     return Interaction.confirm(title, question, info, ok_btn)
Example #14
0
 def confirm(self):
     repo = self.repo
     title = msg = N_('Delete Bookmark?')
     info = N_('%s will be removed from your bookmarks.') % repo
     ok_text = N_('Delete Bookmark')
     return Interaction.confirm(title, msg, info, ok_text, icon=self.icon)
Example #15
0
 def confirm(self):
     repo = self.repo
     title = msg = N_('Remove %s from the recent list?') % repo
     info = N_('%s will be removed from your recent repositories.') % repo
     ok_text = N_('Remove')
     return Interaction.confirm(title, msg, info, ok_text, icon=self.icon)
Example #16
0
 def confirm(self):
     repo = self.repo
     title = msg = N_('Delete Bookmark?')
     info = N_('%s will be removed from your bookmarks.') % repo
     ok_text = N_('Delete Bookmark')
     return Interaction.confirm(title, msg, info, ok_text, icon=self.icon)
Example #17
0
 def confirm(self):
     title = N_("Revert Unstaged Changes?")
     text = N_("This operation drops unstaged changes.\n" "These changes cannot be recovered.")
     info = N_("Revert the unstaged changes?")
     ok_text = N_("Revert Unstaged Changes")
     return Interaction.confirm(title, text, info, ok_text, default=True, icon=self.icon)
Example #18
0
 def confirm(self):
     title = N_('Delete Remote')
     question = N_('Delete remote?')
     info = N_('Delete remote "%s"') % self.remote
     ok_btn = N_('Delete')
     return Interaction.confirm(title, question, info, ok_btn)
Example #19
0
 def confirm(self):
     repo = self.repo
     title = msg = N_('Remove %s from the recent list?') % repo
     info = N_('%s will be removed from your recent repositories.') % repo
     ok_text = N_('Remove')
     return Interaction.confirm(title, msg, info, ok_text, icon=self.icon)