Commit ca9b4a98 authored by Marcus Lundblad's avatar Marcus Lundblad
Browse files

mainWindow: Only enable map type shortcuts when useful

Only enable the shortcuts to switch b/w street and aerial
map types when aerial tiles are available.
parent 260bcb6b
Pipeline #287242 failed with stage
in 7 minutes and 38 seconds
......@@ -192,7 +192,7 @@ var MainWindow = GObject.registerClass({
}
_initActions() {
Utils.addActions(this, {
let actions = {
'about': {
onActivate: () => this._onAboutActivate()
},
......@@ -200,14 +200,6 @@ var MainWindow = GObject.registerClass({
state: ['b', false],
onActivate: () => this._onMapTypeMenuActivate()
},
'switch-to-street-view': {
accels: ['<Primary>1', '<Primary>KP_1'],
onActivate: () => this._onStreetViewActivate()
},
'switch-to-aearial-view': {
accels: ['<Primary>2', '<Primary>KP_2'],
onActivate: () => this._onAerialViewActivate()
},
'hybrid-aerial': {
paramType: 'b',
setting: 'hybrid-aerial'
......@@ -252,7 +244,22 @@ var MainWindow = GObject.registerClass({
'export-as-image': {
onActivate: () => this._onExportActivated()
}
}, Application.settings);
};
// when aerial tiles are available, add shortcuts to switch
if (Service.getService().tiles.aerial) {
actions['switch-to-street-view'] = {
accels: ['<Primary>1', '<Primary>KP_1'],
onActivate: () => this._onStreetViewActivate()
};
actions['switch-to-aearial-view'] = {
accels: ['<Primary>2', '<Primary>KP_2'],
onActivate: () => this._onAerialViewActivate()
};
}
Utils.addActions(this, actions, Application.settings);
}
_initSignals() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment