|
55 | 55 | QWidget, |
56 | 56 | ) |
57 | 57 |
|
| 58 | +from config.environments import Environment |
58 | 59 | from ui.custom.job_tab import JobTab |
59 | 60 | from ui.custom_widgets import ( |
60 | 61 | ButtonManagerWidget, |
@@ -2027,20 +2028,22 @@ def refresh_nest_directories(self): |
2027 | 2028 | # * \/ CHECKERS \/ |
2028 | 2029 | def check_for_updates(self, on_start_up: bool = False): |
2029 | 2030 | try: |
2030 | | - try: |
2031 | | - response = requests.get("http://10.0.0.10:5051/version", timeout=5) |
2032 | | - except ConnectionError: |
2033 | | - return |
2034 | | - if response.status_code == 200: |
2035 | | - version = response.text |
2036 | | - if version != __version__: |
2037 | | - subprocess.Popen("start update.exe", shell=True) |
2038 | | - elif not on_start_up: |
2039 | | - msg = QMessageBox(self) |
2040 | | - msg.setIcon(QMessageBox.Icon.Information) |
2041 | | - msg.setWindowTitle("No updates") |
2042 | | - msg.setText("There are currently no updates available") |
2043 | | - msg.exec() |
| 2031 | + resp = requests.get( |
| 2032 | + f"{Environment.SOFTWARE_API_BASE}/version", |
| 2033 | + timeout=10, |
| 2034 | + ) |
| 2035 | + |
| 2036 | + data = resp.json() |
| 2037 | + latest_version = data.get("version") |
| 2038 | + |
| 2039 | + if latest_version != __version__: |
| 2040 | + subprocess.Popen("start update.exe", shell=True) |
| 2041 | + elif not on_start_up: |
| 2042 | + msg = QMessageBox(self) |
| 2043 | + msg.setIcon(QMessageBox.Icon.Information) |
| 2044 | + msg.setWindowTitle("No updates") |
| 2045 | + msg.setText("There are currently no updates available") |
| 2046 | + msg.exec() |
2044 | 2047 | except Exception as e: |
2045 | 2048 | if not on_start_up: |
2046 | 2049 | msg = QMessageBox(self) |
|
0 commit comments