[gthumb: 23/129] rotate tool: save and restore the grid size



commit 29c58bbd67398ce17f050147696a5cc16c2d881e
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Apr 15 17:33:28 2011 +0200

    rotate tool: save and restore the grid size

 .../data/gthumb_rotate_options.schemas.in          |   12 ++++++++++
 extensions/file_tools/gth-file-tool-rotate.c       |   24 ++-----------------
 extensions/file_tools/preferences.h                |    1 +
 3 files changed, 16 insertions(+), 21 deletions(-)
---
diff --git a/extensions/file_tools/data/gthumb_rotate_options.schemas.in b/extensions/file_tools/data/gthumb_rotate_options.schemas.in
index ed9c164..1f07536 100644
--- a/extensions/file_tools/data/gthumb_rotate_options.schemas.in
+++ b/extensions/file_tools/data/gthumb_rotate_options.schemas.in
@@ -13,5 +13,17 @@
 	</locale>
       </schema>
 
+      <schema>
+	<key>/schemas/apps/gthumb/ext/resize/grid_size</key>
+	<applyto>/apps/gthumb/ext/resize/grid_size</applyto>
+	<owner>gthumb</owner>
+	<type>int</type>
+	<default>15</default>
+	<locale name="C">
+	  <short></short>
+	  <long></long>
+	</locale>
+      </schema>
+
     </schemalist>
 </gconfschemafile>
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index 49a3bc8..ff21212 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -273,21 +273,6 @@ angle_value_changed_cb (GtkAdjustment *adj,
 
 
 static void
-step_checkbutton_toggled_cb (GtkToggleButton *button,
-			     gpointer         user_data)
-{
-	GthFileToolRotate *self = user_data;
-
-	if (gtk_toggle_button_get_active (button))
-		self->priv->step = 5.0;
-	else
-		self->priv->step = 0.1;
-	gtk_adjustment_set_step_increment (self->priv->angle_adj, self->priv->step);
-	angle_value_changed_cb (NULL, user_data);
-}
-
-
-static void
 grid_value_changed_cb (GtkAdjustment *adj,
 		       gpointer       user_data)
 {
@@ -418,7 +403,7 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
 							    0.0, -5.0, 5.0, 0.01, 0.1, 2);
 	self->priv->grid_adj = gimp_scale_entry_new (GET_WIDGET ("grid_box"),
 						     NULL,
-						     DEFAULT_GRID, 2.0, 50.0, 1.0, 10.0, 0);
+						     eel_gconf_get_integer (PREF_ROTATE_GRID_SIZE, DEFAULT_GRID), 2.0, 50.0, 1.0, 10.0, 0);
 
 	g_signal_connect (GET_WIDGET ("ok_button"),
 			  "clicked",
@@ -448,10 +433,6 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
 			  "value-changed",
 			  G_CALLBACK (small_angle_value_changed_cb),
 			  self);
-	/*g_signal_connect (GET_WIDGET ("step_checkbutton"),
-			  "toggled",
-			  G_CALLBACK (step_checkbutton_toggled_cb),
-			  self);*/
 	g_signal_connect (G_OBJECT (self->priv->grid_adj),
 			  "value-changed",
 			  G_CALLBACK (grid_value_changed_cb),
@@ -474,7 +455,7 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
 			  self);
 
 	self->priv->rotator = (GthImageRotator *) gth_image_rotator_new (GTH_IMAGE_VIEWER (viewer));
-	gth_image_rotator_set_grid (self->priv->rotator, FALSE, DEFAULT_GRID);
+	gth_image_rotator_set_grid (self->priv->rotator, FALSE, eel_gconf_get_integer (PREF_ROTATE_GRID_SIZE, DEFAULT_GRID));
 	_gth_file_tool_rotate (self, 0.0);
 	gth_image_rotator_set_center (self->priv->rotator,
 				      self->priv->pixbuf_width * 0.5,
@@ -513,6 +494,7 @@ gth_file_tool_rotate_destroy_options (GthFileTool *base)
 
 		unit = gtk_combo_box_get_active (GTK_COMBO_BOX (GET_WIDGET ("unit_combobox")));
 		eel_gconf_set_enum (PREF_ROTATE_UNIT, GTH_TYPE_UNIT, unit);
+		eel_gconf_set_integer (PREF_ROTATE_GRID_SIZE, (int) gtk_adjustment_get_value (self->priv->grid_adj));
 
 		/* destroy the options data */
 
diff --git a/extensions/file_tools/preferences.h b/extensions/file_tools/preferences.h
index 132c163..b5b0d53 100644
--- a/extensions/file_tools/preferences.h
+++ b/extensions/file_tools/preferences.h
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
 #define PREF_RESIZE_HIGH_QUALITY        "/apps/gthumb/ext/resize/high_quality"
 
 #define PREF_ROTATE_UNIT                "/apps/gthumb/ext/rotate/unit"
+#define PREF_ROTATE_GRID_SIZE           "/apps/gthumb/ext/rotate/grid_size"
 
 G_END_DECLS
 



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