Fix bug with velocity warning.
Add button to suppress
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>WarningSuppressSelectionMode</cstring>
|
||||
<cstring>WarningSuppressVelocity</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Path</cstring>
|
||||
|
||||
@@ -251,6 +251,7 @@ class PathWorkbench(Workbench):
|
||||
|
||||
# keep this one the last entry in the preferences
|
||||
import PathScripts.PathPreferencesAdvanced as PathPreferencesAdvanced
|
||||
from PathScripts.PathPreferences import preferences
|
||||
|
||||
FreeCADGui.addPreferencePage(
|
||||
PathPreferencesAdvanced.AdvancedPreferencesPage, "Path"
|
||||
@@ -274,7 +275,9 @@ class PathWorkbench(Workbench):
|
||||
msgbox = QtGui.QMessageBox(QtGui.QMessageBox.Warning, header, msg)
|
||||
|
||||
msgbox.addButton(translate("Path", "Ok"), QtGui.QMessageBox.AcceptRole)
|
||||
msgbox.exec_()
|
||||
msgbox.addButton(translate("Path", "Don't Show This Anymore"), QtGui.QMessageBox.ActionRole)
|
||||
if msgbox.exec_() == 1:
|
||||
preferences().SetBool("WarningSuppressVelocity", True)
|
||||
|
||||
def GetClassName(self):
|
||||
return "Gui::PythonWorkbench"
|
||||
|
||||
@@ -25,8 +25,11 @@ import glob
|
||||
import os
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
# PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
# PathLog.trackModule()
|
||||
if False:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
DefaultFilePath = "DefaultFilePath"
|
||||
DefaultJobTemplate = "DefaultJobTemplate"
|
||||
|
||||
@@ -22,8 +22,13 @@
|
||||
|
||||
import FreeCADGui
|
||||
import PathScripts.PathPreferences as PathPreferences
|
||||
import PySide
|
||||
import PathScripts.PathLog as PathLog
|
||||
|
||||
if False:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
class AdvancedPreferencesPage:
|
||||
def __init__(self, parent=None):
|
||||
@@ -42,6 +47,7 @@ class AdvancedPreferencesPage:
|
||||
)
|
||||
|
||||
def loadSettings(self):
|
||||
PathLog.track()
|
||||
self.form.WarningSuppressAllSpeeds.setChecked(
|
||||
PathPreferences.suppressAllSpeedsWarning()
|
||||
)
|
||||
@@ -57,7 +63,9 @@ class AdvancedPreferencesPage:
|
||||
self.form.WarningSuppressOpenCamLib.setChecked(
|
||||
PathPreferences.suppressOpenCamLibWarning()
|
||||
)
|
||||
self.form.WarningSuppressVelocity.setChecked(PathPreferences.suppressVelocity())
|
||||
self.form.WarningSuppressVelocity.setChecked(
|
||||
PathPreferences.suppressVelocity()
|
||||
)
|
||||
self.updateSelection()
|
||||
|
||||
def updateSelection(self, state=None):
|
||||
|
||||
Reference in New Issue
Block a user