Beispiel #1
0
    def __init__(self, main_window, name_path, name, displayBottomButtons=True):
        BaseWidget.__init__(self)

        self.component = self.COMPONENT

        self.main_window = main_window

        self.InfoArea = main_window.InfoArea
        self.client = main_window.client
        #self.item = item
        self.displayBottomButtons = displayBottomButtons
        self.displayBottomButtons = False
        # Variable naming convention tip: "control" should always refer to a
        # structure from the menu (a dictionary), and "ctl" to a custom
        # structure containing a control, along with other data like widgets.
        self.ctls = []
        self.errors = []
        QWidget.__init__(self, None)

        self.check_module_disabled()

        self.loadConf()
        self.setObjectName('form')
        self.layout = QVBoxLayout(self)
        self.layout.setObjectName('formLayout')
        self.layout.setMargin(9)
        self.layout.setSpacing(6)
        self._modified = False

        # Label (name of the page):
        self.name = name
        page_name = self.translatePath(name_path, name)
        self.layout.addWidget(createPageLabel(page_name))


        # Main (specific) part:
        scrollWidget, scrollLayout = self._createScrollArea()
        self.createForm(scrollWidget, scrollLayout)


        # Buttons at the bottom of the page:
        if self.displayBottomButtons:
            self.layout.addWidget(self.createBottomButtons())

        self.setLayout(self.layout)

        self.excToErrorMessage = {'[DhcpError] Wrong order': translate('MainWindow',
                    'DHCP server settings: the end IP address must be ' +
                    'greater than the start IP address.'),
                    }

        self.resetConf()
Beispiel #2
0
 def __init__(self):
     QScrollArea.__init__(self)
     BaseWidget.__init__(self)