Fixes a compilation warning with osso-abook
[modest] / src / hildon2 / modest-maemo-utils.c
index 0f56b59..0aa0c6c 100644 (file)
@@ -204,7 +204,7 @@ modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser)
 
        /* Set the default folder to images folder */
        images_folder = g_build_filename (g_get_home_dir (), 
-                                         MODEST_MAEMO_UTILS_MYDOCS_FOLDER,
+                                         g_getenv (MODEST_MAEMO_UTILS_MYDOCS_ENV),
                                          MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER, NULL);
        gtk_file_chooser_set_current_folder (chooser, images_folder);
        g_free (images_folder);
@@ -309,10 +309,39 @@ modest_maemo_utils_create_captioned    (GtkSizeGroup *title_size_group,
                                        const gchar *title,
                                        GtkWidget *control)
 {
+       return modest_maemo_utils_create_captioned_with_size_type (title_size_group,
+                                                                  value_size_group,
+                                                                  title,
+                                                                  control,
+                                                                  HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+}
+
+/**
+ * modest_maemo_utils_create_captioned_with_size_type:
+ * @title_size_group: a #GtkSizeGroup
+ * @value_size_group: a #GtkSizeGroup
+ * @title: a string
+ * @control: a #GtkWidget
+ * @size_type: a #HildonSizeType
+ *
+ * this creates a widget (a #GtkHBox) with a control, and a label
+ * (@string) captioning it. It also uses the proper size groups for title
+ * and control.
+ *
+ * Returns: a widget containing the control and a proper label.
+ */
+GtkWidget *
+modest_maemo_utils_create_captioned_with_size_type    (GtkSizeGroup *title_size_group,
+                                                      GtkSizeGroup *value_size_group,
+                                                      const gchar *title,
+                                                      GtkWidget *control,
+                                                      HildonSizeType size_type)
+{
        GtkWidget *label;
        GtkWidget *box;
   
        label = gtk_label_new (title);
+       hildon_gtk_widget_set_theme_size (label, HILDON_SIZE_FINGER_HEIGHT);
        gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
        gtk_widget_show (label);
        box = gtk_hbox_new (TRUE, MODEST_MARGIN_HALF);
@@ -323,7 +352,7 @@ modest_maemo_utils_create_captioned    (GtkSizeGroup *title_size_group,
        if (value_size_group)
                gtk_size_group_add_widget (value_size_group, control);
 
-       hildon_gtk_widget_set_theme_size (control, HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+       hildon_gtk_widget_set_theme_size (control, size_type);
 
        return box;
 }