Пример #1
0
 def open_reg_mem_save_dialog(self, instance):
     """
     It will be called when user click on the save file button.
     :param instance: used as event handler for button click;
     """
     dialog = MDInputDialog(title='Save file: Enter file name',
                            hint_text='Enter file name',
                            size_hint=(.3, .3),
                            text_button_ok='Save',
                            text_button_cancel='Cancel',
                            events_callback=self.save_file)
     if self.dpi >= 192:
         dialog.pos_hint = {'x': dp(0.18), 'y': dp(0.18)}
     toast('Save Register and Memory Content')
     dialog.open()
Пример #2
0
 def io_config_open(self, instance):
     """
     Opens IO configuration
     :param instance: obj
     """
     dialog = MDInputDialog(title=instance.text,
                            hint_text='Input port number [000-FFF]',
                            text_button_ok='Save',
                            text_button_cancel='Cancel',
                            events_callback=self.save_io_ports)
     if self.dpi < 192:
         dialog.size_hint = (dp(0.4), dp(0.4))
     else:
         dialog.size_hint = (dp(0.2), dp(0.2))
         dialog.pos_hint = {'x': dp(0.15), 'y': dp(0.15)}
     dialog.open()
Пример #3
0
    def open_editor_save_dialog(self, instance):
        """
        Opens editor save dialog
        :param instance: obj
        """
        if EVENTS['IS_OBJ']:
            toast('Obj files cannot be modified.')

        else:
            if EVENTS['LOADED_FILE']:
                self.run_window.editor.save(EVENTS['FILE_PATH'])
                toast('Content saved on loaded file')
                EVENTS['EDITOR_SAVED'] = True
            else:
                dialog = MDInputDialog(title='Save file: Enter file name',
                                       hint_text='Enter file name',
                                       size_hint=(.3, .3),
                                       text_button_ok='Save',
                                       text_button_cancel='Cancel',
                                       events_callback=self.save_asm_file)
                if self.dpi >= 192:
                    dialog.pos_hint = {'x': dp(0.18), 'y': dp(0.18)}
                toast('Save Editor Content')
                dialog.open()