[dia] Bug 623258 - "Visible Spacing" setting does not persist
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Bug 623258 - "Visible Spacing" setting does not persist
- Date: Fri, 30 Jul 2010 20:43:49 +0000 (UTC)
commit f9630dab780d947695c048b99fcf1d0678b725e0
Author: Hans Breuer <hans breuer org>
Date: Fri Jul 30 22:33:08 2010 +0200
Bug 623258 - "Visible Spacing" setting does not persist
Patch to allow the "visible spacing" setting to be defined in
preferences as a default value and persist between instances.
Patch from "J. Edwards <jheiv jheiv com>"
app/diagram.c | 4 ++--
app/preferences.c | 4 ++++
app/preferences.h | 2 ++
3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/app/diagram.c b/app/diagram.c
index b60c0e4..c8143e6 100644
--- a/app/diagram.c
+++ b/app/diagram.c
@@ -207,8 +207,8 @@ diagram_init(Diagram *dia, const char *filename)
dia->grid.hex_size = 1.0;
dia->grid.colour = prefs.new_diagram.grid_color;
dia->grid.hex = prefs.grid.hex;
- dia->grid.visible_x = 1;
- dia->grid.visible_y = 1;
+ dia->grid.visible_x = prefs.grid.vis_x;
+ dia->grid.visible_y = prefs.grid.vis_y;
dia->grid.dynamic = prefs.grid.dynamic;
dia->grid.major_lines = prefs.grid.major_lines;
diff --git a/app/preferences.c b/app/preferences.c
index 6c93d7a..bce7579 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -81,6 +81,8 @@ static void update_internal_prefs(DiaPrefData *pref, gpointer ptr);
static int default_true = 1;
static int default_false = 0;
+static int default_int_vis_x = 1;
+static int default_int_vis_y = 1;
static int default_major_lines = 5;
static real default_real_one = 1.0;
static real default_real_zoom = 100.0;
@@ -237,6 +239,8 @@ DiaPrefData prefs_data[] =
{ "grid_dynamic", PREF_BOOLEAN, PREF_OFFSET(grid.dynamic), &default_true, GRID_TAB, N_("Dynamic grid resizing") },
{ "grid_x", PREF_UREAL, PREF_OFFSET(grid.x), &default_real_one, GRID_TAB, N_("X Size:") },
{ "grid_y", PREF_UREAL, PREF_OFFSET(grid.y), &default_real_one, GRID_TAB, N_("Y Size:") },
+ { "grid_vis_x", PREF_UINT, PREF_OFFSET(grid.vis_x), &default_int_vis_x, GRID_TAB, N_("Visual Spacing X:") },
+ { "grid_vis_y", PREF_UINT, PREF_OFFSET(grid.vis_y), &default_int_vis_y, GRID_TAB, N_("Visual Spacing Y:") },
{ "grid_colour", PREF_COLOUR, PREF_OFFSET(new_diagram.grid_color), &default_colour, GRID_TAB, N_("Color:") },
{ "grid_major", PREF_UINT, PREF_OFFSET(grid.major_lines), &default_major_lines, GRID_TAB, N_("Lines per major line") },
{ "grid_hex", PREF_BOOLEAN, PREF_OFFSET(grid.hex), &default_false, GRID_TAB, N_("Hex grid") },
diff --git a/app/preferences.h b/app/preferences.h
index e6e27f8..24241a0 100644
--- a/app/preferences.h
+++ b/app/preferences.h
@@ -34,6 +34,8 @@ struct DiaPreferences {
gboolean dynamic;
real x;
real y;
+ int vis_x;
+ int vis_y;
int major_lines;
int hex;
real w;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]