Exemplo n.º 1
0
    def remote_renamed(self, item):
        idx = self.remotes.row(item)
        if idx < 0:
            return
        if idx >= len(self.remote_list):
            return

        old_name = self.remote_list[idx]
        new_name = unicode(item.text())
        if new_name == old_name:
            return
        if not new_name:
            item.setText(old_name)
            return

        title = N_("Rename Remote")
        question = N_("Rename remote?")
        info = N_('Rename remote "%(current)s" to "%(new)s"?') % dict(current=old_name, new=new_name)
        ok_btn = N_("Rename")

        if qtutils.confirm(title, question, info, ok_btn):
            git.remote("rename", old_name, new_name)
            self.remote_list[idx] = new_name
        else:
            item.setText(old_name)
Exemplo n.º 2
0
    def remote_renamed(self, item):
        idx = self.remotes.row(item)
        if idx < 0:
            return
        if idx >= len(self.remote_list):
            return

        old_name = self.remote_list[idx]
        new_name = unicode(item.text())
        if new_name == old_name:
            return
        if not new_name:
            item.setText(old_name)
            return

        title = N_('Rename Remote')
        question = N_('Rename remote?')
        info = (N_('Rename remote "%(current)s" to "%(new)s"?') %
                dict(current=old_name, new=new_name))
        ok_btn = N_('Rename')

        if qtutils.confirm(title, question, info, ok_btn):
            git.remote('rename', old_name, new_name)
            self.remote_list[idx] = new_name
        else:
            item.setText(old_name)
Exemplo n.º 3
0
    def remote_renamed(self, item):
        idx = self.remotes.row(item)
        if idx < 0:
            return
        if idx >= len(self.remote_list):
            return

        old_name = self.remote_list[idx]
        new_name = unicode(item.text())
        if new_name == old_name:
            return
        if not new_name:
            item.setText(old_name)
            return

        title = 'Rename Remote'
        question = 'Rename remote?'
        info = unicode(self.tr(
                'Rename remote "%s" to "%s"?')) % (old_name, new_name)
        ok_btn = 'Rename'

        if qtutils.confirm(title, question, info, ok_btn):
            git.remote('rename', old_name, new_name)
            self.remote_list[idx] = new_name
        else:
            item.setText(old_name)
Exemplo n.º 4
0
    def remote_renamed(self, item):
        idx = self.remotes.row(item)
        if idx < 0:
            return
        if idx >= len(self.remote_list):
            return

        old_name = self.remote_list[idx]
        new_name = unicode(item.text())
        if new_name == old_name:
            return
        if not new_name:
            item.setText(old_name)
            return

        title = 'Rename Remote'
        question = 'Rename remote?'
        info = unicode(
            self.tr('Rename remote "%s" to "%s"?')) % (old_name, new_name)
        ok_btn = 'Rename'

        if qtutils.confirm(title, question, info, ok_btn):
            git.remote('rename', old_name, new_name)
            self.remote_list[idx] = new_name
        else:
            item.setText(old_name)
Exemplo n.º 5
0
    def remote_renamed(self, item):
        idx = self.remotes.row(item)
        if idx < 0:
            return
        if idx >= len(self.remote_list):
            return

        old_name = self.remote_list[idx]
        new_name = ustr(item.text())
        if new_name == old_name:
            return
        if not new_name:
            item.setText(old_name)
            return

        title = N_('Rename Remote')
        question = N_('Rename remote?')
        info = (N_('Rename remote "%(current)s" to "%(new)s"?') %
                dict(current=old_name, new=new_name))
        ok_btn = N_('Rename')

        if qtutils.confirm(title, question, info, ok_btn):
            status, out, err = git.remote('rename', old_name, new_name)
            if status == 0:
                self.remote_list[idx] = new_name
        else:
            item.setText(old_name)
Exemplo n.º 6
0
 def add(self):
     widget = AddRemoteWidget(self)
     if not widget.add_remote():
         return
     name = widget.name.value()
     url = widget.url.value()
     status, out = git.remote("add", name, url, with_status=True, with_stderr=True)
     if status != 0:
         qtutils.critical(N_('Error creating remote "%s"') % name, out)
     self.refresh()
Exemplo n.º 7
0
 def refresh(self):
     remotes = core.decode(git.remote()).splitlines()
     self.remotes.clear()
     self.remotes.addItems(remotes)
     self.remote_list = remotes
     self.info.set_hint(self.default_hint)
     self.info.enable_hint(True)
     for idx, r in enumerate(remotes):
         item = self.remotes.item(idx)
         item.setFlags(item.flags() | Qt.ItemIsEditable)
Exemplo n.º 8
0
 def refresh(self):
     remotes = git.remote()[STDOUT].splitlines()
     self.remotes.clear()
     self.remotes.addItems(remotes)
     self.remote_list = remotes
     self.info.hint.set_value(self.default_hint)
     self.info.hint.enable(True)
     for idx, r in enumerate(remotes):
         item = self.remotes.item(idx)
         item.setFlags(item.flags() | Qt.ItemIsEditable)
Exemplo n.º 9
0
 def refresh(self):
     remotes = git.remote()[STDOUT].splitlines()
     self.remotes.clear()
     self.remotes.addItems(remotes)
     self.remote_list = remotes
     self.info.set_hint(self.default_hint)
     self.info.enable_hint(True)
     for idx, r in enumerate(remotes):
         item = self.remotes.item(idx)
         item.setFlags(item.flags() | Qt.ItemIsEditable)
Exemplo n.º 10
0
 def add(self):
     widget = AddRemoteWidget(self)
     if not widget.add_remote():
         return
     name = widget.name.value()
     url = widget.url.value()
     status, out, err = git.remote('add', name, url)
     if status != 0:
         qtutils.critical(N_('Error creating remote "%s"') % name,
                          out + err)
     self.refresh()
Exemplo n.º 11
0
 def add(self):
     widget = AddRemoteWidget(self)
     if not widget.add_remote():
         return
     name = widget.name.value()
     url = widget.url.value()
     status, out, err = git.remote('add', name, url)
     if status != 0:
         qtutils.critical(
             N_('Error creating remote "%s"') % name, out + err)
     self.refresh()
Exemplo n.º 12
0
 def run(self):
     remote = self.remote
     if remote is None:
         return
     status, out, err = git.remote('show', remote)
     # This call takes a long time and we may have selected a
     # different remote...
     if remote == self.remote:
         self.emit(SIGNAL('info'), out + err)
     else:
         self.run()
Exemplo n.º 13
0
 def run(self):
     remote = self.remote
     if remote is None:
         return
     status, out, err = git.remote('show', remote)
     # This call takes a long time and we may have selected a
     # different remote...
     if remote == self.remote:
         self.emit(SIGNAL('info(PyQt_PyObject)'), out + err)
     else:
         self.run()
Exemplo n.º 14
0
 def run(self):
     remote = self.remote
     if remote is None:
         return
     status, out = git.remote("show", remote, with_stderr=True, with_status=True)
     out = core.decode(out)
     # This call takes a long time and we may have selected a
     # different remote...
     if remote == self.remote:
         self.emit(SIGNAL("info"), out)
     else:
         self.run()
Exemplo n.º 15
0
 def run(self):
     remote = self.remote
     if remote is None:
         return
     status, out = git.remote('show', remote,
                              with_stderr=True, with_status=True)
     out = core.decode(out)
     # This call takes a long time and we may have selected a
     # different remote...
     if remote == self.remote:
         self.emit(SIGNAL('info'), out)
     else:
         self.run()
Exemplo n.º 16
0
 def add(self):
     widget = AddRemoteWidget(self)
     if not widget.add_remote():
         return
     name = widget.name.value()
     url = widget.url.value()
     status, out = git.remote('add',
                              name,
                              url,
                              with_status=True,
                              with_stderr=True)
     if status != 0:
         qtutils.critical('Error creating remote "%s"' % name, out)
     self.refresh()
Exemplo n.º 17
0
    def delete(self):
        remote = qtutils.selected_item(self.remotes, self.remote_list)
        if remote is None:
            return

        title = N_("Delete Remote")
        question = N_("Delete remote?")
        info = N_('Delete remote "%s"') % remote
        ok_btn = N_("Delete")
        if not qtutils.confirm(title, question, info, ok_btn):
            return

        status, out = git.remote("rm", remote, with_status=True, with_stderr=True)
        if status != 0:
            qtutils.critical(N_('Error deleting remote "%s"') % remote, out)
        cola.model().update_status()
        self.refresh()
Exemplo n.º 18
0
    def delete(self):
        remote = qtutils.selected_item(self.remotes, self.remote_list)
        if remote is None:
            return

        title = N_('Delete Remote')
        question = N_('Delete remote?')
        info = N_('Delete remote "%s"') % remote
        ok_btn = N_('Delete')
        if not qtutils.confirm(title, question, info, ok_btn):
            return

        status, out, err = git.remote('rm', remote)
        if status != 0:
            qtutils.critical(N_('Error deleting remote "%s"') % remote,
                             out + err)
        main.model().update_status()
        self.refresh()
Exemplo n.º 19
0
    def delete(self):
        remote = qtutils.selected_item(self.remotes, self.remote_list)
        if remote is None:
            return

        title = N_('Delete Remote')
        question = N_('Delete remote?')
        info = N_('Delete remote "%s"') % remote
        ok_btn = N_('Delete')
        if not qtutils.confirm(title, question, info, ok_btn):
            return

        status, out, err = git.remote('rm', remote)
        if status != 0:
            qtutils.critical(
                N_('Error deleting remote "%s"') % remote, out + err)
        main.model().update_status()
        self.refresh()
Exemplo n.º 20
0
    def delete(self):
        remote = qtutils.selected_item(self.remotes, self.remote_list)
        if remote is None:
            return

        title = 'Delete Remote'
        question = 'Delete remote?'
        info = unicode(self.tr('Delete remote "%s"')) % remote
        ok_btn = 'Delete'
        if not qtutils.confirm(title, question, info, ok_btn):
            return

        status, out = git.remote('rm',
                                 remote,
                                 with_status=True,
                                 with_stderr=True)
        if status != 0:
            qtutils.critical('Error deleting remote "%s"' % remote, out)
        cola.model().update_status()
        self.refresh()