示例#1
0
    def __init__(self):
        """
        Sets everything up.
        """

        # initialize some objects
        self.IPChooserView = IPChooserView.View()
        self.mainView = MainView.View()
        self.model = None

        # set up the IP chooser
        # in case IP/Port is already defined in sys.argv, set as value of input fields
        self.IPChooserView.show()
        if len(sys.argv) == 3:
            self.IPChooserView.IPAdressInput.setText(sys.argv[1])
            self.IPChooserView.portInput.setText(sys.argv[2])

        # bind ip chooser widget's buttons to methods
        QObject.connect(self.IPChooserView.connectButton, SIGNAL("clicked()"),
                        self.connect)
        QObject.connect(self.IPChooserView.closeButton, SIGNAL("clicked()"),
                        self.close)
        # bind main widget's buttons to methods
        QObject.connect(self.mainView.checkButton, SIGNAL("clicked()"),
                        self.check)
        QObject.connect(self.mainView.resetButton, SIGNAL("clicked()"),
                        self.reset)
        QObject.connect(self.mainView.closeButton, SIGNAL("clicked()"),
                        self.close)