From f006ebdee5b2f29127a152978ac72e41f61ced33 Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Mon, 6 Aug 2007 18:32:13 +0000 Subject: adds export to ocal feature without dialog window (bzr r3398) --- src/ui/widget/preferences-widget.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/ui/widget/preferences-widget.cpp') 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 * - * 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 -- cgit v1.2.3