Ejemplo n.º 1
0
    @cached_property
    def get_database(self):
        return self.get_resource('database/resturant_database.db')

    @cached_property
    def cancel_icon(self):
        return QIcon(self.get_resource('icons/cross-button.png'))

    @cached_property
    def logout_icon(self):
        return QIcon(self.get_resource('icons/control-power.png'))

    @cached_property
    def about_logo(self):
        return QPixmap(self.get_resource('icons/restaurant128.png'))

    @cached_property
    def window_icon(self):
        return QIcon(self.get_resource('icons/restaurant64.png'))


if __name__ == '__main__':
    
    appctxt = MyApplicationContext()     # 1. Instantiate ApplicationContext

    window = LoginWindow(appctxt)
    window.show()

    exit_code = appctxt.app.exec_()      # 2. Invoke appctxt.app.exec_()
    sys.exit(exit_code)
Ejemplo n.º 2
0
 def logout(self):
     # Go to login window
     self.loginwindow = LoginWindow(context=self.context)
     self.loginwindow.show()
     self.hide()
Ejemplo n.º 3
0
 def logout(self):
     self.loginwindow = LoginWindow(self.context)
     self.loginwindow.show()
     self.hide()
Ejemplo n.º 4
0
import sys
from PyQt5.QtWidgets import QApplication
from loginwindow import LoginWindow

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = LoginWindow()
    window.show()
    sys.exit(app.exec_())
Ejemplo n.º 5
0
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"

api = API()
db = Database()

if __name__ == '__main__':
    app = QApplication(sys.argv)

    data = api.whoami(db.readDatabase()['userdata']['api_token'])
    print(data)

    try:
        if data == None:
            raise ApiException('Error could not connect to api')
        if data.get('error'):
            login = LoginWindow()
            trayIcon = SystemTrayIcon(QIcon(Config.icon))
            #Maybe move this inside the SystemTray class, keep the main clean yo
            trayIcon.StartWorking.setEnabled(False)
            trayIcon.dashboard.setEnabled(False)
            trayIcon.settings.setEnabled(False)
            trayIcon.timer.setEnabled(False)
            trayIcon.show()
            #lol.button.clicked.connect(run)#self.button.clicked
            if login.exec_() == QDialog.Accepted:
                ex = TimerWindow()
                trayIcon.ex = ex
                trayIcon.StartWorking.setEnabled(True)
                trayIcon.dashboard.setEnabled(True)
                trayIcon.settings.setEnabled(True)
                trayIcon.timer.setEnabled(True)
Ejemplo n.º 6
0
 def login(self):
     """Run login dialog and get the api_conn set up"""
     login = LoginWindow(self)
     login.exec_()
     self.connected = True