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

changeset: add commit button

making message field editable for working context

Changeset 2b853f3fda3e

Parent 3c38a0bf2a02

by Adrian Buehlmann

Changes to 2 files · Browse files at 2b853f3fda3e Showing diff from parent 3c38a0bf2a02 Diff from another changeset...

 
56
57
58
 
 
 
59
60
61
 
67
68
69
 
70
71
72
73
 
 
 
 
74
75
76
 
78
79
80
81
 
82
83
 
 
 
 
 
 
 
84
85
86
87
 
 
 
88
89
90
 
148
149
150
 
 
 
 
 
151
152
153
 
225
226
227
 
 
 
 
 
 
228
229
230
 
56
57
58
59
60
61
62
63
64
 
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
86
87
88
 
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
 
166
167
168
169
170
171
172
173
174
175
176
 
248
249
250
251
252
253
254
255
256
257
258
259
@@ -56,6 +56,9 @@
  """   Display metadata for one revision (rev, author, description, etc.)   """ + + commitsignal = QtCore.pyqtSignal() +   def __init__(self, parent=None):   QtGui.QWidget.__init__(self, parent)   self._message = None @@ -67,10 +70,15 @@
  self._header = w = QtGui.QLabel()   w.setTextInteractionFlags(Qt.TextSelectableByMouse | Qt.LinksAccessibleByMouse)   hb.addWidget(w) + hb.addStretch(0)     vb = QtGui.QVBoxLayout()   hb.addLayout(vb)   + hb2 = QtGui.QHBoxLayout() + hb2.addStretch(0) + vb.addLayout(hb2) +   # expand header button   self._expander = w = QtGui.QToolButton()   w.setArrowType(Qt.UpArrow) @@ -78,13 +86,23 @@
  a = QtGui.QAction(self)   connect(a, SIGNAL("triggered()"), self.expand)   w.setDefaultAction(a) - vb.addWidget(w, 0, Qt.AlignTop) + hb2.addWidget(w, 0, Qt.AlignTop)   self._expanded = True   + hb3 = QtGui.QHBoxLayout() + hb3.addStretch(0) + vb.addLayout(hb3) + self._commitbutton = w = QtGui.QPushButton('Commit') + hb3.addWidget(w, 0, Qt.AlignBottom) + connect(w, SIGNAL('clicked()'), self.commit) +   connect(self._header,   SIGNAL('linkActivated(const QString&)'),   self.anchorClicked)   + def commit(self): + self.commitsignal.emit() +   def expand(self):   self._expanded = not self._expanded   if self._expanded: @@ -148,6 +166,11 @@
  def refreshDisplay(self):   ctx = self.ctx   rev = ctx.rev() + + enableci = self._expanded and not rev + self._commitbutton.setVisible(enableci) + self._message.setEditable(enableci) +   buf = headerstyle   if self.mqpatch:   buf += "<table width=100%>\n" @@ -225,6 +248,12 @@
    self.setLayout(vb)   + def setEditable(self, editable): + self._message.setReadOnly(not editable) + + def text(self): + return str(self._message.toPlainText()) +   def displayRevision(self, ctx):   self.ctx = ctx   desc = xml_escape(unicode(ctx.description(), 'utf-8', 'replace'))
 
74
75
76
 
 
77
78
79
 
99
100
101
 
 
 
 
 
 
 
102
103
104
 
74
75
76
77
78
79
80
81
 
101
102
103
104
105
106
107
108
109
110
111
112
113
@@ -74,6 +74,8 @@
    self.textview_header.setMessageWidget(self.message)   + self.textview_header.commitsignal.connect(self.commit) +   # setup tables and views   self.setupHeaderTextview()   connect(self.textview_status, SIGNAL('fileDisplayed'), @@ -99,6 +101,13 @@
  self._repodate = self._getrepomtime()   self._watchrepotimer = self.startTimer(500)   + def commit(self): + args = ['commit'] + args += ['-v', '-m', self.message.text()] + dlg = cmdui.Dialog(args) + dlg.show() + self._commitdlg = dlg +   def timerEvent(self, event):   if event.timerId() == self._watchrepotimer:   if not self._scanForRepoChanges or self.loading():