summaryrefslogtreecommitdiff
path: root/src/searches/Branch.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:14:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:14:53 +0200
commitc43dfb815a4951b8248f4f0e98babe4f80204f03 (patch)
tree82745ed2353757c41ea1865bad9ac7a1b0a8a366 /src/searches/Branch.vala
parent2785a691b958a79a1dd606c445188c71c3f58b3c (diff)
Imported Upstream version 0.22.0upstream/0.22.0
Diffstat (limited to 'src/searches/Branch.vala')
-rw-r--r--src/searches/Branch.vala20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/searches/Branch.vala b/src/searches/Branch.vala
index 229c710..00a9ea7 100644
--- a/src/searches/Branch.vala
+++ b/src/searches/Branch.vala
@@ -1,4 +1,4 @@
-/* Copyright 2011-2014 Yorba Foundation
+/* Copyright 2011-2015 Yorba Foundation
*
* This software is licensed under the GNU LGPL (version 2.1 or later).
* See the COPYING file in this distribution.
@@ -9,7 +9,7 @@ public class Searches.Branch : Sidebar.Branch {
new Gee.HashMap<SavedSearch, Searches.SidebarEntry>();
public Branch() {
- base (new Searches.Grouping(),
+ base (new Searches.Header(),
Sidebar.Branch.Options.HIDE_IF_EMPTY
| Sidebar.Branch.Options.AUTO_OPEN_ON_NEW_CHILD
| Sidebar.Branch.Options.STARTUP_EXPAND_TO_FIRST_CHILD,
@@ -60,12 +60,12 @@ public class Searches.Branch : Sidebar.Branch {
}
}
-public class Searches.Grouping : Sidebar.Grouping, Sidebar.Contextable {
+public class Searches.Header : Sidebar.Header, Sidebar.Contextable {
private Gtk.UIManager ui = new Gtk.UIManager();
private Gtk.Menu? context_menu = null;
- public Grouping() {
- base (_("Saved Searches"), new ThemedIcon(Gtk.Stock.FIND));
+ public Header() {
+ base (_("Saved Searches"));
setup_context_menu();
}
@@ -104,7 +104,7 @@ public class Searches.Grouping : Sidebar.Grouping, Sidebar.Contextable {
public class Searches.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.RenameableEntry,
Sidebar.DestroyableEntry {
- private static Icon single_search_icon;
+ private static string single_search_icon = "find";
private SavedSearch search;
@@ -113,11 +113,9 @@ public class Searches.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.Renameable
}
internal static void init() {
- single_search_icon = new ThemedIcon(Gtk.Stock.FIND);
}
internal static void terminate() {
- single_search_icon = null;
}
public SavedSearch for_saved_search() {
@@ -128,7 +126,7 @@ public class Searches.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.Renameable
return search.get_name();
}
- public override Icon? get_sidebar_icon() {
+ public override string? get_sidebar_icon() {
return single_search_icon;
}
@@ -136,6 +134,10 @@ public class Searches.SidebarEntry : Sidebar.SimplePageEntry, Sidebar.Renameable
return new SavedSearchPage(search);
}
+ public bool is_user_renameable() {
+ return true;
+ }
+
public void rename(string new_name) {
if (!SavedSearchTable.get_instance().exists(new_name))
AppWindow.get_command_manager().execute(new RenameSavedSearchCommand(search, new_name));