コード例 #1
0
    def __init__(self,logger, logincallback, parent=None):
        self.logincallback = logincallback #We call this on successful login
        self.logger = logger
        super(LoginWindow,self).__init__(parent = parent)
        mydir = os.path.dirname(__file__)
        uic.loadUi(os.path.join(mydir,"resources/login.ui"),self)

        logofile = os.path.join(mydir,"resources/logo.png")
        self.logo.setPixmap(QPixmap(logofile))
        self.setWindowIcon(QIcon(logofile))

        #The default device text
        self.connect_devicename.setText("laptop")
        self.create_devicename.setText("laptop")

        #The ConnectorDB database url
        self.connect_server.setText(connectordb.CONNECTORDB_URL)

        #Set the login button callback
        self.login_button.clicked.connect(self.login)
        self.create_button.clicked.connect(self.create)

        # Set the connectordb version
        self.version.setText(version)

        # Only enable the "create" tab if the executable is found
        if files.getConnectorDB() is None:
            logging.info("Couldn't find ConnectorDB executable. Not showing create tab.")
            self.tabWidget.removeTab(1)
コード例 #2
0
 def __init__(self,location,cdb_executable=None):
     self.cdb_executable = cdb_executable
     if self.cdb_executable is None:
         self.cdb_executable = files.getConnectorDB()
         if self.cdb_executable is None:
             raise Exception("Could not find ConnectorDB executable")
     self.location = os.path.abspath(location)