~ubuntu-branches/ubuntu/vivid/git-cola/vivid

« back to all changes in this revision

Viewing changes to cola/widgets/remote.py

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2014-02-14 13:13:33 UTC
  • mfrom: (1.3.22)
  • Revision ID: package-import@ubuntu.com-20140214131333-xbklb7yd9jntikpm
Tags: 1.9.4-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    model.tags = global_model.tags
45
45
    model.remotes = global_model.remotes
46
46
    parent = qtutils.active_window()
47
 
    view = RemoteDialog(model, parent)
 
47
    view = RemoteDialog(model, parent=parent)
48
48
    view.show()
49
49
    return view
50
50
 
117
117
 
118
118
class RemoteActionDialog(standard.Dialog):
119
119
 
120
 
    def __init__(self, model, action, parent):
 
120
    def __init__(self, model, action, parent=None):
121
121
        """Customizes the dialog based on the remote action
122
122
        """
123
123
        standard.Dialog.__init__(self, parent=parent)
128
128
        self.selected_remotes = []
129
129
 
130
130
        self.setAttribute(Qt.WA_MacMetalStyle)
131
 
        self.setWindowModality(Qt.WindowModal)
132
131
        self.setWindowTitle(N_(action))
 
132
        if parent is not None:
 
133
            self.setWindowModality(Qt.WindowModal)
133
134
 
134
135
        self.progress = QtGui.QProgressDialog(self)
135
136
        self.progress.setFont(qtutils.diff_font())
262
263
        else:
263
264
            self.rebase_checkbox.hide()
264
265
 
265
 
        if not qtutils.apply_state(self):
 
266
        if not self.restore_state():
266
267
            self.resize(666, 420)
267
268
 
268
269
        self.remote_name.setFocus()
545
546
 
546
547
# Use distinct classes so that each saves its own set of preferences
547
548
class Fetch(RemoteActionDialog):
548
 
    def __init__(self, model, parent):
549
 
        RemoteActionDialog.__init__(self, model, FETCH, parent)
 
549
    def __init__(self, model, parent=None):
 
550
        RemoteActionDialog.__init__(self, model, FETCH, parent=parent)
550
551
 
551
552
 
552
553
class Push(RemoteActionDialog):
553
 
    def __init__(self, model, parent):
554
 
        RemoteActionDialog.__init__(self, model, PUSH, parent)
 
554
    def __init__(self, model, parent=None):
 
555
        RemoteActionDialog.__init__(self, model, PUSH, parent=parent)
555
556
 
556
557
 
557
558
class Pull(RemoteActionDialog):
558
 
    def __init__(self, model, parent):
559
 
        RemoteActionDialog.__init__(self, model, PULL, parent)
 
559
    def __init__(self, model, parent=None):
 
560
        RemoteActionDialog.__init__(self, model, PULL, parent=parent)
560
561
 
561
562
    def apply_state(self, state):
562
 
        RemoteActionDialog.apply_state(self, state)
 
563
        result = RemoteActionDialog.apply_state(self, state)
563
564
        try:
564
565
            rebase = state['rebase']
565
566
        except KeyError:
566
 
            pass
 
567
            result = False
567
568
        else:
568
569
            self.rebase_checkbox.setChecked(rebase)
 
570
        return result
569
571
 
570
572
    def export_state(self):
571
573
        state = RemoteActionDialog.export_state(self)
573
575
        return state
574
576
 
575
577
    def done(self, exit_code):
576
 
        qtutils.save_state(self)
 
578
        self.save_state()
577
579
        return RemoteActionDialog.done(self, exit_code)