From 5fe6603aa02a4500e19254766af4b4df44aaef70 Mon Sep 17 00:00:00 2001 From: digidigital Date: Mon, 22 Jan 2024 01:47:26 +0100 Subject: [PATCH] Add files via upload --- openXJV.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/openXJV.py b/openXJV.py index ccd90ed..92ed1b2 100644 --- a/openXJV.py +++ b/openXJV.py @@ -515,9 +515,9 @@ def __loadEmptyViewer(self): if darkdetect.isDark(): self.url+='?darkmode=True' - + self.browser.setUrl(QUrl.fromUserInput(self.url)) - + def __displayInfo(self): QMessageBox.information(self, "Information", "openXJV " + VERSION + "\n" @@ -1147,8 +1147,14 @@ def __loadNotes(self): if self.akte.nachricht['eigeneID']: filepath = os.path.join(self.dirs.user_data_dir , 'notizen' + self.akte.nachricht['eigeneID']) if os.path.exists(filepath): - with open(filepath , 'r', encoding = 'utf-8') as notesFile: - self.notizenText.setPlainText(notesFile.read()) + try: + with open(filepath , 'r', encoding = 'utf-8') as notesFile: + notes_text=notesFile.read() + except Exception: + # Unter Windows wurden "alte" Notizen ggf. nicht als UTF-8 gespeichert und werfen Fehler + with open(filepath , 'r') as notesFile: + notes_text=notesFile.read() + self.notizenText.setPlainText(notes_text) def __saveNotes(self): '''Speichert die Favoriten in einer Datei, deren Dateinamen dem Wert der 'eigeneID' entspricht.'''