summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDenis Serdjuk <dserduk@productengine.com>2010-02-02 20:11:57 +0200
committerDenis Serdjuk <dserduk@productengine.com>2010-02-02 20:11:57 +0200
commit1da3feec8b99d938aa5df6f89e785fb317c88c45 (patch)
tree2e1f4272e5eda4ecc1d808556ed0daabbd97a807 /indra/newview
parent47162acede25dadae52fb43bd36f57fa26988aa5 (diff)
parente367c412988a55515fb68179d21f5d1c19249969 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinspect.cpp24
-rw-r--r--indra/newview/llinspect.h3
-rw-r--r--indra/newview/llinspectavatar.cpp13
-rw-r--r--indra/newview/llinspectobject.cpp11
-rw-r--r--indra/newview/llinventorybridge.cpp29
-rw-r--r--indra/newview/llinventorybridge.h2
-rw-r--r--indra/newview/lllogchat.cpp12
-rw-r--r--indra/newview/llnearbychat.cpp4
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp6
-rw-r--r--indra/newview/llpanelplaces.cpp57
-rw-r--r--indra/newview/llpanelplaces.h8
-rw-r--r--indra/newview/llparticipantlist.cpp3
-rw-r--r--indra/newview/llscreenchannel.cpp23
-rw-r--r--indra/newview/llsidepanelinventory.cpp16
-rw-r--r--indra/newview/llviewermessage.cpp53
-rw-r--r--indra/newview/llviewermessage.h5
-rw-r--r--indra/newview/skins/default/xui/en/floater_pay_object.xml2
-rw-r--r--indra/newview/skins/default/xui/en/menu_participant_list.xml3
18 files changed, 217 insertions, 57 deletions
diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp
index c7b8db9635..c7b651f37c 100644
--- a/indra/newview/llinspect.cpp
+++ b/indra/newview/llinspect.cpp
@@ -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;
+}
diff --git a/indra/newview/llinspect.h b/indra/newview/llinspect.h
index a1cb9cd71c..f8c86618d2 100644
--- a/indra/newview/llinspect.h
+++ b/indra/newview/llinspect.h
@@ -56,6 +56,9 @@ public:
/*virtual*/ void onFocusLost();
protected:
+
+ virtual bool childHasVisiblePopupMenu();
+
LLFrameTimer mCloseTimer;
LLFrameTimer mOpenTimer;
};
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 3a41aebf28..b2cdc0738f 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -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()
diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp
index dd313c528d..1a5795a2ae 100644
--- a/indra/newview/llinspectobject.cpp
+++ b/indra/newview/llinspectobject.cpp
@@ -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()
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index e8a4899a0b..f68550d8fd 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -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 |
// +=================================================+
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index eeb8246b11..6fffec96a0 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -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) {}
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index dc187bf36c..96ce01c05f 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -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;
}
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 49ab61556f..6de47fccd2 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -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++;
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index e2a748a1c5..b8e0892b02 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -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(),
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 29cfbbe606..a49386cb5c 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -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;
diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h
index 110d7a1054..78fcbbb11d 100644
--- a/indra/newview/llpanelplaces.h
+++ b/indra/newview/llpanelplaces.h
@@ -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; }
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index f83f3eba96..ad47e351ee 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -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;
}
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index a00b6a9288..8f36c0e88a 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -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));
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 5383158cd3..7b923f4b0b 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -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()
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index b0952dd698..26c9a1dd79 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -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,
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 1415c16090..7dd629dcfd 100644
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -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()
diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml
index 455018f467..d09a0a0535 100644
--- a/indra/newview/skins/default/xui/en/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml
@@ -36,7 +36,7 @@
top_delta="3"
name="payee_name"
width="184">
- Ericacita Moostopolison
+ [FIRST] [LAST]
</text>
<text
type="string"
diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml
index 805ffbae66..d03a7e3d41 100644
--- a/indra/newview/skins/default/xui/en/menu_participant_list.xml
+++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml
@@ -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" />