[nautilus-actions] Make import/export assistants labels wrappable



commit 30dc3b9a8724dcfbf0bff06be027068eeba2264a
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Dec 12 07:44:26 2011 +0100

    Make import/export assistants labels wrappable

 ChangeLog                                |    4 +++
 src/nact/nact-assistant-export.ui        |   11 ++++++---
 src/nact/nact-export-format.c            |    4 ++-
 src/nact/nact-export-format.h            |   31 ++++++++++++++++++-----------
 src/nact/nautilus-actions-config-tool.ui |    4 +++
 5 files changed, 37 insertions(+), 17 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5318f3a..d3be197 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-12-12 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-assistant-export.ui:
+	* src/nact/nautilus-actions-config-tool.ui:
+	* src/nact/nact-export-format.c (draw_in_vbox): Make assistant labels wrappable.
+
 	* src/io-desktop/nadp-formats.c:
 	* src/io-xml/naxml-formats.c: Review the description of the export formats.
 
diff --git a/src/nact/nact-assistant-export.ui b/src/nact/nact-assistant-export.ui
index 3eb217f..5f6a991 100644
--- a/src/nact/nact-assistant-export.ui
+++ b/src/nact/nact-assistant-export.ui
@@ -13,6 +13,7 @@
       <object class="GtkLabel" id="label20">
         <property name="visible">True</property>
         <property name="label" translatable="yes">This assistant will guide you through the process of exporting actions.</property>
+        <property name="wrap">True</property>
       </object>
       <packing>
         <property name="page_type">intro</property>
@@ -67,11 +68,10 @@
         <child>
           <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
-            <property name="label" translatable="yes">Please select one or more actions
-to be exported.
+            <property name="label" translatable="yes">Please select one or more actions to be exported.
 
-You may use Ctrl and Shift keys
-to extend a selection.</property>
+You may use Ctrl and Shift keys to extend the selection.</property>
+            <property name="wrap">True</property>
           </object>
           <packing>
             <property name="position">1</property>
@@ -120,6 +120,7 @@ to extend a selection.</property>
                 <property name="ypad">10</property>
                 <property name="label" translatable="yes">&lt;b&gt;Which format should I use when exporting these items ?&lt;/b&gt;</property>
                 <property name="use_markup">True</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -184,6 +185,7 @@ to extend a selection.</property>
             <property name="xalign">0</property>
             <property name="xpad">20</property>
             <property name="use_markup">True</property>
+            <property name="wrap">True</property>
           </object>
           <packing>
             <property name="position">0</property>
@@ -266,6 +268,7 @@ to extend a selection.</property>
                     <property name="xalign">0</property>
                     <property name="xpad">6</property>
                     <property name="label" translatable="yes">Which format should I choose to export it ?</property>
+                    <property name="wrap">True</property>
                   </object>
                   <packing>
                     <property name="position">1</property>
diff --git a/src/nact/nact-export-format.c b/src/nact/nact-export-format.c
index b825a91..c4b0773 100644
--- a/src/nact/nact-export-format.c
+++ b/src/nact/nact-export-format.c
@@ -199,7 +199,7 @@ draw_in_vbox( GtkWidget *container, const NAExportFormat *format, guint mode, gi
 			label = na_export_format_get_label( format );
 			markup = g_markup_printf_escaped( "%s", label );
 			gtk_button_set_label( GTK_BUTTON( button ), label );
-			g_object_set( G_OBJECT( button ), "use_underline", TRUE, NULL );
+			gtk_button_set_use_underline( GTK_BUTTON( button ), TRUE );
 			break;
 
 		/* this work fine, but it appears that this is not consistant with import assistant */
@@ -225,6 +225,8 @@ draw_in_vbox( GtkWidget *container, const NAExportFormat *format, guint mode, gi
 			gtk_misc_set_padding( GTK_MISC( desc_label ), size, ypad );
 			gtk_misc_get_alignment( GTK_MISC( desc_label ), NULL, &yalign );
 			gtk_misc_set_alignment( GTK_MISC( desc_label ), 0, yalign );
+			gtk_label_set_line_wrap( desc_label, TRUE );
+			gtk_label_set_line_wrap_mode( desc_label, PANGO_WRAP_WORD );
 
 #if GTK_CHECK_VERSION( 3, 2, 0 )
 			gtk_grid_attach( GTK_GRID( container_mode ), GTK_WIDGET( desc_label ), 0, 1, 1, 1 );
diff --git a/src/nact/nact-export-format.h b/src/nact/nact-export-format.h
index cc31127..a53a7b6 100644
--- a/src/nact/nact-export-format.h
+++ b/src/nact/nact-export-format.h
@@ -35,6 +35,11 @@
  * SECTION: nact_export_format
  * @short_description: Displays the list of available export formats.
  * @include: nact/nact-export-format.h
+ *
+ * Export formats are defined by their respective I/O providers
+ * (see e.g. src/io-xml/naxml-formats.c or src/io-desktop/nadp-formats.c).
+ * Each export format must have at least a (short) label, and should have
+ * a full description.
  */
 
 #include <gtk/gtk.h>
@@ -45,24 +50,26 @@
 G_BEGIN_DECLS
 
 enum {
-	/* ask for export format dialog box
-	 * only display the 'ask_label' short export format label
-	 * do not display the full description
-	 * do not propose the 'Ask me' choice
+	/* At export time, when the user has required to be asked for the
+	 * exact format of each exported item (NactExportAsk dialog):
+	 * - display the (short) label of the format
+	 * - do not display the full description (but set the tooltip)
+	 * - do not propose the 'Ask me' choice
 	 */
 	EXPORT_FORMAT_DISPLAY_ASK = 1,
 
-	/* export assistant
-	 * display the assistant short label in bold
-	 * display the full description
-	 * propose the 'Ask me' choice
+	/* When running the export assistant, display the available export
+	 * formats to let the user pick one of them (NactAssistantExport):
+	 * - display the (short) label
+	 * - display the full description (and set the tooltip)
+	 * - propose the 'Ask me' choice
 	 */
 	EXPORT_FORMAT_DISPLAY_ASSISTANT,
 
-	/* preferences editor
-	 * display the assistant short label
-	 * do not display the full description
-	 * propose the 'Ask me' choice
+	/* When tuning the user's preferences (NactPreferencesEditor):
+	 * - display the (short) label
+	 * - do not display the full description (but set the tooltip)
+	 * - propose the 'Ask me' choice
 	 */
 	EXPORT_FORMAT_DISPLAY_PREFERENCES,
 };
diff --git a/src/nact/nautilus-actions-config-tool.ui b/src/nact/nautilus-actions-config-tool.ui
index 67df782..5cf6806 100644
--- a/src/nact/nautilus-actions-config-tool.ui
+++ b/src/nact/nautilus-actions-config-tool.ui
@@ -2679,6 +2679,7 @@ There may be multiple reasons for why an item cannot be edited. See your User's
       <object class="GtkLabel" id="label3">
         <property name="visible">True</property>
         <property name="label" translatable="yes">This assistant will guide you through the process of importing items, actions or menus.</property>
+        <property name="wrap">True</property>
       </object>
       <packing>
         <property name="page_type">intro</property>
@@ -2720,6 +2721,7 @@ There may be multiple reasons for why an item cannot be edited. See your User's
                 <property name="ypad">10</property>
                 <property name="label" translatable="yes">&lt;b&gt;What should I do when importing an item whose ID already exists ?&lt;/b&gt;</property>
                 <property name="use_markup">True</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -2757,6 +2759,7 @@ There may be multiple reasons for why an item cannot be edited. See your User's
                             <property name="label" translatable="yes">This used to be the historical behavior.
 The selected file will be marked as "NOT OK" in the Summary page.
 The existing item will not be modified.</property>
+                            <property name="wrap">True</property>
                           </object>
                           <packing>
                             <property name="padding">4</property>
@@ -2930,6 +2933,7 @@ Be warned: this mode may be dangerous. You will not be prompted another time.</p
             <property name="visible">True</property>
             <property name="xalign">0</property>
             <property name="xpad">20</property>
+            <property name="wrap">True</property>
           </object>
           <packing>
             <property name="position">0</property>



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