Hide more help-related widgets when evolution-help is not installed

This commit is contained in:
Milan Crha 2013-11-11 21:42:44 +01:00
parent 97f519297b
commit 15ce829748
2 changed files with 149 additions and 12 deletions

View File

@ -1,21 +1,155 @@
diff -up evolution-3.10.0/shell/e-shell-window-actions.c.help-contents evolution-3.10.0/shell/e-shell-window-actions.c
--- evolution-3.10.0/shell/e-shell-window-actions.c.help-contents 2013-09-07 18:34:59.000000000 +0200
+++ evolution-3.10.0/shell/e-shell-window-actions.c 2013-10-10 08:51:03.863987108 +0200
@@ -1414,6 +1414,17 @@ e_shell_window_actions_init (EShellWindo
diff -up evolution-3.11.1/addressbook/gui/contact-editor/e-contact-editor.c.help-contents evolution-3.11.1/addressbook/gui/contact-editor/e-contact-editor.c
--- evolution-3.11.1/addressbook/gui/contact-editor/e-contact-editor.c.help-contents 2013-10-20 16:23:21.000000000 +0200
+++ evolution-3.11.1/addressbook/gui/contact-editor/e-contact-editor.c 2013-11-11 21:39:21.984600383 +0100
@@ -4182,6 +4182,11 @@ e_contact_editor_init (EContactEditor *e
g_signal_connect (
widget, "clicked",
G_CALLBACK (show_help_cb), e_contact_editor);
+ if (!e_misc_utils_is_help_package_installed ()) {
+ gtk_widget_set_sensitive (widget, FALSE);
+ gtk_widget_hide (widget);
+ }
+
widget = e_builder_get_widget (
e_contact_editor->builder, "button-web-expand");
g_signal_connect_swapped (
diff -up evolution-3.11.1/calendar/gui/dialogs/comp-editor.c.help-contents evolution-3.11.1/calendar/gui/dialogs/comp-editor.c
--- evolution-3.11.1/calendar/gui/dialogs/comp-editor.c.help-contents 2013-10-20 16:23:34.000000000 +0200
+++ evolution-3.11.1/calendar/gui/dialogs/comp-editor.c 2013-11-11 21:39:21.986600383 +0100
@@ -2152,6 +2152,12 @@ comp_editor_init (CompEditor *editor)
G_BINDING_SYNC_CREATE);
}
+ action = gtk_action_group_get_action (action_group, "help");
+ if (action && !e_misc_utils_is_help_package_installed ()) {
+ gtk_action_set_visible (action, FALSE);
+ gtk_action_set_sensitive (action, FALSE);
+ }
+
action_group = gtk_action_group_new ("individual");
gtk_action_group_set_translation_domain (
action_group, GETTEXT_PACKAGE);
diff -up evolution-3.11.1/e-util/e-misc-utils.c.help-contents evolution-3.11.1/e-util/e-misc-utils.c
--- evolution-3.11.1/e-util/e-misc-utils.c.help-contents 2013-10-20 16:23:09.000000000 +0200
+++ evolution-3.11.1/e-util/e-misc-utils.c 2013-11-11 21:39:21.987600383 +0100
@@ -2097,3 +2097,20 @@ e_binding_transform_uid_to_source (GBind
return success;
}
+
+gboolean
+e_misc_utils_is_help_package_installed (void)
+{
+ gboolean is_installed;
+ gchar *path;
+
+ /* Viewing user documentation requires the evolution-help
+ * package. Look for one of the files it installs. */
+ path = g_build_filename (EVOLUTION_DATADIR, "help", "C", PACKAGE, "index.page", NULL);
+
+ is_installed = g_file_test (path, G_FILE_TEST_IS_REGULAR);
+
+ g_free (path);
+
+ return is_installed;
+}
diff -up evolution-3.11.1/e-util/e-misc-utils.h.help-contents evolution-3.11.1/e-util/e-misc-utils.h
--- evolution-3.11.1/e-util/e-misc-utils.h.help-contents 2013-10-20 16:23:08.000000000 +0200
+++ evolution-3.11.1/e-util/e-misc-utils.h 2013-11-11 21:39:21.987600383 +0100
@@ -185,6 +185,8 @@ gboolean e_binding_transform_uid_to_sour
GValue *target_value,
ESourceRegistry *registry);
+gboolean e_misc_utils_is_help_package_installed (void);
+
G_END_DECLS
#endif /* E_MISC_UTILS_H */
diff -up evolution-3.11.1/e-util/e-preferences-window.c.help-contents evolution-3.11.1/e-util/e-preferences-window.c
--- evolution-3.11.1/e-util/e-preferences-window.c.help-contents 2013-10-20 16:23:14.000000000 +0200
+++ evolution-3.11.1/e-util/e-preferences-window.c 2013-11-11 21:39:21.987600383 +0100
@@ -385,6 +385,11 @@ e_preferences_window_init (EPreferencesW
GTK_BUTTON_BOX (container), widget, TRUE);
gtk_widget_show (widget);
+ if (!e_misc_utils_is_help_package_installed ()) {
+ gtk_widget_set_sensitive (widget, FALSE);
+ gtk_widget_hide (widget);
+ }
+
widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
g_signal_connect_swapped (
widget, "clicked",
diff -up evolution-3.11.1/e-util/e-send-options.c.help-contents evolution-3.11.1/e-util/e-send-options.c
--- evolution-3.11.1/e-util/e-send-options.c.help-contents 2013-10-20 16:22:51.000000000 +0200
+++ evolution-3.11.1/e-util/e-send-options.c 2013-11-11 21:39:21.988600383 +0100
@@ -440,6 +440,7 @@ get_widgets (ESendOptionsDialog *sod)
{
ESendOptionsDialogPrivate *priv;
GtkBuilder *builder;
+ GtkWidget *helpbutton;
priv = sod->priv;
builder = sod->priv->builder;
@@ -479,6 +480,12 @@ get_widgets (ESendOptionsDialog *sod)
priv->accepted_label = e_builder_get_widget (builder, "accepted-label");
priv->completed_label = e_builder_get_widget (builder, "completed-label");
+ helpbutton = e_builder_get_widget (builder, "helpbutton1");
+ if (helpbutton && !e_misc_utils_is_help_package_installed ()) {
+ gtk_widget_set_sensitive (helpbutton, FALSE);
+ gtk_widget_hide (helpbutton);
+ }
+
return (priv->priority
&& priv->security
&& priv->status
diff -up evolution-3.11.1/plugins/email-custom-header/email-custom-header.c.help-contents evolution-3.11.1/plugins/email-custom-header/email-custom-header.c
--- evolution-3.11.1/plugins/email-custom-header/email-custom-header.c.help-contents 2013-10-20 16:22:22.000000000 +0200
+++ evolution-3.11.1/plugins/email-custom-header/email-custom-header.c 2013-11-11 21:39:21.988600383 +0100
@@ -27,6 +27,7 @@
#include <string.h>
#include <glib/gi18n.h>
+#include "e-util/e-util.h"
#include "mail/em-utils.h"
#include "mail/em-event.h"
#include "composer/e-msg-composer.h"
@@ -117,6 +118,8 @@ static gboolean
epech_get_widgets (CustomHeaderOptionsDialog *mch)
{
CustomHeaderOptionsDialogPrivate *priv;
+ GtkWidget *helpbutton;
+
priv = mch->priv;
#define EMAIL_CUSTOM_HEADER(name) e_builder_get_widget (priv->builder, name)
@@ -127,6 +130,13 @@ epech_get_widgets (CustomHeaderOptionsDi
priv->page = EMAIL_CUSTOM_HEADER ("email-custom-header-vbox");
priv->header_table = EMAIL_CUSTOM_HEADER ("email-custom-header-options");
+
+ helpbutton = EMAIL_CUSTOM_HEADER ("helpbutton1");
+ if (helpbutton && !e_misc_utils_is_help_package_installed ()) {
+ gtk_widget_set_sensitive (helpbutton, FALSE);
+ gtk_widget_hide (helpbutton);
+ }
+
#undef EMAIL_CUSTOM_HEADER
return (priv->page
diff -up evolution-3.11.1/shell/e-shell-window-actions.c.help-contents evolution-3.11.1/shell/e-shell-window-actions.c
--- evolution-3.11.1/shell/e-shell-window-actions.c.help-contents 2013-10-20 16:23:24.000000000 +0200
+++ evolution-3.11.1/shell/e-shell-window-actions.c 2013-11-11 21:39:21.989600383 +0100
@@ -1414,6 +1414,11 @@ e_shell_window_actions_init (EShellWindo
if (path == NULL)
gtk_action_set_visible (ACTION (SUBMIT_BUG), FALSE);
g_free (path);
+
+ /* Viewing user documentation requires the evolution-help
+ * Fedora package. Look for one of the files it installs. */
+ path = g_build_filename (
+ EVOLUTION_DATADIR, "help", "C",
+ PACKAGE, "index.page", NULL);
+ if (!g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
+ if (!e_misc_utils_is_help_package_installed ()) {
+ gtk_action_set_visible (ACTION (CONTENTS), FALSE);
+ gtk_action_set_sensitive (ACTION (CONTENTS), FALSE);
+ }
+ g_free (path);
}
GtkWidget *

View File

@ -31,7 +31,7 @@
Name: evolution
Version: 3.11.1
Release: 1%{?dist}
Release: 2%{?dist}
Group: Applications/Productivity
Summary: Mail and calendar client for GNOME
License: GPLv2+ and GFDL
@ -530,6 +530,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
* Mon Nov 11 2013 Milan Crha <mcrha@redhat.com> - 3.11.1-2
- Hide more help-related widgets when evolution-help is not installed
* Tue Oct 22 2013 Matthew Barnes <mbarnes@redhat.com> - 3.11.1-1
- Update to 3.11.1