From b3f55760cbb99bd4cc96d86eae8068e724d0abe9 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 2 Sep 2012 13:24:45 +0900 Subject: Fix for 273539 : Add Group action to the context menu (bzr r11640) --- src/interface.cpp | 16 ++++++++++++++++ src/interface.h | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/interface.cpp b/src/interface.cpp index 71be84f59..b10ba3077 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -1887,6 +1887,17 @@ void ContextMenu::MakeItemMenu (void) } mi->show(); append(*mi); + + /* Group */ + mi = manage(new Gtk::MenuItem(_("_Group"),1)); + mi->signal_activate().connect(sigc::mem_fun(*this, &ContextMenu::ActivateGroup)); + if (_desktop->selection->isEmpty() || _desktop->selection->single()) { + mi->set_sensitive(FALSE); + } else { + mi->set_sensitive(TRUE); + } + mi->show(); + append(*mi); } void ContextMenu::SelectSameFillStroke(void) @@ -1979,6 +1990,11 @@ void ContextMenu::MakeGroupMenu(void) append(*mi); } +void ContextMenu::ActivateGroup(void) +{ + sp_selection_group(_desktop); +} + void ContextMenu::ActivateUngroup(void) { GSList *children = NULL; diff --git a/src/interface.h b/src/interface.h index 931a2c1b3..aa0281db3 100644 --- a/src/interface.h +++ b/src/interface.h @@ -185,10 +185,10 @@ class ContextMenu : public Gtk::Menu /** - * callback, is executed on clicking the anchor "Ungroup" menu entry + * callback, is executed on clicking the anchor "Group" and "Ungroup" menu entry */ void ActivateUngroup(void); - + void ActivateGroup(void); void AnchorLinkProperties(void); /** -- cgit v1.2.3