예제 #1
0
    def __init__(self, screen_manager, localization):
        
        self.sm = screen_manager
        self.l = localization

        description = (
                      self.l.get_str('The console will close any critical processes and shut down safely after 60 seconds, ready for power off.') + \
                      "\n\n" + \
                      self.l.get_str('This extends the lifetime of the console.') + '\n\n' + \
                      self.l.get_str('You will still need to power down your machine separately after the console has finished shutting down.')
                      )
        title_string = self.l.get_str('Shutting down') + '...'
        shutdown_string = self.l.get_bold('Shutdown now')
        cancel_string = self.l.get_bold('Cancel')

        def cancel_shutdown(*args):
          os.system('sudo shutdown -c')

        def shutdown_now(*args):
          os.system('sudo shutdown -h now')
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1.5, text_size=(480, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[0,0], markup = True)

        ok_button = Button(text=shutdown_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        cancel_button = Button(text=cancel_string, markup = True)
        cancel_button.background_normal = ''
        cancel_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,10,0,0])
        btn_layout.add_widget(cancel_button)
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[20,10,20,10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      # size=(300, 300),
                      size=(540, 400),
                      auto_dismiss= False
                      )

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=shutdown_now)
        cancel_button.bind(on_press=cancel_shutdown)
        cancel_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #2
0
    def popup_webscrape(self, value):
        # Box layouts for positioning
        info_box = BoxLayout(orientation='vertical', size_hint=(1, 1))
        username_box = BoxLayout(orientation='vertical', size_hint=(.5, 1))
        password_box = BoxLayout(orientation='vertical', size_hint=(.5, 1))

        # Widgets which contain information about username and password
        self.username_input = TextInput(size_hint=(.5, None), height=50)
        self.password_input = TextInput(size_hint=(.5, None), height=50)
        login_button = MyButton(text='Login', size_hint=(.5, 1), on_press=self.webscrape)

        username_box.add_widget(MyLabel(text='Enter your username:'******'Enter your password:'******'Login', title_size='24sp', title_color=(0, 0, 0, 1), size_hint=(.8, .8), content=info_box)
        popup.background = IMAGE_DIR + '/popup_background_logo.jpg'
        popup.open()
예제 #3
0
    def author(self):
        box = BoxLayout(orientation="vertical")
        box.add_widget(
            Image(
                source='images/author.jpg',
                allow_stretch=False,
                keep_ratio=False,
            ))
        data = "Author :[color=ffff00]Ahmed Mohmed[/color]\nVersion :[color=ffff00]1.0[/color]"
        lb2 = Label(text=data, markup=True, font_size=30)
        lb2.font_name = "fonts/DancingScript-Bold.ttf"
        box.add_widget(lb2)
        content3 = box
        title = "About Tic Tac Toc"

        popup = Popup(title="About Tic Tac Toc",
                      content=content3,
                      size_hint=(None, None),
                      size=(400, 400))
        # popup.background_color=[0,1,1,1]
        popup.background = "images/au.jpg"
        popup.title_size = 30
        popup.title_color = [1, 1, 0, 1]
        popup.title_font = "fonts/actionis.ttf"
        popup.open()
예제 #4
0
    def __init__(self, machine, screen_manager, localization):
        
      self.m = machine
      self.m.soft_stop()

      self.sm = screen_manager
      self.l = localization
        
      def machine_reset(*args):
          self.m.stop_from_soft_stop_cancel()

      def machine_resume(*args):
          self.m.resume_from_a_soft_door()
        
      stop_description = self.l.get_str("Is everything OK? You can resume the job, or cancel it completely.")
      resume_string = self.l.get_bold("Resume")
      cancel_string = self.l.get_bold("Cancel")
      title_string = self.l.get_str("Warning!")
      
      img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
      label = Label(size_hint_y=2, text_size=(360, None), halign='center', valign='middle', text=stop_description, color=[0,0,0,1], padding=[0,0], markup = True)
      
      resume_button = Button(text=resume_string, markup = True)
      resume_button.background_normal = ''
      resume_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
      cancel_button = Button(text=cancel_string, markup = True)
      cancel_button.background_normal = ''
      cancel_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

     
      btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[0,5,0,0], size_hint_y=2) 
      btn_layout.add_widget(cancel_button)
      btn_layout.add_widget(resume_button)
      
      layout_plan = BoxLayout(orientation='vertical', spacing=5, padding=[30,20,30,0])
      layout_plan.add_widget(img)
      layout_plan.add_widget(label)
      layout_plan.add_widget(btn_layout)
      
      popup = Popup(title=title_string,
                    title_color=[0, 0, 0, 1],
                    title_font= 'Roboto-Bold',
                    title_size = '20sp',
                    content=layout_plan,
                    size_hint=(None, None),
                    size=(400, 300),
                    auto_dismiss= False
                    )
      
      popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
      popup.separator_height = '4dp'
      popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
      
      cancel_button.bind(on_press=machine_reset)
      cancel_button.bind(on_press=popup.dismiss)
      resume_button.bind(on_press=machine_resume)
      resume_button.bind(on_press=popup.dismiss)
      
      popup.open()
예제 #5
0
    def __init__(self, screen_manager, machine, localization, description):
        
        self.sm = screen_manager
        self.m = machine
        self.l = localization

        title_string = self.l.get_str('Welcome to SmartBench')
        ok_string = self.l.get_bold('Ok')
        remind_string = self.l.get_bold('Remind me later')
        
        def set_trigger_to_false(*args):
          self.m.write_set_up_options(False)
          self.sm.get_screen('lobby').carousel.load_next(mode='next')

        def set_trigger_to_true(*args):
          self.m.write_set_up_options(True)

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label = Label(size_hint_y=2, text_size=(420, None), markup=True, halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[0,0])
        
        ok_button = Button(text=ok_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        remind_me_button = Button(text=remind_string, markup = True)
        remind_me_button.background_normal = ''
        remind_me_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[20,10,20,0])
        btn_layout.add_widget(remind_me_button)       
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[10,10,10,10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
#                       title_color=[0.141, 0.596, 0.957, 1],
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 440),
                      auto_dismiss= False
                      )

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=set_trigger_to_false)
        remind_me_button.bind(on_press=popup.dismiss)
        remind_me_button.bind(on_press=set_trigger_to_true)

        popup.open()
예제 #6
0
    def __init__(self, screen_manager, machine, localization, warning_message):
        
      self.sm = screen_manager
      self.m = machine
      self.l = localization
      
      description = warning_message
      title_string = self.l.get_str('Warning!')
      yes_string = self.l.get_bold('Yes')
      no_string = self.l.get_bold('No')


      def set_park(*args):
        self.m.set_standby_to_pos()
        self.m.get_grbl_status()

      img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
      label = Label(size_hint_y=1, text_size=(360, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[40,20], markup = True)
      

      ok_button = Button(text=yes_string, markup = True)
      ok_button.background_normal = ''
      ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
      back_button = Button(text=no_string, markup = True)
      back_button.background_normal = ''
      back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

     
      btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
      btn_layout.add_widget(back_button)
      btn_layout.add_widget(ok_button)


      layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[40,20,40,20])
      layout_plan.add_widget(img)
      layout_plan.add_widget(label)
      layout_plan.add_widget(btn_layout)
      
      popup = Popup(title=title_string,
                    title_color=[0, 0, 0, 1],
                    title_font= 'Roboto-Bold',
                    title_size = '20sp',
                    content=layout_plan,
                    size_hint=(None, None),
                    size=(300, 350),
                    auto_dismiss= False
                    )
      
      popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
      popup.separator_height = '4dp'
      popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

      ok_button.bind(on_press=popup.dismiss)
      ok_button.bind(on_press=set_park)
      back_button.bind(on_press=popup.dismiss)

      popup.open()
예제 #7
0
    def __init__(self, screen_manager, localization, settings_manager, warning_message):
        
        self.sm = screen_manager
        self.set = settings_manager
        self.l = localization

        title_string = self.l.get_str('There was a problem updating the software') + '...'
        repair_string = self.l.get_bold('Repair')
        back_string = self.l.get_bold('Go Back')
        
        description = warning_message

        def repair(*args):

            self.sm.get_screen('update').repair_sw_over_wifi()
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1.4, text_size=(560, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[20,20], markup = True)
        
        ok_button = Button(text=repair_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=back_string, markup = True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

       
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[10,20,10,20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(600, 420),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=repair)
        back_button.bind(on_press=popup.dismiss)       

        popup.open()
예제 #8
0
    def __init__(self, screen_manager, localization, description):

        self.sm = screen_manager
        self.l = localization
        popup_width = 600

        title_string = self.l.get_str('Information')
        ok_string = self.l.get_bold('Ok')

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        info_label = RstDocument(text=description,
                                 background_color=[1, 1, 1, 1],
                                 base_font_size=26,
                                 underline_color='000000')

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[10, 20, 10, 0],
                               size_hint_y=0.6)
        btn_layout.add_widget(ok_button)

        scroll_layout = ScrollView(do_scroll_x=True,
                                   do_scroll_y=True,
                                   scroll_type=['content'],
                                   always_overscroll=True,
                                   size_hint_y=1.2)
        scroll_layout.add_widget(info_label)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=0,
                                padding=[10, 10, 10, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(scroll_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(popup_width, 440),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #9
0
    def __init__(self, screen_manager):

        self.shapecutter_sm = screen_manager

        description = "If this is your first time using the app, please go to the tutorial.\n\n" \
                            "If you need help or support, please visit customer support at www.yetitool.com/support"

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_bigger.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(360, None),
                      halign='left',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[20, 20])
        tutorial_button = Button(text='[b]Tutorial[/b]', markup=True)
        tutorial_button.background_normal = ''
        tutorial_button.background_color = [0.141, 0.596, 0.957, 1]

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[50, 20, 50, 0])
        btn_layout.add_widget(tutorial_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[50, 20, 50, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Information',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(400, 380),
                      auto_dismiss=False)

        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        tutorial_button.bind(on_press=self.go_tutorial)
        tutorial_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #10
0
    def __init__(self, screen_manager, localization, message):
        
        self.sm = screen_manager
        self.l = localization
        
        description = self.l.get_str("Software update was successful.") + \
                    "\n\n" + \
                    self.l.get_str("Update message") + ": " + \
                    message + \
                    "\n" + \
                    self.l.get_str("Please do not restart your machine until you are prompted to do so.")

        title_string = self.l.get_str('Update Successful!')
        ok_string = self.l.get_bold('Ok')

        def reboot(*args):
            self.sm.current = 'rebooting'
                    
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1.2, text_size=(660, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[40,10], markup = True)
   
        ok_button = Button(text=ok_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
      
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[40,20,40,20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(700, 400),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        # ok_button.bind(on_press=reboot)
        
        popup.open()
        
        Clock.schedule_once(reboot, 6)
예제 #11
0
    def __init__(self, screen_manager, machine, localization, return_to_screen, cancel_to_screen):

      self.sm = screen_manager
      self.m = machine
      self.l = localization
        
      def home_now(*args):
          self.m.request_homing_procedure(return_to_screen, cancel_to_screen)
        
      stop_description = self.l.get_str("You need to home SmartBench first!")
      title_string = self.l.get_str("Warning!")
      home_string = self.l.get_bold("Home")
      cancel_string = self.l.get_bold("Cancel")
      
      img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
      label = Label(size_hint_y=2, text_size=(360, None), halign='center', valign='middle', text=stop_description, color=[0,0,0,1], padding=[0,0], markup = True)
      
      home_button = Button(text=home_string, markup = True)
      home_button.background_normal = ''
      home_button.background_color = [33 / 255., 150 / 255., 243 / 255., 98 / 100.]

      cancel_button = Button(text=cancel_string, markup = True)
      cancel_button.background_normal = ''
      cancel_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

      btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[0,5,0,0], size_hint_y=2) 
      btn_layout.add_widget(cancel_button)
      btn_layout.add_widget(home_button)
      
      layout_plan = BoxLayout(orientation='vertical', spacing=5, padding=[30,20,30,0])
      layout_plan.add_widget(img)
      layout_plan.add_widget(label)
      layout_plan.add_widget(btn_layout)
      
      popup = Popup(title=title_string,
                    title_color=[0, 0, 0, 1],
                    title_font= 'Roboto-Bold',
                    title_size = '20sp',
                    content=layout_plan,
                    size_hint=(None, None),
                    size=(400, 300),
                    auto_dismiss= False
                    )
      
      popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
      popup.separator_height = '4dp'
      popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

      home_button.bind(on_press=home_now)
      home_button.bind(on_press=popup.dismiss)
      cancel_button.bind(on_press=popup.dismiss)
      
      popup.open()
예제 #12
0
    def __init__(self, screen_manager, localization):

      self.sm = screen_manager
      self.l = localization
        
      def confirm_cancel(*args):
          self.sm.get_screen('stop_or_resume_job_decision').confirm_job_cancel()
        
      stop_description = self.l.get_str("Are you sure you want to cancel the job?")
      title_string = self.l.get_str("Warning!")
      yes_string = self.l.get_bold("Yes")
      no_string = self.l.get_bold("No")
      
      img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
      label = Label(size_hint_y=2, text_size=(360, None), halign='center', valign='middle', text=stop_description, color=[0,0,0,1], padding=[0,0], markup = True)
      
      resume_button = Button(text=no_string, markup = True)
      resume_button.background_normal = ''
      resume_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
      cancel_button = Button(text=yes_string, markup = True)
      cancel_button.background_normal = ''
      cancel_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

     
      btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[0,5,0,0], size_hint_y=2) 
      btn_layout.add_widget(cancel_button)
      btn_layout.add_widget(resume_button)
      
      layout_plan = BoxLayout(orientation='vertical', spacing=5, padding=[30,20,30,0])
      layout_plan.add_widget(img)
      layout_plan.add_widget(label)
      layout_plan.add_widget(btn_layout)
      
      popup = Popup(title=title_string,
                    title_color=[0, 0, 0, 1],
                    title_font= 'Roboto-Bold',
                    title_size = '20sp',
                    content=layout_plan,
                    size_hint=(None, None),
                    size=(400, 300),
                    auto_dismiss= False
                    )
      
      popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
      popup.separator_height = '4dp'
      popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
      
      cancel_button.bind(on_press=confirm_cancel)
      cancel_button.bind(on_press=popup.dismiss)
      resume_button.bind(on_press=popup.dismiss)
      
      popup.open()
예제 #13
0
    def __init__(self, screen_manager):

        self.sm = screen_manager

        description = self.sm.l.get_str("Machine is not Idle.") + "\n\n" \
                    + self.sm.l.get_str("Please check that SmartBench is clear, and then use the Pro app to RESET SmartBench before using Shape Cutter.")

        title_string = self.sm.l.get_str('Warning!')
        ok_string = self.sm.l.get_bold('Ok')

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(360, None),
                      halign='left',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[20, 20])

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[50, 25, 50, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[50, 20, 50, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(400, 380),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #14
0
    def __init__(self, screen_manager, localization, usb):
        
        self.sm = screen_manager
        self.l = localization
        
        title_string = self.l.get_str('Error!')
        ok_string = self.l.get_bold('Ok')

        description = (
          self.l.get_str("Problem mounting USB stick. Please remove your USB stick, and check that it is working properly.") + \
          "\n\n" + \
          self.l.get_str("If this error persists, you may need to reformat your USB stick.")
        )


        def restart_polling(*args):
          usb.start_polling_for_usb()
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1, text_size=(360, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[0,10], markup = True)
        
        ok_button = Button(text=ok_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]
       
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[40,20,40,20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 400),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=restart_polling)  

        popup.open()
예제 #15
0
    def __init__(self, screen_manager, report_string):

        self.sm = screen_manager

        # img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label1 = Label(size_hint_y=1,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='middle',
                       text=report_string,
                       color=[0, 0, 0, 1],
                       padding=[10, 10])

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        text_layout = BoxLayout(orientation='horizontal', spacing=0, padding=0)
        text_layout.add_widget(label1)

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[150, 10, 150, 0],
                               size_hint_y=0.3)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 10, 10, 10])
        # layout_plan.add_widget(img)
        layout_plan.add_widget(text_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Output',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(700, 400),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #16
0
    def __init__(self, screen_manager):
        
        self.systemtools_sm = screen_manager
        
        description = "You should only quit to the console if you have been instructed to do so by YetiTool support.\n\n" + \
        "This will take you to the YetiTool splash screen, and exit the software.\n\n" + \
        "Would you like to quit to console now?"

        def quit_console(*args):
            sys.exit()
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=2, text_size=(360, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[20,0], markup = True)
        
        ok_button = Button(text='[b]Yes[/b]', markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text='[b]No[/b]', markup = True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

       
        btn_layout = BoxLayout(orientation='horizontal', spacing=15, padding=[0,5,0,0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[30,20,30,0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title='Warning!',
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(360, 360),
                      auto_dismiss= False
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=quit_console)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #17
0
    def __init__(self, screen_manager):

        self.shapecutter_sm = screen_manager

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[150, 0, 150, 0],
                               size_hint_y=0.2)
        btn_layout.add_widget(ok_button)

        rst_doc = RstDocument(
            source='./asmcnc/apps/shapeCutter_app/feeds_and_speeds_table.rst',
            background_color=[1, 1, 1, 1],
            base_font_size=26,
            underline_color='000000')

        rst_layout = ScrollView(do_scroll_x=True,
                                do_scroll_y=True,
                                scroll_type=['content'],
                                size_hint_y=0.8)
        rst_layout.add_widget(rst_doc)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 10, 10, 10])
        layout_plan.add_widget(rst_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(
            title='Information',
            #                       title_color=[0.141, 0.596, 0.957, 1],
            title_color=[0, 0, 0, 1],
            title_font='Roboto-Bold',
            title_size='20sp',
            content=layout_plan,
            size_hint=(None, None),
            size=(700, 400),
            auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)
        popup.open()
예제 #18
0
    def __init__(self, app_manager):
        
        self.am = app_manager
        
        description = "You should only access the factory settings if you have been instructed to do so by YetiTool support.\n\n" + \
        "Please enter the password to proceed." 

        def check_password(*args):
          if textinput.text == "Work Smart":
            self.am.systemtools_sm.open_system_tools()
            self.am.systemtools_sm.open_factory_settings_screen()
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1.2, text_size=(450, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[0,0], markup = True)
        textinput = TextInput(size_hint_y=1, text = '')

        ok_button = Button(text='[b]Ok[/b]', markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]
       
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[10,0,10,0])
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=5, padding=[40,10,40,10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(textinput)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title='Warning!',
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 320),
                      auto_dismiss= False,
                      pos_hint={'x': 150.0 / 800.0, 
                                'y':160.0 /  480.0},
                      )
        
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        
        ok_button.bind(on_press=check_password)
        ok_button.bind(on_press=popup.dismiss)    

        popup.open()
예제 #19
0
    def __init__(self, screen_manager, message):

        self.sm = screen_manager

        description = "Please wait" + message

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(360, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[40, 20],
                      markup=True)

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[0, 0, 0, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[40, 20, 40, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Please Wait...',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(500, 400),
                      auto_dismiss=False)

        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        Clock.schedule_once(lambda dt: popup.dismiss(), 2.5)
        popup.open()
예제 #20
0
    def __init__(self, screen_manager, error_message):

        self.shapecutter_sm = screen_manager

        description = error_message

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(360, None),
                      halign='left',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[20, 20])

        ok_button = Button(text='[b]Ok[/b]', markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[50, 25, 50, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[50, 20, 50, 20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title='Warning!',
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(400, 380),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #21
0
    def __init__(self, screen_manager, outcome, message):

        self.sm = screen_manager
        label1 = Label(size_hint_y=0.92,
                       text_size=(None, None),
                       markup=True,
                       halign='left',
                       valign='top',
                       text=message,
                       font_size='11sp',
                       color=[0, 0, 0, 1])

        back_button = Button(text='[b]Ok[/b]', markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        text_layout = BoxLayout(orientation='horizontal', spacing=0, padding=0)
        text_layout.add_widget(label1)

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=20,
                               padding=[100, 0, 100, 0],
                               size_hint_y=0.2)
        btn_layout.add_widget(back_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=0,
                                padding=[10, 0, 10, 0])
        # layout_plan.add_widget(img)
        layout_plan.add_widget(text_layout)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=outcome,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(780, 480),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        back_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #22
0
    def begin(self, value):
        self.results_box.clear_widgets()

        # Creating popup and results content
        popup = Popup(title='Results', title_size='24sp', title_color=(0, 0, 0, 1), size_hint=(.8, .8))
        results_box = StackLayout(size_hint=(1, 1), padding=[10, 10])
        popup.background = IMAGE_DIR + '/popup_background_logo.jpg'
        popup.add_widget(results_box)

        self.best_classes = []

        # Using multi-threading to make UI responsive while loading
        # Thread will end upon finish, and will update best classes and the results box
        class_picker_thread = threading.Thread(target=self.pick_classes, args=(self, results_box, popup))
        class_picker_thread.start()
        popup.open()
예제 #23
0
파일: main.py 프로젝트: mwlt/MDScheduler
	def OrderStatus(self, btn, disable, *args):
		def SelectAll(checkbox, value):
			for b in statuspanel.children:
				if type(b).__name__=='BoxLayout':
					b.children[0].state = value

		def ApplyChange(btn):
			for b in statuspanel.children:
				if type(b).__name__=='BoxLayout':
					check = b.children[0]
					proc = b.children[1].text.lower()
					if proc=='':
						continue
					if check.state=='down':
						o.ES[proc] = 0.0
						o.EE[proc] = 0.0
						o.CopytoSuborders(proc)
					else:
						o.ES[proc] = -1.0
						o.EE[proc] = -1.0
						o.CopytoSuborders(proc)
			self.UpdateResult(self.orders)
			statuspopup.dismiss()

		jo = btn.parent.parent.children[-1].text
		o = [o for o in self.orders if o.jo==jo][0]
		statuspanel = BoxLayout(orientation='vertical')
		b = BoxLayout()
		b.add_widget(Label(text=''))
		selectall = MDCheckbox(state='down' if not [proc for proc in machines if o.EE[proc]<0] else 'normal', disabled=disable)
		selectall.bind(state=SelectAll)
		b.add_widget(selectall)
		statuspanel.add_widget(b)
		for key in machines:
			b = BoxLayout()
			b.add_widget(Label(text=key.upper()))
			b.add_widget(MDCheckbox(state='down' if o.EE[key]>=0 else 'normal', disabled=disable))
			statuspanel.add_widget(b)
		statuspopup = Popup(title='JO#'+jo+' Status',
							title_size=sp(20),
							content=statuspanel,
							size_hint=(.3,.8))
		if not disable:
			statuspanel.add_widget(MDRaisedButton(text='Apply', on_release=ApplyChange, size_hint=(1,1)))
			statuspopup.background = 'atlas://data/images/defaulttheme/button'
		statuspopup.open()
예제 #24
0
    def control(self):
        box = BoxLayout(orientation="vertical")
        box.add_widget(
            Image(
                source='images/gamepad.jpg',
                allow_stretch=False,
                keep_ratio=False,
            ))
        content3 = box

        popup = Popup(title="Controlling",
                      content=content3,
                      size_hint=(None, None),
                      size=(500, 500))
        # popup.background_color=[0,1,1,1]
        popup.background = "images/au.jpg"
        popup.title_size = 30
        popup.title_color = [1, 1, 0, 1]
        popup.title_font = "fonts/actionis.ttf"
        popup.open()
예제 #25
0
    def __init__(self, screen_manager, localization, description):
        
        self.sm = screen_manager
        self.l = localization
        
        img = Image(source="./asmcnc/apps/shapeCutter_app/img/info_icon.png", allow_stretch=False)
        label = Label(size_hint_y=1, text_size=(360, None), halign='center', valign='middle', text=description, color=[0,0,0,1], padding=[40,20], markup = True)
        
        title_string = self.l.get_str('Information')
        ok_string = self.l.get_bold('Ok')

        ok_button = Button(text=ok_string, markup = True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]

        
        btn_layout = BoxLayout(orientation='horizontal', spacing=10, padding=[0,0,0,0])
        btn_layout.add_widget(ok_button)
        
        layout_plan = BoxLayout(orientation='vertical', spacing=10, padding=[40,20,40,20])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)
        
        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font= 'Roboto-Bold',
                      title_size = '20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(300, 300),
                      auto_dismiss= False
                      )

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [249 / 255., 206 / 255., 29 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #26
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = self.l.get_str(
            "Would you like to reboot the console now?")
        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Yes')
        back_string = self.l.get_bold('No')

        def reboot_console(*args):
            self.systemtools_sm.sm.current = 'rebooting'

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(360, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=back_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 5, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(360, 360),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=reboot_console)
        back_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #27
0
    def __init__(self, screen_manager, localization, description, more_info):

        self.sm = screen_manager
        self.l = localization
        popup_width = 500
        label_width = popup_width - 40

        def open_more_info(*args):
            PopupFSCKInfo(self.sm, self.l, more_info)

        title_string = self.l.get_str('Error!')
        ok_string = self.l.get_bold('Ok')
        more_info_string = self.l.get_bold('More info')

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(label_width, None),
                      markup=True,
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[10, 10])

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        more_info_button = Button(text=more_info_string, markup=True)
        more_info_button.background_normal = ''
        more_info_button.background_color = [
            33 / 255., 150 / 255., 243 / 255., 98 / 100.
        ]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[10, 20, 10, 0])
        btn_layout.add_widget(more_info_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[10, 10, 10, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(popup_width, 440),
                      auto_dismiss=False)

        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'
        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'

        ok_button.bind(on_press=popup.dismiss)
        more_info_button.bind(on_press=open_more_info)
        more_info_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #28
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = (
            self.l.get_str("The developer app is to help our engineers access extra settings and " + \
                "functions that might not be stable, or change how SmartBench behaves.") + \
            " " + \
            self.l.get_str("By using the developer app, you may risk causing damage to SmartBench.") + \
            "\n" + \
            self.l.get_str("Please enter the password if you want to continue.")
            )

        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Ok')

        def check_password(*args):
            if textinput.text == "dev":
                self.systemtools_sm.open_developer_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=1,
                      text_size=(550, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)
        textinput = TextInput(size_hint_y=0.7, text='')

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[20, 0, 20, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[40, 10, 40, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(textinput)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(600, 400),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=check_password)
        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #29
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = self.l.get_str(
            "Please enter the password to use the factory settings.")
        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Ok')

        def check_password(*args):
            if textinput.text == "fac":
                self.systemtools_sm.open_factory_settings_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=0.7,
                      text_size=(450, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)
        textinput = TextInput(size_hint_y=1, text='')

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=10,
                               padding=[10, 0, 10, 0])
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=5,
                                padding=[40, 10, 40, 10])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(textinput)
        layout_plan.add_widget(btn_layout)

        popup = Popup(
            title=title_string,
            title_color=[0, 0, 0, 1],
            title_font='Roboto-Bold',
            title_size='20sp',
            content=layout_plan,
            size_hint=(None, None),
            size=(500, 260),
            auto_dismiss=False,
            pos_hint={
                'x': 150.0 / 800.0,
                'y': 200.0 / 480.0
            },
        )

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=check_password)
        ok_button.bind(on_press=popup.dismiss)

        popup.open()
예제 #30
0
    def __init__(self, screen_manager, localization):

        self.systemtools_sm = screen_manager
        self.l = localization

        description = (
            self.l.get_str(
                "Beta testing allows our engineers and beta testers to try out software updates " + \
                "that might not be stable, or change how SmartBench behaves."
                ) + \
            "\n\n" + \
            self.l.get_str("By updating to a beta version or developer branch you may risk causing damage to SmartBench.") + \
            "\n\n" + \
            self.l.get_str("Do you want to continue?")
        )

        title_string = self.l.get_str('Warning!')
        ok_string = self.l.get_bold('Yes')
        back_string = self.l.get_bold('No')

        def dev_app(*args):
            self.systemtools_sm.open_beta_testing_screen()

        img = Image(source="./asmcnc/apps/shapeCutter_app/img/error_icon.png",
                    allow_stretch=False)
        label = Label(size_hint_y=2,
                      text_size=(410, None),
                      halign='center',
                      valign='middle',
                      text=description,
                      color=[0, 0, 0, 1],
                      padding=[0, 0],
                      markup=True)

        ok_button = Button(text=ok_string, markup=True)
        ok_button.background_normal = ''
        ok_button.background_color = [76 / 255., 175 / 255., 80 / 255., 1.]
        back_button = Button(text=back_string, markup=True)
        back_button.background_normal = ''
        back_button.background_color = [230 / 255., 74 / 255., 25 / 255., 1.]

        btn_layout = BoxLayout(orientation='horizontal',
                               spacing=15,
                               padding=[0, 10, 0, 0])
        btn_layout.add_widget(back_button)
        btn_layout.add_widget(ok_button)

        layout_plan = BoxLayout(orientation='vertical',
                                spacing=10,
                                padding=[30, 20, 30, 0])
        layout_plan.add_widget(img)
        layout_plan.add_widget(label)
        layout_plan.add_widget(btn_layout)

        popup = Popup(title=title_string,
                      title_color=[0, 0, 0, 1],
                      title_font='Roboto-Bold',
                      title_size='20sp',
                      content=layout_plan,
                      size_hint=(None, None),
                      size=(550, 400),
                      auto_dismiss=False)

        popup.separator_color = [230 / 255., 74 / 255., 25 / 255., 1.]
        popup.separator_height = '4dp'
        popup.background = './asmcnc/apps/shapeCutter_app/img/popup_background.png'

        ok_button.bind(on_press=popup.dismiss)
        ok_button.bind(on_press=dev_app)
        back_button.bind(on_press=popup.dismiss)

        popup.open()