- 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
This commit is contained in:
Marius Stanciu
2021-08-22 17:21:08 +03:00
committed by Marius Stanciu
parent 4ffecc0bf8
commit dd39657e4f
7 changed files with 26 additions and 3 deletions

View File

@@ -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):
"""