diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 068631d0..8c873ff3 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -429,7 +429,6 @@ class App(QtCore.QObject): self.recent_projects = [] self.clipboard = QtWidgets.QApplication.clipboard() - self.proc_container = FCVisibleProcessContainer(self.ui.activity_view) self.project_filename = None 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_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 "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_proj_item_color": '#000000', "global_proj_item_dis_color": '#b7b7cb', + "global_activity_icon": 'Ball green', "global_toolbar_view": 511, @@ -1637,12 +1638,35 @@ class App(QtCore.QObject): self.worker_task.connect(self.workers.add_task) 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 ################ # ################################################ # ############# Custom signals ################## - # signal for displaying messages in status bar self.inform.connect(self.info) # signal to be called when the app is quiting diff --git a/README.md b/README.md index f7c4187f..a525088b 100644 --- a/README.md +++ b/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 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 +- 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 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 1075d275..71b86b2f 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -1916,9 +1916,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.progress_bar.setMaximum(100) # 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 ################ # ########################################################################### @@ -1995,11 +1992,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow): if settings.contains("layout"): layout = settings.value('layout', type=str) if layout == 'standard': - self.exc_edit_toolbar.setVisible(False) + # self.exc_edit_toolbar.setVisible(False) 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.grb_edit_toolbar.setVisible(False) + # self.grb_edit_toolbar.setVisible(False) self.grb_edit_toolbar.setDisabled(True) self.corner_snap_btn.setVisible(False) @@ -2015,17 +2012,17 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.corner_snap_btn.setDisabled(True) log.debug("FlatCAMGUI.__init__() --> UI layout restored from QSettings.") else: - self.exc_edit_toolbar.setVisible(False) + # self.exc_edit_toolbar.setVisible(False) 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.grb_edit_toolbar.setVisible(False) + # self.grb_edit_toolbar.setVisible(False) self.grb_edit_toolbar.setDisabled(True) self.corner_snap_btn.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. del settings 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.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 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_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) # Add the QFormLayout that holds the Application general defaults @@ -8130,14 +8137,17 @@ class AutoCompletePrefGroupUI(OptionsGroupUI): 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) self.setMinimumWidth(200) + self.movie_path = movie + self.icon_path = icon self.icon = QtWidgets.QLabel(self) 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.movie.start() @@ -8149,6 +8159,7 @@ class FlatCAMActivityView(QtWidgets.QWidget): layout.addWidget(self.icon) self.text = QtWidgets.QLabel(self) self.text.setText(_("Idle.")) + self.icon.setPixmap(QtGui.QPixmap(self.icon_path)) layout.addWidget(self.text) @@ -8158,6 +8169,7 @@ class FlatCAMActivityView(QtWidgets.QWidget): def set_busy(self, msg, no_movie=None): if no_movie is not True: + self.icon.setMovie(self.movie) self.movie.start() self.text.setText(msg) diff --git a/share/active.gif b/share/active.gif index b2cb55d7..b2db1071 100644 Binary files a/share/active.gif and b/share/active.gif differ diff --git a/share/active_2.gif b/share/active_2.gif new file mode 100644 index 00000000..b9b7f7ba Binary files /dev/null and b/share/active_2.gif differ diff --git a/share/active_2_static.png b/share/active_2_static.png new file mode 100644 index 00000000..4e9087b1 Binary files /dev/null and b/share/active_2_static.png differ diff --git a/share/active_3.gif b/share/active_3.gif new file mode 100644 index 00000000..e8e440a9 Binary files /dev/null and b/share/active_3.gif differ diff --git a/share/active_3_static.png b/share/active_3_static.png new file mode 100644 index 00000000..fc249b27 Binary files /dev/null and b/share/active_3_static.png differ diff --git a/share/active_4.gif b/share/active_4.gif new file mode 100644 index 00000000..98a32918 Binary files /dev/null and b/share/active_4.gif differ diff --git a/share/active_4_static.png b/share/active_4_static.png new file mode 100644 index 00000000..06ef701c Binary files /dev/null and b/share/active_4_static.png differ diff --git a/share/active_static.png b/share/active_static.png new file mode 100644 index 00000000..f0884940 Binary files /dev/null and b/share/active_static.png differ diff --git a/share/activity2.gif b/share/activity2.gif deleted file mode 100644 index c1eb1c9a..00000000 Binary files a/share/activity2.gif and /dev/null differ