diff options
author | James Cook <james@lindenlab.com> | 2008-04-03 18:43:54 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2008-04-03 18:43:54 +0000 |
commit | 55c25229b79b1755c989e5996c8e8d118f369721 (patch) | |
tree | 1fa882bc7e11dc8aec031d5e268131809874168a | |
parent | b3fcfa16ba8b984163c38904e165052a34be6dab (diff) |
svn merge -r 83778:83944 maint-ui-10-merge
QAR-442
35 files changed, 852 insertions, 142 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 274bf5cc04..d482011194 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -43,9 +43,10 @@ #include "message.h" // Constants -const char* CN_WAITING = "(waiting)"; -const char* CN_NOBODY = "(nobody)"; -const char* CN_NONE = "(none)"; +// probably need a setUIString() call in the interface +const char* const CN_WAITING = "(Loading...)"; // *TODO: translate +const char* const CN_NOBODY = "(nobody)"; // *TODO: translate +const char* const CN_NONE = "(none)"; // *TODO: translate // llsd serialization constants static const std::string AGENTS("agents"); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index f8882c5ebf..a6c35b67a8 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -130,8 +130,9 @@ LLFloaterView* gFloaterView = NULL; LLFloater::LLFloater() : //FIXME: we should initialize *all* member variables here mResizable(FALSE), - mDragOnLeft(FALSE) - + mDragOnLeft(FALSE), + mMinWidth(0), + mMinHeight(0) { // automatically take focus when opened mAutoFocus = TRUE; @@ -2329,7 +2330,9 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) LLMultiFloater::LLMultiFloater() : mTabContainer(NULL), mTabPos(LLTabContainer::TOP), - mAutoResize(TRUE) + mAutoResize(TRUE), + mOrigMinWidth(0), + mOrigMinHeight(0) { } @@ -2337,7 +2340,9 @@ LLMultiFloater::LLMultiFloater() : LLMultiFloater::LLMultiFloater(LLTabContainer::TabPosition tab_pos) : mTabContainer(NULL), mTabPos(tab_pos), - mAutoResize(TRUE) + mAutoResize(TRUE), + mOrigMinWidth(0), + mOrigMinHeight(0) { } @@ -2346,7 +2351,9 @@ LLMultiFloater::LLMultiFloater(const LLString &name) : LLFloater(name), mTabContainer(NULL), mTabPos(LLTabContainer::TOP), - mAutoResize(FALSE) + mAutoResize(FALSE), + mOrigMinWidth(0), + mOrigMinHeight(0) { } @@ -2358,7 +2365,9 @@ LLMultiFloater::LLMultiFloater( LLFloater(name, rect, name), mTabContainer(NULL), mTabPos(LLTabContainer::TOP), - mAutoResize(auto_resize) + mAutoResize(auto_resize), + mOrigMinWidth(0), + mOrigMinHeight(0) { mTabContainer = new LLTabContainer("Preview Tabs", LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), @@ -2382,7 +2391,9 @@ LLMultiFloater::LLMultiFloater( LLFloater(name, rect_control, name), mTabContainer(NULL), mTabPos(tab_pos), - mAutoResize(auto_resize) + mAutoResize(auto_resize), + mOrigMinWidth(0), + mOrigMinHeight(0) { mTabContainer = new LLTabContainer("Preview Tabs", LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0), @@ -2756,6 +2767,9 @@ void LLMultiFloater::setCanResize(BOOL can_resize) BOOL LLMultiFloater::postBuild() { + // remember any original xml minimum size + getResizeLimits(&mOrigMinWidth, &mOrigMinHeight); + if (mTabContainer) { return TRUE; @@ -2773,10 +2787,11 @@ BOOL LLMultiFloater::postBuild() void LLMultiFloater::updateResizeLimits() { - S32 new_min_width = 0; - S32 new_min_height = 0; - S32 tab_idx; - for (tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + // initialize minimum size constraint to the original xml values. + S32 new_min_width = mOrigMinWidth; + S32 new_min_height = mOrigMinHeight; + // possibly increase minimum size constraint due to children's minimums. + for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) { LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx); if (floaterp) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 360d8093e5..e722d5ad07 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -411,6 +411,7 @@ protected: LLTabContainer::TabPosition mTabPos; BOOL mAutoResize; + S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late }; // visibility policy specialized for floaters diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index ab43e6d7d9..be8416cc23 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -233,9 +233,10 @@ LLDXHardware::LLDXHardware() void LLDXHardware::cleanup() { - for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer()); + // for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer()); } +/* LLString LLDXHardware::dumpDevices() { if (gWriteDebug) @@ -284,6 +285,7 @@ LLDXDevice *LLDXHardware::findDevice(const std::string &vendor, const std::strin return NULL; } +*/ BOOL LLDXHardware::getInfo(BOOL vram_only) { @@ -296,7 +298,7 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) IDxDiagProvider *dx_diag_providerp = NULL; IDxDiagContainer *dx_diag_rootp = NULL; IDxDiagContainer *devices_containerp = NULL; - IDxDiagContainer *system_device_containerp= NULL; + // IDxDiagContainer *system_device_containerp= NULL; IDxDiagContainer *device_containerp = NULL; IDxDiagContainer *file_containerp = NULL; IDxDiagContainer *driver_containerp = NULL; @@ -362,15 +364,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) } // Get the English VRAM string - std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish"); + { + std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish"); - // We don't need the device any more - SAFE_RELEASE(device_containerp); + // We don't need the device any more + SAFE_RELEASE(device_containerp); + + // Dump the string as an int into the structure + char *stopstring; + mVRAM = strtol(ram_str.c_str(), &stopstring, 10); + llinfos << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << llendl; + } - // Dump the string as an int into the structure - char *stopstring; - mVRAM = strtol(ram_str.c_str(), &stopstring, 10); - llinfos << "VRAM Detected: " << mVRAM << " DX9 string: " << ram_str << llendl; if (vram_only) { @@ -378,6 +383,11 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) goto LCleanup; } + + /* for now, we ONLY do vram_only the rest of this + is commented out, to ensure no-one is tempted + to use it + // Now let's get device and driver information // Get the IDxDiagContainer object called "DxDiag_SystemDevices". // This call may take some time while dxdiag gathers the info. @@ -504,11 +514,12 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) } SAFE_RELEASE(device_containerp); } + */ } - dumpDevices(); - ok = TRUE; - + // dumpDevices(); + ok = TRUE; + LCleanup: if (!ok) { @@ -526,7 +537,7 @@ LCleanup: CoUninitialize(); return ok; -} + } LLSD LLDXHardware::getDisplayInfo() { diff --git a/indra/llwindow/lldxhardware.h b/indra/llwindow/lldxhardware.h index e2a255da76..e174b322b0 100644 --- a/indra/llwindow/lldxhardware.h +++ b/indra/llwindow/lldxhardware.h @@ -85,6 +85,7 @@ class LLDXHardware { public: LLDXHardware(); + void setWriteDebugFunc(void (*func)(const char*)); void cleanup(); @@ -100,12 +101,12 @@ public: // Empty strings indicate that you don't care. // You can separate multiple devices with '|' chars to indicate you want // ANY of them to match and return. - LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); + // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); - LLString dumpDevices(); + // LLString dumpDevices(); public: typedef std::map<std::string, LLDXDevice *> device_map_t; - device_map_t mDevices; + // device_map_t mDevices; protected: S32 mVRAM; }; diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index b2e9c5b51d..6b9414a301 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -154,7 +154,7 @@ public: virtual BOOL getSize(LLCoordWindow *size) = 0; virtual BOOL setPosition(LLCoordScreen position) = 0; virtual BOOL setSize(LLCoordScreen size) = 0; - virtual BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) = 0; + virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0; virtual BOOL setCursorPosition(LLCoordWindow position) = 0; virtual BOOL getCursorPosition(LLCoordWindow *position) = 0; virtual void showCursor() = 0; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index b7e6644674..a138814241 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -50,7 +50,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;}; - /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) {return FALSE;}; + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; /*virtual*/ void showCursor() {}; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index ad8a284930..9daedef1f1 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -835,7 +835,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits // changing fullscreen resolution, or switching between windowed and fullscreen mode. -BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) +BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp) { BOOL needsRebuild = FALSE; BOOL result = true; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 86b88daa3c..58bcd91381 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -59,7 +59,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size); /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSize(LLCoordScreen size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 8de92bbe0e..4ed88d7b81 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -54,7 +54,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSize(LLCoordScreen size) {return FALSE;}; - /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) {return FALSE;}; + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; /*virtual*/ void showCursor() {}; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 122b57a497..5597ff4334 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -765,7 +765,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B // changing fullscreen resolution, or switching between windowed and fullscreen mode. -BOOL LLWindowSDL::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) +BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp) { const BOOL needsRebuild = TRUE; // Just nuke the context and start over. BOOL result = true; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 4d4d36e30a..51d34eb96f 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -66,7 +66,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size); /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSize(LLCoordScreen size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 5239da1712..c9554ce7fe 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -651,9 +651,10 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width, //----------------------------------------------------------------------- // Create GL drawing context //----------------------------------------------------------------------- - if (!switchContext(mFullscreen, LLCoordScreen(window_rect.right - window_rect.left, // width - window_rect.bottom - window_rect.top), // height - TRUE)) + LLCoordScreen windowPos(x,y); + LLCoordScreen windowSize(window_rect.right - window_rect.left, + window_rect.bottom - window_rect.top); + if (!switchContext(mFullscreen, windowSize, TRUE, &windowPos)) { return; } @@ -928,7 +929,7 @@ BOOL LLWindowWin32::setSize(const LLCoordScreen size) } // changing fullscreen resolution -BOOL LLWindowWin32::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync) +BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp) { GLuint pixel_format; DEVMODE dev_mode; @@ -1050,10 +1051,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disa else { mFullscreen = FALSE; - window_rect.left = (long) 0; - window_rect.right = (long) width; // Windows GDI rects don't include rightmost pixel - window_rect.top = (long) 0; - window_rect.bottom = (long) height; + window_rect.left = (long) (posp ? posp->mX : 0); + window_rect.right = (long) width + window_rect.left; // Windows GDI rects don't include rightmost pixel + window_rect.top = (long) (posp ? posp->mY : 0); + window_rect.bottom = (long) height + window_rect.top; // Window with an edge dw_ex_style = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; dw_style = WS_OVERLAPPEDWINDOW; diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index e8eed55aee..f6e40a1c7f 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -59,7 +59,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size); /*virtual*/ BOOL setPosition(LLCoordScreen position); /*virtual*/ BOOL setSize(LLCoordScreen size); - /*virtual*/ BOOL switchContext(BOOL fullscreen, LLCoordScreen size, BOOL disable_vsync); + /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7e687a5e64..93c06a474c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2224,6 +2224,28 @@ <integer>0</integer> </array> </map> + <key>FloaterActiveSpeakersSortColumn</key> + <map> + <key>Comment</key> + <string>Column name to sort on</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>speaker_name</string> + </map> + <key>FloaterActiveSpeakersSortAscending</key> + <map> + <key>Comment</key> + <string>Whether to sort up or down</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>FloaterAudioVolumeRect</key> <map> <key>Comment</key> @@ -2304,7 +2326,7 @@ <integer>0</integer> </array> </map> - <key>FloaterCameraRect2</key> + <key>FloaterCameraRect3</key> <map> <key>Comment</key> <string>Rectangle for camera control window</string> @@ -2314,10 +2336,10 @@ <string>Rect</string> <key>Value</key> <array> - <integer>166</integer> - <integer>128</integer> - <integer>342</integer> + <integer>0</integer> <integer>64</integer> + <integer>176</integer> + <integer>0</integer> </array> </map> <key>FloaterChatRect</key> @@ -6062,6 +6084,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ShowActiveSpeakers</key> + <map> + <key>Comment</key> + <string>Display active speakers list on login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>ShowAxes</key> <map> <key>Comment</key> @@ -6082,7 +6115,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowChatHistory</key> <map> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a9d4e8a2f6..d00dfef478 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -58,7 +58,6 @@ #include "imageids.h" #include "llbox.h" #include "llbutton.h" -#include "llcameraview.h" #include "llcallingcard.h" #include "llchatbar.h" #include "llconsole.h" @@ -69,6 +68,7 @@ #include "llfloateractivespeakers.h" #include "llfloateravatarinfo.h" #include "llfloaterbuildoptions.h" +#include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" #include "llfloaterdirectory.h" diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index fb726e7c97..143c9cece4 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -320,6 +320,10 @@ bool LLAppViewerWin32::initHardwareTest() { BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); + // per DEV-11631 - disable hardware probing for everything + // but vram. + vram_only = TRUE; + LLSplashScreen::update("Detecting hardware..."); llinfos << "Attempting to poll DirectX for hardware info" << llendl; diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 0e0880959e..11d4f4c651 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -60,6 +60,8 @@ #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llvoavatar.h" +#include "llimview.h" +#include "llimpanel.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -671,7 +673,18 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) } if(notify) { + // Popup a notify box with online status of this agent LLNotifyBox::showXml(online ? "FriendOnline" : "FriendOffline", args); + + // If there's an open IM session with this agent, send a notification there too. + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); + LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); + if (floater) + { + LLUIString notifyMsg = LLNotifyBox::getTemplateMessage((online ? "FriendOnline" : "FriendOffline"),args); + if (!notifyMsg.empty()) + floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); + } } mModifyMask |= LLFriendObserver::ONLINE; diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index b00450eec6..c07319e224 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -38,7 +38,6 @@ // viewer includes #include "llnotify.h" -#include "llfloatervoicewizard.h" #include "llviewercontrol.h" #include "llui.h" #include "llappviewer.h" @@ -255,20 +254,6 @@ void LLFirstUse::useSculptedPrim() } // static -void LLFirstUse::useVoice() -{ - if (!gSavedSettings.getBOOL("CmdLineDisableVoice")) - { - if (gSavedSettings.getWarning("FirstVoice")) - { - gSavedSettings.setWarning("FirstVoice", FALSE); - - LLFloaterVoiceWizard::showInstance(); - } - } -} - -// static void LLFirstUse::useMedia() { if (gSavedSettings.getWarning("FirstMedia")) diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 5510ce02b9..92c3da6f44 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -104,7 +104,6 @@ public: static void useFlexible(); static void useDebugMenus(); static void useSculptedPrim(); - static void useVoice(); static void useMedia(); protected: diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp new file mode 100644 index 0000000000..6bc14b331b --- /dev/null +++ b/indra/newview/llfloatercamera.cpp @@ -0,0 +1,163 @@ +/** + * @file llfloatercamera.cpp + * @brief Container for camera control buttons (zoom, pan, orbit) + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatercamera.h" + +// Library includes +#include "lluictrlfactory.h" + +// Viewer includes +#include "lljoystickbutton.h" +#include "llviewercontrol.h" + +// Constants +const F32 CAMERA_BUTTON_DELAY = 0.0f; + +// Globals +LLFloaterCamera* gFloaterCamera = NULL; + + +// +// Member functions +// + +LLFloaterCamera::LLFloaterCamera(const std::string& name) +: LLFloater(name) // uses "FloaterCameraRect3" +{ + setIsChrome(TRUE); + + // For now, only used for size and tooltip strings + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml"); + + S32 top = getRect().getHeight(); + S32 bottom = 0; + S32 left = 16; + + const S32 ROTATE_WIDTH = 64; + mRotate = new LLJoystickCameraRotate("cam rotate stick", + LLRect( left, top, left + ROTATE_WIDTH, bottom ), + "cam_rotate_out.tga", + "cam_rotate_in.tga" ); + mRotate->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); + mRotate->setHeldDownDelay(CAMERA_BUTTON_DELAY); + mRotate->setToolTip( getString("rotate_tooltip") ); + mRotate->setSoundFlags(MOUSE_DOWN | MOUSE_UP); + addChild(mRotate); + + left += ROTATE_WIDTH; + + const S32 ZOOM_WIDTH = 16; + mZoom = new LLJoystickCameraZoom( + "zoom", + LLRect( left, top, left + ZOOM_WIDTH, bottom ), + "cam_zoom_out.tga", + "cam_zoom_plus_in.tga", + "cam_zoom_minus_in.tga"); + mZoom->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); + mZoom->setHeldDownDelay(CAMERA_BUTTON_DELAY); + mZoom->setToolTip( getString("zoom_tooltip") ); + mZoom->setSoundFlags(MOUSE_DOWN | MOUSE_UP); + addChild(mZoom); + + left += ZOOM_WIDTH; + + const S32 TRACK_WIDTH = 64; + mTrack = new LLJoystickCameraTrack("cam track stick", + LLRect( left, top, left + TRACK_WIDTH, bottom ), + "cam_tracking_out.tga", + "cam_tracking_in.tga"); + mTrack->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); + mTrack->setHeldDownDelay(CAMERA_BUTTON_DELAY); + mTrack->setToolTip( getString("move_tooltip") ); + mTrack->setSoundFlags(MOUSE_DOWN | MOUSE_UP); + addChild(mTrack); +} + + +LLFloaterCamera::~LLFloaterCamera() +{ + // children all deleted by LLView destructor + gFloaterCamera = NULL; +} + +// virtual +void LLFloaterCamera::onClose(bool app_quitting) +{ + LLFloater::onClose(app_quitting); + + if (!app_quitting) + { + gSavedSettings.setBOOL("ShowCameraControls", FALSE); + } +} + +// +// Static member functions +// + +// static +void LLFloaterCamera::show(void*) +{ + if(!gFloaterCamera) + { + gFloaterCamera = new LLFloaterCamera("camera floater"); + } + gFloaterCamera->open(); /* Flawfinder: ignore */ + gSavedSettings.setBOOL("ShowCameraControls", TRUE); +} + +// static +void LLFloaterCamera::toggle(void*) +{ + if (gFloaterCamera) + { + gFloaterCamera->close(); + } + else + { + show(NULL); + } +} + +// static +BOOL LLFloaterCamera::visible(void*) +{ + if (gFloaterCamera) + { + return gFloaterCamera->getVisible(); + } + else + { + return FALSE; + } +} diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h new file mode 100644 index 0000000000..fac4d2f191 --- /dev/null +++ b/indra/newview/llfloatercamera.h @@ -0,0 +1,62 @@ +/** + * @file llfloatercamera.h + * @brief Container for camera control buttons (zoom, pan, orbit) + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLFLOATERCAMERA_H +#define LLFLOATERCAMERA_H + +#include "llfloater.h" + +class LLJoystickCameraRotate; +class LLJoystickCameraZoom; +class LLJoystickCameraTrack; + +class LLFloaterCamera + : public LLFloater +{ +public: + LLFloaterCamera(const std::string& name); + ~LLFloaterCamera(); + + /*virtual*/ void onClose(bool app_quitting); + + static void show(void*); + static void toggle(void*); + static BOOL visible(void*); + +public: + LLJoystickCameraRotate* mRotate; + LLJoystickCameraZoom* mZoom; + LLJoystickCameraTrack* mTrack; +}; + +extern LLFloaterCamera *gFloaterCamera; + +#endif diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index bb44304ae6..2b7d10a7a9 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -235,12 +235,16 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) spinner4->setVisible(FALSE); color_swatch->setVisible(FALSE); childSetVisible("val_text", FALSE); - childSetVisible("boolean_combo", FALSE); mComment->setText(LLString::null); if (controlp) { eControlType type = controlp->type(); + + //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame + childSetVisible("boolean_combo", type == TYPE_BOOLEAN); + + mComment->setText(controlp->getComment()); spinner1->setMaxValue(F32_MAX); spinner2->setMaxValue(F32_MAX); @@ -304,8 +308,6 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) } break; case TYPE_BOOLEAN: - childSetVisible("boolean_combo", TRUE); - if (!childHasFocus("boolean_combo")) { if (sd.asBoolean()) diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp new file mode 100644 index 0000000000..699f89c944 --- /dev/null +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -0,0 +1,323 @@ +/** + * @file llfloatervoicedevicesettings.cpp + * @author Richard Nelson + * @brief Voice communication set-up + * + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatervoicedevicesettings.h" + +// Viewer includes +#include "llagent.h" +#include "llbutton.h" +#include "llcombobox.h" +#include "llfocusmgr.h" +#include "lliconctrl.h" +#include "llprefsvoice.h" +#include "llsliderctrl.h" +#include "llviewercontrol.h" +#include "llvoiceclient.h" +#include "llimpanel.h" + +// Library includes (after viewer) +#include "lluictrlfactory.h" + + +LLPanelVoiceDeviceSettings::LLPanelVoiceDeviceSettings() +{ + mCtrlInputDevices = NULL; + mCtrlOutputDevices = NULL; + mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); + mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); + mDevicesUpdated = FALSE; + + // grab "live" mic volume level + mMicVolume = gSavedSettings.getF32("AudioLevelMic"); + + // ask for new device enumeration + // now do this in onOpen() instead... + //gVoiceClient->refreshDeviceLists(); +} + +LLPanelVoiceDeviceSettings::~LLPanelVoiceDeviceSettings() +{ +} + +BOOL LLPanelVoiceDeviceSettings::postBuild() +{ + LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); + // set mic volume tuning slider based on last mic volume setting + volume_slider->setValue(mMicVolume); + + childSetCommitCallback("voice_input_device", onCommitInputDevice, this); + childSetCommitCallback("voice_output_device", onCommitOutputDevice, this); + + return TRUE; +} + +void LLPanelVoiceDeviceSettings::draw() +{ + // let user know that volume indicator is not yet available + childSetVisible("wait_text", !gVoiceClient->inTuningMode()); + + LLPanel::draw(); + + F32 voice_power = gVoiceClient->tuningGetEnergy(); + S32 discrete_power = 0; + + if (!gVoiceClient->inTuningMode()) + { + discrete_power = 0; + } + else + { + discrete_power = llmin(4, llfloor((voice_power / LLVoiceClient::OVERDRIVEN_POWER_LEVEL) * 4.f)); + } + + if (gVoiceClient->inTuningMode()) + { + for(S32 power_bar_idx = 0; power_bar_idx < 5; power_bar_idx++) + { + LLString view_name = llformat("%s%d", "bar", power_bar_idx); + LLView* bar_view = getChild<LLView>(view_name); + if (bar_view) + { + if (power_bar_idx < discrete_power) + { + LLColor4 color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor"); + gl_rect_2d(bar_view->getRect(), color, TRUE); + } + gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE); + } + } + } +} + +void LLPanelVoiceDeviceSettings::apply() +{ + std::string s; + if(mCtrlInputDevices) + { + s = mCtrlInputDevices->getSimple(); + gSavedSettings.setString("VoiceInputAudioDevice", s); + } + + if(mCtrlOutputDevices) + { + s = mCtrlOutputDevices->getSimple(); + gSavedSettings.setString("VoiceOutputAudioDevice", s); + } + + // assume we are being destroyed by closing our embedding window + gSavedSettings.setF32("AudioLevelMic", mMicVolume); +} + +void LLPanelVoiceDeviceSettings::cancel() +{ + gSavedSettings.setString("VoiceInputAudioDevice", mInputDevice); + gSavedSettings.setString("VoiceOutputAudioDevice", mOutputDevice); + + if(mCtrlInputDevices) + mCtrlInputDevices->setSimple(mInputDevice); + + if(mCtrlOutputDevices) + mCtrlOutputDevices->setSimple(mOutputDevice); +} + +void LLPanelVoiceDeviceSettings::refresh() +{ + //grab current volume + LLSlider* volume_slider = getChild<LLSlider>("mic_volume_slider"); + // set mic volume tuning slider based on last mic volume setting + mMicVolume = (F32)volume_slider->getValue().asReal(); + gVoiceClient->tuningSetMicVolume(mMicVolume); + + // Fill in popup menus + mCtrlInputDevices = getChild<LLComboBox>("voice_input_device"); + mCtrlOutputDevices = getChild<LLComboBox>("voice_output_device"); + + if(!gVoiceClient->deviceSettingsAvailable()) + { + // The combo boxes are disabled, since we can't get the device settings from the daemon just now. + // Put the currently set default (ONLY) in the box, and select it. + if(mCtrlInputDevices) + { + mCtrlInputDevices->removeall(); + mCtrlInputDevices->add( mInputDevice, ADD_BOTTOM ); + mCtrlInputDevices->setSimple(mInputDevice); + } + if(mCtrlOutputDevices) + { + mCtrlOutputDevices->removeall(); + mCtrlOutputDevices->add( mOutputDevice, ADD_BOTTOM ); + mCtrlOutputDevices->setSimple(mOutputDevice); + } + } + else if (!mDevicesUpdated) + { + LLVoiceClient::deviceList *devices; + + LLVoiceClient::deviceList::iterator iter; + + if(mCtrlInputDevices) + { + mCtrlInputDevices->removeall(); + mCtrlInputDevices->add( getString("default_text"), ADD_BOTTOM ); + + devices = gVoiceClient->getCaptureDevices(); + for(iter=devices->begin(); iter != devices->end(); iter++) + { + mCtrlInputDevices->add( *iter, ADD_BOTTOM ); + } + + if(!mCtrlInputDevices->setSimple(mInputDevice)) + { + mCtrlInputDevices->setSimple(getString("default_text")); + } + } + + if(mCtrlOutputDevices) + { + mCtrlOutputDevices->removeall(); + mCtrlOutputDevices->add( getString("default_text"), ADD_BOTTOM ); + + devices = gVoiceClient->getRenderDevices(); + for(iter=devices->begin(); iter != devices->end(); iter++) + { + mCtrlOutputDevices->add( *iter, ADD_BOTTOM ); + } + + if(!mCtrlOutputDevices->setSimple(mOutputDevice)) + { + mCtrlOutputDevices->setSimple(getString("default_text")); + } + } + mDevicesUpdated = TRUE; + } +} + +void LLPanelVoiceDeviceSettings::onOpen() +{ + mInputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); + mOutputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); + mMicVolume = gSavedSettings.getF32("AudioLevelMic"); + mDevicesUpdated = FALSE; + + // ask for new device enumeration + gVoiceClient->refreshDeviceLists(); + + // put voice client in "tuning" mode + gVoiceClient->tuningStart(); + LLVoiceChannel::suspend(); +} + +void LLPanelVoiceDeviceSettings::onClose(bool app_quitting) +{ + gVoiceClient->tuningStop(); + LLVoiceChannel::resume(); +} + +// static +void LLPanelVoiceDeviceSettings::onCommitInputDevice(LLUICtrl* ctrl, void* user_data) +{ + gSavedSettings.setString("VoiceInputAudioDevice", ctrl->getValue().asString()); +} + +// static +void LLPanelVoiceDeviceSettings::onCommitOutputDevice(LLUICtrl* ctrl, void* user_data) +{ + gSavedSettings.setString("VoiceOutputAudioDevice", ctrl->getValue().asString()); +} + +// +// LLFloaterVoiceDeviceSettings +// + +LLFloaterVoiceDeviceSettings::LLFloaterVoiceDeviceSettings(const LLSD& seed) : LLFloater("floater_device_settings"), mDevicePanel(NULL) +{ + mFactoryMap["device_settings"] = LLCallbackMap(createPanelVoiceDeviceSettings, this); + // do not automatically open singleton floaters (as result of getInstance()) + BOOL no_open = FALSE; + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_device_settings.xml", &mFactoryMap, no_open); + center(); +} + +void LLFloaterVoiceDeviceSettings::onOpen() +{ + if(mDevicePanel) + { + mDevicePanel->onOpen(); + } + + LLFloater::onOpen(); +} + +void LLFloaterVoiceDeviceSettings::onClose(bool app_quitting) +{ + if(mDevicePanel) + { + mDevicePanel->onClose(app_quitting); + } + + setVisible(FALSE); +} + +void LLFloaterVoiceDeviceSettings::apply() +{ + if (mDevicePanel) + { + mDevicePanel->apply(); + } +} + +void LLFloaterVoiceDeviceSettings::cancel() +{ + if (mDevicePanel) + { + mDevicePanel->cancel(); + } +} + +void LLFloaterVoiceDeviceSettings::draw() +{ + if (mDevicePanel) + { + mDevicePanel->refresh(); + } + LLFloater::draw(); +} + +// static +void* LLFloaterVoiceDeviceSettings::createPanelVoiceDeviceSettings(void* user_data) +{ + LLFloaterVoiceDeviceSettings* floaterp = (LLFloaterVoiceDeviceSettings*)user_data; + floaterp->mDevicePanel = new LLPanelVoiceDeviceSettings(); + return floaterp->mDevicePanel; +} diff --git a/indra/newview/llfloatervoicedevicesettings.h b/indra/newview/llfloatervoicedevicesettings.h new file mode 100644 index 0000000000..45a209b24b --- /dev/null +++ b/indra/newview/llfloatervoicedevicesettings.h @@ -0,0 +1,82 @@ +/** + * @file llpanelvoicedevicesettings.h + * @author Richard Nelson + * @brief Voice communication set-up wizard + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERVOICEDEVICESETTINGS_H +#define LL_LLFLOATERVOICEDEVICESETTINGS_H + +#include "llfloater.h" + +class LLPrefsVoiceLogic; + +class LLPanelVoiceDeviceSettings : public LLPanel +{ +public: + LLPanelVoiceDeviceSettings(); + ~LLPanelVoiceDeviceSettings(); + + /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(); + void apply(); + void cancel(); + void refresh(); + void onOpen(); + void onClose(bool app_quitting); + +protected: + static void onCommitInputDevice(LLUICtrl* ctrl, void* user_data); + static void onCommitOutputDevice(LLUICtrl* ctrl, void* user_data); + + F32 mMicVolume; + std::string mInputDevice; + std::string mOutputDevice; + class LLComboBox *mCtrlInputDevices; + class LLComboBox *mCtrlOutputDevices; + BOOL mDevicesUpdated; +}; + +class LLFloaterVoiceDeviceSettings : public LLFloater, public LLFloaterSingleton<LLFloaterVoiceDeviceSettings> +{ +public: + LLFloaterVoiceDeviceSettings(const LLSD& seed); + /*virtual*/ void onOpen(); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + void apply(); + void cancel(); + +protected: + static void* createPanelVoiceDeviceSettings(void* user_data); + + LLPanelVoiceDeviceSettings* mDevicePanel; +}; + +#endif // LL_LLFLOATERVOICEDEVICESETTINGS_H diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4047cd022f..5fa49e0e8b 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -404,6 +404,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, combo->setCommitCallback( &LLPanelGeneral::set_start_location ); + childSetCommitCallback("server_combo", onSelectServer, this); + childSetAction("connect_btn", onClickConnect, this); setDefaultBtn("connect_btn"); @@ -909,6 +911,7 @@ void LLPanelLogin::loadLoginPage() first_query_delimiter = "?"; } + // Language LLString language(gSavedSettings.getString("Language")); if(language == "default") { @@ -916,11 +919,37 @@ void LLPanelLogin::loadLoginPage() } oStr << first_query_delimiter<<"lang=" << language; + // First Login? if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { oStr << "&firstlogin=TRUE"; } + // Channel and Version + LLString version = llformat("%d.%d.%d (%d)", + LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); + + char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0); + char* curl_version = curl_escape(version.c_str(), 0); + + oStr << "&channel=" << curl_channel; + oStr << "&version=" << curl_version; + + curl_free(curl_channel); + curl_free(curl_version); + + // Grid + LLString grid; + S32 grid_index; + getServer( grid, grid_index ); + if( grid_index != (S32)GRID_INFO_OTHER ) + { + grid = gGridInfo[grid_index].mLabel; + } + + char* curl_grid = curl_escape(grid.c_str(), 0); + oStr << "&grid=" << curl_grid; + curl_free(curl_grid); #if USE_VIEWER_AUTH LLURLSimString::sInstance.parse(); @@ -970,22 +999,12 @@ void LLPanelLogin::loadLoginPage() lastname = gSavedSettings.getString("LastName"); } - LLString version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); - char* curl_region = curl_escape(region.c_str(), 0); - char* curl_channel = curl_escape(gChannelName.c_str(), 0); - char* curl_version = curl_escape(version.c_str(), 0); oStr <<"firstname=" << firstname << - "&lastname=" << lastname << "&location=" << location << "®ion=" << curl_region << - "&grid=" << gGridInfo[gGridChoice].mLabel << "&channel=" << curl_channel << - "&version=" << curl_version; + "&lastname=" << lastname << "&location=" << location << "®ion=" << curl_region; curl_free(curl_region); - curl_free(curl_channel); - curl_free(curl_version); - if (!password.empty()) { @@ -1147,3 +1166,10 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) sCapslockDidNotification = TRUE; } } + +// static +void LLPanelLogin::onSelectServer(LLUICtrl*, void*) +{ + // grid changed so show new splash screen (possibly) + loadLoginPage(); +} diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index ac6e3b0426..a13431d683 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -112,6 +112,7 @@ private: virtual void onNavigateComplete( const EventType& eventIn ); static void onClickForgotPassword(void*); static void onPassKey(LLLineEditor* caller, void* user_data); + static void onSelectServer(LLUICtrl*, void*); private: LLPointer<LLUIImage> mLogoImage; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 392c9724a0..bdcde60f46 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -193,7 +193,7 @@ void LLPreviewTexture::init() void LLPreviewTexture::draw() { - updateAspectRatio(); + updateDimensions(); LLPreview::draw(); @@ -377,7 +377,7 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, // It takes a while until we get height and width information. // When we receive it, reshape the window accordingly. -void LLPreviewTexture::updateAspectRatio() +void LLPreviewTexture::updateDimensions() { if (!mImage) return; @@ -386,24 +386,21 @@ void LLPreviewTexture::updateAspectRatio() // Attempt to make the image 1:1 on screen. // If that fails, cut width by half. S32 client_width = image_width; + S32 client_height = image_height; S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; S32 vert_pad = PREVIEW_HEADER_SIZE + 2 * CLIENT_RECT_VPAD + LLPANEL_BORDER_WIDTH; - S32 screen_width = gViewerWindow->getWindowWidth(); - S32 max_client_width = screen_width - horiz_pad; + S32 max_client_width = gViewerWindow->getWindowWidth() - horiz_pad; S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad; - F32 inv_aspect_ratio = (F32) image_height / (F32) image_width; - while ((client_width > max_client_width) || ( llround(client_width * inv_aspect_ratio) > max_client_height ) ) + while ((client_width > max_client_width) || + (client_height > max_client_height ) ) { client_width /= 2; + client_height /= 2; } S32 view_width = client_width + horiz_pad; - - // Adjust the height based on the width computed above. - S32 client_height = llround(client_width * inv_aspect_ratio); S32 view_height = client_height + vert_pad; - // set text on dimensions display (should be moved out of here and into a callback of some sort) childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->mFullWidth)); @@ -459,26 +456,20 @@ void LLPreviewTexture::updateAspectRatio() else { client_width = getRect().getWidth() - horiz_pad; - client_height = llround(client_width * inv_aspect_ratio); + client_height = getRect().getHeight() - vert_pad; } + S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height + - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE; + S32 max_width = getRect().getWidth() - horiz_pad; - S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height - - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE; - max_height = llmax(max_height, 1); - - if (client_height > max_height) - { - F32 aspect_ratio = (F32) image_width / (F32) image_height; - client_height = max_height; - client_width = llround(client_height * aspect_ratio); - } + client_height = llclamp(client_height, 1, max_height); + client_width = llclamp(client_width, 1, max_width); LLRect window_rect(0, getRect().getHeight(), getRect().getWidth(), 0); window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD; - // try to keep aspect ratio when hosted, as hosting view can resize without user input mClientRect.setLeftTopAndSize(window_rect.getCenterX() - (client_width / 2), window_rect.mTop, client_width, client_height); } diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 8ed5210c46..a897dcadef 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -78,11 +78,11 @@ public: protected: void init(); - void updateAspectRatio(); virtual const char *getTitleName() const { return "Texture"; } -protected: +private: + void updateDimensions(); LLUUID mImageID; LLPointer<LLViewerImage> mImage; BOOL mLoadingFullImage; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index daaa117a9c..1533ccf659 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -48,7 +48,6 @@ #include "audiosettings.h" #include "llares.h" #include "llcachename.h" -#include "llcameraview.h" #include "llviewercontrol.h" #include "lldir.h" #include "llerrorcontrol.h" @@ -91,6 +90,7 @@ #include "llfeaturemanager.h" #include "llfirstuse.h" #include "llfloateractivespeakers.h" +#include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloatergesture.h" #include "llfloaterhud.h" @@ -1591,6 +1591,11 @@ BOOL idle_startup() LLFloaterMove::show(NULL); } + if (gSavedSettings.getBOOL("ShowActiveSpeakers")) + { + LLFloaterActiveSpeakers::showInstance(); + } + if (!gNoRender) { // Move the progress view in front of the UI @@ -2281,9 +2286,6 @@ BOOL idle_startup() // On first start, ask user for gender dialog_choose_gender_first_start(); - // setup voice - LLFirstUse::useVoice(); - // Start automatic replay if the flag is set. if (gSavedSettings.getBOOL("StatsAutoRun")) { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 16ab3c0944..315136ed36 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -194,8 +194,12 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) // nothing break; case CLICK_ACTION_SIT: - handle_sit_or_stand(); - return TRUE; + if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // agent not already sitting + { + handle_sit_or_stand(); + return TRUE; + } // else nothing (fall through to touch) + case CLICK_ACTION_PAY: if (object && object->flagTakesMoney() || parent && parent->flagTakesMoney()) @@ -436,7 +440,10 @@ ECursorType cursor_from_object(LLViewerObject* object) switch(click_action) { case CLICK_ACTION_SIT: - cursor = UI_CURSOR_TOOLSIT; + if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting? + { + cursor = UI_CURSOR_TOOLSIT; + } break; case CLICK_ACTION_BUY: cursor = UI_CURSOR_TOOLBUY; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a1181ccf3a..f4cf31273f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -92,6 +92,7 @@ #include "llfloaterbuycontents.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" +#include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" #include "llfloaterdaycycle.h" diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index afd1e48921..4068933fe1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -76,7 +76,6 @@ #include "llagent.h" #include "llalertdialog.h" #include "llbox.h" -#include "llcameraview.h" #include "llchatbar.h" #include "llconsole.h" #include "llviewercontrol.h" @@ -95,6 +94,7 @@ #include "llfloateractivespeakers.h" #include "llfloaterbuildoptions.h" #include "llfloaterbuyland.h" +#include "llfloatercamera.h" #include "llfloaterchat.h" #include "llfloaterchatterbox.h" #include "llfloatercustomize.h" @@ -1750,6 +1750,19 @@ void adjust_rect_top_left(const LLString& control, const LLRect& window) } } +void adjust_rect_top_center(const LLString& control, const LLRect& window) +{ + LLRect r = gSavedSettings.getRect(control); + if (r.mLeft == 0 && r.mBottom == 0) + { + r.setLeftTopAndSize( window.getWidth()/2 - r.getWidth()/2, + window.getHeight(), + r.getWidth(), + r.getHeight() ); + gSavedSettings.setRect(control, r); + } +} + void adjust_rect_top_right(const LLString& control, const LLRect& window) { LLRect r = gSavedSettings.getRect(control); @@ -1808,7 +1821,7 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) adjust_rect_bottom_center("FloaterMoveRect2", window); - adjust_rect_bottom_center("FloaterCameraRect2", window); + adjust_rect_top_center("FloaterCameraRect3", window); adjust_rect_top_left("FloaterCustomizeAppearanceRect", window); diff --git a/indra/newview/macview_Prefix.h b/indra/newview/macview_Prefix.h index eb394dc557..ac19cd924e 100644 --- a/indra/newview/macview_Prefix.h +++ b/indra/newview/macview_Prefix.h @@ -58,7 +58,6 @@ #include "llbox.h" #include "llbutton.h" -#include "llcameraview.h" #include "llconsole.h" #include "lldrawable.h" #include "llfirstuse.h" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 71509f50f5..e73d278043 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -127,26 +127,6 @@ class ViewerManifest(LLManifest): return " ".join((channel_flags, grid_flags)).strip() - def login_url(self): - """ Convenience function that returns the appropriate login url for the grid""" - if(self.args.get('login_url')): - return self.args['login_url'] - else: - if(self.default_grid()): - if(self.default_channel()): - # agni release - return 'http://secondlife.com/app/login/' - else: - # first look (or other) on agni - return 'http://secondlife.com/app/login/%s/' % self.channel_lowerword() - else: - # beta grid - return 'http://secondlife.com/app/login/beta/' - - def replace_login_url(self): - # set the login page to point to a url appropriate for the type of client - self.replace_in("skins/xui/en-us/panel_login.xml", searchdict={'http://secondlife.com/app/login/':self.login_url()}) - class WindowsManifest(ViewerManifest): def final_exe(self): @@ -229,7 +209,6 @@ class WindowsManifest(ViewerManifest): # pull in the crash logger and updater from other projects self.path(src="../win_crash_logger/win_crash_logger.exe", dst="win_crash_logger.exe") self.path(src="../win_updater/updater.exe", dst="updater.exe") - self.replace_login_url() def nsi_file_commands(self, install=True): def wpath(path): @@ -387,9 +366,6 @@ class DarwinManifest(ViewerManifest): # command line arguments for connecting to the proper grid self.put_in_file(self.flags_list(), 'arguments.txt') - # set the proper login url - self.replace_login_url() - self.end_prefix("Resources") self.end_prefix("Contents") @@ -471,8 +447,6 @@ class LinuxManifest(ViewerManifest): # Create an appropriate gridargs.dat for this package, denoting required grid. self.put_in_file(self.flags_list(), 'gridargs.dat') - # set proper login url - self.replace_login_url() # stripping all the libs removes a few megabytes from the end-user package for s,d in self.file_list: |