beagle r4717 - trunk/beagle/search/Beagle.Search
- From: dbera svn gnome org
- To: svn-commits-list gnome org
- Subject: beagle r4717 - trunk/beagle/search/Beagle.Search
- Date: Fri, 18 Apr 2008 17:48:58 +0100 (BST)
Author: dbera
Date: Fri Apr 18 16:48:58 2008
New Revision: 4717
URL: http://svn.gnome.org/viewvc/beagle?rev=4717&view=rev
Log:
Show the search-domain menu always (and not only when EnableAvahi is set). Implement domain selection (ugly, needs work) in beagle-search.
Modified:
trunk/beagle/search/Beagle.Search/SearchWindow.cs
trunk/beagle/search/Beagle.Search/UIManager.cs
Modified: trunk/beagle/search/Beagle.Search/SearchWindow.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search/SearchWindow.cs (original)
+++ trunk/beagle/search/Beagle.Search/SearchWindow.cs Fri Apr 18 16:48:58 2008
@@ -7,6 +7,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Diagnostics;
using Gtk;
@@ -46,6 +47,7 @@
private Beagle.Search.ScopeType scope = ScopeType.Everything;
private Beagle.Search.SortType sort = SortType.Modified;
private Beagle.Search.TypeFilter filter = null;
+ private Dictionary<QueryDomain, bool> domains = null; // FIXME Overkill
// Whether we should grab focus from the text entry
private bool grab_focus = false;
@@ -178,6 +180,9 @@
pages.CurrentPage = pages.PageNum (quicktips);
}
+ domains = new Dictionary<QueryDomain, bool> (3);
+ domains [QueryDomain.Local] = true;
+
StartCheckingIndexingStatus ();
}
@@ -242,10 +247,15 @@
TotalMatches = 0;
current_query = new Query ();
- current_query.AddDomain (QueryDomain.Neighborhood);
-#if ENABLE_GOOGLEBACKENDS
- current_query.AddDomain (QueryDomain.Global);
-#endif
+
+ // FIXME This is ugly!
+ if (! domains.ContainsKey (QueryDomain.Local) || ! domains [QueryDomain.Local] )
+ current_query.RemoveDomain (QueryDomain.Local);
+ if (domains.ContainsKey (QueryDomain.Neighborhood) && domains [QueryDomain.Neighborhood])
+ current_query.AddDomain (QueryDomain.Neighborhood);
+ if (domains.ContainsKey (QueryDomain.Global) && domains [QueryDomain.Global])
+ current_query.AddDomain (QueryDomain.Global);
+
current_query.AddText (query);
current_query.HitsAddedEvent += OnHitsAdded;
current_query.HitsSubtractedEvent += OnHitsSubtracted;
@@ -366,17 +376,9 @@
private void OnDomainChanged (QueryDomain domain, bool active)
{
- if (current_query == null)
- return;
-
+ domains [domain] = active;
+
// FIXME: Most likely refire the query.
- // Also keep the setting, so it can be used for future queries
- // in this running instance.
-
- if (active)
- current_query.AddDomain (domain);
- else
- current_query.RemoveDomain (domain);
}
private void ShowInformation (Tiles.Tile tile)
Modified: trunk/beagle/search/Beagle.Search/UIManager.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search/UIManager.cs (original)
+++ trunk/beagle/search/Beagle.Search/UIManager.cs Fri Apr 18 16:48:58 2008
@@ -297,18 +297,13 @@
" <menuitem action='Feeds'/>" +
" <menuitem action='Archives'/>" +
" </menu>" +
-
-#if ENABLE_AVAHI || ENABLE_GOOGLEBACKENDS
" <menu action='Domain'>" +
" <menuitem action='Local'/>" +
-#if ENABLE_AVAHI
" <menuitem action='Neighborhood'/>" +
-#elif ENABLE_GOOGLEBACKENDS
+#if ENABLE_GOOGLEBACKENDS
" <menuitem action='Global'/>" +
#endif
" </menu>" +
-#endif
-
" <menuitem action='Preferences'/>" +
" <separator/>" +
" <menuitem action='Quit'/>" +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]