Red-GUI.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Red-GUI 作者: ScarletRav3n 项目源码 文件源码
def init_ui(self):

        # v.box
        box = QVBoxLayout()
        box.setSpacing(5)
        box2 = QVBoxLayout()
        box2.setSpacing(0)

        l1 = QLabel('Red Discord Bot', self)
        l1.setFont(QtGui.QFont("Times", 14))
        box.addWidget(l1, 0, Qt.AlignTop)
        box.insertSpacing(1, 10)

        b1 = QPushButton("Start Red", self)
        b1.setMinimumWidth(100)
        box.addWidget(b1, 0, Qt.AlignHCenter)
        b2 = QPushButton("Start Red Loop", self)
        b2.setMinimumWidth(100)
        box.addWidget(b2, 0, Qt.AlignHCenter)
        box.insertSpacing(4, 10)

        b3 = QPushButton("Update Red", self)
        b3.setMinimumWidth(80)
        box2.addWidget(b3, 0, Qt.AlignHCenter)
        b4 = QPushButton("Install Requirements", self)
        b4.setMinimumWidth(120)
        box2.addWidget(b4, 0, Qt.AlignHCenter)
        b5 = QPushButton("Maintenance", self)
        b5.setMinimumWidth(100)
        box2.addWidget(b5, 0, Qt.AlignHCenter)

        # b2.setEnabled(False)
        box.setAlignment(Qt.AlignHCenter)
        box2.addStretch(5)
        box.addLayout(box2)
        self.setLayout(box)

        # binds
        b1.clicked.connect(lambda: self.startred(autorestart=False))
        b2.clicked.connect(lambda: self.startred(autorestart=True))
        b3.clicked.connect(lambda: self.switchwindow(window=UpdateWindow()))
        b4.clicked.connect(lambda: self.switchwindow(window=RequirementsWindow()))
        b5.clicked.connect(lambda: self.switchwindow(window=MaintenanceWindow()))

        # window
        self.setFixedSize(220, 210)
        self.setWindowIcon(QtGui.QIcon('red.ico'))
        self.setWindowTitle('Red Bot')
        self.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号