Skip to content

Commit

Permalink
update suggested git-command for updating
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Sep 14, 2023
1 parent 6b7ec3f commit 7cc5e6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions iblrig/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ def __init__(self, subject=None, task_parameter_file=None, file_hardware_setting
BaseSession.checked_for_update = True
update_status, remote_version = check_for_updates()
if update_status is True:
print(f"\nUpdate to iblrig {remote_version} is available! Please update using 'git pull'.\n")

print(f"\nUpdate to iblrig {remote_version} is available!\n"
f"Please update by issuing:\n\n"
f" pip install --upgrade -e .\n")
while True:
print("- Press [Enter] to exit IBL Rig and perform the update right away.\n"
"- Enter 'I will update later' to continue without updating.")
Expand Down
12 changes: 9 additions & 3 deletions iblrig/gui/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import yaml
import traceback
import webbrowser
from random import choice

from PyQt5 import QtWidgets, QtCore, uic
from PyQt5.QtWidgets import QStyle
Expand Down Expand Up @@ -153,13 +154,18 @@ def __init__(self, *args, **kwargs):
def check_for_update(self):
update_available, remote_version = check_for_updates()
if update_available == 1:
cmdBox = QtWidgets.QLineEdit('pip install --upgrade -e .')
cmdBox.setReadOnly(True)
msgBox = QtWidgets.QMessageBox(parent=self)
msgBox.setWindowTitle("Update Notice")
msgBox.setText(f"Update toiblrig {remote_version} is available.")
msgBox.setInformativeText("Please update using 'git pull'.")
msgBox.setText(f"Update to iblrig {remote_version} is available.\n\n"
f"Please update iblrig by issuing:")
msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
msgBox.setIcon(QtWidgets.QMessageBox().Information)
msgBox.findChild(QtWidgets.QPushButton).setText('Yes, I promise!')
msgBox.layout().addWidget(cmdBox, 1, 2)
msgBox.findChild(QtWidgets.QPushButton).setText(
choice(['Yes, I promise!', 'I will do so immediately!',
'Straight away!', 'Of course I will!']))
msgBox.exec_()
self.setDisabled(False)
self.statusbar.showMessage(f"iblrig v{remote_version}")
Expand Down

0 comments on commit 7cc5e6f

Please sign in to comment.