From 8e03be1b452837fd438b811fbdcfe9ac65765bc4 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 11 May 2012 18:35:03 +0900 Subject: Fix for 997886 : Document Metadata : Crash when saving with 2 documents open (bzr r11353) --- src/ui/widget/entity-entry.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ui/widget/entity-entry.cpp') diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index be43e4fda..2a6e2bcd0 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -26,6 +26,7 @@ #include "ui/widget/registry.h" #include "sp-root.h" #include "document-undo.h" +#include "document-private.h" #include "verbs.h" #include "entity-entry.h" @@ -105,8 +106,9 @@ EntityLineEntry::on_changed() SPDocument *doc = SP_ACTIVE_DOCUMENT; Glib::ustring text = static_cast(_packable)->get_text(); if (rdf_set_work_entity (doc, _entity, text.c_str())) { - DocumentUndo::done(doc, SP_VERB_NONE, - /* TODO: annotate */ "entity-entry.cpp:101"); + if (doc->priv->sensitive) { + DocumentUndo::done(doc, SP_VERB_NONE, "Document metadata updated"); + } } _wr->setUpdating (false); } @@ -155,7 +157,7 @@ EntityMultiLineEntry::on_changed() Gtk::TextView *tv = static_cast(s->get_child()); Glib::ustring text = tv->get_buffer()->get_text(); if (rdf_set_work_entity (doc, _entity, text.c_str())) { - DocumentUndo::done(doc, SP_VERB_NONE, + DocumentUndo::done(doc, SP_VERB_NONE, /* TODO: annotate */ "entity-entry.cpp:146"); } _wr->setUpdating (false); -- cgit v1.2.3 From d9da2a4f178e71f5b33ea158c0631e86220f2e5d Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 12 Jul 2012 17:19:58 +0900 Subject: Fix for 612221 : Add metadata default configuration in the preferences (bzr r11544) --- src/ui/widget/entity-entry.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/ui/widget/entity-entry.cpp') diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index 2a6e2bcd0..c622796b2 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -27,6 +27,7 @@ #include "sp-root.h" #include "document-undo.h" #include "document-private.h" +#include "preferences.h" #include "verbs.h" #include "entity-entry.h" @@ -72,6 +73,13 @@ EntityEntry::~EntityEntry() _changed_connection.disconnect(); } +void EntityEntry::save_to_preferences(SPDocument *doc) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + const gchar *text = rdf_get_work_entity (doc, _entity); + prefs->setString(PREFS_METADATA + Glib::ustring(_entity->name), Glib::ustring(text ? text : "")); +} + EntityLineEntry::EntityLineEntry (rdf_work_entity_t* ent, Registry& wr) : EntityEntry (ent, wr) { @@ -97,6 +105,16 @@ void EntityLineEntry::update(SPDocument *doc) static_cast(_packable)->set_text (text ? text : ""); } + +void EntityLineEntry::load_from_preferences() +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring text = prefs->getString(PREFS_METADATA + Glib::ustring(_entity->name)); + if (text.length() > 0) { + static_cast(_packable)->set_text (text.c_str()); + } +} + void EntityLineEntry::on_changed() { @@ -146,6 +164,19 @@ void EntityMultiLineEntry::update(SPDocument *doc) tv->get_buffer()->set_text (text ? text : ""); } + +void EntityMultiLineEntry::load_from_preferences() +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring text = prefs->getString(PREFS_METADATA + Glib::ustring(_entity->name)); + if (text.length() > 0) { + Gtk::ScrolledWindow *s = static_cast(_packable); + Gtk::TextView *tv = static_cast(s->get_child()); + tv->get_buffer()->set_text (text.c_str()); + } +} + + void EntityMultiLineEntry::on_changed() { -- cgit v1.2.3 From 3c82e8251460b21c8046a418a9fefb700db0a164 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 4 Jun 2013 01:52:40 -0700 Subject: Correct to compile against recent gtkmm, including updated macports versions. Fixes bug #1179338. Fixed bugs: - https://launchpad.net/bugs/1179338 (bzr r12346.1.1) --- src/ui/widget/entity-entry.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/widget/entity-entry.cpp') diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index c622796b2..6b14f2841 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -17,6 +17,8 @@ # include #endif +#include + #include #include -- cgit v1.2.3 From 72d8e897c6b67e46b2a613c4743ef9c13de25059 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 Jun 2013 06:44:11 -0700 Subject: Added configure/ifdef guards to only bring in the needed #include if glibmm has it. (bzr r12353) --- src/ui/widget/entity-entry.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/widget/entity-entry.cpp') diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index 6b14f2841..0f526f77a 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -17,7 +17,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include -- cgit v1.2.3