Minor fixups
Former-commit-id: 7e6057db62be3251f7f8ffffbbc7d054e92eb1b6
This commit is contained in:
parent
fed32e4de9
commit
a7813b9acd
@ -4,12 +4,12 @@
|
|||||||
"fgColor": 4278190080,
|
"fgColor": 4278190080,
|
||||||
"fontFamily": "Arial",
|
"fontFamily": "Arial",
|
||||||
"fontSize": 12,
|
"fontSize": 12,
|
||||||
"rememberTextBoxContent": true,
|
"rememberTextContent": false,
|
||||||
"loadRecentFile": false,
|
"loadRecentFile": false,
|
||||||
"maxResults": 20,
|
"maxResults": 20,
|
||||||
"profiles": {},
|
"profiles": {},
|
||||||
"recentFiles": [],
|
"recentFiles": [],
|
||||||
"textBoxContent": "",
|
"textContent": "",
|
||||||
"scanLength": 16,
|
"scanLength": 16,
|
||||||
"stripReadings": false,
|
"stripReadings": false,
|
||||||
"tags": [],
|
"tags": [],
|
||||||
|
@ -60,10 +60,10 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
|||||||
self.updateVocabDefs()
|
self.updateVocabDefs()
|
||||||
self.updateKanjiDefs()
|
self.updateKanjiDefs()
|
||||||
|
|
||||||
if self.preferences['rememberTextBoxContent']:
|
if filename is not None:
|
||||||
self.textContent.setPlainText(self.preferences['textBoxContent'])
|
|
||||||
elif filename is not None:
|
|
||||||
self.openFile(filename)
|
self.openFile(filename)
|
||||||
|
elif self.preferences['rememberTextContent']:
|
||||||
|
self.textContent.setPlainText(self.preferences['textContent'])
|
||||||
elif self.preferences['loadRecentFile']:
|
elif self.preferences['loadRecentFile']:
|
||||||
filenames = self.preferences.recentFiles()
|
filenames = self.preferences.recentFiles()
|
||||||
if len(filenames) > 0 and os.path.isfile(filenames[0]):
|
if len(filenames) > 0 and os.path.isfile(filenames[0]):
|
||||||
@ -135,8 +135,6 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
|||||||
|
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
if self.preferences['rememberTextBoxContent']: # Before closeFile() because that clears the window
|
|
||||||
self.preferences['textBoxContent'] = unicode(self.textContent.toPlainText())
|
|
||||||
self.closeFile()
|
self.closeFile()
|
||||||
self.preferences['windowState'] = str(self.saveState().toBase64())
|
self.preferences['windowState'] = str(self.saveState().toBase64())
|
||||||
self.preferences.save()
|
self.preferences.save()
|
||||||
@ -381,6 +379,9 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
|
|||||||
|
|
||||||
|
|
||||||
def closeFile(self):
|
def closeFile(self):
|
||||||
|
if self.preferences['rememberTextContent']:
|
||||||
|
self.preferences['textContent'] = unicode(self.textContent.toPlainText())
|
||||||
|
|
||||||
self.setWindowTitle('Yomichan')
|
self.setWindowTitle('Yomichan')
|
||||||
self.textContent.setPlainText(unicode())
|
self.textContent.setPlainText(unicode())
|
||||||
self.updateRecentFile(False)
|
self.updateRecentFile(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user