Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
	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
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 23
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)
		self.connectto(self.preferences, 'changed', self.on_preferences_changed)
Esempio n. 24
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
Esempio n. 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')
Esempio n. 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)
Esempio n. 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)
Esempio n. 28
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.sidepane_widget = None
Esempio n. 29
0
	def __init__(self):
		PluginClass.__init__(self)
		self.symbols = {}
		self.symbol_order = []
Esempio n. 30
0
 def __init__(self, *a):
     self._normal_colors = None
     self._show_panes = True
     PluginClass.__init__(self, *a)
Esempio n. 31
0
 def __init__(self):
     PluginClass.__init__(self)
     self.preferences.connect('changed', self.on_preferences_changed)
Esempio n. 32
0
	def destroy(self):
		self.disconnect_sidepane()
		self.disconnect_floating()
		PluginClass.destroy(self)
Esempio n. 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
Esempio n. 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)
Esempio n. 35
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
     self.symbols = {}
     self.symbol_order = []
Esempio n. 36
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     self._trayicon_class = None
     self.icon = None
     self.proxyobject = None
Esempio n. 37
0
 def destroy(self):
     self._drop_table()
     PluginClass.destroy(self)
Esempio n. 38
0
	def destroy(self):
		self.disconnect_embedded_widget()
		PluginClass.destroy(self)
Esempio n. 39
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
Esempio n. 40
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
Esempio n. 41
0
 def destroy(self):
     self.disconnect_trayicon()
     self.ui.hideonclose = False
     PluginClass.destroy(self)
 def __init__(self):
     PluginClass.__init__(self)
Esempio n. 43
0
File: calendar.py Progetto: gdw2/zim
	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)