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 726252 - Refactor topbar's children into separate classes/modules
Refactor topbar's children into separate classes/modules
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks: 692383
 
 
Reported: 2014-03-13 15:42 UTC by Adrien Plazas
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add properties-toolbar (2.61 KB, patch)
2014-03-13 16:39 UTC, Adrien Plazas
needs-work Details | Review
Use properties-toolbar (4.48 KB, patch)
2014-03-13 16:40 UTC, Adrien Plazas
rejected Details | Review
Add properties-toolbar (6.66 KB, patch)
2014-03-13 20:35 UTC, Adrien Plazas
needs-work Details | Review
Add collection-toolbar (17.01 KB, patch)
2014-03-13 20:35 UTC, Adrien Plazas
needs-work Details | Review
Add collection-toolbar (17.05 KB, patch)
2014-03-13 21:12 UTC, Adrien Plazas
needs-work Details | Review
Add selection-toolbar (12.62 KB, patch)
2014-03-13 21:12 UTC, Adrien Plazas
needs-work Details | Review
Add selection-toolbar (12.58 KB, patch)
2014-03-16 12:57 UTC, Adrien Plazas
needs-work Details | Review
Add wizard-toolbar (12.46 KB, patch)
2014-03-16 12:57 UTC, Adrien Plazas
needs-work Details | Review
Add selection-toolbar (12.68 KB, patch)
2014-03-16 14:55 UTC, Adrien Plazas
needs-work Details | Review
Add wizard-toolbar (12.51 KB, patch)
2014-03-16 14:55 UTC, Adrien Plazas
needs-work Details | Review
Add properties-toolbar (6.66 KB, patch)
2014-06-02 17:10 UTC, Adrien Plazas
none Details | Review
Add collection-toolbar (17.08 KB, patch)
2014-06-02 17:10 UTC, Adrien Plazas
none Details | Review
Add selection-toolbar (16.97 KB, patch)
2014-06-02 17:10 UTC, Adrien Plazas
none Details | Review
Add wizard-toolbar (13.06 KB, patch)
2014-06-02 17:10 UTC, Adrien Plazas
none Details | Review
Add properties-toolbar (6.66 KB, patch)
2014-06-04 14:31 UTC, Adrien Plazas
none Details | Review
Add collection-toolbar (17.42 KB, patch)
2014-06-04 14:31 UTC, Adrien Plazas
none Details | Review
Add selection-toolbar (16.97 KB, patch)
2014-06-04 14:31 UTC, Adrien Plazas
none Details | Review
Add wizard-toolbar (13.05 KB, patch)
2014-06-04 14:31 UTC, Adrien Plazas
none Details | Review
Add properties-toolbar (6.65 KB, patch)
2014-06-05 07:01 UTC, Adrien Plazas
reviewed Details | Review
Add collection-toolbar (17.42 KB, patch)
2014-06-05 07:01 UTC, Adrien Plazas
needs-work Details | Review
Add selection-toolbar (16.97 KB, patch)
2014-06-05 07:02 UTC, Adrien Plazas
none Details | Review
Add wizard-toolbar (13.05 KB, patch)
2014-06-05 07:02 UTC, Adrien Plazas
none Details | Review
Add properties-toolbar (6.64 KB, patch)
2014-06-06 10:49 UTC, Adrien Plazas
committed Details | Review
Add collection-toolbar (17.16 KB, patch)
2014-06-06 10:49 UTC, Adrien Plazas
committed Details | Review
Add selection-toolbar (16.10 KB, patch)
2014-06-06 10:49 UTC, Adrien Plazas
committed Details | Review
Add wizard-toolbar (12.38 KB, patch)
2014-06-06 10:49 UTC, Adrien Plazas
committed Details | Review

Description Adrien Plazas 2014-03-13 15:42:52 UTC
The topbar's role should be limited to switching between the different toolbars at the right time.

Actually it also implements some of the toolbars it manages: they should have their own types and implementations.
Comment 1 Adrien Plazas 2014-03-13 16:39:57 UTC
Created attachment 271755 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 2 Adrien Plazas 2014-03-13 16:40:02 UTC
Created attachment 271757 [details] [review]
Use properties-toolbar

Replaces the current implementation of the properties toolbar in
topbar by a separate on to avoid cluttering the topbar to answer part
of bug #726252.
Comment 3 Zeeshan Ali 2014-03-13 18:57:15 UTC
Review of attachment 271755 [details] [review]:

I don't think this should be a separate patch from the following one. Having them together will also make it clear that we are not exactly introducing a completely new code but rather only moving existing code to new file/class.
Comment 4 Adrien Plazas 2014-03-13 20:35:26 UTC
Created attachment 271791 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 5 Adrien Plazas 2014-03-13 20:35:30 UTC
Created attachment 271792 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.
Comment 6 Adrien Plazas 2014-03-13 21:00:18 UTC
I found an error in 271792:
Boxes.CollectionToolbar.setup_ui should contain "assert (App.window.searchbar != null);".
Comment 7 Adrien Plazas 2014-03-13 21:01:45 UTC
Review of attachment 271792 [details] [review]:

Boxes.CollectionToolbar.setup_ui should contain "assert (App.window.searchbar != null);".
Comment 8 Adrien Plazas 2014-03-13 21:12:30 UTC
Created attachment 271804 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.
Comment 9 Adrien Plazas 2014-03-13 21:12:35 UTC
Created attachment 271805 [details] [review]
Add selection-toolbar

Gives the selection toolbar a proper implementation to answer part of
bug #726252.
Comment 10 Zeeshan Ali 2014-03-14 13:29:38 UTC
Review of attachment 271791 [details] [review]:

Looks good. The commit log details needs something to be desired (not more info but better description) but I can handle that when merging but please do read the commit logs after I push.
Comment 11 Zeeshan Ali 2014-03-14 13:30:23 UTC
Review of attachment 271757 [details] [review]:

Your forgot to obsolete this one.
Comment 12 Zeeshan Ali 2014-03-14 13:33:26 UTC
Review of attachment 271804 [details] [review]:

same comment about the commit log details.
Comment 13 Zeeshan Ali 2014-03-14 13:35:10 UTC
Review of attachment 271805 [details] [review]:

::: data/ui/selection-toolbar.ui
@@ +8,3 @@
+
+    <child>
+      <object class="GtkHeaderBar" id="selection_toolbar">

Well now you can remove the "selection_" prefix from ids in here.
Comment 14 Zeeshan Ali 2014-03-14 13:38:28 UTC
I take it that patches for display-toolbar and wizard-toolbar are on the way? Please keep in mind the comment about no need for ID prefixes anymore.
Comment 15 Adrien Plazas 2014-03-16 12:57:05 UTC
Created attachment 272054 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.
Comment 16 Adrien Plazas 2014-03-16 12:57:09 UTC
Created attachment 272055 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.
Comment 17 Zeeshan Ali 2014-03-16 14:16:22 UTC
Review of attachment 272054 [details] [review]:

ack
Comment 18 Zeeshan Ali 2014-03-16 14:20:26 UTC
Review of attachment 272054 [details] [review]:

actually found a minor issue.

::: src/topbar.vala
@@ +91,2 @@
         App.app.notify["selected-items"].connect (() => {
+            selection_toolbar.update_selection_label ();

Pretty sure we can move this to SelectionToolbar now.
Comment 19 Zeeshan Ali 2014-03-16 14:24:46 UTC
Review of attachment 272055 [details] [review]:

Looks good otherwise.

::: src/wizard-toolbar.vala
@@ +13,3 @@
+    public Gtk.Button create_btn;
+
+    public void back () {

Lets keep them consistent with Topbar naming for similar methods: click_back_button and click_forward_button. Besides its more descriptive what it really does.
Comment 20 Adrien Plazas 2014-03-16 14:55:02 UTC
Created attachment 272061 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.
Comment 21 Adrien Plazas 2014-03-16 14:55:07 UTC
Created attachment 272062 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.
Comment 22 Zeeshan Ali 2014-03-17 19:23:11 UTC
Some issues here:

1. Your patches contain trailing whitespace, please remove those.
2. The last patch (wizard toolbar) doesn't apply here. Please make sure all patches here are recent version.
3. I get this on console with collection toolbar patch:

(gnome-boxes:32100): Boxes-CRITICAL **: boxes_collection_toolbar_set_title: assertion 'title != NULL' failed

Please investigate that.
Comment 23 Zeeshan Ali 2014-03-17 19:25:08 UTC
Review of attachment 271791 [details] [review]:

::: src/Makefile.am
@@ +118,3 @@
 	os-database.vala 			\
 	properties.vala				\
+	properties-toolbar.vala		\

Please align the '\' here with others above it. Unlike in sources, tabs are used in Makefile(.am)s.
Comment 24 Zeeshan Ali 2014-03-17 19:27:14 UTC
Review of attachment 271804 [details] [review]:

::: src/topbar.vala
@@ +124,2 @@
     private void update_search_btn () {
+    	collection_toolbar.update_search_btn ();

I don't think we need to expose update_search_btn, since CollectionToobar can hook to items_added/removed itself.

@@ +129,2 @@
     private void update_select_btn () {
+    	collection_toolbar.update_select_btn ();

same here and hence update_select_btn becomes completely redundant here.
Comment 25 Zeeshan Ali 2014-03-17 19:29:38 UTC
Review of attachment 272061 [details] [review]:

::: src/topbar.vala
@@ +29,3 @@
     private CollectionToolbar collection_toolbar;
     [GtkChild]
+    private SelectionToolbar selection_toolbar;

This becomes redundant too due to changes suggested in comments below.

@@ +102,3 @@
         App.app.collection.item_added.connect (update_select_btn);
         App.app.collection.item_removed.connect (update_select_btn);
+        selection_toolbar.update_selection_label ();

SelectionToolbar.update_selection_label doesn't need to be exposed I think as it has its own setup_ui method anyway where i can call this from.

@@ +118,3 @@
     private void update_search_btn () {
     	collection_toolbar.update_search_btn ();
+    	selection_toolbar.update_search_btn ();

Same thing here as with CollectionToobar.update_search_btn just above it.
Comment 26 Zeeshan Ali 2014-03-17 19:30:44 UTC
Review of attachment 272062 [details] [review]:

Looks good, just ensure that it applies cleanly on top of the previous patches.
Comment 27 Adrien Plazas 2014-06-02 17:10:03 UTC
Created attachment 277743 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 28 Adrien Plazas 2014-06-02 17:10:08 UTC
Created attachment 277744 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	src/topbar.vala
Comment 29 Adrien Plazas 2014-06-02 17:10:14 UTC
Created attachment 277745 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
	src/topbar.vala
Comment 30 Adrien Plazas 2014-06-02 17:10:19 UTC
Created attachment 277746 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
Comment 31 Zeeshan Ali 2014-06-03 11:31:57 UTC
Trailing whitespaces are still there in at least the first patch. Please make sure all points in comment#22 are addressed by each patch.
Comment 32 Adrien Plazas 2014-06-04 14:31:04 UTC
Created attachment 277877 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 33 Adrien Plazas 2014-06-04 14:31:08 UTC
Created attachment 277878 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	src/topbar.vala
Comment 34 Adrien Plazas 2014-06-04 14:31:12 UTC
Created attachment 277879 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
	src/topbar.vala
Comment 35 Adrien Plazas 2014-06-04 14:31:18 UTC
Created attachment 277880 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
Comment 36 Zeeshan Ali 2014-06-04 19:02:56 UTC
Trailing whitespace still there! :(
Comment 37 Adrien Plazas 2014-06-05 07:01:54 UTC
Created attachment 277928 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 38 Adrien Plazas 2014-06-05 07:01:59 UTC
Created attachment 277929 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	src/topbar.vala
Comment 39 Adrien Plazas 2014-06-05 07:02:05 UTC
Created attachment 277930 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
	src/topbar.vala
Comment 40 Adrien Plazas 2014-06-05 07:02:09 UTC
Created attachment 277931 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
Comment 41 Adrien Plazas 2014-06-05 07:03:56 UTC
I was sure it was OK this time but I missed a serie of trailing spaces… it
should be ok now.
Comment 42 Zeeshan Ali 2014-06-05 11:26:32 UTC
Review of attachment 277928 [details] [review]:

::: src/properties-toolbar.vala
@@ +1,2 @@
+// This file is part of GNOME Boxes. License: LGPLv2+
+using Gtk;

This is redundant here. We should either remove this or 'Gtk.' everywhere below.
Comment 43 Zeeshan Ali 2014-06-05 11:36:37 UTC
Review of attachment 277929 [details] [review]:

git-bz points out:

Applying: Add collection-toolbar
/home/zeenix/checkout/gnome/gnome-boxes/.git/rebase-apply/patch:444: space before tab in indent.
    	collection_toolbar.update_search_btn ();
/home/zeenix/checkout/gnome/gnome-boxes/.git/rebase-apply/patch:450: space before tab in indent.
    	collection_toolbar.update_select_btn ();
warning: 2 lines add whitespace errors.

::: src/Makefile.am
@@ +98,3 @@
 	collection-view.vala			\
 	collection.vala				\
+	collection-toolbar.vala		\

Please align the '\'. Seems other patches need this too. I have pointed this out before. Can you please go through all my comments and ensure that your patches are addressing those?

::: src/topbar.vala
@@ +137,2 @@
     private void update_search_btn () {
+    	collection_toolbar.update_search_btn ();

Sorry but did you actually care to go through my comments at all? I understand that you have been busy with other stuff and could easily forget them but can you please go through them all now to refresh your memory and address them *all* in your next version of patches?

comment#24 in this case.
Comment 44 Zeeshan Ali 2014-06-05 11:37:39 UTC
Apart for address my comments, please ensure that you don't introduce any runtime warnings (at least one of your patches does, when you start Boxes).
Comment 45 Adrien Plazas 2014-06-06 10:49:17 UTC
Created attachment 278007 [details] [review]
Add properties-toolbar

Gives the properties toolbar a proper implementation to answer part of
bug #726252.
Comment 46 Adrien Plazas 2014-06-06 10:49:23 UTC
Created attachment 278008 [details] [review]
Add collection-toolbar

Gives the collection toolbar a proper implementation to answer part of
bug #726252.
Comment 47 Adrien Plazas 2014-06-06 10:49:28 UTC
Created attachment 278009 [details] [review]
Add selection-toolbar

The selection toolbar is moved out of the topbar to its own files to
answer part of bug #726252.
Comment 48 Adrien Plazas 2014-06-06 10:49:33 UTC
Created attachment 278010 [details] [review]
Add wizard-toolbar

The wizard toolbar is moved out of the topbar to its own files to
answer part of bug #726252.

https://bugzilla.gnome.org/show_bug.cgi?id=726252

Conflicts:
	data/ui/topbar.ui
Comment 49 Zeeshan Ali 2014-06-06 11:32:59 UTC
Review of attachment 278007 [details] [review]:

Looks good.
Comment 50 Zeeshan Ali 2014-06-06 11:36:17 UTC
Review of attachment 278008 [details] [review]:

Looks good otherwise.

::: src/collection-toolbar.vala
@@ +38,3 @@
+    }
+
+    public void setup_ui () {

No biggie but I prefer public methods coming before private. I'll correct it before merging..
Comment 51 Zeeshan Ali 2014-06-06 11:44:59 UTC
Review of attachment 278009 [details] [review]:

Looks good.
Comment 52 Zeeshan Ali 2014-06-06 11:54:42 UTC
Review of attachment 278010 [details] [review]:

Looks good