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

repowidget: use unique commit widget for each repo

Currently it uses repo._commitwidget to store the unique widget, though
I think it's ugly. It may need to be redesigned.

Changeset 2f792a147e02

Parent 3c9ea29aa2f5

by Yuya Nishihara

Changes to one file · Browse files at 2f792a147e02 Showing diff from parent 3c9ea29aa2f5 Diff from another changeset...

 
15
16
17
18
 
19
20
21
 
111
112
113
114
 
115
116
117
 
129
130
131
 
 
 
 
 
132
133
134
135
136
137
138
139
140
 
 
141
142
143
144
145
 
146
147
148
 
15
16
17
 
18
19
20
21
 
111
112
113
 
114
115
116
117
 
129
130
131
132
133
134
135
136
137
138
139
140
141
 
 
 
 
142
143
144
145
146
147
148
149
150
151
152
@@ -15,7 +15,7 @@
   from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt.qtlib import geticon, getfont, QuestionMsgBox, InfoMsgBox -from tortoisehg.hgqt.qtlib import CustomPrompt +from tortoisehg.hgqt.qtlib import CustomPrompt, SharedWidget  from tortoisehg.hgqt.repomodel import HgRepoListModel  from tortoisehg.hgqt import cmdui, update, tag, backout, merge  from tortoisehg.hgqt import archive, thgimport, thgstrip, run @@ -111,7 +111,7 @@
  sw.minimumSizeHint = lambda: QSize(0, 0)   self.commitTabIndex = idx = tt.addTab(sw, geticon('commit'), '')   tt.setTabToolTip(idx, _("Commit")) - self.commitStackedWidget.addWidget(self.createCommitWidget()) + self.commitStackedWidget.addWidget(SharedWidget(self.createCommitWidget()))   # TODO: unstack commit widget     self.syncStackedWidget = sw = QStackedWidget() @@ -129,20 +129,24 @@
  # TODO: unstack grep widget     def createCommitWidget(self): + cw = getattr(self.repo, '_commitwidget', None) # TODO: ugly + if cw: + cw.commitComplete.connect(self.reload) + return cw +   pats = {}   opts = {}   # TODO: pass repo directly instead of repo.root ?   cw = CommitWidget(pats, opts, root=self.repo.root)   cw.errorMessage.connect(self.workbench.showMessage) - def commitcomplete(): - self.reload() - cw.stwidget.refreshWctx() - cw.commitComplete.connect(commitcomplete) + cw.commitComplete.connect(self.reload) + cw.commitComplete.connect(cw.stwidget.refreshWctx)   b = QPushButton(_('Commit'))   cw.buttonHBox.addWidget(b)   b.clicked.connect(cw.commit)   s = QSettings()   cw.loadConfigs(s) + self.repo._commitwidget = cw   return cw     def createSyncWidget(self):