Zim

Comment 6 for bug 134736

Revision history for this message
Adam Porter (alphapapa) wrote : Re: [Bug 134736] Re: Integrate search in the side pane

Jaap, forgive me if I misunderstand, but does this only add an inline
search for the current page, or does it search across all pages? I
think the latter is what we are hoping to have in a side pane.

On Mon, Feb 18, 2013 at 9:47 AM, Jaap Karssenberg
<email address hidden> wrote:
> Code below can be added in "zim/gui/__init__.py" just below the call
> "self.uimanager.ensure_update()" (around line 540) and will add a search
> entry in the toolbar. In my mind this removes the need for adding search
> to the side pane, but open to suggestions.
>
>
> ###
> space = gtk.SeparatorToolItem()
> space.set_draw(False)
> space.set_expand(True)
> self.mainwindow.toolbar.insert(space, -1)
>
> def inline_search(entry, *a):
> text = entry.get_text()
> if text:
> self.show_search(text)
>
> from zim.gui.widgets import InputEntry
> entry = InputEntry()
> if gtk.gtk_version >= (2, 16):
> entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_FIND)
> entry.set_icon_activatable(gtk.ENTRY_ICON_SECONDARY, True)
> entry.set_icon_tooltip_text(gtk.ENTRY_ICON_SECONDARY, _('Search Pages...'))
> # FIXME would be nice to have function to set "Search" as grey background
> #entry.set_icon_to_clear()
> entry.connect('activate', inline_search)
> entry.connect('icon-release', inline_search)
> entry.show()
> item = gtk.ToolItem()
> item.add(entry)
> self.mainwindow.toolbar.insert(item, -1)
> ###
>
> ** Changed in: zim
> Status: Confirmed => In Progress
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/134736
>
> Title:
> Integrate search in the side pane
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zim/+bug/134736/+subscriptions