~elementary-apps/pantheon-files/trunk

« back to all changes in this revision

Viewing changes to src/View/Sidebar.vala

  • Committer: jeremy at elementaryos
  • Date: 2014-11-13 20:24:33 UTC
  • mto: (1459.3.2 all-views-vala-local-find)
  • mto: This revision was merged to the branch mainline in revision 1643.
  • Revision ID: jeremy@elementaryos.org-20141113202433-zuus66rud9novcbq
Remove unnecessary comment lines, remove redundant files, remove or revise TODOs and FIXMEs, update about dialog authors list and AUTHORS file

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
            STORAGE_CATEGORY
32
32
        }
33
33
 
34
 
//        enum Marlin.OpenFlag {
35
 
//            DEFAULT,
36
 
//            NEW_TAB,
37
 
//            NEW_WINDOW
38
 
//        }
39
 
 
40
34
        private const int MAX_BOOKMARKS_DROPPED = 100;
41
35
        private const int ROOT_INDENTATION_XPAD = 2;
42
36
        private const int EJECT_BUTTON_XPAD = 12;
135
129
        bool display_all_bookmarks = false;
136
130
 
137
131
        public Sidebar (Marlin.View.Window window) {
138
 
//message ("New sidebar");
139
132
            init ();  //creates the Gtk.TreeModel store.
140
133
            this.last_selected_uri = null;
141
134
            this.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
614
607
            if (last_selected_uri != null)
615
608
                set_matching_selection (this.last_selected_uri);
616
609
            else
617
 
                //set_matching_selection  (this.slot_location);
618
610
                set_matching_selection  (slot_location);
619
611
        }
620
612
 
882
874
                if (drop_uri.has_prefix ("trash:///"))
883
875
                    actions &= Gdk.DragAction.MOVE;
884
876
 
885
 
                //real_action = Marlin.drag_drop_action_ask ((Gtk.Widget)tree_view, actions);
886
877
                real_action = dnd_handler.drag_drop_action_ask ((Gtk.Widget)tree_view, window, actions);
887
878
            }
888
879
 
1089
1080
 
1090
1081
        private void mount_volume (Volume volume, Gtk.MountOperation mount_op, Marlin.OpenFlag flags) {
1091
1082
            mounting = true;
1092
 
            //go_to_after_mount_flags = flags;
1093
 
            //Marlin.View.ViewContainer? ctab = window.current_tab;
1094
1083
            volume.mount.begin (GLib.MountMountFlags.NONE,
1095
1084
                                mount_op,
1096
1085
                                null,
1134
1123
        }
1135
1124
 
1136
1125
        private void rename_selected_bookmark () {
1137
 
//message ("rename selected bookmark");
1138
1126
            Gtk.TreeIter iter;
1139
1127
            if (!get_selected_iter ( out iter))
1140
1128
                return;
1500
1488
         * open in a new tab.
1501
1489
         */
1502
1490
        private bool key_press_event_cb (Gtk.Widget widget, Gdk.EventKey event) {
1503
 
//message ("side bar key press");
1504
1491
            Gdk.ModifierType modifiers = Gtk.accelerator_get_default_mod_mask ();
1505
1492
            if (event.keyval == Gdk.Key.Down
1506
1493
             && (event.state & modifiers) == Gdk.ModifierType.MOD1_MASK)
1578
1565
 
1579
1566
                tree_view.get_path_at_pos ((int)(event.x), (int)(event.y), out path, null, null, null);
1580
1567
 
1581
 
                if (path != null)
1582
 
                    open_selected_bookmark (store, path,
1583
 
                        //(event.state & Gdk.ModifierType.CONTROL_MASK) != 0 ? ViewWindowOpenFlags.NEW_TAB : ViewWindowOpenFlags.DEFAULT);
1584
 
                        (event.state & Gdk.ModifierType.CONTROL_MASK) != 0 ? Marlin.OpenFlag.NEW_TAB : Marlin.OpenFlag.DEFAULT);
 
1568
                if (path != null) {
 
1569
                    if ((event.state & Gdk.ModifierType.CONTROL_MASK) != 0)
 
1570
                        open_selected_bookmark (store, path, Marlin.OpenFlag.NEW_TAB);
 
1571
                    else
 
1572
                        open_selected_bookmark (store, path, Marlin.OpenFlag.DEFAULT);
 
1573
                }
1585
1574
            }
1586
1575
 
1587
1576
            return false;
1730
1719
                        drive.eject_with_operation.end (res);
1731
1720
                    }
1732
1721
                    catch (GLib.Error error) {
1733
 
                        //message ("Error ejecting drive: %s", error.message);
 
1722
                        warning ("Error ejecting drive: %s", error.message);
1734
1723
                    }
1735
1724
                    finish_eject_or_unmount (row_ref);
1736
1725
                });
1746
1735
                        volume.eject_with_operation.end (res);
1747
1736
                    }
1748
1737
                    catch (GLib.Error error) {
1749
 
                        //message ("Error ejecting volume: %s", error.message);
 
1738
                        warning ("Error ejecting volume: %s", error.message);
1750
1739
                    }
1751
1740
                    finish_eject_or_unmount (row_ref);
1752
1741
                });
1762
1751
                        mount.eject_with_operation.end (res);
1763
1752
                    }
1764
1753
                    catch (GLib.Error error) {
1765
 
                        //message ("Error ejecting mount: %s", error.message);
 
1754
                        warning ("Error ejecting mount: %s", error.message);
1766
1755
                    }
1767
1756
                    finish_eject_or_unmount (row_ref);
1768
1757
                });