~elementary-apps/pantheon-files/trunk

« back to all changes in this revision

Viewing changes to src/View/Slot.vala

  • Committer: RabbitBot
  • Author(s): Fabio Zaramella
  • Date: 2015-07-22 14:01:44 UTC
  • mfrom: (1740.1.62 add-recent-view)
  • Revision ID: rabbitbot-20150722140144-mv23nsbnfrac9ved
Add a view for recently used files (lp:1083641)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        }
35
35
 
36
36
        public string empty_message = "<span size='x-large'>" + _("This folder is empty.") + "</span>";
 
37
        public string empty_recents = "<span size='x-large'>" + _("There are no recent files.") + "</span>";
37
38
        public string denied_message = "<span size='x-large'>" + _("Access denied") + "</span>";
38
39
 
39
40
        public signal bool horizontal_scroll_event (double delta_x);
48
49
        public signal void miller_slot_request (GLib.File file, bool make_root);
49
50
        public signal void size_change ();
50
51
 
51
 
 
52
52
        public Slot (GLib.File _location, Marlin.View.ViewContainer _ctab, Marlin.ViewMode _mode) {
53
53
            base.init ();
54
54
            ctab = _ctab;
162
162
        }
163
163
 
164
164
        public void autosize_slot () {
165
 
            if (dir_view == null ||
166
 
                !colpane.get_realized () ||
 
165
            if (dir_view == null || 
 
166
                !colpane.get_realized () || 
167
167
                has_autosized)
168
168
 
169
169
                return;
170
170
 
171
171
            Pango.Layout layout = dir_view.create_pango_layout (null);
172
172
 
173
 
            if (directory.is_empty ())
 
173
            if (directory.is_empty () && directory.location.get_uri_scheme () == "recent")
 
174
                layout.set_markup (empty_recents, -1);
 
175
            else if (directory.is_empty ())
174
176
                layout.set_markup (empty_message, -1);
175
177
            else if (directory.permission_denied)
176
178
                layout.set_markup (denied_message, -1);