--HG--
branch : product-engine
meow-7.2.2
Denis Serdjuk 2010-02-02 20:11:57 +02:00
commit 1da3feec8b
21 changed files with 229 additions and 58 deletions

View File

@ -70,7 +70,7 @@ const S32 SCROLL_INCREMENT_DEL = 4; // make space for baskspacing
const F32 AUTO_SCROLL_TIME = 0.05f;
const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. *TODO: make this equal to the double click interval?
const std::string PASSWORD_ASTERISK( "\xE2\x97\x8F" ); // U+25CF BLACK CIRCLE
const std::string PASSWORD_ASTERISK( "\xE2\x80\xA2" ); // U+2022 BULLET
static LLDefaultChildRegistry::Register<LLLineEditor> r1("line_editor");

View File

@ -1023,6 +1023,16 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c)
mReadOnlyFgColor = c;
}
//virtual
void LLTextBase::handleVisibilityChange( BOOL new_visibility )
{
if(!new_visibility && mPopupMenu)
{
mPopupMenu->hide();
}
LLUICtrl::handleVisibilityChange(new_visibility);
}
//virtual
void LLTextBase::setValue(const LLSD& value )
{

View File

@ -122,6 +122,7 @@ public:
/*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; }
/*virtual*/ void setColor( const LLColor4& c );
virtual void setReadOnlyColor(const LLColor4 &c);
virtual void handleVisibilityChange( BOOL new_visibility );
/*virtual*/ void setValue(const LLSD& value );
/*virtual*/ LLTextViewModel* getViewModel() const;

View File

@ -34,6 +34,7 @@
#include "llcontrol.h" // LLCachedControl
#include "llui.h" // LLUI::sSettingsGroups
#include "llviewermenu.h"
LLInspect::LLInspect(const LLSD& key)
: LLFloater(key),
@ -108,3 +109,26 @@ void LLInspect::onMouseLeave(S32 x, S32 y, MASK mask)
{
mOpenTimer.unpause();
}
bool LLInspect::childHasVisiblePopupMenu()
{
// Child text-box may spawn a pop-up menu, if mouse is over the menu, Inspector
// will hide(which is not expected).
// This is an attempt to find out if child control has spawned a menu.
LLView* child_menu = gMenuHolder->getVisibleMenu();
if(child_menu)
{
LLRect floater_rc = calcScreenRect();
LLRect menu_screen_rc = child_menu->calcScreenRect();
S32 mx, my;
LLUI::getMousePositionScreen(&mx, &my);
// This works wrong if we spawn a menu near Inspector and menu overlaps Inspector.
if(floater_rc.overlaps(menu_screen_rc) && menu_screen_rc.pointInRect(mx, my))
{
return true;
}
}
return false;
}

View File

@ -56,6 +56,9 @@ public:
/*virtual*/ void onFocusLost();
protected:
virtual bool childHasVisiblePopupMenu();
LLFrameTimer mCloseTimer;
LLFrameTimer mOpenTimer;
};

View File

@ -393,11 +393,18 @@ void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask)
{
LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu();
LLMenuGL* gear_menu_self = getChild<LLMenuButton>("gear_self_btn")->getMenu();
if ( !(gear_menu && gear_menu->getVisible()) &&
!(gear_menu_self && gear_menu_self->getVisible()))
if ( gear_menu && gear_menu->getVisible() &&
gear_menu_self && gear_menu_self->getVisible() )
{
mOpenTimer.unpause();
return;
}
if(childHasVisiblePopupMenu())
{
return;
}
mOpenTimer.unpause();
}
void LLInspectAvatar::updateModeratorPanel()

View File

@ -575,10 +575,17 @@ void LLInspectObject::updateSecureBrowsing()
void LLInspectObject::onMouseLeave(S32 x, S32 y, MASK mask)
{
LLMenuGL* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu();
if ( !(gear_menu && gear_menu->getVisible()))
if ( gear_menu && gear_menu->getVisible() )
{
mOpenTimer.unpause();
return;
}
if(childHasVisiblePopupMenu())
{
return;
}
mOpenTimer.unpause();
}
void LLInspectObject::onClickBuy()

View File

@ -3773,6 +3773,21 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode
gInventory.updateItem(item);
gInventory.notifyObservers();
}
else if("play" == action)
{
if(!LLGestureManager::instance().isGestureActive(mUUID))
{
// we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboList.
BOOL inform_server = TRUE;
BOOL deactivate_similar = FALSE;
LLGestureManager::instance().setGestureLoadedCallback(mUUID, boost::bind(&LLGestureBridge::playGesture, mUUID));
LLGestureManager::instance().activateGestureWithAsset(mUUID, gInventory.getItem(mUUID)->getAssetUUID(), inform_server, deactivate_similar);
}
else
{
playGesture(mUUID);
}
}
else LLItemBridge::performAction(folder, model, action);
}
@ -3858,6 +3873,20 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
// static
void LLGestureBridge::playGesture(const LLUUID& item_id)
{
if (LLGestureManager::instance().isGesturePlaying(item_id))
{
LLGestureManager::instance().stopGesture(item_id);
}
else
{
LLGestureManager::instance().playGesture(item_id);
}
}
// +=================================================+
// | LLAnimationBridge |
// +=================================================+

View File

@ -491,6 +491,8 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
static void playGesture(const LLUUID& item_id);
protected:
LLGestureBridge(LLInventoryPanel* inventory, const LLUUID& uuid)
: LLItemBridge(inventory, uuid) {}

View File

@ -138,16 +138,20 @@ void LLLogChat::saveHistory(const std::string& filename,
const LLUUID& from_id,
const std::string& line)
{
if(!filename.size())
std::string tmp_filename = filename;
LLStringUtil::trim(tmp_filename);
if (tmp_filename.empty())
{
llinfos << "Filename is Empty!" << llendl;
std::string warn = "Chat history filename [" + filename + "] is empty!";
llwarning(warn, 666);
llassert(tmp_filename.size());
return;
}
llofstream file (LLLogChat::makeLogFileName(filename), std::ios_base::app);
if (!file.is_open())
{
llinfos << "Couldn't open chat history log!" << llendl;
llwarns << "Couldn't open chat history log! - " + filename << llendl;
return;
}

View File

@ -300,8 +300,8 @@ void LLNearbyChat::loadHistory()
LLChat chat;
chat.mFromName = from;
chat.mFromID = from_id;
chat.mText = msg[IM_TEXT];
chat.mTimeStr = msg[IM_TIME];
chat.mText = msg[IM_TEXT].asString();
chat.mTimeStr = msg[IM_TIME].asString();
addMessage(chat);
it++;

View File

@ -168,6 +168,12 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
session_name = "chat";
}
//there still appears a log history file with weird name " .txt"
if (" " == session_name || "{waiting}" == session_name || "{nobody}" == session_name)
{
llwarning("Weird session name (" + session_name + ") for notification " + notification->getName(), 666)
}
if(to_file_only)
{
logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(),

View File

@ -70,6 +70,7 @@
#include "lltoggleablemenu.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
#include "llviewermessage.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
@ -105,22 +106,35 @@ private:
LLPanelPlaces* mPlaces;
};
class LLPlacesInventoryObserver : public LLInventoryObserver
class LLPlacesInventoryObserver : public LLInventoryAddedObserver
{
public:
LLPlacesInventoryObserver(LLPanelPlaces* places_panel) :
LLInventoryObserver(),
mPlaces(places_panel)
mPlaces(places_panel),
mTabsCreated(false)
{}
/*virtual*/ void changed(U32 mask)
{
if (mPlaces)
mPlaces->changedInventory(mask);
LLInventoryAddedObserver::changed(mask);
if (!mTabsCreated && mPlaces)
{
mPlaces->createTabs();
mTabsCreated = true;
}
}
protected:
/*virtual*/ void done()
{
mPlaces->showAddedLandmarkInfo(mAdded);
mAdded.clear();
}
private:
LLPanelPlaces* mPlaces;
bool mTabsCreated;
};
class LLPlacesRemoteParcelInfoObserver : public LLRemoteParcelInfoObserver
@ -943,7 +957,7 @@ void LLPanelPlaces::changedParcelSelection()
updateVerbs();
}
void LLPanelPlaces::changedInventory(U32 mask)
void LLPanelPlaces::createTabs()
{
if (!(gInventory.isInventoryUsable() && LLTeleportHistory::getInstance()))
return;
@ -979,10 +993,6 @@ void LLPanelPlaces::changedInventory(U32 mask)
// Filter applied to show all items.
if (mActivePanel)
mActivePanel->onSearchEdit(mActivePanel->getFilterSubString());
// we don't need to monitor inventory changes anymore,
// so remove the observer
gInventory.removeObserver(mInventoryObserver);
}
void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos)
@ -991,6 +1001,33 @@ void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos)
updateVerbs();
}
void LLPanelPlaces::showAddedLandmarkInfo(const std::vector<LLUUID>& items)
{
for (std::vector<LLUUID>::const_iterator item_iter = items.begin();
item_iter != items.end();
++item_iter)
{
const LLUUID& item_id = (*item_iter);
if(!highlight_offered_item(item_id))
{
continue;
}
LLInventoryItem* item = gInventory.getItem(item_id);
if (LLAssetType::AT_LANDMARK == item->getType())
{
// Created landmark is passed to Places panel to allow its editing.
// If the panel is closed we don't reopen it until created landmark is loaded.
if("create_landmark" == getPlaceInfoType() && !getItem())
{
setItem(item);
}
break;
}
}
}
void LLPanelPlaces::updateVerbs()
{
bool is_place_info_visible;

View File

@ -66,11 +66,15 @@ public:
// Called on parcel selection change to update place information.
void changedParcelSelection();
// Called on agent inventory change to find out when inventory gets usable.
void changedInventory(U32 mask);
// Called once on agent inventory first change to find out when inventory gets usable
// and to create "My Landmarks" and "Teleport History" tabs.
void createTabs();
// Called when we receive the global 3D position of a parcel.
void changedGlobalPos(const LLVector3d &global_pos);
// Opens landmark info panel when agent creates or receives landmark.
void showAddedLandmarkInfo(const std::vector<LLUUID>& items);
void setItem(LLInventoryItem* item);
LLInventoryItem* getItem() { return mItem; }

View File

@ -583,7 +583,8 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co
bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata)
{
std::string item = userdata.asString();
if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item)
if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item
|| "can_pay" == item || "can_add" == item)
{
return mUUIDs.front() != gAgentID;
}

View File

@ -487,10 +487,21 @@ void LLScreenChannel::showToastsBottom()
toast_rect.setOriginAndSize(getRect().mLeft, bottom + toast_margin, toast_rect.getWidth() ,toast_rect.getHeight());
(*it).toast->setRect(toast_rect);
// don't show toasts if there is not enough space
if(floater && floater->overlapsScreenChannel())
{
if(it == mToastList.rbegin())
{
// move first toast above docked floater
S32 shift = floater->getRect().getHeight();
if(floater->getDockControl())
{
shift += floater->getDockControl()->getTongueHeight();
}
(*it).toast->translate(0, shift);
}
LLRect world_rect = gViewerWindow->getWorldViewRectScaled();
// don't show toasts if there is not enough space
if(toast_rect.mTop > world_rect.mTop)
{
break;
@ -802,16 +813,6 @@ void LLScreenChannel::updateShowToastsState()
S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");;
LLRect this_rect = getRect();
// adjust channel's height
if(floater->overlapsScreenChannel())
{
channel_bottom += floater->getRect().getHeight();
if(floater->getDockControl())
{
channel_bottom += floater->getDockControl()->getTongueHeight();
}
}
if(channel_bottom != this_rect.mBottom)
{
setRect(LLRect(this_rect.mLeft, this_rect.mTop, this_rect.mRight, channel_bottom));

View File

@ -164,7 +164,21 @@ void LLSidepanelInventory::onWearButtonClicked()
void LLSidepanelInventory::onPlayButtonClicked()
{
performActionOnSelection("activate");
const LLInventoryItem *item = getSelectedItem();
if (!item)
{
return;
}
switch(item->getInventoryType())
{
case LLInventoryType::IT_GESTURE:
performActionOnSelection("play");
break;
default:
performActionOnSelection("activate");
break;
}
}
void LLSidepanelInventory::onTeleportButtonClicked()

View File

@ -860,28 +860,12 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f
++item_iter)
{
const LLUUID& item_id = (*item_iter);
LLInventoryItem* item = gInventory.getItem(item_id);
if(!item)
if(!highlight_offered_item(item_id))
{
LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL;
continue;
}
////////////////////////////////////////////////////////////////////////////////
// Don't highlight if it's in certain "quiet" folders which don't need UI
// notification (e.g. trash, cof, lost-and-found).
if(!gAgent.getAFK())
{
const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id);
if (parent)
{
const LLFolderType::EType parent_type = parent->getPreferredType();
if (LLViewerFolderType::lookupIsQuietType(parent_type))
{
continue;
}
}
}
LLInventoryItem* item = gInventory.getItem(item_id);
////////////////////////////////////////////////////////////////////////////////
// Special handling for various types.
@ -928,10 +912,11 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f
LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->getPanel("panel_places"));
if (places_panel)
{
// we are creating a landmark
// Landmark creation handling is moved to LLPanelPlaces::showAddedLandmarkInfo()
// TODO* LLPanelPlaces dependency is going to be removed. See EXT-4347.
if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem())
{
places_panel->setItem(item);
//places_panel->setItem(item);
}
// we are opening a group notice attachment
else
@ -981,6 +966,34 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f
}
}
bool highlight_offered_item(const LLUUID& item_id)
{
LLInventoryItem* item = gInventory.getItem(item_id);
if(!item)
{
LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL;
return false;
}
////////////////////////////////////////////////////////////////////////////////
// Don't highlight if it's in certain "quiet" folders which don't need UI
// notification (e.g. trash, cof, lost-and-found).
if(!gAgent.getAFK())
{
const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(item_id);
if (parent)
{
const LLFolderType::EType parent_type = parent->getPreferredType();
if (LLViewerFolderType::lookupIsQuietType(parent_type))
{
return false;
}
}
}
return true;
}
void inventory_offer_mute_callback(const LLUUID& blocked_id,
const std::string& first_name,
const std::string& last_name,

View File

@ -203,6 +203,11 @@ void process_initiate_download(LLMessageSystem* msg, void**);
void start_new_inventory_observer();
void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& from_name);
// Returns true if item is not in certain "quiet" folder which don't need UI
// notification (e.g. trash, cof, lost-and-found) and agent is not AFK, false otherwise.
// Returns false if item is not found.
bool highlight_offered_item(const LLUUID& item_id);
struct LLOfferInfo
{
LLOfferInfo()

View File

@ -36,7 +36,7 @@
top_delta="3"
name="payee_name"
width="184">
Ericacita Moostopolison
[FIRST] [LAST]
</text>
<text
type="string"

View File

@ -78,6 +78,9 @@
name="Pay">
<menu_item_call.on_click
function="Avatar.Pay" />
<menu_item_call.on_enable
function="ParticipantList.EnableItem"
parameter="can_pay" />
</menu_item_call>
<menu_item_separator
layout="topleft" />