Setup-GUI.py 文件源码

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

项目:Red-GUI 作者: ScarletRav3n 项目源码 文件源码
def prefix_ui(self):
        self.clear_layout(self.rbox)
        self.clear_layout(self.hbox)
        self.hbox.addStretch()
        self.l1.setText("Input your desired prefix")

        self.rbox.insertSpacing(1, 30)
        self.prefix_print = QLabel(self)
        self.prefix_print.setText('Prefix will be set to: <font color="#ff0000">!</font>'
                                  '<br>You would execute the help command by typing: '
                                  '<font color="#ff0000">!help</font>')
        self.prefix_print.setWordWrap(True)
        self.rbox.addWidget(self.prefix_print, 0, Qt.AlignTop)
        self.prefix_edit = QLineEdit(self)
        self.prefix_edit.setPlaceholderText("!")
        self.prefix_edit.setMaximumWidth(300)
        self.rbox.addWidget(self.prefix_edit, 0, Qt.AlignTop)

        l2 = QLabel(self)
        l2.setText('\nPrefixes are referred to in the bot with [p]. '
                   '\nAny time you see [p], replace it with your prefix.')
        self.rbox.addWidget(l2, 0, Qt.AlignCenter)

        matches = [a for a in self.settings.prefixes]
        if len(matches) > 0:
            prefixes = ', '.join(self.settings.prefixes)
            if len(matches) == 1:
                plural = "</font>\nis your current prefix."
            elif len(matches) > 1:
                plural = "</font>\nare your current prefixes."
            l5 = QLabel(self)
            l5.setText('<font color="#ff0000">' + prefixes + plural)
            self.rbox.addWidget(l5, 1, Qt.AlignBottom)
            b5 = QPushButton("Skip", self)
            b5.setMaximumWidth(50)
            self.rbox.addWidget(b5, 0, Qt.AlignBottom)
            b5.clicked.connect(self.admin_ui)

        # buttons
        self.buttons_panel()

        # binds
        self.prefix_edit.textChanged[str].connect(self.prefix_on_change)
        self.b1.setEnabled(True)
        self.b1.clicked.connect(self.token_ui)
        self.b2.clicked.connect(self.prefix_save)
        self.b3.clicked.connect(self.close_prompt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号