示例#1
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)
示例#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)
        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
示例#5
0
文件: __init__.py 项目: thejeshgn/Zim
	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
示例#6
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)
示例#7
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)
示例#8
0
文件: spell.py 项目: thejeshgn/Zim
	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)
示例#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.ui.connect_after('open-page', self.do_open_page)
示例#10
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)
示例#11
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
示例#12
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
示例#13
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
示例#14
0
文件: __init__.py 项目: Jam71/Zim-QDA
    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
示例#15
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)
示例#16
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)
示例#17
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
     self.symbols = {}
     self.symbol_order = []
示例#18
0
文件: tags.py 项目: thejeshgn/Zim
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.sidepane_widget = None
示例#19
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
示例#20
0
	def __init__(self, config=None):
		PluginClass.__init__(self, config)
		self.connectto(self.preferences, 'changed', self.on_preferences_changed)
示例#21
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
示例#22
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')
示例#23
0
	def __init__(self):
		PluginClass.__init__(self)
		self.symbols = {}
		self.symbol_order = []
示例#24
0
 def __init__(self):
     PluginClass.__init__(self)
     self.preferences.connect('changed', self.on_preferences_changed)
示例#25
0
 def __init__(self, *a):
     self._normal_colors = None
     self._show_panes = True
     PluginClass.__init__(self, *a)
示例#26
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)
示例#27
0
文件: calendar.py 项目: thejeshgn/Zim
	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
 def __init__(self):
     PluginClass.__init__(self)
示例#29
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)
示例#30
0
	def __init__(self, ui):
		PluginClass.__init__(self, ui)
		self.connectto(ui, 'initialize-notebook')
示例#31
0
 def __init__(self, config=None):
     PluginClass.__init__(self, config)
示例#32
0
文件: insertsymbol.py 项目: gdw2/zim
	def __init__(self, config=None):
		PluginClass.__init__(self, config)
		self.symbols = {}
		self.symbol_order = []
示例#33
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)
示例#34
0
文件: calendar.py 项目: 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)
示例#35
0
 def __init__(self, ui):
     PluginClass.__init__(self, ui)
     self._trayicon_class = None
     self.icon = None
     self.proxyobject = None