Skip to content
Snippets Groups Projects
Commit de23a4d9 authored by Steve Bennetts's avatar Steve Bennetts
Browse files

Merge

parents fb81795a dd9f2ca5
No related branches found
No related tags found
No related merge requests found
Showing
with 119 additions and 74 deletions
......@@ -84,6 +84,7 @@ class LLChat
mAudible(CHAT_AUDIBLE_FULLY),
mMuted(FALSE),
mTime(0.0),
mTimeStr(),
mPosAgent(),
mURL(),
mChatStyle(CHAT_STYLE_NORMAL)
......@@ -97,6 +98,7 @@ class LLChat
EChatAudible mAudible;
BOOL mMuted; // pass muted chat to maintain list of chatters
F64 mTime; // viewer only, seconds from viewer start
std::string mTimeStr;
LLVector3 mPosAgent;
std::string mURL;
EChatStyle mChatStyle;
......
......@@ -206,16 +206,6 @@ void LLDockableFloater::draw()
LLFloater::draw();
}
void LLDockableFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
{
if (isDocked())
{
setDocked(false);
}
LLFloater::reshape(width, height, called_from_parent);
}
void LLDockableFloater::setDockControl(LLDockControl* dockControl)
{
mDockControl.reset(dockControl);
......
......@@ -65,7 +65,6 @@ class LLDockableFloater : public LLFloater
/* virtula */BOOL postBuild();
/* virtual */void setDocked(bool docked, bool pop_on_undock = true);
/* virtual */void draw();
/* virtual */void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/**
* If descendant class overrides setVisible() then it must still invoke its
......
......@@ -135,6 +135,12 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
LLView* resizing_view = getParent();
if( resizing_view )
{
// undock floater when user resize it
if (((LLFloater*)getParent())->isDocked())
{
((LLFloater*)getParent())->setDocked(false, false);
}
// Resize the parent
LLRect orig_rect = resizing_view->getRect();
LLRect scaled_rect = orig_rect;
......
......@@ -37,7 +37,6 @@
#include "llappviewer.h"
#include "llviewercontrol.h"
#include "llimview.h"
#include "llbottomtray.h"
#include "llviewerwindow.h"
#include "llrootview.h"
#include "llsyswellwindow.h"
......
......@@ -50,21 +50,6 @@
static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history");
std::string formatCurrentTime()
{
time_t utc_time;
utc_time = time_corrected();
std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:["
+LLTrans::getString("TimeMin")+"]";
LLSD substitution;
substitution["datetime"] = (S32) utc_time;
LLStringUtil::format (timeStr, substitution);
return timeStr;
}
class LLChatHistoryHeader: public LLPanel
{
public:
......@@ -219,7 +204,7 @@ class LLChatHistoryHeader: public LLPanel
LLTextBox* timeBox = getChild<LLTextBox>("time_box");
timeBox->setValue(formatCurrentTime());
timeBox->setValue(chat.mTimeStr);
LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon");
......@@ -352,7 +337,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style
void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params)
{
LLView* view = NULL;
std::string view_text = "\n[" + formatCurrentTime() + "] ";
std::string view_text = "\n[" + chat.mTimeStr + "] ";
if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM)
view_text += chat.mFromName + ": ";
......
......@@ -81,27 +81,17 @@ LLNotificationChiclet::Params::Params()
button.tab_stop(FALSE);
button.label(LLStringUtil::null);
unread_notifications.name("unread");
unread_notifications.font(LLFontGL::getFontSansSerif());
unread_notifications.text_color=(LLColor4::white);
unread_notifications.font_halign(LLFontGL::HCENTER);
unread_notifications.mouse_opaque(FALSE);
}
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
: LLChiclet(p)
, mButton(NULL)
, mCounterCtrl(NULL)
, mCounter(0)
{
LLButton::Params button_params = p.button;
button_params.rect(p.rect());
mButton = LLUICtrlFactory::create<LLButton>(button_params);
addChild(mButton);
LLChicletNotificationCounterCtrl::Params unread_params = p.unread_notifications;
mCounterCtrl = LLUICtrlFactory::create<LLChicletNotificationCounterCtrl>(unread_params);
addChild(mCounterCtrl);
// connect counter handlers to the signals
connectCounterUpdatersToSignal("notify");
connectCounterUpdatersToSignal("groupnotify");
......@@ -126,13 +116,15 @@ void LLNotificationChiclet::connectCounterUpdatersToSignal(std::string notificat
void LLNotificationChiclet::setCounter(S32 counter)
{
mCounterCtrl->setCounter(counter);
}
std::string s_count;
if(counter != 0)
{
s_count = llformat("%d", counter);
}
void LLNotificationChiclet::setShowCounter(bool show)
{
LLChiclet::setShowCounter(show);
mCounterCtrl->setVisible(getShowCounter());
mButton->setLabel(s_count);
mCounter = counter;
}
boost::signals2::connection LLNotificationChiclet::setClickCallback(
......
......@@ -638,13 +638,14 @@ class LLNotificationChiclet : public LLChiclet
/*virtual*/ void setCounter(S32 counter);
/*virtual*/S32 getCounter() { return mCounterCtrl->getCounter(); }
/*virtual*/ void setShowCounter(bool show);
// *TODO: mantipov: seems getCounter is not necessary for LLNotificationChiclet
// but inherited interface requires it to implement.
// Probably it can be safe removed.
/*virtual*/S32 getCounter() { return mCounter; }
boost::signals2::connection setClickCallback(const commit_callback_t& cb);
/*virtual*/ ~ LLNotificationChiclet();
/*virtual*/ ~LLNotificationChiclet();
// methods for updating a number of unread System notifications
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
......@@ -662,7 +663,7 @@ class LLNotificationChiclet : public LLChiclet
protected:
LLButton* mButton;
LLChicletNotificationCounterCtrl* mCounterCtrl;
S32 mCounter;
};
/*
......
......@@ -474,6 +474,7 @@ void LLIMFloater::updateMessages()
chat.mFromID = from_id;
chat.mFromName = from;
chat.mText = message;
chat.mTimeStr = time;
//Handle IRC styled /me messages.
std::string prefix = message.substr(0, 4);
......
......@@ -49,6 +49,7 @@
#include "llbottomtray.h"
#include "llcallingcard.h"
#include "llchat.h"
#include "llchiclet.h"
#include "llresmgr.h"
#include "llfloaterchat.h"
#include "llfloaterchatterbox.h"
......@@ -1194,7 +1195,7 @@ BOOL LLIncomingCallDialog::postBuild()
// check to see if this is an Avaline call
LLUUID session_id = mPayload["session_id"].asUUID();
bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
childSetVisible("Start IM", is_avatar); // no IM for avaline
LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name");
......
......@@ -83,11 +83,6 @@ LLFloaterMove::LLFloaterMove(const LLSD& key)
{
}
LLFloaterMove::~LLFloaterMove()
{
LLPanelStandStopFlying::getInstance()->reparent(NULL);
}
// virtual
BOOL LLFloaterMove::postBuild()
{
......@@ -161,6 +156,31 @@ void LLFloaterMove::setEnabled(BOOL enabled)
showModeButtons(enabled);
}
// *NOTE: we assume that setVisible() is called on floater close.
// virtual
void LLFloaterMove::setVisible(BOOL visible)
{
// Ignore excessive calls of this method (from LLTransientFloaterMgr?).
if (getVisible() == visible)
return;
if (visible)
{
// Attach the Stand/Stop Flying panel.
LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance();
ssf_panel->reparent(this);
const LLRect& mode_actions_rect = mModeActionsPanel->getRect();
ssf_panel->setOrigin(mode_actions_rect.mLeft, mode_actions_rect.mBottom);
}
else
{
// Detach the Stand/Stop Flying panel.
LLPanelStandStopFlying::getInstance()->reparent(NULL);
}
LLTransientDockableFloater::setVisible(visible);
}
// static
F32 LLFloaterMove::getYawRate( F32 time )
{
......@@ -429,16 +449,6 @@ void LLFloaterMove::showModeButtons(BOOL bShow)
if (NULL == mModeActionsPanel || mModeActionsPanel->getVisible() == bShow)
return;
mModeActionsPanel->setVisible(bShow);
if (bShow)
LLPanelStandStopFlying::getInstance()->reparent(NULL);
else
{
LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance();
ssf_panel->reparent(this);
const LLRect& mode_actions_rect = mModeActionsPanel->getRect();
ssf_panel->setOrigin(mode_actions_rect.mLeft, mode_actions_rect.mBottom);
}
}
//static
......
......@@ -51,11 +51,12 @@ class LLFloaterMove
private:
LLFloaterMove(const LLSD& key);
~LLFloaterMove();
~LLFloaterMove() {}
public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void setEnabled(BOOL enabled);
/*virtual*/ void setVisible(BOOL visible);
static F32 getYawRate(F32 time);
static void setFlyingMode(BOOL fly);
void setFlyingModeImpl(BOOL fly);
......
......@@ -186,7 +186,6 @@ LLNavigationBar::LLNavigationBar()
LLNavigationBar::~LLNavigationBar()
{
mTeleportFinishConnection.disconnect();
LLSearchHistory::getInstance()->save();
}
BOOL LLNavigationBar::postBuild()
......
......@@ -44,6 +44,7 @@
#include "llimview.h"
#include "llvoicechannel.h"
#include "llsidetray.h"
#include "lltrans.h"
void LLPanelChatControlPanel::onCallButtonClicked()
{
......@@ -161,6 +162,11 @@ void LLPanelIMControlPanel::onShareButtonClicked()
{
LLSD key;
LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
if (gIMMgr->hasSession(getSessionId()))
{
LLIMModel::getInstance()->addMessage(getSessionId(), SYSTEM_FROM, LLUUID::null, LLTrans::getString("share_alert"), false);
}
}
void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
......
......@@ -58,6 +58,7 @@ class LLPanelChatControlPanel : public LLPanel
virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state);
virtual void setSessionId(const LLUUID& session_id);
const LLUUID& getSessionId() { return mSessionId; }
private:
LLUUID mSessionId;
......
......@@ -57,7 +57,11 @@ LLPanelPlaceInfo::LLPanelPlaceInfo()
: LLPanel(),
mParcelID(),
mRequestedID(),
mPosRegion()
mPosRegion(),
mScrollingPanelMinHeight(0),
mScrollingPanelWidth(0),
mScrollingPanel(NULL),
mScrollContainer(NULL)
{}
//virtual
......@@ -83,6 +87,12 @@ BOOL LLPanelPlaceInfo::postBuild()
mMaturityRatingIcon = getChild<LLIconCtrl>("maturity_icon");
mMaturityRatingText = getChild<LLTextBox>("maturity_value");
mScrollingPanel = getChild<LLPanel>("scrolling_panel");
mScrollContainer = getChild<LLScrollContainer>("place_scroll");
mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight();
mScrollingPanelWidth = mScrollingPanel->getRect().getWidth();
return TRUE;
}
......@@ -230,6 +240,27 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data)
}
}
// virtual
void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent)
{
LLPanel::reshape(width, height, called_from_parent);
if (!mScrollContainer || !mScrollingPanel)
return;
static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
S32 scroll_height = mScrollContainer->getRect().getHeight();
if (mScrollingPanelMinHeight >= scroll_height)
{
mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight);
}
else
{
mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height);
}
}
// virtual
void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility)
{
......
......@@ -45,6 +45,7 @@ class LLIconCtrl;
class LLInventoryItem;
class LLPanelPickEdit;
class LLParcel;
class LLScrollContainer;
class LLTextBox;
class LLTextureCtrl;
class LLViewerRegion;
......@@ -92,6 +93,7 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void handleVisibilityChange (BOOL new_visibility);
// Create a pick for the location specified
......@@ -110,8 +112,12 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
LLUUID mRequestedID;
LLVector3 mPosRegion;
std::string mCurrentTitle;
S32 mScrollingPanelMinHeight;
S32 mScrollingPanelWidth;
INFO_TYPE mInfoType;
LLScrollContainer* mScrollContainer;
LLPanel* mScrollingPanel;
LLTextBox* mTitle;
LLTextureCtrl* mSnapshotCtrl;
LLTextBox* mRegionName;
......
......@@ -34,12 +34,15 @@
#define LL_LLSEARCHHISTORY_H
#include "llsingleton.h"
#include "llui.h"
/**
* Search history container able to save and load history from file.
* History is stored in chronological order, most recent at the beginning.
*/
class LLSearchHistory : public LLSingleton<LLSearchHistory>
class LLSearchHistory : public LLSingleton<LLSearchHistory>, private LLDestroyClass<LLSearchHistory>
{
friend class LLDestroyClass<LLSearchHistory>;
public:
// Forward declaration
......@@ -130,6 +133,12 @@ class LLSearchHistory : public LLSingleton<LLSearchHistory>
private:
// Implementation of LLDestroyClass<LLSearchHistory>
static void destroyClass()
{
LLSearchHistory::getInstance()->save();
}
search_history_list_t mSearchHistory;
};
......
......@@ -46,7 +46,8 @@ static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_
LLSidepanelInventory::LLSidepanelInventory()
: LLPanel(),
mItemPanel(NULL)
mItemPanel(NULL),
mPanelMainInventory(NULL)
{
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
......@@ -80,8 +81,8 @@ BOOL LLSidepanelInventory::postBuild()
mOverflowBtn = mInventoryPanel->getChild<LLButton>("overflow_btn");
mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this));
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
panel_main_inventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2));
mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2));
}
// UI elements from item panel
......@@ -127,6 +128,10 @@ void LLSidepanelInventory::onOpen(const LLSD& key)
mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection());
showTaskInfoPanel();
}
if (key.has("select"))
{
mPanelMainInventory->getPanel()->setSelection(key["select"].asUUID(), TAKE_FOCUS_NO);
}
}
void LLSidepanelInventory::onInfoButtonClicked()
......
......@@ -68,6 +68,7 @@ class LLSidepanelInventory : public LLPanel
LLPanel* mInventoryPanel; // Main inventory view
LLSidepanelItemInfo* mItemPanel; // Individual item view
LLSidepanelTaskInfo* mTaskPanel; // Individual in-world object view
LLPanelMainInventory* mPanelMainInventory;
protected:
void onInfoButtonClicked();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment