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 746736 - Let GtkApplication load the app menu automatically
Let GtkApplication load the app menu automatically
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-03-25 10:33 UTC by Pranav Kant
Modified: 2016-06-03 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Let GtkApplication load the app menu automatically (5.72 KB, patch)
2015-03-25 10:33 UTC, Pranav Kant
needs-work Details | Review
Let GtkApplication load the app menu automatically (2.58 KB, patch)
2016-03-08 11:08 UTC, Neha Yadav
none Details | Review
Let GtkApplication load the app menu automatically (2.59 KB, patch)
2016-04-23 18:35 UTC, Neha Yadav
none Details | Review
Let GtkApplication load the app menu automatically (1.88 KB, patch)
2016-04-23 18:52 UTC, Neha Yadav
none Details | Review
Let GtkApplication load the app menu automatically (1.92 KB, patch)
2016-04-23 19:32 UTC, Neha Yadav
none Details | Review
Let GtkApplication load the app menu automatically (1.92 KB, patch)
2016-04-23 19:49 UTC, Neha Yadav
none Details | Review
Let GtkApplication load the app menu automatically (2.36 KB, patch)
2016-06-02 17:40 UTC, Alessandro Bono
none Details | Review
Let GtkApplication load the app menu automatically (2.34 KB, patch)
2016-06-03 11:43 UTC, Alessandro Bono
committed Details | Review

Description Pranav Kant 2015-03-25 10:33:54 UTC
We need to change our resource base path to /org/gnome/Documents to
match the default value computed by GIO.
Comment 1 Pranav Kant 2015-03-25 10:33:59 UTC
Created attachment 300269 [details] [review]
Let GtkApplication load the app menu automatically
Comment 2 Bastien Nocera 2015-09-18 16:32:16 UTC
Review of attachment 300269 [details] [review]:

Doesn't that break with gnome-books?
Comment 3 Cosimo Cecchi 2015-09-18 17:00:04 UTC
Review of attachment 300269 [details] [review]:

Also needs to be rebased to latest master I think.

::: src/application.js
@@ +469,1 @@
                 cssProvider.load_from_file(file);

This could use the load_from_resource() function instead.
Comment 4 Neha Yadav 2016-03-08 11:08:28 UTC
Created attachment 323373 [details] [review]
Let GtkApplication load the app menu automatically
Comment 5 Neha Yadav 2016-04-23 18:35:52 UTC
Created attachment 326600 [details] [review]
Let GtkApplication load the app menu automatically
Comment 6 Neha Yadav 2016-04-23 18:52:30 UTC
Created attachment 326601 [details] [review]
Let GtkApplication load the app menu automatically
Comment 7 Neha Yadav 2016-04-23 19:32:09 UTC
Created attachment 326603 [details] [review]
Let GtkApplication load the app menu automatically
Comment 8 Neha Yadav 2016-04-23 19:49:48 UTC
Created attachment 326604 [details] [review]
Let GtkApplication load the app menu automatically
Comment 9 Alessandro Bono 2016-04-23 20:16:42 UTC
Review of attachment 326604 [details] [review]:

Looks good for me.
Comment 10 Cosimo Cecchi 2016-04-25 08:36:40 UTC
Review of attachment 326604 [details] [review]:

Feel free to push to master.
Comment 11 Alessandro Bono 2016-04-25 08:53:58 UTC
Attachment 326604 [details] pushed as 0c0f72d - Let GtkApplication load the app menu automatically
Comment 12 Bastien Nocera 2016-05-31 17:27:01 UTC
This broke the menu loading in gnome-books.
Comment 13 Bastien Nocera 2016-05-31 17:27:46 UTC
commit 1a6c032641a7f76a3392c11b73a6ea7695213c47
Author: Bastien Nocera <hadess@hadess.net>
Date:   Tue May 31 19:26:17 2016 +0200

    Revert "Let GtkApplication load the app menu automatically"
    
    This reverts commit 0c0f72d22d695a97f663c79d689fe6fb4c4b1cbe.
    
    This broke the app menu in gnome-books.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=746736#c12
Comment 14 Cosimo Cecchi 2016-06-02 08:23:39 UTC
How was menu loading broken by the patch exactly? I assume we need to load it from a different resource for the isBooks case?
Comment 15 Bastien Nocera 2016-06-02 12:53:35 UTC
(In reply to Cosimo Cecchi from comment #14)
> How was menu loading broken by the patch exactly?

It doesn't load the menu automatically at all, as the app assumes that the resource will be called org.gnome.Books.gresource and contain /org/gnome/Books/... But even if the resource is the right name, the path will be /org/gnome/Documents/ as we share the resource itself.

> I assume we need to load
> it from a different resource for the isBooks case?

A different resource, and all the other /org/gnome/Documents/ paths would need to be changed as well.

So to remove those 5 lines of code, you'd need to add about a dozen "if (isBooks)" checks in other sources.

Maybe a per-app constant is a nicer way to fix this, I don't really mind. In any case both gnome-books and gnome-documents will need to be tested.
Comment 16 Alessandro Bono 2016-06-02 17:40:03 UTC
Created attachment 328989 [details] [review]
Let GtkApplication load the app menu automatically
Comment 17 Alessandro Bono 2016-06-02 17:43:47 UTC
The attached patch fix both the app-menu loaded automatically and the shortcut window not displayed for Books.
Comment 18 Cosimo Cecchi 2016-06-03 10:51:17 UTC
Review of attachment 328989 [details] [review]:

Looks good to me. Bastien, could you confirm that this also works for you?
Comment 19 Bastien Nocera 2016-06-03 11:14:58 UTC
(In reply to Cosimo Cecchi from comment #18)
> Review of attachment 328989 [details] [review] [review]:
> 
> Looks good to me. Bastien, could you confirm that this also works for you?

Somebody touched the same code path in a commit, so the patch doesn't apply any more (Who could do that!)
Comment 20 Alessandro Bono 2016-06-03 11:43:27 UTC
Created attachment 329036 [details] [review]
Let GtkApplication load the app menu automatically
Comment 21 Bastien Nocera 2016-06-03 12:29:32 UTC
Works for me (no errors, menu appears in both applications).
Comment 22 Bastien Nocera 2016-06-03 14:13:04 UTC
Attachment 329036 [details] pushed as 09a5e4f - Let GtkApplication load the app menu automatically