summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-02-25 00:17:42 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-02-25 00:17:42 -0800
commit0bf246ed663ad11d316fe7898a3fee3f57676d4b (patch)
tree20476d64aecbb1b644ea1f307264c222b7d2e6f6 /indra/llui
parentc2ca71322bf48653d466cba40bbe01c3401318c7 (diff)
parent109b79e9ad67b5fa8967442a47ef15e456eb5bff (diff)
Automated merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp40
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/llui/lluictrl.cpp16
-rw-r--r--indra/llui/llurlentry.cpp2
-rw-r--r--indra/llui/tests/llurlentry_test.cpp20
5 files changed, 59 insertions, 22 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a35d279500..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)
@@ -1067,10 +1068,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");
@@ -1460,6 +1457,7 @@ void LLFloater::onClickTearOff(LLFloater* self)
}
self->setTornOff(false);
}
+ self->updateButtons();
}
// static
@@ -1743,14 +1741,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 docked tear-off floater
+ if (isMinimized() || (mButtonsEnabled[BUTTON_TEAR_OFF] && ! mTornOff))
+ {
+ 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 +1793,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);
}
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;
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())
{
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 466ac2a7d1..366f59d677 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -207,7 +207,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
+ "(?<!@)\\b[^[:space:]:@/]+\\.(?:com|net|edu|org)([/:]\\S*)?\\b" // i.e. FOO.net
")",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 1d66bc268b..94f4969037 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -595,6 +595,26 @@ namespace tut
"MIT web site is at web.mit.edu and also www.mit.edu",
"web.mit.edu");
+ testRegex("don't match e-mail addresses", r,
+ "test@lindenlab.com",
+ "");
+
+ testRegex(".com URL with path", r,
+ "see secondlife.com/status for grid status",
+ "secondlife.com/status");
+
+ testRegex(".com URL with port", r,
+ "secondlife.com:80",
+ "secondlife.com:80");
+
+ testRegex(".com URL with port and path", r,
+ "see secondlife.com:80/status",
+ "secondlife.com:80/status");
+
+ testRegex("www.*.com URL with port and path", r,
+ "see www.secondlife.com:80/status",
+ "www.secondlife.com:80/status");
+
testRegex("invalid .com URL [1]", r,
"..com",
"");