Beispiel #1
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.preferences = plugin.preferences
		self._monitor = None

		# Init statusbar button
		self.statusbar_frame = gtk.Frame()
		self.statusbar_frame.set_shadow_type(gtk.SHADOW_IN)
		self.window.statusbar.pack_end(self.statusbar_frame, False)

		self.statusbar_button = gtk.ToggleButton('<attachments>') # translated below
		button_set_statusbar_style(self.statusbar_button)

		self.statusbar_button.set_use_underline(True)
		self.__class__.toggle_attachmentbrowser.connect_actionable(
			self, self.statusbar_button)

		self.statusbar_frame.add(self.statusbar_button)
		self.statusbar_frame.show_all()

		# Init browser widget
		opener = self.window.get_resource_opener()
		self.widget = AttachmentBrowserPluginWidget(self, opener, self.preferences)
			# FIXME FIXME FIXME - get rid of ui object here

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)

		# XXX
		if self.window.ui.page:
			self.on_open_page(self.window.ui, self.window.ui.page, self.window.ui.page)
		self.connectto(self.window.ui, 'open-page')
		self.connectto(self.window.ui, 'close-page')

		self.connectto(self.window, 'pane-state-changed')
Beispiel #2
0
    def destroy(self):
        if self.sidepane_widget:
            self.window.remove(self.sidepane_widget)
            self.sidepane_widget.destroy()
            self.sidepane_widget = None

        WindowExtension.destroy(self)
Beispiel #3
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)
        self.preferences = plugin.preferences
        self.uistate = plugin.uistate
        self._monitor = None

        # Init statusbar button
        self.statusbar_frame = gtk.Frame()
        self.statusbar_frame.set_shadow_type(gtk.SHADOW_IN)
        self.window.statusbar.pack_end(self.statusbar_frame, False)

        self.statusbar_button = gtk.ToggleButton('<attachments>') # translated below
        button_set_statusbar_style(self.statusbar_button)

        self.statusbar_button.set_use_underline(True)
        self.__class__.toggle_fileview.connect_actionable(
            self, self.statusbar_button)

        self.statusbar_frame.add(self.statusbar_button)
        self.statusbar_frame.show_all()

        # Init browser widget
        opener = self.window.get_resource_opener()
        self.widget = AttachmentBrowserPluginWidget(self, opener, self.preferences)
            # FIXME FIXME FIXME - get rid of ui object here
        self.connectto(plugin, 'preferences-changed')
        self.on_preferences_changed()

        # XXX
        if self.window.ui.page:
            self.on_open_page(self.window.ui, self.window.ui.page, self.window.ui.page)
        self.connectto(self.window.ui, 'open-page')

        self.connectto(self.window, 'pane-state-changed')
Beispiel #4
0
    def destroy(self):
        self._disconnect_monitor()
        self.toggle_fileview(False)
        if self.statusbar_frame:
            self.window.statusbar.remove(self.statusbar_frame)

        WindowExtension.destroy(self)
Beispiel #5
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
		self.plugin = plugin
		self.ui = window.ui
		self.ui.add_actions(ui_actions, self)
Beispiel #6
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)
        self.widget = FloatingToC(self.window.ui, self.window.pageview)  # XXX

        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed',
                       self.on_preferences_changed)
Beispiel #7
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)
        self._adapter = GtkspellcheckAdapter if gtkspellcheck else GtkspellAdapter

        self.uistate.setdefault('active', False)
        self.toggle_spellcheck(self.uistate['active'])
        self.connectto(self.window.ui, 'open-page', order=SIGNAL_AFTER)  # XXX
Beispiel #8
0
    def __init__(self, plugin, window):
        ''' Constructor '''
        WindowExtension.__init__(self, plugin, window)

        # reload tables on current page after plugin activation
        if self.window.ui.page:
            self.window.ui.reload_page()
Beispiel #9
0
    def __init__(self, plugin, window, index_ext):
        WindowExtension.__init__(self, plugin, window)
        self.index_ext = index_ext # index of icons in pages

        self.widget = IconTagsPluginWidget(self.window.ui.notebook.index, self.index_ext,
                                           self.window.ui, self.uistate) # XXX
        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
Beispiel #10
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.window.ui.hideonclose = True # XXX
		self.proxyobject = None

		obj = RemoteObject('zim.plugins.trayicon.' + self.trayiconclass.__name__)
		server = ServerProxy()
		self.proxyobject = server.get_proxy(obj)
Beispiel #11
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)
        self.window.ui.hideonclose = True  # XXX
        self.proxyobject = None

        obj = RemoteObject('zim.plugins.trayicon.' +
                           self.trayiconclass.__name__)
        server = ServerProxy()
        self.proxyobject = server.get_proxy(obj)
Beispiel #12
0
    def __init__(self, plugin, window, index_ext):
        WindowExtension.__init__(self, plugin, window)
        self.index_ext = index_ext  # index of icons in pages

        self.widget = IconTagsPluginWidget(self.window.ui.notebook.index,
                                           self.index_ext, self.window.ui,
                                           self.uistate)  # XXX
        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed',
                       self.on_preferences_changed)
Beispiel #13
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self._normal_colors = None
		self._show_panes = True
		self.preferences = plugin.preferences

		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
		self.connectto(window, 'init-uistate', self.on_init_uistate)

		self.connectto(window, 'fullscreen-changed')
		self.connectto(window.pageview.view, 'size-allocate')
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)
        self._normal_colors = None
        self._show_panes = True
        self.preferences = plugin.preferences

        self.connectto(plugin.preferences, 'changed',
                       self.on_preferences_changed)
        self.connectto(window, 'init-uistate', self.on_init_uistate)

        self.connectto(window, 'fullscreen-changed')
        self.connectto(window.pageview.view, 'size-allocate')
Beispiel #15
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        # Define OS X menu bar for this window and remove menubar from winow
        self.menubar = self.window.menubar
        self.window._zim_window_main.remove(
            self.menubar
        )  # XXX - use private arg, should patch Window.remove() instead ...

        # Hook up to signal for focus change
        window.connect('notify', self._on_notify)
        if window.has_toplevel_focus():
            self.set_menubar()
Beispiel #16
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)

		self.widget = TagsPluginWidget(self.window.ui.notebook.index, self.uistate, self.window.ui) # XXX

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)

		self.uistate.setdefault('vpane_pos', 150)
		self.widget.set_position(self.uistate['vpane_pos'])
		def update_uistate(*a):
			self.uistate['vpane_pos'] = self.widget.get_position()
		self.widget.connect('notify::position', update_uistate)
Beispiel #17
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)

		self.widget = TagsPluginWidget(self.window.ui.notebook.index, self.uistate, self.window.ui) # XXX

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)

		self.uistate.setdefault('vpane_pos', 150)
		self.widget.set_position(self.uistate['vpane_pos'])
		def update_uistate(*a):
			self.uistate['vpane_pos'] = self.widget.get_position()
		self.widget.connect('notify::position', update_uistate)
Beispiel #18
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)

		opener = self.window.get_resource_opener()
		self.widget = BackLinksWidget(opener)
		if self.window.ui.page: # XXX
			ui = self.window.ui # XXX
			page = self.window.ui.page # XXX
			self.on_open_page(ui, page, page)
		self.connectto(self.window.ui, 'open-page') # XXX

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
Beispiel #19
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.opener = window.get_resource_opener()

		notebook = window.ui.notebook # XXX
		model = CalendarWidgetModel(self.plugin, notebook)
		self.widget = CalendarWidget(model)

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)

		self.connectto(self.widget, 'date-activated')
		self.connectto(self.window.ui, 'open-page') # XXX
Beispiel #20
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        opener = self.window.get_resource_opener()
        self.widget = BackLinksWidget(opener)
        if self.window.ui.page:  # XXX
            ui = self.window.ui  # XXX
            page = self.window.ui.page  # XXX
            self.on_open_page(ui, page, page)
        self.connectto(self.window.ui, 'open-page')  # XXX

        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed',
                       self.on_preferences_changed)
Beispiel #21
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        self.index = self.window.ui.notebook.index # XXX

        self.indexer = None
        self._indexing_enabled = plugin.preferences['enable_indexing']

        if self._indexing_enabled:
            if self.index.get_property(IconsIndexer.PLUGIN_NAME) != IconsIndexer.PLUGIN_DB_FORMAT:
                self._destroy_indexer()
                self._initialize_indexer(True)
            else:
                self._initialize_indexer(False)

        self.widget = None
        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
Beispiel #22
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        self.index = self.window.ui.notebook.index  # XXX

        self.indexer = None
        self._indexing_enabled = plugin.preferences['enable_indexing']

        if self._indexing_enabled:
            if self.index.get_property(
                    IconsIndexer.PLUGIN_NAME) != IconsIndexer.PLUGIN_DB_FORMAT:
                self._destroy_indexer()
                self._initialize_indexer(True)
            else:
                self._initialize_indexer(False)

        self.widget = None
        self.on_preferences_changed(plugin.preferences)
        self.connectto(plugin.preferences, 'changed',
                       self.on_preferences_changed)
Beispiel #23
0
	def __init__(self, plugin, window, notebook_ext):
		WindowExtension.__init__(self, plugin, window)
		self.notebook_ext = notebook_ext
		self._autosave_thread = None

		if self.notebook_ext.vcs is None:
			gaction = self.actiongroup.get_action('show_versions')
			gaction.set_sensitive(False)
		else:
			if self.plugin.preferences['autosave']:
				self.do_save_version_async()

		def on_quit(o):
			if self._autosave_thread and not self._autosave_thread.done:
				self._autosave_thread.join()

			if self.plugin.preferences['autosave']:
				self.do_save_version()

		self.window.ui.connect('quit', on_quit) # XXX
Beispiel #24
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.widget = BookmarkBar(self.window.ui, self.uistate,
					  self.window.pageview.get_page)
		self.widget.show_all()

		# Add a new option to the Index popup menu.
		try:
			self.widget.connectto(self.window.pageindex.treeview,
								  'populate-popup', self.on_populate_popup)
		except AttributeError:
			logger.error('BookmarksBar: popup menu not initialized.')

		# Show/hide bookmarks.
		self.uistate.setdefault('show_bar', True)
		self.toggle_show_bookmarks(self.uistate['show_bar'])

		# Init preferences in self.widget.
		self.widget.on_preferences_changed(plugin.preferences)
		self.widget.connectto(plugin.preferences, 'changed',
							  lambda o: self.widget.on_preferences_changed(plugin.preferences))
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.widget = BookmarkBar(self.window.ui, self.uistate,
					  self.window.pageview.get_page)
		self.widget.show_all()

		# Add a new option to the Index popup menu.
		try:
			self.widget.connectto(self.window.pageindex.treeview,
								  'populate-popup', self.on_populate_popup)
		except AttributeError:
			logger.error('BookmarksBar: popup menu not initialized.')

		# Show/hide bookmarks.
		self.uistate.setdefault('show_bar', True)
		self.toggle_show_bookmarks(self.uistate['show_bar'])

		# Init preferences in self.widget.
		self.widget.on_preferences_changed(plugin.preferences)
		self.widget.connectto(plugin.preferences, 'changed',
							  lambda o: self.widget.on_preferences_changed(plugin.preferences))
Beispiel #26
0
	def __init__(self, plugin, window, notebook_ext):
		WindowExtension.__init__(self, plugin, window)
		self.notebook_ext = notebook_ext
		self._autosave_thread = None
		self._autosave_timer = None

		if self.notebook_ext.vcs is None:
			gaction = self.actiongroup.get_action('show_versions')
			gaction.set_sensitive(False)
		else:
			self.on_preferences_changed(None, start=True)

		def on_quit(o):
			self._stop_timer()

			if self.plugin.preferences['autosave'] \
			or self.plugin.preferences['autosave_at_interval']:
				self.do_save_version()

		self.window.ui.connect('quit', on_quit) # XXX

		self.connectto(self.plugin.preferences, 'changed',
			self.on_preferences_changed)
Beispiel #27
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.window.ui.hideonclose = True # XXX
		plugin.load_trayicon()
Beispiel #28
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     ObjectManager.register_object(OBJECT_TYPE_BIB, self.plugin.create_bib)
     ObjectManager.register_object(OBJECT_TYPE_REF, self.plugin.create_ref)
Beispiel #29
0
	def __init__(self, plugin, window, index_ext):
		WindowExtension.__init__(self, plugin, window)
		self.index_ext = index_ext
Beispiel #30
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.spell = None
		self.uistate.setdefault('active', False)
		self.toggle_spellcheck(self.uistate['active'])
		self.connectto(self.window.ui, 'open-page', order=SIGNAL_AFTER) # XXX
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
Beispiel #32
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)

		pageview = self.window.pageview
		pageview.register_image_generator_plugin(self, self.object_type)
Beispiel #33
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.window.ui.hideonclose = True  # XXX
     self.icon = StandAloneTrayIcon(self.window)
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.preferences = plugin.preferences
Beispiel #35
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.connectto(window.pageview.view, 'end-of-word')
     if not plugin.symbols:
         plugin.load_file()
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self._textview = self.window.pageview.view
		self._signal = None
		self._preferences = plugin.preferences
Beispiel #37
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.window.ui.hideonclose = True # XXX
		self.icon = StandAloneTrayIcon(self.window)
Beispiel #38
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.sidepane_widget = None
     self.on_preferences_changed(plugin)
     self.connectto(plugin, 'preferences-changed')
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.preferences = plugin.preferences
Beispiel #40
0
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        pageview = self.window.pageview
        pageview.register_image_generator_plugin(self, self.object_type)
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.widget = FloatingToC(self.window.ui, self.window.pageview) # XXX

		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
Beispiel #42
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		ObjectManager.register_object(OBJECT_TYPE, self.plugin.create_object)
Beispiel #43
0
 def __init__(self, plugin, window, index_ext):
     WindowExtension.__init__(self, plugin, window)
     self.index_ext = index_ext
Beispiel #44
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self.connectto(window.pageview.view, 'end-of-word')
		if not plugin.symbols:
			plugin.load_file()
Beispiel #45
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.context = TemplateContextDict({})
     self.context.update(build_template_functions())
Beispiel #46
0
 def __init__(self, plugin, window):
     WindowExtension.__init__(self, plugin, window)
     self.on_preferences_changed(plugin.preferences)
     self.connectto(plugin.preferences, 'changed',
                    self.on_preferences_changed)
     self.plugin = plugin
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
Beispiel #48
0
	def __init__(self, plugin, window):
		WindowExtension.__init__(self, plugin, window)
		self._widget = None
		self.currently_with_due = plugin.preferences['with_due']
		self.on_preferences_changed(plugin.preferences)
		self.connectto(plugin.preferences, 'changed', self.on_preferences_changed)
    def __init__(self, plugin, window):
        WindowExtension.__init__(self, plugin, window)

        # Define the bugtracker object as global, for the performance purpose
        plugin.bt = Mantis()