[gthumb] [webalbums] make the dialog smaller showing a single row of themes.



commit 7853adcd426a43f8f59d9a9842766755c4e7d293
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Dec 5 20:01:05 2010 +0100

    [webalbums] make the dialog smaller showing a single row of themes.

 extensions/webalbums/data/ui/web-album-exporter.ui |   11 +----
 extensions/webalbums/dlg-web-exporter.c            |   54 ++++++++++++++------
 2 files changed, 40 insertions(+), 25 deletions(-)
---
diff --git a/extensions/webalbums/data/ui/web-album-exporter.ui b/extensions/webalbums/data/ui/web-album-exporter.ui
index fb2c18a..a91a57e 100644
--- a/extensions/webalbums/data/ui/web-album-exporter.ui
+++ b/extensions/webalbums/data/ui/web-album-exporter.ui
@@ -24,7 +24,6 @@
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox6">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
         <property name="spacing">5</property>
         <child>
           <object class="GtkNotebook" id="notebook1">
@@ -35,7 +34,6 @@
               <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame7">
@@ -279,7 +277,6 @@
                         <child>
                           <object class="GtkVBox" id="vbox5">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkHBox" id="hbox2">
@@ -300,8 +297,8 @@
                                 <child>
                                   <object class="GtkFileChooserButton" id="destination_filechooserbutton">
                                     <property name="visible">True</property>
-                                    <property name="action">select-folder</property>
                                     <property name="local_only">False</property>
+                                    <property name="action">select-folder</property>
                                     <property name="title" translatable="yes">Choose destination folder</property>
                                   </object>
                                   <packing>
@@ -426,8 +423,6 @@
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkScrolledWindow" id="scrolledwindow4">
-                            <property name="width_request">453</property>
-                            <property name="height_request">272</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hscrollbar_policy">automatic</property>
@@ -495,7 +490,6 @@
               <object class="GtkVBox" id="vbox2">
                 <property name="visible">True</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">12</property>
                 <child>
                   <object class="GtkFrame" id="frame3">
@@ -751,7 +745,6 @@
               <object class="GtkVBox" id="vbox3">
                 <property name="visible">True</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">12</property>
                 <child>
                   <object class="GtkFrame" id="frame2">
@@ -766,7 +759,6 @@
                         <child>
                           <object class="GtkVBox" id="vbox4">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkTable" id="table1">
@@ -1005,7 +997,6 @@
                         <child>
                           <object class="GtkVBox" id="vbox6">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="image_description_checkbutton">
diff --git a/extensions/webalbums/dlg-web-exporter.c b/extensions/webalbums/dlg-web-exporter.c
index 04280a9..cc85a3b 100644
--- a/extensions/webalbums/dlg-web-exporter.c
+++ b/extensions/webalbums/dlg-web-exporter.c
@@ -264,7 +264,6 @@ add_themes_from_dir (DialogData *data,
 {
 	GFileEnumerator *enumerator;
 	GFileInfo       *file_info;
-	char            *default_theme;
 
 	enumerator = g_file_enumerate_children (dir,
 						(G_FILE_ATTRIBUTE_STANDARD_NAME ","
@@ -276,8 +275,6 @@ add_themes_from_dir (DialogData *data,
 	if (enumerator == NULL)
 		return;
 
-	default_theme = eel_gconf_get_string (PREF_WEBALBUMS_THEME, DEFAULT_ALBUM_THEME);
-
 	while ((file_info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) {
 		GFile     *file;
 		char      *filename;
@@ -300,14 +297,6 @@ add_themes_from_dir (DialogData *data,
 					    THEME_COLUMN_NAME, g_file_info_get_display_name (file_info),
 					    THEME_COLUMN_PREVIEW, preview,
 					    -1);
-
-			if (g_str_equal (default_theme, g_file_info_get_name (file_info))) {
-				GtkTreePath *path;
-
-				path = gtk_tree_model_get_path (GTK_TREE_MODEL (GET_WIDGET ("theme_liststore")), &iter);
-				gtk_icon_view_select_path (GTK_ICON_VIEW (GET_WIDGET ("theme_iconview")), path);
-				gtk_tree_path_free (path);
-			}
 		}
 
 		g_object_unref (preview);
@@ -316,7 +305,6 @@ add_themes_from_dir (DialogData *data,
 		g_object_unref (file_info);
 	}
 
-	g_free (default_theme);
 	g_object_unref (enumerator);
 }
 
@@ -324,9 +312,12 @@ add_themes_from_dir (DialogData *data,
 static void
 load_themes (DialogData *data)
 {
-	char  *style_path;
-	GFile *style_dir;
-	GFile *data_dir;
+	char         *style_path;
+	GFile        *style_dir;
+	GFile        *data_dir;
+	char         *default_theme;
+	GtkTreeModel *model;
+	GtkTreeIter   iter;
 
 	/* local themes */
 
@@ -343,6 +334,39 @@ load_themes (DialogData *data)
 	add_themes_from_dir (data, style_dir);
 	g_object_unref (style_dir);
 	g_object_unref (data_dir);
+
+	/**/
+
+	gtk_widget_set_size_request (GET_WIDGET ("theme_iconview"), (150 * 3), 140);
+	gtk_widget_realize (GET_WIDGET ("theme_iconview"));
+
+	default_theme = eel_gconf_get_string (PREF_WEBALBUMS_THEME, DEFAULT_ALBUM_THEME);
+
+	model = GTK_TREE_MODEL (GET_WIDGET ("theme_liststore"));
+	if (gtk_tree_model_get_iter_first (model, &iter)) {
+		do {
+			char *name;
+
+			gtk_tree_model_get(model, &iter, THEME_COLUMN_ID, &name, -1);
+
+			if (g_strcmp0 (name, default_theme) == 0) {
+				GtkTreePath *path;
+
+				path = gtk_tree_model_get_path (model, &iter);
+				gtk_icon_view_select_path (GTK_ICON_VIEW (GET_WIDGET ("theme_iconview")), path);
+				gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (GET_WIDGET ("theme_iconview")), path, TRUE, 0.5, 0.5);
+
+				gtk_tree_path_free (path);
+				g_free (name);
+				break;
+			}
+
+			g_free (name);
+		}
+		while (gtk_tree_model_iter_next (model, &iter));
+	}
+
+	g_free (default_theme);
 }
 
 



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