Beispiel #1
0
class showInstructionsDialog(QDialog):
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.prm = self.parent().prm
        self.currLocale = self.parent().prm['currentLocale']
        self.currLocale.setNumberOptions(
            self.currLocale.OmitGroupSeparator
            | self.currLocale.RejectGroupSeparator)
        #self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        self.vBoxSizer = QVBoxLayout()
        self.hBoxSizer = QVBoxLayout()
        self.browser = QTextBrowser()
        self.browser.setSizePolicy(QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.setMinimumHeight(80)
        self.buttonBox.buttons()[0].setMinimumHeight(80)
        self.hBoxSizer.addWidget(self.buttonBox)
        cw = self.parent().parent()
        if cw.prm["storedBlocks"] > 0:
            storedInstr = cw.prm['b' +
                                 str(cw.prm['currentBlock'])]['instructions']
            if len(storedInstr) > 0:
                self.browser.append(storedInstr)
            else:
                self.browser.append(
                    self.tr("Sorry, there are no instructions for this task."))
        else:
            storedInstr = self.parent().parent().instructionsTF.toPlainText()
            if len(storedInstr) > 0:
                self.browser.append(storedInstr)
            else:
                self.browser.append(
                    self.tr("Sorry, there are no instructions for this task."))
        self.browser.append("\n\nPress the ESC key to exit this screen.")

        font = QFont()
        font.setFamily("Arial")
        font.setPointSize(22)
        self.browser.setFont(font)

        self.vBoxSizer.addWidget(self.browser)
        self.vBoxSizer.addLayout(self.hBoxSizer)
        #self.vBoxSizer.setSizeConstraint(QLayout.SetFixedSize)

        self.setLayout(self.vBoxSizer)
        self.setWindowTitle(self.tr("Task Instructions"))
        #self.resize(900, 600)
        self.showFullScreen()
class showInstructionsDialog(QDialog):
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.prm = self.parent().prm
        self.currLocale = self.parent().prm['currentLocale']
        self.currLocale.setNumberOptions(self.currLocale.OmitGroupSeparator | self.currLocale.RejectGroupSeparator)
        #self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
       
        self.vBoxSizer = QVBoxLayout()
        self.hBoxSizer = QVBoxLayout()
        self.browser = QTextBrowser()
        self.browser.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.setMinimumHeight(80)
        self.buttonBox.buttons()[0].setMinimumHeight(80)
        self.hBoxSizer.addWidget(self.buttonBox)
        cw = self.parent().parent()
        if cw.prm["storedBlocks"] > 0:
            storedInstr = cw.prm['b'+ str(cw.prm['currentBlock'])]['instructions']
            if len(storedInstr) > 0:
                self.browser.append(storedInstr)
            else:
                self.browser.append(self.tr("Sorry, there are no instructions for this task."))
        else:
            storedInstr = self.parent().parent().instructionsTF.toPlainText()
            if len(storedInstr) > 0:
                self.browser.append(storedInstr)
            else:
                self.browser.append(self.tr("Sorry, there are no instructions for this task."))
        self.browser.append("\n\nPress the ESC key to exit this screen.")

        font = QFont()
        font.setFamily("Arial")
        font.setPointSize(22)
        self.browser.setFont(font)
        
        self.vBoxSizer.addWidget(self.browser)
        self.vBoxSizer.addLayout(self.hBoxSizer)
        #self.vBoxSizer.setSizeConstraint(QLayout.SetFixedSize)
        
        self.setLayout(self.vBoxSizer)
        self.setWindowTitle(self.tr("Task Instructions"))
        #self.resize(900, 600)
        self.showFullScreen()