Skip to content
Commits on Source (25)
43.1 - Oct 22. 2022
=========================
Changes since 43.0
- Fixing various issues left after the GTK 4 port
- Fix setting adaptive narrow (phone) mode on first launch on portrait
displays
- Fix dragging-and-dropping route entris in the sidebar
- Fix opening shapelayer files when dragged-and-dropped onto the main window
- Fix selecting turnpoint instructions showing the position of the
instruction on the map
- Fix local tiles (using the --local command-line option)
- Fix location service dialog
- Fix send-to dialog
Added/updated/fixed translations
- Italian
- Icelandic
- Slovak
- Abkhazian
- Friulian
- Nepali
- Kazakh
All contributors to this release
Baurzhan Muftakhidinov <baurthefirst@gmail.com>
Dušan Kazik <prescott66@gmail.com>
Fabio Tomat <f.t.public@gmail.com>
Gianvito Cavasoli <gianvito@gmx.it>
Marcus Lundblad <ml@dfupdate.se>
Nart Tlisha <daniel.abzakh@gmail.com>
Pawan Chitrakar <chautari@gmail.com>
Sveinn í Felli <sv1@fellsnet.is>
43.0 - Sep 17, 2022
=========================
......
......@@ -31,6 +31,20 @@
</screenshot>
</screenshots>
<releases>
<release date="2022-10-22" version="43.1">
<description>
<ul>
<li>Fixing various issues left after the GTK 4 port</li>
<li>Fix setting adaptive narrow (phone) mode on first launch on portrait displays</li>
<li>Fix dragging-and-dropping route entris in the sidebar</li>
<li>Fix opening shapelayer files when dragged-and-dropped onto the main window</li>
<li>Fix selecting turnpoint instructions showing the position of the instruction on the map</li>
<li>Fix local tiles (using the --local command-line option)</li>
<li>Fix location service dialog</li>
<li>Fix send-to dialog</li>
</ul>
</description>
</release>
<release date="2022-09-17" version="43.0">
<description>
<ul>
......
......@@ -22,7 +22,7 @@
<description>The type of map to display (street, aerial, etc.)</description>
</key>
<key name="window-size" type="ai">
<default>[768, 600]</default>
<default>[]</default>
<summary>Window size</summary>
<description>Window size (width and height).</description>
</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.12"/>
<requires lib="gtk" version="4.0"/>
<template class="Gjs_LocationServiceDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="type">popup</property>
<property name="type_hint">dialog</property>
<property name="width_request">400</property>
<property name="height_request">150</property>
<child internal-child="vbox">
<object class="GtkBox" id="contentArea">
<property name="visible">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Turn on location services to find your location</property>
</object>
</child>
</object>
</child>
<child type="titlebar">
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerBar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="show-close-button">False</property>
<child>
<property name="show-title-buttons">0</property>
<child type="start">
<object class="GtkButton" id="cancelButton">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="1">Cancel</property>
<property name="focusable">1</property>
</object>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
<child>
<child type="end">
<object class="GtkButton" id="settingsButton">
<property name="label" translatable="yes">Location Settings</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="label" translatable="1">Location Settings</property>
<property name="focusable">1</property>
<property name="receives_default">1</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="contentArea">
<child>
<object class="GtkLabel">
<property name="label" translatable="1">Turn on location services to find your location</property>
</object>
</child>
</object>
</child>
......
......@@ -24,8 +24,6 @@
</section>
</menu>
<template class="Gjs_MainWindow" parent="GtkApplicationWindow">
<property name="width-request">300</property>
<property name="height-request">500</property>
<property name="title" translatable="1">Maps</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerBar">
......
......@@ -470,15 +470,14 @@ on_file_load (GObject *source_object,
FillTileData *data = g_task_get_task_data (task);
char *contents;
gsize length;
GBytes *bytes;
g_file_load_contents_finish (data->file, res, &contents, &length, NULL, NULL);
if (contents != NULL)
{
bytes = g_bytes_new_take (contents, length);
data->bytes = g_bytes_new_take (contents, length);
g_signal_emit_by_name (data->self, "received-data", data->x, data->y, data->z, data->bytes);
g_task_return_pointer (task, g_steal_pointer (&bytes), (GDestroyNotify)g_bytes_unref);
g_task_return_pointer (task, g_steal_pointer (&data->bytes), (GDestroyNotify)g_bytes_unref);
}
}
......
project('gnome-maps', 'c',
version: '43.0',
version: '43.1',
license: 'GPL-2.0-or-later',
meson_version: '>= 0.61.0',
)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -305,7 +305,7 @@ export class Application extends Adw.Application {
if (options.contains('local')) {
let variant = options.lookup_value('local', null);
this.local_tile_path = variant.deep_unpack();
normalStartup = false;
Application.normalStartup = false;
if (options.contains('local-tile-size')) {
variant = options.lookup_value('local-tile-size', null);
this.local_tile_size = variant.deep_unpack();
......
......@@ -27,7 +27,7 @@ import Gtk from 'gi://Gtk';
import * as Utils from './utils.js';
const _PRIVACY_PANEL = 'gnome-privacy-panel.desktop';
const _PRIVACY_PANEL = 'gnome-location-panel.desktop';
export class LocationServiceDialog extends Gtk.Dialog {
......
......@@ -177,7 +177,11 @@ export class MainWindow extends Gtk.ApplicationWindow {
this.add_controller(this._dropTarget);
this._dropTarget.connect('drop', (target, value, x, y, data) => {
return this._mapView.openShapeLayers([value]);
let list = new Gio.ListStore(Gio.File.Gtype);
list.insert(0, value);
return this._mapView.openShapeLayers(list);
});
}
......@@ -326,26 +330,34 @@ export class MainWindow extends Gtk.ApplicationWindow {
this._actionBarRight = new HeaderBarRight({ mapView: this._mapView });
this._actionBar.pack_end(this._actionBarRight);
// update adaptive status based on initial geometry
this._updateAdaptiveMode();
this.connect('notify::default-width', () => {
let width = this.default_width;
if (width < _ADAPTIVE_VIEW_WIDTH) {
this.application.adaptive_mode = true;
this._headerBarLeft.hide();
this._headerBarRight.hide();
this._actionBarRevealer.set_reveal_child(true);
this._placeEntry.set_margin_start(0);
this._placeEntry.set_margin_end(0);
} else {
this.application.adaptive_mode = false;
this._headerBarLeft.show();
this._headerBarRight.show();
this._actionBarRevealer.set_reveal_child(false);
this._placeEntry.set_margin_start(_PLACE_ENTRY_MARGIN);
this._placeEntry.set_margin_end(_PLACE_ENTRY_MARGIN);
}
this._updateAdaptiveMode();
});
}
_updateAdaptiveMode() {
let width = this.default_width;
if (width < _ADAPTIVE_VIEW_WIDTH) {
this.application.adaptive_mode = true;
this._headerBarLeft.hide();
this._headerBarRight.hide();
this._actionBarRevealer.set_reveal_child(true);
this._placeEntry.set_margin_start(0);
this._placeEntry.set_margin_end(0);
} else {
this.application.adaptive_mode = false;
this._headerBarLeft.show();
this._headerBarRight.show();
this._actionBarRevealer.set_reveal_child(false);
this._placeEntry.set_margin_start(_PLACE_ENTRY_MARGIN);
this._placeEntry.set_margin_end(_PLACE_ENTRY_MARGIN);
}
}
_saveWindowGeometry() {
if (this.maximized)
return;
......
......@@ -107,9 +107,8 @@ export class MapView extends Gtk.Overlay {
let isValid = Application.routeQuery.isValid();
this._routingOpen = value && isValid;
// TODO: bring it back when the layers are working
//this._routeLayers.forEach((routeLayer) => routeLayer.visible = value && isValid);
//this._instructionMarkerLayer.visible = value && isValid;
this._routeLayers.forEach((routeLayer) => routeLayer.visible = value && isValid);
this._instructionMarkerLayer.visible = value && isValid;
if (!value)
this.routeShowing = false;
this.notify('routingOpen');
......@@ -446,9 +445,7 @@ export class MapView extends Gtk.Overlay {
Application.settings.set('map-type', mapType);
} else {
let source = new GnomeMaps.FileDataSource({
path: Utils.getBufferText(Application.application.local_tile_path),
renderer: renderer,
tile_size: Application.application.local_tile_size || 512
path: Utils.getBufferText(Application.application.local_tile_path)
});
try {
source.prepare();
......@@ -456,8 +453,8 @@ export class MapView extends Gtk.Overlay {
mapSource =
new Shumate.RasterRenderer({ id: 'local',
name: 'local',
min_zoom_level: source.min_zoom_level,
max_zoom_level: source.max_zoom_level,
min_zoom_level: source.min_zoom,
max_zoom_level: source.max_zoom,
tile_size: Application.application.local_tile_size ?? 512,
projection: Shumate.MapProjection.MERCATOR,
data_source: source });
......@@ -465,6 +462,7 @@ export class MapView extends Gtk.Overlay {
this.setMapType(MapView.MapType.STREET);
Application.application.local_tile_path = false;
Utils.showDialog(e.message, Gtk.MessageType.ERROR, this._mainWindow);
return;
}
}
......@@ -776,7 +774,7 @@ export class MapView extends Gtk.Overlay {
showTurnPoint(turnPoint) {
if (this._turnPointMarker)
this._turnPointMarker.destroy();
this._instructionMarkerLayer.remove_marker(this._turnPointMarker);
this._turnPointMarker = null;
if (turnPoint.isStop())
......@@ -790,7 +788,7 @@ export class MapView extends Gtk.Overlay {
showTransitStop(transitStop, transitLeg) {
if (this._turnPointMarker)
this._turnPointMarker.destroy();
this._instructionMarkerLayer.remove_marker(this._turnPointMarker);
this._turnPointMarker = new TurnPointMarker({ transitStop: transitStop,
transitLeg: transitLeg,
......
......@@ -24,7 +24,6 @@ import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
import GWeather from 'gi://GWeather';
import Soup from 'gi://Soup';
import {Application} from './application.js';
import {PlaceFormatter} from './placeFormatter.js';
......@@ -180,8 +179,8 @@ export class SendToDialog extends Gtk.Dialog {
_emailSummary() {
let title = new PlaceFormatter(this._place).title;
let summary = "%s\n%s".format(this._getSummary(), this._getOSMURI());
let uri = 'mailto:?subject=%s&body=%s'.format(Soup.URI.encode(title, null),
Soup.URI.encode(summary, null));
let uri = 'mailto:?subject=%s&body=%s'.format(GLib.uri_escape_string(title, null, false),
GLib.uri_escape_string(summary, null, false));
try {
Gio.app_info_launch_default_for_uri(uri, this._getAppLaunchContext());
......
......@@ -29,6 +29,7 @@ import Gtk from 'gi://Gtk';
import {Application} from './application.js';
import {InstructionRow} from './instructionRow.js';
import {PlaceStore} from './placeStore.js';
import {QueryPoint} from './routeQuery.js';
import {RouteEntry} from './routeEntry.js';
import {RouteQuery} from './routeQuery.js';
import {StoredRoute} from './storedRoute.js';
......@@ -514,7 +515,7 @@ export class Sidebar extends Gtk.Revealer {
// Iterate over points and establish the new order of places
_reorderRoutePoints(srcIndex, destIndex) {
let points = this._query.points;
let srcPlace = this._draggedPoint.place;
let srcPlace = this._query.points[srcIndex].place;
// Determine if we are swapping from "above" or "below"
let step = (srcIndex < destIndex) ? -1 : 1;
......@@ -550,8 +551,8 @@ export class Sidebar extends Gtk.Revealer {
this._query.thaw_notify();
}
_onDragDrop(row) {
let srcIndex = this._query.points.indexOf(this._draggedPoint);
_onDragDrop(row, point) {
let srcIndex = this._query.points.indexOf(point);
let destIndex = row.get_index();
this._reorderRoutePoints(srcIndex, destIndex);
......@@ -559,51 +560,23 @@ export class Sidebar extends Gtk.Revealer {
return true;
}
_dragHighlightRow(row) {
row.opacity = 0.6;
}
_dragUnhighlightRow(row) {
row.opacity = 1.0;
}
// Set the opacity of the row we are currently dragging above
// to semi transparent.
_onDragMotion(row, context, x, y, time) {
let routeEntry = row.get_child();
if (this._draggedPoint && this._draggedPoint !== routeEntry.point) {
this._dragHighlightRow(row);
Gdk.drag_status(context, Gdk.DragAction.MOVE, time);
} else
Gdk.drag_status(context, 0, time);
return true;
}
// Drag ends, show the dragged row again.
_onDragEnd(row) {
this._draggedPoint = null;
row.opacity = 1.0;
}
// Restore to natural height
row.height_request = -1;
row.get_child().show();
_onDragPrepare(point, source, x, y) {
return Gdk.ContentProvider.new_for_value(point);
}
// Drag begins, set the correct drag icon and hide the dragged row.
// Drag begins, set the correct drag icon and dim the dragged row.
_onDragBegin(source, row) {
let routeEntry = row.get_child();
let {x, y, width, height} = row.get_allocation();
this._draggedPoint = routeEntry.point;
// Set a fixed height on the row to prevent the sidebar height
// to shrink while dragging a row.
row.height_request = height;
row.get_child().hide();
let paintable = new Gtk.WidgetPaintable(row);
let paintable = new Gtk.WidgetPaintable({ widget: routeEntry });
source.set_icon(paintable, 0, 0);
row.opacity = 0.6;
}
// Set up drag and drop between RouteEntrys. The drag source is from a
......@@ -616,17 +589,21 @@ export class Sidebar extends Gtk.Revealer {
dragIcon.add_controller(dragSource);
dragSource.connect('prepare',
this._onDragPrepare.bind(this, routeEntry.point));
dragSource.connect('drag-begin',
(source, drag, widget) => this._onDragBegin(source, row));
(source, drag, widget) =>
this._onDragBegin(source, row));
dragSource.connect('drag-end',
(source, dele, data) => this._onDragEnd(row));
let dropTarget = Gtk.DropTarget.new(RouteEntry, Gdk.DragAction.MOVE);
let dropTarget = Gtk.DropTarget.new(QueryPoint, Gdk.DragAction.COPY);
row.add_controller(dropTarget);
dropTarget.connect('drop',
(target, value, x, y, data) => this._onDragDrop(target));
(target, value, x, y, data) =>
this._onDragDrop(row, value));
}
}
......