Exemple #1
0
    def create_search_entry(self):
        if has_sexy:
            self.search_entry = sexy.IconEntry()
            self.search_entry.set_icon(
                sexy.ICON_ENTRY_PRIMARY,
                gtk.image_new_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON))
            self.search_entry.add_clear_button()
        else:
            self.search_entry = gtk.Entry()

        self.search_entry.connect("changed", self.on_search_changed)

        toolitem = gtk.ToolItem()
        toolitem.add(self.search_entry)
        self.toolbar_top.insert(toolitem, 6)
        self.search_entry.show()
        toolitem.show()
        rc_style = self.search_entry.rc_get_style()
        self.entry_active_style = rc_style.copy()
        self.entry_active_style.base[gtk.STATE_NORMAL] = rc_style.base[
            gtk.STATE_SELECTED]
        self.entry_active_style.text[gtk.STATE_NORMAL] = rc_style.text[
            gtk.STATE_SELECTED]
        self.entry_active_style.base[gtk.STATE_ACTIVE] = rc_style.base[
            gtk.STATE_NORMAL]
        self.entry_active_style.text[gtk.STATE_ACTIVE] = rc_style.text[
            gtk.STATE_NORMAL]
        self.entry_active_style.base[gtk.STATE_SELECTED] = rc_style.base[
            gtk.STATE_ACTIVE]
        self.entry_active_style.text[gtk.STATE_SELECTED] = rc_style.text[
            gtk.STATE_ACTIVE]
	def prepare_new_widget(self):
		
		self.__glade_builder = gtk.Builder()
		self.__glade_builder.add_from_file(self.__glade_prefix+"WebClient.glade")
		
		self.__outerbox = self.__glade_builder.get_object("outerbox")
		self.__tb = self.__glade_builder.get_object("toolbar")
		
		self.__tb_back = gtk.ToolButton(gtk.STOCK_GO_BACK)
		self.__tb_back.connect("clicked",self.__tb_back_clicked)
		self.__tb.insert(self.__tb_back,-1)
		
		self.__tb_forward = gtk.ToolButton(gtk.STOCK_GO_FORWARD)
		self.__tb_forward.connect("clicked",self.__tb_forward_clicked)
		self.__tb.insert(self.__tb_forward,-1)
		
		self.__tb_reload = gtk.ToolButton(gtk.STOCK_REFRESH)
		self.__tb_reload.connect("clicked",self.__tb_reload_clicked)
		self.__tb.insert(self.__tb_reload,-1)
		
		self.__tb_stop = gtk.ToolButton(gtk.STOCK_STOP)
		self.__tb_stop.connect("clicked",self.__tb_stop_clicked)
		self.__tb.insert(self.__tb_stop,-1)
		
		self.__tb_address = gtk.ToolItem()
		self.__tb_address.set_expand(True)
		self.__tb_address_entry = sexy.IconEntry()
		self.__tb_address_entry_image = gtk.image_new_from_file("/usr/share/ude/components/16x16doc.svg")
		self.__tb_address_entry.set_icon(sexy.ICON_ENTRY_PRIMARY,self.__tb_address_entry_image)
		self.__tb_address_entry.connect("activate",self.__tb_address_entry_activate)
		self.__tb_address.add(self.__tb_address_entry)
		self.__tb.insert(self.__tb_address,-1)
		
		self.__wv = WebViewTab()
		self.__wv.connect("notify::uri",self.__wv_notify_uri)
		self.__wv.connect("notify::progress",self.__wv_notify_progress)
		self.__wv.connect("notify::load-status",self.__wv_notify_load_status)
		self.__wv.connect("notify::title",self.__wv_notify_title)
		self.__wv.connect("notify::icon-uri",self.__wv_notify_icon_uri)
		
		self.__wv.connect("load-error",self.__wv_load_error)
		self.__wv.connect("resource-request-starting",self.__wv_resource_request_starting)
		
		
		__wv_sw = gtk.ScrolledWindow()
		__wv_sw.add(self.__wv)
		self.__outerbox.pack_start(__wv_sw,expand=True,fill=True)
		
		return self.__outerbox
Exemple #3
0
    def __init__(self, ctrl):
        GtkInterface.__init__(self, ctrl)

        self._changeset = None

        self._window = gtk.Window()
        self._window.set_title("Smart Package Manager %s" % VERSION)
        self._window.set_position(gtk.WIN_POS_CENTER)
        self._window.set_geometry_hints(min_width=640, min_height=480)
        def delete(widget, event):
            gtk.main_quit()
            return True
        self._window.connect("delete-event", delete)

        self._log.set_transient_for(self._window)
        self._progress.set_transient_for(self._window)
        self._hassubprogress.set_transient_for(self._window)
        self._changes.set_transient_for(self._window)

        self._watch = gtk.gdk.Cursor(gtk.gdk.WATCH)

        self._undo = []
        self._redo = []

        self._topvbox = gtk.VBox()
        self._topvbox.show()
        self._window.add(self._topvbox)

        globals = {"self": self, "gtk": gtk}
        self._actions = gtk.ActionGroup("Actions")
        self._actions.add_actions(compileActions(ACTIONS, globals))

        self._filters = {}
        for name, label in [("hide-non-upgrades", _("Hide Non-upgrades")),
                            ("hide-non-newest", _("Hide Non-newest")),
                            ("hide-installed", _("Hide Installed")),
                            ("hide-uninstalled", _("Hide Uninstalled")),
                            ("hide-unmarked", _("Hide Unmarked")),
                            ("hide-unlocked", _("Hide Unlocked")),
                            ("hide-requested", _("Hide Requested")),
                            ("hide-old", _("Hide Old"))]:
            action = gtk.ToggleAction(name, label, "", "")
            action.connect("toggled", lambda x, y: self.toggleFilter(y), name)
            self._actions.add_action(action)

        treestyle = sysconf.get("package-tree")
        lastaction = None
        for name, label in [("groups", _("Groups")),
                            ("separate-groups", _("Separate Groups")),
                            ("channels", _("Channels")),
                            ("channels-groups", _("Channels & Groups")),
                            ("none", _("None"))]:
            action = gtk.RadioAction("tree-style-"+name, label, "", "", 0)
            if name == treestyle:
                action.set_active(True)
            if lastaction:
                action.set_group(lastaction)
            lastaction = action
            action.connect("toggled", lambda x, y: self.setTreeStyle(y), name)
            self._actions.add_action(action)

        self._ui = gtk.UIManager()
        self._ui.insert_action_group(self._actions, 0)
        self._ui.add_ui_from_string(UI)
        self._menubar = self._ui.get_widget("/menubar")
        self._topvbox.pack_start(self._menubar, False)

        self._toolbar = self._ui.get_widget("/toolbar")
        self._toolbar.set_style(gtk.TOOLBAR_ICONS)
        self._topvbox.pack_start(self._toolbar, False)
        if sysconf.getReadOnly():
           # Can't update channels in readonly mode.
           updatetoolitem = self._ui.get_widget("/toolbar/update-channels")
           updatetoolitem.set_property("sensitive", False)

        self._window.add_accel_group(self._ui.get_accel_group())

        self._execmenuitem = self._ui.get_action("/menubar/file/exec-changes")
        self._execmenuitem.set_property("sensitive", False)
        self._clearmenuitem = self._ui.get_action("/menubar/edit/clear-changes")
        self._clearmenuitem.set_property("sensitive", False)
        self._undomenuitem = self._ui.get_action("/menubar/edit/undo")
        self._undomenuitem.set_property("sensitive", False)
        self._redomenuitem = self._ui.get_action("/menubar/edit/redo")
        self._redomenuitem.set_property("sensitive", False)

        # Search bar

        if gtk.gtk_version >= (2, 16, 0) or sexy:
            self._searchbar = gtk.ToolItem()
            self._searchbar.set_expand(True)
            self._searchbar.set_homogeneous(False)
            self._searchbar.show()
            count = self._toolbar.get_n_items()
            find = self._toolbar.get_nth_item(count - 1)
            self._toolbar.remove(find)
            self._toolbar.insert(self._searchbar, -1)

            searchtable = gtk.Table(1, 1)
            searchtable.set_row_spacings(5)
            searchtable.set_col_spacings(5)
            searchtable.set_border_width(5)
            searchtable.show()
            self._searchbar.add(searchtable)

            if gtk.gtk_version >= (2, 16, 0):
                self._searchentry = gtk.Entry()
                self._searchentry.set_property("primary-icon-name", "gtk-find")
                self._searchentry.set_property("secondary-icon-name", "gtk-clear")
                def press(entry, icon_pos, event):
                    if int(icon_pos) == 0: # "primary"
                        self._searchmenu.popup(None, None, None, event.button, event.time)
                    elif int(icon_pos) == 1: # "secondary"
                        self._searchentry.set_text("")
                        self.refreshPackages()
                self._searchentry.connect("icon-press", press)
            elif sexy:
                self._searchentry = sexy.IconEntry()
                image = gtk.Image()
                image.set_from_stock("gtk-find", gtk.ICON_SIZE_BUTTON)
                self._searchentry.set_icon(sexy.ICON_ENTRY_PRIMARY, image)
                image = gtk.Image()
                image.set_from_stock("gtk-clear", gtk.ICON_SIZE_BUTTON)
                self._searchentry.set_icon(sexy.ICON_ENTRY_SECONDARY, image)
                def pressed(entry, icon_pos, button):
                    if icon_pos == 0: # "primary"
                        self._searchmenu.popup(None, None, None, button, gtk.get_current_event_time())
                    elif icon_pos == 1: # "secondary"
                        self._searchentry.set_text("")
                        self.refreshPackages()
                self._searchentry.connect("icon-pressed", pressed)
            self._searchentry.connect("activate", lambda x: self.refreshPackages())
            self._searchentry.show()
            searchtable.attach(self._searchentry, 0, 1, 0, 1)

            self._searchmenu = gtk.Menu()
            self._searchname = gtk.CheckMenuItem(_("Automatic"))
            self._searchname.set_draw_as_radio(True)
            self._searchname.set_active(True)
            def search_automatic(item):
                self._searchdesc.set_active(not item.get_active())
                self.refreshPackages()
            self._searchname.connect("activate", search_automatic)
            self._searchname.show()
            self._searchmenu.append(self._searchname)
            self._searchdesc = gtk.CheckMenuItem(_("Description"))
            self._searchdesc.set_draw_as_radio(True)
            self._searchdesc.set_active(False)
            def search_description(item):
                self._searchname.set_active(not item.get_active())
                self.refreshPackages()
            self._searchdesc.connect("activate", search_description)
            self._searchdesc.show()
            self._searchmenu.append(self._searchdesc)
        else:
            self._searchbar = gtk.Alignment()
            self._searchbar.set(0, 0, 1, 1)
            self._searchbar.set_padding(3, 3, 0, 0)
            self._topvbox.pack_start(self._searchbar, False)

            searchvp = gtk.Viewport()
            searchvp.set_shadow_type(gtk.SHADOW_OUT)
            searchvp.show()
            self._searchbar.add(searchvp)

            searchtable = gtk.Table(1, 1)
            searchtable.set_row_spacings(5)
            searchtable.set_col_spacings(5)
            searchtable.set_border_width(5)
            searchtable.show()
            searchvp.add(searchtable)

            label = gtk.Label(_("Search:"))
            label.show()
            searchtable.attach(label, 0, 1, 0, 1, 0, 0)

            self._searchentry = gtk.Entry()
            self._searchentry.connect("activate", lambda x: self.refreshPackages())
            self._searchentry.show()
            searchtable.attach(self._searchentry, 1, 2, 0, 1)

            button = gtk.Button()
            button.set_relief(gtk.RELIEF_NONE)
            button.connect("clicked", lambda x: self.refreshPackages())
            button.show()
            searchtable.attach(button, 2, 3, 0, 1, 0, 0)
            image = gtk.Image()
            image.set_from_stock("gtk-find", gtk.ICON_SIZE_BUTTON)
            image.show()
            button.add(image)

            align = gtk.Alignment()
            align.set(1, 0, 0, 0)
            align.set_padding(0, 0, 10, 0)
            align.show()
            searchtable.attach(align, 3, 4, 0, 1, gtk.FILL, gtk.FILL)
            button = gtk.Button()
            button.set_size_request(20, 20)
            button.set_relief(gtk.RELIEF_NONE)
            button.connect("clicked", lambda x: self.toggleSearch())
            button.show()
            align.add(button)
            image = gtk.Image()
            image.set_from_stock("gtk-close", gtk.ICON_SIZE_MENU)
            image.show()
            button.add(image)

            hbox = gtk.HBox()
            hbox.set_spacing(10)
            hbox.show()
            searchtable.attach(hbox, 1, 2, 1, 2)

            self._searchmenu = None
            self._searchname = gtk.RadioButton(None, _("Automatic"))
            self._searchname.set_active(True)
            self._searchname.connect("clicked", lambda x: self.refreshPackages())
            self._searchname.show()
            hbox.pack_start(self._searchname, False)
            self._searchdesc = gtk.RadioButton(self._searchname, _("Description"))
            self._searchdesc.connect("clicked", lambda x: self.refreshPackages())
            self._searchdesc.show()
            hbox.pack_start(self._searchdesc, False)

        # Packages and information

        self._hpaned = gtk.HPaned()
        self._hpaned.show()
        self._topvbox.pack_start(self._hpaned)

        scrollwin = gtk.ScrolledWindow()
        scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        scrollwin.set_shadow_type(gtk.SHADOW_IN)
        self._hpaned.pack1(scrollwin, True)

        self._pg = gtk.TreeView()
        def group_selected(treeview):
            self.refreshPackages()
        self._pg.connect("cursor_changed", group_selected)
        self._pg.show()
        scrollwin.add(self._pg)

        selection = self._pg.get_selection()
        selection.set_mode(gtk.SELECTION_MULTIPLE)

        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn(_("Group"), renderer, text=1)
        self._pg.append_column(column)

        self._vpaned = gtk.VPaned()
        self._vpaned.show()
        self._hpaned.pack2(self._vpaned, True)

        self._pv = GtkPackageView()
        self._pv.show()
        self._vpaned.pack1(self._pv, True)

        self._pi = GtkPackageInfo()
        self._pi.show()
        self._pv.connect("package_selected",
                         lambda x, y: self._pi.setPackage(y))
        self._pv.connect("package_activated",
                         lambda x, y: self.actOnPackages(y))
        self._pv.connect("package_popup", self.packagePopup)
        self._vpaned.pack2(self._pi, False)

        self._status = gtk.Statusbar()
        self._status.show()
        self._topvbox.pack_start(self._status, False)
        
        self._legend = GtkLegend()
Exemple #4
0
    def __init__(self):
        gtk.Alignment.__init__(self, 0.5, 0.5, 1.0, 1.0)

        self._pkg = None
        self._changeset = None

        font = self.style.font_desc.copy()
        font.set_size(font.get_size() - pango.SCALE)

        boldfont = font.copy()
        boldfont.set_weight(pango.WEIGHT_BOLD)

        if sysconf.get("gtk-description-fontsize"):
            fontsize = int(sysconf.get("gtk-description-fontsize"))

            descfont = self.style.font_desc.copy()
            descfont.set_size(fontsize * pango.SCALE)

            bolddescfont = descfont.copy()
            bolddescfont.set_weight(pango.WEIGHT_BOLD)
        else:
            descfont = font
            bolddescfont = boldfont

        self._notebook = gtk.Notebook()
        self._notebook.show()
        self.add(self._notebook)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        #sw.set_border_width(5)
        sw.show()

        table = gtk.Table()
        table.set_row_spacings(2)
        table.set_col_spacings(5)
        table.set_border_width(5)
        table.show()
        sw.add_with_viewport(table)

        self._info = type("Info", (), {})()

        attrsleft = pango.AttrList()
        attrsleft.insert(pango.AttrFontDesc(font, 0, -1))
        attrsright = pango.AttrList()
        attrsright.insert(pango.AttrFontDesc(boldfont, 0, -1))

        style = sw.get_style()
        bgcolor = style.bg[gtk.STATE_NORMAL]

        self._reftv = gtk.TextView()
        self._reftv.modify_base(gtk.STATE_NORMAL, bgcolor)
        self._reftv.set_editable(False)
        self._reftv.set_cursor_visible(False)
        self._reftv.connect("motion-notify-event", self.motion_notify_event)
        self._reftv.connect("event-after", self.event_after)
        self._reftv.show()
        self._reftv.get_buffer().create_tag("reference", font_desc=font)

        row = 0
        for attr, text in [("status", _("Status:")),
                           ("priority", _("Priority:")),
                           ("group", _("Group:")),
                           ("installedsize", _("Installed Size:")),
                           ("channels", _("Channels:")),
                           ("reference", _("Reference URLs:"))]:
            label = gtk.Label(text)
            label.set_attributes(attrsleft)
            if attr == "channels":
                label.set_alignment(1.0, 0.0)
            else:
                label.set_alignment(1.0, 0.5)
            label.show()
            table.attach(label, 0, 1, row, row + 1, gtk.FILL, gtk.FILL)
            setattr(self._info, attr + "_label", label)
            if attr == "reference":
                label = self._reftv
            else:
                label = gtk.Label()
                label.set_attributes(attrsright)
                label.set_alignment(0.0, 0.5)
            label.show()
            table.attach(label, 1, 2, row, row + 1, gtk.FILL, gtk.FILL)
            setattr(self._info, attr, label)
            row += 1

        label = gtk.Label(_("General"))
        self._notebook.append_page(sw, label)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        sw.set_shadow_type(gtk.SHADOW_IN)
        sw.set_border_width(5)
        sw.show()

        self._descrtv = gtk.TextView()
        self._descrtv.set_editable(False)
        self._descrtv.set_cursor_visible(False)
        self._descrtv.set_left_margin(5)
        self._descrtv.set_right_margin(5)
        self._descrtv.show()
        buffer = self._descrtv.get_buffer()
        buffer.create_tag("description", font_desc=descfont)
        buffer.create_tag("summary", font_desc=bolddescfont)
        sw.add(self._descrtv)

        label = gtk.Label(_("Description"))
        self._notebook.append_page(sw, label)

        vbox = gtk.VBox()
        vbox.show()

        filtertable = gtk.Table(1, 1)
        filtertable.set_row_spacings(5)
        filtertable.set_col_spacings(5)
        filtertable.set_border_width(5)
        filtertable.show()
        vbox.pack_end(filtertable, False)

        label = gtk.Label(_("Filter:"))
        label.show()
        filtertable.attach(label, 0, 1, 0, 1, 0, 0)

        if gtk.gtk_version >= (2, 16, 0) or not sexy:
            self._filterentry = gtk.Entry()
        else:
            self._filterentry = sexy.IconEntry()
        self._filterentry.connect("activate", lambda x: self.filterContent())
        self._filterentry.show()
        filtertable.attach(self._filterentry, 1, 2, 0, 1)

        align = gtk.Alignment()
        align.set(1, 0, 0, 0)
        align.set_padding(0, 0, 10, 0)
        align.show()
        filtertable.attach(align, 2, 3, 0, 1, gtk.FILL, gtk.FILL)

        if gtk.gtk_version >= (2, 16, 0):
            self._filterentry.set_property("primary-icon-stock", "gtk-find")
            self._filterentry.set_property("secondary-icon-stock", "gtk-clear")

            def press(entry, icon_pos, event):
                if int(icon_pos) == 0:  # "primary"
                    self.filterContent()
                elif int(icon_pos) == 1:  # "secondary"
                    self.filterClear()

            self._filterentry.connect("icon-press", press)
        elif sexy:
            image = gtk.Image()
            image.set_from_stock("gtk-find", gtk.ICON_SIZE_BUTTON)
            self._filterentry.set_icon(sexy.ICON_ENTRY_PRIMARY, image)
            image = gtk.Image()
            image.set_from_stock("gtk-clear", gtk.ICON_SIZE_BUTTON)
            self._filterentry.set_icon(sexy.ICON_ENTRY_SECONDARY, image)

            def pressed(entry, icon_pos, button):
                if icon_pos == 0:  # "primary"
                    self.filterContent()
                elif icon_pos == 1:  # "secondary"
                    self.filterClear()

            self._filterentry.connect("icon-pressed", pressed)
        else:
            button = gtk.Button()
            button.set_relief(gtk.RELIEF_NONE)
            button.connect("clicked", lambda x: self.filterContent())
            button.show()
            filtertable.attach(button, 3, 4, 0, 1, 0, 0)
            image = gtk.Image()
            image.set_from_stock("gtk-find", gtk.ICON_SIZE_BUTTON)
            image.show()
            button.add(image)

            button = gtk.Button()
            button.set_relief(gtk.RELIEF_NONE)
            button.connect("clicked", lambda x: self.filterClear())
            button.show()
            filtertable.attach(button, 4, 5, 0, 1, 0, 0)
            image = gtk.Image()
            image.set_from_stock("gtk-clear", gtk.ICON_SIZE_BUTTON)
            image.show()
            button.add(image)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        sw.set_shadow_type(gtk.SHADOW_IN)
        sw.set_border_width(5)
        sw.show()

        self._conttv = gtk.TextView()
        self._conttv.set_editable(False)
        self._conttv.set_cursor_visible(False)
        self._conttv.set_left_margin(5)
        self._conttv.set_right_margin(5)
        self._conttv.show()
        buffer = self._conttv.get_buffer()
        buffer.create_tag("content", font_desc=font)
        sw.add(self._conttv)

        vbox.add(sw)

        label = gtk.Label(_("Content"))
        self._notebook.append_page(vbox, label)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        sw.set_shadow_type(gtk.SHADOW_IN)
        sw.set_border_width(5)
        sw.show()

        self._change = gtk.TextView()
        self._change.set_editable(False)
        self._change.set_cursor_visible(False)
        self._change.set_left_margin(5)
        self._change.set_right_margin(5)
        self._change.show()
        buffer = self._change.get_buffer()
        buffer.create_tag("changetime", font_desc=boldfont)
        buffer.create_tag("changelog", font_desc=font)
        sw.add(self._change)

        label = gtk.Label(_("Changelog"))
        self._notebook.append_page(sw, label)

        self._relations = GtkPackageView()
        self._relations.set_border_width(5)
        self._relations.getTreeView().set_headers_visible(False)
        self._relations.show()

        label = gtk.Label(_("Relations"))
        self._notebook.append_page(self._relations, label)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.set_border_width(5)
        sw.set_shadow_type(gtk.SHADOW_IN)
        sw.show()

        model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
                              gobject.TYPE_STRING)
        self._urls = gtk.TreeView(model)
        self._urls.set_headers_visible(False)
        self._urls.show()
        renderer = gtk.CellRendererText()
        renderer.set_property("font-desc", font)
        self._urls.insert_column_with_attributes(-1,
                                                 _("Channel"),
                                                 renderer,
                                                 text=0)
        self._urls.insert_column_with_attributes(-1,
                                                 _("Size"),
                                                 renderer,
                                                 text=1)
        self._urls.insert_column_with_attributes(-1,
                                                 _("URL"),
                                                 renderer,
                                                 text=2)
        sw.add(self._urls)

        label = gtk.Label(_("URLs"))
        self._notebook.append_page(sw, label)

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
        sw.set_shadow_type(gtk.SHADOW_IN)
        sw.set_border_width(5)
        sw.show()

        self._notebook.connect("switch_page", self._switchPage)
        self._notebook.set_current_page(sysconf.get("gtk-starting-tab", 0))
Exemple #5
0
    def __init__(self, plugin):
        gtk.Window.__init__(self)

        self._plugin = plugin

        self.set_title('Go to File')
        self.set_default_size(300, 250)
        self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_UTILITY)
        self.set_position(gtk.WIN_POS_CENTER)  # _ON_PARENT
        self.connect('show', self._windowShow)
        self.connect('delete-event', self._windowDeleteEvent)

        theme = gtk.icon_theme_get_default()
        searchPixbuf = theme.load_icon('search', 16,
                                       gtk.ICON_LOOKUP_USE_BUILTIN)

        self._entry = sexy.IconEntry()
        self._entry.add_clear_button()
        self._entry.set_icon(sexy.ICON_ENTRY_PRIMARY,
                             gtk.image_new_from_pixbuf(searchPixbuf))
        self._entry.connect('changed', self._entryChanged)
        self._entry.connect('key-press-event', self._entryKeyPress)
        self._entry.connect('activate', self._entryActivated)

        cell = gtk.CellRendererText()
        cell.set_property('ellipsize', pango.ELLIPSIZE_START)

        self._tree = gtk.TreeView()
        self._tree.set_headers_visible(False)
        self._tree.append_column(gtk.TreeViewColumn("Name", cell, markup=0))
        self._tree.connect('button-press-event', self._treeButtonPress)
        self._tree.get_selection().connect('changed',
                                           self._treeSelectionChanged)

        # Model columns: formattedName, formattedPath, path, score
        self._store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,
                                    gobject.TYPE_STRING, gobject.TYPE_FLOAT)

        self._sortModel = gtk.TreeModelSort(self._store)
        self._sortModel.set_sort_column_id(3, gtk.SORT_DESCENDING)
        self._tree.set_model(self._sortModel)

        vbox = gtk.VBox()

        alignment = gtk.Alignment(0, 0, 1, 1)
        alignment.set_padding(6, 6, 6, 6)
        alignment.add(self._entry)
        vbox.pack_start(alignment, False, False, 0)

        vbox.pack_start(gtk.HSeparator(), False, False, 0)

        swindow = gtk.ScrolledWindow()
        swindow.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        swindow.add(self._tree)
        vbox.pack_start(swindow, True, True, 0)

        vbox.pack_start(gtk.HSeparator(), False, False, 0)

        label = gtk.Label()
        #label.set_ellipsize(pango.ELLIPSIZE_START)
        self._expander = gtk.Expander(None)
        self._expander.set_label_widget(label)

        table = gtk.Table(2, 3, False)
        table.set_property('row-spacing', 6)
        table.set_property('column-spacing', 6)
        table.set_border_width(6)
        table.attach(gtk.Label("Include:"), 0, 1, 0, 1, gtk.SHRINK, gtk.SHRINK,
                     0, 0)
        self._includeFilterEntry = gtk.Entry()
        self._includeFilterEntry.set_text(self._plugin.getIncludeFilter())
        self._includeFilterEntry.connect('changed', self._filtersChanged)
        table.attach(self._includeFilterEntry, 1, 2, 0, 1,
                     gtk.FILL | gtk.EXPAND, gtk.SHRINK, 0, 0)

        table.attach(gtk.Label("Exclude:"), 0, 1, 1, 2, gtk.SHRINK, gtk.SHRINK,
                     0, 0)
        self._excludeFilterEntry = gtk.Entry()
        self._excludeFilterEntry.set_text(self._plugin.getExcludeFilter())
        self._excludeFilterEntry.connect('changed', self._filtersChanged)
        table.attach(self._excludeFilterEntry, 1, 2, 1, 2,
                     gtk.FILL | gtk.EXPAND, gtk.SHRINK, 0, 0)

        self._showHiddenCheck = gtk.CheckButton("Show hidden files/folders")
        self._showHiddenCheck.connect('toggled', self._filtersChanged)
        table.attach(self._showHiddenCheck, 0, 2, 2, 3, gtk.FILL | gtk.EXPAND,
                     gtk.SHRINK, 0, 0)

        self._expander.add(table)

        vbox.pack_start(self._expander, False, False, 0)

        self.add(vbox)

        try:
            import texas
            self._walker = texas.WalkerTexasRanger(self._onWalkResult,
                                                   self._onWalkClear,
                                                   self._onWalkFinish)
        except:
            print "async walker not available"
            import moonwalk
            self._walker = moonwalk.MoonWalker(self._onWalkResult,
                                               self._onWalkClear,
                                               self._onWalkFinish)