Ejemplo n.º 1
0
 def __init__(self, parent=None):
     super(UserMainWindow, self).__init__(parent)
     self.setupUi(self)
     self.currentCart = []
     self.connect(self.userSales, SIGNAL('clicked()'), self.switch_to_sales_tab)
     self.connect(self.userSettings, SIGNAL('clicked()'), self.switch_to_settings_tab)
     self.connect(self.notificationsBtn, SIGNAL('clicked()'), self.switch_to_notifications_tab)
     self.connect(self.searchButton, SIGNAL('clicked()'), self.search_inventory)
     self.connect(self.searchTableWidget, SIGNAL('itemSelectionChanged()'), self.add_to_cart)
     self.searchTableWidget.setAlternatingRowColors(True)
     self.searchTableWidget.setSelectionBehavior(QTableWidget.SelectRows)
     self.searchTableWidget.setSelectionBehavior(QTableWidget.SelectRows)
     self.searchTableWidget.setSelectionMode(QTableWidget.SingleSelection)
     self.cartTableWidget.clear()
     self.cartTableWidget.setColumnCount(3)
     self.cartTableWidget.setHorizontalHeaderLabels(['Item', 'Quantity', 'Price'])
     self.cartTableWidget.setAlternatingRowColors(True)
     self.connect(self.cashLineEdit, SIGNAL('returnPressed()'), self.return_balance)
     self.connect(self.finishBtn, SIGNAL('clicked()'), self.on_finish)
     self.connect(self.checkoutButton, SIGNAL('clicked()'), self.checkout)
     self.connect(self.searchLineEdit, SIGNAL('returnPressed()'), self.search_inventory)
     self.lcd_font = QFont()
     self.lcd_font.Bold
     sales_today = databaseManagement.today_sales()
     self.todaysSalesLCD.setSegmentStyle(QLCDNumber.Flat)
     self.todaysSalesLCD.setDigitCount(7)
     self.todaysSalesLCD.display(sales_today)
Ejemplo n.º 2
0
 def __init__(self, parent=None):
     super(AdminMainWindow, self).__init__(parent)
     self.setupUi(self)
     self.tabWidget.setCurrentWidget(self.reportsTab)
     self.userComboBox.clear()
     self.userComboBox.addItems(databaseManagement.get_users())
     self.connect(self.inventoryBtn, SIGNAL('clicked()'),
                  self.inventory_btn_signal)
     self.connect(self.reportsBtn, SIGNAL('clicked()'),
                  self.reports_btn_signal)
     self.connect(self.logoutBtn, SIGNAL('clicked()'), self.logout)
     self.connect(self.addUserBtn, SIGNAL('clicked()'), self.add_user)
     self.connect(self.deleteUserBtn, SIGNAL('clicked()'), self.delete_user)
     self.setWindowTitle("Point of Sale System")
     self.connect(self.inventoryAddItemBtn, SIGNAL('clicked()'), self.add_new_item)
     self.connect(self.searchBtn, SIGNAL('clicked()'), self.search_inventory)
     self.connect(self.inventorySeachEdit, SIGNAL('returnPressed()'), self.search_inventory)
     sales_today = databaseManagement.today_sales()
     self.todaysSalesLCD.setSegmentStyle(QLCDNumber.Flat)
     self.todaysSalesLCD.setDigitCount(7)
     self.todaysSalesLCD.display(sales_today)