diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 15:57:31 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 15:57:31 -0800 |
commit | 0b4b03fe3e92f0991b8145a2ba8267a20ce53581 (patch) | |
tree | adef5f205fd2ba632c1e6db79d575b1c3ceb081d /indra/llui | |
parent | 374aa101ab0296d9bed3e7c592e4820930042f6e (diff) | |
parent | c3a82913deb9b23ef1f22b6d002893b36146553a (diff) |
Merge from product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llflatlistview.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llflatlistview.h | 2 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llfloater.h | 3 | ||||
-rw-r--r-- | indra/llui/llnotificationsutil.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llnotificationsutil.h | 2 | ||||
-rw-r--r-- | indra/llui/llurlentry.cpp | 26 | ||||
-rw-r--r-- | indra/llui/llurlregistry.cpp | 4 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llview.h | 11 |
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¶m2=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(); |