diff options
author | Marcus Lundblad <ml@update.uu.se> | 2021-11-17 22:38:25 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2021-11-19 23:18:08 +0100 |
commit | c2351cbf1f2e62f2eb90c1fe66597eb541262cf2 (patch) | |
tree | 4863c1c96497f2961119f87d5cf482551c8542c9 | |
parent | b5e833e9b47ed0146145f9208292ebbf9a95bda5 (diff) | |
download | gnome-maps-c2351cbf1f2e62f2eb90c1fe66597eb541262cf2.tar.gz |
application: Add action to perform search
Adds an action to initiate search so that
a search query can be iniated via the
"ActivateAction" DBus message.
-rw-r--r-- | src/application.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/application.js b/src/application.js index 07fbb6a1..0e2e65e5 100644 --- a/src/application.js +++ b/src/application.js @@ -189,6 +189,20 @@ var Application = GObject.registerClass({ dialog.connect('response', () => dialog.destroy()); } + _onSearchActivate(action, parameter) { + this._createWindow(); + this._mainWindow.present(); + + let query = parameter.deep_unpack(); + let mapView = this._mainWindow.mapView; + + if (mapView.view.realized) + this._openSearchQuery(query); + else + mapView.view.connect('notify::realized', + this._openSearchQuery.bind(this, query)); + } + _addContacts() { let contacts = contactStore.get_contacts(); @@ -256,6 +270,10 @@ var Application = GObject.registerClass({ 'osm-account-setup': { onActivate: this._onOsmAccountSetupActivate.bind(this) }, + 'search': { + paramType: 's', + onActivate: this._onSearchActivate.bind(this) + }, 'quit': { onActivate: () => this.quit(), accels: ['<Primary>Q'] |