GNOME Bugzilla – Bug 780152
No "Clone project" option in the app menu
Last modified: 2018-01-11 10:21:12 UTC
Builder have a new/open/clone UI in the greeter, but this last option is missing in the other place where this is provided, the app menu. So to be consistent it should display it there, otherwise it's difficult to know from where you can "import" or "clone" a project from any UI part of Builder.
-> newcomers, appropriate as a first task once the maintainer agrees.
Sure, it's just a little bit tricky. We need to add: - plugins/git/gtk/menus.ui (and add to resources) to add the menu item to be merged into the global menu. - We need an action to change the greeter perspective to the proper genesis addin using an action-target like "genesis::git". Right now the current buttons use a ::clicked callback. So those could be changed to use actions too.
Created attachment 349216 [details] [review] application-actions: Added clone-project option to app-menu
Review of attachment 349216 [details] [review]: Hey Pratyusha, I cannot test the patch, but a high level review from my part (and Christian can go into the technical details once that's fixed): The commit message doesn't follow the guidelines, take a look at https://wiki.gnome.org/Newcomers/CodeContributionWorkflow#Commit_guidelines ::: libide/application/ide-application-actions.c @@ +297,3 @@ static void +ide_application_actions_clone_project (GSimpleAction *action, + GVariant *variant, wrong aligment @@ +298,3 @@ +ide_application_actions_clone_project (GSimpleAction *action, + GVariant *variant, + gpointer user_data) ditto @@ +302,3 @@ + IdeApplication *self = user_data; + + g_assert (IDE_IS_APPLICATION (self)); Are you sure you want to crash the whole application unconditionally because you cannot clone a project? :) use g_return_if_fail instead to raise a critical.
Created attachment 349222 [details] [review] application-actions: Added clone-project option to app-menu Builder has clone-project option in the greeter, but this is not there in app menu. This patch adds a clone-project option to app-menu making it accessible from anywhere.
Comment on attachment 349222 [details] [review] application-actions: Added clone-project option to app-menu Hi Carlos, Thanks for the review. I have made some changes. Can you see and tell if I have to make any other changes?
Review of attachment 349222 [details] [review]: This looks like a good strategy to solve the problem. However, we should avoid putting git-related items in libide when the feature is provided by the git plugin (in plugins/git/). It ends up being more code, but it keeps things compartmentalized within the plugin. That means we need to do a couple things: 1) add plugins/git/gtk/menus.ui which contains the mergeable menu item like (and add the file to plugins/git/ide-git-resources.gresource.xml). <?xml version="1.0"?> <interface> <menu id="app-menu"> <section id="app-menu-project-section"> <item> <attribute name="label" translatable="yes">_Clone Project</attribute> <attribute name="action">app.clone-project</attribute> </item> </section> </menu> </interface> 2) Create a new IdeApplicationAddin for the git plugin named like plugins/git/ide-git-application-addin.{c,h} that adds the clone-project action to the IdeApplication (which is a GActionMap, so you can use g_action_map_add_action). See ide-git-workbench-addin.{c,h} for an example of how to create a GObject for the addin. The ApplicationAddin and WorkbenchAddin are very similar in structure. 3) Register the application addin in plugins/git/ide-git-plugin.c And I think that's it. Thanks so much for working on this!
Oh, and plugins/git/Makefile.am and plugins/git/meson.build both will need to be updated to include the new ide-git-application-addin.{c,h} files.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-builder/issues/193.