Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve version check with a way to disable the annoying popup. #495

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
# I don't like this being here
import selectionFilter


"""
+-----------------------------------------------+
| Initialize the workbench |
Expand All @@ -55,8 +54,8 @@ def __init__(self):
if FCver[0]=='0' and FCver[1]=='22':
git = int(FCver[3][0:5])
if isinstance(git, int) and git>35594 :
print("This version of FreeCAD ("+FCver[0]+"."+FCver[1]+"-"+str(git)+") is not compatible with Assembly4")
print("You may encounter erors, it is rather suggested to use the stable 0.21 branch")
print("Assembly4 is not fully compatible with FreeCAD "+FCver[0]+"."+FCver[1]+"-"+str(git)+" yet.")
print("You may encounter erors. It is rather suggested to use the stable FreeCAD 0.21.")

def Activated(self):
"This function is executed when the workbench is activated"
Expand Down Expand Up @@ -90,16 +89,19 @@ def GetClassName(self):
def Initialize(self):
# check for FreeCAD version
FCver = FreeCAD.Version()
if FCver[0]=='0' and FCver[1]=='22':
MODDIR = os.path.join(App.ConfigGet("UserAppData"), "Mod")
popup_disable_filename = os.path.join(MODDIR, "asm4_disable_version_check_popup") # TODO: REMOVE IN THE FUTURE
if FCver[0]=='0' and FCver[1]=='22' and not os.path.exists(popup_disable_filename):
git = int(FCver[3][0:5])
if isinstance(git, int) and git>35594 :
from PySide import QtGui
msgBox = QtGui.QMessageBox()
msgBox.setWindowTitle( 'Warning' )
msgBox.setIcon( QtGui.QMessageBox.Critical )
msgBox.setWindowFlags( QtCore.Qt.WindowStaysOnTopHint )
text = "This version of FreeCAD ("+FCver[0]+"."+FCver[1]+"-"+str(git)+") is not compatible with Assembly4. "
text +="You may encounter erors, it is rather suggested to use the stable 0.21 branch"
text = "Assembly4 is not fully compatible with FreeCAD version "+FCver[0]+"."+FCver[1]+"-"+str(git)+" yet.\n\n"
text +="You may encounter erors.\nIt is rather suggested to use the stable FreeCAD 0.21.\n\n"
text +="To disable this popup create the following file:\n"+popup_disable_filename
msgBox.setText( text )
msgBox.exec_()

Expand Down