[eog] Bug 566810 – Image properties dialog too big for netbooks



commit a1c8d6f3b7a2c0459e75b6cbce281751f6376671
Author: Felix Riemann <friemann gnome org>
Date:   Sat Jul 25 17:21:26 2009 +0200

    Bug 566810 â?? Image properties dialog too big for netbooks
    
    Add an option to have the detailled metadata list widget shown on its
    own notebook page in the properties dialog. This should avoid moving the
    dialog buttons off the screen on smaller displays.
    This is currently a GConf-only option.

 data/eog-image-properties-dialog.ui |  101 +++++++++++++++++++++++++++--------
 data/eog.schemas.in                 |   15 +++++
 src/eog-config-keys.h               |    1 +
 src/eog-properties-dialog.c         |   92 ++++++++++++++++++++++++++++++-
 src/eog-properties-dialog.h         |    5 ++-
 src/eog-window.c                    |   34 ++++++++++++
 6 files changed, 221 insertions(+), 27 deletions(-)
---
diff --git a/data/eog-image-properties-dialog.ui b/data/eog-image-properties-dialog.ui
index dc8de03..a05fd99 100644
--- a/data/eog-image-properties-dialog.ui
+++ b/data/eog-image-properties-dialog.ui
@@ -1,10 +1,12 @@
 <?xml version="1.0"?>
 <interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkDialog" id="eog_image_properties_dialog">
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Image Properties</property>
     <property name="icon_name">gtk-properties</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="image-properties-dialog-vbox">
@@ -32,11 +34,13 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
@@ -54,11 +58,12 @@
                             <property name="xalign">0</property>
                             <property name="label" translatable="yes">&lt;b&gt;Name:&lt;/b&gt;</property>
                             <property name="use_markup">True</property>
-                            <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                            <property name="justify">right</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -130,6 +135,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
@@ -145,6 +151,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -200,8 +207,8 @@
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="yalign">0.47999998927116394</property>
-                            <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                             <property name="selectable">True</property>
+                            <property name="ellipsize">end</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -255,6 +262,7 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
@@ -328,7 +336,7 @@
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">&lt;b&gt;Camera Model:&lt;/b&gt;</property>
                                 <property name="use_markup">True</property>
-                                <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                                <property name="justify">right</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -352,6 +360,7 @@
                           </object>
                           <packing>
                             <property name="padding">5</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -368,6 +377,7 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
@@ -430,6 +440,7 @@
                       </object>
                       <packing>
                         <property name="expand">False</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
@@ -444,13 +455,14 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="justify">GTK_JUSTIFY_RIGHT</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+                                <property name="justify">right</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
@@ -458,8 +470,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -472,8 +484,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -486,8 +498,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -500,8 +512,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -514,8 +526,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -528,8 +540,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -542,8 +554,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -554,6 +566,7 @@
                           </object>
                           <packing>
                             <property name="padding">5</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -565,13 +578,14 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="justify">GTK_JUSTIFY_RIGHT</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+                                <property name="justify">right</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
@@ -579,8 +593,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -593,8 +607,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -607,8 +621,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -621,8 +635,8 @@
                                 <property name="visible">True</property>
                                 <property name="xalign">0</property>
                                 <property name="use_markup">True</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
                                 <property name="selectable">True</property>
+                                <property name="ellipsize">end</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -643,6 +657,7 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
@@ -662,11 +677,14 @@
                   </object>
                   <packing>
                     <property name="padding">3</property>
-                    <property name="pack_type">GTK_PACK_END</property>
+                    <property name="pack_type">end</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
             </child>
             <child type="tab">
               <object class="GtkLabel" id="label44">
@@ -678,6 +696,28 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkVBox" id="metadata_details_box">
+                <property name="visible">True</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="md_details_label">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Details</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="position">1</property>
@@ -686,12 +726,13 @@
         <child internal-child="action_area">
           <object class="GtkHButtonBox" id="dialog-action_area1">
             <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <property name="layout_style">end</property>
             <child>
               <object class="GtkButton" id="previous_button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
+                <property name="receives_default">False</property>
                 <child>
                   <object class="GtkAlignment" id="alignment2">
                     <property name="visible">True</property>
@@ -709,6 +750,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -728,12 +770,18 @@
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
             </child>
             <child>
               <object class="GtkButton" id="next_button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
+                <property name="receives_default">False</property>
                 <child>
                   <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
@@ -751,6 +799,7 @@
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -771,25 +820,31 @@
                 </child>
               </object>
               <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">1</property>
               </packing>
             </child>
             <child>
               <object class="GtkButton" id="close_button">
+                <property name="label">gtk-close</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
-                <property name="label">gtk-close</property>
+                <property name="receives_default">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">2</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>
diff --git a/data/eog.schemas.in b/data/eog.schemas.in
index 9226fcb..8190fb4 100644
--- a/data/eog.schemas.in
+++ b/data/eog.schemas.in
@@ -243,6 +243,21 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/eog/ui/propsdialog_netbook_mode</key>
+      <applyto>/apps/eog/ui/propsdialog_netbook_mode</applyto>
+      <owner>eog</owner>
+      <type>bool</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Whether the metadata list in the properties dialog should have its own page.</short>
+        <long>If activated the detailed metadata list in the properties dialog
+	will be moved to its own page in the dialog. This should make the dialog
+	more usable on smaller screens, e.g. as used by netbooks. If disabled
+	the widget will be embedded on the "Metadata" page.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/eog/plugins/active_plugins</key>
       <applyto>/apps/eog/plugins/active_plugins</applyto>
       <owner>eog</owner>
diff --git a/src/eog-config-keys.h b/src/eog-config-keys.h
index b66f797..849a7aa 100644
--- a/src/eog-config-keys.h
+++ b/src/eog-config-keys.h
@@ -54,6 +54,7 @@
 #define EOG_CONF_UI_SCROLL_BUTTONS		"/apps/eog/ui/scroll_buttons"
 #define EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION	"/apps/eog/ui/disable_trash_confirmation"
 #define EOG_CONF_UI_FILECHOOSER_XDG_FALLBACK	"/apps/eog/ui/filechooser_xdg_fallback"
+#define EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE	"/apps/eog/ui/propsdialog_netbook_mode"
 
 #define EOG_CONF_PLUGINS_ACTIVE_PLUGINS         "/apps/eog/plugins/active_plugins"
 
diff --git a/src/eog-properties-dialog.c b/src/eog-properties-dialog.c
index cb92d8e..b17c706 100644
--- a/src/eog-properties-dialog.c
+++ b/src/eog-properties-dialog.c
@@ -59,6 +59,7 @@ G_DEFINE_TYPE (EogPropertiesDialog, eog_properties_dialog, EOG_TYPE_DIALOG);
 enum {
         PROP_0,
         PROP_THUMBVIEW,
+        PROP_NETBOOK_MODE
 };
 
 struct _EogPropertiesDialogPrivate {
@@ -103,7 +104,11 @@ struct _EogPropertiesDialogPrivate {
 	GtkWidget      *exif_box;
 	GtkWidget      *exif_details_expander;
 	GtkWidget      *exif_details;
+	GtkWidget      *metadata_details_box;
+	GtkWidget      *metadata_details_sw;
 #endif
+
+	gboolean        netbook_mode;
 };
 
 static void
@@ -345,15 +350,26 @@ pd_update_metadata_tab (EogPropertiesDialog *prop_dlg,
 	    ) {
 		if (gtk_notebook_get_current_page (notebook) ==	EOG_PROPERTIES_DIALOG_PAGE_EXIF) {
 			gtk_notebook_prev_page (notebook);
+		} else if (gtk_notebook_get_current_page (notebook) == EOG_PROPERTIES_DIALOG_PAGE_DETAILS) {
+			gtk_notebook_set_current_page (notebook, EOG_PROPERTIES_DIALOG_PAGE_GENERAL);
 		}
 
 		if (GTK_WIDGET_VISIBLE (priv->exif_box)) {
 			gtk_widget_hide_all (priv->exif_box);
 		}
+		if (GTK_WIDGET_VISIBLE (priv->metadata_details_box)) {
+			gtk_widget_hide_all (priv->metadata_details_box);
+		}
 
 		return;
-	} else if (!GTK_WIDGET_VISIBLE (priv->exif_box)) {
-		gtk_widget_show_all (priv->exif_box);
+	} else {
+		if (!GTK_WIDGET_VISIBLE (priv->exif_box))
+			gtk_widget_show_all (priv->exif_box);
+		if (priv->netbook_mode &&
+		    !GTK_WIDGET_VISIBLE (priv->metadata_details_box)) {
+			gtk_widget_show_all (priv->metadata_details_box);
+			gtk_widget_hide_all (priv->exif_details_expander);
+		}
 	}
 
 #if HAVE_EXIF
@@ -499,6 +515,40 @@ eog_properties_dialog_delete (GtkWidget   *widget,
 	return TRUE;
 }
 
+void
+eog_properties_dialog_set_netbook_mode (EogPropertiesDialog *dlg,
+					gboolean enable)
+{
+	EogPropertiesDialogPrivate *priv;
+
+	g_return_if_fail (EOG_IS_PROPERTIES_DIALOG (dlg));
+
+	priv = dlg->priv;
+
+	if (priv->netbook_mode == enable)
+		return;
+
+	priv->netbook_mode = enable;
+
+	if (enable) {
+		gtk_widget_reparent (priv->metadata_details_sw,
+				     priv->metadata_details_box);
+		// Only show details box if metadata is being displayed
+		if (GTK_WIDGET_VISIBLE (priv->exif_box))
+			gtk_widget_show_all (priv->metadata_details_box);
+
+		gtk_widget_hide_all (priv->exif_details_expander);
+	} else {
+		gtk_widget_reparent (priv->metadata_details_sw,
+				     priv->exif_details_expander);
+		gtk_widget_show_all (priv->exif_details_expander);
+
+		if (gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)) == EOG_PROPERTIES_DIALOG_PAGE_DETAILS)
+			gtk_notebook_prev_page (GTK_NOTEBOOK (priv->notebook));
+		gtk_widget_hide_all (priv->metadata_details_box);
+	}
+}
+
 static void
 eog_properties_dialog_set_property (GObject      *object,
 				    guint         prop_id,
@@ -511,6 +561,14 @@ eog_properties_dialog_set_property (GObject      *object,
 		case PROP_THUMBVIEW:
 			prop_dlg->priv->thumbview = g_value_get_object (value);
 			break;
+		case PROP_NETBOOK_MODE:
+			eog_properties_dialog_set_netbook_mode (prop_dlg,
+						   g_value_get_boolean (value));
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id,
+							   pspec);
+			break;
 	}
 }
 
@@ -526,6 +584,14 @@ eog_properties_dialog_get_property (GObject    *object,
 		case PROP_THUMBVIEW:
 			g_value_set_object (value, prop_dlg->priv->thumbview);
 			break;
+		case PROP_NETBOOK_MODE:
+			g_value_set_boolean (value,
+					     prop_dlg->priv->netbook_mode);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id,
+							   pspec);
+			break;
 	}
 }
 
@@ -569,6 +635,13 @@ eog_properties_dialog_class_init (EogPropertiesDialogClass *class)
 							      G_PARAM_STATIC_NAME |
 							      G_PARAM_STATIC_NICK |
 							      G_PARAM_STATIC_BLURB));
+	g_object_class_install_property (g_object_class, PROP_NETBOOK_MODE,
+					 g_param_spec_boolean ("netbook-mode",
+					 		      "Netbook Mode",
+							      "Netbook Mode",
+							      FALSE,
+							      G_PARAM_READWRITE |
+							      G_PARAM_STATIC_STRINGS));
 
 	g_type_class_add_private (g_object_class, sizeof (EogPropertiesDialogPrivate));
 }
@@ -634,6 +707,7 @@ eog_properties_dialog_init (EogPropertiesDialog *prop_dlg)
 #ifdef HAVE_METADATA
 			         "exif_box", &priv->exif_box,
 				 "exif_details_expander", &priv->exif_details_expander,
+				 "metadata_details_box", &priv->metadata_details_box,
 #endif
 			         NULL);
 
@@ -666,11 +740,21 @@ eog_properties_dialog_init (EogPropertiesDialog *prop_dlg)
 
 	priv->exif_details = eog_exif_details_new ();
 	gtk_widget_set_size_request (priv->exif_details, -1, 170);
+	gtk_container_set_border_width (GTK_CONTAINER (sw), 6);
 
 	gtk_container_add (GTK_CONTAINER (sw), priv->exif_details);
 	gtk_widget_show_all (sw);
 
-	gtk_container_add (GTK_CONTAINER (priv->exif_details_expander), sw);
+	priv->metadata_details_sw = sw;
+
+	if (priv->netbook_mode) {
+		gtk_widget_hide_all (priv->exif_details_expander);
+		gtk_box_pack_start (GTK_BOX (priv->metadata_details_box),
+				    sw, TRUE, TRUE, 6);
+	} else {
+		gtk_container_add (GTK_CONTAINER (priv->exif_details_expander),
+				   sw);
+	}
 
 	g_signal_connect_after (G_OBJECT (priv->exif_details_expander),
 			        "notify::expanded",
@@ -685,6 +769,8 @@ eog_properties_dialog_init (EogPropertiesDialog *prop_dlg)
 #else
 	gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook),
 				  EOG_PROPERTIES_DIALOG_PAGE_EXIF);
+	gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook),
+				  EOG_PROPERTIES_DIALOG_PAGE_DETAILS);
 #endif
 }
 
diff --git a/src/eog-properties-dialog.h b/src/eog-properties-dialog.h
index a2f46fc..7078e14 100644
--- a/src/eog-properties-dialog.h
+++ b/src/eog-properties-dialog.h
@@ -46,7 +46,8 @@ typedef struct _EogPropertiesDialogPrivate EogPropertiesDialogPrivate;
 typedef enum {
 	EOG_PROPERTIES_DIALOG_PAGE_GENERAL = 0,
 	EOG_PROPERTIES_DIALOG_PAGE_EXIF,
-	EOG_PROPERTIES_DIALOG_PAGE_XMP
+	EOG_PROPERTIES_DIALOG_PAGE_DETAILS,
+	EOG_PROPERTIES_DIALOG_N_PAGES
 } EogPropertiesDialogPage;
 
 struct _EogPropertiesDialog {
@@ -72,6 +73,8 @@ void	    eog_properties_dialog_update  	(EogPropertiesDialog     *prop,
 void	    eog_properties_dialog_set_page  	(EogPropertiesDialog     *prop,
 						 EogPropertiesDialogPage  page);
 
+void	    eog_properties_dialog_set_netbook_mode (EogPropertiesDialog *dlg,
+						    gboolean enable);
 G_END_DECLS
 
 #endif /* __EOG_PROPERTIES_DIALOG_H__ */
diff --git a/src/eog-window.c b/src/eog-window.c
index 9cbe6f0..045da99 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -126,6 +126,7 @@ enum {
 	EOG_WINDOW_NOTIFY_COLLECTION_POS,
 	EOG_WINDOW_NOTIFY_COLLECTION_RESIZABLE,
 	EOG_WINDOW_NOTIFY_CAN_SAVE,
+	EOG_WINDOW_NOTIFY_PROPSDIALOG_NETBOOK_MODE,
 	EOG_WINDOW_NOTIFY_LENGTH
 };
 
@@ -604,6 +605,25 @@ eog_window_can_save_changed_cb (GConfClient *client,
 	}
 }
 
+static void
+eog_window_pd_nbmode_changed_cb (GConfClient *client,
+				 guint       cnxn_id,
+				 GConfEntry  *entry,
+				 gpointer    user_data)
+{
+	EogWindow *window = EOG_WINDOW (user_data);
+
+	if (window->priv->properties_dlg != NULL) {
+		gboolean netbook_mode;
+		EogPropertiesDialog *dlg;
+
+		netbook_mode = gconf_value_get_bool (entry->value);
+		dlg = EOG_PROPERTIES_DIALOG (window->priv->properties_dlg);
+
+		eog_properties_dialog_set_netbook_mode (dlg, netbook_mode);
+	}
+}
+
 #ifdef HAVE_LCMS
 static cmsHPROFILE *
 eog_window_get_display_profile (GdkScreen *screen)
@@ -2916,6 +2936,8 @@ eog_window_cmd_properties (GtkAction *action, gpointer user_data)
 					     "GoPrevious");
 
 	if (window->priv->properties_dlg == NULL) {
+		gboolean netbook_mode;
+
 		window->priv->properties_dlg =
 			eog_properties_dialog_new (GTK_WINDOW (window),
 						   EOG_THUMB_VIEW (priv->thumbview),
@@ -2924,6 +2946,12 @@ eog_window_cmd_properties (GtkAction *action, gpointer user_data)
 
 		eog_properties_dialog_update (EOG_PROPERTIES_DIALOG (priv->properties_dlg),
 					      priv->image);
+		netbook_mode =
+			gconf_client_get_bool (priv->client,
+					       EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE,
+					       NULL);
+		eog_properties_dialog_set_netbook_mode (EOG_PROPERTIES_DIALOG (priv->properties_dlg),
+							netbook_mode);
 	}
 
 	eog_dialog_show (EOG_DIALOG (window->priv->properties_dlg));
@@ -4363,6 +4391,12 @@ eog_window_init (EogWindow *window)
 					 eog_window_can_save_changed_cb,
 					 window, NULL, NULL);
 
+	priv->client_notifications[EOG_WINDOW_NOTIFY_PROPSDIALOG_NETBOOK_MODE] =
+		gconf_client_notify_add (window->priv->client,
+					 EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE,
+					 eog_window_pd_nbmode_changed_cb,
+					 window, NULL, NULL);
+
 	window->priv->store = NULL;
 	window->priv->image = NULL;
 



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