home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1164 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.8 KB  |  38 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
  6. __docformat__ = 'restructuredtext en'
  7. from calibre.gui2.actions import InterfaceAction
  8.  
  9. class EditCollectionsAction(InterfaceAction):
  10.     name = 'Edit Collections'
  11.     action_spec = (_('Manage collections'), None, _('Manage the collections on this device'), None)
  12.     dont_add_to = frozenset([
  13.         'toolbar',
  14.         'context-menu'])
  15.     action_type = 'current'
  16.     
  17.     def genesis(self):
  18.         self.qaction.triggered.connect(self.edit_collections)
  19.  
  20.     
  21.     def location_selected(self, loc):
  22.         enabled = loc != 'library'
  23.         self.qaction.setEnabled(enabled)
  24.  
  25.     
  26.     def edit_collections(self, *args):
  27.         oncard = None
  28.         cv = self.gui.current_view()
  29.         if cv is self.gui.card_a_view:
  30.             oncard = 'carda'
  31.         
  32.         if cv is self.gui.card_b_view:
  33.             oncard = 'cardb'
  34.         
  35.         self.gui.iactions['Edit Metadata'].edit_device_collections(cv, oncard = oncard)
  36.  
  37.  
  38.