viewer2 merge.

meow-7.2.2
Tofu Linden 2010-02-16 16:50:21 +00:00
commit e2d56363f1
17 changed files with 201 additions and 69 deletions

View File

@ -287,7 +287,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa
std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
{
// return the part of the Url after slurl.com/secondlife/
const std::string search_string = "secondlife";
const std::string search_string = "/secondlife";
size_t pos = url.find(search_string);
if (pos == std::string::npos)
{

View File

@ -60,6 +60,27 @@ namespace
const std::string& PANEL_MOVEMENT_NAME = "movement_panel";
const std::string& PANEL_CAMERA_NAME = "cam_panel";
const std::string& PANEL_GESTURE_NAME = "gesture_panel";
S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel)
{
S32 minimal_width = 0;
llassert(stack);
if ( stack && panel && panel->getVisible() )
{
stack->getPanelMinSize(panel->getName(), &minimal_width, NULL);
}
return minimal_width;
}
S32 get_curr_width(LLUICtrl* ctrl)
{
S32 cur_width = 0;
if ( ctrl && ctrl->getVisible() )
{
cur_width = ctrl->getRect().getWidth();
}
return cur_width;
}
}
class LLBottomTrayLite
@ -1094,58 +1115,131 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis
if (mDummiesMap.count(shown_object_type))
{
mDummiesMap[shown_object_type]->setVisible(visible);
// Hide/show layout panel for dummy icon.
mDummiesMap[shown_object_type]->getParent()->setVisible(visible);
}
}
void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification)
{
bool can_be_set = true;
if (!setVisibleAndFitWidths(shown_object_type, visible) && visible && raise_notification)
{
LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown",
LLSD(),
LLSD(),
LLNotificationFunctorRegistry::instance().DONOTHING);
}
}
bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible)
{
LLPanel* cur_panel = mStateProcessedObjectMap[object_type];
if (NULL == cur_panel)
{
lldebugs << "There is no object to process for state: " << object_type << llendl;
return false;
}
const S32 dummy_width = mDummiesMap.count(object_type)
? mDummiesMap[object_type]->getParent()->getRect().getWidth()
: 0;
bool is_set = true;
if (visible)
{
LLPanel* panel = mStateProcessedObjectMap[shown_object_type];
if (NULL == panel)
// Assume that only chiclet panel can be auto-resized and
// don't take into account width of dummy widgets
const S32 available_width =
mChicletPanel->getParent()->getRect().getWidth() -
mChicletPanel->getMinWidth() -
dummy_width;
S32 preferred_width = mObjectDefaultWidthMap[object_type];
S32 current_width = cur_panel->getRect().getWidth();
S32 result_width = 0;
bool decrease_width = false;
// Mark this button to be shown
mResizeState |= object_type;
if (preferred_width > 0 && available_width >= preferred_width)
{
lldebugs << "There is no object to process for state: " << shown_object_type << llendl;
return;
result_width = preferred_width;
}
else if (available_width >= current_width)
{
result_width = current_width;
}
else
{
// Calculate the possible shrunk width as difference between current and minimal widths
const S32 chatbar_shrunk_width =
mNearbyChatBar->getRect().getWidth() - mNearbyChatBar->getMinWidth();
const S32 sum_of_min_widths =
get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_CAMERA]) +
get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) +
get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_GESTURES]) +
get_panel_min_width(mToolbarStack, mSpeakPanel);
const S32 sum_of_curr_widths =
get_curr_width(mStateProcessedObjectMap[RS_BUTTON_CAMERA]) +
get_curr_width(mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) +
get_curr_width(mStateProcessedObjectMap[RS_BUTTON_GESTURES]) +
get_curr_width(mSpeakPanel);
const S32 possible_shrunk_width =
chatbar_shrunk_width + (sum_of_curr_widths - sum_of_min_widths);
// Minimal width of current panel
S32 minimal_width = 0;
mToolbarStack->getPanelMinSize(cur_panel->getName(), &minimal_width, NULL);
if ( (available_width + possible_shrunk_width) >= minimal_width)
{
// There is enough space for minimal width, but set the result_width
// to current_width so buttons widths decreasing will be done in predefined order
result_width = current_width;
decrease_width = true;
}
else
{
// Nothing can be done, give up...
return false;
}
}
const S32 dummy_width = mDummiesMap.count(shown_object_type) ? mDummiesMap[shown_object_type]->getRect().getWidth() : 0;
const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth();
const S32 chatbar_panel_min_width = mNearbyChatBar->getMinWidth();
const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth();
const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth();
const S32 available_width = (chatbar_panel_width - chatbar_panel_min_width)
+ (chiclet_panel_width - chiclet_panel_min_width);
const S32 required_width = panel->getRect().getWidth() + dummy_width;
can_be_set = available_width >= required_width;
}
if (can_be_set)
{
setTrayButtonVisible(shown_object_type, visible);
// if we hide the button mark it NOT to show while future bottom tray extending
if (!visible)
if (result_width != current_width)
{
mResizeState &= ~shown_object_type;
cur_panel->reshape(result_width, cur_panel->getRect().getHeight());
current_width = result_width;
}
is_set = processShowButton(object_type, &current_width);
// Shrink buttons if needed
if (is_set && decrease_width)
{
processWidthDecreased( -result_width - dummy_width );
}
}
else
{
// mark this button to show it while future bottom tray extending
mResizeState |= shown_object_type;
if ( raise_notification )
LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown",
LLSD(),
LLSD(),
LLNotificationFunctorRegistry::instance().DONOTHING);
const S32 delta_width = get_curr_width(cur_panel);
setTrayButtonVisible(object_type, false);
// Mark button NOT to show while future bottom tray extending
mResizeState &= ~object_type;
// Extend other buttons if need
if (delta_width)
{
processWidthIncreased(delta_width + dummy_width);
}
}
return is_set;
}
//EOF

View File

@ -173,6 +173,14 @@ private:
*/
void setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification = true);
/**
* Sets passed visibility to required button and fit widths of shown
* buttons(notice that method can shrink widths to
* allocate needed room in bottom tray).
* Returns true if visibility of required button was set.
*/
bool setVisibleAndFitWidths(EResizeState object_type, bool visible);
MASK mResizeState;
typedef std::map<EResizeState, LLPanel*> state_object_map_t;

View File

@ -666,7 +666,8 @@ void LLFloaterPreference::refreshEnabledGraphics()
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if(instance)
{
instance->refreshEnabledState();
instance->refresh();
//instance->refreshEnabledState();
}
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
if (hardware_settings)

View File

@ -1523,7 +1523,9 @@ void LLFloaterTools::updateMediaSettings()
mMediaSettings[ base_key + std::string( LLPanelContents::TENTATIVE_SUFFIX ) ] = ! identical;
// Auto play
value_bool = default_media_data.getAutoPlay();
//value_bool = default_media_data.getAutoPlay();
// set default to auto play TRUE -- angela EXT-5172
value_bool = true;
struct functor_getter_auto_play : public LLSelectedTEGetFunctor< bool >
{
functor_getter_auto_play(const LLMediaEntry& entry) : mMediaEntry(entry) {}
@ -1534,7 +1536,8 @@ void LLFloaterTools::updateMediaSettings()
if ( object->getTE(face) )
if ( object->getTE(face)->getMediaData() )
return object->getTE(face)->getMediaData()->getAutoPlay();
return mMediaEntry.getAutoPlay();
//return mMediaEntry.getAutoPlay(); set default to auto play TRUE -- angela EXT-5172
return true;
};
const LLMediaEntry &mMediaEntry;

View File

@ -222,7 +222,7 @@ LLFolderView::LLFolderView(const Params& p)
// Escape is handled by reverting the rename, not commiting it (default behavior)
LLLineEditor::Params params;
params.name("ren");
params.rect(getRect());
params.rect(rect);
params.font(getLabelFontForStyle(LLFontGL::NORMAL));
params.max_length_bytes(DB_INV_ITEM_NAME_STR_LEN);
params.commit_callback.function(boost::bind(&LLFolderView::commitRename, this, _2));
@ -234,13 +234,19 @@ LLFolderView::LLFolderView(const Params& p)
// Textbox
LLTextBox::Params text_p;
LLRect new_r(5, 40, 300, 40-13);
text_p.name(std::string(p.name));
LLFontGL* font = getLabelFontForStyle(mLabelStyle);
LLRect new_r = LLRect(rect.mLeft + ICON_PAD,
rect.mTop - TEXT_PAD,
rect.mRight,
rect.mTop - TEXT_PAD - llfloor(font->getLineHeight()));
text_p.rect(new_r);
text_p.font(getLabelFontForStyle(mLabelStyle));
text_p.name(std::string(p.name));
text_p.font(font);
text_p.visible(false);
text_p.allow_html(true);
mStatusTextBox = LLUICtrlFactory::create<LLTextBox> (text_p);
mStatusTextBox->setFollowsLeft();
mStatusTextBox->setFollowsTop();
//addChild(mStatusTextBox);

View File

@ -497,7 +497,11 @@ void LLIMFloater::setVisible(BOOL visible)
{
//only if floater was construced and initialized from xml
updateMessages();
mInputEditor->setFocus(TRUE);
//prevent steal focus when IM opened in multitab mode
if (!isChatMultiTab())
{
mInputEditor->setFocus(TRUE);
}
}
if(!visible)

View File

@ -455,18 +455,20 @@ void LLPanelProfileTab::onMapButtonClick()
void LLPanelProfileTab::updateButtons()
{
bool is_avatar_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
if(LLAvatarActions::isFriend(getAvatarId()))
{
childSetEnabled("teleport", is_avatar_online);
childSetEnabled("teleport", is_buddy_online);
}
else
{
childSetEnabled("teleport", true);
}
bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId());
bool enable_map_btn = (is_buddy_online &&
is_agent_mappable(getAvatarId()))
|| gAgent.isGodlike();
childSetEnabled("show_on_map_btn", enable_map_btn);
}

View File

@ -206,7 +206,7 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
{
LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
self->mAutoLoop->clear();
self->mAutoPlay->setValue(LLSD(TRUE)); // set default value for auto play to true;
self->mAutoPlay->clear();
self->mAutoScale->clear();
self->mAutoZoom ->clear();
self->mCurrentURL->clear();

View File

@ -304,12 +304,12 @@ void LLPreviewTexture::openToSave()
// static
void LLPreviewTexture::onFileLoadedForSave(BOOL success,
LLViewerFetchedTexture *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
BOOL final,
void* userdata)
LLViewerFetchedTexture *src_vi,
LLImageRaw* src,
LLImageRaw* aux_src,
S32 discard_level,
BOOL final,
void* userdata)
{
LLUUID* item_uuid = (LLUUID*) userdata;

View File

@ -66,12 +66,13 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif
std::string font_size = LLFontGL::sizeFromFont(fontp);
style_params.font.name(font_name);
style_params.font.size(font_size);
style_params.font.style = "UNDERLINE";
//Handle IRC styled /me messages.
std::string prefix = p.message.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
{
//style_params.font.style = "UNDERLINE";
mMessage->clear();
style_params.font.style ="ITALIC";
@ -82,7 +83,8 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif
}
else
{
mMessage->setValue(p.message);
style_params.font.style = "NORMAL";
mMessage->setText(p.message, style_params);
}
mAvatarName->setValue(p.from);

View File

@ -2399,16 +2399,25 @@ void LLViewerMediaImpl::calculateInterest()
for(; iter != mObjectList.end() ; ++iter)
{
LLVOVolume *obj = *iter;
if(LLMuteList::getInstance()->isMuted(obj->getID()))
llassert(obj);
if (!obj) continue;
if(LLMuteList::getInstance() &&
LLMuteList::getInstance()->isMuted(obj->getID()))
{
mIsMuted = true;
}
else
{
// We won't have full permissions data for all objects. Attempt to mute objects when we can tell their owners are muted.
LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj);
if(obj_perm)
if (LLSelectMgr::getInstance())
{
if(LLMuteList::getInstance()->isMuted(obj_perm->getOwner()))
mIsMuted = true;
LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj);
if(obj_perm)
{
if(LLMuteList::getInstance() &&
LLMuteList::getInstance()->isMuted(obj_perm->getOwner()))
mIsMuted = true;
}
}
}
}

View File

@ -285,6 +285,9 @@
<color
name="ColorPaletteEntry32"
reference="White" />
<color
name="ComboListBgColor"
reference="DkGray" />
<color
name="ConsoleBackground"
reference="Black" />

View File

@ -118,7 +118,7 @@
<button
follows="right|bottom"
height="22"
label="Cancel"
label="Discard"
layout="topleft"
left_pad="5"
name="Discard"

View File

@ -2297,6 +2297,9 @@ Display settings have been set to recommended levels based on your system config
name="ErrorMessage"
type="alertmodal">
[ERROR_MESSAGE]
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification

View File

@ -1805,12 +1805,9 @@ Clears (deletes) the media and all params from the given face.
<string name="LeaveMouselook">Press ESC to return to World View</string>
<!-- inventory -->
<string name="InventoryNoMatchingItems">[secondlife:///app/search/groups No matching items found in inventory.Try "Search"?]</string>
<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
<string name="InventoryNoTexture">
You do not have a copy of
this texture in your inventory
</string>
<string name="InventoryNoMatchingItems">No matching items found in inventory. Try [secondlife:///app/search/groups "Search"].</string>
<string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string>
<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
<!-- use value="" because they have preceding spaces -->
<string name="no_transfer" value=" (no transfer)" />
<string name="no_modify" value=" (no modify)" />

View File

@ -20,7 +20,7 @@
image_pressed="DropDown_Press"
image_pressed_selected="DropDown_Press"
image_disabled="DropDown_Disabled" />
<combo_box.combo_list bg_writeable_color="MenuDefaultBgColor"
<combo_box.combo_list bg_writeable_color="ComboListBgColor"
background_visible="true"
/>
<!-- Text is "tentative" if you have typed in a string that does not match