from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QDialog, QMessageBox
import sys
import ui.reparkingUi as rp
class ReparkingWindow(QDialog, rp.Ui_Dialog):
    def __init__(self):
        super(ReparkingWindow, self).__init__()
        self.setupUi(self)
        self.results = False
        self.park_tableid = -1
        # 设置属性为模态框
        self.setWindowModality(Qt.ApplicationModal)
        self.OK_pushButton.clicked.connect(self.ok_btn)

    def ok_btn(self):
        if self.park_lineEdit.text().isdigit() is True:
            self.results = True
            self.park_tableid = int(self.park_lineEdit.text())
            self.close()
        else:
            QMessageBox.warning(self, "提示", "车位号输入错误！", QMessageBox.Yes)

    def get_results(self):
        return self.results

    def get_park_tableid(self):
        return self.park_tableid



