Beispiel #1
0
    def build(self):
        Window.size = (1046, 718)
        self.manager = ScreenManager()

        # Add screens to app
        self.manager.add_widget(Login(name='login'))
        self.manager.add_widget(Register(name='registration'))
        self.manager.add_widget(GamesOverview(name="overview"))

        game = ChessGame()
        game.draw_board()
        # game.update_board(board)
        # game.setup_clocks(time=60, interval=.01)

        game_screen = GameScreen(name='game')
        game_screen.add_widget(game)

        self.manager.add_widget(game_screen)

        self.manager.current = 'login'

        Config.set('graphics', 'resizable', '1')
        Config.write()
        # Notifications...
        Clock.schedule_interval(self.check_background_games, 2)
        Clock.schedule_interval(MWT().collect, 1)

        return self.manager
Beispiel #2
0
	def build(self):
		Builder.load_file('screens/login.kv')
		Builder.load_file('screens/home.kv')
		Builder.load_file('screens/scenarios.kv')
		Builder.load_file('main.kv')
		
		self.body.add_widget(Login(LoginMenu, 'loginmenu', None, name = 'login'))
		self.body.add_widget(Home(HomeMenu, 'homemenu', None, name = 'home'))
		self.body.add_widget(Scenarios(ScenariosMenu, 'scenariosmenu', 'home', name = 'scenarios'))
		self.body.add_widget(NewScenario(NewScenarioMenu, 'newscenariomenu', 'scenarios', name = 'newscenario'))
		self.body.current = 'login'
		
		self.menu.height = '48dp'
		self.menu.size_hint_y = None
		self.use_kivy_settings = False
		self.settings_cls = SettingsWithSidebar
		
		screen =  AnchorLayout(anchor_x='right', anchor_y='top')
		screen.add_widget(self.body)
		screen.add_widget(self.menu)
		
# 		screen = BoxLayout(orientation='vertical')
# 		screen.add_widget(self.menu)
# 		screen.add_widget(self.body)
				
		return screen
Beispiel #3
0
    def query_2(self,*args):

        results = Qvap.get_best_distinct_settings_2(Login.get_connection(),self.atribute_list_fixed,self.atribute_list_unwished,None)

        New.set_current_results(results)
        #print(results)

        self.manager.transition.direction = 'left'
        self.manager.current = 'results'
Beispiel #4
0
	def test_valid_login(self):
		welcome = Welcome(self.driver)
		login = Login(self.driver)
		loggedinhome = LoggedInHome(self.driver)
		
		welcome.sign_in_button()
		welcome.click_sign_in_button()
		login.fill_login_form("*****@*****.**", "qa123123")
		login.click_submit()
		loggedinhome.logged_in_home()
Beispiel #5
0
    def test_map(self):
        welcome = Welcome(self.driver)
        login = Login(self.driver)
        loggedinhome = LoggedInHome(self.driver)
        homepage = Homepage(self.driver)

        welcome.sign_in_button()
        welcome.click_sign_in_button()

        login.fill_login_form("*****@*****.**", "qa123123")
        login.click_submit()

        loggedinhome.logged_in_home()

        homepage.get_map()
        homepage.map_marker()
    def test_my_rides_list_scroll(self):
        welcome = Welcome(self.driver)
        login = Login(self.driver)
        loggedinhome = LoggedInHome(self.driver)
        sidemenu = SideMenu(self.driver)
        myrides = MyRides(self.driver)

        welcome.sign_in_button()
        welcome.click_sign_in_button()

        login.fill_login_form("*****@*****.**", "qa123123")
        login.click_submit()

        loggedinhome.logged_in_home()

        sidemenu.click_top_menu_button()
        sidemenu.click_my_rides_button()

        myrides.my_rides_list()
        myrides.scroll_my_rides_list()
Beispiel #7
0
    def test_profile_image_upload(self):
        welcome = Welcome(self.driver)
        login = Login(self.driver)
        loggedinhome = LoggedInHome(self.driver)
        sidemenu = SideMenu(self.driver)
        profileImage = ProfileImage(self.driver)

        welcome.sign_in_button()
        welcome.click_sign_in_button()

        login.fill_login_form("*****@*****.**", "qa123123")
        login.click_submit()

        loggedinhome.logged_in_home()

        sidemenu.click_top_menu_button()
        sidemenu.click_profile_image()

        profileImage.click_profile_image()
        profileImage.gallery_button()
        profileImage.upload_file()
    def test_upcoming_rides_statuses(self):
        welcome = Welcome(self.driver)
        login = Login(self.driver)
        loggedinhome = LoggedInHome(self.driver)
        sidemenu = SideMenu(self.driver)
        myrides = MyRides(self.driver)

        welcome.sign_in_button()
        welcome.click_sign_in_button()

        login.fill_login_form("*****@*****.**", "qa123123")
        login.click_submit()

        loggedinhome.logged_in_home()

        sidemenu.click_top_menu_button()
        sidemenu.click_my_rides_button()

        myrides.my_rides_list()
        myrides.click_upcoming_tab()
        myrides.my_rides_list()
        assert myrides.ride_status_text == "Accepted"
Beispiel #9
0
class Controller:
    """ Контроллер отвечающий за переключениями между окнами """
    def __init__(self):
        self.register = Register()
        self.login = Login()
        self.main = Main()
        self.wish_form = WishForm()

    def show_login(self):
        self.register.close()
        self.main.close()

        self.login.show()

        self.login.switch_to_main.connect(self.show_main)
        self.login.switch_to_register.connect(self.show_register)

    def show_register(self):
        self.login.close()
        self.register.show()

        self.register.switch_to_login.connect(self.show_login)

    def show_main(self, user):
        self.login.close()
        self.wish_form.close()
        self.main.show()

        self.main.username_lbl.setText(f'User: {user}')
        self.main.username_lbl.adjustSize()

        self.main.set_table_data(user)
        self.main.switch_to_login.connect(self.show_login)
        self.main.switch_to_add.connect(self.show_wish_form)

    def show_wish_form(self, username):
        self.wish_form = WishForm(username)
        self.wish_form.show()
        self.wish_form.switch_to_main.connect(self.show_main)
Beispiel #10
0
 def exit():
     Login.close_connection()
     exit()
Beispiel #11
0
 def screen_switch_one(a, b):
     #check login previo
     if (Login.just_logged(Login.get_connection())):
         sm.current = 'recents'
     else:
         sm.current = 'login'
Beispiel #12
0
def logoff():
    Login.logoff()
    exit()
Beispiel #13
0
            text: "[color=222222][b][/b][/color]"
            height: 20
            background_color: 1, 1, 1, 1
            font_size: self.parent.width * 0.02 + 12
""")

# Declare both screens
# class MenuScreen(Screen):
#     pass

# class SettingsScreen(Screen):
#     pass

# Create the screen manager
sm = ScreenManager()
lg = Login()
# sm.add_widget(Splash())
sm.add_widget(lg)
sm.add_widget(Logup())
sm.add_widget(Recents())
sm.add_widget(New())
sm.add_widget(Results())
sm.add_widget(TargetAudience())
sm.add_widget(Profile.get_instance())


class TestApp(App):
    def build(self):
        #Clock.schedule_once(self.screen_switch_one, 3)

        self.icon = (Path("./images/") / f'LOGO.png').__str__()
Beispiel #14
0
 def logoff(self, msg=None):
     if Login.logoff(msg):
         self.manager.transition.direction = 'right'
         self.manager.current = 'login'
Beispiel #15
0
 def record(self,email,password,confirm_password,msg=None):
     if self.check_email_format(email,msg) and self.check_password_format(password,confirm_password,msg):
         if SqlUtils.record(Login.get_connection(),email.text,password.text,msg):
             Login.set_login(email.text)
             self.manager.transition.direction = 'left'
             self.manager.current = 'recents'
Beispiel #16
0
 def __init__(self):
     self.register = Register()
     self.login = Login()
     self.main = Main()
     self.wish_form = WishForm()