gimp r26058 - in trunk: . app/dialogs app/widgets



Author: neo
Date: Fri Jul  4 18:41:58 2008
New Revision: 26058
URL: http://svn.gnome.org/viewvc/gimp?rev=26058&view=rev

Log:
2008-07-04  Sven Neumann  <sven gimp org>

	* app/widgets/gimphelp.[ch]: added a function to get the 
location
	where the user manual is expected if it is installed locally.

	* app/dialogs/preferences-dialog.c: inform the user about the
	presence or absence of the user manual.



Modified:
   trunk/ChangeLog
   trunk/app/dialogs/preferences-dialog.c
   trunk/app/widgets/gimphelp.c
   trunk/app/widgets/gimphelp.h

Modified: trunk/app/dialogs/preferences-dialog.c
==============================================================================
--- trunk/app/dialogs/preferences-dialog.c	(original)
+++ trunk/app/dialogs/preferences-dialog.c	Fri Jul  4 18:41:58 2008
@@ -43,6 +43,7 @@
 #include "widgets/gimpdevices.h"
 #include "widgets/gimpdialogfactory.h"
 #include "widgets/gimpgrideditor.h"
+#include "widgets/gimphelp.h"
 #include "widgets/gimphelp-ids.h"
 #include "widgets/gimpmessagebox.h"
 #include "widgets/gimpmessagedialog.h"
@@ -1799,14 +1800,53 @@
 
   {
     GtkWidget *combo;
+    GtkWidget *hbox;
+    GtkWidget *image;
+    GtkWidget *label;
+    gchar     *dir;
+    gint       width;
 
-    table = prefs_table_new (1, GTK_CONTAINER (vbox2));
+    table = prefs_table_new (2, GTK_CONTAINER (vbox2));
     combo = prefs_boolean_combo_box_add (object, "user-manual-online",
                                          _("Use the online version"),
                                          _("Use a locally installed copy"),
                                          _("User manual:"),
                                          GTK_TABLE (table), 0, size_group);
     gimp_help_set_help_data (combo, NULL, NULL);
+
+    dir = gimp_help_get_manual_location ();
+
+    if (g_file_test (dir, G_FILE_TEST_IS_DIR))
+      {
+        image = gtk_image_new_from_stock (GIMP_STOCK_INFO,
+                                          GTK_ICON_SIZE_MENU);
+        label = gtk_label_new (_("The user manual is installed locally."));
+      }
+    else
+      {
+        image = gtk_image_new_from_stock (GIMP_STOCK_WARNING,
+                                          GTK_ICON_SIZE_MENU);
+        label = gtk_label_new (_("The user manual is not installed."));
+      }
+
+    hbox = gtk_hbox_new (FALSE, 6);
+    gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 2, 1, 2);
+    gtk_widget_show (hbox);
+
+    gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+    gtk_widget_show (image);
+
+    gimp_label_set_attributes (GTK_LABEL (label),
+                               PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
+                               -1);
+    gtk_widget_get_size_request (combo, &width, NULL);
+    gtk_widget_set_size_request (label, width - 20, -1);
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+    gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+    gtk_widget_show (label);
+
+    g_free (dir);
   }
 
   /*  Help Browser  */

Modified: trunk/app/widgets/gimphelp.c
==============================================================================
--- trunk/app/widgets/gimphelp.c	(original)
+++ trunk/app/widgets/gimphelp.c	Fri Jul  4 18:41:58 2008
@@ -127,6 +127,12 @@
     }
 }
 
+gchar *
+gimp_help_get_manual_location (void)
+{
+  return g_build_filename (gimp_data_directory (), "help", NULL);
+}
+
 
 /*  private functions  */
 
@@ -454,7 +460,7 @@
   if (config->user_manual_online)
     return g_strdup (config->user_manual_online_uri);
 
-  dir = g_build_filename (gimp_data_directory (), "help", NULL);
+  dir = gimp_help_get_manual_location ();
   uri = g_filename_to_uri (dir, NULL, NULL);
   g_free (dir);
 

Modified: trunk/app/widgets/gimphelp.h
==============================================================================
--- trunk/app/widgets/gimphelp.h	(original)
+++ trunk/app/widgets/gimphelp.h	Fri Jul  4 18:41:58 2008
@@ -27,10 +27,15 @@
  *
  *  there should be no need to use it directly
  */
-void   gimp_help_show (Gimp         *gimp,
-                       GimpProgress *progress,
-                       const gchar  *help_domain,
-                       const gchar  *help_id);
+void    gimp_help_show (Gimp         *gimp,
+                        GimpProgress *progress,
+                        const gchar  *help_domain,
+                        const gchar  *help_id);
+
+
+/*  returns the folder where the user manual should be installed
+ */
+gchar * gimp_help_get_manual_location (void);
 
 
 #endif /* __GIMP_HELP_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]