From 989abbac025a8b3349748d19a613a08586c5fdcd Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 31 Jul 2013 21:11:20 +0200 Subject: Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes. (bzr r11608.1.110) --- src/ui/tool/node-tool.cpp | 22 ++++++++-------------- src/ui/tool/node-tool.h | 1 - src/ui/widget/selected-style.cpp | 14 +++++++------- 3 files changed, 15 insertions(+), 22 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index d424c1fdb..4b236e94c 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -127,7 +127,6 @@ InkNodeTool::InkNodeTool() : SPEventContext() { this->single_node_transform_handles = false; this->show_transform_handles = false; this->cursor_drag = false; - this->_node_message_context = 0; this->live_objects = false; this->edit_clipping_paths = false; this->live_outline = false; @@ -183,16 +182,11 @@ InkNodeTool::~InkNodeTool() { destroy_group(data.outline_group); destroy_group(data.dragpoint_group); destroy_group(this->_transform_handle_group); - - if (this->_node_message_context) { - delete this->_node_message_context; - } } void InkNodeTool::setup() { SPEventContext::setup(); - this->_node_message_context = new Inkscape::MessageContext((this->desktop)->messageStack()); this->_path_data = new Inkscape::UI::PathSharedData(); Inkscape::UI::PathSharedData &data = *this->_path_data; @@ -559,11 +553,11 @@ void InkNodeTool::update_tip(GdkEvent *event) { if (state_held_shift(new_state)) { if (this->_last_over) { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Shift: drag to add nodes to the selection, " "click to toggle object selection")); } else { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Shift: drag to add nodes to the selection")); } @@ -584,30 +578,30 @@ void InkNodeTool::update_tip(GdkEvent *event) { char *dyntip = g_strdup_printf(C_("Node tool tip", "%s Drag to select nodes, click to edit only this object (more: Shift)"), nodestring); - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, dyntip); + this->message_context->set(Inkscape::NORMAL_MESSAGE, dyntip); g_free(dyntip); } else { char *dyntip = g_strdup_printf(C_("Node tool tip", "%s Drag to select nodes, click clear the selection"), nodestring); - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, dyntip); + this->message_context->set(Inkscape::NORMAL_MESSAGE, dyntip); g_free(dyntip); } g_free(nodestring); } else if (!this->_multipath->empty()) { if (this->_last_over) { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Drag to select nodes, click to edit only this object")); } else { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Drag to select nodes, click to clear the selection")); } } else { if (this->_last_over) { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Drag to select objects to edit, click to edit this object (more: Shift)")); } else { - this->_node_message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", + this->message_context->set(Inkscape::NORMAL_MESSAGE, C_("Node tool tip", "Drag to select objects to edit")); } } diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 313cc0561..779cf98e6 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -58,7 +58,6 @@ private: sigc::connection _mouseover_changed_connection; sigc::connection _sizeUpdatedConn; - Inkscape::MessageContext *_node_message_context; SPItem *flashed_item; Inkscape::Display::TemporaryItem *flash_tempitem; Inkscape::UI::Selector* _selector; diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 8cb0c5588..08589a0b6 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1351,25 +1351,25 @@ RotateableSwatch::do_motion(double by, guint modifier) { DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust alpha"))); double ch = hsla[3]; - parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting alpha: was %.3g, now %.3g (diff %.3g); with Ctrl to adjust lightness, with Shift to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff); + parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting alpha: was %.3g, now %.3g (diff %.3g); with Ctrl to adjust lightness, with Shift to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff); } else if (modifier == 2) { // saturation DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust saturation"))); double ch = hsla[1]; - parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting saturation: was %.3g, now %.3g (diff %.3g); with Ctrl to adjust lightness, with Alt to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); + parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting saturation: was %.3g, now %.3g (diff %.3g); with Ctrl to adjust lightness, with Alt to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); } else if (modifier == 1) { // lightness DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust lightness"))); double ch = hsla[2]; - parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting lightness: was %.3g, now %.3g (diff %.3g); with Shift to adjust saturation, with Alt to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); + parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting lightness: was %.3g, now %.3g (diff %.3g); with Shift to adjust saturation, with Alt to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); } else { // hue DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust hue"))); double ch = hsla[0]; - parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting hue: was %.3g, now %.3g (diff %.3g); with Shift to adjust saturation, with Alt to adjust alpha, with Ctrl to adjust lightness"), ch - diff, ch, diff); + parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting hue: was %.3g, now %.3g (diff %.3g); with Shift to adjust saturation, with Alt to adjust alpha, with Ctrl to adjust lightness"), ch - diff, ch, diff); } } @@ -1424,7 +1424,7 @@ RotateableSwatch::do_release(double by, guint modifier) { undokey = "ssrot1"; } - parent->getDesktop()->event_context->_message_context->clear(); + parent->getDesktop()->event_context->message_context->clear(); startcolor_set = false; } @@ -1490,7 +1490,7 @@ RotateableStrokeWidth::do_motion(double by, guint modifier) { double diff = value_adjust(startvalue, by, modifier, false); DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width"))); - parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting stroke width: was %.3g, now %.3g (diff %.3g)"), startvalue, startvalue + diff, diff); + parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting stroke width: was %.3g, now %.3g (diff %.3g)"), startvalue, startvalue + diff, diff); } } @@ -1511,7 +1511,7 @@ RotateableStrokeWidth::do_release(double by, guint modifier) { } else { undokey = "swrot1"; } - parent->getDesktop()->event_context->_message_context->clear(); + parent->getDesktop()->event_context->message_context->clear(); } void -- cgit v1.2.3