Commit c7e6f397 authored by Mattias Bengtsson's avatar Mattias Bengtsson Committed by Jonas Danielsson

MainWindow: Use params pattern for _init

This makes MainWindow consistent with most other classes in Maps.

https://bugzilla.gnome.org/show_bug.cgi?id=740647
parent 6650c307
...@@ -212,7 +212,8 @@ const Application = new Lang.Class({ ...@@ -212,7 +212,8 @@ const Application = new Lang.Class({
'icons'])); 'icons']));
let overlay = new Gtk.Overlay({ visible: true, can_focus: false }); let overlay = new Gtk.Overlay({ visible: true, can_focus: false });
notificationManager = new NotificationManager.NotificationManager(overlay); notificationManager = new NotificationManager.NotificationManager(overlay);
this._mainWindow = new MainWindow.MainWindow(this, overlay); this._mainWindow = new MainWindow.MainWindow({ application: this,
overlay: overlay });
this._mainWindow.connect('destroy', this._onWindowDestroy.bind(this)); this._mainWindow.connect('destroy', this._onWindowDestroy.bind(this));
}, },
......
...@@ -58,16 +58,16 @@ const MainWindow = new Lang.Class({ ...@@ -58,16 +58,16 @@ const MainWindow = new Lang.Class({
'layersButton', 'layersButton',
'favoritesButton' ], 'favoritesButton' ],
_init: function(app, overlay) { _init: function(params) {
this.parent(); this._overlay = params.overlay;
delete params.overlay;
this._configureId = 0; this.parent(params);
this.application = app; this._configureId = 0;
this._overlay = overlay;
this.mapView = new MapView.MapView(); this.mapView = new MapView.MapView();
overlay.add(this.mapView); this._overlay.add(this.mapView);
this.mapView.gotoUserLocation(false); this.mapView.gotoUserLocation(false);
......
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