diff options
author | Marcus Lundblad <ml@update.uu.se> | 2020-01-19 23:33:59 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@update.uu.se> | 2020-01-19 23:33:59 +0100 |
commit | be6636c9a8cf8b6766c8a34760bac5a906b24fa9 (patch) | |
tree | a082d51dd4a53510dd7065b0c6414befbfee74f3 | |
parent | 1c969f3fd2c43e0c2370cbd07dffb50870ef4357 (diff) | |
download | gnome-maps-be6636c9a8cf8b6766c8a34760bac5a906b24fa9.tar.gz |
contextMenu: Remove item to "Export as Image"wip/mlundblad/export-in-hamburger
-rw-r--r-- | data/ui/context-menu.ui | 7 | ||||
-rw-r--r-- | src/contextMenu.js | 38 |
2 files changed, 0 insertions, 45 deletions
diff --git a/data/ui/context-menu.ui b/data/ui/context-menu.ui index 037ccdd0..6f3e54ca 100644 --- a/data/ui/context-menu.ui +++ b/data/ui/context-menu.ui @@ -18,13 +18,6 @@ </object> </child> <child> - <object class="GtkMenuItem" id="exportItem"> - <property name="name">export-item</property> - <property name="label" translatable="yes">Export As Image</property> - <property name="visible">True</property> - </object> - </child> - <child> <object class="GtkMenuItem" id="routeItem"> <property name="name">route-item</property> <property name="visible">True</property> diff --git a/src/contextMenu.js b/src/contextMenu.js index 19b5b459..373eabd0 100644 --- a/src/contextMenu.js +++ b/src/contextMenu.js @@ -19,7 +19,6 @@ * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org> */ -const Champlain = imports.gi.Champlain; const Gdk = imports.gi.Gdk; const Geocode = imports.gi.GeocodeGlib; const GObject = imports.gi.GObject; @@ -27,7 +26,6 @@ const Gtk = imports.gi.Gtk; const Mainloop = imports.mainloop; const Application = imports.application; -const ExportViewDialog = imports.exportViewDialog; const GeocodeFactory = imports.geocode; const Location = imports.location; const OSMAccountDialog = imports.osmAccountDialog; @@ -42,12 +40,10 @@ var ContextMenu = GObject.registerClass({ Template: 'resource:///org/gnome/Maps/ui/context-menu.ui', InternalChildren: [ 'whatsHereItem', 'geoURIItem', - 'exportItem', 'addOSMLocationItem', 'routeItem' ], }, class ContextMenu extends Gtk.Menu { _init(params) { - this._mapView = params.mapView; delete params.mapView; this._mainWindow = params.mainWindow; @@ -62,8 +58,6 @@ var ContextMenu = GObject.registerClass({ this._onWhatsHereActivated.bind(this)); this._geoURIItem.connect('activate', this._onGeoURIActivated.bind(this)); - this._exportItem.connect('activate', - this._onExportActivated.bind(this)); this._addOSMLocationItem.connect('activate', this._onAddOSMLocationActivated.bind(this)); this._routeItem.connect('activate', @@ -192,36 +186,4 @@ var ContextMenu = GObject.registerClass({ } }); } - - _activateExport() { - let view = this._mapView.view; - let surface = view.to_surface(true); - let bbox = view.get_bounding_box(); - let [latitude, longitude] = bbox.get_center(); - - let dialog = new ExportViewDialog.ExportViewDialog({ - transient_for: this._mainWindow, - modal: true, - surface: surface, - latitude: latitude, - longitude: longitude, - mapView: this._mapView - }); - - dialog.connect('response', () => dialog.destroy()); - dialog.show_all(); - } - - _onExportActivated() { - if (this._mapView.view.state === Champlain.State.DONE) { - this._activateExport(); - } else { - let notifyId = this._mapView.view.connect('notify::state', () => { - if (this._mapView.view.state === Champlain.State.DONE) { - this._mapView.view.disconnect(notifyId); - this._activateExport(); - } - }); - } - } }); |