コード例 #1
0
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_StartRestartForm.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()

        self.radioButtonYes.clicked.connect(self.slotStartRestart)
        self.radioButtonNo.clicked.connect(self.slotStartRestart)
        self.toolButton.pressed.connect(self.slotSearchRestartDirectory)
        self.checkBox.clicked.connect(self.slotFrozenField)
        self.toolButtonAdvanced.pressed.connect(self.slotAdvancedOptions)

        self.model = StartRestartModel(self.case)

        # Widget initialization

        self.restart_path = self.model.getRestartPath()

        if self.restart_path:
            if not os.path.isdir(
                    os.path.join(self.case['case_path'], self.restart_path)):
                title = self.tr("WARNING")
                msg = self.tr("Invalid path in %s!" % self.restart_path)
                QMessageBox.warning(self, title, msg)

            self.radioButtonYes.setChecked(True)
            self.radioButtonNo.setChecked(False)
コード例 #2
0
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_StartRestartForm.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()

        self.connect(self.radioButtonYes, SIGNAL("clicked()"), self.slotStartRestart)
        self.connect(self.radioButtonNo, SIGNAL("clicked()"), self.slotStartRestart)
        self.connect(self.toolButton, SIGNAL("pressed()"), self.slotSearchRestartDirectory)
        self.connect(self.checkBox, SIGNAL("clicked()"), self.slotFrozenField)
        self.connect(self.toolButtonAdvanced, SIGNAL("pressed()"), self.slotAdvancedOptions)

        self.model = StartRestartModel(self.case)

        # Widget initialization

        self.restart_path = self.model.getRestartPath()

        if self.restart_path:
            if not os.path.isdir(os.path.join(self.case['case_path'],
                                              self.restart_path)):
                title = self.tr("WARNING")
                msg   = self.tr("Invalid path in %s!" % self.restart_path)
                QMessageBox.warning(self, title, msg)

            self.radioButtonYes.setChecked(True)
            self.radioButtonNo.setChecked(False)

        else:
            self.radioButtonYes.setChecked(False)
            self.radioButtonNo.setChecked(True)

        self.slotStartRestart()

        if self.model.getFrozenField() == 'on':
            self.checkBox.setChecked(True)
        else:
            self.checkBox.setChecked(False)

        self.case.undoStartGlobal()