persistent details toggle patch
- From: "Ryan Probasco" <rprobasco novell com>
- To: "Joe Shaw" <JoeShaw ximian com>
- Cc: dashboard-hackers gnome org
- Subject: persistent details toggle patch
- Date: Tue, 03 Oct 2006 10:02:44 -0600
Hey Joe,
Here's a follow up patch to my last one. It makes the details toggle persist between sessions. I'm not entirely certain that I'm using the Conf object correctly but the change is pretty minimal, so it shouldn't be too hard to fix if necessary.
By the way, as I was adding this, it made me wonder if the 'sort by *' options should persist as well? I'd be happy to submit another patch for that (based on the changes in this one) if that's the right direction for Beagle.
Thanks,
-Ryan
Index: Util/Conf.cs
===================================================================
RCS file: /cvs/gnome/beagle/Util/Conf.cs,v
retrieving revision 1.32
diff -u -r1.32 Conf.cs
--- Util/Conf.cs 10 Aug 2006 19:05:53 -0000 1.32
+++ Util/Conf.cs 3 Oct 2006 14:46:52 -0000
@@ -369,7 +369,12 @@
get { return search_history; }
set { search_history = value; }
}
-
+
+ private bool show_details = true;
+ public bool ShowDetails {
+ get { return show_details; }
+ set { show_details = value; }
+ }
}
[ConfigSection (Name="daemon")]
Index: search/Search.cs
===================================================================
RCS file: /cvs/gnome/beagle/search/Search.cs,v
retrieving revision 1.32
diff -u -r1.32 Search.cs
--- search/Search.cs 1 Oct 2006 00:07:02 -0000 1.32
+++ search/Search.cs 3 Oct 2006 14:46:52 -0000
@@ -34,7 +34,7 @@
Search.ScopeType scope = ScopeType.Everything;
Search.SortType sort = SortType.Modified;
Search.TypeFilter filter = null;
- bool showDetails = true;
+ bool showDetails = Conf.Searching.ShowDetails;
XKeybinder keybinder = new XKeybinder ();
@@ -339,6 +339,7 @@
private void OnWindowDelete (object o, Gtk.DeleteEventArgs args)
{
+ Conf.Save();
if (IconEnabled) {
Hide ();
args.RetVal = true;
@@ -380,10 +381,14 @@
private void OnToggleDetails (bool active)
{
showDetails = active;
+
if (panes.Details != null)
panes.ToggleDetails (showDetails);
else
panes.ToggleDetails (false);
+
+ Conf.Searching.ShowDetails = showDetails;
+ Conf.Searching.SaveNeeded = true;
}
private void OnShowQuickTips ()
Index: search/UIManager.cs
===================================================================
RCS file: /cvs/gnome/beagle/search/UIManager.cs,v
retrieving revision 1.17
diff -u -r1.17 UIManager.cs
--- search/UIManager.cs 29 Sep 2006 19:15:51 -0000 1.17
+++ search/UIManager.cs 3 Oct 2006 14:46:52 -0000
@@ -219,7 +219,7 @@
view_entries = new ToggleActionEntry[] {
new ToggleActionEntry ("ShowDetails", null,
Catalog.GetString ("Show Details"), null, null,
- OnToggleDetails, true)
+ OnToggleDetails, Conf.Searching.ShowDetails)
};
actions.Add (view_entries);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]