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 682292 - Add favorite emblems support
Add favorite emblems support
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-20 19:20 UTC by Marc-Andre Lureau
Modified: 2016-03-31 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
util-app: copy create_symbolic_emblem() from gnome-documents (886 bytes, patch)
2012-08-20 19:20 UTC, Marc-Andre Lureau
committed Details | Review
display-config: add set_category() to add/remove a category (1.41 KB, patch)
2012-08-20 19:20 UTC, Marc-Andre Lureau
committed Details | Review
selectionbar: update favorite button when selection changes (1.67 KB, patch)
2012-08-20 19:20 UTC, Marc-Andre Lureau
committed Details | Review
Rename s/favourite/favorite category (1.01 KB, patch)
2012-08-20 19:20 UTC, Marc-Andre Lureau
accepted-commit_now Details | Review
collection-view: draw emblem on favorite machine (4.44 KB, patch)
2012-08-20 19:20 UTC, Marc-Andre Lureau
committed Details | Review

Description Marc-Andre Lureau 2012-08-20 19:20:39 UTC
SSIA
Comment 1 Marc-Andre Lureau 2012-08-20 19:20:41 UTC
Created attachment 221883 [details] [review]
util-app: copy create_symbolic_emblem() from gnome-documents
Comment 2 Marc-Andre Lureau 2012-08-20 19:20:45 UTC
Created attachment 221884 [details] [review]
display-config: add set_category() to add/remove a category
Comment 3 Marc-Andre Lureau 2012-08-20 19:20:48 UTC
Created attachment 221885 [details] [review]
selectionbar: update favorite button when selection changes

Update favorite button sensitivity and state depending on selected
machines.
Comment 4 Marc-Andre Lureau 2012-08-20 19:20:52 UTC
Created attachment 221886 [details] [review]
Rename s/favourite/favorite category

Internal, now follows gtk naming
Comment 5 Marc-Andre Lureau 2012-08-20 19:20:56 UTC
Created attachment 221887 [details] [review]
collection-view: draw emblem on favorite machine

SSIA, adapted from similar code from gnome-documents. Styling might
not be good atm, but my local configuration doesn't work so I can't
see what is really the current result or improve it. What I see isn't
so bad, but doesn't look great either..
Comment 6 Zeeshan Ali 2012-08-20 20:56:15 UTC
Review of attachment 221883 [details] [review]:

ACK
Comment 7 Zeeshan Ali 2012-08-20 21:05:57 UTC
Review of attachment 221884 [details] [review]:

::: src/display-config.vala
@@ -48,2 +58,5 @@
         categories += category;
         this.categories = categories;
+    }
+
+    public void set_category (string category, bool enabled) {

IMHO this seems like a weird API and i don't think this saves a lot of LOCs to caller but not really a big deal so keep it if you disagree.
Comment 8 Zeeshan Ali 2012-08-20 21:18:25 UTC
Review of attachment 221885 [details] [review]:

::: src/selectionbar.vala
@@ +77,3 @@
+
+            var is_favorite = "favorite" in machine.config.categories;
+            if (!active) {

i don't quite follow the logic here. When do we want the button to be inactive and when do we want it insensitive? I'm guessing I'm missing something fundamental here.
Comment 9 Zeeshan Ali 2012-08-20 21:20:48 UTC
Review of attachment 221886 [details] [review]:

Seems you are doing a bit more than renaming here? ACK with the commit log corrected.
Comment 10 Marc-Andre Lureau 2012-08-21 00:28:18 UTC
(In reply to comment #8)
> Review of attachment 221885 [details] [review]:
> 
> ::: src/selectionbar.vala
> @@ +77,3 @@
> +
> +            var is_favorite = "favorite" in machine.config.categories;
> +            if (!active) {
> 
> i don't quite follow the logic here. When do we want the button to be inactive
> and when do we want it insensitive? I'm guessing I'm missing something
> fundamental here.

I am not sure what we should really do, but I am not fond of gnome-documents behaviour either, so here is the interaction:

- no vm selection, favorite in insensitive
- all vm selected are favorite or not favorite, the button is sensitive
- the toggle state is set according to favorite or not
- if the vm are mixed favorite and not favorite, the button is insensitive
Comment 11 Marc-Andre Lureau 2012-08-21 00:30:59 UTC
Review of attachment 221886 [details] [review]:

selectionbar: button toggles machine "favorite" category now
    
    internal, now follows gtk naming s/favourite/favorite category
Comment 12 Marc-Andre Lureau 2012-08-21 11:55:01 UTC
Attachment 221883 [details] pushed as 9659102 - util-app: copy create_symbolic_emblem() from gnome-documents
Attachment 221884 [details] pushed as 09c6cc5 - display-config: add set_category() to add/remove a category
Attachment 221885 [details] pushed as 32c1f7f - selectionbar: update favorite button when selection changes
Attachment 221887 [details] pushed as dd0be51 - collection-view: draw emblem on favorite machine