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

workbench: use saveGeometry/restoreGeometry

According to the docs the restoreGeometry function also checks if the restored geometry is outside
the available screen geometry, and modifies it as appropriate if it is.

Requires at least Qt 4.3 (according to PyQt book).

Changeset 4df33d74888a

Parent 47a360d8ba3d

by Adrian Buehlmann

Changes to 2 files · Browse files at 4df33d74888a Showing diff from parent 47a360d8ba3d Diff from another changeset...

Change 1 of 1 Show Changes Only CONTRIBUTING.txt Stacked
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
18
19
20
21
22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
17
18
19
20
21
22
 == Rules for contributing to TortoiseHg ==    Note that these rules may change together with the code base as the project  evolves. Specifically, the compatibility rules in the default branch may be  different from those in the stable branch.    === Library compatibility ===    Our code base assumes minimum versions of library components as listed below.  That is, our code must not depend on features or API's that were introduced  in any later versions of the respective components.  It may be ok though if some advanced user interface features are available only  if later versions of a library are found to be present at runtime, provided the  application is still reasonably usable with the base library versions listed  below.   -PyGtk: 2.10 +PyQt: 4.3    === Python version ===    TortoiseHg needs to run on Python 2.4, to stay consistent with Mercurial  itself.
 
83
84
85
86
87
88
89
90
91
92
93
 
 
94
95
96
 
552
553
554
555
556
557
 
558
559
560
 
83
84
85
 
 
 
 
 
 
 
 
86
87
88
89
90
 
546
547
548
 
 
 
549
550
551
552
@@ -83,14 +83,8 @@
  self.startrev_entry.setText(str(fromhead))   self.setupRevisionTable()   - settings = QtCore.QSettings() - V = QtCore.QVariant - S = QtCore.QSize - P = QtCore.QPoint - size = settings.value("Workbench/Size", V(S(600, 500))).toSize() - self.resize(size) - pos = settings.value("Workbench/Position", V(P(0, 0))).toPoint() - self.move(pos) + s = QtCore.QSettings() + self.restoreGeometry(s.value("Workbench/geometry").toByteArray())     self._repodate = self._getrepomtime()   self._watchrepotimer = self.startTimer(500) @@ -552,9 +546,7 @@
  if not self.okToContinue():   event.ignore()   s = QtCore.QSettings() - V = QtCore.QVariant - s.setValue("Workbench/Size", V(self.size())) - s.setValue("Workbench/Position", V(self.pos())) + s.setValue("Workbench/geometry", self.saveGeometry());    def run(ui, *pats, **opts):   from tortoisehg.hgqt import setup_font_substitutions