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

- the Apply button text in Preferences is now made red when changes were made and require to be applied

Marius Stanciu 6 лет назад
Родитель
Сommit
5032d8e8fe
2 измененных файлов с 14 добавлено и 5 удалено
  1. 10 5
      FlatCAMApp.py
  2. 4 0
      README.md

+ 10 - 5
FlatCAMApp.py

@@ -6828,6 +6828,8 @@ class App(QtCore.QObject):
             if self.ui.plot_tab_area.tabText(idx) == _("Preferences"):
                 self.ui.plot_tab_area.tabBar.setTabTextColor(idx, QtGui.QColor('black'))
 
+        self.ui.pref_apply_button.setStyleSheet("QPushButton {color: black;}")
+
         self.inform.emit('%s' % _("Preferences applied."))
 
         # make sure we update the self.current_defaults dict used to undo changes to self.defaults
@@ -7616,13 +7618,16 @@ class App(QtCore.QObject):
                     pass
 
     def on_preferences_edited(self):
-        self.inform.emit('[WARNING_NOTCL] %s' % _("Preferences edited but not saved."))
+        if self.preferences_changed_flag is False:
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Preferences edited but not saved."))
 
-        for idx in range(self.ui.plot_tab_area.count()):
-            if self.ui.plot_tab_area.tabText(idx) == _("Preferences"):
-                self.ui.plot_tab_area.tabBar.setTabTextColor(idx, QtGui.QColor('red'))
+            for idx in range(self.ui.plot_tab_area.count()):
+                if self.ui.plot_tab_area.tabText(idx) == _("Preferences"):
+                    self.ui.plot_tab_area.tabBar.setTabTextColor(idx, QtGui.QColor('red'))
+
+            self.ui.pref_apply_button.setStyleSheet("QPushButton {color: red;}")
 
-        self.preferences_changed_flag = True
+            self.preferences_changed_flag = True
 
     def on_tools_database(self):
         """

+ 4 - 0
README.md

@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+29.12.2019
+
+- the Apply button text in Preferences is now made red when changes were made and require to be applied
+
 28.12.2019
 
 - more updates to the Preferences window and in some other parts of the GUI