summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-06-21 17:16:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-06-21 17:16:27 +0000
commitade6bbb06c6a842f39a3fe32decf7c66682df092 (patch)
tree8fa1e4ba680f916bb4c77c70f2464f295a3bd3f3 /indra/newview
parent9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (diff)
merge -r 124105-124625 skinning-13 -> viewer-2.0.0-3
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llappviewer.cpp2
-rw-r--r--indra/newview/llfavoritesbar.cpp2
-rw-r--r--indra/newview/llfloaterauction.cpp9
-rw-r--r--indra/newview/llfloaterauction.h2
-rw-r--r--indra/newview/llfloaterbuildoptions.cpp2
-rw-r--r--indra/newview/llfloaterbuildoptions.h2
-rw-r--r--indra/newview/llfloaterbump.cpp2
-rw-r--r--indra/newview/llfloaterbump.h5
-rw-r--r--indra/newview/llfloatercamera.cpp15
-rw-r--r--indra/newview/llfloatercamera.h2
-rw-r--r--indra/newview/llfloaterlagmeter.cpp90
-rw-r--r--indra/newview/llfloaterlagmeter.h7
-rw-r--r--indra/newview/llfloaterland.cpp7
-rw-r--r--indra/newview/llfloaternotificationsconsole.cpp12
-rw-r--r--indra/newview/llfloaternotificationsconsole.h2
-rw-r--r--indra/newview/llfloaterpreference.cpp587
-rw-r--r--indra/newview/llfloaterpreference.h36
-rw-r--r--indra/newview/llfloaterreporter.cpp2
-rw-r--r--indra/newview/llfloatersettingsdebug.cpp73
-rw-r--r--indra/newview/llfloatersettingsdebug.h6
-rw-r--r--indra/newview/llfloatertools.cpp3
-rw-r--r--indra/newview/llfolderview.cpp49
-rw-r--r--indra/newview/llfolderview.h3
-rw-r--r--indra/newview/lllocationinputctrl.cpp4
-rw-r--r--indra/newview/llnamelistctrl.h4
-rw-r--r--indra/newview/llpanelprofileview.cpp4
-rw-r--r--indra/newview/llpanelprofileview.h2
-rw-r--r--indra/newview/llpanelteleporthistory.cpp11
-rw-r--r--indra/newview/llstatusbar.cpp2
-rw-r--r--indra/newview/llviewerfloaterreg.cpp15
-rw-r--r--indra/newview/llviewermenu.cpp14
-rw-r--r--indra/newview/llviewermessage.cpp4
-rw-r--r--indra/newview/llviewerwindow.cpp91
-rw-r--r--indra/newview/skins/default/xui/en/floater_auction.xml11
-rw-r--r--indra/newview/skins/default/xui/en/floater_avatar_picker.xml10
-rw-r--r--indra/newview/skins/default/xui/en/floater_lagmeter.xml11
-rw-r--r--indra/newview/skins/default/xui/en/floater_notifications_console.xml5
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_settings_debug.xml43
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml8
41 files changed, 909 insertions, 253 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0cbacd5b2e..f96c8fdca0 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -278,7 +278,6 @@ set(viewer_SOURCE_FILES
llpaneldirland.cpp
llpaneldirpeople.cpp
llpaneldirplaces.cpp
- llpaneldisplay.cpp
llpanelevent.cpp
llpanelface.cpp
llpanelgroup.cpp
@@ -694,7 +693,6 @@ set(viewer_HEADER_FILES
llpaneldirland.h
llpaneldirpeople.h
llpaneldirplaces.h
- llpaneldisplay.h
llpanelevent.h
llpanelface.h
llpanelgroup.h
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ce66bb6180..d0d6a118b3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1715,7 +1715,7 @@ void LLAppViewer::loadColorSettings()
if(control->isType(TYPE_COL4))
{
LLUIColorTable::ColorParams color;
- color.value = control->getValue();
+ color.value = (LLColor4)control->getValue();
LLUIColorTable::ColorEntryParams color_entry;
color_entry.name = name;
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 7719af2bd7..0e5b943dd3 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -367,7 +367,7 @@ BOOL LLFavoritesBarCtrl::postBuild()
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_favorites.xml", gMenuHolder);
if (!menu)
{
- menu = LLUICtrlFactory::createDummyWidget<LLMenuGL>("inventory_menu");
+ menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
}
menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor"));
mInventoryItemsPopupMenuHandle = menu->getHandle();
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index e1974bba84..8ad5a19d02 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -75,7 +75,9 @@ LLFloaterAuction::LLFloaterAuction(const LLSD& key)
: LLFloater(),
mParcelID(-1)
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml");
+// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml");
+ mCommitCallbackRegistrar.add("ClickSnapshot", boost::bind(&LLFloaterAuction::onClickSnapshot, this));
+ mCommitCallbackRegistrar.add("ClickOK", boost::bind(&LLFloaterAuction::onClickOK, this));
}
// Destroys the object
@@ -85,11 +87,6 @@ LLFloaterAuction::~LLFloaterAuction()
BOOL LLFloaterAuction::postBuild()
{
- childSetValue("fence_check", LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) );
- getChild<LLUICtrl>("fence_check")->setCommitCallback(boost::bind(LLSavedSettingsGlue::setBOOL, _1, "AuctionShowFence"));
-
- childSetAction("snapshot_btn", onClickSnapshot, this);
- childSetAction("ok_btn", onClickOK, this);
return TRUE;
}
diff --git a/indra/newview/llfloaterauction.h b/indra/newview/llfloaterauction.h
index d71fd3c653..b018316c64 100644
--- a/indra/newview/llfloaterauction.h
+++ b/indra/newview/llfloaterauction.h
@@ -55,9 +55,9 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void draw();
-private:
LLFloaterAuction(const LLSD& key);
~LLFloaterAuction();
+private:
void initialize();
static void onClickSnapshot(void* data);
diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp
index 2507a72caa..9dbd1db38e 100644
--- a/indra/newview/llfloaterbuildoptions.cpp
+++ b/indra/newview/llfloaterbuildoptions.cpp
@@ -46,7 +46,7 @@
LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
: LLFloater()
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_build_options.xml");
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_build_options.xml");
}
LLFloaterBuildOptions::~LLFloaterBuildOptions()
diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h
index da72520486..61db303ba2 100644
--- a/indra/newview/llfloaterbuildoptions.h
+++ b/indra/newview/llfloaterbuildoptions.h
@@ -45,7 +45,7 @@ class LLFloaterBuildOptions
: public LLFloater, public LLFloaterSingleton<LLFloaterBuildOptions>
{
friend class LLUISingleton<LLFloaterBuildOptions, VisibilityPolicy<LLFloater> >;
-protected:
+public:
LLFloaterBuildOptions(const LLSD& key);
~LLFloaterBuildOptions();
};
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index 5cf4d90ece..e4e1c7efa2 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -50,7 +50,7 @@
LLFloaterBump::LLFloaterBump(const LLSD& key)
: LLFloater()
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml");
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml");
}
diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h
index f55a9e6bc5..b56817436c 100644
--- a/indra/newview/llfloaterbump.h
+++ b/indra/newview/llfloaterbump.h
@@ -44,13 +44,12 @@ class LLFloaterBump
{
friend class LLUISingleton<LLFloaterBump, VisibilityPolicy<LLFloater> >;
protected:
- LLFloaterBump(const LLSD& key);
- virtual ~LLFloaterBump();
-
void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd);
public:
/*virtual*/ void onOpen(const LLSD& key);
+ LLFloaterBump(const LLSD& key);
+ virtual ~LLFloaterBump();
};
#endif
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 6ca8944a19..e79142513b 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -47,20 +47,24 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f;
//
// Member functions
//
-
-
LLFloaterCamera::LLFloaterCamera(const LLSD& val)
: LLFloater()
{
- setIsChrome(TRUE);
-
// For now, only used for size and tooltip strings
const BOOL DONT_OPEN = FALSE;
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", DONT_OPEN);
-
+}
+
+// virtual
+BOOL LLFloaterCamera::postBuild()
+{
+ setIsChrome(TRUE);
+
mRotate = getChild<LLJoystickCameraRotate>("cam_rotate_stick");
mZoom = getChild<LLJoystickCameraZoom>("zoom");
mTrack = getChild<LLJoystickCameraTrack>("cam_track_stick");
+
+ return TRUE;
}
// virtual
@@ -79,3 +83,4 @@ void LLFloaterCamera::onClose(bool app_quitting)
gSavedSettings.setBOOL("ShowCameraControls", FALSE);
}
}
+
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index 871e5c8ed1..f954e329eb 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -51,7 +51,7 @@ private:
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onClose(bool app_quitting);
-
+ /*virtual*/ BOOL postBuild();
public:
LLJoystickCameraRotate* mRotate;
LLJoystickCameraZoom* mZoom;
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index a97b270c44..82deaef4a9 100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -53,21 +53,22 @@ const std::string LAG_GOOD_IMAGE_NAME = "lag_status_good.tga";
LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key)
: LLFloater()
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml");
+// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml");
+ mCommitCallbackRegistrar.add("LagMeter.ClickShrink", boost::bind(&LLFloaterLagMeter::onClickShrink, this));
+}
+BOOL LLFloaterLagMeter::postBuild()
+{
// Don't let this window take keyboard focus -- it's confusing to
// lose arrow-key driving when testing lag.
setIsChrome(TRUE);
-
+
// were we shrunk last time?
if (gSavedSettings.getBOOL("LagMeterShrunk"))
{
- onClickShrink(this);
+ onClickShrink();
}
-}
-
-BOOL LLFloaterLagMeter::postBuild()
-{
+
mClientButton = getChild<LLButton>("client_lagmeter");
mClientText = getChild<LLTextBox>("client_text");
mClientCause = getChild<LLTextBox>("client_lag_cause");
@@ -102,7 +103,7 @@ BOOL LLFloaterLagMeter::postBuild()
config_string = getString("server_single_process_max_time_ms", mStringArgs);
mServerSingleProcessMaxTime = (float)atof( config_string.c_str() );
- mShrunk = false;
+// mShrunk = false;
config_string = getString("max_width_px", mStringArgs);
mMaxWidth = atoi( config_string.c_str() );
config_string = getString("min_width_px", mStringArgs);
@@ -120,18 +121,18 @@ BOOL LLFloaterLagMeter::postBuild()
mStringArgs["[SERVER_FRAME_RATE_CRITICAL]"] = getString("server_frame_rate_critical_fps");
mStringArgs["[SERVER_FRAME_RATE_WARNING]"] = getString("server_frame_rate_warning_fps");
- childSetAction("minimize", onClickShrink, this);
+// childSetAction("minimize", onClickShrink, this);
return TRUE;
}
LLFloaterLagMeter::~LLFloaterLagMeter()
{
// save shrunk status for next time
- gSavedSettings.setBOOL("LagMeterShrunk", mShrunk);
+// gSavedSettings.setBOOL("LagMeterShrunk", mShrunk);
// expand so we save the large window rectangle
- if (mShrunk)
+ if (gSavedSettings.getBOOL("LagMeterShrunk"))
{
- onClickShrink(this);
+ onClickShrink();
}
}
@@ -311,58 +312,61 @@ void LLFloaterLagMeter::determineServer()
}
}
-//static
-void LLFloaterLagMeter::onClickShrink(void * data)
+
+void LLFloaterLagMeter::onClickShrink() // toggle "LagMeterShrunk"
{
- LLFloaterLagMeter * self = (LLFloaterLagMeter*)data;
+// LLFloaterLagMeter * self = (LLFloaterLagMeter*)data;
+
+ LLButton * button = getChild<LLButton>("minimize");
+ S32 delta_width = mMaxWidth -mMinWidth;
+ LLRect r = getRect();
+ bool shrunk = gSavedSettings.getBOOL("LagMeterShrunk");
- LLButton * button = self->getChild<LLButton>("minimize");
- S32 delta_width = self->mMaxWidth - self->mMinWidth;
- LLRect r = self->getRect();
- if(self->mShrunk)
+ if(shrunk)
{
- self->setTitle( self->getString("max_title_msg", self->mStringArgs) );
+ setTitle(getString("max_title_msg", mStringArgs) );
// make left edge appear to expand
r.translate(-delta_width, 0);
- self->setRect(r);
- self->reshape(self->mMaxWidth, self->getRect().getHeight());
+ setRect(r);
+ reshape(mMaxWidth, getRect().getHeight());
- self->childSetText("client", self->getString("client_text_msg", self->mStringArgs) + ":");
- self->childSetText("network", self->getString("network_text_msg", self->mStringArgs) + ":");
- self->childSetText("server", self->getString("server_text_msg", self->mStringArgs) + ":");
+ childSetText("client", getString("client_text_msg", mStringArgs) + ":");
+ childSetText("network", getString("network_text_msg",mStringArgs) + ":");
+ childSetText("server", getString("server_text_msg", mStringArgs) + ":");
// usually "<<"
- button->setLabel( self->getString("smaller_label", self->mStringArgs) );
+ button->setLabel( getString("smaller_label", mStringArgs) );
}
else
{
- self->setTitle( self->getString("min_title_msg", self->mStringArgs) );
+ setTitle( getString("min_title_msg", mStringArgs) );
// make left edge appear to collapse
r.translate(delta_width, 0);
- self->setRect(r);
- self->reshape(self->mMinWidth, self->getRect().getHeight());
+ setRect(r);
+ reshape(mMinWidth, getRect().getHeight());
- self->childSetText("client", self->getString("client_text_msg", self->mStringArgs) );
- self->childSetText("network", self->getString("network_text_msg", self->mStringArgs) );
- self->childSetText("server", self->getString("server_text_msg", self->mStringArgs) );
+ childSetText("client", getString("client_text_msg", mStringArgs) );
+ childSetText("network",getString("network_text_msg",mStringArgs) );
+ childSetText("server", getString("server_text_msg", mStringArgs) );
// usually ">>"
- button->setLabel( self->getString("bigger_label", self->mStringArgs) );
+ button->setLabel( getString("bigger_label", mStringArgs) );
}
// Don't put keyboard focus on the button
button->setFocus(FALSE);
- self->mClientText->setVisible(self->mShrunk);
- self->mClientCause->setVisible(self->mShrunk);
- self->childSetVisible("client_help", self->mShrunk);
+// self->mClientText->setVisible(self->mShrunk);
+// self->mClientCause->setVisible(self->mShrunk);
+// self->childSetVisible("client_help", self->mShrunk);
- self->mNetworkText->setVisible(self->mShrunk);
- self->mNetworkCause->setVisible(self->mShrunk);
- self->childSetVisible("network_help", self->mShrunk);
+// self->mNetworkText->setVisible(self->mShrunk);
+// self->mNetworkCause->setVisible(self->mShrunk);
+// self->childSetVisible("network_help", self->mShrunk);
- self->mServerText->setVisible(self->mShrunk);
- self->mServerCause->setVisible(self->mShrunk);
- self->childSetVisible("server_help", self->mShrunk);
+// self->mServerText->setVisible(self->mShrunk);
+// self->mServerCause->setVisible(self->mShrunk);
+// self->childSetVisible("server_help", self->mShrunk);
- self->mShrunk = !self->mShrunk;
+// self->mShrunk = !self->mShrunk;
+ gSavedSettings.setBOOL("LagMeterShrunk", !gSavedSettings.getBOOL("LagMeterShrunk"));
}
diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h
index e8af68ac7a..6d2086839e 100644
--- a/indra/newview/llfloaterlagmeter.h
+++ b/indra/newview/llfloaterlagmeter.h
@@ -42,17 +42,18 @@ class LLFloaterLagMeter : public LLFloater, public LLFloaterSingleton<LLFloaterL
friend class LLUISingleton<LLFloaterLagMeter, VisibilityPolicy<LLFloater> >;
public:
+ LLFloaterLagMeter(const LLSD& key);
+ /*virtual*/ ~LLFloaterLagMeter();
+
/*virtual*/ void draw();
/*virtual*/ BOOL postBuild();
private:
- LLFloaterLagMeter(const LLSD& key);
- /*virtual*/ ~LLFloaterLagMeter();
void determineClient();
void determineNetwork();
void determineServer();
- static void onClickShrink(void * data);
+ void onClickShrink();
bool mShrunk;
S32 mMaxWidth, mMinWidth;
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 6f5bd5f27b..f3275913e4 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -44,11 +44,11 @@
#include "lluserauth.h"
#include "llagent.h"
-#include "llfloateravatarpicker.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
-#include "llradiogroup.h"
#include "llcombobox.h"
+#include "llfloaterreg.h"
+#include "llfloateravatarpicker.h"
#include "llfloaterauction.h"
#include "llfloatergroups.h"
#include "llfloatergroupinfo.h"
@@ -889,7 +889,8 @@ void LLPanelLandGeneral::onClickStartAuction(void* data)
}
else
{
- LLFloaterAuction::showInstance();
+ //LLFloaterAuction::showInstance();
+ LLFloaterReg::showInstance("auction");
}
}
}
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 11842b8b0e..3d5d2b733f 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -163,7 +163,9 @@ bool LLNotificationChannelPanel::update(const LLSD& payload, bool passed_filter)
LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key)
: LLFloater()
{
- LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml");
+ mCommitCallbackRegistrar.add("ClickAdd", boost::bind(&LLFloaterNotificationConsole::onClickAdd, this));
+
+ //LLUICtrlFactory::instance().buildFloater(this, "floater_notifications_console.xml");
}
void LLFloaterNotificationConsole::onClose(bool app_quitting)
@@ -187,7 +189,7 @@ BOOL LLFloaterNotificationConsole::postBuild()
addChannel("Notifications");
addChannel("NotificationTips");
- getChild<LLButton>("add_notification")->setClickedCallback(onClickAdd, this);
+// getChild<LLButton>("add_notification")->setClickedCallback(onClickAdd, this);
LLComboBox* notifications = getChild<LLComboBox>("notification_types");
LLNotifications::TemplateNames names = LLNotifications::instance().getTemplateNames();
@@ -236,11 +238,9 @@ void LLFloaterNotificationConsole::updateResizeLimits()
setResizeLimits(getMinWidth(), floater_header_size + HEADER_PADDING + ((NOTIFICATION_PANEL_HEADER_HEIGHT + 3) * stack.getNumPanels()));
}
-void LLFloaterNotificationConsole::onClickAdd(void* user_data)
+void LLFloaterNotificationConsole::onClickAdd()
{
- LLFloaterNotificationConsole* floater = (LLFloaterNotificationConsole*)user_data;
-
- std::string message_name = floater->getChild<LLComboBox>("notification_types")->getValue().asString();
+ std::string message_name = getChild<LLComboBox>("notification_types")->getValue().asString();
if (!message_name.empty())
{
LLNotifications::instance().add(message_name, LLSD());
diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h
index 0372553182..b85437c3c5 100644
--- a/indra/newview/llfloaternotificationsconsole.h
+++ b/indra/newview/llfloaternotificationsconsole.h
@@ -55,7 +55,7 @@ public:
void updateResizeLimits();
private:
- static void onClickAdd(void* user_data);
+ void onClickAdd();
};
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index d0df2617b3..15d57ebbcc 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -57,18 +57,61 @@
#include "llfloatervoicedevicesettings.h"
#include "llkeyboard.h"
#include "llmodaldialog.h"
-#include "llpaneldisplay.h"
#include "llpanellogin.h"
#include "llradiogroup.h"
+#include "llsky.h"
#include "llstylemap.h"
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
#include "llsliderctrl.h"
#include "lltabcontainer.h"
+#include "lltrans.h"
#include "lltexteditor.h"
#include "llviewercontrol.h"
#include "llviewercamera.h"
#include "llviewerwindow.h"
+#include "llviewermessage.h"
+#include "llviewershadermgr.h"
+#include "llvotree.h"
+#include "llvosky.h"
+
+// linden library includes
+#include "llerror.h"
+#include "llfontgl.h"
+#include "llrect.h"
+#include "llstring.h"
+
+// project includes
+
+#include "llbutton.h"
+#include "llflexibleobject.h"
+#include "lllineeditor.h"
+#include "llresmgr.h"
+#include "llspinctrl.h"
+#include "llstartup.h"
+#include "lltextbox.h"
+
+#include "llui.h"
+
+#include "llviewerimage.h"
+#include "llviewerimagelist.h"
+#include "llviewerobjectlist.h"
+
+#include "llvoavatar.h"
+#include "llvovolume.h"
+#include "llwindow.h"
+#include "llworld.h"
+#include "pipeline.h"
+#include "lluictrlfactory.h"
+#include "llboost.h"
+
+
+//RN temporary includes for resolution switching
+#include "llglheaders.h"
+const F32 MAX_USER_FAR_CLIP = 512.f;
+const F32 MIN_USER_FAR_CLIP = 64.f;
+
+const S32 ASPECT_RATIO_STR_LEN = 100;
class LLVoiceSetKeyDialog : public LLModalDialog
{
@@ -136,6 +179,9 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response
bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater);
bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater);
+bool extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height);
+void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator);
+
LLMediaBase *get_web_media()
{
LLMediaBase *media_source;
@@ -223,8 +269,41 @@ bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLFl
return false;
}
+
+// Extract from strings of the form "<width> x <height>", e.g. "640 x 480".
+bool extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height)
+{
+ using namespace boost;
+ cmatch what;
+ const regex expression("([0-9]+) x ([0-9]+)");
+ if (regex_match(instr.c_str(), what, expression))
+ {
+ width = atoi(what[1].first);
+ height = atoi(what[2].first);
+ return true;
+ }
+
+ width = height = 0;
+ return false;
+}
+
+void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator)
+{
+ numerator = 0;
+ denominator = 0;
+ for (F32 test_denominator = 1.f; test_denominator < 30.f; test_denominator += 1.f)
+ {
+ if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f)
+ {
+ numerator = llround(decimal_val * test_denominator);
+ denominator = llround(test_denominator);
+ break;
+ }
+ }
+}
// static
std::string LLFloaterPreference::sSkin = "";
+F32 LLFloaterPreference::sAspectRatio = 0.0;
//////////////////////////////////////////////
// LLFloaterPreference
@@ -235,9 +314,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
{
//Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
- mFactoryMap["display"] = LLCallbackMap((LLCallbackMap::callback_t)LLCallbackMap::buildPanel<LLPanelDisplay>); /// done fixing the callbacks
-
-
mCommitCallbackRegistrar.add("Pref.Apply", boost::bind(&LLFloaterPreference::onBtnApply, this));
mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this));
mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this));
@@ -261,9 +337,14 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this));
mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this));
- gSavedSkinSettings.getControl("HTMLLinkColor")->getCommitSignal()->connect(boost::bind(&handleHTMLLinkColorChanged, _2));
- //gSavedSettings.getControl("UseExternalBrowser")->getCommitSignal()->connect(boost::bind(&LLPanelPreference::handleUseExternalBrowserChanged, this));
+ mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this));
+ mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2));
+ mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this));
+ mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this));
+ mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2));
+ gSavedSkinSettings.getControl("HTMLLinkColor")->getCommitSignal()->connect(boost::bind(&handleHTMLLinkColorChanged, _2));
+
}
BOOL LLFloaterPreference::postBuild()
@@ -271,20 +352,27 @@ BOOL LLFloaterPreference::postBuild()
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
-
-
return TRUE;
}
LLFloaterPreference::~LLFloaterPreference()
{
+ // clean up user data
+ LLComboBox* ctrl_aspect_ratio = getChild<LLComboBox>( "aspect_ratio");
+ LLComboBox* ctrl_window_size = getChild<LLComboBox>("windowsize combo");
+ for (S32 i = 0; i < ctrl_aspect_ratio->getItemCount(); i++)
+ {
+ ctrl_aspect_ratio->setCurrentByIndex(i);
+ }
+ for (S32 i = 0; i < ctrl_window_size->getItemCount(); i++)
+ {
+ ctrl_window_size->setCurrentByIndex(i);
+ }
}
void LLFloaterPreference::draw()
{
BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL);
gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected);
-
-
LLFloater::draw();
}
@@ -368,6 +456,14 @@ void LLFloaterPreference::apply()
}
}
+ applyResolution();
+
+ // Only set window size if we're not in fullscreen mode
+ if(gSavedSettings.getBOOL("NotFullScreen"))
+ {
+ applyWindowSize();
+ }
+
}
void LLFloaterPreference::cancel()
@@ -396,7 +492,11 @@ void LLFloaterPreference::cancel()
{
voice_device_settings ->cancel();
}
+
LLFloaterReg::hideInstance("pref_voicedevicesettings");
+
+ gSavedSettings.setF32("FullScreenAspectRatio", sAspectRatio);
+
}
void LLFloaterPreference::onOpen(const LLSD& key)
@@ -517,32 +617,17 @@ void LLFloaterPreference::onChangeCustom()
refreshEnabledGraphics();
}
-//////////////////////////////////////////////////////////////////////////
-// static Note:(angela) NOT touching LLPanelDisplay for this milestone (skinning-11)
+
void LLFloaterPreference::refreshEnabledGraphics()
{
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if(instance)
{
LLFloaterHardwareSettings::instance()->refreshEnabledState();
-
- LLTabContainer* tabcontainer = instance->getChild<LLTabContainer>("pref core");
- for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin();
- iter != tabcontainer->getChildList()->end(); ++iter)
- {
- LLView* view = *iter;
- if(!view)
- return;
- if(view->getName()=="display")
- {
- LLPanelDisplay* display_panel = dynamic_cast<LLPanelDisplay*>(view);
- if(!display_panel)
- return;
- display_panel->refreshEnabledState();
- }
- }
+ instance->refreshEnabledState();
}
}
+
void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl)
{
// get our UI widgets
@@ -693,6 +778,208 @@ void LLFloaterPreference::buildLists(void* data)
}
}
+void LLFloaterPreference::refreshEnabledState()
+{
+
+ // disable graphics settings and exit if it's not set to custom
+ if(!gSavedSettings.getBOOL("RenderCustomSettings"))
+ {
+ return;
+ }
+
+ LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
+ LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio");
+
+ // Reflections
+ BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable")
+ && gGLManager.mHasCubeMap
+ && LLCubeMap::sUseCubeMaps;
+ ctrl_reflections->setEnabled(reflections);
+
+ // Bump & Shiny
+ bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
+ getChild<LLCheckBoxCtrl>("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE);
+
+ for (S32 i = 0; i < radio_reflection_detail->getItemCount(); ++i)
+ {
+ radio_reflection_detail->setIndexEnabled(i, ctrl_reflections->get() && reflections);
+ }
+
+ // Avatar Mode
+ // Enable Avatar Shaders
+ LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
+ // Avatar Render Mode
+ LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
+
+ S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel;
+ ctrl_avatar_vp->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE);
+
+ if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||
+ gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)
+ {
+ ctrl_avatar_cloth->setEnabled(false);
+ }
+ else
+ {
+ ctrl_avatar_cloth->setEnabled(true);
+ }
+
+ // Vertex Shaders
+ // Global Shader Enable
+ LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
+ // radio set for terrain detail mode
+ LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
+
+ ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
+
+ BOOL shaders = ctrl_shader_enable->get();
+ if (shaders)
+ {
+ mRadioTerrainDetail->setValue(1);
+ mRadioTerrainDetail->setEnabled(FALSE);
+ }
+ else
+ {
+ mRadioTerrainDetail->setEnabled(TRUE);
+ }
+
+ // WindLight
+ LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
+
+ // *HACK just checks to see if we can use shaders...
+ // maybe some cards that use shaders, but don't support windlight
+ ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
+ // now turn off any features that are unavailable
+ disableUnavailableSettings();
+}
+
+void LLFloaterPreference::disableUnavailableSettings()
+{
+ LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
+ LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
+ LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
+ LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
+ LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
+ LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
+
+ // if vertex shaders off, disable all shader related products
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
+ {
+ ctrl_shader_enable->setEnabled(FALSE);
+ ctrl_shader_enable->setValue(FALSE);
+
+ ctrl_wind_light->setEnabled(FALSE);
+ ctrl_wind_light->setValue(FALSE);
+
+ ctrl_reflections->setEnabled(FALSE);
+ ctrl_reflections->setValue(FALSE);
+
+ ctrl_avatar_vp->setEnabled(FALSE);
+ ctrl_avatar_vp->setValue(FALSE);
+
+ ctrl_avatar_cloth->setEnabled(FALSE);
+ ctrl_avatar_cloth->setValue(FALSE);
+ }
+
+ // disabled windlight
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders"))
+ {
+ ctrl_wind_light->setEnabled(FALSE);
+ ctrl_wind_light->setValue(FALSE);
+ }
+
+ // disabled reflections
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections"))
+ {
+ ctrl_reflections->setEnabled(FALSE);
+ ctrl_reflections->setValue(FALSE);
+ }
+
+ // disabled av
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"))
+ {
+ ctrl_avatar_vp->setEnabled(FALSE);
+ ctrl_avatar_vp->setValue(FALSE);
+
+ ctrl_avatar_cloth->setEnabled(FALSE);
+ ctrl_avatar_cloth->setValue(FALSE);
+ }
+ // disabled cloth
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth"))
+ {
+ ctrl_avatar_cloth->setEnabled(FALSE);
+ ctrl_avatar_cloth->setValue(FALSE);
+ }
+ // disabled impostors
+ if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors"))
+ {
+ ctrl_avatar_impostors->setEnabled(FALSE);
+ ctrl_avatar_impostors->setValue(FALSE);
+ }
+}
+
+void LLFloaterPreference::onCommitAutoDetectAspect()
+{
+ BOOL auto_detect = getChild<LLCheckBoxCtrl>("aspect_auto_detect")->get();
+ F32 ratio;
+
+ if (auto_detect)
+ {
+ S32 numerator = 0;
+ S32 denominator = 0;
+
+ // clear any aspect ratio override
+ gViewerWindow->mWindow->setNativeAspectRatio(0.f);
+ fractionFromDecimal(gViewerWindow->mWindow->getNativeAspectRatio(), numerator, denominator);
+
+ std::string aspect;
+ if (numerator != 0)
+ {
+ aspect = llformat("%d:%d", numerator, denominator);
+ }
+ else
+ {
+ aspect = llformat("%.3f", gViewerWindow->mWindow->getNativeAspectRatio());
+ }
+
+ getChild<LLComboBox>( "aspect_ratio")->setLabel(aspect);
+
+ ratio = gViewerWindow->mWindow->getNativeAspectRatio();
+ gSavedSettings.setF32("FullScreenAspectRatio", ratio);
+ }
+}
+
+void LLFloaterPreference::refresh()
+{
+ LLPanel::refresh();
+
+ // sliders and their text boxes
+ // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow");
+ // slider text boxes
+ updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail"), getChild<LLTextBox>("ObjectMeshDetailText"));
+ updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail"), getChild<LLTextBox>("FlexibleMeshDetailText"));
+ updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail"), getChild<LLTextBox>("TreeMeshDetailText"));
+ updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail"), getChild<LLTextBox>("AvatarMeshDetailText"));
+ updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail"), getChild<LLTextBox>("TerrainMeshDetailText"));
+ updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess"), getChild<LLTextBox>("PostProcessText"));
+ updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail"), getChild<LLTextBox>("SkyMeshDetailText"));
+
+ refreshEnabledState();
+}
+
+void LLFloaterPreference::onCommitWindowedMode()
+{
+ refresh();
+}
+
+void LLFloaterPreference::onChangeQuality(const LLSD& data)
+{
+ U32 level = (U32)(data.asReal());
+ LLFeatureManager::getInstance()->setGraphicsLevel(level, true);
+ refreshEnabledGraphics();
+ refresh();
+}
+
// static
// DEV-24146 - needs to be removed at a later date. jan-2009
void LLFloaterPreference::cleanupBadSetting()
@@ -790,9 +1077,9 @@ void LLFloaterPreference::onCommitLogging()
{
enableHistory();
}
+
void LLFloaterPreference::enableHistory()
{
-
if (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean())
{
childEnable("log_show_history");
@@ -850,6 +1137,158 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
}
+void LLFloaterPreference::onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name)
+{
+ if(name.asString() =="" || !hasChild("name"))
+ return;
+
+ LLTextBox* text_box = getChild<LLTextBox>(name.asString());
+ LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl);
+ updateSliderText(slider, text_box);
+}
+
+void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box)
+{
+ if(text_box == NULL || ctrl== NULL)
+ return;
+
+ // get range and points when text should change
+ F32 value = (F32)ctrl->getValue().asReal();
+ F32 min = ctrl->getMinValue();
+ F32 max = ctrl->getMaxValue();
+ F32 range = max - min;
+ llassert(range > 0);
+ F32 midPoint = min + range / 3.0f;
+ F32 highPoint = min + (2.0f * range / 3.0f);
+
+ // choose the right text
+ if(value < midPoint)
+ {
+ text_box->setText(LLTrans::getString("GraphicsQualityLow"));
+ }
+ else if (value < highPoint)
+ {
+ text_box->setText(LLTrans::getString("GraphicsQualityMid"));
+ }
+ else
+ {
+ text_box->setText(LLTrans::getString("GraphicsQualityHigh"));
+ }
+}
+
+void LLFloaterPreference::onKeystrokeAspectRatio()
+{
+ getChild<LLCheckBoxCtrl>("aspect_auto_detect")->set(FALSE);
+}
+
+void LLFloaterPreference::applyWindowSize()
+{
+ LLComboBox* ctrl_windowSize = getChild<LLComboBox>("windowsize combo");
+ if (ctrl_windowSize->getVisible() && (ctrl_windowSize->getCurrentIndex() != -1))
+ {
+ U32 width = 0;
+ U32 height = 0;
+ if (extractWindowSizeFromString(ctrl_windowSize->getValue().asString().c_str(), width,height))
+ {
+ LLViewerWindow::movieSize(width, height);
+ }
+ }
+}
+
+void LLFloaterPreference::applyResolution()
+{
+ LLComboBox* ctrl_aspect_ratio = getChild<LLComboBox>( "aspect_ratio");
+ gGL.flush();
+ char aspect_ratio_text[ASPECT_RATIO_STR_LEN]; /*Flawfinder: ignore*/
+ if (ctrl_aspect_ratio->getCurrentIndex() == -1)
+ {
+ // *Can't pass const char* from c_str() into strtok
+ strncpy(aspect_ratio_text, ctrl_aspect_ratio->getSimple().c_str(), sizeof(aspect_ratio_text) -1); /*Flawfinder: ignore*/
+ aspect_ratio_text[sizeof(aspect_ratio_text) -1] = '\0';
+ char *element = strtok(aspect_ratio_text, ":/\\");
+ if (!element)
+ {
+ sAspectRatio = 0.f; // will be clamped later
+ }
+ else
+ {
+ LLLocale locale(LLLocale::USER_LOCALE);
+ sAspectRatio = (F32)atof(element);
+ }
+
+ // look for denominator
+ element = strtok(NULL, ":/\\");
+ if (element)
+ {
+ LLLocale locale(LLLocale::USER_LOCALE);
+
+ F32 denominator = (F32)atof(element);
+ if (denominator != 0.f)
+ {
+ sAspectRatio /= denominator;
+ }
+ }
+ }
+ else
+ {
+ sAspectRatio = (F32)ctrl_aspect_ratio->getValue().asReal();
+ }
+
+ // presumably, user entered a non-numeric value if aspect_ratio == 0.f
+ if (sAspectRatio != 0.f)
+ {
+ sAspectRatio = llclamp(sAspectRatio, 0.2f, 5.f);
+ gSavedSettings.setF32("FullScreenAspectRatio", sAspectRatio);
+ }
+
+ // Screen resolution
+ S32 num_resolutions;
+ LLWindow::LLWindowResolution* supported_resolutions =
+ gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
+ U32 resIndex = getChild<LLComboBox>("fullscreen combo")->getCurrentIndex();
+ gSavedSettings.setS32("FullScreenWidth", supported_resolutions[resIndex].mWidth);
+ gSavedSettings.setS32("FullScreenHeight", supported_resolutions[resIndex].mHeight);
+
+ gViewerWindow->requestResolutionUpdate(!gSavedSettings.getBOOL("NotFullScreen"));
+
+ send_agent_update(TRUE);
+
+ // Update enable/disable
+ refresh();
+}
+
+void LLFloaterPreference::initWindowSizeControls(LLPanel* panelp)
+{
+ // Window size
+ // mWindowSizeLabel = getChild<LLTextBox>("WindowSizeLabel");
+ LLComboBox* ctrl_window_size = panelp->getChild<LLComboBox>("windowsize combo");
+
+ // Look to see if current window size matches existing window sizes, if so then
+ // just set the selection value...
+ const U32 height = gViewerWindow->getWindowDisplayHeight();
+ const U32 width = gViewerWindow->getWindowDisplayWidth();
+ for (S32 i=0; i < ctrl_window_size->getItemCount(); i++)
+ {
+ U32 height_test = 0;
+ U32 width_test = 0;
+ ctrl_window_size->setCurrentByIndex(i);
+ if (extractWindowSizeFromString(ctrl_window_size->getValue().asString(), width_test, height_test))
+ {
+ if ((height_test == height) && (width_test == width))
+ {
+ return;
+ }
+ }
+ }
+ // ...otherwise, add a new entry with the current window height/width.
+ LLUIString resolution_label = panelp->getString("resolution_format");
+ resolution_label.setArg("[RES_X]", llformat("%d", width));
+ resolution_label.setArg("[RES_Y]", llformat("%d", height));
+ ctrl_window_size->add(resolution_label, ADD_TOP);
+ ctrl_window_size->setCurrentByIndex(0);
+}
+
+
//----------------------------------------------------------------------------
static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference");
@@ -858,14 +1297,12 @@ LLPanelPreference::LLPanelPreference()
{
//
mCommitCallbackRegistrar.add("setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
-
}
//virtual
BOOL LLPanelPreference::postBuild()
{
if (hasChild("maturity_desired_combobox"))
{
-
/////////////////////////// From LLPanelGeneral //////////////////////////
// if we have no agent, we can't let them choose anything
// if we have an agent, then we only let them choose if they have a choice
@@ -935,6 +1372,94 @@ BOOL LLPanelPreference::postBuild()
childSetText("busy_response", getString("log_in_to_change"));
}
+
+
+ if(hasChild("fullscreen combo"))
+ {
+ //============================================================================
+ // Resolution
+
+ S32 num_resolutions = 0;
+ LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions);
+
+ S32 fullscreen_mode = num_resolutions - 1;
+
+ LLComboBox*ctrl_full_screen = getChild<LLComboBox>( "fullscreen combo");
+ LLUIString resolution_label = getString("resolution_format");
+
+ for (S32 i = 0; i < num_resolutions; i++)
+ {
+ resolution_label.setArg("[RES_X]", llformat("%d", supported_resolutions[i].mWidth));
+ resolution_label.setArg("[RES_Y]", llformat("%d", supported_resolutions[i].mHeight));
+ ctrl_full_screen->add( resolution_label, ADD_BOTTOM );
+ }
+
+ {
+ BOOL targetFullscreen;
+ S32 targetWidth;
+ S32 targetHeight;
+
+ gViewerWindow->getTargetWindow(targetFullscreen, targetWidth, targetHeight);
+
+ if (targetFullscreen)
+ {
+ fullscreen_mode = 0; // default to 800x600
+ for (S32 i = 0; i < num_resolutions; i++)
+ {
+ if (targetWidth == supported_resolutions[i].mWidth
+ && targetHeight == supported_resolutions[i].mHeight)
+ {
+ fullscreen_mode = i;
+ }
+ }
+ ctrl_full_screen->setCurrentByIndex(fullscreen_mode);
+ }
+ else
+ {
+ // set to windowed mode
+ //fullscreen_mode = mCtrlFullScreen->getItemCount() - 1;
+ ctrl_full_screen->setCurrentByIndex(0);
+ }
+ }
+
+ LLFloaterPreference::initWindowSizeControls(this);
+
+ if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio"))
+ {
+ LLFloaterPreference::sAspectRatio = gViewerWindow->getDisplayAspectRatio();
+ }
+ else
+ {
+ LLFloaterPreference::sAspectRatio = gSavedSettings.getF32("FullScreenAspectRatio");
+ }
+
+ getChild<LLComboBox>("aspect_ratio")->setTextEntryCallback(boost::bind(&LLPanelPreference::setControlFalse, this, LLSD("FullScreenAutoDetectAspectRatio") ));
+
+
+ S32 numerator = 0;
+ S32 denominator = 0;
+ fractionFromDecimal(LLFloaterPreference::sAspectRatio, numerator, denominator);
+
+ LLUIString aspect_ratio_text = getString("aspect_ratio_text");
+ if (numerator != 0)
+ {
+ aspect_ratio_text.setArg("[NUM]", llformat("%d", numerator));
+ aspect_ratio_text.setArg("[DEN]", llformat("%d", denominator));
+ }
+ else
+ {
+ aspect_ratio_text = llformat("%.3f", LLFloaterPreference::sAspectRatio);
+ }
+
+ LLComboBox* ctrl_aspect_ratio = getChild<LLComboBox>( "aspect_ratio");
+ //mCtrlAspectRatio->setCommitCallback(onSelectAspectRatio, this);
+ // add default aspect ratios
+ ctrl_aspect_ratio->add(aspect_ratio_text, &LLFloaterPreference::sAspectRatio, ADD_TOP);
+ ctrl_aspect_ratio->setCurrentByIndex(0);
+
+ refresh();
+ }
+
apply();
return true;
}
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 000bff4dea..afff610c69 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -43,12 +43,22 @@
class LLPanelPreference;
class LLPanelLCD;
-class LLPanelDisplay;
class LLPanelDebug;
class LLMessageSystem;
class LLScrollListCtrl;
-
+class LLSliderCtrl;
class LLSD;
+class LLTextBox;
+
+typedef enum
+ {
+ GS_LOW_GRAPHICS,
+ GS_MID_GRAPHICS,
+ GS_HIGH_GRAPHICS,
+ GS_ULTRA_GRAPHICS
+
+ } EGraphicsSettings;
+
// Floater to control preferences (display, audio, bandwidth, general.
class LLFloaterPreference : public LLFloater
@@ -88,6 +98,8 @@ protected:
void setHardwareDefaults();
// callback for when client turns on shaders
void onVertexShaderEnable();
+
+
public:
void onClickSetCache();
@@ -106,11 +118,29 @@ public:
void enableHistory();
void onCommitLogging();
void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
+ void refreshEnabledState();
+ void disableUnavailableSettings();
+ void onCommitWindowedMode();
+ void refresh(); // Refresh enable/disable
+ // if the quality radio buttons are changed
+ void onChangeQuality(const LLSD& data);
+
+ void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box);
+ void onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name);
+ void onKeystrokeAspectRatio();
+// void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator);
+// bool extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height);
+
+ void onCommitAutoDetectAspect();
+ void applyResolution();
+ void applyWindowSize();
+
+ static void initWindowSizeControls(LLPanel* panelp);
static void buildLists(void* data);
static void refreshSkin(void* data);
static void cleanupBadSetting();
-
+ static F32 sAspectRatio;
private:
static std::string sSkin;
bool mGotPersonalInfo;
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 8ddc929019..4b175cdc27 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -188,7 +188,7 @@ BOOL LLFloaterReporter::postBuild()
LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit");
le->setEnabled( FALSE );
- setPosBox(mPosition.getValue());
+ setPosBox((LLVector3d)mPosition.getValue());
LLButton* pick_btn = getChild<LLButton>("pick_btn");
pick_btn->setImages(std::string("tool_face.tga"),
std::string("tool_face_active.tga") );
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 339b90a0f5..8b6102c67f 100644
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -44,7 +44,11 @@
LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key)
: LLFloater(key)
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_settings_debug.xml");
+ //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_settings_debug.xml");
+ mCommitCallbackRegistrar.add("SettingSelect", boost::bind(&LLFloaterSettingsDebug::onSettingSelect, this,_1));
+ mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this));
+ mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsDebug::onClickDefault, this));
+
}
LLFloaterSettingsDebug::~LLFloaterSettingsDebug()
@@ -82,17 +86,7 @@ BOOL LLFloaterSettingsDebug::postBuild()
}
settings_combo->sortByName();
- settings_combo->setCommitCallback(onSettingSelect, this);
settings_combo->updateSelection();
-
- childSetCommitCallback("val_spinner_1", onCommitSettings, this);
- childSetCommitCallback("val_spinner_2", onCommitSettings, this);
- childSetCommitCallback("val_spinner_3", onCommitSettings, this);
- childSetCommitCallback("val_spinner_4", onCommitSettings, this);
- childSetCommitCallback("val_text", onCommitSettings, this);
- childSetCommitCallback("boolean_combo", onCommitSettings, this);
- childSetCommitCallback("color_swatch", onCommitSettings, this);
- childSetAction("default_btn", onClickDefault, this);
mComment = getChild<LLTextEditor>("comment_text");
return TRUE;
}
@@ -107,21 +101,17 @@ void LLFloaterSettingsDebug::draw()
}
//static
-void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl, void* user_data)
+void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl)
{
- LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
LLComboBox* combo_box = (LLComboBox*)ctrl;
LLControlVariable* controlp = (LLControlVariable*)combo_box->getCurrentUserdata();
- floaterp->updateControl(controlp);
+ updateControl(controlp);
}
-//static
-void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
+void LLFloaterSettingsDebug::onCommitSettings()
{
- LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
-
- LLComboBox* settings_combo = floaterp->getChild<LLComboBox>("settings_combo");
+ LLComboBox* settings_combo = getChild<LLComboBox>("settings_combo");
LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata();
LLVector3 vector;
@@ -135,46 +125,46 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
switch(controlp->type())
{
case TYPE_U32:
- controlp->set(floaterp->childGetValue("val_spinner_1"));
+ controlp->set(childGetValue("val_spinner_1"));
break;
case TYPE_S32:
- controlp->set(floaterp->childGetValue("val_spinner_1"));
+ controlp->set(childGetValue("val_spinner_1"));
break;
case TYPE_F32:
- controlp->set(LLSD(floaterp->childGetValue("val_spinner_1").asReal()));
+ controlp->set(LLSD(childGetValue("val_spinner_1").asReal()));
break;
case TYPE_BOOLEAN:
- controlp->set(floaterp->childGetValue("boolean_combo"));
+ controlp->set(childGetValue("boolean_combo"));
break;
case TYPE_STRING:
- controlp->set(LLSD(floaterp->childGetValue("val_text").asString()));
+ controlp->set(LLSD(childGetValue("val_text").asString()));
break;
case TYPE_VEC3:
- vector.mV[VX] = (F32)floaterp->childGetValue("val_spinner_1").asReal();
- vector.mV[VY] = (F32)floaterp->childGetValue("val_spinner_2").asReal();
- vector.mV[VZ] = (F32)floaterp->childGetValue("val_spinner_3").asReal();
+ vector.mV[VX] = (F32)childGetValue("val_spinner_1").asReal();
+ vector.mV[VY] = (F32)childGetValue("val_spinner_2").asReal();
+ vector.mV[VZ] = (F32)childGetValue("val_spinner_3").asReal();
controlp->set(vector.getValue());
break;
case TYPE_VEC3D:
- vectord.mdV[VX] = floaterp->childGetValue("val_spinner_1").asReal();
- vectord.mdV[VY] = floaterp->childGetValue("val_spinner_2").asReal();
- vectord.mdV[VZ] = floaterp->childGetValue("val_spinner_3").asReal();
+ vectord.mdV[VX] = childGetValue("val_spinner_1").asReal();
+ vectord.mdV[VY] = childGetValue("val_spinner_2").asReal();
+ vectord.mdV[VZ] = childGetValue("val_spinner_3").asReal();
controlp->set(vectord.getValue());
break;
case TYPE_RECT:
- rect.mLeft = floaterp->childGetValue("val_spinner_1").asInteger();
- rect.mRight = floaterp->childGetValue("val_spinner_2").asInteger();
- rect.mBottom = floaterp->childGetValue("val_spinner_3").asInteger();
- rect.mTop = floaterp->childGetValue("val_spinner_4").asInteger();
+ rect.mLeft = childGetValue("val_spinner_1").asInteger();
+ rect.mRight = childGetValue("val_spinner_2").asInteger();
+ rect.mBottom = childGetValue("val_spinner_3").asInteger();
+ rect.mTop = childGetValue("val_spinner_4").asInteger();
controlp->set(rect.getValue());
break;
case TYPE_COL4:
- col3.setValue(floaterp->childGetValue("color_swatch"));
- col4 = LLColor4(col3, (F32)floaterp->childGetValue("val_spinner_4").asReal());
+ col3.setValue(childGetValue("val_color_swatch"));
+ col4 = LLColor4(col3, (F32)childGetValue("val_spinner_4").asReal());
controlp->set(col4.getValue());
break;
case TYPE_COL3:
- controlp->set(floaterp->childGetValue("color_swatch"));
+ controlp->set(childGetValue("val_color_swatch"));
//col3.mV[VRED] = (F32)floaterp->childGetValue("val_spinner_1").asC();
//col3.mV[VGREEN] = (F32)floaterp->childGetValue("val_spinner_2").asReal();
//col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal();
@@ -186,16 +176,15 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
}
// static
-void LLFloaterSettingsDebug::onClickDefault(void* user_data)
+void LLFloaterSettingsDebug::onClickDefault()
{
- LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
- LLComboBox* settings_combo = floaterp->getChild<LLComboBox>("settings_combo");
+ LLComboBox* settings_combo = getChild<LLComboBox>("settings_combo");
LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata();
if (controlp)
{
controlp->resetToDefault();
- floaterp->updateControl(controlp);
+ updateControl(controlp);
}
}
@@ -206,7 +195,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
- LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("color_swatch");
+ LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h
index 0a98021c79..87833793af 100644
--- a/indra/newview/llfloatersettingsdebug.h
+++ b/indra/newview/llfloatersettingsdebug.h
@@ -52,9 +52,9 @@ public:
void updateControl(LLControlVariable* control);
- static void onSettingSelect(LLUICtrl* ctrl, void* user_data);
- static void onCommitSettings(LLUICtrl* ctrl, void* user_data);
- static void onClickDefault(void* user_data);
+ void onSettingSelect(LLUICtrl* ctrl);
+ void onCommitSettings();
+ void onClickDefault();
protected:
LLTextEditor* mComment;
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 62a8c0d27e..4bcf470317 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -45,6 +45,7 @@
#include "lldraghandle.h"
#include "llfloaterbuildoptions.h"
#include "llfloateropenobject.h"
+#include "llfloaterreg.h"
#include "llfocusmgr.h"
#include "llmenugl.h"
#include "llpanelcontents.h"
@@ -952,7 +953,7 @@ void LLFloaterTools::setObjectType( LLPCode pcode )
void LLFloaterTools::onClickGridOptions(void* data)
{
//LLFloaterTools* floaterp = (LLFloaterTools*)data;
- LLFloaterBuildOptions::showInstance();
+ LLFloaterReg::showInstance("build_options");
// RN: this makes grid options dependent on build tools window
//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
}
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 5b17c98ef0..fd8c22b8e5 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -82,7 +82,7 @@ const S32 ICON_WIDTH = 16;
const S32 TEXT_PAD = 1;
const S32 ARROW_SIZE = 12;
const S32 RENAME_WIDTH_PAD = 4;
-const S32 RENAME_HEIGHT_PAD = 6;
+const S32 RENAME_HEIGHT_PAD = 2;
const S32 AUTO_OPEN_STACK_DEPTH = 16;
const S32 MIN_ITEM_WIDTH_VISIBLE = ICON_WIDTH + ICON_PAD + ARROW_SIZE + TEXT_PAD + /*first few characters*/ 40;
const S32 MINIMUM_RENAMER_WIDTH = 80;
@@ -2560,7 +2560,7 @@ LLFolderView::LLFolderView(const Params& p)
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory.xml", gMenuHolder);
if (!menu)
{
- menu = LLUICtrlFactory::createDummyWidget<LLMenuGL>("inventory_menu");
+ menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
}
menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor"));
mPopupMenuHandle = menu->getHandle();
@@ -2772,6 +2772,9 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
reshape( llmax(min_width, total_width), running_height );
}
+ // move item renamer text field to item's new position
+ updateRenamerPosition();
+
mTargetHeight = (F32)target_height;
return llround(mTargetHeight);
}
@@ -3620,23 +3623,8 @@ void LLFolderView::startRenamingSelectedItem( void )
{
mRenameItem = item;
- S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD - 1 + item->getIndentation();
- S32 y = llfloor(item->getRect().getHeight()-sFont->getLineHeight()-2);
- item->localPointToScreen( x, y, &x, &y );
- screenPointToLocal( x, y, &x, &y );
- mRenamer->setOrigin( x, y );
-
- S32 scroller_height = 0;
- S32 scroller_width = gViewerWindow->getWindowWidth();
- BOOL dummy_bool;
- if (mScrollContainer)
- {
- mScrollContainer->calcVisibleSize( &scroller_width, &scroller_height, &dummy_bool, &dummy_bool);
- }
+ updateRenamerPosition();
- S32 width = llmax(llmin(item->getRect().getWidth() - x, scroller_width - x - getRect().mLeft), MINIMUM_RENAMER_WIDTH);
- S32 height = llfloor(sFont->getLineHeight() + RENAME_HEIGHT_PAD);
- mRenamer->reshape( width, height, TRUE );
mRenamer->setText(item->getName());
mRenamer->selectAll();
@@ -4386,6 +4374,31 @@ void LLFolderView::dumpSelectionInformation()
llinfos << "****************************************" << llendl;
}
+void LLFolderView::updateRenamerPosition()
+{
+ if(mRenameItem)
+ {
+ S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD - 1 + mRenameItem->getIndentation();
+ S32 y = llfloor(mRenameItem->getRect().getHeight()-sFont->getLineHeight()-2);
+ mRenameItem->localPointToScreen( x, y, &x, &y );
+ screenPointToLocal( x, y, &x, &y );
+ mRenamer->setOrigin( x, y );
+
+ S32 scroller_height = 0;
+ S32 scroller_width = gViewerWindow->getWindowWidth();
+ BOOL dummy_bool;
+ if (mScrollContainer)
+ {
+ mScrollContainer->calcVisibleSize( &scroller_width, &scroller_height, &dummy_bool, &dummy_bool);
+ }
+
+ S32 width = llmax(llmin(mRenameItem->getRect().getWidth() - x, scroller_width - x - getRect().mLeft), MINIMUM_RENAMER_WIDTH);
+ S32 height = llfloor(sFont->getLineHeight() + RENAME_HEIGHT_PAD);
+ mRenamer->reshape( width, height, TRUE );
+ }
+}
+
+
///----------------------------------------------------------------------------
/// Local function definitions
///----------------------------------------------------------------------------
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 2393aa627c..848d289bb9 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -915,6 +915,9 @@ public:
// DEBUG only
void dumpSelectionInformation();
+private:
+ void updateRenamerPosition();
+
protected:
LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container.
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 4aaa7ca6cb..fac0de0f33 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -426,7 +426,9 @@ void LLLocationInputCtrl::rebuildLocationHistory(std::string filter)
LLLocationHistory* lh = LLLocationHistory::getInstance();
if (filter.empty())
+ {
itemsp = &lh->getItems();
+ }
else
{
lh->getMatchingItems(filter, filtered_items);
@@ -435,7 +437,9 @@ void LLLocationInputCtrl::rebuildLocationHistory(std::string filter)
removeall();
for (LLLocationHistory::location_list_t::const_reverse_iterator it = itemsp->rbegin(); it != itemsp->rend(); it++)
+ {
add(*it);
+ }
}
void LLLocationInputCtrl::focusTextEntry()
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 379cd48a6a..6f64aa68ad 100644
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -68,8 +68,8 @@ public:
struct NameColumn : public LLInitParam::Choice<NameColumn>
{
- Option<S32> column_index;
- Option<std::string> column_name;
+ Alternative<S32> column_index;
+ Alternative<std::string> column_name;
NameColumn()
: column_name("name_column"),
column_index("name_column_index", 0)
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index 457397a379..0d25272f88 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -45,8 +45,8 @@ static std::string PANEL_PROFILE = "panel_profile";
static std::string PANEL_PICKS = "panel_picks";
static std::string PANEL_NOTES = "panel_notes";
-LLPanelProfileView::LLPanelProfileView(const LLPanel::Params& p)
-: LLPanel(p)
+LLPanelProfileView::LLPanelProfileView()
+: LLPanel()
{
}
diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h
index 4d81704522..2d89f15fe4 100644
--- a/indra/newview/llpanelprofileview.h
+++ b/indra/newview/llpanelprofileview.h
@@ -44,7 +44,7 @@ class LLPanelProfileView : public LLPanel
friend class LLUICtrlFactory;
public:
- LLPanelProfileView(const LLPanel::Params& p = defaultParams());
+ LLPanelProfileView();
~LLPanelProfileView(void);
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 22e8ada2ea..eb35834dc0 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -92,15 +92,8 @@ void LLTeleportHistoryPanel::onShowOnMap()
S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger();
- const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems();
-
- LLVector3d global_pos = hist_items[index].mGlobalPos;
-
- if (!global_pos.isExactlyZero())
- {
- LLFloaterWorldMap::getInstance()->trackLocation(global_pos);
- LLFloaterReg::showInstance("world_map", "center");
- }
+ // teleport to existing item in history, so we don't add it again
+ mTeleportHistory->goToItem(index);
}
// virtual
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 981a843d94..8c2372ee74 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -732,7 +732,7 @@ void LLStatusBar::onClickSearch(void* data)
// static
void LLStatusBar::onClickStatGraph(void* data)
{
- LLFloaterLagMeter::showInstance();
+ LLFloaterReg::showInstance("lagmeter");
}
BOOL can_afford_transaction(S32 cost)
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 950d5ba20c..03c4915e66 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -39,20 +39,26 @@
#include "llcompilequeue.h"
#include "llfloaterabout.h"
+#include "llfloaterauction.h"
#include "llfloateraddlandmark.h"
#include "llfloateravatarinfo.h"
+#include "llfloaterbuildoptions.h"
+#include "llfloaterbump.h"
#include "llfloaterchat.h"
#include "llfloaterchatterbox.h"
#include "llfloaterdirectory.h"
#include "llfloaterjoystick.h"
-#include "llfloatervoicedevicesettings.h"
+#include "llfloaternotificationsconsole.h"
+#include "llfloaterlagmeter.h"
#include "llfloatermap.h"
#include "llfloatermemleak.h"
#include "llfloatermute.h"
#include "llfloaterpreference.h"
#include "llfloatersnapshot.h"
+#include "llfloatersettingsdebug.h"
#include "llfloatertools.h"
#include "llfloateruipreview.h"
+#include "llfloatervoicedevicesettings.h"
#include "llfloaterworldmap.h"
#include "llinventoryview.h"
#include "llnearbychathistory.h"
@@ -80,6 +86,13 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("add_landmark", "floater_add_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAddLandmark>);
LLFloaterReg::add("mute", "floater_mute.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMute>);
+ LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>);
+ LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>);
+ LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
+ LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);
+ LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
+ LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>);
+
LLFloaterReg::add("ui_preview", "floater_ui_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterUIPreview>);
LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bdc86a3a69..826aca5e64 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -121,6 +121,7 @@
#include "llfloaterperms.h"
#include "llfloaterpostprocess.h"
#include "llfloaterpreference.h"
+#include "llfloaterreg.h"
#include "llfloaterregioninfo.h"
#include "llfloaterreporter.h"
#include "llfloaterscriptdebug.h"
@@ -613,7 +614,8 @@ class LLAdvancedToggleConsole : public view_listener_t
#endif
else if ("notifications" == console_type)
{
- LLFloaterNotificationConsole::showInstance();
+ //LLFloaterNotificationConsole::showInstance();
+ LLFloaterReg::showInstance("notifications_console");
}
return true;
}
@@ -2145,7 +2147,8 @@ class LLAdvancedShowDebugSettings : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLFloaterSettingsDebug::showInstance(userdata);
+ // LLFloaterSettingsDebug::showInstance(userdata);
+ LLFloaterReg::showInstance("settings_debug",userdata);
return true;
}
};
@@ -5649,7 +5652,7 @@ class LLShowFloater : public view_listener_t
}
else if (floater_name == "grid options")
{
- LLFloaterBuildOptions::showInstance();
+ LLFloaterReg::showInstance("build_options");
}
else if (floater_name == "script errors")
{
@@ -5673,12 +5676,13 @@ class LLShowFloater : public view_listener_t
{
if (!gNoRender)
{
- LLFloaterBump::showInstance();
+ //LLFloaterBump::showInstance();
+ LLFloaterReg::showInstance("bumps");
}
}
else if (floater_name == "lag meter")
{
- LLFloaterLagMeter::showInstance();
+ LLFloaterReg::showInstance("lagmeter");
}
else if (floater_name == "buy currency")
{
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index a62e59bc10..a05bd30600 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4395,8 +4395,8 @@ void handle_show_mean_events(void *)
{
return;
}
-
- LLFloaterBump::showInstance();
+ LLFloaterReg::showInstance("bumps");
+ //LLFloaterBump::showInstance();
}
void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false)
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cb2a8771fa..46aa284258 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2131,7 +2131,8 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
&& (MASK_CONTROL & mask)
&& ('5' == key))
{
- LLFloaterNotificationConsole::showInstance();
+ //LLFloaterNotificationConsole::showInstance();
+ LLFloaterReg::showInstance("notifications_console");
return TRUE;
}
@@ -2428,51 +2429,59 @@ void LLViewerWindow::updateUI()
root_view = mRootView;
}
- // walk UI tree in depth-first order
- LLView::tree_iterator_t end_it;
- for (LLView::tree_iterator_t it = root_view->beginTree();
- it != end_it;
- ++it)
- {
- LLView* viewp = *it;
- // calculating the screen rect involves traversing the parent, so this is less than optimal
- if (!viewp->getVisible()
- || !viewp->calcScreenBoundingRect().pointInRect(x, y))
- {
- // skip this view and all of its children
- it.skipDescendants();
- continue;
- }
+ // aggregate visible views that contain mouse cursor in display order
- // if this view is mouse opaque, nothing behind it should be in mouse_hover_set
- if (viewp->getMouseOpaque())
+ // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events
+ if (top_ctrl && top_ctrl->calcScreenBoundingRect().pointInRect(x, y))
+ {
+ // iterator over contents of top_ctrl, and throw into mouse_hover_set
+ for (LLView::tree_iterator_t it = top_ctrl->beginTree();
+ it != top_ctrl->endTree();
+ ++it)
{
- // constrain further iteration to children of this widget
- it = viewp->beginTree();
+ LLView* viewp = *it;
+ if (viewp->getVisible()
+ && viewp->calcScreenBoundingRect().pointInRect(x, y))
+ {
+ // we have a view that contains the mouse, add it to the set
+ mouse_hover_set.insert(viewp->getHandle());
+ }
+ else
+ {
+ // skip this view and all of its children
+ it.skipDescendants();
+ }
}
-
- // we have a view that contains the mouse, add it to the set
- mouse_hover_set.insert(viewp->getHandle());
}
-
- // now do the same aggregation for the "top" ctrl, whose parent does not necessarily contain the mouse
- if (top_ctrl)
+ else
{
- for (LLView::tree_iterator_t it = top_ctrl->beginTree();
- it != root_view->endTree();
+ // walk UI tree in depth-first order
+ LLView::tree_iterator_t end_it;
+ for (LLView::tree_iterator_t it = root_view->beginTree();
+ it != end_it;
++it)
{
LLView* viewp = *it;
- if (!viewp->getVisible()
- || !viewp->calcScreenBoundingRect().pointInRect(x, y))
+ // calculating the screen rect involves traversing the parent, so this is less than optimal
+ if (viewp->getVisible()
+ && viewp->calcScreenBoundingRect().pointInRect(x, y))
+ {
+
+ // if this view is mouse opaque, nothing behind it should be in mouse_hover_set
+ if (viewp->getMouseOpaque())
+ {
+ // constrain further iteration to children of this widget
+ it = viewp->beginTree();
+ }
+
+ // we have a view that contains the mouse, add it to the set
+ mouse_hover_set.insert(viewp->getHandle());
+ }
+ else
{
// skip this view and all of its children
it.skipDescendants();
- continue;
}
-
- // we have a view that contains the mouse, add it to the set
- mouse_hover_set.insert(viewp->getHandle());
}
}
@@ -2898,11 +2907,25 @@ void LLViewerWindow::updateWorldViewRect()
if (!LLSideTray::instanceCreated()) return;
LLRect new_world_rect = mWindowRect;
+
+ // pull in right side of world view based on sidetray
LLSideTray* sidetray = LLSideTray::getInstance();
if (sidetray->getVisible())
{
new_world_rect.mRight -= llround((F32)sidetray->getTrayWidth() * mDisplayScale.mV[VX]);
}
+
+ // push top of world view below nav bar
+ if (LLNavigationBar::getInstance()->getVisible())
+ {
+ LLNavigationBar* barp = LLNavigationBar::getInstance();
+ LLRect nav_bar_rect;
+ if(barp->localRectToOtherView(barp->getLocalRect(), &nav_bar_rect, mRootView))
+ {
+ new_world_rect.mTop = llround((F32)LLNavigationBar::getInstance()->getRect().mBottom * mDisplayScale.mV[VY]);
+ }
+ }
+
if (mWorldViewRect != new_world_rect)
{
mWorldViewRect = new_world_rect;
diff --git a/indra/newview/skins/default/xui/en/floater_auction.xml b/indra/newview/skins/default/xui/en/floater_auction.xml
index 21d060fdda..076332e062 100644
--- a/indra/newview/skins/default/xui/en/floater_auction.xml
+++ b/indra/newview/skins/default/xui/en/floater_auction.xml
@@ -29,6 +29,7 @@
top_pad="12"
width="400" />
<check_box
+ control_name="AuctionShowFence"
follows="left|bottom"
height="16"
initial_value="true"
@@ -47,7 +48,10 @@
left_delta="0"
name="snapshot_btn"
top_pad="4"
- width="96" />
+ width="96" >
+ <button.commit_callback
+ function="ClickSnapshot" />
+ </button>
<button
follows="left|bottom"
height="20"
@@ -57,5 +61,8 @@
left_pad="4"
name="ok_btn"
top_delta="0"
- width="48" />
+ width="48">
+ <button.commit_callback
+ function="ClickOK" />
+ </button>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
index 0e29046500..0012294160 100644
--- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml
@@ -64,17 +64,17 @@
left_delta="0"
name="Edit"
top_pad="4"
- width="132" />
+ width="50" />
<button
follows="top|right"
height="20"
label="Find"
label_selected="Find"
layout="topleft"
- left_pad="30"
+ left_pad="5"
name="Find"
top_delta="-1"
- width="95" />
+ width="62" />
<scroll_list
follows="left|top|right|bottom"
height="90"
@@ -196,12 +196,12 @@
top="324"
width="95" />
<button
- follows="left|bottom"
+ follows="right|bottom"
height="20"
label="Cancel"
label_selected="Cancel"
layout="topleft"
- left_pad="70"
+ right="-10"
name="Cancel"
top_delta="0"
width="95" />
diff --git a/indra/newview/skins/default/xui/en/floater_lagmeter.xml b/indra/newview/skins/default/xui/en/floater_lagmeter.xml
index ebe8df9f5e..8af4f74aa3 100644
--- a/indra/newview/skins/default/xui/en/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/en/floater_lagmeter.xml
@@ -201,6 +201,7 @@
Client:
</text>
<text
+ make_visible_control="LagMeterShrunk"
type="string"
length="1"
bottom="40"
@@ -214,6 +215,7 @@
Normal
</text>
<text
+ make_visible_control="LagMeterShrunk"
bottom="56"
follows="left|top"
height="16"
@@ -248,6 +250,7 @@
Network:
</text>
<text
+ make_visible_control="LagMeterShrunk"
type="string"
length="1"
bottom="80"
@@ -261,6 +264,7 @@
Normal
</text>
<text
+ make_visible_control="LagMeterShrunk"
bottom="96"
follows="left|top"
height="16"
@@ -295,6 +299,7 @@
Server:
</text>
<text
+ make_visible_control="LagMeterShrunk"
type="string"
length="1"
bottom="120"
@@ -308,6 +313,7 @@
Normal
</text>
<text
+ make_visible_control="LagMeterShrunk"
bottom="136"
follows="left|top"
height="16"
@@ -333,5 +339,8 @@
left_delta="-317"
name="minimize"
top_delta="-2"
- width="25" />
+ width="25">
+ <button.commit_callback
+ function="LagMeter.ClickShrink" />
+ </button>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_notifications_console.xml b/indra/newview/skins/default/xui/en/floater_notifications_console.xml
index 92ecb5908e..14aa12aed7 100644
--- a/indra/newview/skins/default/xui/en/floater_notifications_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_notifications_console.xml
@@ -24,7 +24,10 @@
left_pad="3"
name="add_notification"
top_delta="0"
- width="50" />
+ width="50" >
+ <button.commit_callback
+ function="ClickAdd" />
+ </button>
<layout_stack
bottom="495"
follows="left|right|top|bottom"
diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml
index ba28016d8e..1760d5b818 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences.xml
@@ -109,6 +109,7 @@
layout="topleft"
name="web" />
<panel
+ class="panel_preference"
filename="panel_preferences_graphics1.xml"
label="Graphics"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml
index 108d0b97e8..9a73ffb1a2 100644
--- a/indra/newview/skins/default/xui/en/floater_settings_debug.xml
+++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml
@@ -15,7 +15,10 @@
max_chars="255"
name="settings_combo"
top="30"
- width="200" />
+ width="200">
+ <combo_box.commit_callback
+ function="SettingSelect" />
+ </combo_box>
<text_editor
enabled="false"
height="60"
@@ -41,6 +44,8 @@
<combo_box.item
label="FALSE"
value="" />
+ <combo_box.commit_callback
+ function="CommitSettings" />
</combo_box>
<line_editor
height="20"
@@ -49,14 +54,21 @@
name="val_text"
top_delta="0"
visible="false"
- width="300" />
+ width="300" >
+ <line_editor.commit_callback
+ function="CommitSettings" />
+ </line_editor>
<color_swatch
bottom="185"
can_apply_immediately="true"
height="55"
+ name="val_color_swatch"
label="Color"
layout="topleft"
- width="37" />
+ width="37" >
+ <color_swatch.commit_callback
+ function="CommitSettings" />
+ </color_swatch>
<spinner
height="20"
label="x"
@@ -66,7 +78,10 @@
name="val_spinner_1"
top_delta="10"
visible="false"
- width="120" />
+ width="120" >
+ <spinner.commit_callback
+ function="CommitSettings" />
+ </spinner>
<spinner
height="20"
label="x"
@@ -76,7 +91,10 @@
name="val_spinner_2"
top_delta="0"
visible="false"
- width="120" />
+ width="120">
+ <spinner.commit_callback
+ function="CommitSettings" />
+ </spinner>
<spinner
height="20"
label="x"
@@ -86,7 +104,10 @@
name="val_spinner_3"
top="160"
visible="false"
- width="120" />
+ width="120">
+ <spinner.commit_callback
+ function="CommitSettings" />
+ </spinner>
<spinner
height="20"
label="x"
@@ -96,7 +117,10 @@
name="val_spinner_4"
top_delta="0"
visible="false"
- width="120" />
+ width="120" >
+ <spinner.commit_callback
+ function="CommitSettings" />
+ </spinner>
<button
height="20"
label="Reset to default"
@@ -104,5 +128,8 @@
left="15"
name="default_btn"
top="190"
- width="150" />
+ width="150" >
+ <button.commit_callback
+ function="ClickDefault" />
+ </button>
</floater>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 929f857e90..8db8c8f31d 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -165,6 +165,9 @@
enabled="true"
label="16:9 (Widescreen)"
value="1.7777777" />
+ <combo_box.commit_callback
+ function="setControlFalse"
+ parameter="FullScreenAutoDetectAspectRatio" />
</combo_box>
<check_box
make_invisible_control="NotFullScreen"
@@ -336,7 +339,10 @@
name="QualityPerformanceSelection"
show_text="false"
top_delta="-1"
- width="150" />
+ width="150">
+ <slider.commit_callback
+ function="Pref.QualityPerformance"/>
+ </slider>
<check_box
control_name="RenderCustomSettings"
height="16"