-
Notifications
You must be signed in to change notification settings - Fork 18
/
About.py
73 lines (58 loc) · 2.24 KB
/
About.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# About.py
import sys
import json
import webbrowser as web
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import pyqtSlot
from GUI.Ui_About import Ui_About
class QmyAbout(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.ui = Ui_About()
self.ui.setupUi(self)
f = open("./Plug/config.json", 'r', encoding='utf-8')
self.Crypto_json = json.load(f)
f.close()
if self.Crypto_json['G_S_Replace']:
self.ui.checkBox.setChecked(True)
if self.Crypto_json['G_S_Crypk']:
self.ui.checkBox_2.setChecked(True)
if self.Crypto_json['G_S_Flag']:
self.ui.checkBox_3.setChecked(True)
self.__dlgSetHeaders = None
self.setAutoFillBackground(True)
@pyqtSlot()
def on_pushButton_clicked(self):
web.open("https://github.com/ht0Ruial/TomatoTools") # 打开项目地址
@pyqtSlot()
def on_checkBox_clicked(self):
with open("./Plug/config.json", 'w+', encoding='utf-8') as f:
if self.ui.checkBox.isChecked():
self.Crypto_json['G_S_Replace'] = True
f.write(json.dumps(self.Crypto_json))
else:
self.Crypto_json['G_S_Replace'] = False
f.write(json.dumps(self.Crypto_json))
@pyqtSlot()
def on_checkBox_2_clicked(self):
with open("./Plug/config.json", 'w+', encoding='utf-8') as f:
if self.ui.checkBox_2.isChecked():
self.Crypto_json['G_S_Crypk'] = True
f.write(json.dumps(self.Crypto_json))
else:
self.Crypto_json['G_S_Crypk'] = False
f.write(json.dumps(self.Crypto_json))
@pyqtSlot()
def on_checkBox_3_clicked(self):
with open("./Plug/config.json", 'w+', encoding='utf-8') as f:
if self.ui.checkBox_3.isChecked():
self.Crypto_json['G_S_Flag'] = True
f.write(json.dumps(self.Crypto_json))
else:
self.Crypto_json['G_S_Flag'] = False
f.write(json.dumps(self.Crypto_json))
if __name__ == "__main__":
app = QApplication(sys.argv)
formAbout = QmyAbout()
formAbout.show()
sys.exit(app.exec_())