Example #1
0
    def addOption(self, dstPage=None):
        # add option to the provide page
        if dstPage:
            optionText, success = QtGui.QInputDialog.getText(
                self, "Option Text", "Enter the option text to the next page"
            )
            if success:
                self._currentPage.options.append({"text": str(optionText), "id": dstPage.id})
        else:
            options = {}
            for option in self._eligibleOptions():
                options[option] = {}

            dialog = OptionsDialog(self, options)
            if dialog.exec_():  # TODO: check against enum
                optionTitle = dialog.option()
                workspace = self._workspace

                self._currentPage.options.append({"text": "text to go to", "id": optionTitle})

        self._updateOptionsBox()