summaryrefslogtreecommitdiffstats
path: root/src/preferences.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-05-04 05:20:54 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-05-04 05:20:54 +0000
commit2dcad8b8dd3e13db62e7de20293c5369dc5e9445 (patch)
tree863fd4014431356803427bca8f813d51c234c1fb /src/preferences.cpp
parentFixed broken preferences singleton and removed GUI encapsulation leakage. Fix... (diff)
downloadinkscape-2dcad8b8dd3e13db62e7de20293c5369dc5e9445.tar.gz
inkscape-2dcad8b8dd3e13db62e7de20293c5369dc5e9445.zip
Implement warning of prior errors.
(bzr r7817)
Diffstat (limited to 'src/preferences.cpp')
-rw-r--r--src/preferences.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp
index a6409b5ba..071dbf91e 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -54,7 +54,8 @@ Preferences::Preferences() :
_prefs_filename(""),
_prefs_doc(0),
_errorHandler(0),
- _writable(false)
+ _writable(false),
+ _hasError(false)
{
// profile_path essentailly returns the argument prefixed by the profile directory.
gchar *path = profile_path(NULL);
@@ -224,6 +225,21 @@ void Preferences::save()
sp_repr_save_file(_prefs_doc, utf8name.data());
}
+bool Preferences::getLastError( Glib::ustring& primary, Glib::ustring& secondary )
+{
+ bool result = _hasError;
+ if ( _hasError ) {
+ primary = _lastErrPrimary;
+ secondary = _lastErrSecondary;
+ _hasError = false;
+ _lastErrPrimary.clear();
+ _lastErrSecondary.clear();
+ } else {
+ primary.clear();
+ secondary.clear();
+ }
+ return result;
+}
// Now for the meat.
@@ -610,6 +626,9 @@ void Preferences::_keySplit(Glib::ustring const &pref_path, Glib::ustring &node_
void Preferences::_reportError(Glib::ustring const &msg, Glib::ustring const &secondary)
{
+ _hasError = true;
+ _lastErrPrimary = msg;
+ _lastErrSecondary = secondary;
if (_errorHandler) {
_errorHandler->handleError(msg, secondary);
}