diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-12-16 18:09:15 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-12-16 18:09:15 +0000 |
| commit | a81c104b848a3538815235cc9763a5c02591061f (patch) | |
| tree | 5a9026c279e6ac51822d27156497427b3ddcc36c /src/ui/widget/preferences-widget.cpp | |
| parent | fix possible crash where event_context is destroyed during fill operation due... (diff) | |
| download | inkscape-a81c104b848a3538815235cc9763a5c02591061f.tar.gz inkscape-a81c104b848a3538815235cc9763a5c02591061f.zip | |
add default unit to grid preferences.
(bzr r4238)
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 29f86745e..7b94512cf 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -356,6 +356,23 @@ void PrefColorPicker::on_changed (guint32 rgba) } } +void PrefUnit::init(const std::string& prefs_path, const std::string& attr) +{ + _prefs_path = prefs_path; + _attr = attr; + setUnitType(UNIT_TYPE_LINEAR); + gchar const * prefval = prefs_get_string_attribute(_prefs_path.c_str(), _attr.c_str()); + setUnit(prefval); +} + +void PrefUnit::on_changed() +{ + if (this->is_visible()) //only take action if user changed value + { + prefs_set_string_attribute(_prefs_path.c_str(), _attr.c_str(), getUnitAbbr().c_str()); + } +} + } // namespace Widget } // namespace UI } // namespace Inkscape |
