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

about: porting to pyqt

Changeset 1001976be872

Parent 9476c0faabc1

by Johan Samyn

Changes to 7 files · Browse files at 1001976be872 Showing diff from parent 9476c0faabc1 Diff from another changeset...

Change 1 of 1 Show Entire File tortoisehg/​hgqt/​about.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
@@ -0,0 +1,110 @@
+# about.py - About dialog for TortoiseHg +# +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org> +# Copyright 2010 Yuki KODAMA <endflow.net@gmail.com> +# Copyright 2010 Johan Samyn <johan.samyn@gmail.com> +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference. +""" +TortoiseHg About dialog - PyQt4 version +""" + +import os, sys, urllib2 + +from PyQt4.QtCore import PYQT_VERSION_STR, QT_VERSION_STR +from PyQt4.QtGui import QIcon, QPixmap, QDialog + +from tortoisehg.util.i18n import _ +from tortoisehg.util import version, hglib, shlib + +def make_version(tuple): + vers = ".".join([str(x) for x in tuple]) + return vers + +try: + from tortoisehg.hgqt.about_ui import Ui_AboutDialog +except ImportError: + from PyQt4 import uic + Ui_AboutDialog = uic.loadUiType(os.path.join(os.path.dirname(__file__), + 'about.ui'))[0] + +class AboutDialog(QDialog): + """Dialog for showing info about TortoiseHg""" + + _upgradeurl = '' + + def __init__(self, parent=None): + super(AboutDialog, self).__init__(parent) + + self._qui = Ui_AboutDialog() + self._qui.setupUi(self) + + icon = QIcon() + icon.addPixmap(QPixmap("icons/thg_logo.ico"), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) + self.setWindowTitle(_('About TortoiseHg')) + + self._qui.logo_label.setPixmap(QPixmap("icons/thg_logo_92x50.png")) + + thgv = version.version() + if '+' in thgv: + thgv = thgv[0:thgv.index('+')] + self._qui.name_version_label.setText(_('TortoiseHg (version %s)') % thgv) + + lib_versions = (_("with Mercurial-%s, Python-%s, PyQt-%s, Qt-%s") % \ + (hglib.hgversion, make_version(sys.version_info[0:3]), + PYQT_VERSION_STR, QT_VERSION_STR)) + self._qui.libs_label.setText(lib_versions) + + self._qui.copyright_label.setText(_('Copyright 2008-2010 Steve Borho and others')) + self._qui.courtesy_label.setText( + _('Several icons are courtesy of the TortoiseSVN project')) + + _verurl = 'http://tortoisehg.bitbucket.org/curversion.txt' + newver = (0,0,0) + self._upgradeurl = 'http://tortoisehg.org' + try: + f = urllib2.urlopen(_verurl).read().splitlines() + newver = tuple([int(p) for p in f[0].split('.')]) + self._upgradeurl = f[1] # generic download URL + platform = sys.platform + if platform == 'win32': + from win32process import IsWow64Process as IsX64 + platform = IsX64() and 'x64' or 'x86' + # linux2 for Linux, darwin for OSX + for line in f[2:]: + p, url = line.split(':') + if platform == p: + self._upgradeurl = url.strip() + break + except: + pass + try: + curver = tuple([int(p) for p in thgv.split('.')]) + except: + curver = (0,0,0) + if newver > curver: + self._qui.download_label.setText( + _('A new version of TortoiseHg is ready for download!')) + else: + self._qui.download_label.setText('') + dlurl = hglib.fromunicode(self._qui.download_url_label.text()) + dlurl = dlurl.replace('http://thg-download-url', self._upgradeurl) + self._qui.download_url_label.setText(dlurl) + + self._qui.license_button.setText(_('&License')) + self._qui.close_button.setText(_('&Close')) + + def actionVisitDownloadSite(self): + shlib.browse_url(self._upgradeurl) + + def actionShowLicense(self): + from tortoisehg.hgqt import license + ld = license.LicenseDialog(self) + ld.show() + + +def run(ui, *pats, **opts): + return AboutDialog()
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​about.ui Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <author>Johan Samyn &lt;johan.samyn@gmail.com&gt;</author> + <class>AboutDialog</class> + <widget class="QDialog" name="AboutDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>324</width> + <height>277</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>324</width> + <height>241</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>99999</width> + <height>99999</height> + </size> + </property> + <property name="windowTitle"> + <string>About TortoiseHg</string> + </property> + <property name="whatsThis"> + <string/> + </property> + <property name="locale"> + <locale language="English" country="UnitedStates"/> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <widget class="QLabel" name="name_version_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>75</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>14</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true">TortoiseHg (version %s)</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="libs_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>100</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="text"> + <string>with Mercurial-%s, Python-%s, PyQt4-%s, Qt-%s</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="download_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>180</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="text"> + <string>A new version of TortoisHg is ready for download!</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="copyright_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>130</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="text"> + <string>Copyright 2008-2010 Steve Borho and others</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QPushButton" name="close_button"> + <property name="geometry"> + <rect> + <x>235</x> + <y>240</y> + <width>75</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>&amp;Close</string> + </property> + </widget> + <widget class="QPushButton" name="license_button"> + <property name="geometry"> + <rect> + <x>15</x> + <y>240</y> + <width>75</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>&amp;License</string> + </property> + </widget> + <widget class="QLabel" name="download_url_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>200</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="mouseTracking"> + <bool>true</bool> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="text"> + <string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; +&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; +p, li { white-space: pre-wrap; } +&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt; +&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://thg_download_url&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://thg-download-url&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="openExternalLinks"> + <bool>false</bool> + </property> + </widget> + <widget class="QLabel" name="courtesy_label"> + <property name="geometry"> + <rect> + <x>10</x> + <y>150</y> + <width>301</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>8</pointsize> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="text"> + <string>Several icons are courtesy of the TortoiseSVN project</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="logo_label"> + <property name="geometry"> + <rect> + <x>116</x> + <y>16</y> + <width>92</width> + <height>50</height> + </rect> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <action name="actionVisitDownloadSite"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>visitDownloadSite</string> + </property> + </action> + <action name="actionshowLicense"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>showLicense</string> + </property> + <property name="toolTip"> + <string>showLicense</string> + </property> + </action> + </widget> + <resources/> + <connections> + <connection> + <sender>close_button</sender> + <signal>clicked()</signal> + <receiver>AboutDialog</receiver> + <slot>close()</slot> + <hints> + <hint type="sourcelabel"> + <x>272</x> + <y>251</y> + </hint> + <hint type="destinationlabel"> + <x>161</x> + <y>117</y> + </hint> + </hints> + </connection> + <connection> + <sender>download_url_label</sender> + <signal>linkActivated(QString)</signal> + <receiver>AboutDialog</receiver> + <slot>actionVisitDownloadSite()</slot> + <hints> + <hint type="sourcelabel"> + <x>208</x> + <y>215</y> + </hint> + <hint type="destinationlabel"> + <x>205</x> + <y>241</y> + </hint> + </hints> + </connection> + <connection> + <sender>license_button</sender> + <signal>clicked()</signal> + <receiver>AboutDialog</receiver> + <slot>actionShowLicense()</slot> + <hints> + <hint type="sourcelabel"> + <x>47</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>123</x> + <y>254</y> + </hint> + </hints> + </connection> + </connections> + <designerdata> + <property name="gridDeltaX"> + <number>5</number> + </property> + <property name="gridDeltaY"> + <number>5</number> + </property> + <property name="gridSnapX"> + <bool>true</bool> + </property> + <property name="gridSnapY"> + <bool>true</bool> + </property> + <property name="gridVisible"> + <bool>true</bool> + </property> + </designerdata> + <slots> + <slot>actionVisitDownloadSite()</slot> + <slot>actionShowLicense()</slot> + </slots> +</ui>
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​about_ui.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
@@ -0,0 +1,127 @@
+# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'about.ui' +# +# Created: Mon May 10 22:27:06 2010 +# by: PyQt4 UI code generator 4.7.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_AboutDialog(object): + def setupUi(self, AboutDialog): + AboutDialog.setObjectName("AboutDialog") + AboutDialog.resize(324, 277) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(AboutDialog.sizePolicy().hasHeightForWidth()) + AboutDialog.setSizePolicy(sizePolicy) + AboutDialog.setMinimumSize(QtCore.QSize(324, 241)) + AboutDialog.setMaximumSize(QtCore.QSize(99999, 99999)) + AboutDialog.setWhatsThis("") + AboutDialog.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + AboutDialog.setModal(True) + self.name_version_label = QtGui.QLabel(AboutDialog) + self.name_version_label.setGeometry(QtCore.QRect(10, 75, 301, 20)) + font = QtGui.QFont() + font.setPointSize(14) + font.setWeight(75) + font.setBold(True) + self.name_version_label.setFont(font) + self.name_version_label.setText("TortoiseHg (version %s)") + self.name_version_label.setAlignment(QtCore.Qt.AlignCenter) + self.name_version_label.setObjectName("name_version_label") + self.libs_label = QtGui.QLabel(AboutDialog) + self.libs_label.setGeometry(QtCore.QRect(10, 100, 301, 20)) + font = QtGui.QFont() + font.setPointSize(8) + font.setWeight(50) + font.setBold(False) + self.libs_label.setFont(font) + self.libs_label.setAlignment(QtCore.Qt.AlignCenter) + self.libs_label.setObjectName("libs_label") + self.download_label = QtGui.QLabel(AboutDialog) + self.download_label.setGeometry(QtCore.QRect(10, 180, 301, 20)) + font = QtGui.QFont() + font.setPointSize(8) + font.setWeight(50) + font.setBold(False) + self.download_label.setFont(font) + self.download_label.setAlignment(QtCore.Qt.AlignCenter) + self.download_label.setObjectName("download_label") + self.copyright_label = QtGui.QLabel(AboutDialog) + self.copyright_label.setGeometry(QtCore.QRect(10, 130, 301, 20)) + font = QtGui.QFont() + font.setPointSize(8) + font.setWeight(50) + font.setBold(False) + self.copyright_label.setFont(font) + self.copyright_label.setAlignment(QtCore.Qt.AlignCenter) + self.copyright_label.setObjectName("copyright_label") + self.close_button = QtGui.QPushButton(AboutDialog) + self.close_button.setGeometry(QtCore.QRect(235, 240, 75, 23)) + self.close_button.setObjectName("close_button") + self.license_button = QtGui.QPushButton(AboutDialog) + self.license_button.setGeometry(QtCore.QRect(15, 240, 75, 23)) + self.license_button.setObjectName("license_button") + self.download_url_label = QtGui.QLabel(AboutDialog) + self.download_url_label.setGeometry(QtCore.QRect(10, 200, 301, 20)) + font = QtGui.QFont() + font.setPointSize(8) + font.setWeight(50) + font.setBold(False) + self.download_url_label.setFont(font) + self.download_url_label.setMouseTracking(True) + self.download_url_label.setFrameShape(QtGui.QFrame.NoFrame) + self.download_url_label.setFrameShadow(QtGui.QFrame.Plain) + self.download_url_label.setText("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" +"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" +"p, li { white-space: pre-wrap; }\n" +"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8pt; font-weight:400; font-style:normal;\">\n" +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"http://thg_download_url\"><span style=\" text-decoration: underline; color:#0000ff;\">http://thg-download-url</span></a></p></body></html>") + self.download_url_label.setAlignment(QtCore.Qt.AlignCenter) + self.download_url_label.setOpenExternalLinks(False) + self.download_url_label.setObjectName("download_url_label") + self.courtesy_label = QtGui.QLabel(AboutDialog) + self.courtesy_label.setGeometry(QtCore.QRect(10, 150, 301, 20)) + font = QtGui.QFont() + font.setPointSize(8) + font.setWeight(50) + font.setBold(False) + self.courtesy_label.setFont(font) + self.courtesy_label.setAlignment(QtCore.Qt.AlignCenter) + self.courtesy_label.setObjectName("courtesy_label") + self.logo_label = QtGui.QLabel(AboutDialog) + self.logo_label.setGeometry(QtCore.QRect(116, 16, 92, 50)) + self.logo_label.setAutoFillBackground(True) + self.logo_label.setFrameShape(QtGui.QFrame.NoFrame) + self.logo_label.setText("") + self.logo_label.setAlignment(QtCore.Qt.AlignCenter) + self.logo_label.setObjectName("logo_label") + self.actionVisitDownloadSite = QtGui.QAction(AboutDialog) + self.actionVisitDownloadSite.setCheckable(True) + self.actionVisitDownloadSite.setObjectName("actionVisitDownloadSite") + self.actionshowLicense = QtGui.QAction(AboutDialog) + self.actionshowLicense.setCheckable(True) + self.actionshowLicense.setObjectName("actionshowLicense") + + self.retranslateUi(AboutDialog) + QtCore.QObject.connect(self.close_button, QtCore.SIGNAL("clicked()"), AboutDialog.close) + QtCore.QObject.connect(self.download_url_label, QtCore.SIGNAL("linkActivated(QString)"), AboutDialog.actionVisitDownloadSite) + QtCore.QObject.connect(self.license_button, QtCore.SIGNAL("clicked()"), AboutDialog.actionShowLicense) + QtCore.QMetaObject.connectSlotsByName(AboutDialog) + + def retranslateUi(self, AboutDialog): + AboutDialog.setWindowTitle(QtGui.QApplication.translate("AboutDialog", "About TortoiseHg", None, QtGui.QApplication.UnicodeUTF8)) + self.libs_label.setText(QtGui.QApplication.translate("AboutDialog", "with Mercurial-%s, Python-%s, PyQt4-%s, Qt-%s", None, QtGui.QApplication.UnicodeUTF8)) + self.download_label.setText(QtGui.QApplication.translate("AboutDialog", "A new version of TortoisHg is ready for download!", None, QtGui.QApplication.UnicodeUTF8)) + self.copyright_label.setText(QtGui.QApplication.translate("AboutDialog", "Copyright 2008-2010 Steve Borho and others", None, QtGui.QApplication.UnicodeUTF8)) + self.close_button.setText(QtGui.QApplication.translate("AboutDialog", "&Close", None, QtGui.QApplication.UnicodeUTF8)) + self.license_button.setText(QtGui.QApplication.translate("AboutDialog", "&License", None, QtGui.QApplication.UnicodeUTF8)) + self.courtesy_label.setText(QtGui.QApplication.translate("AboutDialog", "Several icons are courtesy of the TortoiseSVN project", None, QtGui.QApplication.UnicodeUTF8)) + self.actionVisitDownloadSite.setText(QtGui.QApplication.translate("AboutDialog", "visitDownloadSite", None, QtGui.QApplication.UnicodeUTF8)) + self.actionshowLicense.setText(QtGui.QApplication.translate("AboutDialog", "showLicense", None, QtGui.QApplication.UnicodeUTF8)) + self.actionshowLicense.setToolTip(QtGui.QApplication.translate("AboutDialog", "showLicense", None, QtGui.QApplication.UnicodeUTF8)) +
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​license.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@@ -0,0 +1,39 @@
+# license.py - license dialog for TortoiseHg +# +# Copyright 2007 TK Soh <teekaysoh@gmail.com> +# Copyright 2007 Steve Borho <steve@borho.org> +# Copyright 2010 Yuki KODAMA <endflow.net@gmail.com> +# Copyright 2010 Johan Samyn <johan.samyn@gmail.com> +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference. +""" +TortoiseHg License dialog - PyQt4 version +""" + +from PyQt4.QtGui import QDialog, QIcon, QPixmap + +from tortoisehg.util.i18n import _ + +try: + from tortoisehg.hgqt.license_ui import Ui_LicenseDialog +except ImportError: + from PyQt4 import uic + Ui_LicenseDialog = uic.loadUiType(os.path.join(os.path.dirname(__file__), + 'license.ui'))[0] + +class LicenseDialog(QDialog): + """Dialog for showing the TortoiseHg license""" + def __init__(self, parent=None): + super(LicenseDialog, self).__init__(parent) + self._qui = Ui_LicenseDialog() + self._qui.setupUi(self) + icon = QIcon() + icon.addPixmap(QPixmap("icons/thg_logo.ico"), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) + self.setWindowTitle(_('License')) + try: + lic = open('COPYING.txt', 'rb').read() + self._qui.licenseText.setPlainText(lic) + except (IOError): + pass
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​license.ui Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <author>Johan Samyn &lt;johan.samyn@gmail.com&gt;</author> + <class>LicenseDialog</class> + <widget class="QDialog" name="LicenseDialog"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>458</width> + <height>360</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="windowTitle"> + <string>License</string> + </property> + <property name="whatsThis"> + <string notr="true"/> + </property> + <property name="locale"> + <locale language="English" country="UnitedStates"/> + </property> + <property name="sizeGripEnabled"> + <bool>false</bool> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <item> + <widget class="QPlainTextEdit" name="licenseText"> + <property name="textInteractionFlags"> + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="btnClose"> + <property name="locale"> + <locale language="English" country="UnitedStates"/> + </property> + <property name="text"> + <string>&amp;Close</string> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + <action name="actionClose"> + <property name="text"> + <string>Close</string> + </property> + <property name="toolTip"> + <string>Close the License dialog</string> + </property> + </action> + </widget> + <resources/> + <connections> + <connection> + <sender>btnClose</sender> + <signal>clicked()</signal> + <receiver>LicenseDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>410</x> + <y>338</y> + </hint> + <hint type="destinationlabel"> + <x>228</x> + <y>179</y> + </hint> + </hints> + </connection> + </connections> +</ui>
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​license_ui.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'license.ui' +# +# Created: Mon May 10 22:26:55 2010 +# by: PyQt4 UI code generator 4.7.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_LicenseDialog(object): + def setupUi(self, LicenseDialog): + LicenseDialog.setObjectName("LicenseDialog") + LicenseDialog.setEnabled(True) + LicenseDialog.resize(458, 360) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(LicenseDialog.sizePolicy().hasHeightForWidth()) + LicenseDialog.setSizePolicy(sizePolicy) + LicenseDialog.setMaximumSize(QtCore.QSize(16777215, 16777215)) + LicenseDialog.setWhatsThis("None") + LicenseDialog.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + LicenseDialog.setSizeGripEnabled(False) + LicenseDialog.setModal(True) + self.verticalLayout = QtGui.QVBoxLayout(LicenseDialog) + self.verticalLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) + self.verticalLayout.setObjectName("verticalLayout") + self.licenseText = QtGui.QPlainTextEdit(LicenseDialog) + self.licenseText.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.licenseText.setObjectName("licenseText") + self.verticalLayout.addWidget(self.licenseText) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setContentsMargins(-1, -1, -1, 0) + self.horizontalLayout.setObjectName("horizontalLayout") + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.btnClose = QtGui.QPushButton(LicenseDialog) + self.btnClose.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) + self.btnClose.setFlat(False) + self.btnClose.setObjectName("btnClose") + self.horizontalLayout.addWidget(self.btnClose) + self.verticalLayout.addLayout(self.horizontalLayout) + self.actionClose = QtGui.QAction(LicenseDialog) + self.actionClose.setObjectName("actionClose") + + self.retranslateUi(LicenseDialog) + QtCore.QObject.connect(self.btnClose, QtCore.SIGNAL("clicked()"), LicenseDialog.accept) + QtCore.QMetaObject.connectSlotsByName(LicenseDialog) + + def retranslateUi(self, LicenseDialog): + LicenseDialog.setWindowTitle(QtGui.QApplication.translate("LicenseDialog", "License", None, QtGui.QApplication.UnicodeUTF8)) + self.btnClose.setText(QtGui.QApplication.translate("LicenseDialog", "&Close", None, QtGui.QApplication.UnicodeUTF8)) + self.actionClose.setText(QtGui.QApplication.translate("LicenseDialog", "Close", None, QtGui.QApplication.UnicodeUTF8)) + self.actionClose.setToolTip(QtGui.QApplication.translate("LicenseDialog", "Close the License dialog", None, QtGui.QApplication.UnicodeUTF8)) +
 
379
380
381
 
 
 
 
 
382
383
384
 
592
593
594
 
595
596
597
 
379
380
381
382
383
384
385
386
387
388
389
 
597
598
599
600
601
602
603
@@ -379,6 +379,11 @@
  from tortoisehg.hgqt.visdiff import run   qtrun(run, ui, *pats, **opts)   +def about(ui, *pats, **opts): + """about dialog""" + from tortoisehg.hgqt.about import run + qtrun(run, ui, *pats, **opts) +  ### help management, adapted from mercurial.commands.help_()  def help_(ui, name=None, with_version=False, **opts):   """show help for a command, extension, or list of commands @@ -592,6 +597,7 @@
 ]    table = { + "about": (about, [], _('thg about')),   "^clone":   (clone,   [('U', 'noupdate', None,