def __init__(self): super(Error, self).__init__() loadUi(os.path.join(UI_DIRECTORY, 'error.ui'), self) self.icon = QtGui.QImage() self.icon.load(os.path.join(IMAGE_DIRECTORY, 'error.png')) self.error_label.setPixmap(QtGui.QPixmap(self.icon)) AuthenticationClient.add_listener(self)
def __init__(self, content): super(Welcome, self).__init__() self.content = content loadUi(os.path.join(UI_DIRECTORY, 'welcome.ui'), self) AuthenticationClient.add_listener(self) self.user_id = '' self.add_delivery_button.clicked.connect(self.add_delivery) self.receive_delivery_button.clicked.connect(self.retrieve_delivery)
def __init__(self): super(Header, self).__init__() loadUi(os.path.join(UI_DIRECTORY, 'header.ui'), self) self.logo = QtGui.QImage() self.logo.load(os.path.join(IMAGE_DIRECTORY, 'aidu.png')) self.logo_label.setPixmap(QtGui.QPixmap(self.logo.scaledToHeight(100))) self.logout_button.clicked.connect(self.logout) AuthenticationClient.add_listener(self)
def __init__(self): super(Header, self).__init__() loadUi(os.path.join(UI_DIRECTORY, "header.ui"), self) self.logo = QtGui.QImage() self.logo.load(os.path.join(IMAGE_DIRECTORY, "aidu.png")) self.logo_label.setPixmap(QtGui.QPixmap(self.logo.scaledToHeight(100))) self.logout_button.clicked.connect(self.logout) AuthenticationClient.add_listener(self)
def __init__(self, content): super(RetrieveDelivery, self).__init__() self.content = content loadUi(os.path.join(UI_DIRECTORY, 'receive_delivery.ui'), self) self.drawer1_button.clicked.connect(self.drawer1_open) self.drawer2_button.clicked.connect(self.drawer2_open) self.drawer3_button.clicked.connect(self.drawer3_open) self.cancel_button.clicked.connect(self.cancel) self.recipient_id = None self.drawer_id = '1' AuthenticationClient.add_listener(self)
def __init__(self, content): super(AddDelivery, self).__init__() self.content = content loadUi(os.path.join(UI_DIRECTORY, 'add_delivery.ui'), self) self.cancel_button.clicked.connect(self.cancel) self.save_button.clicked.connect(self.place) self.deliveries = {} self.sender = None self.drawer_id = '1' for location in Location.get_locations(): self.location_combobox.addItem(location.name) #from PySide.QtGui import QComboBox #test = QComboBox() #self.recipient_combobox.addItems(User.get_users()) #self.location_combobox.addItems(Location.get_locations()) AuthenticationClient.add_listener(self)
def __init__(self): super(Content, self).__init__() self.setFrameStyle(QtGui.QFrame.StyledPanel | QtGui.QFrame.Plain) self.timer = None # Initialize all possible content components self.components = {'scan_card': ScanCard(), 'add_delivery': AddDelivery(self), 'retrieve_delivery': RetrieveDelivery(self), 'welcome': Welcome(self), 'open_drawer': OpenDrawer(self), 'error': Error()} # Creates the layout and adds all the components layout = QtGui.QHBoxLayout() for component in self.components.values(): layout.addWidget(component) component.hide() self.setLayout(layout) # Listen to the authentication client AuthenticationClient.add_listener(self)
def __init__(self): super(Content, self).__init__() self.setFrameStyle(QtGui.QFrame.StyledPanel | QtGui.QFrame.Plain) self.timer = None # Initialize all possible content components self.components = { 'scan_card': ScanCard(), 'add_delivery': AddDelivery(self), 'retrieve_delivery': RetrieveDelivery(self), 'welcome': Welcome(self), 'open_drawer': OpenDrawer(self), 'error': Error() } # Creates the layout and adds all the components layout = QtGui.QHBoxLayout() for component in self.components.values(): layout.addWidget(component) component.hide() self.setLayout(layout) # Listen to the authentication client AuthenticationClient.add_listener(self)
def logout(self): AuthenticationClient.logout()