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

manifestdialog: rename text() and textChanged() to status() and statusChanged()

Changeset 132987595b11

Parent 68fd64ebe685

by Yuya Nishihara

Changes to one file · Browse files at 132987595b11 Showing diff from parent 68fd64ebe685 Diff from another changeset...

 
161
162
163
164
 
165
166
167
 
185
186
187
188
 
189
190
191
 
193
194
195
196
197
 
 
198
199
200
201
202
203
 
204
205
206
 
259
260
261
262
 
263
264
265
266
 
267
268
269
270
 
271
272
273
 
 
274
275
276
 
286
287
288
289
290
 
 
291
292
293
 
294
295
296
297
298
299
 
300
301
302
 
161
162
163
 
164
165
166
167
 
185
186
187
 
188
189
190
191
 
193
194
195
 
 
196
197
198
199
200
201
202
 
203
204
205
206
 
259
260
261
 
262
263
264
265
 
266
267
268
269
 
270
271
 
 
272
273
274
275
276
 
286
287
288
 
 
289
290
291
 
 
292
293
294
295
296
297
 
298
299
300
301
@@ -161,7 +161,7 @@
  getattr(self._fileview, name).connect(getattr(self, name))     def _initactions(self): - self._statusfilter = _StatusFilterButton(text='MAC') + self._statusfilter = _StatusFilterButton(statustext='MAC')   self._toolbar.addWidget(self._statusfilter)     self._action_annotate_mode = QAction(_('Annotate'), self, checkable=True) @@ -185,7 +185,7 @@
    def _setupmodel(self):   self._treemodel = ManifestModel(self._repo, self._rev, - statusfilter=self._statusfilter.text, + statusfilter=self._statusfilter.status(),   parent=self)   self._treeview.setModel(self._treemodel)   @@ -193,14 +193,14 @@
  selmodel.currentChanged.connect(self._updatecontent)   selmodel.currentChanged.connect(self._emitPathChanged)   - self._statusfilter.textChanged.connect(self._treemodel.setStatusFilter) - self._statusfilter.textChanged.connect(self._autoexpandtree) + self._statusfilter.statusChanged.connect(self._treemodel.setStatusFilter) + self._statusfilter.statusChanged.connect(self._autoexpandtree)   self._autoexpandtree()     @pyqtSlot()   def _autoexpandtree(self):   """expand file tree if the number of the items isn't large""" - if 'C' not in self._statusfilter.text: + if 'C' not in self._statusfilter.status():   self._treeview.expandAll()     def reload(self): @@ -259,18 +259,18 @@
 # TODO: share this menu with status widget?  class _StatusFilterButton(QToolButton):   """Button with drop-down menu for status filter""" - textChanged = pyqtSignal(str) + statusChanged = pyqtSignal(str)     _TYPES = 'MARC'   - def __init__(self, text=_TYPES, parent=None): + def __init__(self, statustext=_TYPES, parent=None, **kwargs):   super(_StatusFilterButton, self).__init__(   parent, popupMode=QToolButton.InstantPopup,   icon=qtlib.geticon('status'), - toolButtonStyle=Qt.ToolButtonTextBesideIcon) + toolButtonStyle=Qt.ToolButtonTextBesideIcon, **kwargs)   - self._initactions(text=text) - self._setText(self.text) + self._initactions(statustext) + self._setText(self.status())     def _initactions(self, text):   self._actions = {} @@ -286,17 +286,16 @@
    @pyqtSlot()   def _update(self): - self._setText(self.text) - self.textChanged.emit(self.text) + self._setText(self.status()) + self.statusChanged.emit(self.status())   - @property - def text(self): + def status(self):   """Return the text for status filter"""   return ''.join(c for c in self._TYPES   if self._actions[c].isChecked())     @pyqtSlot(str) - def setText(self, text): + def setStatus(self, text):   """Set the status text"""   assert util.all(c in self._TYPES for c in text)   for c in self._TYPES: