Пример #1
0
    def __init__(self, ui):
        PluginClass.__init__(self, ui)

        # Add menu items.
        if self.ui.ui_type == 'gtk':
            self.ui.add_actions(ui_actions, self)
            self.ui.add_ui(ui_xml, self)
Пример #2
0
    def __init__(self, config=None):
        PluginClass.__init__(self, config)

        # Construct a new class on run time
        klassname = self.object_type.title() + 'MainWindowExtension'
        insert_action = Action('insert_%s' % self.object_type,
                               MainWindowExtensionBase.insert_object,
                               self.short_label + '...',
                               readonly=False)
        generatorklass = self.lookup_subclass(ImageGeneratorClass)
        assert generatorklass.object_type == self.object_type, \
         'Object type of ImageGenerator (%s) does not match object type of plugin (%s)' \
         % (generatorklass.object_type, self.object_type)


        mainwindow_extension_base = \
         self.lookup_subclass(MainWindowExtensionBase) \
         or MainWindowExtensionBase

        klass = type(
            klassname, (mainwindow_extension_base, ), {
                'object_type': self.object_type,
                'syntax': self.syntax,
                'uimanager_xml': uimanager_xml_template % self.object_type,
                'generator_class': generatorklass,
                'short_label': self.short_label,
                'insert_label': self.insert_label,
                'edit_label': self.edit_label,
                'insert_%s' % self.object_type: insert_action,
            })

        self.set_extension_class('MainWindow', klass)
Пример #3
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)

		# Construct a new class on run time
		klassname = self.object_type.title() + 'MainWindowExtension'
		insert_action = Action(
			'insert_%s' % self.object_type,
			MainWindowExtensionBase.insert_object,
			self.short_label + '...', readonly=False
		)
		generatorklass = self.lookup_subclass(ImageGeneratorClass)
		assert generatorklass.object_type == self.object_type, \
			'Object type of ImageGenerator (%s) does not match object type of plugin (%s)' \
			% (generatorklass.object_type, self.object_type)


		mainwindow_extension_base = \
			self.lookup_subclass(MainWindowExtensionBase) \
			or MainWindowExtensionBase

		klass = type(klassname, (mainwindow_extension_base,), {
			'object_type': self.object_type,
			'syntax': self.syntax,
			'uimanager_xml': uimanager_xml_template % self.object_type,
			'generator_class': generatorklass,
			'short_label': self.short_label,
			'insert_label': self.insert_label,
			'edit_label': self.edit_label,
			'insert_%s' % self.object_type: insert_action,
		})

		self.set_extension_class('MainWindow', klass)
Пример #4
0
    def __init__(self, config=None):
        PluginClass.__init__(self, config)
        self.connectto(TemplateManager, 'process-page',
                       self.on_process_page_template)

        self.preferences.connect('changed', self.on_preferences_changed)
        self.on_preferences_changed(self.preferences)
Пример #5
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)

		# Construct a new class on run time
		klassname = self.object_type.title() + 'PageViewExtension'
		insert_action = Action(
			'insert_%s' % self.object_type,
			ImageGeneratorPageViewExtensionBase.insert_object,
			self.short_label + '...', menuhints='insert'
		)
		generatorklass = self.lookup_subclass(ImageGeneratorClass)
		assert generatorklass.object_type == self.object_type, \
			'Object type of ImageGenerator (%s) does not match object type of plugin (%s)' \
			% (generatorklass.object_type, self.object_type)


		mainwindow_extension_base = \
			self.lookup_subclass(ImageGeneratorPageViewExtensionBase) \
			or ImageGeneratorPageViewExtensionBase

		klass = type(klassname, (mainwindow_extension_base,), {
			'object_type': self.object_type,
			'syntax': self.syntax,
			'generator_class': generatorklass,
			'short_label': self.short_label,
			'insert_label': self.insert_label,
			'edit_label': self.edit_label,
			'insert_%s' % self.object_type: insert_action,
		})

		self.extension_classes['PageView'] = klass
Пример #6
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		if self.ui.ui_type == 'gtk':
			import gui
			self.gui = gui.GtkLinkMap(self.ui)
		else:
			self.gui = False
Пример #7
0
 def destroy(self):
     # show at least menubar again, set margins to zero & restore colors
     self.ui.uistate['MainWindow']['show_menubar_fullscreen'] = True
     self._set_margins(0, 0, 0, 0)
     if self._normal_colors:
         self._set_colors(self._normal_colors)
     PluginClass.destroy(self)
Пример #8
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
     ObjectManager.register_object(
         OBJECT_TYPE, self.create_object
     )  # register the plugin in the main init so it works for a non-gui export
     self.connectto(self.preferences, 'changed',
                    self.on_preferences_changed)
Пример #9
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.spell = None
		self.uistate.setdefault('active', False)
		if self.ui.ui_type == 'gtk':
			self.ui.add_toggle_actions(ui_toggle_actions, self)
			self.ui.add_ui(ui_xml, self)
			self.connectto(self.ui, 'open-page', order=SIGNAL_AFTER)
Пример #10
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.spell = None
		self.uistate.setdefault('active', False)
		if self.ui.ui_type == 'gtk':
			self.ui.add_toggle_actions(ui_toggle_actions, self)
			self.ui.add_ui(ui_xml, self)
			self.ui.connect_after('open-page', self.do_open_page)
Пример #11
0
 def extend(self, obj):
     name = obj.__class__.__name__
     if name == 'MainWindow':
         index = obj.ui.notebook.index  # XXX
         i_ext = self.get_extension(IconsIndexExtension, index=index)
         mw_ext = MainWindowExtension(self, obj, i_ext)
         self.extensions.add(mw_ext)
     else:
         PluginClass.extend(self, obj)
Пример #12
0
	def disconnect(self):
		self.ui.notebook.unregister_hook('suggest_link', self.suggest_link)
		if self._set_template:
			ns = self._set_template
			try:
				self.ui.notebook.namespace_properties[ns].remove('template')
			except KeyError:
				pass
		PluginClass.disconnect(self)
Пример #13
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.sidepane_widget = None
		self.ui_id_show_dialog = None
		self._set_template = None
		if self.ui.ui_type == 'gtk':
			self.ui.add_actions(ui_actions, self)
			self.ui.add_ui(ui_xml, self)
			self.ui.connect_after('open-notebook', self.do_open_notebook)
Пример #14
0
	def destroy(self):
		if self._set_template:
			ns = self._set_template
			try:
				self.ui.notebook.namespace_properties[ns].remove('template')
			except KeyError:
				pass
		self.destroy_embedded_widget()
		PluginClass.destroy(self)
Пример #15
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     try:
         self.zeitgeist_client = ZeitgeistClient()
         self.zeitgeist_client.register_data_source('application://zim.desktop',
             'Zim', _('Zim Desktop Wiki'), []) # T: short description of zim
     except RuntimeError, e:
         logger.exception('Loading zeitgeist client failed, will not log events')
         self.zeitgeist_client = None
Пример #16
0
	def extend(self, obj):
		name = obj.__class__.__name__
		if name == 'MainWindow':
			index = obj.ui.notebook.index # XXX
			i_ext = self.get_extension(IndexExtension, index=index)
			mw_ext = MainWindowExtension(self, obj, i_ext)
			self.extensions.add(mw_ext)
		else:
			PluginClass.extend(self, obj)
Пример #17
0
	def extend(self, obj):
		name = obj.__class__.__name__
		if name == 'MainWindow':
			nb = obj.ui.notebook # XXX
			nb_ext = self.get_extension(NotebookExtension, notebook=nb)
			assert nb_ext, 'No notebook extension found for: %s' % nb
			mw_ext = MainWindowExtension(self, obj, nb_ext)
			self.extensions.add(mw_ext)
		else:
			PluginClass.extend(self, obj)
Пример #18
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     self.task_labels = None
     self.task_label_re = None
     self.next_label = None
     self.next_label_re = None
     self.nonactionable_tags = []
     self.included_re = None
     self.excluded_re = None
     self.db_initialized = False
     self._current_preferences = None
Пример #19
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     try:
         self.zeitgeist_client = ZeitgeistClient()
         self.zeitgeist_client.register_data_source(
             'application://zim.desktop', 'Zim', _('Zim Desktop Wiki'),
             [])  # T: short description of zim
     except RuntimeError, e:
         logger.exception(
             'Loading zeitgeist client failed, will not log events')
         self.zeitgeist_client = None
Пример #20
0
    def __init__(self, ui):
        PluginClass.__init__(self, ui)
        self.codes_labels = None
        self.codes_label_re = None

        self.included_re = None
        self.excluded_re = None
        self.db_initialized = False
        self._current_preferences = None

        # Permite el indexamiento de la db en batch
        self.allow_index = False
Пример #21
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.icon = None
		self.proxyobject = None
		if self.ui.ui_type == 'gtk':
			if ui.usedaemon:
			#~ and not self.preferences['standalone']
				from zim.daemon import DaemonProxy
				self.proxyobject = DaemonProxy().get_object(
					'zim.plugins.trayicon.DaemonTrayIcon', 'TrayIcon')
				self.ui.hideonclose = True
			else:
				self.icon = StandAloneTrayIcon(self.ui)
Пример #22
0
    def __init__(self, ui):
        PluginClass.__init__(self, ui)
        self.vcs = None
        if self.ui.ui_type == 'gtk':
            self.ui.add_actions(ui_actions, self)
            self.ui.add_ui(ui_xml, self)
            self.actiongroup.get_action('show_versions').set_sensitive(False)
            if self.ui.notebook:
                self.detect_vcs()
            else:
                self.ui.connect_after('open-notebook',
                    lambda o, n: self.detect_vcs() )

            def on_quit(o):
                if self.preferences['autosave']:
                    self.autosave()
            self.ui.connect('quit', on_quit)
Пример #23
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)
		self.connectto(self.preferences, 'changed', self.on_preferences_changed)
Пример #24
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
Пример #25
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     if self.ui.ui_type == 'gtk':
         self.ui.add_actions(ui_actions, self)
         self.ui.add_ui(ui_xml, self)
         self.register_image_generator_plugin('gnu_r_plot')
Пример #26
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     if self.ui.ui_type == "gtk":
         self.ui.add_actions(ui_actions, self)
         self.ui.add_ui(ui_xml, self)
Пример #27
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
     self.add_manifests()
     self.preferences.connect('changed', self.on_preferences_changed)
     self.on_preferences_changed(self.preferences)
Пример #28
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.sidepane_widget = None
Пример #29
0
	def __init__(self):
		PluginClass.__init__(self)
		self.symbols = {}
		self.symbol_order = []
Пример #30
0
 def __init__(self, *a):
     self._normal_colors = None
     self._show_panes = True
     PluginClass.__init__(self, *a)
Пример #31
0
 def __init__(self):
     PluginClass.__init__(self)
     self.preferences.connect('changed', self.on_preferences_changed)
Пример #32
0
	def destroy(self):
		self.disconnect_sidepane()
		self.disconnect_floating()
		PluginClass.destroy(self)
Пример #33
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.sidepane_widget = None # For the embedded version
		self.ui_id_show_dialog = None # For the 'show dialog' action
		self._set_template = None
Пример #34
0
 def __init__(self, config=None):
     ''' Constructor '''
     PluginClass.__init__(self, config)
     ObjectManager.register_object(OBJECT_TYPE, self.create_table)
     self.connectto(self.preferences, 'changed',
                    self.on_preferences_changed)
Пример #35
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
     self.symbols = {}
     self.symbol_order = []
Пример #36
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     self._trayicon_class = None
     self.icon = None
     self.proxyobject = None
Пример #37
0
 def destroy(self):
     self._drop_table()
     PluginClass.destroy(self)
Пример #38
0
	def destroy(self):
		self.disconnect_embedded_widget()
		PluginClass.destroy(self)
Пример #39
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
Пример #40
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
Пример #41
0
 def destroy(self):
     self.disconnect_trayicon()
     self.ui.hideonclose = False
     PluginClass.destroy(self)
 def __init__(self):
     PluginClass.__init__(self)
Пример #43
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)
		self.connectto(TemplateManager, 'process-page', self.on_process_page_template)

		self.preferences.connect('changed', self.on_preferences_changed)
		self.on_preferences_changed(self.preferences)