class RadiusUserWidget(DirectoryWidget): def __init__(self, config, specific_config, mainwindow, parent=None): DirectoryWidget.__init__(self, config, specific_config, mainwindow, parent=None) self.__setupgui() self.__setupsignals() if len(self.specific_config.servers) == 0: self.specific_config.servers.append(RadiusServer()) self.updateView() def __setupgui(self): self.__radiusframe = RadiusFrame(self.mainwindow.client) self.__radiusframe.setFrameStyle(QFrame.NoFrame) self.form.addRow(self.__radiusframe) self.__radiusframe.show() def __setupsignals(self): for lineedit in self.__radiusframe.lineedits: self.connect( lineedit, SIGNAL("textEdited(QString)"), self.signalModified ) def signalModified(self): self.specific_config.servers = [self.__radiusframe.getRadiusserverconf(),] self.config.auth = self.specific_config DirectoryWidget.signalModified(self) def updateView(self): if len(self.specific_config.servers) == 0: self.specific_config.servers.append(RadiusServer()) self.__radiusframe.setRadiusserverconf( self.specific_config.servers[0] )
def __setupgui(self): self.__radiusframe = RadiusFrame(self.mainwindow.client) self.__radiusframe.setFrameStyle(QFrame.NoFrame) self.form.addRow(self.__radiusframe) self.__radiusframe.show()