After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702657 - More GtkBuilder work
More GtkBuilder work
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
: 702655 702656 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-06-19 14:00 UTC by Mattias Bengtsson
Modified: 2013-06-25 18:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Util: add getUIObject (868 bytes, patch)
2013-06-19 14:00 UTC, Mattias Bengtsson
accepted-commit_now Details | Review
MainWindow: use more GtkBuilder (12.33 KB, patch)
2013-06-19 14:00 UTC, Mattias Bengtsson
needs-work Details | Review
Util: add getUIObject (868 bytes, patch)
2013-06-19 16:50 UTC, Mattias Bengtsson
none Details | Review
MainWindow: use more GtkBuilder (8.75 KB, patch)
2013-06-19 16:50 UTC, Mattias Bengtsson
needs-work Details | Review
Util: add getUIObject (1.00 KB, patch)
2013-06-25 01:38 UTC, Mattias Bengtsson
committed Details | Review
MainWindow: use more GtkBuilder (6.09 KB, patch)
2013-06-25 01:38 UTC, Mattias Bengtsson
committed Details | Review

Description Mattias Bengtsson 2013-06-19 14:00:33 UTC
Patch 1 introduces a getUIObject for easier GtkBuilder usage.
Patch 2 pushes the app window init in mainWindow.js to main-window.ui
Comment 1 Mattias Bengtsson 2013-06-19 14:00:35 UTC
Created attachment 247259 [details] [review]
Util: add getUIObject

Add getUIObject, a helper function for working with GtkBuilder.
Comment 2 Mattias Bengtsson 2013-06-19 14:00:39 UTC
Created attachment 247260 [details] [review]
MainWindow: use more GtkBuilder

Move the appwindow into the ui-file and load it with Utils.getUIObject.
Comment 3 Mattias Bengtsson 2013-06-19 14:02:59 UTC
*** Bug 702656 has been marked as a duplicate of this bug. ***
Comment 4 Mattias Bengtsson 2013-06-19 14:03:29 UTC
*** Bug 702655 has been marked as a duplicate of this bug. ***
Comment 5 Zeeshan Ali 2013-06-19 16:08:21 UTC
Review of attachment 247259 [details] [review]:

ACK, would be nice to not instantiate a separate Gtk.Builder instance for each widget in future though.
Comment 6 Zeeshan Ali 2013-06-19 16:15:46 UTC
Review of attachment 247260 [details] [review]:

::: src/application.js
@@ +61,2 @@
     _onQuitActivate: function() {
+        this._mainWindow.ui.appWindow.destroy();

I would make it so that these changes are not needed. i-e

this.window = this.ui.appWindow;

from mainWindows.js. User of a class shouldn't need to know anything about 'ui' property.
Comment 7 Mattias Bengtsson 2013-06-19 16:50:34 UTC
Created attachment 247271 [details] [review]
Util: add getUIObject

Add getUIObject, a helper function for working with GtkBuilder.
Comment 8 Mattias Bengtsson 2013-06-19 16:50:44 UTC
Created attachment 247272 [details] [review]
MainWindow: use more GtkBuilder

Move the appwindow into the ui-file and load it with Utils.getUIObject.
Comment 9 Mattias Bengtsson 2013-06-19 16:52:03 UTC
Oh sorry, didn't need to reattach the first patch there.
The second one should fix the this.window-comment above.
Comment 10 Zeeshan Ali 2013-06-19 17:02:49 UTC
Review of attachment 247272 [details] [review]:

::: src/mainWindow.js
@@ +116,3 @@
             function () {
                 if (!this.mapView.userLocationVisible())
+                    this._ui.trackUserButton.active = false;

we shouldn't need these changes either. Just initialize the properties soon after loading the builder file.
Comment 11 Mattias Bengtsson 2013-06-25 01:38:19 UTC
Created attachment 247696 [details] [review]
Util: add getUIObject

Add getUIObject, a helper function for working with GtkBuilder.
Comment 12 Mattias Bengtsson 2013-06-25 01:38:30 UTC
Created attachment 247697 [details] [review]
MainWindow: use more GtkBuilder

Move the appwindow into the ui-file and load it with Utils.getUIObject.
Comment 13 Mattias Bengtsson 2013-06-25 01:41:41 UTC
There: :)
- Moved all getUIObject code to the first patch.
- Fixed the mainWindow.js patch according to comments.
Comment 14 Zeeshan Ali 2013-06-25 13:00:38 UTC
Review of attachment 247696 [details] [review]:

ACK
Comment 15 Zeeshan Ali 2013-06-25 13:04:18 UTC
Review of attachment 247697 [details] [review]:

ACK with that fixed.

::: src/mainWindow.js
@@ +51,3 @@
+                                                    'search-entry',
+                                                    'track-user-button']),
+            grid = ui.windowContent,

I'd prefer separate 'let x = X;' statements here as these don't fit in one line.
Comment 16 Mattias Bengtsson 2013-06-25 18:53:28 UTC
Attachment 247696 [details] pushed as 2a21a2e - Util: add getUIObject
Attachment 247697 [details] pushed as 93c536e - MainWindow: use more GtkBuilder