summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-07-31 19:11:20 +0000
committerMarkus Engel <markus.engel@tum.de>2013-07-31 19:11:20 +0000
commit989abbac025a8b3349748d19a613a08586c5fdcd (patch)
tree157b5f656c6344784aea3c498fa60199bd7d2958 /src/ui
parentFurther refactoring of EventContexts. (diff)
downloadinkscape-989abbac025a8b3349748d19a613a08586c5fdcd.tar.gz
inkscape-989abbac025a8b3349748d19a613a08586c5fdcd.zip
Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes.
(bzr r11608.1.110)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/tool/node-tool.cpp22
-rw-r--r--src/ui/tool/node-tool.h1
-rw-r--r--src/ui/widget/selected-style.cpp14
3 files changed, 15 insertions, 22 deletions
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", "<b>Shift</b>: 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", "<b>Shift</b>: 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 <b>alpha</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, with <b>Shift</b> to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff);
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>alpha</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, with <b>Shift</b> 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 <b>saturation</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, with <b>Alt</b> to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff);
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>saturation</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, with <b>Alt</b> 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 <b>lightness</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Alt</b> to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff);
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>lightness</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Alt</b> 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 <b>hue</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Alt</b> to adjust alpha, with <b>Ctrl</b> to adjust lightness"), ch - diff, ch, diff);
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>hue</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Alt</b> to adjust alpha, with <b>Ctrl</b> 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 <b>stroke width</b>: was %.3g, now <b>%.3g</b> (diff %.3g)"), startvalue, startvalue + diff, diff);
+ parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>stroke width</b>: was %.3g, now <b>%.3g</b> (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