summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee63f45)
raw | patch | inline | side by side (parent: ee63f45)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 13 Nov 2007 14:24:25 +0000 (14:24 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 13 Nov 2007 14:24:25 +0000 (14:24 +0000) |
src/desktop.cpp | patch | blob | history | |
src/desktop.h | patch | blob | history | |
src/sp-namedview.cpp | patch | blob | history | |
src/sp-namedview.h | patch | blob | history |
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 4fc0e5f60725ca3497cf3ffebd524c815d5647f5..f12d0ffd799957e377ac7e0d11e5925b5f3392a7 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
// (Setting up after the connections are all in place, as it may use some of them)
layer_manager = new Inkscape::LayerManager( this );
- showGrids(namedview->grids_visible);
+ showGrids(namedview->grids_visible, false);
}
}
}
-void SPDesktop::showGrids(bool show)
+void SPDesktop::showGrids(bool show, bool dirty_document)
{
grids_visible = show;
- sp_namedview_show_grids(namedview, grids_visible);
+ sp_namedview_show_grids(namedview, grids_visible, dirty_document);
if (show) {
sp_canvas_item_show(SP_CANVAS_ITEM(gridgroup));
} else {
diff --git a/src/desktop.h b/src/desktop.h
index bee0243d5e17cf95e681c54bb912435fdc9bb19a..fa8b4f84e8aede1ad414e0ecfa4de4a2068b9b3e 100644 (file)
--- a/src/desktop.h
+++ b/src/desktop.h
void toggleGrids();
bool gridsEnabled() { return grids_visible; }
- void showGrids(bool show);
+ void showGrids(bool show, bool dirty_document = true);
bool is_iconified();
bool is_maximized();
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 8b9bc008ec30895d3dd1a7d7831eb4ecd99b916a..9fba7bc99180bc6527efbe2f646f6c4842c5018c 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
}
}
- desktop->showGrids(grids_visible);
+ desktop->showGrids(grids_visible, false);
}
#define MIN_ONSCREEN_DISTANCE 50
sp_document_set_undo_sensitive(doc, saved);
}
-void sp_namedview_show_grids(SPNamedView * namedview, bool show)
+void sp_namedview_show_grids(SPNamedView * namedview, bool show, bool dirty_document)
{
namedview->grids_visible = show;
sp_repr_set_boolean(repr, "showgrid", namedview->grids_visible);
- doc->rroot->setAttribute("sodipodi:modified", "true");
+ /* we don't want the document to get dirty on startup; that's when
+ we call this function with dirty_document = false */
+ if (dirty_document) {
+ doc->rroot->setAttribute("sodipodi:modified", "true");
+ }
sp_document_set_undo_sensitive(doc, saved);
}
diff --git a/src/sp-namedview.h b/src/sp-namedview.h
index dc5c164b8319aaba3ca9b7389eff8756304aedb3..3e1923f1dc26f33a71f6b887a972b21514de68bb 100644 (file)
--- a/src/sp-namedview.h
+++ b/src/sp-namedview.h
void sp_namedview_update_layers_from_document (SPDesktop *desktop);
void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
-void sp_namedview_show_grids(SPNamedView *namedview, bool show);
+void sp_namedview_show_grids(SPNamedView *namedview, bool show, bool dirty_document);
#endif /* !INKSCAPE_SP_NAMEDVIEW_H */