home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- __license__ = 'GPL v3'
- __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
- __docformat__ = 'restructuredtext en'
- from functools import partial
- from PyQt4.Qt import QToolButton, QAction, QIcon, QObject
- from calibre.gui2 import Dispatcher
-
- class InterfaceAction(QObject):
- name = 'Implement me'
- priority = 1
- popup_type = QToolButton.MenuButtonPopup
- auto_repeat = False
- action_spec = ('text', 'icon', None, None)
- dont_add_to = frozenset([])
- dont_remove_from = frozenset([])
- all_locations = frozenset([
- 'toolbar',
- 'toolbar-device',
- 'context-menu',
- 'context-menu-device'])
- action_type = 'global'
-
- def __init__(self, parent, site_customization):
- QObject.__init__(self, parent)
- self.setObjectName(self.name)
- self.gui = parent
- self.site_customization = site_customization
-
-
- def do_genesis(self):
- self.Dispatcher = partial(Dispatcher, parent = self)
- self.create_action()
- self.gui.addAction(self.qaction)
- self.genesis()
-
-
- def create_action(self, spec = None, attr = 'qaction'):
- if spec is None:
- spec = self.action_spec
-
- (text, icon, tooltip, shortcut) = spec
- if icon is not None:
- action = QAction(QIcon(I(icon)), text, self.gui)
- else:
- action = QAction(text, self.gui)
- action.setAutoRepeat(self.auto_repeat)
- text = None if tooltip else text
- action.setToolTip(text)
- action.setStatusTip(text)
- action.setWhatsThis(text)
- action.setAutoRepeat(False)
- if shortcut:
- action.setShortcut(shortcut)
-
- setattr(self, attr, action)
- return action
-
-
- def genesis(self):
- pass
-
-
- def location_selected(self, loc):
- pass
-
-
- def library_changed(self, db):
- pass
-
-
- def initialization_complete(self):
- pass
-
-
- def shutting_down(self):
- return True
-
-
-