Codebase list gnome-maps / c28cb59
sendToDialog: Ensure consistency when marker moves The Send To dialog now remembers the exact coordinates, not just the Place object, from when it was created. This way, if the place moves (such as a moving current location marker), the coordinates shown in the dialog remain the same as when the Send To button was pressed. Also, the map bubble now creates a new sendToDialog every time the Send To button is pressed, so that the latest marker position is shown in the dialog. James Westman 4 years ago
2 changed file(s) with 12 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
142142 }
143143
144144 _initSendToButton(button) {
145 let dialog = new SendToDialog.SendToDialog({ transient_for: this.get_toplevel(),
146 modal: true,
147 mapView: this._mapView,
148 place: this._place });
149145 button.visible = true;
150146 button.connect('clicked', () => {
151 dialog.connect('response', () => dialog.hide());
147 let dialog = new SendToDialog.SendToDialog({ transient_for: this.get_toplevel(),
148 modal: true,
149 mapView: this._mapView,
150 place: this._place });
151 dialog.connect('response', () => dialog.destroy());
152152 dialog.show();
153153 });
154154 }
5858
5959 _init(params) {
6060 this._place = params.place;
61 this._location = this._place.location;
6162 delete params.place;
6263
6364 this._mapView = params.mapView;
9495
9596 if (GWeather) {
9697 let world = GWeather.Location.get_world();
97 let location = this._place.location;
98 let location = this._location;
9899 this._city = world.find_nearest_city(location.latitude,
99100 location.longitude);
100101 /* Translators: The first string is the name of the city, the
156157 lines.push(details);
157158 }
158159
159 lines.push('%f, %f'.format(place.location.latitude,
160 place.location.longitude));
160 lines.push('%f, %f'.format(this._location.latitude,
161 this._location.longitude));
161162
162163 return lines.join('\n');
163164 }
173174 place.osm_id);
174175 } else {
175176 return '%s?mlat=%f&mlon=%f&zoom=%d'.format(base,
176 place.location.latitude,
177 place.location.longitude,
177 this._location.latitude,
178 this._location.longitude,
178179 view.zoom_level);
179180 }
180181 }
236237 new GLib.Variant('v', this._city.serialize()),
237238 timestamp);
238239 } else if (row instanceof OpenWithRow) {
239 let uri = this._place.location.to_uri(Geocode.LocationURIScheme.GEO);
240 let uri = this._location.to_uri(Geocode.LocationURIScheme.GEO);
240241 row.appinfo.launch_uris([ uri ], this._getAppLaunchContext());
241242 }
242243 this.response(Response.SUCCESS);