Exemplo n.º 1
0
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)

        self.iface = ServiceItemWidget()
        # Should not be here
        self.instance = avahiservices.Zeroconf("moon", gethostname(), "_presence._tcp")
        self.instance.connect_dbus()
        self.instance.connect_avahi()
        self.instance.connect()
        self.contacts={}

        # Filling Window
        self.connect(self.pushButton, SIGNAL("clicked()"), self.allWidgets)
Exemplo n.º 2
0
class MainWindow(QtGui.QMainWindow, mainWindow.Ui_MainWindow):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)

        self.iface = ServiceItemWidget()
        # Should not be here
        self.instance = avahiservices.Zeroconf("moon", gethostname(), "_presence._tcp")
        self.instance.connect_dbus()
        self.instance.connect_avahi()
        self.instance.connect()
        self.contacts={}

        # Filling Window
        self.connect(self.pushButton, SIGNAL("clicked()"), self.allWidgets)

    def allWidgets(self):
        self.instance.get_contacts()

        self.listWidget.clear()
        self.connect(self.listWidget, SIGNAL("itemClicked(QListWidgetItem*)"), self.connectHost)
        for contact in self.instance.get_contacts():
            self.contacts[contact] = self.iface.fillWidget(contact)


    def connectHost(self, item):
        self.pkg = self.interface.getPackage(str(item.data(Qt.UserRole).toString()))
        self.lineEdit_2.setText(unicode(self.pkg.name))
        self.textEdit.setText(unicode(self.pkg.summary))
        self.textEdit_2.setText(unicode(self.pkg.description))
Exemplo n.º 3
0
class MainWindow(QtGui.QMainWindow, mainWindow.Ui_MainWindow):
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)

        self.iface = ServiceItemWidget()
        # Should not be here
        self.instance = avahiservices.Zeroconf("moon", gethostname(), "_presence._tcp")
        self.instance.connect_dbus()
        self.instance.connect_avahi()
        self.instance.connect()
        self.contacts={}

        # Filling Window
        self.connect(self.pushButton, SIGNAL("clicked()"), self.allWidgets)

    def allWidgets(self):
        self.instance.get_contacts()

        self.listWidget.clear()
        self.connect(self.listWidget, SIGNAL("itemClicked(QListWidgetItem*)"), self.connectHost)
        for contact in self.instance.get_contacts():
            self.contacts[contact] = self.iface.fillWidget(contact)


    def connectHost(self, item):
        self.pkg = self.interface.getPackage(str(item.data(Qt.UserRole).toString()))
        self.lineEdit_2.setText(unicode(self.pkg.name))
        self.textEdit.setText(unicode(self.pkg.summary))
        self.textEdit_2.setText(unicode(self.pkg.description))
Exemplo n.º 4
0
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)

        self.iface = ServiceItemWidget()
        # Should not be here
        self.instance = avahiservices.Zeroconf("moon", gethostname(), "_presence._tcp")
        self.instance.connect_dbus()
        self.instance.connect_avahi()
        self.instance.connect()
        self.contacts={}

        # Filling Window
        self.connect(self.pushButton, SIGNAL("clicked()"), self.allWidgets)