summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-06-02 13:40:12 -0700
committerRichard Linden <none@none>2010-06-02 13:40:12 -0700
commit1bfd7a659b4539c1011ab314cac161e14a1fa13e (patch)
treedfa4f6c9007d5ca7ce4950d49aca160172e07010 /indra
parent9e7cf5c1bc9174d65c2541f54a3a70a2864519b7 (diff)
EXT-7600 FIX Context menus for line editors don't work on login screen
initialize edit menu callbacks earlier
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llstartup.cpp2
-rw-r--r--indra/newview/llviewermenu.cpp58
-rw-r--r--indra/newview/llviewermenu.h1
3 files changed, 30 insertions, 31 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6418551517..e51e6363dd 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -736,6 +736,8 @@ bool idle_startup()
// Make sure the process dialog doesn't hide things
gViewerWindow->setShowProgress(FALSE);
+ initialize_edit_menu();
+
// Show the login dialog
login_show();
// connect dialog is already shown, so fill in the names
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 69352e6685..a1b909c609 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2403,18 +2403,14 @@ void handle_object_touch()
msg->sendMessage(object->getRegion()->getHost());
}
-bool enable_object_touch()
-{
- LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- return obj && obj->flagHandleTouch();
-}
-
// One object must have touch sensor
class LLObjectEnableTouch : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- bool new_value = enable_object_touch();
+ LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
+
+ bool new_value = obj && obj->flagHandleTouch();
// Update label based on the node touch name if available.
std::string touch_text;
@@ -7705,6 +7701,30 @@ void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y)
LLMenuGL::showPopup(ctrl, show_navbar_context_menu, x, y);
}
+void initialize_edit_menu()
+{
+ view_listener_t::addMenu(new LLEditUndo(), "Edit.Undo");
+ view_listener_t::addMenu(new LLEditRedo(), "Edit.Redo");
+ view_listener_t::addMenu(new LLEditCut(), "Edit.Cut");
+ view_listener_t::addMenu(new LLEditCopy(), "Edit.Copy");
+ view_listener_t::addMenu(new LLEditPaste(), "Edit.Paste");
+ view_listener_t::addMenu(new LLEditDelete(), "Edit.Delete");
+ view_listener_t::addMenu(new LLEditSelectAll(), "Edit.SelectAll");
+ view_listener_t::addMenu(new LLEditDeselect(), "Edit.Deselect");
+ view_listener_t::addMenu(new LLEditDuplicate(), "Edit.Duplicate");
+ view_listener_t::addMenu(new LLEditTakeOff(), "Edit.TakeOff");
+ view_listener_t::addMenu(new LLEditEnableUndo(), "Edit.EnableUndo");
+ view_listener_t::addMenu(new LLEditEnableRedo(), "Edit.EnableRedo");
+ view_listener_t::addMenu(new LLEditEnableCut(), "Edit.EnableCut");
+ view_listener_t::addMenu(new LLEditEnableCopy(), "Edit.EnableCopy");
+ view_listener_t::addMenu(new LLEditEnablePaste(), "Edit.EnablePaste");
+ view_listener_t::addMenu(new LLEditEnableDelete(), "Edit.EnableDelete");
+ view_listener_t::addMenu(new LLEditEnableSelectAll(), "Edit.EnableSelectAll");
+ view_listener_t::addMenu(new LLEditEnableDeselect(), "Edit.EnableDeselect");
+ view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");
+
+}
+
void initialize_menus()
{
// A parameterized event handler used as ctrl-8/9/0 zoom controls below.
@@ -7731,7 +7751,6 @@ void initialize_menus()
// Generic enable and visible
// Don't prepend MenuName.Foo because these can be used in any menu.
enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service));
- enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service));
view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts");
@@ -7742,27 +7761,6 @@ void initialize_menus()
// File menu
init_menu_file();
- // Edit menu
- view_listener_t::addMenu(new LLEditUndo(), "Edit.Undo");
- view_listener_t::addMenu(new LLEditRedo(), "Edit.Redo");
- view_listener_t::addMenu(new LLEditCut(), "Edit.Cut");
- view_listener_t::addMenu(new LLEditCopy(), "Edit.Copy");
- view_listener_t::addMenu(new LLEditPaste(), "Edit.Paste");
- view_listener_t::addMenu(new LLEditDelete(), "Edit.Delete");
- view_listener_t::addMenu(new LLEditSelectAll(), "Edit.SelectAll");
- view_listener_t::addMenu(new LLEditDeselect(), "Edit.Deselect");
- view_listener_t::addMenu(new LLEditDuplicate(), "Edit.Duplicate");
- view_listener_t::addMenu(new LLEditTakeOff(), "Edit.TakeOff");
-
- view_listener_t::addMenu(new LLEditEnableUndo(), "Edit.EnableUndo");
- view_listener_t::addMenu(new LLEditEnableRedo(), "Edit.EnableRedo");
- view_listener_t::addMenu(new LLEditEnableCut(), "Edit.EnableCut");
- view_listener_t::addMenu(new LLEditEnableCopy(), "Edit.EnableCopy");
- view_listener_t::addMenu(new LLEditEnablePaste(), "Edit.EnablePaste");
- view_listener_t::addMenu(new LLEditEnableDelete(), "Edit.EnableDelete");
- view_listener_t::addMenu(new LLEditEnableSelectAll(), "Edit.EnableSelectAll");
- view_listener_t::addMenu(new LLEditEnableDeselect(), "Edit.EnableDeselect");
- view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate");
view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");
view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar");
view_listener_t::addMenu(new LLEnableEditShape(), "Edit.EnableEditShape");
@@ -8048,7 +8046,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");
enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2));
- enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2));
// Object pie menu
view_listener_t::addMenu(new LLObjectBuild(), "Object.Build");
@@ -8070,7 +8067,6 @@ void initialize_menus()
commit.add("Object.Open", boost::bind(&handle_object_open));
commit.add("Object.Take", boost::bind(&handle_take));
enable.add("Object.EnableOpen", boost::bind(&enable_object_open));
- enable.add("Object.EnableTouch", boost::bind(&enable_object_touch));
view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch");
view_listener_t::addMenu(new LLObjectEnableSitOrStand(), "Object.EnableSitOrStand");
enable.add("Object.EnableDelete", boost::bind(&enable_object_delete));
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index d72ea00077..ad88fcea9a 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -44,6 +44,7 @@ class LLParcelSelection;
class LLObjectSelection;
class LLSelectNode;
+void initialize_edit_menu();
void init_menus();
void cleanup_menus();