PE merge.

master
Tofu Linden 2010-02-18 16:57:52 +00:00
commit b5f9e437ea
17 changed files with 142 additions and 95 deletions

View File

@ -257,6 +257,8 @@ public:
void setForcePressedState(bool b) { mForcePressedState = b; }
void setAutoResize(bool auto_resize) { mAutoResize = auto_resize; }
protected:
LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; }
LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; }

View File

@ -155,7 +155,7 @@ void LLSearchEditor::setFocus( BOOL b )
void LLSearchEditor::onClearButtonClick(const LLSD& data)
{
setText(LLStringUtil::null);
mSearchEditor->selectAll();
mSearchEditor->doDelete(); // force keystroke callback
}

View File

@ -721,22 +721,26 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
notify_box->setFollowsRight();
notify_box->setFollowsTop();
LLButton* accept_button = notify_box->getChild<LLButton> ("Accept",
TRUE);
if (accept_button != NULL)
ctrl_list_t ctrls = notify_box->getControlPanel()->getCtrlList();
S32 offset = 0;
for (ctrl_list_t::iterator it = ctrls.begin(); it != ctrls.end(); it++)
{
accept_button->setFollowsNone();
accept_button->setOrigin(2*HPAD, accept_button->getRect().mBottom);
}
LLButton* decline_button = notify_box->getChild<LLButton> (
"Decline", TRUE);
if (accept_button != NULL && decline_button != NULL)
{
decline_button->setFollowsNone();
decline_button->setOrigin(4*HPAD
+ accept_button->getRect().getWidth(),
decline_button->getRect().mBottom);
LLButton * button = dynamic_cast<LLButton*> (*it);
if (button != NULL)
{
button->setOrigin( offset,
button->getRect().mBottom);
button->setLeftHPad(2 * HPAD);
button->setRightHPad(2 * HPAD);
// set zero width before perform autoResize()
button->setRect(LLRect(button->getRect().mLeft,
button->getRect().mTop, button->getRect().mLeft,
button->getRect().mBottom));
button->setAutoResize(true);
button->autoResize();
offset += 2 * HPAD + button->getRect().getWidth();
button->setFollowsNone();
}
}
LLTextEditor* text_editor = notify_box->getChild<LLTextEditor>("text_editor_box", TRUE);

View File

@ -315,7 +315,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this));
mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this));
mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this));
mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1));
mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this));
mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this));
@ -674,21 +673,6 @@ void LLFloaterPreference::refreshEnabledGraphics()
}
}
void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl)
{
// get our UI widgets
LLSliderCtrl* slider = (LLSliderCtrl*) ctrl;
LLTextBox* m1 = getChild<LLTextBox>("DrawDistanceMeterText1");
LLTextBox* m2 = getChild<LLTextBox>("DrawDistanceMeterText2");
// toggle the two text boxes based on whether we have 1 or two digits
F32 val = slider->getValueF32();
bool two_digits = val < 100;
m1->setVisible(two_digits);
m2->setVisible(!two_digits);
}
void LLFloaterPreference::onClickBrowserClearCache()
{
LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache);

View File

@ -287,7 +287,7 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata)
return gAgent.getGroupID() != selected_group_id;
if (userdata.asString() == "call")
return LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking();
return real_group_selected && LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking();
return real_group_selected;
}

View File

@ -250,6 +250,12 @@ void LLFloaterMove::setSittingMode(BOOL bSitting)
else
{
LLPanelStandStopFlying::clearStandStopFlyingMode(LLPanelStandStopFlying::SSFM_STAND);
// show "Stop Flying" button if needed. EXT-871
if (gAgent.getFlying())
{
LLPanelStandStopFlying::setStandStopFlyingMode(LLPanelStandStopFlying::SSFM_STOP_FLYING);
}
}
enableInstance(!bSitting);
}
@ -684,10 +690,6 @@ void LLPanelStandStopFlying::onStandButtonClick()
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
setFocus(FALSE); // EXT-482
BOOL fly = gAgent.getFlying();
mStopFlyingButton->setVisible(fly);
setVisible(fly);
}
void LLPanelStandStopFlying::onStopFlyingButtonClick()

View File

@ -334,11 +334,6 @@ public:
* Adds notification panel to the IM floater.
*/
static void addNotifPanelToIM(const LLNotificationPtr& notification);
/**
* Reloads IM floater messages.
*/
static void reloadIMFloaterMessages(const LLNotificationPtr& notification);
};
}

View File

@ -94,7 +94,8 @@ bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification)
// static
bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification)
{
return OFFER_FRIENDSHIP == notification->getName();
return OFFER_FRIENDSHIP == notification->getName()
|| USER_GIVE_ITEM == notification->getName();
}
@ -265,31 +266,8 @@ void LLHandlerUtil::addNotifPanelToIM(const LLNotificationPtr& notification)
offer["from_id"] = notification->getPayload()["from_id"];
offer["from"] = name;
offer["time"] = LLLogChat::timestamp(true);
offer["index"] = (LLSD::Integer)session->mMsgs.size();
session->mMsgs.push_front(offer);
LLIMFloater::show(session_id);
}
// static
void LLHandlerUtil::reloadIMFloaterMessages(
const LLNotificationPtr& notification)
{
LLUUID from_id = notification->getPayload()["from_id"];
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>(
"impanel", session_id);
if (im_floater != NULL)
{
LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession(
session_id);
if(session != NULL)
{
session->mMsgs.clear();
std::list<LLSD> chat_history;
LLLogChat::loadAllHistory(session->mHistoryFileName, chat_history);
session->addMessagesFromHistory(chat_history);
}
im_floater->reloadMessages();
}
}

View File

@ -155,10 +155,6 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
}
else
{
if (LLHandlerUtil::canAddNotifPanelToIM(notification))
{
LLHandlerUtil::reloadIMFloaterMessages(notification);
}
mChannel->killToastByNotificationID(notification->getID());
}
}

View File

@ -351,7 +351,14 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
if (mNoPicks && mNoClassifieds)
{
childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText"));
if(getAvatarId() == gAgentID)
{
childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText"));
}
else
{
childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText"));
}
}
}

View File

@ -249,6 +249,7 @@ void LLPreviewTexture::draw()
}
}
}
}
@ -283,18 +284,52 @@ void LLPreviewTexture::saveAs()
// virtual
void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent)
{
// mLastHeight = 0;
// mLastWidth = 0;
mUpdateDimensions = TRUE;
LLPreview::reshape(width, height, called_from_parent);
LLRect dim_rect;
childGetRect("dimensions", dim_rect);
S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE;
// add space for dimensions and aspect ratio
S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD;
LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
S32 client_width = client_rect.getWidth();
S32 client_height = client_rect.getHeight();
if (mAspectRatio > 0.f)
{
if(mAspectRatio > 1.f)
{
client_height = llceil((F32)client_width / mAspectRatio);
if(client_height > client_rect.getHeight())
{
client_height = client_rect.getHeight();
client_width = llceil((F32)client_height * mAspectRatio);
}
}
else//mAspectRatio < 1.f
{
client_width = llceil((F32)client_height * mAspectRatio);
if(client_width > client_rect.getWidth())
{
client_width = client_rect.getWidth();
client_height = llceil((F32)client_width / mAspectRatio);
}
}
}
mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height);
}
// virtual
void LLPreviewTexture::onFocusReceived()
{
mLastHeight = 0;
mLastWidth = 0;
mUpdateDimensions = TRUE;
LLPreview::onFocusReceived();
}
@ -365,13 +400,19 @@ void LLPreviewTexture::updateDimensions()
{
if (!mImage)
return;
if(mImage->getFullWidth() == 0 || mImage->getFullHeight() == 0)
{
return;
}
mUpdateDimensions = FALSE;
// set text on dimensions display (should be moved out of here and into a callback of some sort)
childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth()));
childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight()));
LLRect dim_rect;
childGetRect("dimensions", dim_rect);
@ -380,34 +421,68 @@ void LLPreviewTexture::updateDimensions()
// add space for dimensions and aspect ratio
S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD;
LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
S32 screen_width = gFloaterView->getSnapRect().getWidth();
S32 screen_height = gFloaterView->getSnapRect().getHeight();
S32 client_width = client_rect.getWidth();
S32 client_height = client_rect.getHeight();
S32 max_image_width = screen_width - 2*horiz_pad;
S32 max_image_height = screen_height - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD)
- (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height);
S32 client_width = llmin(max_image_width,mImage->getFullWidth());
S32 client_height = llmin(max_image_height,mImage->getFullHeight());
if (mAspectRatio > 0.f)
{
if(mAspectRatio > 1.f)
{
client_height = llceil((F32)client_width / mAspectRatio);
if(client_height > client_rect.getHeight())
if(client_height > max_image_height)
{
client_height = client_rect.getHeight();
client_height = max_image_height;
client_width = llceil((F32)client_height * mAspectRatio);
}
}
else
else//mAspectRatio < 1.f
{
client_width = llceil((F32)client_height * mAspectRatio);
if(client_width > client_rect.getWidth())
if(client_width > max_image_width)
{
client_width = client_rect.getWidth();
client_width = max_image_width;
client_height = llceil((F32)client_width / mAspectRatio);
}
}
}
else
{
if(client_height > max_image_height)
{
F32 ratio = (F32)max_image_height/client_height;
client_height = max_image_height;
client_width = llceil((F32)client_height * ratio);
}
if(client_width > max_image_width)
{
F32 ratio = (F32)max_image_width/client_width;
client_width = max_image_width;
client_height = llceil((F32)client_width * ratio);
}
}
//now back to whole floater
S32 floater_width = llmax(getMinWidth(),client_width + 2*horiz_pad);
S32 floater_height = llmax(getMinHeight(),client_height + (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD)
+ (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height));
//reshape floater
reshape( floater_width, floater_height );
gFloaterView->adjustToFitScreen(this, FALSE);
//setup image rect...
LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height);
@ -469,6 +544,7 @@ void LLPreviewTexture::loadAsset()
mImage->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
mImage->forceToSaveRawImage(0) ;
mAssetStatus = PREVIEW_ASSET_LOADING;
mUpdateDimensions = TRUE;
updateDimensions();
childSetEnabled("save_tex_btn", canSaveAs());
}

View File

@ -346,4 +346,7 @@ void LLToastNotifyPanel::onClickButton(void* data)
response[button_name] = true;
}
self->mNotification->respond(response);
// disable all buttons
self->mControlPanel->setEnabled(FALSE);
}

View File

@ -55,6 +55,7 @@ class LLToastNotifyPanel: public LLToastPanel
public:
LLToastNotifyPanel(LLNotificationPtr&);
virtual ~LLToastNotifyPanel();
LLPanel * getControlPanel() { return mControlPanel; }
protected:
LLButton* createButton(const LLSD& form_element, BOOL is_option);

View File

@ -12,7 +12,7 @@
can_minimize="true"
visible="true"
width="520"
can_resize="true"
can_resize="false"
min_width="350"
min_height="369">
</floater>

View File

@ -75,6 +75,7 @@
height="16"
image_pressed="Info_Press"
image_unselected="Info_Over"
layout="topleft"
left_pad="3"
right="-53"
name="info_btn"

View File

@ -366,10 +366,7 @@
min_val="64"
name="DrawDistance"
top="3"
width="255">
<slider.commit_callback
function="Pref.UpdateMeterText" />
</slider>
width="255" />
<text
type="string"
length="1"

View File

@ -2127,6 +2127,7 @@ Clears (deletes) the media and all params from the given face.
<!-- panel picks -->
<string name="NoPicksClassifiedsText">You haven't created any Picks or Classifieds. Click the Plus button below to create a Pick or Classified.</string>
<string name="NoAvatarPicksClassifiedsText">User has no picks or classfields</string>
<string name="PicksClassifiedsLoadingText">Loading...</string>
<!-- Multi Preview Floater -->