Make places results available in search
Places is one of the dash sections and it should be included in search results. Factor out the code for getting and updating the information about places from Places to PlacesManager. Introduce PlaceInfo class that contains information about the place and can be used by classes that display it in different ways. Rename classes so that their names are consistent with corresponding classes in appDisplay.js and docDisplay.js https://bugzilla.gnome.org/show_bug.cgi?id=599125
This commit is contained in:

committed by
Marina Zhurakhinskaya

parent
5ee72d807d
commit
585bfe5b5a
@ -14,7 +14,7 @@ const _ = Gettext.gettext;
|
||||
|
||||
const AppDisplay = imports.ui.appDisplay;
|
||||
const DocDisplay = imports.ui.docDisplay;
|
||||
const Places = imports.ui.places;
|
||||
const PlaceDisplay = imports.ui.placeDisplay;
|
||||
const GenericDisplay = imports.ui.genericDisplay;
|
||||
const Button = imports.ui.button;
|
||||
const Main = imports.ui.main;
|
||||
@ -60,6 +60,7 @@ PANE_BACKGROUND_COLOR.from_pixel(0x000000f4);
|
||||
const APPS = "apps";
|
||||
const PREFS = "prefs";
|
||||
const DOCS = "docs";
|
||||
const PLACES = "places";
|
||||
|
||||
/*
|
||||
* Returns the index in an array of a given length that is obtained
|
||||
@ -81,7 +82,8 @@ function _createDisplay(displayType) {
|
||||
return new AppDisplay.AppDisplay(true);
|
||||
else if (displayType == DOCS)
|
||||
return new DocDisplay.DocDisplay();
|
||||
|
||||
else if (displayType == PLACES)
|
||||
return new PlaceDisplay.PlaceDisplay();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -729,7 +731,7 @@ Dash.prototype = {
|
||||
/* Translators: This is in the sense of locations for documents,
|
||||
network locations, etc. */
|
||||
this._placesSection = new Section(_("PLACES"), true);
|
||||
let placesDisplay = new Places.Places();
|
||||
let placesDisplay = new PlaceDisplay.DashPlaceDisplay();
|
||||
this._placesSection.content.append(placesDisplay.actor, Big.BoxPackFlags.EXPAND);
|
||||
this.sectionArea.append(this._placesSection.actor, Big.BoxPackFlags.NONE);
|
||||
|
||||
@ -783,6 +785,11 @@ Dash.prototype = {
|
||||
title: _("RECENT DOCUMENTS"),
|
||||
header: null,
|
||||
resultArea: null
|
||||
},
|
||||
{ type: PLACES,
|
||||
title: _("PLACES"),
|
||||
header: null,
|
||||
resultArea: null
|
||||
}
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user