home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1156 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.6 KB  |  30 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 AddToLibraryAction(InterfaceAction):
  10.     name = 'Add To Library'
  11.     action_spec = (_('Add books to library'), 'add_book.png', _('Add books to your calibre library from the connected 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.add_books_to_library)
  19.  
  20.     
  21.     def location_selected(self, loc):
  22.         enabled = loc != 'library'
  23.         self.qaction.setEnabled(enabled)
  24.  
  25.     
  26.     def add_books_to_library(self, *args):
  27.         self.gui.iactions['Add Books'].add_books_from_device(self.gui.current_view())
  28.  
  29.  
  30.