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 Entire File CONTRIBUTING.txt Stacked
 
14
15
16
17
 
18
19
20
 
14
15
16
 
17
18
19
20
@@ -14,7 +14,7 @@
 application is still reasonably usable with the base library versions listed  below.   -PyGtk: 2.10 +PyQt: 4.3    === Python version ===  
 
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