diff options
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 00d8b5a26..a6302aa9d 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -3,8 +3,9 @@ * * Authors: * Marco Scholten + * Bruno Dilly <bruno.dilly@gmail.com> * - * Copyright (C) 2004, 2006 Authors + * Copyright (C) 2004, 2006, 2007 Authors * * Released under GNU GPL. Read the file 'COPYING' for more information. */ @@ -266,6 +267,25 @@ void PrefCombo::on_changed() } } +void PrefEntry::init(const std::string& prefs_path, const std::string& attr, + bool visibility) +{ + _prefs_path = prefs_path; + _attr = attr; + this->set_invisible_char('*'); + this->set_visibility(visibility); + this->set_text(prefs_get_string_attribute(_prefs_path.c_str(), _attr.c_str())); +} + +void PrefEntry::on_activate() +{ + if (this->is_visible()) //only take action if user changed value + { + prefs_set_string_attribute(_prefs_path.c_str(), _attr.c_str(), this->get_text().c_str()); + } + return; +} + } // namespace Widget } // namespace UI } // namespace Inkscape |
