[gnome-photos/wip/rishi/export] export-dialog: Add an explanatory message



commit 8af085f90a10b46bbbe691049cfff30528c3f77c
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Dec 30 20:38:06 2015 +0100

    export-dialog: Add an explanatory message
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759363

 src/photos-export-dialog.c  |   17 +++++++++++++++++
 src/photos-export-dialog.ui |   16 ++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-export-dialog.c b/src/photos-export-dialog.c
index 8ce9eda..849a9be 100644
--- a/src/photos-export-dialog.c
+++ b/src/photos-export-dialog.c
@@ -35,6 +35,7 @@ struct _PhotosExportDialog
   GtkWidget *folder_name_label;
   GtkWidget *full_button;
   GtkWidget *full_label;
+  GtkWidget *msg_label;
   GtkWidget *reduced_button;
   GtkWidget *reduced_label;
   GtkWidget *size_label;
@@ -202,10 +203,25 @@ photos_export_dialog_set_property (GObject *object, guint prop_id, const GValue
 static void
 photos_export_dialog_init (PhotosExportDialog *self)
 {
+  const gchar *pictures_path;
+  gchar *msg;
+  gchar *pictures_path_basename;
+
   gtk_widget_init_template (GTK_WIDGET (self));
 
   self->cancellable = g_cancellable_new ();
+
+  pictures_path = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+  pictures_path_basename = g_path_get_basename (pictures_path);
+  msg = g_strdup_printf (_("Photos are exported to the %s ▶ %s folder."),
+                         pictures_path_basename,
+                         PHOTOS_EXPORT_SUBPATH);
+  gtk_label_set_label (GTK_LABEL (self->msg_label), msg);
+
   self->reduced_zoom = -1.0;
+
+  g_free (msg);
+  g_free (pictures_path_basename);
 }
 
 
@@ -232,6 +248,7 @@ photos_export_dialog_class_init (PhotosExportDialogClass *class)
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, folder_name_label);
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, full_button);
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, full_label);
+  gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, msg_label);
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, reduced_button);
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, reduced_label);
   gtk_widget_class_bind_template_child (widget_class, PhotosExportDialog, size_label);
diff --git a/src/photos-export-dialog.ui b/src/photos-export-dialog.ui
index 9f9bda9..d84ee7e 100644
--- a/src/photos-export-dialog.ui
+++ b/src/photos-export-dialog.ui
@@ -35,9 +35,24 @@
             <property name="margin">12</property>
             <property name="row_spacing">6</property>
             <child>
+              <object class="GtkLabel" id="msg_label">
+                <property name="halign">start</property>
+                <property name="margin_bottom">6</property>
+                <style>
+                  <class name="dim-label"/>
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">3</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkLabel" id="folder_name_label">
                 <property name="halign">end</property>
                 <property name="label" translatable="yes">_Folder Name</property>
+                <property name="margin_top">6</property>
                 <property name="mnemonic_widget">dir_entry</property>
                 <property name="use_underline">1</property>
                 <style>
@@ -52,6 +67,7 @@
             <child>
               <object class="GtkEntry" id="dir_entry">
                 <property name="activates_default">1</property>
+                <property name="margin_top">6</property>
                 <property name="width_chars">30</property>
               </object>
               <packing>


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