Skip to content
Snippets Groups Projects
Commit 76969a99 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

- fixed : "Build" button on the bottom tray should visually disable when both...

- fixed : "Build" button on the bottom tray should visually disable when both @edit=n and @rez=n restricted (thankies Chloe)
    -> see http://redmine.catznip.com/issues/2
- fixed : "Build" menu option under "Build" should visually disable when both @edit=n and @rez=n restricted

--HG--
branch : RLVa
parent c273067c
No related branches found
No related tags found
No related merge requests found
...@@ -48,10 +48,17 @@ ...@@ -48,10 +48,17 @@
#include "llsyswellwindow.h" #include "llsyswellwindow.h"
#include "lltoolmgr.h" #include "lltoolmgr.h"
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d)
#include "rlvhandler.h"
#include "rlvui.h"
// [/RLVa:KB]
static void update_build_button_enable_state() static void update_build_button_enable_state()
{ {
bool can_edit = LLToolMgr::getInstance()->canEdit(); // bool can_edit = LLToolMgr::getInstance()->canEdit();
// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d
bool can_edit = RlvUIEnabler::isBuildEnabled();
// [/RLVa:KB]
LLBottomTray::getInstance()->getChildView("build_btn")->setEnabled(can_edit); LLBottomTray::getInstance()->getChildView("build_btn")->setEnabled(can_edit);
} }
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "llviewerparcelmgr.h" #include "llviewerparcelmgr.h"
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e)
#include "rlvhandler.h" #include "rlvhandler.h"
#include "rlvui.h"
// [/RLVa:KB] // [/RLVa:KB]
// Used when app not active to avoid processing hover. // Used when app not active to avoid processing hover.
...@@ -82,7 +83,10 @@ LLToolMgr::LLToolMgr() ...@@ -82,7 +83,10 @@ LLToolMgr::LLToolMgr()
{ {
// Not a panel, register these callbacks globally. // Not a panel, register these callbacks globally.
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); // LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&RlvUIEnabler::isBuildEnabled));
// [/RLVa:KB]
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this));
gToolNull = new LLTool(LLStringUtil::null); // Does nothing gToolNull = new LLTool(LLStringUtil::null); // Does nothing
......
...@@ -65,6 +65,7 @@ RlvUIEnabler::RlvUIEnabler() ...@@ -65,6 +65,7 @@ RlvUIEnabler::RlvUIEnabler()
// onToggleXXX // onToggleXXX
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_FLY, boost::bind(&RlvUIEnabler::onToggleFly, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_FLY, boost::bind(&RlvUIEnabler::onToggleFly, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_REZ, boost::bind(&RlvUIEnabler::onToggleRez, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this)));
...@@ -127,6 +128,9 @@ void RlvUIEnabler::onToggleEdit() ...@@ -127,6 +128,9 @@ void RlvUIEnabler::onToggleEdit()
LLToolMgr::instance().toggleBuildMode(); LLToolMgr::instance().toggleBuildMode();
} }
// Enable/disable the "Build" bottom tray button (but only if edit *and* rez restricted)
LLBottomTray::getInstance()->getChild<LLButton>("build_btn")->setEnabled(isBuildEnabled());
// Start or stop filtering opening the beacons floater // Start or stop filtering opening the beacons floater
if (!fEnable) if (!fEnable)
addGenericFloaterFilter("beacons"); addGenericFloaterFilter("beacons");
...@@ -147,6 +151,13 @@ void RlvUIEnabler::onToggleFly() ...@@ -147,6 +151,13 @@ void RlvUIEnabler::onToggleFly()
LLFloaterMove::sUpdateFlyingStatus(); LLFloaterMove::sUpdateFlyingStatus();
} }
// Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d
void RlvUIEnabler::onToggleRez()
{
// Enable/disable the "Build" bottom tray button
LLBottomTray::getInstance()->getChild<LLButton>("build_btn")->setEnabled(isBuildEnabled());
}
// Checked: 2010-03-17 (RLVa-1.2.0a) | Added: RLVa-1.2.0a // Checked: 2010-03-17 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
void RlvUIEnabler::onToggleSetEnv() void RlvUIEnabler::onToggleSetEnv()
{ {
...@@ -597,4 +608,10 @@ bool RlvUIEnabler::hasOpenProfile(const LLUUID& idAgent) ...@@ -597,4 +608,10 @@ bool RlvUIEnabler::hasOpenProfile(const LLUUID& idAgent)
return false; return false;
} }
// Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d
bool RlvUIEnabler::isBuildEnabled()
{
return (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT) || !gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && LLToolMgr::getInstance()->canEdit();
}
// ============================================================================ // ============================================================================
...@@ -46,6 +46,7 @@ protected: ...@@ -46,6 +46,7 @@ protected:
void onRefreshHoverText(); // showloc, shownames, showhovertext(all|world|hud) void onRefreshHoverText(); // showloc, shownames, showhovertext(all|world|hud)
void onToggleEdit(); // edit void onToggleEdit(); // edit
void onToggleFly(); // fly void onToggleFly(); // fly
void onToggleRez(); // rez
void onToggleSetEnv(); // setenv void onToggleSetEnv(); // setenv
void onToggleShowInv(); // showinv void onToggleShowInv(); // showinv
void onToggleShowLoc(); // showloc void onToggleShowLoc(); // showloc
...@@ -92,6 +93,7 @@ public: ...@@ -92,6 +93,7 @@ public:
static bool canViewRegionProperties(); // showloc static bool canViewRegionProperties(); // showloc
static bool hasOpenIM(const LLUUID& idAgent); // shownames static bool hasOpenIM(const LLUUID& idAgent); // shownames
static bool hasOpenProfile(const LLUUID& idAgent); // shownames static bool hasOpenProfile(const LLUUID& idAgent); // shownames
static bool isBuildEnabled(); // edit and rez
/* /*
* Member variables * Member variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment