From 04b3b8585f40b85109dca062e45ca92fcbb022d1 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 18 Sep 2019 18:27:28 +0300 Subject: [PATCH] - added option to run a script from the context menu of the sys tray icon. Changed the color of the sys tray icon to a green one so it will be visible on light and dark themes --- FlatCAMApp.py | 3 ++- README.md | 1 + flatcamGUI/FlatCAMGUI.py | 11 +++++++++++ share/flatcam_icon32_green.png | Bin 0 -> 831 bytes 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 share/flatcam_icon32_green.png diff --git a/FlatCAMApp.py b/FlatCAMApp.py index ef01f6fc..c5c35dbd 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -400,7 +400,8 @@ class App(QtCore.QObject): # ################################################################# self.parent_w = QtWidgets.QWidget() - self.trayIcon = FlatCAMSystemTray(app=self, icon=QtGui.QIcon('share/flatcam_icon32.png'), parent=self.parent_w) + self.trayIcon = FlatCAMSystemTray(app=self, icon=QtGui.QIcon('share/flatcam_icon32_green.png'), + parent=self.parent_w) # ############################################################################# # ############################## Data ######################################### diff --git a/README.md b/README.md index 41bafdac..aa81808e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ CAD program, and create G-Code for Isolation routing. - added possibility to edit the custom keywords used by the autocompleter (in Tcl Shell and in the Code Editor). It is done in the Edit -> Preferences -> Utilities - added a new setting in Edit -> Preferences -> General -> GUI Settings -> Textbox Font which control the font on the texbox GUI elements - fixed issue with the sys tray icon not hiding after application close +- added option to run a script from the context menu of the sys tray icon. Changed the color of the sys tray icon to a green one so it will be visible on light and dark themes 17.09.2019 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 17e26da6..c83760b3 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -8211,6 +8211,16 @@ class FlatCAMSystemTray(QtWidgets.QSystemTrayIcon): menu = QtWidgets.QMenu(parent) + menu_runscript = QtWidgets.QAction(QtGui.QIcon('share/script16.png'), '%s' % _('Run Script ...'), self) + menu_runscript.setToolTip( + _("Will run the opened Tcl Script thus\n" + "enabling the automation of certain\n" + "functions of FlatCAM.") + ) + menu.addAction(menu_runscript) + + menu.addSeparator() + menu_open = menu.addMenu(QtGui.QIcon('share/folder32_bis.png'), _('Open')) # Open Project ... @@ -8238,6 +8248,7 @@ class FlatCAMSystemTray(QtWidgets.QSystemTrayIcon): exitAction.setIcon(QtGui.QIcon('share/power16.png')) self.setContextMenu(menu) + menu_runscript.triggered.connect(self.app.on_filerunscript) menu_openproject.triggered.connect(self.app.on_file_openproject) menu_opengerber.triggered.connect(self.app.on_fileopengerber) menu_openexcellon.triggered.connect(self.app.on_fileopenexcellon) diff --git a/share/flatcam_icon32_green.png b/share/flatcam_icon32_green.png new file mode 100644 index 0000000000000000000000000000000000000000..81920f22212fbc71dcbbf8bd83a0442280fa5d18 GIT binary patch literal 831 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)j!3-ol&c;6kQjEnx?oNz1PwLbIIh+L^k;M!Q zwk;sccy-PC5}<;Z0G|+7pd`aZ2F6Q_5Cma!-R9!H!wnQcmJ)j|ruSb@@|7e+CDUal z)o-dm5w-7X%vYGc9$@J-+w^Ry!YRKAlNkT$cByk{{64u+{3j0|LK6oTey=R z3Ni}c;XfR&ZEIZ&RN`m<<^SLRJD-Jxgw_GM;e2-=$U7IB3EV%EaktF(*0U085Y0nKL?TB2*+KZp^r8 zIm1#hM=wt7g~NPOV`}Sz-KHYoV2MpqsOEF!zZIY1b~g7B8B&Z=W1<#Hj-UtL0ZH zExrkd=v)Znwxa;DnZZJJa0 zM9wih^2zc{Wo&gUOHKBA`sCSDagk@DqRA&17;bLSIUn9vTLwz!p00i_>zopr0G=Hw Aga7~l literal 0 HcmV?d00001