src/eric7/Snapshot/SnapshotTimer.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
38 self.__time = 0 38 self.__time = 0
39 self.__length = 0 39 self.__length = 0
40 self.__toggle = True 40 self.__toggle = True
41 41
42 # text is taken from paintEvent with maximum number plus some margin 42 # text is taken from paintEvent with maximum number plus some margin
43 try: 43 fmWidth = self.fontMetrics().horizontalAdvance(
44 fmWidth = self.fontMetrics().horizontalAdvance( 44 self.tr("Snapshot will be taken in %n seconds", "", 99)
45 self.tr("Snapshot will be taken in %n seconds", "", 99) 45 )
46 )
47 except AttributeError:
48 fmWidth = self.fontMetrics().width(
49 self.tr("Snapshot will be taken in %n seconds", "", 99)
50 )
51 self.resize(fmWidth + 6, self.fontMetrics().height() + 4) 46 self.resize(fmWidth + 6, self.fontMetrics().height() + 4)
52 47
53 self.__timer.timeout.connect(self.__bell) 48 self.__timer.timeout.connect(self.__bell)
54 49
55 def start(self, seconds): 50 def start(self, seconds):

eric ide

mercurial