From dbef09a2bb629cf6001a3963f6899bcac53b7774 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 May 2013 18:29:28 -0700 Subject: ACME-344 : Menu hooked up. Readded the missing completedHeader() methods in responder that I mistakenly took out during the refactor. --- indra/newview/llviewermenu.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index beca08203f..bb9ad8c606 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -52,6 +52,7 @@ #include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" +#include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -5970,6 +5971,21 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } +void handle_facebook_connect() +{ + if (LLFacebookConnect::instance().getConnected()) + { + LLFacebookConnect::instance().disconnectFromFacebook(); + } + else + { + LLFacebookConnect::instance().getConnectionToFacebook(); + } +} + +//bool is_facebook_connected(); + + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8719,4 +8735,7 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + + // Facebook Connect + commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); } -- cgit v1.2.3 From abcb3e85628712da4d61fda6e68bb86a29e1f965 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 4 Jun 2013 18:39:41 -0700 Subject: ACME-471: Once connected to facebook, a user can use the 'Check in to Facebook' button under the 'Me' menu to make a check in post to Facebook --- indra/newview/llviewermenu.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bb9ad8c606..eb100a3f9b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -45,6 +45,7 @@ #include "llagent.h" #include "llagentaccess.h" #include "llagentcamera.h" +#include "llagentui.h" #include "llagentwearables.h" #include "llagentpilot.h" #include "llcompilequeue.h" @@ -5983,6 +5984,26 @@ void handle_facebook_connect() } } +void handle_facebook_checkin() +{ + + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + //Get the location name + LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); + std::string parcel_string = parcel->getAgentParcelName(); + + //Get the location description + LLVector3 agent_pos = gAgent.getPositionAgent(); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + + LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); +} + //bool is_facebook_connected(); @@ -8738,4 +8759,6 @@ void initialize_menus() // Facebook Connect commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); + // Facebook Checkin + commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); } -- cgit v1.2.3 From 1734cabbcc15411afa4bd52e370290d6fbc487ba Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 00:32:15 -0700 Subject: ACME-471: In last commit was not using the correct name and location. Now using the proper name and location. --- indra/newview/llviewermenu.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index eb100a3f9b..bd5a37876f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5992,16 +5992,40 @@ void handle_facebook_checkin() LLAgentUI::buildSLURL(slurl); std::string slurl_string = slurl.getSLURLString(); - //Get the location name + std::string region_name = gAgent.getRegion()->getName(); + + //Get the parcel name LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_string = parcel->getAgentParcelName(); + std::string parcel_title = parcel->getAgentParcelName(); + + //Create the location + LLVector3 agent_pos_region = gAgent.getPositionAgent(); + S32 pos_x = S32(agent_pos_region.mV[VX]); + S32 pos_y = S32(agent_pos_region.mV[VY]); + S32 pos_z = S32(agent_pos_region.mV[VZ]); + + // Round the numbers based on the velocity + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + + const F32 FLY_CUTOFF = 6.f; // meters/sec + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; // meters/sec + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } - //Get the location description - LLVector3 agent_pos = gAgent.getPositionAgent(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); - LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From 3d40f4d82f067421e63ac3719ce22c18e29b0e20 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 14:45:11 -0700 Subject: ACME-471: Code cleanup, instead of duplicating code from LLAgentUI::buildLocationString, now calling LLAgentUI::buildLocationString with a flag to perform a similar operation. --- indra/newview/llviewermenu.cpp | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bd5a37876f..471db8d8fc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5993,37 +5993,8 @@ void handle_facebook_checkin() std::string slurl_string = slurl.getSLURLString(); std::string region_name = gAgent.getRegion()->getName(); - - //Get the parcel name - LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_title = parcel->getAgentParcelName(); - - //Create the location - LLVector3 agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX]); - S32 pos_y = S32(agent_pos_region.mV[VY]); - S32 pos_z = S32(agent_pos_region.mV[VZ]); - - // Round the numbers based on the velocity - F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -- cgit v1.2.3 From cf5cf32ebf3a8eccbaa9e8c092fd23b357a68727 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 16:31:32 -0700 Subject: ACME-471: Now using the actual map top-down image for the checked in location. --- indra/newview/llviewermenu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..e8c7e0cfdc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5995,8 +5995,12 @@ void handle_facebook_checkin() std::string region_name = gAgent.getRegion()->getName(); std::string description; LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From ba90e388855f99ec5b3f1991f2437f616a5d9e62 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Jun 2013 19:40:33 -0700 Subject: ACME-464 : WIP : Make the menu Connect to FB only connect and be disabled if the user is already connected --- indra/newview/llviewermenu.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..bc2e13d77e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5974,16 +5974,18 @@ void handle_report_abuse() void handle_facebook_connect() { - if (LLFacebookConnect::instance().getConnected()) - { - LLFacebookConnect::instance().disconnectFromFacebook(); - } - else + if (!LLFacebookConnect::instance().getConnected()) { LLFacebookConnect::instance().getConnectionToFacebook(); } } +bool enable_facebook_connect() +{ + // The menu item will be disabled if we are already connected + return !LLFacebookConnect::instance().getConnected(); +} + void handle_facebook_checkin() { @@ -5999,9 +6001,6 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -//bool is_facebook_connected(); - - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8754,6 +8753,8 @@ void initialize_menus() // Facebook Connect commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); + enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect)); + // Facebook Checkin commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); } -- cgit v1.2.3 From 54e879cc22ec342f57cec23d38ba269b83489111 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 8 Jun 2013 00:48:46 +0100 Subject: added Facebook status update feature for ACME-502, ACME-503, and ACME-504 --- indra/newview/llviewermenu.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bfa5ac2d1..67460c4bc6 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6005,6 +6005,23 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } +bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + std::string message = response["message"].asString(); + if (!message.empty()) + LLFacebookConnect::instance().updateStatus(message); + } + return false; +} + +void handle_facebook_status() +{ + LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); +} + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8761,4 +8778,7 @@ void initialize_menus() // Facebook Checkin commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); + + // Facebook Status Update + commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } -- cgit v1.2.3 From 2eb466908e8056f9b890d06d449ad8d10d3ff4cf Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 14 Jun 2013 20:01:33 -0700 Subject: ACME-520 : Add more extended state in LLFacebookConnect and handle it consistently and transparently from the public interface --- indra/newview/llviewermenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 67460c4bc6..ae28d6b129 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5974,7 +5974,7 @@ void handle_report_abuse() void handle_facebook_connect() { - if (!LLFacebookConnect::instance().getConnected()) + if (!LLFacebookConnect::instance().isConnected()) { LLFacebookConnect::instance().getConnectionToFacebook(); } @@ -5983,7 +5983,7 @@ void handle_facebook_connect() bool enable_facebook_connect() { // The menu item will be disabled if we are already connected - return !LLFacebookConnect::instance().getConnected(); + return !LLFacebookConnect::instance().isConnected(); } void handle_facebook_checkin() -- cgit v1.2.3 From 0e50cbc2edacdecf32071c97c2ce5349db5ef5e9 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 01:21:14 +0100 Subject: made it optional to autoconnect in LLFacebookConnect::getConnectionToFacebook() for ACME-648 --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index df2da12045..47787e2687 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5957,7 +5957,7 @@ void handle_facebook_connect() { if (!LLFacebookConnect::instance().isConnected()) { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } } -- cgit v1.2.3 From 7d17bbe132cf0f799b703bba978d48d44a1377c4 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 19:26:07 +0100 Subject: removed unused Me menu items for ACME-637 --- indra/newview/llviewermenu.cpp | 60 ------------------------------------------ 1 file changed, 60 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 47787e2687..137eeb6a99 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5953,56 +5953,6 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } -void handle_facebook_connect() -{ - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().getConnectionToFacebook(true); - } -} - -bool enable_facebook_connect() -{ - // The menu item will be disabled if we are already connected - return !LLFacebookConnect::instance().isConnected(); -} - -void handle_facebook_checkin() -{ - - // Get the location SLURL - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - std::string region_name = gAgent.getRegion()->getName(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); - LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); - int x_pos = center_agent[0] / 256.0; - int y_pos = center_agent[1] / 256.0; - std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); -} - -bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - std::string message = response["message"].asString(); - if (!message.empty()) - LLFacebookConnect::instance().updateStatus(message); - } - return false; -} - -void handle_facebook_status() -{ - LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); -} - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8801,14 +8751,4 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); - - // Facebook Connect - commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); - enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect)); - - // Facebook Checkin - commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); - - // Facebook Status Update - commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } -- cgit v1.2.3 From ee0b66f080de53f70599c824d5ff231d6a9c739f Mon Sep 17 00:00:00 2001 From: "Jeff (Gioffredo Linden)" Date: Thu, 25 Jul 2013 16:07:16 -0400 Subject: VITA test framework - record events support --- indra/newview/llviewermenu.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5e2f05f468..7bde5d388e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -40,6 +40,7 @@ #include "llinventorypanel.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llviewereventrecorder.h" // newview includes #include "llagent.h" @@ -1950,6 +1951,43 @@ class LLAdvancedDropPacket : public view_listener_t }; +//////////////////// +// EVENT Recorder // +/////////////////// + + +class LLAdvancedViewerEventRecorder : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string command = userdata.asString(); + if ("start playback" == command) + { + llinfos << "Event Playback starting" << llendl; + LLViewerEventRecorder::instance().playbackRecording(); + llinfos << "Event Playback completed" << llendl; + } + else if ("stop playback" == command) + { + // Future + } + else if ("start recording" == command) + { + LLViewerEventRecorder::instance().setEventLoggingOn(); + llinfos << "Event recording started" << llendl; + } + else if ("stop recording" == command) + { + LLViewerEventRecorder::instance().setEventLoggingOff(); + llinfos << "Event recording stopped" << llendl; + } + + return true; + } +}; + + + ///////////////// // AGENT PILOT // @@ -8320,6 +8358,8 @@ void initialize_menus() // Don't prepend MenuName.Foo because these can be used in any menu. enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service)); + enable.add("displayViewerEventRecorderMenuItems",boost::bind(&LLViewerEventRecorder::displayViewerEventRecorderMenuItems,&LLViewerEventRecorder::instance())); + view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts"); enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed)); @@ -8578,6 +8618,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedAgentPilot(), "Advanced.AgentPilot"); view_listener_t::addMenu(new LLAdvancedToggleAgentPilotLoop(), "Advanced.ToggleAgentPilotLoop"); view_listener_t::addMenu(new LLAdvancedCheckAgentPilotLoop(), "Advanced.CheckAgentPilotLoop"); + view_listener_t::addMenu(new LLAdvancedViewerEventRecorder(), "Advanced.EventRecorder"); // Advanced > Debugging view_listener_t::addMenu(new LLAdvancedForceErrorBreakpoint(), "Advanced.ForceErrorBreakpoint"); -- cgit v1.2.3