[gnome-maps] Remove mainToolbar.js



commit e7721b3a71bef10a1f5a94c1fb02b9fc505430ee
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Apr 5 21:26:51 2013 +0200

    Remove mainToolbar.js
    
    Our header bar is simple enough to not warrant its own module. Beside
    the only method it encapsulates (onSearchActivate) actually belongs to
    the window since it acts on the mapView.

 src/Makefile-js.am |    1 -
 src/mainToolbar.js |   55 ----------------------------------------------------
 src/mainWindow.js  |   17 +++++++++++++--
 3 files changed, 14 insertions(+), 59 deletions(-)
---
diff --git a/src/Makefile-js.am b/src/Makefile-js.am
index 801e7a9..bf9bc19 100644
--- a/src/Makefile-js.am
+++ b/src/Makefile-js.am
@@ -3,7 +3,6 @@ dist_js_DATA = \
     application.js \
     main.js \
     mainWindow.js \
-    mainToolbar.js \
     mapView.js \
     mapViewEmbed.js \
     path.js \
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 344a752..e15e153 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -22,6 +22,7 @@
 const Gdk = imports.gi.Gdk;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
+const Gd = imports.gi.Gd;
 const Champlain = imports.gi.Champlain;
 const Geocode = imports.gi.GeocodeGlib;
 
@@ -29,7 +30,6 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 
 const Application = imports.application;
-const MainToolbar = imports.mainToolbar;
 const MapViewEmbed = imports.mapViewEmbed;
 const Utils = imports.utils;
 const Config = imports.config;
@@ -90,8 +90,13 @@ const MainWindow = new Lang.Class({
         grid.set_orientation (Gtk.Orientation.VERTICAL);
         this.window.add(grid);
 
-        this._toolbar = new MainToolbar.MainToolbar(this);
-        grid.add(this._toolbar.widget);
+        this._searchEntry = new Gd.TaggedEntry({ width_request: 500 });
+        this._searchEntry.connect('activate', Lang.bind(this, this._onSearchActivate));
+
+        let headerBar = new Gd.HeaderBar();
+        headerBar.set_custom_title(this._searchEntry);
+
+        grid.add(headerBar);
 
         this._embed = new MapViewEmbed.MapViewEmbed();
         grid.add(this._embed);
@@ -142,6 +147,12 @@ const MainWindow = new Lang.Class({
         Application.settings.set_boolean('window-maximized', maximized);
     },
 
+    _onSearchActivate: function() {
+        let string = this._searchEntry.get_text();
+
+        this.mapView.geocodeSearch(string);
+    },
+
     _quit: function() {
         // remove configure event handler if still there
         if (this._configureId != 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]