Commit c5852afb authored by Martyn Russell's avatar Martyn Russell

tracker-needle: Connect iconview selection change with tag-view update

parent c45fdc88
...@@ -344,8 +344,7 @@ public class Tracker.Needle { ...@@ -344,8 +344,7 @@ public class Tracker.Needle {
sw_icons = new Tracker.View (Tracker.View.Display.FILE_ICONS, null); sw_icons = new Tracker.View (Tracker.View.Display.FILE_ICONS, null);
iconview = (IconView) sw_icons.get_child (); iconview = (IconView) sw_icons.get_child ();
iconview.item_activated.connect (icon_item_activated); iconview.item_activated.connect (icon_item_activated);
//var iconselection = iconview.get_selection (); iconview.selection_changed.connect (icon_view_selection_changed);
//iconselection.changed.connect (icon_item_selected);
view.pack_start (sw_icons, true, true, 0); view.pack_start (sw_icons, true, true, 0);
// Set up tags widget // Set up tags widget
...@@ -619,6 +618,33 @@ public class Tracker.Needle { ...@@ -619,6 +618,33 @@ public class Tracker.Needle {
tags_view.set_files (uris); tags_view.set_files (uris);
} }
private void icon_view_selection_changed () {
IconView iconview;
TreeModel model = null;
debug ("Icon selection changed");
iconview = (IconView) sw_icons.get_child ();
model = iconview.get_model ();
List<string> uris = null;
iconview.selected_foreach ((iconview, path) => {
TreeIter iter;
if (model.get_iter (out iter, path)) {
string uri;
model.get (iter, 1, out uri, -1);
debug ("--> %s", uri);
if (uri != null) {
uris.prepend (uri);
}
}
});
tags_view.set_files (uris);
}
private void show_tags_clicked () { private void show_tags_clicked () {
if (show_tags.active) { if (show_tags.active) {
debug ("Showing tags"); debug ("Showing tags");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment