Просмотр исходного кода

- added new control in Edit -> Preferences -> General -> Gui Preferences -> Activity Icon. Will select a GIF from a selection, the one used to show that FlatCAM is working.

Marius Stanciu 6 лет назад
Родитель
Сommit
1e49c23e8f

+ 26 - 2
FlatCAMApp.py

@@ -429,7 +429,6 @@ class App(QtCore.QObject):
         self.recent_projects = []
         self.recent_projects = []
 
 
         self.clipboard = QtWidgets.QApplication.clipboard()
         self.clipboard = QtWidgets.QApplication.clipboard()
-        self.proc_container = FCVisibleProcessContainer(self.ui.activity_view)
 
 
         self.project_filename = None
         self.project_filename = None
         self.toggle_units_ignore = False
         self.toggle_units_ignore = False
@@ -476,6 +475,7 @@ class App(QtCore.QObject):
 
 
             "global_proj_item_color": self.ui.general_defaults_form.general_gui_group.proj_color_entry,
             "global_proj_item_color": self.ui.general_defaults_form.general_gui_group.proj_color_entry,
             "global_proj_item_dis_color": self.ui.general_defaults_form.general_gui_group.proj_color_dis_entry,
             "global_proj_item_dis_color": self.ui.general_defaults_form.general_gui_group.proj_color_dis_entry,
+            "global_activity_icon": self.ui.general_defaults_form.general_gui_group.activity_combo,
 
 
             # General GUI Settings
             # General GUI Settings
             "global_layout": self.ui.general_defaults_form.general_gui_set_group.layout_combo,
             "global_layout": self.ui.general_defaults_form.general_gui_set_group.layout_combo,
@@ -861,6 +861,7 @@ class App(QtCore.QObject):
             "global_sel_draw_color": '#0000FF',
             "global_sel_draw_color": '#0000FF',
             "global_proj_item_color": '#000000',
             "global_proj_item_color": '#000000',
             "global_proj_item_dis_color": '#b7b7cb',
             "global_proj_item_dis_color": '#b7b7cb',
+            "global_activity_icon": 'Ball green',
 
 
             "global_toolbar_view": 511,
             "global_toolbar_view": 511,
 
 
@@ -1637,12 +1638,35 @@ class App(QtCore.QObject):
         self.worker_task.connect(self.workers.add_task)
         self.worker_task.connect(self.workers.add_task)
         self.log.debug("Finished creating Workers crew.")
         self.log.debug("Finished creating Workers crew.")
 
 
+        # ################################################
+        # ############### Activity Monitor ###############
+        # ################################################
+
+        if self.defaults["global_activity_icon"] == "Ball green":
+            icon = 'share/active_2_static.png'
+            movie = "share/active_2.gif"
+        elif self.defaults["global_activity_icon"] == "Ball black":
+            icon = 'share/active_static.png'
+            movie = "share/active.gif"
+        elif self.defaults["global_activity_icon"] == "Arrow green":
+            icon = 'share/active_3_static.png'
+            movie = "share/active_3.gif"
+        elif self.defaults["global_activity_icon"] == "Eclipse green":
+            icon = 'share/active_4_static.png'
+            movie = "share/active_4.gif"
+        else:
+            icon = 'share/active_static.png'
+            movie = "share/active.gif"
+
+        self.activity_view = FlatCAMActivityView(icon=icon, movie=movie)
+        self.ui.infobar.addWidget(self.activity_view)
+        self.proc_container = FCVisibleProcessContainer(self.activity_view)
+
         # ################################################
         # ################################################
         # ############### Signal handling ################
         # ############### Signal handling ################
         # ################################################
         # ################################################
 
 
         # ############# Custom signals  ##################
         # ############# Custom signals  ##################
-
         # signal for displaying messages in status bar
         # signal for displaying messages in status bar
         self.inform.connect(self.info)
         self.inform.connect(self.info)
         # signal to be called when the app is quiting
         # signal to be called when the app is quiting

+ 1 - 0
README.md

@@ -22,6 +22,7 @@ CAD program, and create G-Code for Isolation routing.
 - fixed the command line argument --shellvar to work when there are spaces in the argument value
 - fixed the command line argument --shellvar to work when there are spaces in the argument value
 - fixed bug in Gerber editor that did not allow to display all shapes after it encountered one shape without 'solid' geometry
 - fixed bug in Gerber editor that did not allow to display all shapes after it encountered one shape without 'solid' geometry
 - fixed bug in Gerber Editor -> selection area handler where if some of the selected shapes did not had the 'solid' geometry will silently abort selection of further shapes
 - fixed bug in Gerber Editor -> selection area handler where if some of the selected shapes did not had the 'solid' geometry will silently abort selection of further shapes
+- added new control in Edit -> Preferences -> General -> Gui Preferences -> Activity Icon. Will select a GIF from a selection, the one used to show that FlatCAM is working.
 
 
 18.09.2019
 18.09.2019
 
 

+ 24 - 12
flatcamGUI/FlatCAMGUI.py

@@ -1916,9 +1916,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         self.progress_bar.setMaximum(100)
         self.progress_bar.setMaximum(100)
         # infobar.addWidget(self.progress_bar)
         # infobar.addWidget(self.progress_bar)
 
 
-        self.activity_view = FlatCAMActivityView()
-        self.infobar.addWidget(self.activity_view)
-
         # ###########################################################################
         # ###########################################################################
         # ####### Set the APP ICON and the WINDOW TITLE and GEOMETRY ################
         # ####### Set the APP ICON and the WINDOW TITLE and GEOMETRY ################
         # ###########################################################################
         # ###########################################################################
@@ -1995,11 +1992,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         if settings.contains("layout"):
         if settings.contains("layout"):
             layout = settings.value('layout', type=str)
             layout = settings.value('layout', type=str)
             if layout == 'standard':
             if layout == 'standard':
-                self.exc_edit_toolbar.setVisible(False)
+                # self.exc_edit_toolbar.setVisible(False)
                 self.exc_edit_toolbar.setDisabled(True)
                 self.exc_edit_toolbar.setDisabled(True)
-                self.geo_edit_toolbar.setVisible(False)
+                # self.geo_edit_toolbar.setVisible(False)
                 self.geo_edit_toolbar.setDisabled(True)
                 self.geo_edit_toolbar.setDisabled(True)
-                self.grb_edit_toolbar.setVisible(False)
+                # self.grb_edit_toolbar.setVisible(False)
                 self.grb_edit_toolbar.setDisabled(True)
                 self.grb_edit_toolbar.setDisabled(True)
 
 
                 self.corner_snap_btn.setVisible(False)
                 self.corner_snap_btn.setVisible(False)
@@ -2015,17 +2012,17 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                 self.corner_snap_btn.setDisabled(True)
                 self.corner_snap_btn.setDisabled(True)
             log.debug("FlatCAMGUI.__init__() --> UI layout restored from QSettings.")
             log.debug("FlatCAMGUI.__init__() --> UI layout restored from QSettings.")
         else:
         else:
-            self.exc_edit_toolbar.setVisible(False)
+            # self.exc_edit_toolbar.setVisible(False)
             self.exc_edit_toolbar.setDisabled(True)
             self.exc_edit_toolbar.setDisabled(True)
-            self.geo_edit_toolbar.setVisible(False)
+            # self.geo_edit_toolbar.setVisible(False)
             self.geo_edit_toolbar.setDisabled(True)
             self.geo_edit_toolbar.setDisabled(True)
-            self.grb_edit_toolbar.setVisible(False)
+            # self.grb_edit_toolbar.setVisible(False)
             self.grb_edit_toolbar.setDisabled(True)
             self.grb_edit_toolbar.setDisabled(True)
 
 
             self.corner_snap_btn.setVisible(False)
             self.corner_snap_btn.setVisible(False)
             self.snap_magnet.setVisible(False)
             self.snap_magnet.setVisible(False)
-            settings.setValue('layout', "standard")
 
 
+            settings.setValue('layout', "standard")
             # This will write the setting to the platform specific storage.
             # This will write the setting to the platform specific storage.
             del settings
             del settings
             log.debug("FlatCAMGUI.__init__() --> UI layout restored from defaults. QSettings set to 'standard'")
             log.debug("FlatCAMGUI.__init__() --> UI layout restored from defaults. QSettings set to 'standard'")
@@ -3930,6 +3927,14 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
         self.form_box_child_13.addWidget(self.proj_color_dis_button)
         self.form_box_child_13.addWidget(self.proj_color_dis_button)
         self.form_box_child_13.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
         self.form_box_child_13.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
 
 
+        # Activity monitor icon
+        self.activity_label = QtWidgets.QLabel('%s:' % _("Activity Icon"))
+        self.activity_label.setToolTip(
+            _("Select the GIF that show activity when FlatCAM is active.")
+        )
+        self.activity_combo = FCComboBox()
+        self.activity_combo.addItems(['Ball black', 'Ball green', 'Arrow green', 'Eclipse green' ])
+
         # Just to add empty rows
         # Just to add empty rows
         self.spacelabel = QtWidgets.QLabel('')
         self.spacelabel = QtWidgets.QLabel('')
 
 
@@ -3958,6 +3963,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
         self.form_box.addRow(self.proj_color_label, self.form_box_child_12)
         self.form_box.addRow(self.proj_color_label, self.form_box_child_12)
         self.form_box.addRow(self.proj_color_dis_label, self.form_box_child_13)
         self.form_box.addRow(self.proj_color_dis_label, self.form_box_child_13)
 
 
+        self.form_box.addRow(self.activity_label, self.activity_combo)
+
         self.form_box.addRow(self.spacelabel, self.spacelabel)
         self.form_box.addRow(self.spacelabel, self.spacelabel)
 
 
         # Add the QFormLayout that holds the Application general defaults
         # Add the QFormLayout that holds the Application general defaults
@@ -8130,14 +8137,17 @@ class AutoCompletePrefGroupUI(OptionsGroupUI):
 
 
 class FlatCAMActivityView(QtWidgets.QWidget):
 class FlatCAMActivityView(QtWidgets.QWidget):
 
 
-    def __init__(self, parent=None):
+    def __init__(self, movie="share/active.gif", icon='share/active_static.png', parent=None):
         super().__init__(parent=parent)
         super().__init__(parent=parent)
 
 
         self.setMinimumWidth(200)
         self.setMinimumWidth(200)
+        self.movie_path = movie
+        self.icon_path = icon
 
 
         self.icon = QtWidgets.QLabel(self)
         self.icon = QtWidgets.QLabel(self)
         self.icon.setGeometry(0, 0, 16, 12)
         self.icon.setGeometry(0, 0, 16, 12)
-        self.movie = QtGui.QMovie("share/active.gif")
+        self.movie = QtGui.QMovie(self.movie_path)
+
         self.icon.setMovie(self.movie)
         self.icon.setMovie(self.movie)
         # self.movie.start()
         # self.movie.start()
 
 
@@ -8149,6 +8159,7 @@ class FlatCAMActivityView(QtWidgets.QWidget):
         layout.addWidget(self.icon)
         layout.addWidget(self.icon)
         self.text = QtWidgets.QLabel(self)
         self.text = QtWidgets.QLabel(self)
         self.text.setText(_("Idle."))
         self.text.setText(_("Idle."))
+        self.icon.setPixmap(QtGui.QPixmap(self.icon_path))
 
 
         layout.addWidget(self.text)
         layout.addWidget(self.text)
 
 
@@ -8158,6 +8169,7 @@ class FlatCAMActivityView(QtWidgets.QWidget):
 
 
     def set_busy(self, msg, no_movie=None):
     def set_busy(self, msg, no_movie=None):
         if no_movie is not True:
         if no_movie is not True:
+            self.icon.setMovie(self.movie)
             self.movie.start()
             self.movie.start()
         self.text.setText(msg)
         self.text.setText(msg)
 
 

BIN
share/active.gif


BIN
share/active_2.gif


BIN
share/active_2_static.png


BIN
share/active_3.gif


BIN
share/active_3_static.png


BIN
share/active_4.gif


BIN
share/active_4_static.png


BIN
share/active_static.png


BIN
share/activity2.gif