Beispiel #1
0
 def add_formats(self, *args):
     ids = self._check_add_formats_ok()
     if not ids:
         return
     books = choose_files_and_remember_all_files(self.gui,
                                                 'add formats dialog dir',
                                                 _('Select book files'),
                                                 filters=get_filters())
     if books:
         self._add_formats(books, ids)
Beispiel #2
0
    def add_books(self, *args):
        '''
        Add books from the local filesystem to either the library or the device.
        '''
        filters = get_filters()
        to_device = self.gui.stack.currentIndex() != 0
        if to_device:
            fmts = self.gui.device_manager.device.settings().format_map
            filters = [(_('Supported books'), fmts)]

        books = choose_files_and_remember_all_files(self.gui,
                                                    'add books dialog dir',
                                                    _('Select books'),
                                                    filters=filters)
        if not books:
            return
        self._add_books(books, to_device)