home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1172 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  1.7 KB  |  33 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. from calibre.gui2.dialogs.book_info import BookInfo
  9. from calibre.gui2 import error_dialog
  10.  
  11. class ShowBookDetailsAction(InterfaceAction):
  12.     name = 'Show Book Details'
  13.     action_spec = (_('Show book details'), 'dialog_information.png', None, _('I'))
  14.     dont_add_to = frozenset([
  15.         'toolbar-device',
  16.         'context-menu-device'])
  17.     action_type = 'current'
  18.     
  19.     def genesis(self):
  20.         self.qaction.triggered.connect(self.show_book_info)
  21.  
  22.     
  23.     def show_book_info(self, *args):
  24.         if self.gui.current_view() is not self.gui.library_view:
  25.             error_dialog(self.gui, _('No detailed info available'), _('No detailed information is available for books on the device.')).exec_()
  26.             return None
  27.         index = self.gui.library_view.currentIndex()
  28.         if index.isValid():
  29.             BookInfo(self.gui, self.gui.library_view, index).show()
  30.         
  31.  
  32.  
  33.