- reactivated the version check in case the release is not BETA; FlatCAMApp.App has now a beta object that when set True the application will show in the Title and help-> About that is Beta (and it disable version checking)

This commit is contained in:
Marius Stanciu 2019-01-06 22:04:01 +02:00 committed by Marius S
parent 3ea1f4e62c
commit b418d15daf
6 changed files with 38 additions and 13 deletions

View File

@ -87,8 +87,9 @@ class App(QtCore.QObject):
log.addHandler(handler) log.addHandler(handler)
# Version # Version
version = '8.6 Beta1' version = 8.6
version_date = "2019/01/06" version_date = "2019/01/06"
beta = True
# URL for update checks and statistics # URL for update checks and statistics
version_url = "http://flatcam.org/version" version_url = "http://flatcam.org/version"
@ -260,7 +261,7 @@ class App(QtCore.QObject):
QtCore.QObject.__init__(self) QtCore.QObject.__init__(self)
self.ui = FlatCAMGUI(self.version, self) self.ui = FlatCAMGUI(self.version, self.beta, self)
# self.connect(self.ui, # self.connect(self.ui,
# QtCore.SIGNAL("geomUpdate(int, int, int, int, int)"), # QtCore.SIGNAL("geomUpdate(int, int, int, int, int)"),
# self.save_geometry) PyQt4 # self.save_geometry) PyQt4
@ -1136,6 +1137,24 @@ class App(QtCore.QObject):
print("ERROR: ", ext) print("ERROR: ", ext)
sys.exit(2) sys.exit(2)
###########################
#### Check for updates ####
###########################
# Separate thread (Not worker)
if self.beta is False or self.beta is None:
App.log.info("Checking for updates in backgroud (this is version %s)." % str(self.version))
self.thr2 = QtCore.QThread()
self.worker_task.emit({'fcn': self.version_check,
'params': []})
self.thr2.start()
####################################
#### Variables for global usage ####
####################################
# coordinates for relative position display # coordinates for relative position display
self.rel_point1 = (0, 0) self.rel_point1 = (0, 0)
self.rel_point2 = (0, 0) self.rel_point2 = (0, 0)
@ -1996,6 +2015,7 @@ class App(QtCore.QObject):
version = self.version version = self.version
version_date = self.version_date version_date = self.version_date
beta = self.beta
class AboutDialog(QtWidgets.QDialog): class AboutDialog(QtWidgets.QDialog):
def __init__(self, parent=None): def __init__(self, parent=None):
@ -2017,7 +2037,7 @@ class App(QtCore.QObject):
title = QtWidgets.QLabel( title = QtWidgets.QLabel(
"<font size=8><B>FlatCAM</B></font><BR>" "<font size=8><B>FlatCAM</B></font><BR>"
"Version %s (%s) - %s <BR>" "Version %s %s (%s) - %s <BR>"
"<BR>" "<BR>"
"2D Computer-Aided Printed Circuit Board<BR>" "2D Computer-Aided Printed Circuit Board<BR>"
"Manufacturing.<BR>" "Manufacturing.<BR>"
@ -2035,7 +2055,7 @@ class App(QtCore.QObject):
"<a href = \"https://bitbucket.org/jpcgt/flatcam/src/Beta/\">here.</a><BR>" "<a href = \"https://bitbucket.org/jpcgt/flatcam/src/Beta/\">here.</a><BR>"
"DOWNLOAD area " "DOWNLOAD area "
"<a href = \"https://bitbucket.org/jpcgt/flatcam/downloads/\">here.</a><BR>" "<a href = \"https://bitbucket.org/jpcgt/flatcam/downloads/\">here.</a><BR>"
"" % (version, version_date, platform.architecture()[0]) "" % (version, ('BETA' if beta else ''), version_date, platform.architecture()[0])
) )
title.setOpenExternalLinks(True) title.setOpenExternalLinks(True)
@ -5664,20 +5684,20 @@ class App(QtCore.QObject):
""" """
self.log.debug("version_check()") self.log.debug("version_check()")
full_url = App.version_url + \
"?s=" + str(self.defaults['serial']) + \
"&v=" + str(self.version) + \
"&os=" + str(self.os) + \
"&" + urllib.parse.urlencode(self.defaults["global_stats"])
App.log.debug("Checking for updates @ %s" % full_url)
full_url = App.version_url + \
"?s=" + str(self.defaults['global_serial']) + \
"&v=" + str(self.version) + \
"&os=" + str(self.os) + \
"&" + urllib.parse.urlencode(self.defaults["global_stats"])
App.log.debug("Checking for updates @ %s" % full_url)
### Get the data ### Get the data
try: try:
f = urllib.request.urlopen(full_url) f = urllib.request.urlopen(full_url)
except: except:
# App.log.warning("Failed checking for latest version. Could not connect.") # App.log.warning("Failed checking for latest version. Could not connect.")
self.log.warning("Failed checking for latest version. Could not connect.") self.log.warning("Failed checking for latest version. Could not connect.")
self.inform.emit("[warning] Failed checking for latest version. Could not connect.") self.inform.emit("[warning_notcl] Failed checking for latest version. Could not connect.")
return return
try: try:

View File

@ -16,7 +16,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
geom_update = QtCore.pyqtSignal(int, int, int, int, int, name='geomUpdate') geom_update = QtCore.pyqtSignal(int, int, int, int, int, name='geomUpdate')
final_save = QtCore.pyqtSignal(name='saveBeforeExit') final_save = QtCore.pyqtSignal(name='saveBeforeExit')
def __init__(self, version, app): def __init__(self, version, beta, app):
super(FlatCAMGUI, self).__init__() super(FlatCAMGUI, self).__init__()
self.app = app self.app = app
@ -717,7 +717,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.setWindowIcon(self.app_icon) self.setWindowIcon(self.app_icon)
self.setGeometry(100, 100, 1024, 650) self.setGeometry(100, 100, 1024, 650)
self.setWindowTitle('FlatCAM %s - %s' % (version, platform.architecture()[0])) self.setWindowTitle('FlatCAM %s %s - %s' % (version, ('BETA' if beta else ''), platform.architecture()[0]))
self.show() self.show()
self.filename = "" self.filename = ""

View File

@ -15,6 +15,7 @@ def apply_async(pool, fun, args):
def func1(): def func1():
print("func") print("func")
class WorkerPool(QtCore.QObject): class WorkerPool(QtCore.QObject):
def __init__(self): def __init__(self):

View File

@ -14,6 +14,8 @@ CAD program, and create G-Code for Isolation routing.
- fixed cncjob TclCommand - it used the default values for parameters - fixed cncjob TclCommand - it used the default values for parameters
- fixed the layout in ToolTransform - fixed the layout in ToolTransform
- fixed the initial text in the ToolShell - fixed the initial text in the ToolShell
- reactivated the version check in case the release is not BETA; FlatCAMApp.App has now a beta object that when set True the application will show in the Title and help-> About that is Beta (and it disable version checking)
3.01.2019 3.01.2019

View File

@ -3,6 +3,7 @@
# Usage: pip install -r requirements.txt # Usage: pip install -r requirements.txt
numpy>=1.8 numpy>=1.8
simplejson simplejson
dill
rtree rtree
pyopengl pyopengl
pyopengl-accelerate pyopengl-accelerate

View File

@ -16,6 +16,7 @@ apt-get install python3-gdal
apt-get install python3-lxml apt-get install python3-lxml
apt-get install python3-ezdxf apt-get install python3-ezdxf
easy_install3 -U distribute easy_install3 -U distribute
pip3 install --upgrade dill
pip3 install --upgrade Shapely pip3 install --upgrade Shapely
pip3 install --upgrade vispy pip3 install --upgrade vispy
pip3 install --upgrade rtree pip3 install --upgrade rtree