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 623370 - Add a help button
Add a help button
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-02 11:11 UTC by Garrett Regier
Modified: 2010-07-22 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added PeasUIHelpable and a Help button to the plugin manager (14.66 KB, patch)
2010-07-02 11:14 UTC, Garrett Regier
none Details | Review
Added Help to the plugin info and a Help button to the plugin manager (9.69 KB, patch)
2010-07-02 20:24 UTC, Garrett Regier
needs-work Details | Review
Added a Help uro to the plugin info and a Help button to the plugin manager v2 (10.78 KB, patch)
2010-07-07 19:20 UTC, Garrett Regier
reviewed Details | Review
Added a Help URI to the plugin info and a Help button to the plugin manager v3 (9.74 KB, patch)
2010-07-08 05:25 UTC, Garrett Regier
needs-work Details | Review
Added a Help button to the plugin manager v4 (8.04 KB, patch)
2010-07-20 19:01 UTC, Garrett Regier
committed Details | Review

Description Garrett Regier 2010-07-02 11:11:13 UTC
The plugin manager should have a help button which plugins can make sensitive by implementing a PeasUIHelpable interface and overriding the show_help method.
Comment 1 Garrett Regier 2010-07-02 11:14:10 UTC
Created attachment 165090 [details] [review]
Added PeasUIHelpable and a Help button to the plugin manager
Comment 2 Steve Frécinaux 2010-07-02 12:23:23 UTC
To be honest I don't like the idea to add an extension interface for that at all.

I would prefer to have a new plugin info property ("Help-URI" ?) which would contain the URI for the help file. The host program could do whatever it wants to do with it, and libpeasui would just use it to add a "help" button in the configuration dialog for the plugin and/or to the about box.

Using an URI also has the advantage that you can specify either a gnome help page through ghelp:, a website page through http: or even a local file through file:, just by using gtk_show_uri or equivalent.

The issue I can see is about portability and win32/osx support. win32 help files could be a simple URL as well, but I have no idea how help works in osX.
Also it might be good if we allowed to specify the help file url for all the supported systems at once, so plugins can be copied from gnome to win32 painlessly.
Comment 3 Garrett Regier 2010-07-02 20:24:45 UTC
Created attachment 165147 [details] [review]
Added Help to the plugin info and a Help button to the plugin manager
Comment 4 Steve Frécinaux 2010-07-04 21:22:44 UTC
Review of attachment 165147 [details] [review]:

::: libpeas/peas-plugin-info-priv.h
@@ +45,3 @@
   gchar *website;
   gchar *version;
+  gchar *help;

Please help something more explicit, like "help_uri".

::: libpeasui/peas-ui-plugin-info.h
@@ +29,2 @@
 const gchar  *peas_ui_plugin_info_get_icon_name            (PeasPluginInfo *info);
+const gchar  *peas_ui_plugin_info_get_help                 (const PeasPluginInfo *info);

Idem, use help_uri.

I guess it could go as peas_plugin_info_get_help_uri in peas-plugin-info.h: I secretely dream about killing peas-ui-plugin-info.h

::: peas-demo/plugins/helloworld/helloworld.peasdemo-plugin
@@ +9,3 @@
+[Linux]
+
+Help=http://git.gnome.org/browse/libpeas/

Could you please *not* use an INI section?

The reason is that I'd like to keep them for other uses (like plugins for several apps)

I'd propose Help, Help-Gnome, Help-Windows, Help-MacOS-X
Comment 5 Garrett Regier 2010-07-07 19:20:28 UTC
Created attachment 165435 [details] [review]
Added a Help uro to the plugin info and a Help button to the plugin manager v2
Comment 6 Steve Frécinaux 2010-07-07 19:48:56 UTC
Review of attachment 165435 [details] [review]:

::: libpeas/peas-plugin-info.c
@@ +302,3 @@
 
+  /* Get Help */
+  tmp = g_strdup_printf ("Help-%s", os_name);

Why don't you do something like this:

  str = g_key_file_get_string (plugin_file, section_header, OS_SPECIFIC_HELP_KEY, NULL);

and use a #define instead of g_strdup_printf ?

::: libpeasui/peas-ui-plugin-manager.c
@@ +988,3 @@
+  pm->priv->help_button = gtk_button_new_from_stock (GTK_STOCK_HELP);
+  gtk_container_add (GTK_CONTAINER (hbuttonbox), pm->priv->help_button);
+  gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (hbuttonbox), pm->priv->help_button, TRUE);

I still think this help button should be located on the configure dialog rather than on the bottom left of the plugin manager: putting the button on the plugin manager sort of implies the help is about the plugin manager dialog.
Comment 7 Garrett Regier 2010-07-08 05:25:31 UTC
Created attachment 165453 [details] [review]
Added a Help URI to the plugin info and a Help button to the plugin manager v3
Comment 8 Steve Frécinaux 2010-07-15 14:08:13 UTC
Review of attachment 165453 [details] [review]:

This patch looks mostly good. It will go soon I'm sure. After the manager split patch?


BTW the patch title exceeds 72 chars. You can probably mention the help button only in the commit message since it's a consequency of the support for the help uri...

the pythonhello.py part should probably go as a separate plugin, and not extend the existing class but another one. A configurable python plugin is really missing right now.

::: libpeas/peas-plugin-info.c
@@ +135,3 @@
+          g_str_equal (keys[i], "Version") ||
+          g_str_equal (keys[i], "Help") ||
+          g_str_equal (keys[i], OS_HELP_KEY))

I liked the strprefix solution more. If you do what you do now, you will add Help-MacOS-X in the hash table if you are using gedit on GNOME

::: libpeasui/peas-ui-plugin-info.h
@@ +29,2 @@
 const gchar  *peas_ui_plugin_info_get_icon_name            (PeasPluginInfo *info);
+const gchar  *peas_ui_plugin_info_get_help_uri             (const PeasPluginInfo *info);

I think it could go in libpeas/peas-plugin-info.h as you can imagine writing the URI string or launching a browser to it even if you're not using Gtk+ (Clutter comes to mind)

::: libpeasui/peas-ui-plugin-manager.c
@@ +214,3 @@
+  GtkWindow *toplevel;
+  GtkWidget *error_dlg;
+  GtkWindowGroup *wg;

I know it's harder, but those vars should be defined at the top of the function to avoid having some compilers complain (I can hear the solaris guys screaming)

@@ +267,3 @@
   GtkWindow *toplevel;
   GtkWidget *conf_widget = NULL;
+  gchar *title;

What is this new variable for?

::: peas-demo/plugins/pythonhello/pythonhello.py
@@ +9,3 @@
 LABEL_STRING="Python Says Hello!"
 
+class PythonHelloPlugin(gobject.GObject, Peas.Activatable, PeasUI.Configurable):

You should create a new class instead of extending the existing one in order to show "best practices".
Comment 9 Garrett Regier 2010-07-20 19:01:01 UTC
Created attachment 166233 [details] [review]
Added a Help button to the plugin manager v4
Comment 10 Steve Frécinaux 2010-07-21 11:28:21 UTC
Review of attachment 166233 [details] [review]:

Looks great to me. Feel free to push, with an explanation of the way you implemented things (using Help: in the plugin info file) in the commit message.

Thanks.
Comment 11 Steve Frécinaux 2010-07-22 11:01:17 UTC
The patch 166233 has been committed. The fix will be available in the next release.

Thanks!