-
Notifications
You must be signed in to change notification settings - Fork 2
/
interface.py
189 lines (180 loc) · 9.56 KB
/
interface.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interface.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
from core import *
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(586, 304)
MainWindow.setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0.352, x2:1, y2:0.716, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(67, 67, 67, 255));")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setStyleSheet("")
self.centralwidget.setObjectName("centralwidget")
self.Shecan = QtWidgets.QPushButton(self.centralwidget)
self.Shecan.setGeometry(QtCore.QRect(20, 30, 101, 31))
font = QtGui.QFont()
font.setFamily("Fira Code")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.Shecan.setFont(font)
self.Shecan.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: qlineargradient(spread:pad, x1:0.489, y1:1, x2:0.5, y2:0, stop:0 rgba(142, 158, 171, 255), stop:0.244318 rgba(238, 242, 243, 255));")
self.Shecan.setObjectName("Shecan")
self.Begzar = QtWidgets.QPushButton(self.centralwidget)
self.Begzar.setGeometry(QtCore.QRect(20, 100, 101, 31))
font = QtGui.QFont()
font.setFamily("Fira Code")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.Begzar.setFont(font)
self.Begzar.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: qlineargradient(spread:pad, x1:0.489, y1:1, x2:0.5, y2:0, stop:0 rgba(142, 158, 171, 255), stop:0.244318 rgba(238, 242, 243, 255));")
self.Begzar.setObjectName("Begzar")
self.RiotPlus = QtWidgets.QPushButton(self.centralwidget)
self.RiotPlus.setGeometry(QtCore.QRect(20, 170, 101, 31))
font = QtGui.QFont()
font.setFamily("Fira Code")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.RiotPlus.setFont(font)
self.RiotPlus.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: qlineargradient(spread:pad, x1:0.489, y1:1, x2:0.5, y2:0, stop:0 rgba(142, 158, 171, 255), stop:0.244318 rgba(238, 242, 243, 255));")
self.RiotPlus.setObjectName("RiotPlus")
self.Disconnect = QtWidgets.QPushButton(self.centralwidget)
self.Disconnect.setGeometry(QtCore.QRect(20, 240, 101, 31))
font = QtGui.QFont()
font.setFamily("Fira Code")
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.Disconnect.setFont(font)
self.Disconnect.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: qlineargradient(spread:pad, x1:0.489, y1:1, x2:0.5, y2:0, stop:0 rgba(142, 158, 171, 255), stop:0.244318 rgba(238, 242, 243, 255));")
self.Disconnect.setObjectName("Disconnect")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setGeometry(QtCore.QRect(20, 25, 100, 41))
self.frame.setStyleSheet("border-radius:5px;\n"
"background-color: qlineargradient(spread:pad, x1:0.057, y1:0.420455, x2:1, y2:0.693, stop:0 rgba(54, 0, 51, 255), stop:1 rgba(11, 135, 147, 255));")
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.frame_2 = QtWidgets.QFrame(self.centralwidget)
self.frame_2.setGeometry(QtCore.QRect(19, 94, 100, 41))
self.frame_2.setStyleSheet("border-radius:5px;\n"
"background-color: qlineargradient(spread:pad, x1:0.057, y1:0.420455, x2:1, y2:0.693, stop:0 rgba(54, 0, 51, 255), stop:1 rgba(11, 135, 147, 255));")
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.frame_3 = QtWidgets.QFrame(self.centralwidget)
self.frame_3.setGeometry(QtCore.QRect(20, 163, 100, 41))
self.frame_3.setStyleSheet("border-radius:5px;\n"
"background-color: qlineargradient(spread:pad, x1:0.057, y1:0.420455, x2:1, y2:0.693, stop:0 rgba(54, 0, 51, 255), stop:1 rgba(11, 135, 147, 255));")
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_3.setObjectName("frame_3")
self.frame_4 = QtWidgets.QFrame(self.centralwidget)
self.frame_4.setGeometry(QtCore.QRect(21, 235, 100, 41))
self.frame_4.setStyleSheet("border-radius:5px;\n"
"background-color: qlineargradient(spread:pad, x1:0.057, y1:0.420455, x2:1, y2:0.693, stop:0 rgba(54, 0, 51, 255), stop:1 rgba(11, 135, 147, 255));")
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_4.setObjectName("frame_4")
self.frame_5 = QtWidgets.QFrame(self.centralwidget)
self.frame_5.setGeometry(QtCore.QRect(10, 0, 121, 301))
self.frame_5.setStyleSheet("border-radius:10px;")
self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_5.setObjectName("frame_5")
self.Status = QtWidgets.QLabel(self.centralwidget)
self.Status.setGeometry(QtCore.QRect(260, 140, 221, 81))
font = QtGui.QFont()
font.setFamily("Fira Code")
font.setPointSize(20)
self.Status.setFont(font)
self.Status.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(0, 255, 127);")
self.Status.setObjectName("Status")
self.frame_6 = QtWidgets.QFrame(self.centralwidget)
self.frame_6.setGeometry(QtCore.QRect(139, 259, 441, 41))
self.frame_6.setStyleSheet("border-radius:20px;\n"
"background-color: qlineargradient(spread:pad, x1:0, y1:0.653, x2:0.977, y2:0.573864, stop:0 rgba(187, 43, 39, 255), stop:1 rgba(21, 101, 192, 255));")
self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_6.setObjectName("frame_6")
self.label = QtWidgets.QLabel(self.frame_6)
self.label.setGeometry(QtCore.QRect(10, 10, 421, 21))
font = QtGui.QFont()
font.setFamily("Dima Web")
font.setPointSize(13)
font.setBold(False)
font.setWeight(50)
self.label.setFont(font)
self.label.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(255, 255, 255);")
self.label.setObjectName("label")
self.frame_5.raise_()
self.frame_4.raise_()
self.frame_3.raise_()
self.frame_2.raise_()
self.frame.raise_()
self.Shecan.raise_()
self.Begzar.raise_()
self.RiotPlus.raise_()
self.Disconnect.raise_()
self.Status.raise_()
self.frame_6.raise_()
self.Shecan.clicked.connect(self.setdns1)
self.Begzar.clicked.connect(self.setdns2)
self.RiotPlus.clicked.connect(self.setdns3)
self.Disconnect.clicked.connect(self.setdns4)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "DNS Changer"))
self.Shecan.setText(_translate("MainWindow", "Shecan"))
self.Begzar.setText(_translate("MainWindow", "Begzar"))
self.RiotPlus.setText(_translate("MainWindow", "Riot+"))
self.Disconnect.setText(_translate("MainWindow", "Disconnect"))
self.label.setText(_translate("MainWindow", "نکته: لطفا قبل از هر دفعه عوض کردن DNS بر روی Disconnnect یک بار کلیک کنید."))
def setdns1(self):
self.Status.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(0, 255, 127);")
_translate = QtCore.QCoreApplication.translate
shecan_dns()
self.Status.setText(_translate("MainWindow", "Connected✔"))
def setdns2(self):
self.Status.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(0, 255, 127);")
_translate = QtCore.QCoreApplication.translate
begzar_dns()
self.Status.setText(_translate("MainWindow", "Connected✔"))
def setdns3(self):
self.Status.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(0, 255, 127);")
_translate = QtCore.QCoreApplication.translate
riotplus_dns()
self.Status.setText(_translate("MainWindow", "Connected✔"))
def setdns4(self):
self.Status.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n"
"color: rgb(236, 62, 62);")
_translate = QtCore.QCoreApplication.translate
default_dns
self.Status.setText(_translate("MainWindow", "Disonnected❌"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())