mirror of
https://github.com/MCMi460/3DS-RPC.git
synced 2025-06-19 05:55:36 -04:00
Add logout button
This commit is contained in:
parent
5365f3b038
commit
740e77d0c6
@ -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)
|
||||
|
@ -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__":
|
||||
|
@ -528,6 +528,50 @@
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="okButtonLogout">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>165</x>
|
||||
<y>470</y>
|
||||
<width>270</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Logout</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="showProfileButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>215</y>
|
||||
<width>550</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="showSmallImage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>25</x>
|
||||
<y>365</y>
|
||||
<width>550</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>showSmallImage</zorder>
|
||||
<zorder>showProfileButton</zorder>
|
||||
<zorder>showElapsed</zorder>
|
||||
<zorder>okButton</zorder>
|
||||
<zorder>showElapsedOff</zorder>
|
||||
@ -539,6 +583,7 @@
|
||||
<zorder>showElapsedText</zorder>
|
||||
<zorder>showProfileButtonText</zorder>
|
||||
<zorder>showSmallImageText</zorder>
|
||||
<zorder>okButtonLogout</zorder>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user