Commits

Alexandre Macabies committed 32a48bc

Adding size&pos memorization

Comments (0)

Files changed (1)

 
     def readSettings(self):
         self.settings.beginGroup("main")
-#        self.resize(self.settings.value("size", QSize(400, 400)).toSize())
-#        self.move(self.settings.value("pos", QPoint(200, 200)).toPoint())
+        self.resize(self.settings.value("size", QtCore.QSize(400, 400)))
+        self.move(self.settings.value("pos", QtCore.QPoint(200, 200)))
         self.selectItemByData(self.ui.lng_from, self.settings.value("lng_from", 'fr'))
         self.selectItemByData(self.ui.lng_to, self.settings.value("lng_to", 'en'))
         self.ui.font_size.setValue(int(self.settings.value("font_size", self.ui.o_text.font().pointSize())))
         self.settings.endGroup()
 
     def writeSettings(self):
+        lng_from, lng_to, _ = self.getData()
         self.settings.beginGroup("main")
-        lng_from, lng_to, _ = self.getData()
         self.settings.setValue("lng_from", lng_from)
         self.settings.setValue("lng_to", lng_to)
         self.settings.setValue("font_size", self.ui.font_size.value())
+        self.settings.setValue("size", self.size())
+        self.settings.setValue("pos", self.pos())
         self.settings.endGroup()
 
     def closeEvent(self, e):