Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.2 kB
1
Indexable
Never
Form, _ = uic.loadUiType("pr.social.ui")

class Ui (QtWidgets.QDialog, Form):

    def on_click_proxy(self):
        file, _ = QFileDialog.getOpenFileName(self, 'Open File', './', "Text (*.txt)")
        self.label_Proxy.setText(file)
        print(file)

    def on_click_start(self,status):
        self.label.setStyleSheet('color: rgb(0, 0, 0);')
        self.label_2.setStyleSheet('color: rgb(0, 0, 0);')


        if not self.wind_api.text():
            self.label.setStyleSheet('color: rgb(255, 0, 0);')
            status = False
        elif not self.wind_id.text():
            self.label_2.setStyleSheet('color: rgb(255, 0, 0);')
            status = False


        if status is True:

            self.pushButton.setText('Стоп')
            self.wind_api.setEnabled(False)
            self.wind_id.setEnabled(False)
            self.wind_hours.setEnabled(False)
            self.ButtonProxy.setEnabled(False)
            self.checkBox.setEnabled(False)
        else:
            self.pushButton.setText('Старт')
            self.wind_api.setEnabled(True)
            self.wind_id.setEnabled(True)
            self.wind_hours.setEnabled(True)
            self.ButtonProxy.setEnabled(True)
            self.checkBox.setEnabled(True)


    def on_click_exit(self):
        self.close()

    def on_click_exit_a(self):
        print(5)


    def __init__(self):



        super(Ui, self,).__init__()

        self.setupUi(self)
        # self.wind_api.setText("333")
        self.checkBox.setChecked(True)




        self.label_6.setText(acc_good)
        self.label_12.setText(acc_bad)
        self.ButtonProxy.clicked.connect(self.on_click_proxy)
        self.pushButton.setCheckable(True)
        self.pushButton.clicked.connect(self.on_click_start)
        self.pushButton_2.clicked.connect(self.on_click_exit)

        print(self.checkBox.isChecked())
        if self.checkBox.isChecked() == True:
            time.sleep(1)
            self.close()
            self.on_click_exit()







if __name__ == "__main__":

    app = QtWidgets.QApplication(sys.argv)


    w = Ui()


    w.show()
    # form = Form()
    # form.setupUi(w)

    sys.exit(app.exec_())