summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-09-09 04:27:06 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-09-09 04:27:06 +0000
commit4601aef70abe611a2a25b3e236cc089ff2bcb6af (patch)
treead639e7d5c1724c64cc0d894ebceb017f57dd92b /indra/newview
parent579d8447d3269fc6ed747774f1b612a88d850781 (diff)
merge -r 1586-1593 https://svn.aws.productengine.com/secondlife/pe/stable-2 -> viewer-2.0.0-3
Fixes: EXT-839 EXT-859 EXT-868 EXT-795 EXT-861 EXT-678 EXT-848 EXT-873
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llbottomtray.cpp34
-rw-r--r--indra/newview/llchiclet.cpp35
-rw-r--r--indra/newview/llchiclet.h20
-rw-r--r--indra/newview/llgrouplist.cpp8
-rw-r--r--indra/newview/lllocationinputctrl.cpp2
-rw-r--r--indra/newview/llnavigationbar.cpp2
-rw-r--r--indra/newview/llsearchcombobox.cpp15
-rw-r--r--indra/newview/llsyswellwindow.cpp23
-rw-r--r--indra/newview/llsyswellwindow.h1
-rw-r--r--indra/newview/llviewerwindow.cpp5
-rw-r--r--indra/newview/skins/default/xui/en/panel_activeim_row.xml11
-rw-r--r--indra/newview/skins/default/xui/en/panel_bottomtray.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/location_input.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/search_combo_box.xml1
14 files changed, 124 insertions, 37 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index b47787bd5f..d166715038 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -37,12 +37,12 @@
#include "llchiclet.h"
#include "llfloaterreg.h"
#include "llflyoutbutton.h"
+#include "llimpanel.h" // for LLIMFloater
#include "lllayoutstack.h"
#include "llnearbychatbar.h"
#include "llsplitbutton.h"
#include "llsyswellwindow.h"
#include "llfloatercamera.h"
-#include "llimpanel.h"
LLBottomTray::LLBottomTray(const LLSD&)
: mChicletPanel(NULL),
@@ -119,6 +119,7 @@ void LLBottomTray::onChicletClick(LLUICtrl* ctrl)
}
}
+// *TODO Vadim: why void* ?
void* LLBottomTray::createNearbyChatBar(void* userdata)
{
return new LLNearbyChatBar();
@@ -126,30 +127,19 @@ void* LLBottomTray::createNearbyChatBar(void* userdata)
LLIMChiclet* LLBottomTray::createIMChiclet(const LLUUID& session_id)
{
- if(session_id.isNull())
- {
- return NULL;
- }
-
- LLFloaterIMPanel* im = LLIMMgr::getInstance()->findFloaterBySession(session_id);
- if (!im)
- {
- return NULL; //should never happen
- }
+ LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(session_id);
- switch(im->getDialogType())
+ switch (im_chiclet_type)
{
- case IM_NOTHING_SPECIAL:
+ case LLIMChiclet::TYPE_IM:
return getChicletPanel()->createChiclet<LLIMP2PChiclet>(session_id);
- break;
- case IM_SESSION_GROUP_START:
- case IM_SESSION_INVITE:
+ case LLIMChiclet::TYPE_GROUP:
return getChicletPanel()->createChiclet<LLIMGroupChiclet>(session_id);
- break;
- default:
- return NULL;
+ case LLIMChiclet::TYPE_UNKNOWN:
break;
}
+
+ return NULL;
}
//virtual
@@ -273,4 +263,10 @@ void LLBottomTray::showCameraAndMoveControls(BOOL visible)
{
mCamPanel->setVisible(visible);
mMovementPanel->setVisible(visible);
+
+ if (!visible)
+ {
+ LLFloaterReg::hideFloaterInstance("moveview");
+ LLFloaterReg::hideFloaterInstance("camera");
+ }
}
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index e54b068d47..9ce194c712 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -214,6 +214,37 @@ void LLIMChiclet::draw()
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.0f,0.0f,0.0f,1.f), FALSE);
}
+// static
+LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id)
+{
+ EType type = TYPE_UNKNOWN;
+ LLFloaterIMPanel* im = NULL;
+
+ if(session_id.isNull())
+ return type;
+
+ if (!(im = LLIMMgr::getInstance()->findFloaterBySession(session_id)))
+ {
+ llassert_always(0 && "IM session not found"); // should never happen
+ return type;
+ }
+
+ switch(im->getDialogType())
+ {
+ case IM_NOTHING_SPECIAL:
+ type = TYPE_IM;
+ break;
+ case IM_SESSION_GROUP_START:
+ case IM_SESSION_INVITE:
+ type = TYPE_GROUP;
+ break;
+ default:
+ break;
+ }
+
+ return type;
+}
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -224,6 +255,7 @@ LLIMP2PChiclet::Params::Params()
, speaker("speaker")
, show_speaker("show_speaker")
{
+ // *TODO Vadim: Get rid of hardcoded values.
rect(LLRect(0, 25, 45, 0));
avatar_icon.name("avatar_icon");
@@ -1028,11 +1060,14 @@ BOOL LLChicletPanel::handleScrollWheel(S32 x, S32 y, S32 clicks)
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
+// *TODO Vadim: Move this out of llchiclet.cpp.
+
LLTalkButton::Params::Params()
: speak_button("speak_button")
, show_button("show_button")
, monitor("monitor")
{
+ // *TODO Vadim: move hardcoded labels (!) and other params to XUI.
speak_button.name("left");
speak_button.label("Speak");
speak_button.label_selected("Speak");
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index f96dfb69ec..91f55915ed 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -272,6 +272,11 @@ private:
class LLIMChiclet : public LLChiclet
{
public:
+ enum EType {
+ TYPE_UNKNOWN,
+ TYPE_IM,
+ TYPE_GROUP
+ };
/*virtual*/ ~LLIMChiclet() {};
@@ -307,6 +312,19 @@ public:
/*virtual*/ void draw();
/**
+ * Determine whether given ID refers to a group or an IM chat session.
+ *
+ * This is used when we need to chose what IM chiclet (P2P/group)
+ * class to instantiate.
+ *
+ * @param session_id session ID.
+ * @return TYPE_GROUP in case of group chat session,
+ * TYPE_IM in case of P2P session,
+ * TYPE_UNKNOWN otherwise.
+ */
+ static EType getIMSessionType(const LLUUID& session_id);
+
+ /**
* The action taken on mouse down event.
*
* Made public so that it can be triggered from outside
@@ -368,7 +386,7 @@ public:
Params();
};
- void setOtherParticipantId(const LLUUID& other_participant_id);
+ /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id);
/*virtual*/ void setShowSpeaker(bool show);
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 73d3a60701..cddc67cb0a 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -77,14 +77,20 @@ BOOL LLGroupList::update(const std::string& name_filter)
const LLGroupData& group_data = gAgent.mGroups.get(i);
if (name_filter != LLStringUtil::null && !findInsensitive(group_data.mName, name_filter))
continue;
- addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM);
+ addItem(id, group_data.mName, highlight_id == id, ADD_BOTTOM); // ADD_SORTED can only sort by first column anyway
}
+ // Force sorting the list.
+ updateSort();
+
// add "none" to list at top
{
std::string loc_none = LLTrans::getString("GroupsNone");
if (name_filter == LLStringUtil::null || findInsensitive(loc_none, name_filter))
addItem(LLUUID::null, loc_none, highlight_id.isNull(), ADD_TOP);
+
+ // Prevent the "none" item from being sorted.
+ setNeedsSort(false);
}
group_list->selectByValue(highlight_id);
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index d8c89690e8..1d9220cf3d 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -324,7 +324,7 @@ BOOL LLLocationInputCtrl::handleKeyHere(KEY key, MASK mask)
{
BOOL result = LLComboBox::handleKeyHere(key, mask);
- if (key == KEY_DOWN && hasFocus() && mList->getItemCount() != 0)
+ if (key == KEY_DOWN && hasFocus() && mList->getItemCount() != 0 && !mList->getVisible())
{
showList();
}
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index c283b3a05f..0da572dd24 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -300,8 +300,8 @@ void LLNavigationBar::onSearchCommit()
if(!search_query.empty())
{
LLSearchHistory::getInstance()->addEntry(search_query);
- invokeSearch(mSearchComboBox->getValue().asString());
}
+ invokeSearch(search_query);
}
void LLNavigationBar::onTeleportHistoryMenuItemClicked(const LLSD& userdata)
diff --git a/indra/newview/llsearchcombobox.cpp b/indra/newview/llsearchcombobox.cpp
index c903f40f3f..29d31e8b56 100644
--- a/indra/newview/llsearchcombobox.cpp
+++ b/indra/newview/llsearchcombobox.cpp
@@ -152,19 +152,16 @@ void LLSearchComboBox::onSelectionCommit()
{
std::string search_query = getSimple();
LLStringUtil::trim(search_query);
- if(search_query.empty())
- {
- mTextEntry->setText(search_query);
- setControlValue(search_query);
-
- return;
- }
- remove(search_query);
- add(search_query, ADD_TOP);
mTextEntry->setText(search_query);
setControlValue(search_query);
+ if(!search_query.empty())
+ {
+ remove(search_query);
+ add(search_query, ADD_TOP);
+ }
+
LLUICtrl::onCommit();
}
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 2ff0c6833c..98428bf0f7 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -181,7 +181,7 @@ void LLSysWellWindow::setVisible(BOOL visible)
if(mChannel)
mChannel->setShowToasts(!visible);
- LLFloater::setVisible(visible);
+ LLDockableFloater::setVisible(visible);
}
//---------------------------------------------------------------------------------
@@ -331,11 +331,28 @@ void LLSysWellWindow::sessionRemoved(const LLUUID& sessionId)
//---------------------------------------------------------------------------------
LLSysWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& sessionId,
S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) :
- LLScrollingPanel(LLPanel::Params()), mParent(parent)
+ LLScrollingPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent)
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_activeim_row.xml", NULL);
- mChiclet = getChild<LLIMChiclet>("chiclet");
+ // Choose which of the pre-created chiclets (IM/group) to use.
+ // The other one gets hidden.
+
+ LLIMChiclet::EType im_chiclet_type = LLIMChiclet::getIMSessionType(sessionId);
+ switch (im_chiclet_type)
+ {
+ case LLIMChiclet::TYPE_GROUP:
+ mChiclet = getChild<LLIMChiclet>("group_chiclet");
+ childSetVisible("p2p_chiclet", false);
+ break;
+ case LLIMChiclet::TYPE_UNKNOWN: // assign mChiclet a non-null value anyway
+ case LLIMChiclet::TYPE_IM:
+ mChiclet = getChild<LLIMChiclet>("p2p_chiclet");
+ childSetVisible("group_chiclet", false);
+ break;
+ }
+
+ // Initialize chiclet.
mChiclet->setCounter(chicletCounter);
mChiclet->setSessionId(sessionId);
mChiclet->setIMSessionName(name);
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index ef0974b428..d76147b489 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -69,6 +69,7 @@ public:
virtual void setVisible(BOOL visible);
void adjustWindowPosition();
void toggleWindow();
+ /*virtua*/BOOL canClose() { return FALSE; }
// Handlers
void onItemClick(LLSysWellItem* item);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index a088006c53..e5d0e3ebb2 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2073,6 +2073,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
return TRUE;
}
+ //some of context menus use this container, let context menu handle navigation keys
+ if(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE))
+ {
+ return TRUE;
+ }
// Traverses up the hierarchy
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
diff --git a/indra/newview/skins/default/xui/en/panel_activeim_row.xml b/indra/newview/skins/default/xui/en/panel_activeim_row.xml
index f5af8e7b30..4dc4a9ff46 100644
--- a/indra/newview/skins/default/xui/en/panel_activeim_row.xml
+++ b/indra/newview/skins/default/xui/en/panel_activeim_row.xml
@@ -11,7 +11,7 @@
bevel_style="in"
bg_alpha_color="0 0 0 0">
<chiclet_im_p2p
- name="chiclet"
+ name="p2p_chiclet"
layout="topleft"
follows="left"
top="5"
@@ -19,6 +19,15 @@
height="25"
width="45">
</chiclet_im_p2p>
+ <chiclet_im_group
+ name="group_chiclet"
+ layout="topleft"
+ follows="left"
+ top="5"
+ left="5"
+ height="25"
+ width="45">
+ </chiclet_im_group>
<text
type="string"
name="contact_name"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 79ca839f28..df91920721 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -33,12 +33,13 @@
top="0"
width="5"/>
<layout_panel
+ auto_resize="false"
follows="left|right"
height="28"
layout="topleft"
left="5"
min_height="28"
- width="500"
+ width="600"
top="0"
min_width="305"
name="chat_bar"
diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml
index 297a3762f6..a37ed76c51 100644
--- a/indra/newview/skins/default/xui/en/widgets/location_input.xml
+++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml
@@ -17,6 +17,7 @@
show_text_as_tentative="false"
max_chars="20"
follows="left|top"
+ allow_new_values="true"
>
<info_button name="Place Information"
label=""
diff --git a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml
index a03d90876a..6e73e997e0 100644
--- a/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml
+++ b/indra/newview/skins/default/xui/en/widgets/search_combo_box.xml
@@ -5,6 +5,7 @@
show_text_as_tentative="false"
dropdown_button_visible="false"
max_chars="256"
+ allow_new_values="true"
background_image="TextField_Search_Off"
background_image_disabled="TextField_Search_Disabled"
background_image_focused="TextField_Search_Active">