def logout(self): #edit transition manageWin.transition = FallOutTransition() manageWin.transition.duration = 0.15 manageWin.current = "welcomeWin" ## popup "Logout Successful" signOut_Complete()
def close_button(self): """Determine button's function.""" if self.is_initialized: self.app.root.transition = FallOutTransition() self.app.root.current = '_main_screen_' else: self.app.stop()
def build(self): self.load_ui_kv_file(os.curdir) root = ScreenManager(transition=FallOutTransition()) scr = MainScreen(self.pipe_ui_with_server, name='Main Screen') root.add_widget(scr) Clock.schedule_interval(scr.update, self.UI_REFRESH_RATE) return root
def go_back(self): if len(self.history) < 2: return False view = self.history.pop() if hasattr(view, 'close'): view.close() self.transition = FallOutTransition() self.current = self.history[-1].name return True
def build(self): root = ScreenManager(transition=FallOutTransition()) root.add_widget(FirstScreen(name = "start")) root.add_widget(SecondScreen(name = "intro")) root.add_widget(GameScreen(name = "game")) root.add_widget(WinScreen(name = "win")) root.add_widget(CreditsScreen(name = "credits")) return root
def cancelar(self): self.scmgr.transition = FallOutTransition() self.scmgr.current = "principal" Logger.debug("%s: current 'principal' - FallOut" % APP) self.parar_servicio() self.config.set('general', 'numero', 0) self.config.set('general', 's1', 'Sector1') self.config.set('general', 's2', 'Sector2') self.config.write()
def build(self): sm = ScreenManager(transition=FallOutTransition()) sm.add_widget(IntroScreen()) sm.add_widget(ObjectListScreen()) sm.add_widget(UploadScreen()) sm.add_widget(DataEntryScreen()) sm.add_widget(VisualScreen()) return sm
def first_start(self, *_): self.root.ids.sm.transition = FallOutTransition() \ if self.theme_cls.theme_style == 'Dark' else RiseInTransition() self.set_decorations() self.root.ids.sm.current = 'scr 1' self.root.ids.sm.transition = SlideTransition() self.root.ids.sm.transition.direction = 'up'
def build(self): # self.server_interface = MockServerInterface() self.manager = ScreenManager(transition=FallOutTransition()) self.manager.add_widget(LoginScreen(name='LoginScreen')) self.manager.add_widget(CreateUserScreen(name='CreateUserScreen')) self.manager.add_widget(PostScreen(name='PostScreen')) self.manager.add_widget(ConversationScreen(name='ConversationScreen')) self.manager.add_widget(PrivateMessenger(name='PrivateMessenger')) self.manager.add_widget(ChoosePMRecipient(name='ChoosePMRecipient')) self.manager.add_widget(ScreenToPost(name='ScreenToPost')) return self.manager
def skip(self, *args): global newPlayer self.manager.transition = FallOutTransition(duration=.01) if (newPlayer.hasNoUser()): self.manager.current = "Reg" else: self.manager.get_screen( 'Selector' ).ids.welcome_name.text = "Maayong Pag-abot (Welcome),\n" + newPlayer.getName( ) self.manager.current = 'Selector' self.manager.transition = SlideTransition()
def pressEnterBtn(self): if self.cart_flag > 0: product_list = [] for id, num in self.cart_list.items(): for i in range(num): product_list.append(id) PayInfo.set_payType(PayType.PAYMENT) PayInfo.set_products(product_list) PayInfo.set_payVal(int(self.price_property)) self.parent.transition = FallOutTransition() self.parent.current = 's_nfc' else: self.OpenErrorPop()
def __init__(self, **kwargs): super().__init__(**kwargs) self.transition = FallOutTransition() my_db = db.OD_DAG('ingredients') beans = nd.Node('Beans') black_beans = nd.Node('Black Beans') red_beans = nd.Node('Red Beans') my_db.add(beans) my_db.add(black_beans, beans) my_db.add(red_beans, beans) my_db.save() path = None self.add_widget(Test_Screen(path, self)) self.add_widget(Test_New_Data_Node())
def SetPageEffect(self,*,uEffect:str) -> bool: """ Sets the page effect for showing a page """ self.uCurrentEffect = uEffect try: if uEffect==u'': return True uType=ToUnicode(type(self.oRootSM.transition)) if uEffect==u'no': self.oRootSM.transition = NoTransition() if uEffect==u'fade': if uType.endswith(u'FadeTransition\'>'): return True self.oRootSM.transition = FadeTransition() elif uEffect==u'slide': if uType.endswith(u'SlideTransition\'>'): return True self.oRootSM.transition = SlideTransition() elif uEffect==u'wipe': if uType.endswith(u'WipeTransition\'>'): return True self.oRootSM.transition = WipeTransition() elif uEffect==u'swap': if uType.endswith(u'SwapTransition\'>'): return True self.oRootSM.transition = SwapTransition() elif uEffect==u'fallout': if uType.endswith(u'FallOutTransition\'>'): return True self.oRootSM.transition = FallOutTransition() elif uEffect==u'risein': if uType.endswith(u'RiseInTransition\'>'): return True self.oRootSM.transition = RiseInTransition() # noinspection PyArgumentList self.oRootSM.transition.bind(on_complete=self.On_Transition_Complete) # noinspection PyArgumentList self.oRootSM.transition.bind(on_progress=self.On_Transition_Started) return True except Exception as e: ShowErrorPopUp(uMessage=LogError(uMsg=u'TheScreen: Can not set page effect:' + uEffect,oException=e)) return False
def do_login(self, loginText, passwordText): """Login to the server with login and password. Parameters ---------- loginText : String The username to login with. passwordText : String The unhashed password to try the login with. Returns ------- If login is sucessful, proceed to the application. Else show a popup and clear the textboxes. """ app = App.get_running_app() app.username = loginText app.password = passwordText app.host_address = self.ids.host_address.text app.host_port = self.ids.host_port.text if len(loginText) == 0 or len(passwordText) == 0: self.ids.login.focus = True return False Logger.info(f"Trying: {loginText}/{passwordText} h: {app.host_address}:{app.host_port}") app.player = Player(loginText, password=passwordText, host_address=app.host_address, host_port=app.host_port) if app.player.logged_in: self.manager.transition = FallOutTransition() self.manager.current = 'overview' self.manager.get_screen('overview').get_current_games() app.config.read(app.get_application_config()) app.config.write() else: self.resetForm() self.ids.login.focus = True self.loginFailedMessage()
def __init__(self, **kwargs): super(QuirkRoot, self).__init__(**kwargs) self.transition = FallOutTransition() self.scores = {} self.responses = {} home_screen = self.get_screen('home') # Populate home screen with available questionnaires for filename in os.listdir(os.getcwd() + "/questionnaires"): if not filename.startswith('.'): # Ignore .DS_store :/ path = os.path.join("questionnaires", filename) questionnaire_json = json_from_file(path) title = questionnaire_json['title'] selector = Factory.QuestionnaireSelector() selector.title = title selector.filename = filename home_screen.content.add_widget(selector)
def __init__(self, **kwargs): super().__init__(**kwargs) self.transition = FallOutTransition() ingredient_data = db.OD_Scaffold('ingredients.json') self.add_widget(ig.Ingredients_Screen(ingredient_data, self)) quantities_data = db.OD_Scaffold('quantities.json') self.add_widget(qt.Quantities_Screen(quantities_data, self)) cookbook_data = db.OD_Scaffold('cookbook.json') cookbook_data.attach_core(ingredient_data, dbl.process_core_node_db, dbl.process_obs_recipe_ing) cookbook_data.attach_core(quantities_data, dbl.process_core_node_db, dbl.process_obs_recipe_qtype) shop_cook_filename = 'shopping_cookbook.json' if os.path.exists(shop_cook_filename): os.remove(shop_cook_filename) shopping_cookbook_data = db.OD_Scaffold(shop_cook_filename) RM = rm.Recipe_Manager(cookbook_data) self.add_widget(cb.Cookbook_Home_Screen(RM, cookbook_data, shopping_cookbook_data, self)) self.add_widget(arm.Recipe_Home_Screen(self, RM)) self.add_widget(ari.Ingredients_Select_Screen(ingredient_data, self, RM)) self.add_widget(arq.Quantity_Select_Screen(quantities_data, self, RM)) shop_quantity_filename = 'shopping_quantity.json' if os.path.exists(shop_quantity_filename): os.remove(shop_quantity_filename) shop_quantity_data = db.OD_Scaffold(shop_quantity_filename) self.add_widget(sc.Shopping_Cookbook_Screen(shopping_cookbook_data, shop_quantity_data, self)) self.add_widget(sq.Shopping_Quantity_Screen(shop_quantity_data, self))
def cancelar_alarma(self, dt=None, source='Unknown', clock_date=None): # argumento dt viene del Clock now = datetime.now() Logger.debug("%s: cancelar_alarma - source %s %s" % (APP, source, now)) if not self.scmgr.current == 'alarma': # La cancelación automática se llama aunque el usuario haya # cancelado ya. No hacer nada si es el caso Logger.debug("%s: cancelar_alarma - alarma ya apagada." % APP) return if source == 'Clock': # El usuario no ha cancelado. Debemos evitar que la pantalla # se quede encendida. Enviamos la task al background Logger.debug("%s: cancelar alarma clock_date=%s dt=%s" % (APP, clock_date, dt)) if (now - clock_date).seconds < self.ACS: # No sé por qué a veces el Clock llama inmediatamente en # lugar de esperar los segundos que tocan. Si es el caso # volver a intentarlo con lo que falta self.clock_callback = partial(self.cancelar_alarma, source='Clock', clock_date=clock_date) Clock.schedule_once(self.clock_callback, (clock_date + timedelta(seconds=self.ACS) - now).seconds) Logger.debug( "%s: cancelar_alarma - Clock llamo antes de tiempo") return self.cancelar_sonido_alarma() self.scmgr.transition = FallOutTransition() self.scmgr.current = self.previous_screen Logger.debug("%s: current previous '%s' - FallOut" % (APP, self.previous_screen)) Clock.unschedule(self.clock_callback)
def on_enter(self, *args): self.children[0].initialize() class result_screen(Screen): def __init__(self, **kwargs): super(result_screen, self).__init__(**kwargs) self.result_screen = Result() self.add_widget(self.result_screen) def on_enter(self, *args): pass Builder.load_file("numeron.kv") sm = ScreenManager(transition=FallOutTransition()) sm.add_widget(main_screen(name="main")) sm.add_widget(result_screen(name="result")) class NumeronApp(App): def __init_(self, **kwargs): super(NumeronApp, self).__init__(**kwargs) self.title = 'numeron' def build(self): return sm if __name__ == "__main__": NumeronApp().run()
def deleteAccount(self): userDatabase.remove_user(self.currentUsername) manageWin.transition = FallOutTransition() manageWin.transition.duration = 0.15 manageWin.current = "welcomeWin" userDeleted()
def switchTo(self, name: str): if (self.sm.current == name): self.sm.transition = NoTransition() self.sm.current = blankScreen self.sm.current = name self.sm.transition = FallOutTransition()
def __init__(self, **kwargs): super(Juggler, self).__init__(**kwargs) self.fade = FadeTransition() self.fall = FallOutTransition() self.rise = RiseInTransition() self.transition = self.fade
def goto_register(self): """Change to the register account screen.""" self.manager.transition = FallOutTransition() self.manager.current = "registration"
def restart(self): values = {} for scr in in_scr: scr.clear_widgets() sm.transition = FallOutTransition() sm.current = 'input 1'
def menuScreen2(self,dt): sm.transition = FallOutTransition() sm.current = 'menu'
def CambiarAnimacionContactos(self): root.transition = FallOutTransition()
def __init__(self, **kwargs): super().__init__(**kwargs) self.transition = FallOutTransition() self.add_widget(TestScreen())
def hide_image(self, widget=None, touch=None): Logger.debug("%s: hide_image" % APP) self.scmgr.transition = FallOutTransition() self.scmgr.current = 'planilla'
def pressEnterBtn(self): if not self.price_property == '0': PayInfo.set_payType(PayType.CHARGE) PayInfo.set_chargeVal(int(self.price_property)) self.parent.transition = FallOutTransition() self.parent.current = 's_nfc'
def build(self): self.manager = ScreenManager(transition=FallOutTransition()) self.manager.add_widget(MainMenu(name='MainMenu')) self.manager.add_widget(GameScreen(name='GameScreen')) return self.manager