summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorcallum <none@none>2011-10-20 15:03:28 -0700
committercallum <none@none>2011-10-20 15:03:28 -0700
commit6998c5ebc7aad43d44f1bb6e42e20503c2ff144f (patch)
tree916f1c113192211d85a7772b4b62df65f0a613d7 /indra/llui
parenta1561c20e063060a6a54b4e66968404e4cb15d8a (diff)
parent4a90d9f3d6d4491aab8b17bc8dc7f3c8ac90de49 (diff)
Merge with head
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcommandmanager.cpp9
-rw-r--r--indra/llui/llcommandmanager.h23
-rw-r--r--indra/llui/llfloater.cpp4
-rw-r--r--indra/llui/lltoolbar.cpp2
4 files changed, 13 insertions, 25 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 128ba609cb..0e2f3f1961 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -41,7 +41,7 @@
// LLCommandId class
//
-const LLCommandId LLCommandId::null = LLCommandId();
+const LLCommandId LLCommandId::null = LLCommandId("null command");
//
// LLCommand class
@@ -67,10 +67,11 @@ LLCommand::Params::Params()
}
LLCommand::LLCommand(const LLCommand::Params& p)
- : mAvailableInToybox(p.available_in_toybox)
+ : mIdentifier(p.name)
+ , mAvailableInToybox(p.available_in_toybox)
, mIcon(p.icon)
- , mIdentifier(p.name)
, mLabelRef(p.label_ref)
+ , mName(p.name)
, mTooltipRef(p.tooltip_ref)
, mExecuteFunction(p.execute_function)
, mExecuteParameters(p.execute_parameters)
@@ -134,7 +135,7 @@ void LLCommandManager::addCommand(LLCommand * command)
mCommandIndices[command_id.uuid()] = mCommands.size();
mCommands.push_back(command);
- lldebugs << "Successfully added command: " << command->id().name() << llendl;
+ lldebugs << "Successfully added command: " << command->name() << llendl;
}
//static
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index 9b93ab735a..a7276a48aa 100644
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -50,31 +50,20 @@ public:
{}
};
- LLCommandId()
- : mName("null command")
- {
- mUUID = LLUUID::generateNewID(mName);
- }
-
LLCommandId(const std::string& name)
- : mName(name)
{
mUUID = LLUUID::generateNewID(name);
}
LLCommandId(const Params& p)
- : mName(p.name)
{
mUUID = LLUUID::generateNewID(p.name);
}
LLCommandId(const LLUUID& uuid)
- : mName(""),
- mUUID(uuid)
- {
- }
+ : mUUID(uuid)
+ {}
- const std::string& name() const { return mName; }
const LLUUID& uuid() const { return mUUID; }
bool operator!=(const LLCommandId& command) const
@@ -87,15 +76,9 @@ public:
return (mUUID == command.mUUID);
}
- bool operator<(const LLCommandId& command) const
- {
- return (mName < command.mName);
- }
-
static const LLCommandId null;
private:
- std::string mName;
LLUUID mUUID;
};
@@ -137,6 +120,7 @@ public:
const std::string& icon() const { return mIcon; }
const LLCommandId& id() const { return mIdentifier; }
const std::string& labelRef() const { return mLabelRef; }
+ const std::string& name() const { return mName; }
const std::string& tooltipRef() const { return mTooltipRef; }
const std::string& executeFunctionName() const { return mExecuteFunction; }
@@ -160,6 +144,7 @@ private:
bool mAvailableInToybox;
std::string mIcon;
std::string mLabelRef;
+ std::string mName;
std::string mTooltipRef;
std::string mExecuteFunction;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index bd537bfb19..ddc90b0378 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -875,7 +875,8 @@ bool LLFloater::applyRectControl()
{
bool saved_rect = false;
- if (LLFloaterReg::getLastFloaterInGroup(mInstanceName))
+ LLFloater* last_in_group = LLFloaterReg::getLastFloaterInGroup(mInstanceName);
+ if (last_in_group && last_in_group != this)
{
// other floaters in our group, position ourselves relative to them and don't save the rect
mRectControl.clear();
@@ -1589,6 +1590,7 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)
if (mDocked)
{
setMinimized(FALSE);
+ mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE;
}
updateTitleButtons();
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index bceda9bf54..515605200e 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -821,7 +821,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
if (!commandp) return NULL;
LLToolBarButton::Params button_p;
- button_p.name = commandp->id().name(); // Make sure to retrieve the name from the command itself, not the passed in id
+ button_p.name = commandp->name();
button_p.label = LLTrans::getString(commandp->labelRef());
button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
button_p.image_overlay = LLUI::getUIImage(commandp->icon());