diff --git a/client/app.py b/client/app.py index 830d478..36d8d9e 100644 --- a/client/app.py +++ b/client/app.py @@ -82,6 +82,7 @@ class GUI(Ui_MainWindow): # Update others self.friendCard.mouseReleaseEvent = lambda event : self.openLink(host + '/user/%s' % client.userData['User']['friendCode']) + self.okButtonLogout.clicked.connect(self.logout) for button in ((self.showElapsedOff, self.showElapsedOn, 'showElapsed'), (self.showProfileButtonOff, self.showProfileButtonOn, 'showProfileButton'), (self.showSmallImageOff, self.showSmallImageOn, 'showSmallImage')): self.setFontText(button[0], 'No') self.setFontText(button[1], 'Yes') @@ -132,7 +133,7 @@ class GUI(Ui_MainWindow): sys.exit() def grabCode(self): - global friendCode, client, config + global friendCode if friendCode: return friendCode = str(convertPrincipalIdtoFriendCode(convertFriendCodeToPrincipalId(self.waitUntil()))).zfill(12) @@ -164,6 +165,10 @@ class GUI(Ui_MainWindow): self.gamePlate.hide() self.underLyingButton.click() + def logout(self): + os.remove(privateFile) + sys.exit() + class SystemTrayApp(QSystemTrayIcon): def __init__(self, icon, parent): QSystemTrayIcon.__init__(self, icon, parent) diff --git a/client/layout/__init__.py b/client/layout/__init__.py index a7096d9..bfb87e3 100644 --- a/client/layout/__init__.py +++ b/client/layout/__init__.py @@ -170,6 +170,20 @@ class Ui_MainWindow(object): self.showElapsed.setGeometry(QtCore.QRect(25, 65, 550, 71)) self.showElapsed.setTitle("") self.showElapsed.setObjectName("showElapsed") + self.okButtonLogout = QtWidgets.QPushButton(self.settings) + self.okButtonLogout.setGeometry(QtCore.QRect(165, 470, 270, 61)) + self.okButtonLogout.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) + self.okButtonLogout.setObjectName("okButtonLogout") + self.showProfileButton = QtWidgets.QGroupBox(self.settings) + self.showProfileButton.setGeometry(QtCore.QRect(25, 215, 550, 71)) + self.showProfileButton.setTitle("") + self.showProfileButton.setObjectName("showProfileButton") + self.showSmallImage = QtWidgets.QGroupBox(self.settings) + self.showSmallImage.setGeometry(QtCore.QRect(25, 365, 550, 71)) + self.showSmallImage.setTitle("") + self.showSmallImage.setObjectName("showSmallImage") + self.showSmallImage.raise_() + self.showProfileButton.raise_() self.showElapsed.raise_() self.okButton.raise_() self.showElapsedOff.raise_() @@ -181,6 +195,7 @@ class Ui_MainWindow(object): self.showElapsedText.raise_() self.showProfileButtonText.raise_() self.showSmallImageText.raise_() + self.okButtonLogout.raise_() self.stackedWidget.addWidget(self.settings) self.retranslateUi(MainWindow) @@ -210,6 +225,7 @@ class Ui_MainWindow(object): self.showElapsedText.setText(_translate("MainWindow", "Allow others to see your current time in-game?")) self.showProfileButtonText.setText(_translate("MainWindow", "Allow others to click your status to view your profile?")) self.showSmallImageText.setText(_translate("MainWindow", "Show a small image of your Mii to Discord?")) + self.okButtonLogout.setText(_translate("MainWindow", "Logout")) if __name__ == "__main__": diff --git a/client/layout/mainwindow.ui b/client/layout/mainwindow.ui index f37da7c..83d9810 100644 --- a/client/layout/mainwindow.ui +++ b/client/layout/mainwindow.ui @@ -528,6 +528,50 @@ + + + + 165 + 470 + 270 + 61 + + + + PointingHandCursor + + + Logout + + + + + + 25 + 215 + 550 + 71 + + + + + + + + + + 25 + 365 + 550 + 71 + + + + + + + showSmallImage + showProfileButton showElapsed okButton showElapsedOff @@ -539,6 +583,7 @@ showElapsedText showProfileButtonText showSmallImageText + okButtonLogout diff --git a/client/layout/style.qss b/client/layout/style.qss index 2cde4a6..ffe6002 100644 --- a/client/layout/style.qss +++ b/client/layout/style.qss @@ -76,6 +76,10 @@ QPushButton[objectName*="okButton"] { QPushButton[objectName*="okButton"]:hover { background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #9093a1, stop:1 #717274); } +QPushButton[objectName*="Logout"] { + border: 2px solid #C7C7C7; + border-radius: 15px; +} QGroupBox[objectName*="friendCard"] { background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #FFC693, stop:1 #FEF5EF); border: 2px solid #fff;