From dd39657e4f8c1450e97623c36b8249dd6e8e51bf Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 22 Aug 2021 17:21:08 +0300 Subject: [PATCH] - added a new menu entry in the View menu to show the application log file where even the fatal crashes are logged - fixed an issue due of porting to Qt6 --- CHANGELOG.md | 5 +++++ appEditors/AppTextEditor.py | 2 +- appGUI/MainGUI.py | 5 +++++ app_Main.py | 13 +++++++++++++ assets/resources/dark_resources/log32.png | Bin 0 -> 843 bytes assets/resources/log32.png | Bin 0 -> 528 bytes requirements.txt | 4 ++-- 7 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 assets/resources/dark_resources/log32.png create mode 100644 assets/resources/log32.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 59a9e85a..85be0eae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta ================================================= +22.08.2021 + +- added a new menu entry in the View menu to show the application log file where even the fatal crashes are logged +- fixed an issue due of porting to Qt6 + 19.08.2021 - some cleaning up in the Preferences diff --git a/appEditors/AppTextEditor.py b/appEditors/AppTextEditor.py index f847d677..76a23501 100644 --- a/appEditors/AppTextEditor.py +++ b/appEditors/AppTextEditor.py @@ -222,7 +222,7 @@ class AppTextEditor(QtWidgets.QWidget): if path: file = QtCore.QFile(path) - if file.open(QtCore.QIODevice.ReadOnly): + if file.open(QtCore.QIODevice.OpenModeFlag.ReadOnly): stream = QtCore.QTextStream(file) self.code_edited = stream.readAll() self.code_editor.setPlainText(self.code_edited) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 3fecf248..055dc5e8 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -573,6 +573,11 @@ class MainGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/hud_32.png'), '%s\t%s' % (_("Toggle HUD"), _('Shift+H'))) + self.menuview.addSeparator() + self.menuview_show_log = self.menuview.addAction( + QtGui.QIcon(self.app.resource_location + '/log32.png'), + '%s\t%s' % (_("Log"), '')) + # ######################################################################## # ########################## Objects # ################################### # ######################################################################## diff --git a/app_Main.py b/app_Main.py index 221c318a..2f503c76 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1825,6 +1825,9 @@ class App(QtCore.QObject): def preprocessors_path(self): return os.path.join(self.data_path, 'preprocessors') + def log_path(self): + return os.path.join(self.data_path, 'log.txt') + def on_app_restart(self): # make sure that the Sys Tray icon is hidden before restart otherwise it will @@ -2167,6 +2170,7 @@ class App(QtCore.QObject): self.ui.menuview_toggle_grid_lines.triggered.connect(self.plotcanvas.on_toggle_grid_lines) self.ui.menuview_toggle_axis.triggered.connect(self.plotcanvas.on_toggle_axis) self.ui.menuview_toggle_hud.triggered.connect(self.plotcanvas.on_toggle_hud) + self.ui.menuview_show_log.triggered.connect(self.on_show_log) def connect_menuhelp_signals(self): self.ui.menuhelp_about.triggered.connect(self.on_about) @@ -4917,6 +4921,15 @@ class App(QtCore.QObject): self.ui.general_pref_form.general_app_set_group.workspace_cb.stateChanged.connect(self.on_workspace) self.on_workspace() + def on_show_log(self): + if sys.platform == 'win32': + subprocess.Popen('explorer %s' % self.log_path()) + elif sys.platform == 'darwin': + os.system('open "%s"' % self.log_path()) + else: + subprocess.Popen(['xdg-open', self.log_path()]) + self.inform.emit('[success] %s' % _("FlatCAM log opened.")) + def on_cursor_type(self, val): """ diff --git a/assets/resources/dark_resources/log32.png b/assets/resources/dark_resources/log32.png new file mode 100644 index 0000000000000000000000000000000000000000..b694e5e80c5bd5fe42b2874e7ac58ed3865ecdae GIT binary patch literal 843 zcmeAS@N?(olHy`uVBq!ia0vp^3Lq@N0wg;h=h*-$mUKs7M+SzC{oH>NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasD-fiYDaqU2g@IvJud)%4$64SJ zSq!9ss(|=Iw$phagT2Jl*OmP#hZr9V>&4^slYpA+JY5_^A`ZWuX73>#D0962z0Ivl zPQ_1d-I91wAa+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requirements.txt b/requirements.txt index 8451a941..e63696d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,8 +28,8 @@ gdal pyserial>=3.4 pikepdf>=2.0 pywin32>2.0 -pyqt6>=6.0.0 -vispy +pyqt6>=6.1.0 +vispy>=0.8.0 rasterio foronoi>=1.0.3 networkx \ No newline at end of file