Esempio n. 1
0
 def _get_selected_formats(self, msg, ids, exclude=False, single=False):
     from calibre.gui2.dialogs.select_formats import SelectFormats
     c = Counter()
     db = self.gui.library_view.model().db
     for x in ids:
         fmts_ = db.formats(x, index_is_id=True, verify_formats=False)
         if fmts_:
             for x in frozenset([x.lower() for x in fmts_.split(',')]):
                 c[x] += 1
     d = SelectFormats(c, msg, parent=self.gui, exclude=exclude,
             single=single)
     if d.exec_() != d.Accepted:
         return None
     return d.selected_formats
Esempio n. 2
0
 def _get_selected_formats(self, msg, ids, exclude=False, single=False):
     from calibre.gui2.dialogs.select_formats import SelectFormats
     c = Counter()
     db = self.gui.library_view.model().db
     for x in ids:
         fmts_ = db.formats(x, index_is_id=True, verify_formats=False)
         if fmts_:
             for x in frozenset([x.lower() for x in fmts_.split(',')]):
                 c[x] += 1
     d = SelectFormats(c, msg, parent=self.gui, exclude=exclude,
             single=single)
     if d.exec_() != d.Accepted:
         return None
     return d.selected_formats