fix(deadline): support for UNC

fix(muster): multiple fixes in logon widget for muster and muster submitter
This commit is contained in:
antirotor 2019-06-04 00:17:02 +02:00
parent f8b943bc42
commit 409c560145
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7
7 changed files with 297 additions and 27 deletions

View file

@ -12,7 +12,7 @@ class MusterModule:
asking for user credentials for Muster if not already specified.
"""
cred_folder_path = os.path.normpath(
appdirs.user_data_dir('pype-app', 'pype', 'muster')
appdirs.user_data_dir('pype-app', 'pype')
)
cred_filename = 'muster_cred.json'
@ -24,7 +24,7 @@ class MusterModule:
self.parent = parent
self.widget_login = MusterLogin(main_parent, self)
def start_up(self):
def tray_start(self):
"""
Show login dialog if credentials not found.
"""
@ -52,7 +52,7 @@ class MusterModule:
)
self.menu.addAction(self.aShowLogin)
self.aShowLogin.triggered.connect(self.show_settings)
self.aShowLogin.triggered.connect(self.show_login)
return self.menu
@ -65,7 +65,7 @@ class MusterModule:
file = open(self.cred_path, 'r')
credentials = json.load(file)
except Exception:
file = open(self.cred_path, 'w')
file = open(self.cred_path, 'w+')
file.close()
return credentials

View file

@ -16,7 +16,6 @@ class MusterLogin(QtWidgets.QWidget):
self.parent_widget = parent
self.main_parent = main_parent
self.clockapi = parent.clockapi
# Icon
if hasattr(parent, 'icon'):
@ -80,7 +79,7 @@ class MusterLogin(QtWidgets.QWidget):
self.label_password.setTextFormat(QtCore.Qt.RichText)
self.input_password = QtWidgets.QLineEdit()
self.input_password.setEchoMode(QtGui.QLineEdit.Password)
self.input_password.setEchoMode(QtWidgets.QLineEdit.Password)
self.input_password.setEnabled(True)
self.input_password.setFrame(True)
self.input_password.setPlaceholderText(
@ -132,6 +131,14 @@ class MusterLogin(QtWidgets.QWidget):
self.setError("Username cannot be empty")
self.invalid_input(self.input_username)
self.save_credentials(username, password)
self._close_widget()
def save_credentials(self, username, password):
self.parent_widget.save_credentials(username, password)
def closeEvent(self, event):
event.ignore()
self._close_widget()
def _close_widget(self):
self.hide()