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 780152 - No "Clone project" option in the app menu
No "Clone project" option in the app menu
Status: RESOLVED OBSOLETE
Product: gnome-builder
Classification: Other
Component: general
3.23.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks: 781010
 
 
Reported: 2017-03-16 14:47 UTC by Carlos Soriano
Modified: 2018-01-11 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application-actions: Added clone-project option to app-menu (2.38 KB, patch)
2017-04-04 06:56 UTC, Pratyusha Musunuru
none Details | Review
application-actions: Added clone-project option to app-menu (2.56 KB, patch)
2017-04-04 10:31 UTC, Pratyusha Musunuru
needs-work Details | Review

Description Carlos Soriano 2017-03-16 14:47:17 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.
Comment 1 Carlos Soriano 2017-03-16 14:48:35 UTC
-> newcomers, appropriate as a first task once the maintainer agrees.
Comment 2 Christian Hergert 2017-03-18 06:10:12 UTC
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.
Comment 3 Pratyusha Musunuru 2017-04-04 06:56:33 UTC
Created attachment 349216 [details] [review]
application-actions: Added clone-project option to app-menu
Comment 4 Carlos Soriano 2017-04-04 07:29:41 UTC
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.
Comment 5 Pratyusha Musunuru 2017-04-04 10:31:42 UTC
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 6 Pratyusha Musunuru 2017-04-04 10:34:31 UTC
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?
Comment 7 Christian Hergert 2017-04-04 23:12:20 UTC
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!
Comment 8 Christian Hergert 2017-04-04 23:13:46 UTC
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.
Comment 9 GNOME Infrastructure Team 2018-01-11 10:21:12 UTC
-- 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.