Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable sync: layout improvements (close #108)

* move p4pending into the toolbar where it belongs, as it's a command action
* move options widgets into the toolbar proper using separators
* disable the stop button at startup, like it should have always been
* move URL editing widgets into a group box to isolate them logically

Changeset 972f7cd87206

Parent bd0e49b1a6bc

by Steve Borho

Changes to one file · Browse files at 972f7cd87206 Showing diff from parent bd0e49b1a6bc Diff from another changeset...

 
61
62
63
64
65
66
67
68
69
 
 
70
71
72
 
82
83
84
85
 
86
 
 
 
 
 
 
 
 
87
88
89
90
 
91
92
93
94
95
96
97
98
99
100
 
101
102
103
104
105
 
 
106
107
108
109
110
111
112
 
 
 
113
114
115
116
117
118
119
120
121
122
 
 
123
 
 
124
125
 
126
 
127
128
129
 
150
151
152
153
154
155
156
 
190
191
192
193
194
195
196
197
 
494
495
496
497
 
498
499
500
 
503
504
505
506
 
507
508
509
 
61
62
63
 
 
 
 
64
 
65
66
67
68
69
 
79
80
81
 
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
 
 
98
 
 
 
 
 
 
99
100
101
 
 
 
102
103
104
105
106
107
108
 
 
109
110
111
112
113
114
115
 
116
117
118
119
 
120
121
122
123
124
125
 
126
127
128
129
130
131
 
152
153
154
 
155
156
157
 
191
192
193
 
 
194
195
196
 
493
494
495
 
496
497
498
499
 
502
503
504
 
505
506
507
508
@@ -61,12 +61,9 @@
  self.setWindowTitle(_('TortoiseHg Sync'))   self.resize(850, 550)   - hbox = QHBoxLayout() - hbox.setContentsMargins(0, 0, 0, 0) - hbox.setSpacing(4) -   tb = QToolBar(self) - sactions = [] + self.layout().addWidget(tb) + self.opbuttons = []   for tip, icon, cb in (   (_('Preview incoming changesets from specified URL'),   'incoming', self.inclicked), @@ -82,48 +79,53 @@
  a.setToolTip(tip)   a.setIcon(qtlib.geticon(icon))   a.triggered.connect(cb) - sactions.append(a) + self.opbuttons.append(a)   tb.addAction(a) + if 'perfarce' in self.repo.extensions(): + a = QAction(self) + a.setToolTip(_('Manage pending perforce changelists')) + a.setText('P4') + a.triggered.connect(self.p4pending) + self.opbuttons.append(a) + tb.addAction(a) + tb.addSeparator()   self.stopAction = a = QAction(self)   a.setToolTip(_('Stop current operation'))   a.setIcon(qtlib.geticon('process-stop'))   a.triggered.connect(self.stopclicked) + a.setEnabled(False)   tb.addAction(a) - hbox.addWidget(tb) - self.layout().addLayout(hbox)   - if 'perfarce' in self.repo.extensions(): - self.p4pbutton = QPushButton(_('p4pending')) - self.p4pbutton.clicked.connect(self.p4pending) - hbox.addWidget(self.p4pbutton) - else: - self.p4pbutton = None + tb.addSeparator()   self.optionsbutton = QPushButton(_('Options'))   self.postpullbutton = QPushButton() - tb.setMaximumHeight(self.postpullbutton.sizeHint().height()) - hbox.addWidget(self.postpullbutton) - hbox.addWidget(self.optionsbutton) + tb.addWidget(self.postpullbutton) + tb.addWidget(self.optionsbutton)     self.targetcombo = QComboBox()   self.targetcombo.setEnabled(False)   self.targetcheckbox = QCheckBox(_('Target:'))   self.targetcheckbox.toggled.connect(self.targetcombo.setEnabled) - hbox.addWidget(self.targetcheckbox) - hbox.addWidget(self.targetcombo) + tb.addSeparator() + tb.addWidget(self.targetcheckbox) + tb.addWidget(self.targetcombo)   if not embedded:   self.targetcombo.setHidden(True)   self.targetcheckbox.setHidden(True)   - hbox.addStretch(1)   self.urllabel = QLabel()   self.urllabel.setMargin(4)   self.urllabel.setTextInteractionFlags(Qt.TextSelectableByMouse)   self.urllabel.setAcceptDrops(False) - hbox.addWidget(self.urllabel) + tb.addSeparator() + tb.addWidget(self.urllabel)   + urlbox = QGroupBox(_('URL')) + self.layout().addWidget(urlbox)   hbox = QHBoxLayout() - hbox.setContentsMargins(0, 0, 0, 0) + urlbox.setLayout(hbox)   hbox.setSpacing(4) +   self.schemecombo = QComboBox()   for s in _schemes:   self.schemecombo.addItem(s) @@ -150,7 +152,6 @@
  hbox.addWidget(self.securebutton)   self.savebutton = QPushButton(_('Save'))   hbox.addWidget(self.savebutton) - self.layout().addLayout(hbox)     hbox = QHBoxLayout()   hbox.setContentsMargins(0, 0, 0, 0) @@ -190,8 +191,6 @@
  self.postpullbutton.clicked.connect(self.postpullclicked)   self.optionsbutton.pressed.connect(self.editOptions)   - self.opbuttons = sactions + [self.p4pbutton] -   cmd = cmdui.Widget(not embedded, self)   cmd.commandStarted.connect(self.commandStarted)   cmd.commandFinished.connect(self.commandFinished) @@ -494,7 +493,7 @@
    def commandStarted(self):   for b in self.opbuttons: - if b: b.setEnabled(False) + b.setEnabled(False)   self.stopAction.setEnabled(True)   if not self.embedded:   self.cmd.setShowOutput(True) @@ -503,7 +502,7 @@
  def commandFinished(self, ret):   self.repo.decrementBusyCount()   for b in self.opbuttons: - if b: b.setEnabled(True) + b.setEnabled(True)   self.stopAction.setEnabled(False)   if self.finishfunc:   output = self.cmd.core.rawoutput()