def delete_keys(self):
     keys = Key.get_all()
     if keys['data']:
         self.delete_keys_window = DeleteKeysWindow(keys['data'])
         self.delete_keys_window.show()
     elif keys['warnings']:
         self.info = InfoWindow(
             label_text=u"Немає ключів які можна видалити")
         self.info.show()
         QtCore.QTimer.singleShot(5000, self.info.close)
     else:
         self.info_error.show()
         QtCore.QTimer.singleShot(5000, self.info_error.close)
Esempio n. 2
0
 def get_the_keys(self):
     if User.get_all()['warnings']:
         self.info = InfoWindow(
             label_text=
             u"Перший запуск програми, будь ласка створіть користувача!")
         self.info.show()
         self.new_user = AddNewUser()
         QtCore.QTimer.singleShot(3000, self.info.close)
         QtCore.QTimer.singleShot(3000, self.new_user.show)
     else:
         # TODO: Open window with user auth
         user = User.get_by_rfid("12334")['data']
         #self.authenticate_user()
         username = user.firstname + u' ' + user.lastname
         self.welcome_window(username)
         keys = Key.get_all()
         if keys['errors']:
             self.info_error.show()
             QtCore.QTimer.singleShot(5000, self.info_error.close)
         elif keys['warnings']:
             self.get_key_window(keys=None, user=None)
         else:
             self.get_key_window(keys['data'], user=user)