GNOME Bugzilla – Bug 702657
More GtkBuilder work
Last modified: 2013-06-25 18:53:35 UTC
Patch 1 introduces a getUIObject for easier GtkBuilder usage. Patch 2 pushes the app window init in mainWindow.js to main-window.ui
Created attachment 247259 [details] [review] Util: add getUIObject Add getUIObject, a helper function for working with GtkBuilder.
Created attachment 247260 [details] [review] MainWindow: use more GtkBuilder Move the appwindow into the ui-file and load it with Utils.getUIObject.
*** Bug 702656 has been marked as a duplicate of this bug. ***
*** Bug 702655 has been marked as a duplicate of this bug. ***
Review of attachment 247259 [details] [review]: ACK, would be nice to not instantiate a separate Gtk.Builder instance for each widget in future though.
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.
Created attachment 247271 [details] [review] Util: add getUIObject Add getUIObject, a helper function for working with GtkBuilder.
Created attachment 247272 [details] [review] MainWindow: use more GtkBuilder Move the appwindow into the ui-file and load it with Utils.getUIObject.
Oh sorry, didn't need to reattach the first patch there. The second one should fix the this.window-comment above.
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.
Created attachment 247696 [details] [review] Util: add getUIObject Add getUIObject, a helper function for working with GtkBuilder.
Created attachment 247697 [details] [review] MainWindow: use more GtkBuilder Move the appwindow into the ui-file and load it with Utils.getUIObject.
There: :) - Moved all getUIObject code to the first patch. - Fixed the mainWindow.js patch according to comments.
Review of attachment 247696 [details] [review]: ACK
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.
Attachment 247696 [details] pushed as 2a21a2e - Util: add getUIObject Attachment 247697 [details] pushed as 93c536e - MainWindow: use more GtkBuilder