From e1105245371e7c34c1be7a772906d3c2f6ca258d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 14 Jan 2010 14:30:40 +0000 Subject: EXT-4233: Don't show help button on tear-off floaters. The script error floater may be the only floater left that uses the old-style tearoff functionality, but at least it should behave a little better now in terms of help "?" buttons. --- indra/llui/llfloater.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a35d279500..a17e306325 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1067,10 +1067,6 @@ void LLFloater::setMinimized(BOOL minimize) reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } - // don't show the help button while minimized - it's - // not very useful when minimized and uses up space - mButtonsEnabled[BUTTON_HELP] = !minimize; - applyTitle (); make_ui_sound("UISndWindowClose"); @@ -1743,14 +1739,32 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { - if(!mButtons[i]) continue; - mButtons[i]->setEnabled(mButtonsEnabled[i]); + if (!mButtons[i]) + { + continue; + } - if (mButtonsEnabled[i] - //*HACK: always render close button for hosted floaters - // so that users don't accidentally hit the button when closing multiple windows - // in the chatterbox - || (i == BUTTON_CLOSE && mButtonScale != 1.f)) + bool enabled = mButtonsEnabled[i]; + if (i == BUTTON_HELP) + { + // don't show the help button if the floater is minimized + // or if it is a tear-off hosted floater + if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF]) + { + enabled = false; + } + } + if (i == BUTTON_CLOSE && mButtonScale != 1.f) + { + //*HACK: always render close button for hosted floaters so + //that users don't accidentally hit the button when + //closing multiple windows in the chatterbox + enabled = true; + } + + mButtons[i]->setEnabled(enabled); + + if (enabled) { button_count++; @@ -1777,7 +1791,7 @@ void LLFloater::updateButtons() // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); } - else if (mButtons[i]) + else { mButtons[i]->setVisible(FALSE); } -- cgit v1.2.3 From c6108f0fadd54a60c8bbeecb3f3604073a934c73 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 15 Jan 2010 11:07:37 +0000 Subject: EXT-4125: Regexes hurt my head! Updated the regex to match a free URL in plain text with no http: protocol. This now explicitly does not match e-mail addresses, such as test@lindenlab.com (yay negative lookbehind regexes). It additionally matches URLs with a port or path after it, e.g., secondlife.com/status. I've added a bunch more unit tests to asset positive and negative matches for this regex, because no human can do this in their head. --- indra/llui/llurlentry.cpp | 2 +- indra/llui/tests/llurlentry_test.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 1b6dd1b264..4927e57a52 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -204,7 +204,7 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() mPattern = boost::regex("(" "\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR "|" // or - "\\b[^ \\t\\n\\r\\f\\v:/]+\\.(?:com|net|edu|org)[^[:space:][:alnum:]]*\\>" // i.e. FOO.net + "(? Date: Fri, 15 Jan 2010 12:37:56 +0000 Subject: EXT-4233: Display "?" button on torn-off floaters. This involved tracking the torn-off state of a floater, which we apparently weren't doing before. Also, making sure that we update the title bar buttons when the floater changes torn-off state. --- indra/llui/llfloater.cpp | 6 ++++-- indra/llui/llfloater.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a17e306325..980cd2abd7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -233,6 +233,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mAutoFocus(TRUE), // automatically take focus when opened mCanDock(false), mDocked(false), + mTornOff(false), mHasBeenDraggedWhileMinimized(FALSE), mPreviousMinimizedBottom(0), mPreviousMinimizedLeft(0) @@ -1456,6 +1457,7 @@ void LLFloater::onClickTearOff(LLFloater* self) } self->setTornOff(false); } + self->updateButtons(); } // static @@ -1748,8 +1750,8 @@ void LLFloater::updateButtons() if (i == BUTTON_HELP) { // don't show the help button if the floater is minimized - // or if it is a tear-off hosted floater - if (isMinimized() || mButtonsEnabled[BUTTON_TEAR_OFF]) + // or if it is a docked tear-off floater + if (isMinimized() || (mButtonsEnabled[BUTTON_TEAR_OFF] && ! mTornOff)) { enabled = false; } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index daf558de24..f70495c0f0 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -256,7 +256,7 @@ public: bool isDocked() const { return mDocked; } virtual void setDocked(bool docked, bool pop_on_undock = true); - virtual void setTornOff(bool torn_off) {} + virtual void setTornOff(bool torn_off) { mTornOff = torn_off; } // Return a closeable floater, if any, given the current focus. static LLFloater* getClosableFloaterFromFocus(); @@ -387,6 +387,7 @@ private: bool mCanDock; bool mDocked; + bool mTornOff; static LLMultiFloater* sHostp; static BOOL sQuitting; -- cgit v1.2.3 From 5c09d482a47a8894ebebc9d3c8053b25a280f58e Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 15 Jan 2010 18:01:31 +0000 Subject: EXT-4148 EXT-4230: Lots of help ID updates. Updated the logic of the help ID detection to search sub-panels before searching active tabs. For some reason, certain tabs are still visible and active even though they are not being displayed on screen. I also removed a bunch of help IDs for button panels that just confuse things. Also went through all of the side panel tabs and added new help IDs where appropriate. These are: profile_classified_info profile_edit_classified profile_pick_info profile_edit_pick my_inventory_tab recent_inventory_tab --- indra/llui/lluictrl.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index f016c0af89..3ade46d367 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -868,14 +868,6 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) if (panel) { - // does the panel have an active tab with a help topic? - LLPanel *tab = panel->childGetVisibleTabWithHelp(); - if (tab) - { - help_topic_out = tab->getHelpTopic(); - return true; // success (tab) - } - // does the panel have a sub-panel with a help topic? LLPanel *subpanel = panel->childGetVisiblePanelWithHelp(); if (subpanel) @@ -884,6 +876,14 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) return true; // success (subpanel) } + // does the panel have an active tab with a help topic? + LLPanel *tab = panel->childGetVisibleTabWithHelp(); + if (tab) + { + help_topic_out = tab->getHelpTopic(); + return true; // success (tab) + } + // otherwise, does the panel have a help topic itself? if (!panel->getHelpTopic().empty()) { -- cgit v1.2.3