diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2011-05-26 20:04:59 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2011-05-26 20:04:59 +0000 |
| commit | e221cd716d74e63d1f27ddedd598f23b0fce611d (patch) | |
| tree | 7dad0eae9cf2c407746d8b9f6fb5521476179e6e /src | |
| parent | adding keyboard shortcut (Ctrl Alt G) for "add glyph layer" extension (diff) | |
| download | inkscape-e221cd716d74e63d1f27ddedd598f23b0fce611d.tar.gz inkscape-e221cd716d74e63d1f27ddedd598f23b0fce611d.zip | |
unitmenu: add method to add a unit
(bzr r10232)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/widget/unit-menu.cpp | 8 | ||||
| -rw-r--r-- | src/ui/widget/unit-menu.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/widget/unit-menu.cpp b/src/ui/widget/unit-menu.cpp index 5c68f7196..362f5d90f 100644 --- a/src/ui/widget/unit-menu.cpp +++ b/src/ui/widget/unit-menu.cpp @@ -67,6 +67,14 @@ UnitMenu::resetUnitType(UnitType unit_type) return setUnitType(unit_type); } +/** Adds a unit, possibly user-defined, to the menu. */ +void +UnitMenu::addUnit(Unit const& u) +{ + _unit_table.addUnit(u, false); + append_text(u.abbr); +} + /** Returns the Unit object corresponding to the current selection in the dropdown widget */ Unit diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index efeb10ead..cf42231ba 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -29,6 +29,7 @@ public: bool setUnitType(UnitType unit_type); bool resetUnitType(UnitType unit_type); + void addUnit(Unit const& u); bool setUnit(Glib::ustring const &unit); |
