summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llviewerwindow.cpp69
1 files changed, 56 insertions, 13 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 28bcdff7bd..90b8e5e0f9 100755..100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -102,6 +102,7 @@
#include "llface.h"
#include "llfeaturemanager.h"
#include "llfilepicker.h"
+#include "llfirstuse.h"
#include "llfloater.h"
#include "llfloaterbuildoptions.h"
#include "llfloaterbuyland.h"
@@ -162,6 +163,7 @@
#include "lltrans.h"
#include "lluictrlfactory.h"
#include "llurldispatcher.h" // SLURL from other app instance
+#include "llversioninfo.h"
#include "llvieweraudio.h"
#include "llviewercamera.h"
#include "llviewergesture.h"
@@ -1579,7 +1581,7 @@ void LLViewerWindow::initBase()
// (But wait to add it as a child of the root view so that it will be in front of the
// other views.)
MainPanel* main_view = new MainPanel();
- LLUICtrlFactory::instance().buildPanel(main_view, "main_view.xml");
+ main_view->buildFromFile("main_view.xml");
main_view->setShape(full_window);
getRootView()->addChild(main_view);
@@ -1587,7 +1589,8 @@ void LLViewerWindow::initBase()
mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle();
mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
- mPopupView = main_view->getChild<LLPopupView>("popup_holder");
+ mPopupView = main_view->findChild<LLPopupView>("popup_holder");
+ mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
@@ -1625,7 +1628,7 @@ void LLViewerWindow::initBase()
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLFloaterPreference::initBusyResponse));
// Add the progress bar view (startup view), which overrides everything
- mProgressView = getRootView()->getChild<LLProgressView>("progress_view");
+ mProgressView = getRootView()->findChild<LLProgressView>("progress_view");
setShowProgress(FALSE);
setProgressCancelButtonVisible(FALSE);
@@ -1997,6 +2000,11 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
LLSD args;
LLColor4 new_bg_color;
+ // no l10n problem because channel is always an english string
+ std::string channel = LLVersionInfo::getChannel();
+ bool isProject = (channel.find("Project") != std::string::npos);
+
+ // god more important than project, proj more important than grid
if(god_mode && LLGridManager::getInstance()->isInProductionGrid())
{
new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" );
@@ -2005,6 +2013,10 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
{
new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" );
}
+ else if (!god_mode && isProject)
+ {
+ new_bg_color = LLUIColorTable::instance().getColor( "MenuBarProjectBgColor" );
+ }
else if(!god_mode && !LLGridManager::getInstance()->isInProductionGrid())
{
new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" );
@@ -2189,10 +2201,20 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
return TRUE;
}
+ LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+
// give menus a chance to handle modified (Ctrl, Alt) shortcut keys before current focus
// as long as focus isn't locked
if (mask & (MASK_CONTROL | MASK_ALT) && !gFocusMgr.focusLocked())
{
+ // Check the current floater's menu first, if it has one.
+ if (gFocusMgr.keyboardFocusHasAccelerators()
+ && keyboard_focus
+ && keyboard_focus->handleKey(key,mask,FALSE))
+ {
+ return TRUE;
+ }
+
if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask))
||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)))
{
@@ -2228,7 +2250,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
}
// Traverses up the hierarchy
- LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
if( keyboard_focus )
{
LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL;
@@ -2446,7 +2467,7 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params)
{
if (viewp)
{
- if (!params.styled_message().empty())
+ if (!params.styled_message.empty())
{
params.styled_message.add().text("\n---------\n");
}
@@ -2481,6 +2502,18 @@ void LLViewerWindow::updateUI()
static std::string last_handle_msg;
+ if (gLoggedInTime.getStarted())
+ {
+ if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("DestinationGuideHintTimeout"))
+ {
+ LLFirstUse::notUsingDestinationGuide();
+ }
+ if (gLoggedInTime.getElapsedTimeF32() > gSavedSettings.getF32("SidePanelHintTimeout"))
+ {
+ LLFirstUse::notUsingSidePanel();
+ }
+ }
+
LLConsole::updateClass();
// animate layout stacks so we have up to date rect for world view
@@ -2543,6 +2576,17 @@ void LLViewerWindow::updateUI()
// only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
+ // include all ancestors of captor_view as automatically having mouse
+ if (captor_view)
+ {
+ LLView* captor_parent_view = captor_view->getParent();
+ while(captor_parent_view)
+ {
+ mouse_hover_set.insert(captor_parent_view->getHandle());
+ captor_parent_view = captor_parent_view->getParent();
+ }
+ }
+
// aggregate visible views that contain mouse cursor in display order
LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups();
@@ -3979,7 +4023,14 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
image_buffer_x = llfloor(snapshot_width*scale_factor) ;
image_buffer_y = llfloor(snapshot_height *scale_factor) ;
}
+ if(image_buffer_x > 0 && image_buffer_y > 0)
+ {
raw->resize(image_buffer_x, image_buffer_y, 3);
+ }
+ else
+ {
+ return FALSE ;
+ }
if(raw->isBufferInvalid())
{
return FALSE ;
@@ -4308,14 +4359,6 @@ BOOL LLViewerWindow::getShowProgress() const
return (mProgressView && mProgressView->getVisible());
}
-void LLViewerWindow::moveProgressViewToFront()
-{
- if( mProgressView && mRootView )
- {
- mRootView->sendChildToFront(mProgressView);
- }
-}
-
void LLViewerWindow::setProgressString(const std::string& string)
{
if (mProgressView)