示例#1
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = ki18n("Bug Reporting Tool")
    desc = ki18n("Welcome to Bug Reporting Tool :)")

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_bugWidget()
        self.ui.setupUi(self)

    def shown(self):
        pass

    def execute(self):
        return True

    @property
    def choices(self):
        return self.ui.choicesBox

    def add_choice(self, option, is_multiple=False):
        widget = None
        if is_multiple:
            widget = QtGui.QCheckBox(option)
        else:
            widget = QtGui.QRadioButton(option)
        assert widget != None, 'Unexpected None value for widget'
        self.ui.choicesBox.insertWidget(0,widget)

    def get_response(self):
        return [c for c in range(0, self.choices.count()) if \
                self.choices.itemAt(c).widget().isChecked()]
示例#2
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = ki18n("Bug Reporting Tool")
    desc = ki18n("Welcome to Bug Reporting Tool :)")

    def __init__(self, *args):
        QtGui.QWidget.__init__(self, None)
        self.ui = Ui_bugWidget()
        self.ui.setupUi(self)

    def shown(self):
        pass

    def execute(self):
        return True

    @property
    def choices(self):
        return self.ui.choicesBox

    def add_choice(self, option, is_multiple=False):
        widget = None
        if is_multiple:
            widget = QtGui.QCheckBox(option)
        else:
            widget = QtGui.QRadioButton(option)
        assert widget != None, 'Unexpected None value for widget'
        self.ui.choicesBox.insertWidget(0, widget)

    def get_response(self):
        return [c for c in range(0, self.choices.count()) if \
                self.choices.itemAt(c).widget().isChecked()]
示例#3
0
 def __init__(self, *args):
     QtGui.QWidget.__init__(self,None)
     self.ui = Ui_bugWidget()
     self.ui.setupUi(self)
示例#4
0
 def __init__(self, *args):
     QtGui.QWidget.__init__(self, None)
     self.ui = Ui_bugWidget()
     self.ui.setupUi(self)