summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-08 16:20:25 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-08 16:20:25 -0500
commit45b24808657dddfb2a605186416409b453f149e7 (patch)
tree298c49cfd6fb4f645a3a776a75b9bb64601bf9c3 /indra/llui
parent7ce49586881fd078ea8bceeab558b4a156b30f63 (diff)
parent37848d29d9030e00086c3a499d28237cdf943e1b (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llflatlistview.cpp5
-rw-r--r--indra/llui/llflatlistview.h2
-rw-r--r--indra/llui/llfloater.cpp12
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/llui/llnotificationsutil.cpp5
-rw-r--r--indra/llui/llnotificationsutil.h2
-rw-r--r--indra/llui/llurlentry.cpp26
-rw-r--r--indra/llui/llurlregistry.cpp4
-rw-r--r--indra/llui/llview.cpp11
-rw-r--r--indra/llui/llview.h11
10 files changed, 37 insertions, 44 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index d4c3cfb7b6..831ac66d06 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -932,7 +932,7 @@ void LLFlatListView::onFocusLost()
}
//virtual
-void LLFlatListView::notify(const LLSD& info)
+S32 LLFlatListView::notify(const LLSD& info)
{
if(info.has("action"))
{
@@ -941,13 +941,16 @@ void LLFlatListView::notify(const LLSD& info)
{
setFocus(true);
selectFirstItem();
+ return 1;
}
else if(str_action == "select_last")
{
setFocus(true);
selectLastItem();
+ return 1;
}
}
+ return 0;
}
//EOF
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 9e1e0f90fc..ba824ff2df 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -283,7 +283,7 @@ public:
void selectFirstItem ();
void selectLastItem ();
- virtual void notify(const LLSD& info) ;
+ virtual S32 notify(const LLSD& info) ;
protected:
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a63187678e..fd7b64af02 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -74,7 +74,6 @@ std::string LLFloater::sButtonNames[BUTTON_COUNT] =
"llfloater_minimize_btn", //BUTTON_MINIMIZE
"llfloater_tear_off_btn", //BUTTON_TEAR_OFF
"llfloater_dock_btn", //BUTTON_DOCK
- "llfloater_undock_btn", //BUTTON_UNDOCK
"llfloater_help_btn" //BUTTON_HELP
};
@@ -91,7 +90,6 @@ std::string LLFloater::sButtonToolTipsIndex[BUTTON_COUNT]=
"BUTTON_MINIMIZE", //"Minimize", //BUTTON_MINIMIZE
"BUTTON_TEAR_OFF", //"Tear Off", //BUTTON_TEAR_OFF
"BUTTON_DOCK",
- "BUTTON_UNDOCK",
"BUTTON_HELP"
};
@@ -102,7 +100,6 @@ LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] =
LLFloater::onClickMinimize, //BUTTON_MINIMIZE
LLFloater::onClickTearOff, //BUTTON_TEAR_OFF
LLFloater::onClickDock, //BUTTON_DOCK
- LLFloater::onClickDock, //BUTTON_UNDOCK
LLFloater::onClickHelp //BUTTON_HELP
};
@@ -179,14 +176,12 @@ LLFloater::Params::Params()
minimize_image("minimize_image"),
tear_off_image("tear_off_image"),
dock_image("dock_image"),
- undock_image("undock_image"),
help_image("help_image"),
close_pressed_image("close_pressed_image"),
restore_pressed_image("restore_pressed_image"),
minimize_pressed_image("minimize_pressed_image"),
tear_off_pressed_image("tear_off_pressed_image"),
dock_pressed_image("dock_pressed_image"),
- undock_pressed_image("undock_pressed_image"),
help_pressed_image("help_pressed_image"),
open_callback("open_callback"),
close_callback("close_callback")
@@ -1395,12 +1390,10 @@ void LLFloater::setCanDock(bool b)
if(mCanDock)
{
mButtonsEnabled[BUTTON_DOCK] = !mDocked;
- mButtonsEnabled[BUTTON_UNDOCK] = mDocked;
}
else
{
mButtonsEnabled[BUTTON_DOCK] = FALSE;
- mButtonsEnabled[BUTTON_UNDOCK] = FALSE;
}
}
updateButtons();
@@ -1412,7 +1405,6 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)
{
mDocked = docked;
mButtonsEnabled[BUTTON_DOCK] = !mDocked;
- mButtonsEnabled[BUTTON_UNDOCK] = mDocked;
updateButtons();
storeDockStateControl();
@@ -1864,8 +1856,6 @@ LLUIImage* LLFloater::getButtonImage(const Params& p, EFloaterButton e)
return p.tear_off_image;
case BUTTON_DOCK:
return p.dock_image;
- case BUTTON_UNDOCK:
- return p.undock_image;
case BUTTON_HELP:
return p.help_image;
}
@@ -1887,8 +1877,6 @@ LLUIImage* LLFloater::getButtonPressedImage(const Params& p, EFloaterButton e)
return p.tear_off_pressed_image;
case BUTTON_DOCK:
return p.dock_pressed_image;
- case BUTTON_UNDOCK:
- return p.undock_pressed_image;
case BUTTON_HELP:
return p.help_pressed_image;
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index b5c835cb47..daf558de24 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -90,7 +90,6 @@ public:
BUTTON_MINIMIZE,
BUTTON_TEAR_OFF,
BUTTON_DOCK,
- BUTTON_UNDOCK,
BUTTON_HELP,
BUTTON_COUNT
};
@@ -121,14 +120,12 @@ public:
minimize_image,
tear_off_image,
dock_image,
- undock_image,
help_image;
Optional<LLUIImage*> close_pressed_image,
restore_pressed_image,
minimize_pressed_image,
tear_off_pressed_image,
dock_pressed_image,
- undock_pressed_image,
help_pressed_image;
Optional<CommitCallbackParam> open_callback,
diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp
index 2cd165f1b3..f343d27cb4 100644
--- a/indra/llui/llnotificationsutil.cpp
+++ b/indra/llui/llnotificationsutil.cpp
@@ -89,3 +89,8 @@ S32 LLNotificationsUtil::getSelectedOption(const LLSD& notification, const LLSD&
{
return LLNotification::getSelectedOption(notification, response);
}
+
+void LLNotificationsUtil::cancel(LLNotificationPtr pNotif)
+{
+ LLNotifications::instance().cancel(pNotif);
+}
diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h
index a0801b338f..d552fa915b 100644
--- a/indra/llui/llnotificationsutil.h
+++ b/indra/llui/llnotificationsutil.h
@@ -63,6 +63,8 @@ namespace LLNotificationsUtil
boost::function<void (const LLSD&, const LLSD&)> functor);
S32 getSelectedOption(const LLSD& notification, const LLSD& response);
+
+ void cancel(LLNotificationPtr pNotif);
}
#endif
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index b51709e208..7694d02837 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -386,36 +386,24 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa
//
// LLUrlEntryInventory Describes a Second Life inventory Url, e.g.,
-// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select
+// secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select
//
LLUrlEntryInventory::LLUrlEntryInventory()
{
- mPattern = boost::regex("secondlife:///app/inventory/[\\da-f-]+/\\w+",
+ //*TODO: add supporting of inventory item names with whitespaces
+ //this pattern cann't parse for example
+ //secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select?name=name with spaces&param2=value
+ mPattern = boost::regex("secondlife:///app/inventory/[\\da-f-]+/\\w+\\S*",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_inventory.xml";
}
std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
- return unescapeUrl(url);
- // TODO: Figure out if we can somehow access the inventory from here to get the actual item name
- /*
- std::string inventory_id_string = getIDStringFromUrl(url);
- if (inventory_id_string.empty())
- {
- // something went wrong, give raw url
- return unescapeUrl(url);
- }
- LLUUID inventory_id(inventory_id_string);
- LLInventoryItem* item = gInventory.getItem(inventory_id);
- if(!item)
- {
- return unescapeUrl(url);
- }
- return item->getName(); */
+ std::string label = getStringAfterToken(url, "name=");
+ return LLURI::unescape(label.empty() ? url : label);
}
-
///
/// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,
/// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index b2f084e5ac..f47db2db1a 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -53,9 +53,11 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryTeleport());
registerUrl(new LLUrlEntryWorldMap());
registerUrl(new LLUrlEntryPlace());
+ registerUrl(new LLUrlEntryInventory());
+ //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,
+ //so it should be registered in the end of list
registerUrl(new LLUrlEntrySL());
registerUrl(new LLUrlEntrySLLabel());
- registerUrl(new LLUrlEntryInventory());
}
LLUrlRegistry::~LLUrlRegistry()
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 6f8455774d..8917e4b813 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2850,18 +2850,21 @@ LLView::default_widget_map_t& LLView::getDefaultWidgetMap() const
return *mDefaultWidgets;
}
-void LLView::notifyParent(const LLSD& info)
+S32 LLView::notifyParent(const LLSD& info)
{
LLView* parent = getParent();
if(parent)
- parent->notifyParent(info);
+ return parent->notifyParent(info);
+ return 0;
}
-void LLView::notifyChildren(const LLSD& info)
+bool LLView::notifyChildren(const LLSD& info)
{
+ bool ret = false;
for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
- (*child_it)->notifyChildren(info);
+ ret |= (*child_it)->notifyChildren(info);
}
+ return ret;
}
// convenient accessor for draw context
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index c611e4c85f..f8460f5361 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -511,10 +511,15 @@ public:
virtual void handleReshape(const LLRect& rect, bool by_user);
virtual void dirtyRect();
- virtual void notifyParent(const LLSD& info);
- virtual void notifyChildren(const LLSD& info);
+ //send custom notification to LLView parent
+ virtual S32 notifyParent(const LLSD& info);
- virtual void notify(const LLSD& info) {};
+ //send custom notification to all view childrend
+ // return true if _any_ children return true. otherwise false.
+ virtual bool notifyChildren(const LLSD& info);
+
+ //send custom notification to current view
+ virtual S32 notify(const LLSD& info) { return 0;};
static const LLViewDrawContext& getDrawContext();