[gthumb] [importer] added a help box for the custom format



commit d1586eb5998d4bcb122a242f0715ad271bf00cfe
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Jul 2 21:40:43 2010 +0200

    [importer] added a help box for the custom format

 extensions/importer/data/ui/import-preferences.ui  |  355 ++++++++++++++++++--
 .../importer/gth-import-preferences-dialog.c       |   23 ++
 2 files changed, 352 insertions(+), 26 deletions(-)
---
diff --git a/extensions/importer/data/ui/import-preferences.ui b/extensions/importer/data/ui/import-preferences.ui
index 2eb912a..f1d7cca 100644
--- a/extensions/importer/data/ui/import-preferences.ui
+++ b/extensions/importer/data/ui/import-preferences.ui
@@ -87,6 +87,7 @@
             </child>
           </object>
           <packing>
+            <property name="expand">False</property>
             <property name="position">0</property>
           </packing>
         </child>
@@ -96,60 +97,361 @@
             <property name="top_padding">6</property>
             <property name="left_padding">14</property>
             <child>
-              <object class="GtkHBox" id="subfolder_type_box">
+              <object class="GtkHBox" id="subfolder_type_box1">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
                 <child>
-                  <placeholder/>
+                  <object class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkHBox" id="subfolder_type_box">
+                        <property name="visible">True</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
                 </child>
                 <child>
-                  <object class="GtkNotebook" id="subfolder_options_notebook">
+                  <object class="GtkVBox" id="vbox1">
                     <property name="visible">True</property>
-                    <property name="show_tabs">False</property>
-                    <property name="show_border">False</property>
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkCheckButton" id="single_subfolder_checkbutton">
-                        <property name="label" translatable="yes">as _single subfolder</property>
+                      <object class="GtkNotebook" id="subfolder_options_notebook">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="show_tabs">False</property>
+                        <property name="show_border">False</property>
+                        <child>
+                          <object class="GtkCheckButton" id="single_subfolder_checkbutton">
+                            <property name="label" translatable="yes">as _single subfolder</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                        </child>
+                        <child type="tab">
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="custom_format_entry">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="invisible_char">&#x25CF;</property>
+                            <property name="width_chars">25</property>
+                            <property name="secondary_icon_stock">gtk-help</property>
+                            <property name="secondary_icon_activatable">True</property>
+                            <property name="secondary_icon_sensitive">True</property>
+                            <property name="secondary_icon_tooltip_text">Help</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child type="tab">
+                          <placeholder/>
+                        </child>
+                        <child>
+                          <placeholder/>
+                        </child>
+                        <child type="tab">
+                          <placeholder/>
+                        </child>
                       </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
                     </child>
-                    <child type="tab">
-                      <placeholder/>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkAlignment" id="template_help_alignment">
+            <property name="top_padding">6</property>
+            <property name="left_padding">14</property>
+            <child>
+              <object class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <child>
+                  <object class="GtkTable" id="template_help_table">
+                    <property name="visible">True</property>
+                    <property name="n_rows">8</property>
+                    <property name="n_columns">2</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label6">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%E</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
                     </child>
                     <child>
-                      <object class="GtkEntry" id="custom_format_entry">
+                      <object class="GtkLabel" id="label11">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="invisible_char">&#x25CF;</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The event description</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
                       </object>
                       <packing>
-                        <property name="position">1</property>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                       </packing>
                     </child>
-                    <child type="tab">
-                      <placeholder/>
+                    <child>
+                      <object class="GtkLabel" id="label14">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Special code</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label15">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Description</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                      </packing>
                     </child>
                     <child>
-                      <placeholder/>
+                      <object class="GtkLabel" id="label4">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%Y</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
                     </child>
-                    <child type="tab">
-                      <placeholder/>
+                    <child>
+                      <object class="GtkLabel" id="label5">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%m</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label7">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%d</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label8">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%H</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label9">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%M</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">6</property>
+                        <property name="bottom_attach">7</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label10">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label">%S</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">7</property>
+                        <property name="bottom_attach">8</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label12">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The year</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label13">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The month</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label16">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The day of the month</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label17">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The hour</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">5</property>
+                        <property name="bottom_attach">6</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label18">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The minutes</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">6</property>
+                        <property name="bottom_attach">7</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label19">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">The seconds</property>
+                        <attributes>
+                          <attribute name="size" value="8000"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">7</property>
+                        <property name="bottom_attach">8</property>
+                      </packing>
                     </child>
                   </object>
                   <packing>
-                    <property name="pack_type">end</property>
-                    <property name="position">1</property>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
               </object>
             </child>
           </object>
           <packing>
-            <property name="position">1</property>
+            <property name="expand">False</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
@@ -170,7 +472,7 @@
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="position">2</property>
+            <property name="position">3</property>
           </packing>
         </child>
       </object>
@@ -235,6 +537,7 @@
         </child>
       </object>
       <packing>
+        <property name="expand">False</property>
         <property name="position">2</property>
       </packing>
     </child>
diff --git a/extensions/importer/gth-import-preferences-dialog.c b/extensions/importer/gth-import-preferences-dialog.c
index 016d81c..a693de6 100644
--- a/extensions/importer/gth-import-preferences-dialog.c
+++ b/extensions/importer/gth-import-preferences-dialog.c
@@ -39,6 +39,7 @@ struct _GthImportPreferencesDialogPrivate {
 	GtkWidget  *subfolder_type_list;
 	GtkWidget  *subfolder_format_list;
 	char       *event;
+	gboolean    help_visible;
 };
 
 
@@ -279,6 +280,23 @@ custom_format_entry_changed_cb (GtkEditable *editable,
 
 
 static void
+custom_format_entry_icon_press_cb (GtkEntry             *entry,
+				   GtkEntryIconPosition  icon_pos,
+				   GdkEvent             *event,
+				   gpointer              user_data)
+{
+	GthImportPreferencesDialog *self = user_data;
+
+	self->priv->help_visible = ! self->priv->help_visible;
+
+	if (self->priv->help_visible)
+		gtk_widget_show (GET_WIDGET ("template_help_alignment"));
+	else
+		gtk_widget_hide (GET_WIDGET ("template_help_alignment"));
+}
+
+
+static void
 dialog_response_cb (GtkDialog *dialog,
                     int        response_id,
                     gpointer   user_data)
@@ -300,6 +318,7 @@ gth_import_preferences_dialog_init (GthImportPreferencesDialog *self)
 
 	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_PREFERENCES_DIALOG, GthImportPreferencesDialogPrivate);
 	self->priv->builder = _gtk_builder_new_from_file ("import-preferences.ui", "importer");
+	self->priv->help_visible = FALSE;
 
 	gtk_window_set_title (GTK_WINDOW (self), _("Preferences"));
 	gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
@@ -391,6 +410,10 @@ gth_import_preferences_dialog_init (GthImportPreferencesDialog *self)
 			  "changed",
 			  G_CALLBACK (custom_format_entry_changed_cb),
 			  self);
+	g_signal_connect (GET_WIDGET ("custom_format_entry"),
+			  "icon-press",
+			  G_CALLBACK (custom_format_entry_icon_press_cb),
+			  self);
 	g_signal_connect (self,
 			  "response",
 			  G_CALLBACK (dialog_response_cb),



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