def error_out():
     if not self.error_popup:
         self.error_popup = True
         ep = Error_Popup(
             lang.pack['Files']['File_Options']['Folder_Error']
             ['Title'],
             lang.pack['Files']['File_Options']['Folder_Error']['Body'])
         ep.show()
 def error_out():
     if not self.error_popup:
         self.error_popup = True
         ep = Error_Popup(
             lang.pack['Files']['File_Options']['Move_Error']['Title'],
             lang.pack['Files']['File_Options']['Move_Error']['Body'])
         ep.show()
     self.counter = self.max_count - 1
Esempio n. 3
0
 def __init__(self):
     self.update_interface = Update_Interface()
     self.buttons = self.make_buttons()
     super(Update_System, self).__init__(self.buttons)
     if self.buttons == []:
         ep = Error_Popup(
             roboprinter.lang.pack['Update_Printer']['Server_Error']
             ['Title'], roboprinter.lang.pack['Update_Printer']
             ['Server_Error']['Body'])
         ep.show()
Esempio n. 4
0
 def goto_update(dt):
     Logger.info("Selecting Update: " +
                 str(json.dumps(self.button_data, indent=4)))
     if not self.update_interface.select_update(self.button_data):
         #if the update does not go through then throw an error and tell the user
         self.warning.dismiss()
         ep = Error_Popup(
             roboprinter.lang.pack['Update_Printer']['Server_Error']
             ['Title'], roboprinter.lang.pack['Update_Printer']
             ['Server_Error']['Body'], cancel)
         ep.show()
    def get_selected_files(self, file_list, file_options_screen,
                           resume_file_select, update_selected_folders):
        #Logger.info("Getting selected files")

        self.selected_files = []
        selected_folders_path = {}

        for file in file_list:
            if file['selected']:
                #Logger.info('File: ' + str(file['name']) + ' added to list')
                self.selected_files.append(file)
                if file['type'] == 'folder':
                    selected_folders_path[file['path']] = file['name']

        #if nothing is selected then do nothing
        if len(self.selected_files) == 0:
            #Logger.info("No Items Selected")
            ep = Error_Popup(
                lang.pack['Files']['Errors']['No_Items1']['Title'],
                lang.pack['Files']['Errors']['No_Items1']['Body'],
            )
            ep.show()
            return

        #return modify buttons to their original state
        #This is so the user can pick their option without interference from us
        for button in self.button_dict['modify_files']['buttons']:
            if hasattr(button, 'selected'):
                button.selected = False
                button.select(button.selected)
            elif hasattr(button, 'update_count'):
                button.update_count(str(len(self.selected_files)))
            else:
                raise AttributeError("Has neither selected or update count.")

        #Throw the selected list over to file_explorer so it can block out any
        update_selected_folders(selected_folders_path)
        #change screen back to lead back to the file select screen
        file_select_screen = roboprinter.screen_controls.get_screen_data()

        roboprinter.screen_controls.populate_old_screen(file_options_screen)
        self.switch_lists('modify_files')

        def back_function():
            self.return_to_previous_list()  #return to the List Option Page
            resume_file_select(
            )  #tell the File Explorer to go back to the file select screen
            roboprinter.screen_controls.populate_old_screen(
                file_select_screen,
                ignore_update=True)  #return to the file select screen

        roboprinter.screen_controls.update_back_function(back_function)
Esempio n. 6
0
    def modify_files(self):
        #Logger.info("Modify the files!")

        for button in self.button_dict['modify_files']['buttons']:
            if hasattr(button, 'selected'):
                if button.selected:
                    self.execute_modification(button.original_name)
                    return

        #Logger.info("No Items Selected")
        ep = Error_Popup(lang.pack['Files']['Errors']['No_Items2']['Title'],
                         lang.pack['Files']['Errors']['No_Items2']['Body'],
                         )
        ep.show()
Esempio n. 7
0
        def delete():
            if not self.dual:
                #get all the options
                presets = roboprinter.printer_instance._settings.get(
                    ['Temp_Preset'])

                #delete entry
                name = next(iter(self.selected_option))
                del presets[name]

                #save
                roboprinter.printer_instance._settings.set(['Temp_Preset'],
                                                           presets)
                roboprinter.printer_instance._settings.save()

                #Info Popup saying that we deleted the preset
                title = lang.pack['Preheat']['Delete']['Deleted']
                ep = Error_Popup(name, title, callback=self.delete_callback)
                ep.show()
            else:
                #get all the options
                presets = roboprinter.printer_instance._settings.get(
                    ['Dual_Temp_Preset'])

                #delete entry
                name = next(iter(self.selected_option))
                del presets[name]

                #save
                roboprinter.printer_instance._settings.set(
                    ['Dual_Temp_Preset'], presets)
                roboprinter.printer_instance._settings.save()

                #Info Popup saying that we deleted the preset
                title = lang.pack['Preheat']['Delete']['Deleted']
                ep = Error_Popup(name, title, callback=self.delete_callback)
                ep.show()