def __init__(self, *args): QVBox.__init__(self, *args) self.setMargin(6) self.setSpacing(6) self.links = QListBox(self) box = QHBox(self) box.setSpacing(12) but = QPushButton(i18n("Create"), box) self.connect(but, SIGNAL("clicked()"), self.slotCreate) but = QPushButton(i18n("Edit"), box) self.connect(but, SIGNAL("clicked()"), self.slotEdit) but = QPushButton(i18n("Delete"), box) self.connect(but, SIGNAL("clicked()"), self.slotDelete) but = QPushButton(i18n("Connect"), box) self.connect(but, SIGNAL("clicked()"), self.slotConnect) but = QPushButton(i18n("Disconnect"), box) self.connect(but, SIGNAL("clicked()"), self.slotDisconnect) self.comar = comar.Link() links.query(self.comar) self.comar.call("Net.Link.connections", id=1) self.comar.ask_notify("Net.Link.stateChanged") self.comar.ask_notify("Net.Link.connectionChanged") self.comar.ask_notify("Net.Link.deviceChanged") self.notifier = QSocketNotifier(self.comar.sock.fileno(), QSocketNotifier.Read) self.connect(self.notifier, SIGNAL("activated(int)"), self.slotComar)
def __init__(self, *args): QVBox.__init__(self, *args) self.setMargin(6) self.setSpacing(6) box = QHBox(self) lab = QLabel(i18n("Network connections:"), box) box.setStretchFactor(lab, 5) but = QPushButton(i18n("Settings"), box) self.connect(but, SIGNAL("clicked()"), self.slotSettings) box.setStretchFactor(but, 1) self.links = QListBox(self) self.connect(self.links, SIGNAL("doubleClicked(QListBoxItem *)"), self.slotDouble) box = QHBox(self) box.setSpacing(12) but = QPushButton(i18n("Create"), box) self.connect(but, SIGNAL("clicked()"), self.slotCreate) but = QPushButton(i18n("Edit"), box) self.connect(but, SIGNAL("clicked()"), self.slotEdit) but = QPushButton(i18n("Delete"), box) self.connect(but, SIGNAL("clicked()"), self.slotDelete) but = QPushButton(i18n("Connect"), box) self.connect(but, SIGNAL("clicked()"), self.slotConnect) but = QPushButton(i18n("Disconnect"), box) self.connect(but, SIGNAL("clicked()"), self.slotDisconnect) but = QPushButton(i18n("Help"), box) self.connect(but, SIGNAL("clicked()"), self.slotHelp) self.comar = comar.Link() self.stack = stack.Window(self, self.comar) links.query(self.comar) self.comar.call("Net.Link.connections", id=1) self.comar.ask_notify("Net.Link.stateChanged") self.comar.ask_notify("Net.Link.connectionChanged") self.comar.ask_notify("Net.Link.deviceChanged") self.notifier = QSocketNotifier(self.comar.sock.fileno(), QSocketNotifier.Read) self.connect(self.notifier, SIGNAL("activated(int)"), self.slotComar)
def __init__(self, *args): QVBox.__init__(self, *args) self.setMargin(6) self.setSpacing(6) bar = QToolBar("lala", None, self) but = QToolButton(getIconSet("add.png"), i18n("New connection"), "lala", self.slotCreate, bar) but.setUsesTextLabel(True) but.setTextPosition(but.BesideIcon) bar.addSeparator() but = QToolButton(getIconSet("configure.png"), i18n("Name Service Settings"), "lala", self.slotSettings, bar) but.setUsesTextLabel(True) but.setTextPosition(but.BesideIcon) bar.addSeparator() but = QToolButton(getIconSet("help.png"), i18n("Help"), "lala", self.slotHelp, bar) but.setUsesTextLabel(True) but.setTextPosition(but.BesideIcon) self.comar = comar.Link() self.view = ConnectionView(self, self.comar) self.stack = stack.Window(self, self.comar) links.query(self.comar) self.comar.ask_notify("Net.Link.stateChanged") self.comar.ask_notify("Net.Link.connectionChanged") self.comar.ask_notify("Net.Link.deviceChanged") self.comar.call("Net.Link.connections", id=1) self.notifier = QSocketNotifier(self.comar.sock.fileno(), QSocketNotifier.Read) self.connect(self.notifier, SIGNAL("activated(int)"), self.slotComar)