Пример #1
0
def install_tesseract_dialog():
    def close_dialog(instance, *args):
        instance.parent.parent.parent.parent.dismiss()

    layout = MDBoxLayout(orientation="horizontal", adaptive_height=True)
    layout.add_widget(
        OneLineListItem(
            text=
            "Tesseract wasn't found on the system. You can install it now or set"
            "the right path in the settings-menu. (Restart required)"))
    dialog = MDDialog(
        title="Installing tesseract?",
        type='custom',
        auto_dismiss=False,
        content_cls=layout,
        buttons=[
            MDFlatButton(text="INSTALL",
                         on_release=partial(install_tesseract)),
            MDFlatButton(text="DISCARD", on_release=close_dialog),
        ],
    )
    dialog.content_cls.focused = True
    dialog.open()
Пример #2
0
    def congratulate(self):
        if self.time_elapsed < self.best_record:
            self.best_record = self.time_elapsed

        text = f'Total time used: {self.format_time()}, ' \
               f'total clicks: {self.flips}, ' \
               f'best record: {self.best_record}.'

        button_style = dict(font_name='Lato',
                            font_size="16sp",
                            text_color=(0, 153 / 255, 1, 1))

        button = MDFlatButton(text="OK", **button_style)
        button.bind(on_release=self.close_dialog)

        # create a new dialog with new statistics each time
        self.popup2 = MDDialog(title="Congratulations, You Won!",
                               text=text,
                               radius=[20, 20, 20, 20],
                               size_hint=(0.7, None),
                               auto_dismiss=False,
                               buttons=[button])
        self.popup2.open()
Пример #3
0
 def abrir_popup_maps(self):    
     if not self.popup_maps:
         self.popup_maps = MDDialog( size_hint = [0.8,0.8],
             text="Deseja ir para rotas no Maps?",
             buttons=[
                 MDRaisedButton(
                     text="Sim", text_color=MDApp.get_running_app().theme_cls.text_color, on_release = self.abrir_maps
                 ),
                 MDFlatButton(
                     text="Não", text_color=MDApp.get_running_app().theme_cls.primary_color, on_release = self.fechar_popup_maps
                 )
             ],
         )
     self.popup_maps.open()
Пример #4
0
    def click_sing_in_btn(self):
        global login
        global fullName

        close_dialog_btn = MDFlatButton(text="Close",
                                        on_release=self.close_dialog_func)
        if self.login.text == "" or self.password.text == "":
            if self.login.text == "":
                check_string = "Please entre your login..!!"
            else:
                check_string = "Please entre your password..!!"
            self.dialog = MDDialog(title="Incompleted Infos:",
                                   text=check_string,
                                   size_hint=(0.7, 1),
                                   buttons=[close_dialog_btn])
            self.dialog.open()
        else:
            url = 'http://we-hack-things.com/login_user.php'
            passwd_sha256 = sha256(
                self.password.text.encode("ascii")).hexdigest()
            params = {'login': self.login.text, 'p_hash': passwd_sha256}
            login = self.login.text
            try:
                response = post(url, params=params, timeout=5)
                data = response.json()
                if data['code'] == 200:
                    with open('api_key.txt', 'w') as file:
                        file.write(data['full_name'].upper() + '\n')
                        file.write(self.login.text + '\n')
                        file.write(data['api_key'])
                    self.manager.current = "slots"
                elif data['code'] == 404:
                    self.dialog = MDDialog(title="Login Erreur:",
                                           text=data['err'],
                                           size_hint=(0.7, 1),
                                           buttons=[close_dialog_btn])
                    self.dialog.open()
            except ReadTimeout:
                self.dialog = MDDialog(
                    title="Server Erreur:",
                    text="Server May Be Down Please\nTry agin later..!!",
                    size_hint=(0.7, 1),
                    buttons=[close_dialog_btn])
                self.dialog.open()
            except:
                self.dialog = MDDialog(title="Erreur id 1024:",
                                       text="Please Try Again..!!",
                                       size_hint=(0.7, 1),
                                       buttons=[close_dialog_btn])
                self.dialog.open()
Пример #5
0
    def get_data_sms(self, obj):

        if self.sms.text is "":
            check_string = "Please enter the message"
        else:
            check_string = message_rating(self.sms.text)

        close_btn = MDFlatButton(text='Close', on_release=self.close_dialog)

        self.dialog = MDDialog(title='Verification',
                               text=check_string,
                               size_hint=(0.7, 1),
                               buttons=[close_btn])
        self.dialog.open()
Пример #6
0
def show_alert_dialog(self,x,inst_refer_to):
    #dialog = None
   
    dialog = MDDialog(
        
        title="Edit:",
        type="custom",# custom type equal to 
        content_cls=dContent(),
        buttons=[
            MDFlatButton(
                text="APPLY"
                ,on_press = lambda qq: [dialog.dismiss(),Intphone().editMe(str(inst_refer_to),dialog.content_cls.ids.item.text)]
            ),
            MDFlatButton(
                text="DISCARD"
                ,on_press = lambda qq: [dialog.dismiss(),Intphone().removeMe(str(inst_refer_to))]
            ),
        ],
    )
    for x in items:
        if inst_refer_to == x.id:
            dialog.content_cls.ids.item.text = x._description1.text
    dialog.open()
 def show_send_coin_dialog(self):
     if not self.send_coin_dialog:
         self.send_coin_dialog = MDDialog(
             title="Send Coin",
             type="custom",
             auto_dismiss=False,
             content_cls=Send_Coin_Box(),
             buttons=[
                 MDFlatButton(
                     text="CANCEL",
                     on_press=self.dismiss_send_coin_dialog,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
                 MDFlatButton(
                     text="OK",
                     on_press=self.sent_the_coins,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
             ],
         )
     self.send_coin_dialog.open()
Пример #8
0
 def show_alert_dialog(self):
     if not self.dialog:
         self.dialog = MDDialog(
             text="Do you real want to quit?",
             buttons=[
                 MDFlatButton(
                     text="CANCEL", text_color=self.theme_cls.primary_color, on_release=self.kill
                 ),
                 MDRaisedButton(
                     text="QUIT!", text_color=self.theme_cls.primary_color, on_release=quit
                 ),
             ],
         )
     self.dialog.open()
Пример #9
0
 def add_note_dialog(self):
     if not self.dialog:
         self.dialog = MDDialog(
             title=self.text,
             type='custom',
             content_cls=Content(),
             buttons=[
                 MDFlatButton(
                     text='CANCEL', 
                     text_color=self.theme_cls.primary_color, 
                     on_release=self.my_callback
                 ),
                 MDFlatButton(
                     text='ADD', 
                     text_color=self.theme_cls.primary_color, 
                     on_release=self.my_callback
                 )
             ],
             size_hint=[.8, 1], 
             auto_dismiss=False
         )
         self.dialog.set_normal_height()
         self.dialog.open()
    def connection_check(self):
        conn = hype.HTTPConnection("www.google.com", timeout=5)
        try:
            conn.request("HEAD", "/")
            conn.close()

        except Exception as e:
            button = MDFlatButton(text='DISMISS', on_release=self.close_)
            self.dialog = MDDialog(text='there is no internet connection',
                                   size_hint=(0.7, 1),
                                   buttons=[button])
            self.dialog.open()
            print(f'there is no internet connection: {e}')
            conn.close()
Пример #11
0
 def congratulate(self):
     if not self.popup:
         self.popup = MDDialog(
             title="Congratulations!",
             text="You have won the 2048, nice work!",
             radius=[20, 20, 20, 20],
             size_hint=(0.7, None),
             buttons=[
                 MDFlatButton(
                     text="OK", text_color=(0, 153/255, 1, 1)
                 )
             ]
         )
     self.popup.open()
Пример #12
0
 def show_dialog(self, *args):
     """
     opens a MDDialog popup for changing name of avatar
     """
     self.dialog = None
     if not self.dialog:
         self.dialog = MDDialog(
             title='Change Name',
             type="custom",
             content_cls=ChangeTextDialog(),
             buttons=[
                 MDFlatButton(text="CANCEL",
                              on_release=lambda *args: self.close_dialog(
                                  instance=self)),
                 MDFlatButton(text="SAVE",
                              on_release=lambda *args: self.
                              change_name(instance=self,
                                          value=self.dialog.content_cls.ids.
                                          change_name_text_field.text)),
             ],
         )
     # self.dialog.set_normal_height()
     self.dialog.open()
Пример #13
0
 def show_alert_dialog_password(self):
         self.dialog = MDDialog(
             title="Change Password?",
             type="custom",
             content_cls= MDTextField(helper_text_mode="on_error"),
             buttons=[
                 MDFlatButton(
                     text="save", text_color=self.theme_cls.primary_color,on_press=self.outpassword
                 ),
                 MDFlatButton(
                     text="close", text_color=self.theme_cls.primary_color,on_press=self.dialog_close
                 ),
             ],
             size_hint=(0.9,1)
             
         )
         try:
             #setting port number that is saved
             self.dialog.content_cls.text=str(self.password)
         except AttributeError:
             #setting default if no value is set
             self.dialog.content_cls.text="12345"
         self.dialog.open()
Пример #14
0
 def show_alert_dialog_port(self):       
         self.dialog = MDDialog(
             title="Port:",
             type="custom",
             content_cls=MDTextField(),
             buttons=[
                 MDFlatButton(
                     text="Ok", text_color=self.theme_cls.primary_color,on_press=self.outport
                 ),
                 MDFlatButton(
                     text="Cancel", text_color=self.theme_cls.primary_color,on_press=self.dialog_close
                 ),
             ],
             size_hint=(0.9,1)
         )
         try:
             #setting port number that is saved
             self.dialog.content_cls.text=str(self.port_number)
         except AttributeError:
             #setting default if no value is set
             self.dialog.content_cls.text="1024"
         
         self.dialog.open()
    def unlock_folder_dialog(self, folderpath, outputpath, url):
        def close_dialog(instance, *args):
            instance.parent.parent.parent.parent.dismiss()

        layout = MDBoxLayout(orientation="horizontal", adaptive_height=True)
        layout.add_widget(MDTextField(hint_text="Password", password=True))
        dialog = MDDialog(
            title=
            "Enter sudo password to change the rights of the destination folder",
            type='custom',
            auto_dismiss=False,
            content_cls=layout,
            buttons=[
                MDFlatButton(text="ENTER",
                             on_release=partial(self.unlock_folder, folderpath,
                                                outputpath, url)),
                MDFlatButton(text="DISCARD", on_release=close_dialog),
            ],
        )
        if get_app()._platform not in ['win32', 'win64']:
            # TODO: Focus function seems buggy in win
            dialog.content_cls.focused = True
        dialog.open()
Пример #16
0
        def show_dialog5(self, *args, text):

            from tes import check_resi
            deskripsi = check_resi(self.data[text]['kurir'], text)
            self.deskripsi = deskripsi["data"]["detail"]
            self.dialog = MDDialog(
                title='DETAILS',
                text=f'PENERIMA: {self.deskripsi["receiver"]}\n'
                f'STATUS: {self.deskripsi["status"]}\n'
                f'DIKIRIM: {self.deskripsi["date_shipment"]}\n'
                f'DITERIMA: {self.deskripsi["date_received"]}\n',
                size_hint=(0.8, 1),
                buttons=[
                    MDFlatButton(text='Close', on_release=self.close_dialog),
                    MDFlatButton(
                        text='Delete',
                        on_release=lambda x, item=text: self.delete(item)),
                    MDRaisedButton(text='See Details',
                                   on_release=lambda x, item=text: self.
                                   change_name(text=item))
                ])

            self.dialog.open()
Пример #17
0
 def about_dialog(self):
     close = MDFlatButton(text="Close", on_release=self.close_dialog)
     if not self.dialog2:
         self.dialog_ = MDDialog(
             text=
             f"Just took inspirations form my previous script of the same problem but it was done on a cli"
             f"This took real hardwork and time as i had 0 knowledge about Kivy in general, saw alot of times "
             f"when i thought to end this project",
             title=f"Created by: Shahzaib Ali aka Ali™",
             # type="custom",
             size_hint=(0.5, 1),
             auto_dismiss=False,
             buttons=[close])
     self.dialog_.open()
Пример #18
0
 def show_wallet_alert_dialog(self):
     if not self.wallet_alert_dialog:
         self.wallet_alert_dialog = MDDialog(
             title="Wallet is Created",
             buttons=[
                 MDFlatButton(
                     text="OK",
                     font_size= "18sp",
                     font_name= self.FONT_PATH + "RobotoCondensed-Bold",
                     on_press=self.dismiss_wallet_alert_dialog
                 ),
             ],
         )
     self.wallet_alert_dialog.open()
Пример #19
0
 def show_alert_dialog(self):
     if not self.dialog:
         self.dialog = MDDialog(
             text="Er du sikker på, at du vil slette?",
             size_hint_x=".55",
             buttons=[
                 MDFlatButton(text="NEJ",
                              text_color=self.theme_cls.primary_color,
                              on_release=self.close_dialog),
                 MDRaisedButton(text="SLET",
                                on_release=self.delete_task_post),
             ],
         )
     self.dialog.open()
Пример #20
0
 def hrdialog(self):
     close_button = MDFlatButton(text="Okay", on_release=self.close_dialog)
     self.dialog = MDDialog(
         title="Manual BPM Check",
         text=
         "Age   Target BPM   Average BPM \n 20     100 to 170      200 \n 30     95 to 162     "
         "   190 \n 35     93 to 157        185 \n 40     90 to 153        180 \n 45     88 to "
         "149       175 \n 50     85 to 145       170 \n 55     83 to 140       165 \n 60     80 "
         "to 136       160 \n 65     78 to 132        155 \n 70     75 to 128       150 \n   If "
         "you feel that your heart is beating out of rhythm, too fast, or too slow, "
         "speak to a doctor about your symptoms.",
         size_hint=(1, 1),
         buttons=[close_button])
     self.dialog.open()
    def dialogue_box_error_ui(self, title, text, button_text):
        """ Creates and opens the dialogue box on the screen.

        Parameters:
        title (str): The title of the dialogue box.
        text (str): The text of the dialogue box.
        button_text (str): Text of the button of the dialogue box.

        """

        cancel_btn_dialogue = MDFlatButton(text=button_text, on_release=self.close_dialogue)
        self.dialogue = MDDialog(title=title, text=text,
                                size_hint=(0.7, 0.2), buttons=[cancel_btn_dialogue])
        self.dialogue.open()
Пример #22
0
    def clear(self, *args):
        ''' Clear existing stack by moving/deleting FITs and resetting
        '''

        if len(self.subs) == 0:
            return

        if self.confirm_on_clear_stack:
            self.dialog = MDDialog(
                auto_dismiss=False,
                text="Are you sure you wish to clear the stack?",
                buttons=[
                    MDFlatButton(text="YES",
                                 text_color=self.app.theme_cls.primary_color,
                                 on_press=self._clear),
                    MDFlatButton(text="CANCEL",
                                 text_color=self.app.theme_cls.primary_color,
                                 on_press=self._cancel)
                ],
            )
            self.dialog.open()
        else:
            self._clear()
Пример #23
0
    def get_data_num(self, obj):

        if self.num.text is "":
            check_string = "Please enter a number"
        else:
            check_string = call_location((self.num.text))

        close_btn = MDFlatButton(text='Close', on_release=self.close_dialog)

        self.dialog = MDDialog(title='Verification',
                               text=check_string,
                               size_hint=(0.7, 1),
                               buttons=[close_btn])
        self.dialog.open()
Пример #24
0
 def show_add_unl_node_dialog(self):
     if not self.add_unl_node_dialog:
         self.add_unl_node_dialog = MDDialog(
             title="Add UNL Node",
             type="custom",
             auto_dismiss=False,
             content_cls=add_unl_node_Box(),
             buttons=[
                 MDFlatButton(
                     text="CANCEL",
                     on_press=self.dismiss_add_unl_node_dialog,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
                 MDFlatButton(
                     text="OK",
                     on_press=self.add_unl_node_func,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
             ],
         )
     self.add_unl_node_dialog.open()
Пример #25
0
    def openDialogToAddSource(self):
        title = 'Добавить новый магазин'
        content = AddSourceDialogContent()

        dismissButton = MDFlatButton(
            text='Отмена',
            on_release=self.onDialogDismiss,
            # text_color=self.theme_cls.primary_color
        )
        acceptButton = MDFlatButton(
            text='Добавить',
            on_release=self.onDialogAccept,
            # text_color=self.theme_cls.primary_color
        )
        buttons = [dismissButton, acceptButton]

        self.dialog = MDDialog(title=title,
                               type='custom',
                               content_cls=content,
                               buttons=buttons,
                               on_pre_dismiss=self.deleteDialog)

        self.dialog.open()
Пример #26
0
 def show_start_node_server_dialog(self):
     if not self.start_node_server_dialog:
         self.start_node_server_dialog = MDDialog(
             title="Start Node Server",
             type="custom",
             auto_dismiss=False,
             content_cls=start_node_server_Box(),
             buttons=[
                 MDFlatButton(
                     text="CANCEL",
                     on_press=self.dismiss_start_node_server_dialog,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
                 MDFlatButton(
                     text="OK",
                     on_press=self.start_node_server_func,
                     font_size="18sp",
                     font_name=self.FONT_PATH + "RobotoCondensed-Bold",
                 ),
             ],
         )
     self.start_node_server_dialog.open()
Пример #27
0
    def check_username(self):
        self.username_text = self.strng.get_screen('usernamescreen').ids.username_text_fied.text
        username_check_false = True
        try:
            int(self.username_text)
        except:
            username_check_false = False
        if username_check_false or self.username_text.split() == []:
                cancel_btn_username_dialogue = MDFlatButton(text='Retry',on_release = self.close_username_dialogue)
                self.dialog = MDDialog(title = 'Invalid Username',text = "Please input a valid username",size_hint = (0.7,0.2),buttons = [cancel_btn_username_dialogue])
                self.dialog.open()

        else:
            self.strng.get_screen('usernamescreen').ids.disabled_button.disabled = False
Пример #28
0
 def confirmfinal(self):
     if not self.confirmdf:
         self.confirmdf = MDDialog(
             title='[color=#FFFFFF]Confirm[/color]',
             size_hint=(0.4, 0.3),
             text="Add Meeting {} at {} to {}?".format(
                 self.my_event, self.starttime, self.endtime),
             buttons=[
                 MDFlatButton(text='NO',
                              on_release=self.clconfirmdf,
                              text_color=self.theme_cls.primary_color),
                 MDRaisedButton(text='YES', on_release=self.event_adder2)
             ])
         self.confirmdf.open()
Пример #29
0
    def show_data(self, obj):
        if self.username.text == '':
            check_string = 'Please enter a username'
        else:
            check_string = f'{self.username.text} does not exist'

        close_button = MDFlatButton(
            text='Close',
            on_release=self.close_dialog
        )

        other_button = MDFlatButton(
            text='Other'
        )
        
        self.dialog = MDDialog(
            title='Username Check',
            text=check_string,
            size_hint=(.7, 1),
            buttons=[close_button, other_button]
        )

        self.dialog.open()
Пример #30
0
 def menu_item_about_callback(self, text):
     self.menu_main.dismiss()
     self.about_dialog = MDDialog(
         title=T("co-app-name"),
         size_hint=(0.8, 0.3),
         text=T("co-app-running-on") + f" {platform}",
         buttons=[
             MDFlatButton(
                 text=T("co-close-button"),
                 on_release=self.about_dialog_close,
             ),
         ],
     )
     self.about_dialog.open()