From eeb1970f79d34de3c8d531ae7d7da52d30246c36 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 3 Dec 2009 11:57:58 +0200 Subject: fixed normal bug EXT-3038 (Verb buttons in avatar profile panel don't have tool-tips) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_my_profile.xml | 2 ++ indra/newview/skins/default/xui/en/panel_picks.xml | 3 +++ 2 files changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index fe3e010cf9..3c87331199 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -416,6 +416,7 @@ left="10" label="Edit Profile" name="edit_profile_btn" + tool_tip="Edit your personal information" width="130" /> Date: Fri, 4 Dec 2009 14:00:52 +0200 Subject: Work on normal task EXT-3081 (Separate Message Well on Notifications Well and IM Well) -- removed member pointer to Notification Well Icon from the LLBottomTray -- placed Well counter over the Icon, made center-aligned --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 9 ++++++--- indra/newview/llbottomtray.h | 2 -- indra/newview/llsyswellwindow.cpp | 4 +++- indra/newview/skins/default/xui/en/panel_bottomtray.xml | 16 ++++++++-------- 4 files changed, 17 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index d80aa66257..8c793873f4 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -54,21 +54,24 @@ template class LLBottomTray* LLSingleton::getInstance(); LLBottomTray::LLBottomTray(const LLSD&) : mChicletPanel(NULL), - mNotificationWell(NULL), mSpeakPanel(NULL), mSpeakBtn(NULL), mNearbyChatBar(NULL), mToolbarStack(NULL) , mMovementButton(NULL) , mResizeState(RS_NORESIZE) -// Add more members +, mBottomTrayContextMenu(NULL) +, mMovementPanel(NULL) +, mCamPanel(NULL) +, mSnapshotPanel(NULL) +, mGesturePanel(NULL) +, mCamButton(NULL) { mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); LLUICtrlFactory::getInstance()->buildPanel(this,"panel_bottomtray.xml"); mChicletPanel = getChild("chiclet_list"); - mNotificationWell = getChild("notification_well"); mChicletPanel->setChicletClickedCallback(boost::bind(&LLBottomTray::onChicletClick,this,_1)); diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index a86f7846e3..fa204ee9ea 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -66,7 +66,6 @@ public: BOOL postBuild(); LLChicletPanel* getChicletPanel() {return mChicletPanel;} - LLNotificationChiclet* getSysWell() {return mNotificationWell;} LLNearbyChatBar* getNearbyChatBar() {return mNearbyChatBar;} void onCommitGesture(LLUICtrl* ctrl); @@ -189,7 +188,6 @@ protected: LLIMChiclet* createIMChiclet(const LLUUID& session_id); LLChicletPanel* mChicletPanel; - LLNotificationChiclet* mNotificationWell; LLPanel* mSpeakPanel; LLSpeakButton* mSpeakBtn; LLNearbyChatBar* mNearbyChatBar; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 6b7c4049f4..a64c200b92 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -46,6 +46,8 @@ #include "llnotificationmanager.h" +static std::string NOTIFICATION_WELL_ANCHOR_NAME = "notification_well_panel"; + //--------------------------------------------------------------------------------- LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key), mChannel(NULL), @@ -251,7 +253,7 @@ void LLSysWellWindow::setVisible(BOOL visible) if (NULL == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getSysWell(), this, + LLBottomTray::getInstance()->getChild(NOTIFICATION_WELL_ANCHOR_NAME), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLSysWellWindow::getAllowedRect, this, _1))); } diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 621dbdec61..2796b4a1f7 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -320,8 +320,8 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. min_height="28" top="0" name="notification_well_panel" - width="54" - min_width="54" + width="34" + min_width="34" user_resize="false"> + width="34"> + + - Date: Fri, 4 Dec 2009 18:33:13 +0200 Subject: =?UTF-8?q?implemented=20EXT-700=20=E2=80=9C"Offer"=20notification?= =?UTF-8?q?s=20should=20be=20accessible=20via=20chiclet=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llnotificationhandler.h | 5 +++++ indra/newview/llnotificationhandlerutil.cpp | 13 ++++++++++++- indra/newview/llnotificationofferhandler.cpp | 21 +++++++++++++++++++++ indra/newview/llviewermessage.cpp | 8 ++++++-- .../newview/skins/default/xui/en/notifications.xml | 4 ++-- 5 files changed, 46 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llnotificationhandler.h b/indra/newview/llnotificationhandler.h index da8928321a..5c240aa54a 100644 --- a/indra/newview/llnotificationhandler.h +++ b/indra/newview/llnotificationhandler.h @@ -265,6 +265,11 @@ public: */ static bool canLogToIM(const LLNotificationPtr& notification); + /** + * Checks sufficient conditions to spawn IM session. + */ + static bool canSpawnIMSession(const LLNotificationPtr& notification); + /** * Writes notification message to IM session. */ diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 857b7e9796..0fbc6575e8 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -43,7 +43,10 @@ using namespace LLNotificationsUI; const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM( "ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER( - "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"); + "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"), + ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), + USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"), + FRIENDSHIP_ACCEPTED("FriendshipAccepted"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) @@ -53,6 +56,14 @@ bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) || PAYMENT_RECIVED == notification->getName(); } +// static +bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification) +{ + return ADD_FRIEND_WITH_MESSAGE == notification->getName() + || OFFER_FRIENDSHIP == notification->getName() + || FRIENDSHIP_ACCEPTED == notification->getName(); +} + // static void LLHandlerUtil::logToIM(const EInstantMessage& session_type, const std::string& session_name, const std::string& from_name, diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 4f353bf6a5..b7f95ae2fa 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -40,6 +40,7 @@ #include "llnotificationmanager.h" #include "llnotifications.h" #include "llscriptfloater.h" +#include "llimview.h" using namespace LLNotificationsUI; @@ -101,6 +102,26 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } else { + if (LLHandlerUtil::canSpawnIMSession(notification)) + { + const std::string name = notification->getSubstitutions().has( + "NAME") ? notification->getSubstitutions()["NAME"] + : notification->getSubstitutions()["[NAME]"]; + + LLUUID from_id = notification->getPayload()["from_id"]; + + LLUUID session_id = LLIMMgr::computeSessionID( + IM_NOTHING_SPECIAL, from_id); + + LLIMModel::LLIMSession* session = + LLIMModel::instance().findIMSession(session_id); + if (session == NULL) + { + LLIMMgr::instance().addSession(name, IM_NOTHING_SPECIAL, + from_id); + } + } + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); LLToast::Params p; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 76cc9bf335..c44cebe877 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2074,13 +2074,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { args["NAME"] = name; - LLNotificationsUtil::add("InventoryAccepted", args); + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("InventoryAccepted", args, payload); break; } case IM_INVENTORY_DECLINED: { args["NAME"] = name; - LLNotificationsUtil::add("InventoryDeclined", args); + LLSD payload; + payload["from_id"] = from_id; + LLNotificationsUtil::add("InventoryDeclined", args, payload); break; } // TODO: _DEPRECATED suffix as part of vote removal - DEV-24856 diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f48cc6d4bf..0d7351395a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4499,14 +4499,14 @@ You don't have permission to copy this. + type="offer"> [NAME] received your inventory offer. + type="offer"> [NAME] declined your inventory offer. -- cgit v1.2.3 From 6d8fd3114349b9efa14d39fab5c77b886b6eda1b Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 4 Dec 2009 18:09:29 +0200 Subject: Implemented normal priority task EXT-2311 (Filter in side panels should highlight results). Added missing highlighting to people/group lists and teleport history. Btw, the "none" group list entry now gets hidden when user types a filter. --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llavatarlist.cpp | 11 ++++++++++- indra/newview/llavatarlistitem.cpp | 29 ++++++++++++++++++----------- indra/newview/llavatarlistitem.h | 5 +++++ indra/newview/llgrouplist.cpp | 26 +++++++++++++------------- indra/newview/llgrouplist.h | 6 ++++-- indra/newview/llpanelteleporthistory.cpp | 18 +++++++++++------- 7 files changed, 63 insertions(+), 34 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dd3fc10fa2..61aecdbfb6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -410,6 +410,7 @@ set(viewer_SOURCE_FILES lltexturestats.cpp lltexturestatsuploader.cpp lltextureview.cpp + lltextutil.cpp lltoast.cpp lltoastalertpanel.cpp lltoastgroupnotifypanel.cpp @@ -911,6 +912,7 @@ set(viewer_HEADER_FILES lltexturestats.h lltexturestatsuploader.h lltextureview.h + lltextutil.h lltoast.h lltoastalertpanel.h lltoastgroupnotifypanel.h diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 202fbdebd4..3bd4f898c8 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -262,9 +262,18 @@ void LLAvatarList::refresh() bool dirty = add_limit_exceeded || (have_filter && !have_names); setDirty(dirty); - // Refreshed all items, lets send refresh_complete signal. + // Refreshed all items. if(!dirty) { + // Highlight items matching the filter. + std::vector items; + getItems(items); + for( std::vector::const_iterator it = items.begin(); it != items.end(); it++) + { + static_cast(*it)->setHighlight(mNameFilter); + } + + // Send refresh_complete signal. std::vector cur_values; getValues(cur_values); mRefreshCompleteSignal(this, LLSD((S32)cur_values.size())); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 59ed391c06..072eebdf2d 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "lloutputmonitorctrl.h" #include "llavatariconctrl.h" +#include "lltextutil.h" #include "llbutton.h" LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) @@ -155,13 +156,8 @@ void LLAvatarListItem::setOnline(bool online) mOnlineStatus = (EOnlineStatus) online; // Change avatar name font style depending on the new online status. - LLStyle::Params style_params; - style_params.color = online ? LLColor4::white : LLColor4::grey; - - // Rebuild the text to change its style. - std::string text = mAvatarName->getText(); - mAvatarName->setText(LLStringUtil::null); - mAvatarName->appendText(text, false, style_params); + mAvatarNameStyle.color = online ? LLColor4::white : LLColor4::grey; + setNameInternal(mAvatarName->getText(), mHighlihtSubstring); // Make the icon fade if the avatar goes offline. mAvatarIcon->setColor(online ? LLColor4::white : LLColor4::smoke); @@ -169,8 +165,12 @@ void LLAvatarListItem::setOnline(bool online) void LLAvatarListItem::setName(const std::string& name) { - mAvatarName->setValue(name); - mAvatarName->setToolTip(name); + setNameInternal(name, mHighlihtSubstring); +} + +void LLAvatarListItem::setHighlight(const std::string& highlight) +{ + setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight); } void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) @@ -310,11 +310,18 @@ const std::string LLAvatarListItem::getAvatarName() const return mAvatarName->getValue(); } +//== PRIVATE SECITON ========================================================== + +void LLAvatarListItem::setNameInternal(const std::string& name, const std::string& highlight) +{ + LLTextUtil::textboxSetHighlightedVal(mAvatarName, mAvatarNameStyle, name, highlight); + mAvatarName->setToolTip(name); +} + void LLAvatarListItem::onNameCache(const std::string& first_name, const std::string& last_name) { std::string name = first_name + " " + last_name; - mAvatarName->setValue(name); - mAvatarName->setToolTip(name); + setName(name); } void LLAvatarListItem::reshapeAvatarName() diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index a7b080098d..cb015a5461 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -37,6 +37,7 @@ #include "lloutputmonitorctrl.h" #include "llbutton.h" #include "lltextbox.h" +#include "llstyle.h" #include "llcallingcard.h" // for LLFriendObserver @@ -71,6 +72,7 @@ public: void setOnline(bool online); void setName(const std::string& name); + void setHighlight(const std::string& highlight); // XXX ugly name void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly @@ -112,6 +114,7 @@ private: E_UNKNOWN, } EOnlineStatus; + void setNameInternal(const std::string& name, const std::string& highlight); void onNameCache(const std::string& first_name, const std::string& last_name); std::string formatSeconds(U32 secs); @@ -119,12 +122,14 @@ private: LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; + LLStyle::Params mAvatarNameStyle; LLButton* mInfoBtn; LLButton* mProfileBtn; ContextMenu* mContextMenu; LLUUID mAvatarId; + std::string mHighlihtSubstring; // substring to highlight EOnlineStatus mOnlineStatus; //Flag indicating that info/profile button shouldn't be shown at all. //Speaker indicator and avatar name coords are translated accordingly diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 97cf139f1d..80b706a215 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llgroupactions.h" #include "llfloaterreg.h" +#include "lltextutil.h" #include "llviewercontrol.h" // for gSavedSettings static LLDefaultChildRegistry::Register r("group_list"); @@ -133,17 +134,17 @@ void LLGroupList::refresh() const LLGroupData& group_data = gAgent.mGroups.get(i); if (have_filter && !findInsensitive(group_data.mName, mNameFilter)) continue; - addNewItem(id, group_data.mName, group_data.mInsigniaID, highlight_id == id, ADD_BOTTOM); + addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM); } // Sort the list. sort(); - // add "none" to list at top + // Add "none" to list at top if filter not set (what's the point of filtering "none"?). + if (!have_filter) { std::string loc_none = LLTrans::getString("GroupsNone"); - if (have_filter || findInsensitive(loc_none, mNameFilter)) - addNewItem(LLUUID::null, loc_none, LLUUID::null, highlight_id.isNull(), ADD_TOP); + addNewItem(LLUUID::null, loc_none, LLUUID::null, ADD_TOP); } selectItemByUUID(highlight_id); @@ -171,12 +172,12 @@ void LLGroupList::toggleIcons() // PRIVATE Section ////////////////////////////////////////////////////////////////////////// -void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, BOOL is_bold, EAddPosition pos) +void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, EAddPosition pos) { LLGroupListItem* item = new LLGroupListItem(); - item->setName(name); item->setGroupID(id); + item->setName(name, mNameFilter); item->setGroupIconID(icon_id); // item->setContextMenu(mContextMenu); @@ -267,10 +268,10 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) LLPanel::onMouseLeave(x, y, mask); } -void LLGroupListItem::setName(const std::string& name) +void LLGroupListItem::setName(const std::string& name, const std::string& highlight) { mGroupName = name; - mGroupNameBox->setValue(name); + LLTextUtil::textboxSetHighlightedVal(mGroupNameBox, mGroupNameStyle, name, highlight); mGroupNameBox->setToolTip(name); } @@ -308,6 +309,8 @@ void LLGroupListItem::setGroupIconVisible(bool visible) ////////////////////////////////////////////////////////////////////////// void LLGroupListItem::setActive(bool active) { + // *BUG: setName() overrides the style params. + // Active group should be bold. LLFontDescriptor new_desc(mGroupNameBox->getDefaultFont()->getFontDesc()); @@ -316,15 +319,12 @@ void LLGroupListItem::setActive(bool active) // is predefined as bold (SansSerifSmallBold, for example) new_desc.setStyle(active ? LLFontGL::BOLD : LLFontGL::NORMAL); LLFontGL* new_font = LLFontGL::getFont(new_desc); - LLStyle::Params style_params; - style_params.font = new_font; + mGroupNameStyle.font = new_font; // *NOTE: You cannot set the style on a text box anymore, you must // rebuild the text. This will cause problems if the text contains // hyperlinks, as their styles will be wrong. - std::string text = mGroupNameBox->getText(); - mGroupNameBox->setText(LLStringUtil::null); - mGroupNameBox->appendText(text, false, style_params); + mGroupNameBox->setText(mGroupName, mGroupNameStyle); } void LLGroupListItem::onInfoBtnClick() diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index 8dbc13997c..41b4d01711 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -37,6 +37,7 @@ #include "llflatlistview.h" #include "llpanel.h" #include "llpointer.h" +#include "llstyle.h" /** * Auto-updating list of agent groups. @@ -66,7 +67,7 @@ public: private: void setDirty(bool val = true) { mDirty = val; } void refresh(); - void addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, BOOL is_bold, EAddPosition pos = ADD_BOTTOM); + void addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, EAddPosition pos = ADD_BOTTOM); bool handleEvent(LLPointer event, const LLSD& userdata); // called on agent group list changes bool mShowIcons; @@ -90,7 +91,7 @@ public: const LLUUID& getGroupID() const { return mGroupID; } const std::string& getGroupName() const { return mGroupName; } - void setName(const std::string& name); + void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); void setGroupID(const LLUUID& group_id); void setGroupIconID(const LLUUID& group_icon_id); void setGroupIconVisible(bool visible); @@ -106,6 +107,7 @@ private: LLButton* mInfoBtn; std::string mGroupName; + LLStyle::Params mGroupNameStyle; static S32 sIconWidth; // icon width + padding }; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 523487fa14..b3e8588efc 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -38,6 +38,8 @@ #include "llsidetray.h" #include "llworldmap.h" #include "llteleporthistorystorage.h" +#include "lltextutil.h" + #include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llflatlistview.h" @@ -57,7 +59,7 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; class LLTeleportHistoryFlatItem : public LLPanel { public: - LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name); + LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, const std::string &hl); virtual ~LLTeleportHistoryFlatItem() {}; virtual BOOL postBuild(); @@ -82,13 +84,15 @@ private: S32 mIndex; std::string mRegionName; + std::string mHighlight; }; -LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name) +LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string ®ion_name, const std::string &hl) : LLPanel(), mIndex(index), mContextMenu(context_menu), - mRegionName(region_name) + mRegionName(region_name), + mHighlight(hl) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history_item.xml"); } @@ -96,8 +100,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor //virtual BOOL LLTeleportHistoryFlatItem::postBuild() { - LLTextBox *region = getChild("region"); - region->setValue(mRegionName); + LLTextUtil::textboxSetHighlightedVal(getChild("region"), LLStyle::Params(), mRegionName, mHighlight); mProfileBtn = getChild("profile_btn"); @@ -521,7 +524,7 @@ void LLTeleportHistoryPanel::refresh() if (curr_flat_view) { - LLTeleportHistoryFlatItem* item = new LLTeleportHistoryFlatItem(mCurrentItem, &mContextMenu, items[mCurrentItem].mTitle); + LLTeleportHistoryFlatItem* item = new LLTeleportHistoryFlatItem(mCurrentItem, &mContextMenu, items[mCurrentItem].mTitle, mFilterSubString); curr_flat_view->addItem(item); if (mLastSelectedItemIndex == mCurrentItem) @@ -568,7 +571,8 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index) const LLTeleportHistoryStorage::slurl_list_t& history_items = mTeleportHistory->getItems(); LLTeleportHistoryFlatItem* item = new LLTeleportHistoryFlatItem(history_items.size(), // index will be decremented inside loop below &mContextMenu, - history_items[history_items.size() - 1].mTitle); // Most recent item, it was + history_items[history_items.size() - 1].mTitle, // Most recent item, it was + mFilterSubString); // added instead of removed fv->addItem(item, LLUUID::null, ADD_TOP); -- cgit v1.2.3 From 1a7013d5cf63006ff9f4d30b21c4f369915de332 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Fri, 4 Dec 2009 19:28:27 +0200 Subject: Implemented normal task EXT-2832 (Hide "undock" icon on the floaters). --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 12 ------------ indra/llui/llfloater.h | 3 --- indra/newview/skins/default/textures/textures.xml | 3 --- indra/newview/skins/default/xui/en/strings.xml | 1 - indra/newview/skins/default/xui/en/widgets/floater.xml | 2 -- 5 files changed, 21 deletions(-) (limited to 'indra') 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 close_pressed_image, restore_pressed_image, minimize_pressed_image, tear_off_pressed_image, dock_pressed_image, - undock_pressed_image, help_pressed_image; Optional open_callback, diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index fbb910b847..771726d466 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -204,9 +204,6 @@ with the same filename but different name - - - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e47ec1ebda..194e359e10 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -88,7 +88,6 @@ Minimize Tear Off Dock - Undock Show Help diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml index 2263866471..70ee9fc3b8 100644 --- a/indra/newview/skins/default/xui/en/widgets/floater.xml +++ b/indra/newview/skins/default/xui/en/widgets/floater.xml @@ -13,13 +13,11 @@ minimize_image="Icon_Minimize_Foreground" tear_off_image="tearoffbox.tga" dock_image="Icon_Dock_Foreground" - undock_image="Icon_Undock_Foreground" help_image="Icon_Help_Foreground" close_pressed_image="Icon_Close_Press" restore_pressed_image="Icon_Restore_Press" minimize_pressed_image="Icon_Minimize_Press" tear_off_pressed_image="tearoff_pressed.tga" dock_pressed_image="Icon_Dock_Press" - undock_pressed_image="Icon_Undock_Press" help_pressed_image="Icon_Help_Press" /> -- cgit v1.2.3 From ae6911d094bcfaa730fd77f3c55c9ea5fa02b229 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Fri, 4 Dec 2009 20:01:16 +0200 Subject: No ticket. Removed check is current voice channel active when "Leave Call" button in Voice Control Panel (EXT-2986). --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index ad59c780f3..895b4ed80e 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -127,7 +127,7 @@ void LLCallFloater::onOpen(const LLSD& /*key*/) void LLCallFloater::leaveCall() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); - if (voice_channel && voice_channel->isActive()) + if (voice_channel) { voice_channel->deactivate(); } -- cgit v1.2.3 From c28fd45839b0a1924c80bc289a90e4756e677472 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Fri, 4 Dec 2009 20:46:04 +0200 Subject: omg fix for two omg crtical bugs... EXT-3109 Viewer crashes when attempting to select group role EXT-3130 Viewer crashes after pressing "New Role" button in group profile also a bit fix layout --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_group_roles.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 5bae5c2711..a5bab3232c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -367,7 +367,7 @@ things in this group. There's a broad variety of Abilities. + Date: Mon, 7 Dec 2009 13:13:11 +0200 Subject: Fixed normal bug EXT-3128 ("Ability to add friend" isn't disabled from "choose resident" ("+" btn) menu when resident is already a friend) --HG-- branch : product-engine --- indra/newview/llfloateravatarpicker.cpp | 53 +++++++++++++++++++++++++++++++-- indra/newview/llfloateravatarpicker.h | 9 +++++- indra/newview/llpanelpeople.cpp | 18 +++++++++++ indra/newview/llpanelpeople.h | 1 + 4 files changed, 78 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 07bb6f832b..6e3d5499a2 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -140,9 +140,14 @@ BOOL LLFloaterAvatarPicker::postBuild() return TRUE; } +void LLFloaterAvatarPicker::setOkBtnEnableCb(validate_callback_t cb) +{ + mOkButtonValidateSignal.connect(cb); +} + void LLFloaterAvatarPicker::onTabChanged() { - childSetEnabled("ok_btn", visibleItemsSelected()); + childSetEnabled("ok_btn", isSelectBtnEnabled()); } // Destroys the object @@ -175,6 +180,10 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; + // If select btn not enabled then do not callback + if (!self || !self->isSelectBtnEnabled()) + return; + if(self->mCallback) { std::string acvtive_panel_name; @@ -244,7 +253,7 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata; if (self) { - self->childSetEnabled("ok_btn", self->visibleItemsSelected()); + self->childSetEnabled("ok_btn", self->isSelectBtnEnabled()); } } @@ -477,3 +486,43 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) return LLFloater::handleKeyHere(key, mask); } + +bool LLFloaterAvatarPicker::isSelectBtnEnabled() +{ + bool ret_val = visibleItemsSelected(); + + if ( ret_val && mOkButtonValidateSignal.num_slots() ) + { + std::string acvtive_panel_name; + LLScrollListCtrl* list = NULL; + LLPanel* active_panel = childGetVisibleTab("ResidentChooserTabs"); + + if(active_panel) + { + acvtive_panel_name = active_panel->getName(); + } + + if(acvtive_panel_name == "SearchPanel") + { + list = getChild("SearchResults"); + } + else if(acvtive_panel_name == "NearMePanel") + { + list = getChild("NearMe"); + } + else if (acvtive_panel_name == "FriendsPanel") + { + list = getChild("Friends"); + } + + if(list) + { + std::vector avatar_ids; + std::vector avatar_names; + getSelectedAvatarData(list, avatar_names, avatar_ids); + return mOkButtonValidateSignal(avatar_ids); + } + } + + return ret_val; +} diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index b8ace985d9..13e491834e 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -40,6 +40,9 @@ class LLFloaterAvatarPicker : public LLFloater { public: + typedef boost::signals2::signal&), boost_boolean_combiner> validate_signal_t; + typedef validate_signal_t::slot_type validate_callback_t; + // Call this to select an avatar. // The callback function will be called with an avatar name and UUID. typedef void(*callback_t)(const std::vector&, const std::vector&, void*); @@ -53,6 +56,8 @@ public: virtual BOOL postBuild(); + void setOkBtnEnableCb(validate_callback_t cb); + static void processAvatarPickerReply(class LLMessageSystem* msg, void**); private: @@ -65,7 +70,8 @@ private: static void onBtnClose(void* userdata); static void onList(class LLUICtrl* ctrl, void* userdata); void onTabChanged(); - + bool isSelectBtnEnabled(); + void populateNearMe(); void populateFriend(); BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. @@ -83,6 +89,7 @@ private: void (*mCallback)(const std::vector& name, const std::vector& id, void* userdata); void* mCallbackUserdata; + validate_signal_t mOkButtonValidateSignal; }; #endif diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9c7e3952f5..1e4682701e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1003,10 +1003,28 @@ void LLPanelPeople::onAddFriendButtonClicked() } } +bool LLPanelPeople::isItemsFreeOfFriends(const std::vector& uuids) +{ + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + for ( std::vector::const_iterator + id = uuids.begin(), + id_end = uuids.end(); + id != id_end; ++id ) + { + if (av_tracker.isBuddy (*id)) + { + return false; + } + } + return true; +} + void LLPanelPeople::onAddFriendWizButtonClicked() { // Show add friend wizard. LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE); + // Need to disable 'ok' button when friend occurs in selection + if (picker) picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1)); LLFloater* root_floater = gFloaterView->getParentFloater(this); if (root_floater) { diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index bd1b155947..a9cc6d0ccb 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -72,6 +72,7 @@ private: void updateRecentList(); bool isFriendOnline(const LLUUID& id); + bool isItemsFreeOfFriends(const std::vector& uuids); void updateButtons(); std::string getActiveTabName() const; -- cgit v1.2.3 From d53bee8b6e2077ffb16e63746c51d11e58912e9c Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 7 Dec 2009 14:29:36 +0200 Subject: Fixed low bug EXT-3023('Edit' in Pick Info does nothing after saving changes to pick) --HG-- branch : product-engine --- indra/newview/llpanelpicks.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index cc6e88a9d2..59a68bc12d 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -161,6 +161,9 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) std::string name, second_name; gCacheName->getName(getAvatarId(),name,second_name); childSetTextArg("pick_title", "[NAME]",name); + + // Save selection, to be able to edit same item after saving changes. See EXT-3023. + LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID]; mPicksList->clear(); @@ -186,6 +189,10 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) mPicksList->addItem(picture, pick_value); + // Restore selection by item id. + if ( pick_id == selected_id ) + mPicksList->selectItemByValue(pick_value); + picture->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickPickItem, this, _1)); picture->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); picture->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); -- cgit v1.2.3 From cf24b4062396eab77a4424e050d6fb7de28f5bdb Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Fri, 4 Dec 2009 21:56:12 +0200 Subject: Fixed major bug EXT-3094 "Content of accordions disappears after collapsing all folders in My "Landmarks" tab and switching to "Teleport history" tab and back" - Fixed applying filter to Teleport History tab in Places panel. --HG-- branch : product-engine --- indra/newview/llpanelteleporthistory.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index b3e8588efc..43f80f6d6a 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -319,11 +319,8 @@ void LLTeleportHistoryPanel::draw() // virtual void LLTeleportHistoryPanel::onSearchEdit(const std::string& string) { - if (sFilterSubString != string) - { - sFilterSubString = string; - showTeleportHistory(); - } + sFilterSubString = string; + showTeleportHistory(); } // virtual -- cgit v1.2.3 From c6177836ecbe95f75d79f572303a879bf37b3226 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 7 Dec 2009 12:04:27 +0200 Subject: no ticket, minor refactoring. add return value to notifyXXX functions, may be usefull --HG-- branch : product-engine --- indra/llui/llflatlistview.cpp | 5 ++++- indra/llui/llflatlistview.h | 2 +- indra/llui/llview.cpp | 11 +++++++---- indra/llui/llview.h | 11 ++++++++--- indra/newview/llpanelme.cpp | 6 +++--- indra/newview/llpanelme.h | 2 +- indra/newview/llpanelpeople.cpp | 8 ++++---- indra/newview/llpanelpeople.h | 2 +- indra/newview/llpanelprofile.cpp | 6 +++--- indra/newview/llpanelprofile.h | 2 +- 10 files changed, 33 insertions(+), 22 deletions(-) (limited to 'indra') 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/llview.cpp b/indra/llui/llview.cpp index 23e4131e6d..d8ebe15dc0 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2848,18 +2848,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(); diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 046118cf75..4e21268a8a 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -71,7 +71,7 @@ void LLPanelMe::onOpen(const LLSD& key) LLPanelProfile::onOpen(key); } -void LLPanelMe::notifyChildren(const LLSD& info) +bool LLPanelMe::notifyChildren(const LLSD& info) { if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") { @@ -104,10 +104,10 @@ void LLPanelMe::notifyChildren(const LLSD& info) if (on_default_view) LLSideTray::getInstance()->collapseSideBar(); - return; // this notification is only supposed to be handled by task panels + return true; // this notification is only supposed to be handled by task panels } - LLPanel::notifyChildren(info); + return LLPanel::notifyChildren(info); } void LLPanelMe::buildEditPanel() diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h index 17d367132e..1325192bbf 100644 --- a/indra/newview/llpanelme.h +++ b/indra/newview/llpanelme.h @@ -54,7 +54,7 @@ public: LLPanelMe(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void notifyChildren(const LLSD& info); + /*virtual*/ bool notifyChildren(const LLSD& info); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 1743df52fc..9c7e3952f5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1284,7 +1284,7 @@ void LLPanelPeople::onOpen(const LLSD& key) reSelectedCurrentTab(); } -void LLPanelPeople::notifyChildren(const LLSD& info) +bool LLPanelPeople::notifyChildren(const LLSD& info) { if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") { @@ -1292,7 +1292,7 @@ void LLPanelPeople::notifyChildren(const LLSD& info) if (!container) { llwarns << "Cannot find People panel container" << llendl; - return; + return true; } if (container->getCurrentPanelIndex() > 0) @@ -1303,10 +1303,10 @@ void LLPanelPeople::notifyChildren(const LLSD& info) else LLSideTray::getInstance()->collapseSideBar(); - return; // this notification is only supposed to be handled by task panels + return true; // this notification is only supposed to be handled by task panels } - LLPanel::notifyChildren(info); + return LLPanel::notifyChildren(info); } void LLPanelPeople::showAccordion(const std::string name, bool show) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 5ac5bcc1d7..bd1b155947 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -51,7 +51,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void notifyChildren(const LLSD& info); + /*virtual*/ bool notifyChildren(const LLSD& info); // internals class Updater; diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 1830d00f68..3274820174 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -220,15 +220,15 @@ void LLPanelProfile::openPanel(LLPanel* panel, const LLSD& params) panel->setRect(new_rect); } -void LLPanelProfile::notifyParent(const LLSD& info) +S32 LLPanelProfile::notifyParent(const LLSD& info) { std::string action = info["action"]; // lets update Picks list after Pick was saved if("save_new_pick" == action) { onOpen(info); - return; + return 1; } - LLPanel::notifyParent(info); + return LLPanel::notifyParent(info); } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 067beb248b..bcf4bdd0ec 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -55,7 +55,7 @@ public: virtual void openPanel(LLPanel* panel, const LLSD& params); - void notifyParent(const LLSD& info); + S32 notifyParent(const LLSD& info); protected: -- cgit v1.2.3 From 660d81834803354140029ca27dd718fa588f157d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Dec 2009 13:40:57 +0200 Subject: Work on normal task EXT-3148 (Implement updating of the IM Well message counter) -- added new member in session stored count of unread messages from real participant and its updating -- added new method to IM Manager to caclculate total count of unread messages from real participants in all stored sessions -- added updating count of unread messages in IM Well counter --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 33 ++++++++++++++++++++++----------- indra/newview/llchiclet.h | 25 +++++++++++++++++++++++++ indra/newview/llimview.cpp | 24 ++++++++++++++++++++++++ indra/newview/llimview.h | 12 ++++++++++-- 4 files changed, 81 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 5fad030e5b..8d4e16df8e 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -55,7 +55,7 @@ #include "lltransientfloatermgr.h" static LLDefaultChildRegistry::Register t1("chiclet_panel"); -static LLDefaultChildRegistry::Register t2_0("chiclet_im_well"); +static LLDefaultChildRegistry::Register t2_0("chiclet_im_well"); static LLDefaultChildRegistry::Register t2("chiclet_notification"); static LLDefaultChildRegistry::Register t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register t4("chiclet_im_group"); @@ -138,6 +138,26 @@ void LLSysWellChiclet::setToggleState(BOOL toggled) { mButton->setToggleState(toggled); } + +/************************************************************************/ +/* LLIMWellChiclet implementation */ +/************************************************************************/ +LLIMWellChiclet::LLIMWellChiclet(const Params& p) +: LLSysWellChiclet(p) +{ + LLIMModel::instance().addNewMsgCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1)); + LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1)); +} + +void LLIMWellChiclet::messageCountChanged(const LLSD& session_data) +{ + S32 total_unread = LLIMMgr::instance().getNumberOfUnreadParticipantMessages(); + setCounter(total_unread); +} + +/************************************************************************/ +/* LLNotificationChiclet implementation */ +/************************************************************************/ LLNotificationChiclet::LLNotificationChiclet(const Params& p) : LLSysWellChiclet(p) { @@ -886,16 +906,7 @@ LLChicletPanel::~LLChicletPanel() void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){ LLUUID session_id = data["session_id"].asUUID(); - LLUUID from_id = data["from_id"].asUUID(); - const std::string from = data["from"].asString(); - S32 unread = data["num_unread"].asInteger(); - - // if new message came - if(unread != 0) - { - //we do not show balloon (indicator of new messages) for system messages and our own messages - if (from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from) return; - } + S32 unread = data["participant_unread"].asInteger(); LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); if (im_floater && im_floater->getVisible()) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 7e2d1ea411..603ca9de54 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -789,6 +789,31 @@ protected: S32 mCounter; }; +/** + * Class represented a chiclet for IM Well Icon. + * + * It displays a count of unread messages from other participants in all IM sessions. + */ +class LLIMWellChiclet : public LLSysWellChiclet +{ + friend class LLUICtrlFactory; +protected: + LLIMWellChiclet(const Params& p); + + /** + * Handles changes in a session (message was added, messages were read, etc.) + * + * It get total count of unread messages from a LLIMMgr in all opened sessions and display it. + * + * @param[in] session_data contains session related data, is not used now + * ["session_id"] - id of an appropriate session + * ["participant_unread"] - count of unread messages from "real" participants. + * + * @see LLIMMgr::getNumberOfUnreadParticipantMessages() + */ + void messageCountChanged(const LLSD& session_data); +}; + class LLNotificationChiclet : public LLSysWellChiclet { friend class LLUICtrlFactory; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f1efc11b07..6c4af0522f 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -148,6 +148,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& : mSessionID(session_id), mName(name), mType(type), + mParticipantUnreadMessageCount(0), mNumUnread(0), mOtherParticipantID(other_participant_id), mInitialTargetIDs(ids), @@ -496,10 +497,12 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, } session->mNumUnread = 0; + session->mParticipantUnreadMessageCount = 0; LLSD arg; arg["session_id"] = session_id; arg["num_unread"] = 0; + arg["participant_unread"] = session->mParticipantUnreadMessageCount; mNoUnreadMsgsSignal(arg); } @@ -576,10 +579,18 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co session->mNumUnread++; + //update count of unread messages from real participant + if (!(from_id.isNull() || from_id == gAgentID || SYSTEM_FROM == from)) + { + ++(session->mParticipantUnreadMessageCount); + } + + // notify listeners LLSD arg; arg["session_id"] = session_id; arg["num_unread"] = session->mNumUnread; + arg["participant_unread"] = session->mParticipantUnreadMessageCount; arg["message"] = utf8_text; arg["from"] = from; arg["from_id"] = from_id; @@ -1895,6 +1906,19 @@ S32 LLIMMgr::getNumberOfUnreadIM() return num; } +S32 LLIMMgr::getNumberOfUnreadParticipantMessages() +{ + std::map::iterator it; + + S32 num = 0; + for(it = LLIMModel::getInstance()->mId2SessionMap.begin(); it != LLIMModel::getInstance()->mId2SessionMap.end(); ++it) + { + num += (*it).second->mParticipantUnreadMessageCount; + } + + return num; +} + void LLIMMgr::clearNewIMNotification() { mIMReceived = FALSE; diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 4561d760d4..c002434a18 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -86,7 +86,10 @@ public: // connection to voice channel state change signal boost::signals2::connection mVoiceChannelStateChangeConnection; - //does NOT include system messages + //does NOT include system messages and agent's messages + S32 mParticipantUnreadMessageCount; + + // does include all incoming messages S32 mNumUnread; std::list mMsgs; @@ -330,9 +333,14 @@ public: // IM received that you haven't seen yet BOOL getIMReceived() const; - // Calc number of unread IMs + // Calc number of all unread IMs S32 getNumberOfUnreadIM(); + /** + * Calculates number of unread IMs from real participants in all stored sessions + */ + S32 getNumberOfUnreadParticipantMessages(); + // This method is used to go through all active sessions and // disable all of them. This method is usally called when you are // forced to log out or similar situations where you do not have a -- cgit v1.2.3 From 4880959567436443b85bb45a963ed4ee5464dc45 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Dec 2009 13:52:35 +0200 Subject: Aditional changes for normal task EXT-3081 (Separate Message Well on Notifications Well and IM Well) -- moved Notification well specific functionality from the "LLSysWellChiclet" into derived "LLNotificationChiclet" class --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 23 +++++++++++------------ indra/newview/llchiclet.h | 15 ++++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 8d4e16df8e..8d627dc4c2 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -92,7 +92,6 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p) : LLChiclet(p) , mButton(NULL) , mCounter(0) -, mUreadSystemNotifications(0) { LLButton::Params button_params = p.button; mButton = LLUICtrlFactory::create(button_params); @@ -104,17 +103,6 @@ LLSysWellChiclet::~LLSysWellChiclet() } -void LLSysWellChiclet::connectCounterUpdatersToSignal(std::string notification_type) -{ - LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance(); - LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type); - if(n_handler) - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); - } -} - void LLSysWellChiclet::setCounter(S32 counter) { std::string s_count; @@ -160,6 +148,7 @@ void LLIMWellChiclet::messageCountChanged(const LLSD& session_data) /************************************************************************/ LLNotificationChiclet::LLNotificationChiclet(const Params& p) : LLSysWellChiclet(p) +, mUreadSystemNotifications(0) { // connect counter handlers to the signals connectCounterUpdatersToSignal("notify"); @@ -167,6 +156,16 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) connectCounterUpdatersToSignal("offer"); } +void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type) +{ + LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance(); + LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type); + if(n_handler) + { + n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); + n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); + } +} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 603ca9de54..8727e97aad 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -770,20 +770,13 @@ public: /*virtual*/ ~LLSysWellChiclet(); - // methods for updating a number of unread System notifications - void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } - void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } void setToggleState(BOOL toggled); protected: - // connect counter updaters to the corresponding signals - void connectCounterUpdatersToSignal(std::string notification_type); LLSysWellChiclet(const Params& p); friend class LLUICtrlFactory; - S32 mUreadSystemNotifications; - protected: LLButton* mButton; S32 mCounter; @@ -820,6 +813,14 @@ class LLNotificationChiclet : public LLSysWellChiclet protected: LLNotificationChiclet(const Params& p); + // connect counter updaters to the corresponding signals + void connectCounterUpdatersToSignal(const std::string& notification_type); + + // methods for updating a number of unread System notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } + + S32 mUreadSystemNotifications; }; /** -- cgit v1.2.3 From fdb25e5add7305d8b92067f610eff1b5c18482de Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Dec 2009 14:20:33 +0200 Subject: Aditional changes for normal task EXT-3081 (Separate Message Well on Notifications Well and IM Well) -- set different titles for IM & Notification Well windows -- set different anchors for IM & Notification Well windows --HG-- branch : product-engine --- indra/newview/llsyswellwindow.cpp | 19 ++++++++++++++++++- indra/newview/llsyswellwindow.h | 16 +++++++++++++++- .../newview/skins/default/xui/en/floater_sys_well.xml | 9 +++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index c288301923..e5a4b456a0 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -47,6 +47,7 @@ static std::string NOTIFICATION_WELL_ANCHOR_NAME = "notification_well_panel"; +static std::string IM_WELL_ANCHOR_NAME = "im_well_panel"; //--------------------------------------------------------------------------------- LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key), @@ -156,7 +157,7 @@ void LLSysWellWindow::setVisible(BOOL visible) if (NULL == getDockControl() && getDockTongue().notNull()) { setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getChild(NOTIFICATION_WELL_ANCHOR_NAME), this, + LLBottomTray::getInstance()->getChild(getAnchorViewName()), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLSysWellWindow::getAllowedRect, this, _1))); } } @@ -373,6 +374,15 @@ LLNotificationWellWindow* LLNotificationWellWindow::getInstance(const LLSD& key return LLFloaterReg::getTypedInstance("notification_well_window", key); } +// virtual +BOOL LLNotificationWellWindow::postBuild() +{ + BOOL rv = LLSysWellWindow::postBuild(); + setTitle(getString("title_notification_well_window")); + return rv; +} + +// virtual void LLNotificationWellWindow::setVisible(BOOL visible) { if (visible) @@ -501,6 +511,13 @@ LLIMWellWindow* LLIMWellWindow::getInstance(const LLSD& key /*= LLSD()*/) return LLFloaterReg::getTypedInstance("im_well_window", key); } +BOOL LLIMWellWindow::postBuild() +{ + BOOL rv = LLSysWellWindow::postBuild(); + setTitle(getString("title_im_well_window")); + return rv; +} + //virtual void LLIMWellWindow::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 21391cebea..d2c494bfe8 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -47,6 +47,10 @@ class LLFlatListView; class LLChiclet; class LLIMChiclet; +extern std::string NOTIFICATION_WELL_ANCHOR_NAME; +extern std::string IM_WELL_ANCHOR_NAME; + + class LLSysWellWindow : public LLDockableFloater { public: @@ -92,7 +96,7 @@ protected: void handleItemRemoved(EItemType removed_item_type); bool anotherTypeExists(EItemType item_type) ; - + virtual const std::string& getAnchorViewName() = 0; void reshapeWindow(); @@ -125,16 +129,21 @@ public: static void initClass() { getInstance(); } + /*virtual*/ BOOL postBuild(); /*virtual*/ void setVisible(BOOL visible); // Operating with items void addItem(LLSysWellItem::Params p); +protected: + /*virtual*/ const std::string& getAnchorViewName() { return NOTIFICATION_WELL_ANCHOR_NAME; } + private: // init Window's channel void initChannel(); void clearScreenChannels(); + void onStoreToast(LLPanel* info_panel, LLUUID id); // connect counter and list updaters to the corresponding signals @@ -160,11 +169,16 @@ public: static LLIMWellWindow* getInstance(const LLSD& key = LLSD()); static void initClass() { getInstance(); } + /*virtual*/ BOOL postBuild(); + // LLIMSessionObserver observe triggers /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); /*virtual*/ void sessionRemoved(const LLUUID& session_id); /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); +protected: + /*virtual*/ const std::string& getAnchorViewName() { return IM_WELL_ANCHOR_NAME; } + private: LLChiclet * findIMChiclet(const LLUUID& sessionId); void addIMRow(const LLUUID& sessionId, S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId); diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml index 4e9388c2b2..3fc57372de 100644 --- a/indra/newview/skins/default/xui/en/floater_sys_well.xml +++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml @@ -21,6 +21,15 @@ save_visibility="true" single_instance="true" > + + IM SESSIONS + + + NOTIFICATIONS + + Date: Mon, 7 Dec 2009 14:39:34 +0200 Subject: Work on normal task EXT-3148 (Implement updating of the IM Well message counter). Completed -- added updating count of unread messages in IM Well counter while closing any session. --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 7 +++++++ indra/newview/llchiclet.h | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 8d627dc4c2..6b9e616e47 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -135,6 +135,13 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p) { LLIMModel::instance().addNewMsgCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1)); LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1)); + + LLIMMgr::getInstance()->addSessionObserver(this); +} + +LLIMWellChiclet::~LLIMWellChiclet() +{ + LLIMMgr::getInstance()->removeSessionObserver(this); } void LLIMWellChiclet::messageCountChanged(const LLSD& session_data) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 8727e97aad..609ce16713 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -39,6 +39,7 @@ #include "lltextbox.h" #include "lloutputmonitorctrl.h" #include "llgroupmgr.h" +#include "llimview.h" class LLVoiceControlPanel; class LLMenuGL; @@ -787,9 +788,15 @@ protected: * * It displays a count of unread messages from other participants in all IM sessions. */ -class LLIMWellChiclet : public LLSysWellChiclet +class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver { friend class LLUICtrlFactory; +public: + virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {} + virtual void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); } + virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {} + + ~LLIMWellChiclet(); protected: LLIMWellChiclet(const Params& p); -- cgit v1.2.3 From 0a617f15a83262ab472ca88f146c57bb0f6a6a73 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 7 Dec 2009 15:15:41 +0200 Subject: =?UTF-8?q?implemented=20EXT-2797=20=E2=80=9CMaking=20friendship?= =?UTF-8?q?=20offer=20should=20be=20recorded=20into=20IM=20history?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/llui/llnotificationsutil.cpp | 5 ++++ indra/llui/llnotificationsutil.h | 2 ++ indra/newview/llavataractions.cpp | 7 +++++ indra/newview/llnotificationhandlerutil.cpp | 11 ++++++-- indra/newview/llnotificationofferhandler.cpp | 33 ++++++++++++++-------- .../newview/skins/default/xui/en/notifications.xml | 7 +++++ 6 files changed, 50 insertions(+), 15 deletions(-) (limited to 'indra') 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 functor); S32 getSelectedOption(const LLSD& notification, const LLSD& response); + + void cancel(LLNotificationPtr pNotif); } #endif diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a7a6da3ac2..5af023f565 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -487,6 +487,13 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri IM_ONLINE, IM_FRIENDSHIP_OFFERED, calling_card_folder_id); + + LLSD args; + args["TO_NAME"] = target_name; + LLSD payload; + payload["SESSION_NAME"] = target_name; + payload["SUPPRES_TOST"] = true; + LLNotificationsUtil::add("FriendshipOffered", args, payload); } //static diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 0fbc6575e8..6748bd7982 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -46,14 +46,16 @@ const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"), "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"), ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"), USER_GIVE_ITEM("UserGiveItem"), OFFER_FRIENDSHIP("OfferFriendship"), - FRIENDSHIP_ACCEPTED("FriendshipAccepted"); + FRIENDSHIP_ACCEPTED("FriendshipAccepted"), + FRIENDSHIP_OFFERED("FriendshipOffered"); // static bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification) { return GRANTED_MODIFY_RIGHTS == notification->getName() || REVOKED_MODIFY_RIGHTS == notification->getName() - || PAYMENT_RECIVED == notification->getName(); + || PAYMENT_RECIVED == notification->getName() + || FRIENDSHIP_OFFERED == notification->getName(); } // static @@ -103,13 +105,16 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification) notification->getSubstitutions().has("NAME") ? notification->getSubstitutions()["NAME"] : notification->getSubstitutions()["[NAME]"]; + const std::string session_name = notification->getPayload().has( + "SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name; + // don't create IM p2p session with objects, it's necessary condition to log if (notification->getName() != OBJECT_GIVE_ITEM && notification->getName() != OBJECT_GIVE_ITEM_UNKNOWN_USER) { LLUUID from_id = notification->getPayload()["from_id"]; - logToIM(IM_NOTHING_SPECIAL, name, name, notification->getMessage(), + logToIM(IM_NOTHING_SPECIAL, session_name, name, notification->getMessage(), from_id, from_id); } } diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index b7f95ae2fa..4d64c5c0e4 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -41,6 +41,7 @@ #include "llnotifications.h" #include "llscriptfloater.h" #include "llimview.h" +#include "llnotificationsutil.h" using namespace LLNotificationsUI; @@ -122,20 +123,28 @@ bool LLOfferHandler::processNotification(const LLSD& notify) } } - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); + if (notification->getPayload().has("SUPPRES_TOST") + && notification->getPayload()["SUPPRES_TOST"]) + { + LLNotificationsUtil::cancel(notification); + } + else + { + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); - LLToast::Params p; - p.notif_id = notification->getID(); - p.notification = notification; - p.panel = notify_box; - p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); - - LLScreenChannel* channel = dynamic_cast(mChannel); - if(channel) - channel->addToast(p); + LLToast::Params p; + p.notif_id = notification->getID(); + p.notification = notification; + p.panel = notify_box; + p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1); - // send a signal to the counter manager - mNewNotificationSignal(); + LLScreenChannel* channel = dynamic_cast(mChannel); + if(channel) + channel->addToast(p); + + // send a signal to the counter manager + mNewNotificationSignal(); + } } } else if (notify["sigtype"].asString() == "delete") diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 0d7351395a..c4946b895e 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5128,6 +5128,13 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you [O text="Decline"/> + + + You have offered friendship to [TO_NAME] + Date: Mon, 7 Dec 2009 15:44:44 +0200 Subject: Implemented normal task EXT-3084 (Update Notifications window behavior). - Added hiding window when focus is lost. --HG-- branch : product-engine --- indra/newview/llsyswellwindow.cpp | 6 ++++++ indra/newview/llsyswellwindow.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'indra') diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index e5a4b456a0..18877e3895 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -174,6 +174,12 @@ void LLSysWellWindow::setVisible(BOOL visible) } } +//--------------------------------------------------------------------------------- +void LLSysWellWindow::onFocusLost() +{ + setVisible(false); +} + //--------------------------------------------------------------------------------- void LLSysWellWindow::setDocked(bool docked, bool pop_on_undock) { diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index d2c494bfe8..18715ceeb5 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -73,6 +73,11 @@ public: // override LLFloater's minimization according to EXT-1216 /*virtual*/ void setMinimized(BOOL minimize); + /** + * Hides window when user clicks away from it (EXT-3084) + */ + /*virtual*/ void onFocusLost(); + void onStartUpToastClick(S32 x, S32 y, MASK mask); // size constants for the window and for its elements -- cgit v1.2.3 From d5bc38ae2db2d482db3e3fb83a0d9b917c6d4eb4 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Dec 2009 15:59:49 +0200 Subject: Work on normal task EXT-3148 (Implement updating of the IM Well message counter). Fixed Linux build -- move constats into class --HG-- branch : product-engine --- indra/newview/llsyswellwindow.cpp | 4 ---- indra/newview/llsyswellwindow.h | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 18877e3895..f64cd4727b 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -45,10 +45,6 @@ #include "lltoastpanel.h" #include "llnotificationmanager.h" - -static std::string NOTIFICATION_WELL_ANCHOR_NAME = "notification_well_panel"; -static std::string IM_WELL_ANCHOR_NAME = "im_well_panel"; - //--------------------------------------------------------------------------------- LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key), mChannel(NULL), diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 18715ceeb5..adbc83677d 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -47,8 +47,6 @@ class LLFlatListView; class LLChiclet; class LLIMChiclet; -extern std::string NOTIFICATION_WELL_ANCHOR_NAME; -extern std::string IM_WELL_ANCHOR_NAME; class LLSysWellWindow : public LLDockableFloater @@ -101,6 +99,8 @@ protected: void handleItemRemoved(EItemType removed_item_type); bool anotherTypeExists(EItemType item_type) ; + const std::string NOTIFICATION_WELL_ANCHOR_NAME; + const std::string IM_WELL_ANCHOR_NAME; virtual const std::string& getAnchorViewName() = 0; void reshapeWindow(); -- cgit v1.2.3 From 7c839098a7643f0e58dacdd9af1a509f2f72c61c Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 7 Dec 2009 16:18:24 +0200 Subject: Minor comments cleanup. --HG-- branch : product-engine --- indra/newview/llavatarlistitem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index cb015a5461..aa1b7593f5 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -72,7 +72,7 @@ public: void setOnline(bool online); void setName(const std::string& name); - void setHighlight(const std::string& highlight); // XXX ugly name + void setHighlight(const std::string& highlight); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); void setLastInteractionTime(U32 secs_since); //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly -- cgit v1.2.3 From 62dce8b425627b85bc119920b79fd882a5a77f09 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 7 Dec 2009 16:45:14 +0200 Subject: Fix for critical bug EXT-3166 "MyInventory/Library Places accordions are causing massive inventory background fetch on startup" - MyInventory/Library Places accordions aren't expanded on startup now. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index d731da0ec7..e87b70f6a5 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -125,7 +125,10 @@ void LLLandmarksPanel::onSearchEdit(const std::string& string) tab->setVisible(TRUE); // expand accordion to see matched items in each one. See EXT-2014. - tab->changeOpenClose(false); + if (string != "") + { + tab->changeOpenClose(false); + } LLInventorySubTreePanel* inventory_list = dynamic_cast(tab->getAccordionView()); if (NULL == inventory_list) continue; -- cgit v1.2.3 From 48803059de80263d5b605edaf58ad9c42db5359e Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 7 Dec 2009 17:01:07 +0200 Subject: EXT-2989 Chiclet overlaps the voice indicator of another chiclet see comments for details --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 5fad030e5b..330151d710 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -401,6 +401,10 @@ LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) sendChildToFront(mNewMessagesIcon); setShowSpeaker(p.show_speaker); + + //since mShowSpeaker initialized with false + //setShowSpeaker(false) will not hide mSpeakerCtrl + mSpeakerCtrl->setVisible(getShowSpeaker()); } void LLIMP2PChiclet::setCounter(S32 counter) -- cgit v1.2.3 From 8cd690bc1f754ec66ebd175c2bbb6d2763825969 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 7 Dec 2009 18:03:43 +0200 Subject: Fixed normal bug EXT - 3074 (Resident name tabs in IM window should not be capitalized) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 9de0b1f827..2bc07d0c27 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -237,7 +237,6 @@ BOOL LLIMFloater::postBuild() mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + session_name); - LLStringUtil::toUpper(session_name); setTitle(session_name); childSetCommitCallback("chat_editor", onSendMsg, this); -- cgit v1.2.3 From 4a1bb89faffae4b1d87013dba104545c1b9952e0 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 7 Dec 2009 18:11:33 +0200 Subject: Completed normal task EXT-3148 (Implement updating of the IM Well message counter). -- added broken constants' initialization (in Changeset: f0931dcb0481) --HG-- branch : product-engine --- indra/newview/llsyswellwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index f64cd4727b..bef7f5d6aa 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -49,7 +49,10 @@ LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLDockableFloater(NULL, key), mChannel(NULL), mMessageList(NULL), - mSeparator(NULL) + mSeparator(NULL), + NOTIFICATION_WELL_ANCHOR_NAME("notification_well_panel"), + IM_WELL_ANCHOR_NAME("im_well_panel") + { mTypedItemsCount[IT_NOTIFICATION] = 0; mTypedItemsCount[IT_INSTANT_MESSAGE] = 0; -- cgit v1.2.3 From 0a88e412cc5b6b27bddc90b905214dceca65e5e1 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 7 Dec 2009 19:09:25 +0200 Subject: tast EXT-3096 (Notification toasts mouse hovering behavior), fade behavior is now being reset for all toasts on hovering --HG-- branch : product-engine --- indra/newview/llscreenchannel.cpp | 33 +++++++++++++++++++++++++++++++++ indra/newview/llscreenchannel.h | 7 +++++++ indra/newview/lltoast.cpp | 33 +++++++++++++++++++++++++-------- indra/newview/lltoast.h | 9 +++++++++ 4 files changed, 74 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 44bdf98a86..4f0c873c61 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -162,6 +162,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p) if(mControlHovering) { new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2)); + new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToasts, this)); + new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToasts, this)); } if(show_toast) @@ -586,6 +588,37 @@ void LLScreenChannel::closeStartUpToast() } } +void LLNotificationsUI::LLScreenChannel::stopFadingToasts() +{ + if (!mToastList.size()) return; + + if (!mHoveredToast) return; + + std::vector::iterator it = mToastList.begin(); + while (it != mToastList.end()) + { + ToastElem& elem = *it; + elem.toast->stopFading(); + ++it; + } +} + +void LLNotificationsUI::LLScreenChannel::startFadingToasts() +{ + if (!mToastList.size()) return; + + //because onMouseLeave is processed after onMouseEnter + if (mHoveredToast) return; + + std::vector::iterator it = mToastList.begin(); + while (it != mToastList.end()) + { + ToastElem& elem = *it; + elem.toast->startFading(); + ++it; + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::hideToastsFromScreen() { diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index f39b94b89d..67f1c9bdc6 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -184,6 +184,13 @@ public: // close the StartUp Toast void closeStartUpToast(); + + /** Stop fading all toasts */ + virtual void stopFadingToasts(); + + /** Start fading all toasts */ + virtual void startFadingToasts(); + // get StartUp Toast's state static bool getStartUpToastShown() { return mWasStartUpToastShown; } // tell all channels that the StartUp toast was shown and allow them showing of toasts diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index bf485b7e65..fc7c029a17 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -244,15 +244,15 @@ void LLToast::onMouseEnter(S32 x, S32 y, MASK mask) mOnToastHoverSignal(this, MOUSE_ENTER); setBackgroundOpaque(TRUE); - if(mCanFade) - { - mTimer.stop(); - } + + //toasts fading is management by Screen Channel sendChildToFront(mHideBtn); if(mHideBtn && mHideBtn->getEnabled()) mHideBtn->setVisible(TRUE); mOnMouseEnterSignal(this); + + LLModalDialog::onMouseEnter(x, y, mask); } //-------------------------------------------------------------------------- @@ -260,10 +260,8 @@ void LLToast::onMouseLeave(S32 x, S32 y, MASK mask) { mOnToastHoverSignal(this, MOUSE_LEAVE); - if(mCanFade) - { - mTimer.start(); - } + //toasts fading is management by Screen Channel + if(mHideBtn && mHideBtn->getEnabled()) { if( mHideBtnPressed ) @@ -273,6 +271,25 @@ void LLToast::onMouseLeave(S32 x, S32 y, MASK mask) } mHideBtn->setVisible(FALSE); } + + LLModalDialog::onMouseLeave(x, y, mask); +} + + +void LLNotificationsUI::LLToast::stopFading() +{ + if(mCanFade) + { + stopTimer(); + } +} + +void LLNotificationsUI::LLToast::startFading() +{ + if(mCanFade) + { + resetTimer(); + } } //-------------------------------------------------------------------------- diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 769b2ba122..d08e46e160 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -88,6 +88,15 @@ public: virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void onMouseLeave(S32 x, S32 y, MASK mask); + //Fading + + /** Stop fading timer */ + virtual void stopFading(); + + /** Start fading timer */ + virtual void startFading(); + + // Operating with toasts // insert a panel to a toast void insertPanel(LLPanel* panel); -- cgit v1.2.3 From da8de2b6742cad3fadad84c9f0640b69a9690f66 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 7 Dec 2009 19:42:11 +0200 Subject: implemented Task EXT-2304 Offer Notifications should include a link that highlights the landmark or item in the appropriate side panel Changes: 1.highlighting of landmarks was broken by LLInventoryPanel::getActiveInventoryPanel(). 2. escaping of urls --HG-- branch : product-engine --- indra/llui/llurlentry.cpp | 2 +- indra/newview/llviewerinventory.cpp | 3 +- indra/newview/llviewermessage.cpp | 94 +++++++++++++++---------------------- 3 files changed, 40 insertions(+), 59 deletions(-) (limited to 'indra') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 9ad86a29f6..7694d02837 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -401,7 +401,7 @@ LLUrlEntryInventory::LLUrlEntryInventory() std::string LLUrlEntryInventory::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { std::string label = getStringAfterToken(url, "name="); - return label.empty() ? url : label; + return LLURI::unescape(label.empty() ? url : label); } /// diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 5bdcbc79bd..839e035272 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -85,7 +85,8 @@ public: { std::vector items_to_open; items_to_open.push_back(inventory_id); - open_inventory_offer(items_to_open, ""); + //inventory_handler is just a stub, because we don't know from who this offer + open_inventory_offer(items_to_open, "inventory_handler"); return true; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 558382b0a7..d6b57dfced 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -73,6 +73,7 @@ #include "llstatusbar.h" #include "llimview.h" #include "lltrans.h" +#include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" @@ -827,6 +828,8 @@ void open_inventory_offer(const std::vector& items, const std::string& f std::vector::const_iterator it = items.begin(); std::vector::const_iterator end = items.end(); const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + BOOL user_is_away = gAwayTimer.getStarted(); LLInventoryItem* item; for(; it != end; ++it) { @@ -837,7 +840,10 @@ void open_inventory_offer(const std::vector& items, const std::string& f LL_WARNS("Messaging") << "Unable to show inventory item: " << id << LL_ENDL; continue; } - if(gInventory.isObjectDescendentOf(id, trash_id)) + // don't select trash or lost and found items if the user is active + if(gInventory.isObjectDescendentOf(id, trash_id) || + (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) + && !user_is_away) ) { continue; } @@ -846,6 +852,7 @@ void open_inventory_offer(const std::vector& items, const std::string& f //if we are throttled, don't display them if (check_offer_throttle(from_name, false)) { + LL_DEBUGS("Messaging") << "Highlighting inventory item: " << item->getUUID() << LL_ENDL; // If we opened this ourselves, focus it BOOL take_focus = from_name.empty() ? TAKE_FOCUS_YES : TAKE_FOCUS_NO; switch(asset_type) @@ -856,71 +863,44 @@ void open_inventory_offer(const std::vector& items, const std::string& f case LLAssetType::AT_LANDMARK: { LLInventoryCategory* parent_folder = gInventory.getCategory(item->getParentUUID()); - LLSD args; - args["LANDMARK_NAME"] = item->getName(); - args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); - LLNotificationsUtil::add("LandmarkCreated", args); - - // Created landmark is passed to Places panel to allow its editing. - LLPanelPlaces *panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); - if (panel) + if ("inventory_handler" == from_name) { - panel->setItem(item); + //we have to filter inventory_handler messages to avoid notification displaying + LLSideTray::getInstance()->showPanel("panel_places", + LLSD().with("type", "landmark").with("id", item->getUUID())); } - } + else if(from_name.empty()) + { + // we receive a message from LLOpenTaskOffer, it mean that new landmark has been added. + LLSD args; + args["LANDMARK_NAME"] = item->getName(); + args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); + LLNotificationsUtil::add("LandmarkCreated", args); + // Created landmark is passed to Places panel to allow its editing. In fact panel should be already displayed. + //TODO*:: dserduk(7/12/09) remove LLPanelPlaces dependency from here + LLPanelPlaces *panel = dynamic_cast(LLSideTray::getInstance()->showPanel("panel_places", LLSD())); + if (panel) + { + panel->setItem(item); + } + } + } break; case LLAssetType::AT_TEXTURE: LLFloaterReg::showInstance("preview_texture", LLSD(id), take_focus); break; default: + if(gSavedSettings.getBOOL("ShowInInventory") && + asset_type != LLAssetType::AT_CALLINGCARD && + item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && + !from_name.empty()) + { + LLSideTray::getInstance()->showPanel("sidepanel_inventory", + LLSD().with("select", item->getUUID())); + } break; } } - //highlight item, if it's not in the trash or lost+found - - // Don't auto-open the inventory floater - if(gSavedSettings.getBOOL("ShowInInventory") && - asset_type != LLAssetType::AT_CALLINGCARD && - item->getInventoryType() != LLInventoryType::IT_ATTACHMENT && - !from_name.empty()) - { - //TODO:this should be moved to the end of method after all the checks, - //but first decide what to do with active inventory if any (EK) - LLSD key; - key["select"] = item->getUUID(); - LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); - } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if(active_panel) - { - //Trash Check - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) - { - return; - } - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - //BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view); - BOOL user_is_away = gAwayTimer.getStarted(); - - // don't select lost and found items if the user is active - if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id) - && !user_is_away) - { - return; - } - - //Not sure about this check. Could make it easy to miss incoming items. - //don't dick with highlight while the user is working - //if(inventory_has_focus && !user_is_away) - // break; - LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL; - //highlight item - - LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus(); - active_panel->setSelection(item->getUUID(), TAKE_FOCUS_NO); - gFocusMgr.setKeyboardFocus(focus_ctrl); - } } } @@ -1461,7 +1441,7 @@ void inventory_offer_handler(LLOfferInfo* info) args["OBJECTFROMNAME"] = info->mFromName; args["NAME"] = info->mFromName; args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about"); - std::string verb = "select?name=" + msg; + std::string verb = "select?name=" + LLURI::escape(msg); args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str()); LLNotification::Params p("ObjectGiveItem"); -- cgit v1.2.3 From 37c7e4059cab2a7152e730ca5d68530f14f8f51e Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 7 Dec 2009 18:22:52 +0000 Subject: DEV-43439: Allow Home side panel URL to be customized. The URL for the Home side panel is now specified via a new "HomeSidePanelURL" string in app_settings/settings.xml. This string supports the following substitutions: CHANNEL = the channel name for the viewer VERSION = the full version string for the viewer LANGUAGE = the current language set in the viewer AUTH_KEY = the authentication key (see below) The authentication key is an optional string that is read from the dictionary of strings returned by login.cgi. If login.cgi returns a key called "home_sidetray_token", then the value of that key is used for the AUTH_KEY substitution. This lets the server provide a piece of blind data that can be passed to the Home panel web page to support authentication. The viewer does not interpret the token in any way. This change adds a new module, llviewerhome.{cpp|h} to contain the model functionality, used by the view module, llpanelhome.{cpp|h}. --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 11 +++++ indra/newview/llpanelhome.cpp | 6 ++- indra/newview/llviewerhome.cpp | 79 +++++++++++++++++++++++++++++++++ indra/newview/llviewerhome.h | 49 ++++++++++++++++++++ 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 indra/newview/llviewerhome.cpp create mode 100644 indra/newview/llviewerhome.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dd3fc10fa2..3a1a318669 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -462,6 +462,7 @@ set(viewer_SOURCE_FILES llviewergesture.cpp llviewerhelp.cpp llviewerhelputil.cpp + llviewerhome.cpp llviewerinventory.cpp llviewerjoint.cpp llviewerjointattachment.cpp @@ -964,6 +965,7 @@ set(viewer_HEADER_FILES llviewergenericmessage.h llviewergesture.h llviewerhelp.h + llviewerhome.h llviewerinventory.h llviewerjoint.h llviewerjointattachment.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b301d784f9..ec28603d25 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3587,6 +3587,17 @@ Value http://viewer-help.secondlife.com/[LANGUAGE]/[CHANNEL]/[VERSION]/[TOPIC] + HomeSidePanelURL + + Comment + URL for the web page to display in the Home side panel + Persist + 0 + Type + String + Value + http://www.secondlife.com/ + HighResSnapshot Comment diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index de7a85836d..fb2629c692 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -35,6 +35,7 @@ #include "llpanelhome.h" #include "llmediactrl.h" +#include "llviewerhome.h" static LLRegisterPanelClassWrapper t_people("panel_sidetray_home"); @@ -62,9 +63,12 @@ BOOL LLPanelHome::postBuild() mBrowser = getChild("browser"); if (mBrowser) { + // read the URL to display from settings.xml + std::string url = LLViewerHome::getHomeURL(); + mBrowser->addObserver(this); mBrowser->setTrusted(true); - mBrowser->setHomePageUrl("http://www.secondlife.com/"); + mBrowser->setHomePageUrl(url); childSetAction("back", onClickBack, this); childSetAction("forward", onClickForward, this); diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp new file mode 100644 index 0000000000..64fe4f4fca --- /dev/null +++ b/indra/newview/llviewerhome.cpp @@ -0,0 +1,79 @@ +/** + * @file llviewerhome.cpp + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llviewerhome.h" + +#include "lllogininstance.h" +#include "llui.h" +#include "lluri.h" +#include "llsd.h" +#include "llversionviewer.h" +#include "llviewercontrol.h" + +//static +std::string LLViewerHome::getHomeURL() +{ + // Return the URL to display in the Home side tray. We read + // this value from settings.xml and support various substitutions + + // *TODO: We should put this version pattern in a central place; this and near + // equivalents are replicated in other code - what's a good location? + std::ostringstream version; + version << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VERSION_BUILD; + + LLSD substitution; + substitution["VERSION"] = version.str(); + substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); + substitution["LANGUAGE"] = LLUI::getLanguage(); + substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); + + std::string homeURL = gSavedSettings.getString("HomeSidePanelURL"); + LLStringUtil::format(homeURL, substitution); + + return homeURL; +} + +//static +std::string LLViewerHome::getAuthKey() +{ + // return the value of the (optional) auth token returned by login.cgi + // this lets the server provide an authentication token that we can + // blindly pass to the Home web page for it to perform authentication. + static const std::string authKeyName("home_sidetray_token"); + return LLLoginInstance::getInstance()->getResponse(authKeyName); +} + diff --git a/indra/newview/llviewerhome.h b/indra/newview/llviewerhome.h new file mode 100644 index 0000000000..50454a71b7 --- /dev/null +++ b/indra/newview/llviewerhome.h @@ -0,0 +1,49 @@ +/** + * @file llviewerhome.h + * @brief Model (non-View) component for the web-based Home side panel + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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_LLVIEWERHOME_H +#define LL_LLVIEWERHOME_H + +#include + +class LLViewerHome +{ +public: + /// return the URL to use for the web-based Home side panel + static std::string getHomeURL(); + + /// return the authentication key for the Home web site + static std::string getAuthKey(); +}; + +#endif -- cgit v1.2.3 From 86c686e962a6fb7e282a0652eaff2b107c48a02d Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 7 Dec 2009 20:31:45 +0200 Subject: Fix for major bug EXT-3135 "Crash after dragging LM from 'Inventory' accordion to fav bar". - Added method to get currently active tab in sidetray. - Disabled opening sidetray inventory panel upon receiving new inventory item or after drag-n-drop operations with landmarks in sidetray places panel. --HG-- branch : product-engine --- indra/newview/llinventorypanel.cpp | 9 ++++++--- indra/newview/llsidetray.h | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index baa659df7c..b89a8bfd7d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -881,10 +881,13 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() // Otherwise, open the inventorySP and use that. if (!res) { - LLSD key; + LLSideTray *side_tray = LLSideTray::getInstance(); LLSidepanelInventory *sidepanel_inventory = - dynamic_cast(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); - if (sidepanel_inventory) + dynamic_cast(side_tray->getPanel("sidepanel_inventory")); + + // Use the inventory side panel only if it is already active. + // Activating it may unexpectedly switch off the currently active tab in some cases. + if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory) { res = sidepanel_inventory->getActivePanel(); if (res) diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 7321574681..c90b2d7f8c 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -102,6 +102,11 @@ public: LLPanel* getPanel (const std::string& panel_name); /* + * get currently active tab + */ + const LLSideTrayTab* getActiveTab() const { return mActiveTab; } + + /* * collapse SideBar, hiding visible tab and moving tab buttons * to the right corner of the screen */ -- cgit v1.2.3 From eebbf52e5ed0663672fea899ab92574f482aab01 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 7 Dec 2009 21:05:18 +0200 Subject: Implemented normal sub-task EXT-3142("new message" indicator for object chiclets) --HG-- branch : product-engine --- indra/newview/llscriptfloater.cpp | 17 ++++++++++++++--- indra/newview/llscriptfloater.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 088884178b..8de99a48aa 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -207,11 +207,22 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) return; } + // Need to indicate of "new message" for object chiclets according to requirements + // specified in the Message Bar design specification. See EXT-3142. + bool set_new_message = false; + // If an Object spawns more-than-one floater, only the newest one is shown. // The previous is automatically closed. script_notification_map_t::iterator it = mNotifications.find(object_id); if(it != mNotifications.end()) { + LLScriptFloater* floater = LLFloaterReg::findTypedInstance("script_floater", it->second.notification_id); + if(floater) + { + // Generate chiclet with a "new message" indicator if a docked window was opened. See EXT-3142. + set_new_message = floater->isShown(); + } + onRemoveNotification(it->second.notification_id); } @@ -229,7 +240,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) LLBottomTray::getInstance()->getChicletPanel()->createChiclet(object_id); } - toggleScriptFloater(object_id); + toggleScriptFloater(object_id, set_new_message); } void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) @@ -278,13 +289,13 @@ void LLScriptFloaterManager::removeNotificationByObjectId(const LLUUID& object_i } } -void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& object_id) +void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& object_id, bool set_new_message) { // hide "new message" icon from chiclet LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet(object_id); if(chiclet) { - chiclet->setShowNewMessagesIcon(false); + chiclet->setShowNewMessagesIcon(set_new_message); } // kill toast diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 8b5a266691..8de7a28d0f 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -70,7 +70,7 @@ public: * Toggles script floater. * Removes "new message" icon from chiclet and removes notification toast. */ - void toggleScriptFloater(const LLUUID& object_id); + void toggleScriptFloater(const LLUUID& object_id, bool set_new_message = false); LLUUID findObjectId(const LLUUID& notification_id); -- cgit v1.2.3 From 4a8733fadd54a44eb59bd4b80c7e727ccdc0c540 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 7 Dec 2009 22:04:02 +0200 Subject: No ticket. Removed inventory offer fake notification. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d6b57dfced..c4a2e88db5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1480,14 +1480,15 @@ void inventory_offer_handler(LLOfferInfo* info) } // Pop up inv offer notification and let the user accept (keep), or reject (and silently delete) the inventory. - LLNotifications::instance().add(p); + LLNotifications::instance().add(p); + // TODO(EM): Recheck this after we will know how script notifications should look like. // Inform user that there is a script floater via toast system - { - payload["give_inventory_notification"] = TRUE; - LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); - LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); - } + // { + // payload["give_inventory_notification"] = TRUE; + // LLNotificationPtr notification = LLNotifications::instance().add(p.payload(payload)); + // LLScriptFloaterManager::getInstance()->setNotificationToastId(object_id, notification->getID()); + // } } bool lure_callback(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From de2f8212f0c8a42d02e636ecd0744d3ddfd0dce9 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 7 Dec 2009 20:05:52 +0000 Subject: DEV-43439: Added calls to query the viewer version. Rather than copy/paste the same version string formatting pattern again, I added new string-based version routines: /// return the full viewer version as a string like "2.0.0.200030" const std::string &llGetViewerVersion(); /// return the viewer version as a string like "2.0.0" const std::string &llGetViewerShortVersion(); /// return the viewer build version as a string, e.g., "200130" const std::string &llGetViewerBuildVersion(); --- indra/newview/CMakeLists.txt | 5 +++-- indra/newview/llappviewer.cpp | 13 +++++-------- indra/newview/llfloaterabout.cpp | 13 ++----------- indra/newview/llfloaterreporter.cpp | 13 ++++--------- indra/newview/llpanellogin.cpp | 11 ++++------- indra/newview/llviewerhelputil.cpp | 10 ++-------- indra/newview/llviewerhome.cpp | 12 ++---------- indra/newview/llviewermedia.cpp | 4 ++-- indra/newview/tests/llviewerhelputil_test.cpp | 7 +++++++ 9 files changed, 31 insertions(+), 57 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3a1a318669..f0bbd343d3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -451,8 +451,9 @@ set(viewer_SOURCE_FILES llviewerassetstorage.cpp llviewerassettype.cpp llvieweraudio.cpp + llviewerbuild.cpp llviewercamera.cpp - llviewerchat.cpp + llviewerchat.cpp llviewercontrol.cpp llviewercontrollistener.cpp llviewerdisplay.cpp @@ -956,7 +957,7 @@ set(viewer_HEADER_FILES llvieweraudio.h llviewerbuild.h llviewercamera.h - llviewerchat.h + llviewerchat.h llviewercontrol.h llviewercontrollistener.h llviewerdisplay.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ddc818172d..e5be17dec6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -36,6 +36,7 @@ // Viewer includes #include "llversionviewer.h" +#include "llviewerbuild.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -647,12 +648,9 @@ bool LLAppViewer::init() writeSystemInfo(); // Build a string representing the current version number. - gCurrentVersion = llformat("%s %d.%d.%d.%d", - gSavedSettings.getString("VersionChannelName").c_str(), - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VERSION_BUILD ); + gCurrentVersion = llformat("%s %s", + gSavedSettings.getString("VersionChannelName").c_str(), + llGetViewerVersion().c_str()); ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2521,8 +2519,7 @@ void LLAppViewer::writeSystemInfo() // Dump some debugging info LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH - << LL_ENDL; + << " version " << llGetViewerShortVersion() << LL_ENDL; // Dump the local time and time zone time_t now; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 68fc69b4f7..5efaf6c58d 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -217,10 +217,7 @@ LLSD LLFloaterAbout::getInfo() version.append(LL_VERSION_PATCH); version.append(LL_VERSION_BUILD); info["VIEWER_VERSION"] = version; - info["VIEWER_VERSION_STR"] = STRINGIZE(version[0].asInteger() << '.' << - version[1].asInteger() << '.' << - version[2].asInteger() << '.' << - version[3].asInteger()); + info["VIEWER_VERSION_STR"] = llGetViewerVersion(); info["BUILD_DATE"] = __DATE__; info["BUILD_TIME"] = __TIME__; info["CHANNEL"] = gSavedSettings.getString("VersionChannelName"); @@ -286,15 +283,9 @@ LLSD LLFloaterAbout::getInfo() static std::string get_viewer_release_notes_url() { - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - LLSD query; query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = version.str(); + query["version"] = llGetViewerVersion(); std::ostringstream url; url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1f3bd50d5b..ec2815dd5a 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -45,7 +45,7 @@ #include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" -#include "llversionviewer.h" +#include "llviewerbuild.h" #include "message.h" #include "v3math.h" @@ -609,10 +609,7 @@ LLSD LLFloaterReporter::gatherReport() std::ostringstream details; - details << "V" << LL_VERSION_MAJOR << "." // client version moved to body of email for abuse reports - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VIEWER_BUILD << std::endl << std::endl; + details << "V" << llGetViewerVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports std::string object_name = childGetText("object_name"); if (!object_name.empty() && !mOwnerName.empty()) @@ -629,10 +626,8 @@ LLSD LLFloaterReporter::gatherReport() std::string version_string; version_string = llformat( - "%d.%d.%d %s %s %s %s", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, + "%s %s %s %s %s", + llGetViewerShortVersion().c_str(), platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4bae6af12e..a72b7a9d7a 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -248,11 +248,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, getChild("login_widgets")->setDefaultBtn("connect_btn"); std::string channel = gSavedSettings.getString("VersionChannelName"); - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VIEWER_BUILD ); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); LLTextBox* channel_text = getChild("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); @@ -741,8 +738,8 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - std::string version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); + std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), + llGetViewerBuildVersion().c_str()); char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0); char* curl_version = curl_escape(version.c_str(), 0); diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index c1555eacdc..2d98765175 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llversionviewer.h" +#include "llviewerbuild.h" //#include "llfloaterhelpbrowser.h" //#include "llfloaterreg.h" @@ -86,14 +87,7 @@ std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); - // *TODO: We should put this version pattern in a central place; this and near - // equivalents are replicated in other code - what's a good location? - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - substitution["VERSION"] = helpURLEncode(version.str()); + substitution["VERSION"] = helpURLEncode(llGetViewerVersion()); substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR); substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR); substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH); diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp index 64fe4f4fca..57e828525d 100644 --- a/indra/newview/llviewerhome.cpp +++ b/indra/newview/llviewerhome.cpp @@ -38,7 +38,7 @@ #include "llui.h" #include "lluri.h" #include "llsd.h" -#include "llversionviewer.h" +#include "llviewerbuild.h" #include "llviewercontrol.h" //static @@ -47,16 +47,8 @@ std::string LLViewerHome::getHomeURL() // Return the URL to display in the Home side tray. We read // this value from settings.xml and support various substitutions - // *TODO: We should put this version pattern in a central place; this and near - // equivalents are replicated in other code - what's a good location? - std::ostringstream version; - version << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; - LLSD substitution; - substitution["VERSION"] = version.str(); + substitution["VERSION"] = llGetViewerVersion(); substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); substitution["LANGUAGE"] = LLUI::getLanguage(); substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f6db661489..25a809d697 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -41,7 +41,7 @@ #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llversionviewer.h" +#include "llviewerbuild.h" #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" @@ -446,7 +446,7 @@ std::string LLViewerMedia::getCurrentUserAgent() // http://www.mozilla.org/build/revised-user-agent-strings.html std::ostringstream codec; codec << "SecondLife/"; - codec << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD; + codec << llGetViewerVersion(); codec << " (" << channel << "; " << skin_name << " skin)"; llinfos << codec.str() << llendl; diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 988d28c301..87304cfcff 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -36,6 +36,7 @@ #include "../test/lltut.h" #include "../llviewerhelputil.h" +#include "../llviewerbuild.h" #include "llcontrol.h" #include "llsys.h" @@ -75,6 +76,12 @@ std::string LLControlGroup::getString(const std::string& name) return test_stringvec[name]; } +const std::string &llGetViewerVersion() +{ + static std::string version = "2.0.0.200099"; + return version; +} + //---------------------------------------------------------------------------- namespace tut -- cgit v1.2.3 From 24cba353a45f6c261169fcda03cb9ac860ef8d9f Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 7 Dec 2009 20:30:29 +0000 Subject: DEV-43439: Rename llviewerbuild.{cpp|h} -> llviewerversion.{cpp|h} This module now contains general viewer version routines, not just access to the viewer build number, so I've renamed it from llviewerbuild to llviewerversion. --- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/llappviewer.cpp | 2 +- indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llfloaterreporter.cpp | 3 +-- indra/newview/llpanellogin.cpp | 2 +- indra/newview/llviewerassetstorage.cpp | 1 - indra/newview/llviewerhelputil.cpp | 2 +- indra/newview/llviewerhome.cpp | 2 +- indra/newview/llviewermedia.cpp | 2 +- indra/newview/tests/llviewerhelputil_test.cpp | 2 +- 10 files changed, 10 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f0bbd343d3..76b967eb82 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -451,7 +451,6 @@ set(viewer_SOURCE_FILES llviewerassetstorage.cpp llviewerassettype.cpp llvieweraudio.cpp - llviewerbuild.cpp llviewercamera.cpp llviewerchat.cpp llviewercontrol.cpp @@ -497,6 +496,7 @@ set(viewer_SOURCE_FILES llviewertextureanim.cpp llviewertexturelist.cpp llviewerthrottle.cpp + llviewerversion.cpp llviewervisualparam.cpp llviewerwindow.cpp llviewerwindowlistener.cpp @@ -955,7 +955,6 @@ set(viewer_HEADER_FILES llviewerassetstorage.h llviewerassettype.h llvieweraudio.h - llviewerbuild.h llviewercamera.h llviewerchat.h llviewercontrol.h @@ -998,6 +997,7 @@ set(viewer_HEADER_FILES llviewertextureanim.h llviewertexturelist.h llviewerthrottle.h + llviewerversion.h llviewervisualparam.h llviewerwindow.h llviewerwindowlistener.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e5be17dec6..6bbc1eaa6a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -36,7 +36,7 @@ // Viewer includes #include "llversionviewer.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 5efaf6c58d..b2588cc01b 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -46,7 +46,7 @@ #include "llviewerstats.h" #include "llviewerregion.h" #include "llversionviewer.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llweb.h" // Linden library includes diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index ec2815dd5a..be821ad43b 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -45,7 +45,6 @@ #include "llnotificationsutil.h" #include "llstring.h" #include "llsys.h" -#include "llviewerbuild.h" #include "message.h" #include "v3math.h" @@ -76,7 +75,7 @@ #include "llfloateravatarpicker.h" #include "lldir.h" #include "llselectmgr.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "lluictrlfactory.h" #include "llviewernetwork.h" diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a72b7a9d7a..d80d5c3d2e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -57,7 +57,7 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlsimstring.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llviewerhelp.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index c32e67ef90..a041f3ac98 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -36,7 +36,6 @@ #include "llagent.h" #include "llviewerassetstorage.h" -#include "llviewerbuild.h" #include "llvfile.h" #include "llvfs.h" diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index 2d98765175..2642b2378e 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -34,7 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llversionviewer.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" //#include "llfloaterhelpbrowser.h" //#include "llfloaterreg.h" diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp index 57e828525d..ee1e46dc59 100644 --- a/indra/newview/llviewerhome.cpp +++ b/indra/newview/llviewerhome.cpp @@ -38,7 +38,7 @@ #include "llui.h" #include "lluri.h" #include "llsd.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llviewercontrol.h" //static diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 25a809d697..a206768d33 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -41,7 +41,7 @@ #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llviewerbuild.h" +#include "llviewerversion.h" #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 87304cfcff..90e3e7a7e0 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -36,7 +36,7 @@ #include "../test/lltut.h" #include "../llviewerhelputil.h" -#include "../llviewerbuild.h" +#include "../llviewerversion.h" #include "llcontrol.h" #include "llsys.h" -- cgit v1.2.3 From c3a82913deb9b23ef1f22b6d002893b36146553a Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 7 Dec 2009 22:44:44 +0200 Subject: Fixed normal bug EXT-3018([BSI] Hook up "Go to My Dashboard" in Profile to link to http://secondlife.com/my) --HG-- branch : product-engine --- indra/newview/llpanelme.cpp | 1 + indra/newview/skins/default/xui/en/panel_edit_profile.xml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 4e21268a8a..ece93125b3 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -220,6 +220,7 @@ BOOL LLPanelMyProfileEdit::postBuild() initTexturePickerMouseEvents(); childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url")); + childSetTextArg("my_account_link", "[URL]", getString("my_account_link_url")); return LLPanelAvatarProfile::postBuild(); } diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index a833ad97d9..bbf86089cb 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -50,6 +50,10 @@ name="partner_edit_link_url"> http://www.secondlife.com/account/partners.php?lang=en + + http://secondlife.com/my + @@ -256,7 +260,7 @@ layout="topleft" left="10" name="my_account_link" - value="Go to My Dashboard" + value="[[URL] Go to My Dashboard]" width="285" /> Date: Mon, 7 Dec 2009 15:49:08 -0500 Subject: EXT-3214 : Trash icon flahes in Recent Items when nothing in history Trash icon is disabled when no items are selected. --HG-- branch : avatar-pipeline --- indra/newview/llpanelmaininventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9fd92725dc..21627e84ff 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1020,6 +1020,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) can_delete = TRUE; std::set selection_set; folder->getSelectionList(selection_set); + if (selection_set.empty()) return FALSE; for (std::set::iterator iter = selection_set.begin(); iter != selection_set.end(); ++iter) -- cgit v1.2.3 From 1d60a4c67817292a1e0b32d96fa8effbac2f6285 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 7 Dec 2009 17:15:49 -0500 Subject: EXT-2826 : Rename "Favorite" folder to "Favorites" folder Only will affect new accounts. --HG-- branch : avatar-pipeline --- indra/newview/llviewerfoldertype.cpp | 2 +- indra/newview/skins/default/xui/en/panel_landmarks.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index db54a79610..033d35d80a 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -121,7 +121,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga", TRUE)); addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga", FALSE)); addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga", FALSE)); - addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorite", "inv_folder_plain_closed.tga", FALSE)); + addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "inv_folder_plain_closed.tga", FALSE)); addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga",TRUE)); addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga", TRUE)); diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index c52b0c83d0..1f211c0fed 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -32,7 +32,7 @@ left="0" mouse_opaque="true" name="favorites_list" - start_folder="Favorite" + start_folder="Favorites" width="380"/> Date: Mon, 7 Dec 2009 17:19:21 -0500 Subject: EXT-3125 : INFRASTRUCTURE : Cleanup LLInventoryFilter to disambiguate various filter options EXT-3124 : Add lookup for finding all linked items to an item Specifying date range now is explicitly tracked as a filter type. --HG-- branch : avatar-pipeline --- indra/newview/llinventoryfilter.cpp | 60 +++++++++++++++++++++++++++---------- indra/newview/llinventoryfilter.h | 3 +- 2 files changed, 47 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 4c5e4d5607..8907bf4c1c 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -95,26 +95,14 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) return TRUE; } - const U16 HOURS_TO_SECONDS = 3600; - time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; - if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) - { - earliest = mFilterOps.mMinDate; - } - else if (!mFilterOps.mHoursAgo) - { - earliest = 0; - } - const LLFolderViewEventListener* listener = item->getListener(); mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; const BOOL passed_filtertype = checkAgainstFilterType(item); const BOOL passed = passed_filtertype && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) && - ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && - (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); - + ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions); + return passed; } @@ -131,6 +119,8 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const U32 filterTypes = mFilterOps.mFilterTypes; + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_OBJECT // Pass if this item's type is of the correct filter type if (filterTypes & FILTERTYPE_OBJECT) { @@ -143,7 +133,12 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) if ((1LL << object_type & mFilterOps.mFilterObjectTypes) == U64(0)) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_CATEGORY // Pass if this item is a category of the filter type, or // if its parent is a category of the filter type. if (filterTypes & FILTERTYPE_CATEGORY) @@ -159,13 +154,43 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID if (filterTypes & FILTERTYPE_UUID) { if (object->getLinkedUUID() != mFilterOps.mFilterUUID) return FALSE; } + // + //////////////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_DATE + // Pass if this item is within the date range. + if (filterTypes & FILTERTYPE_DATE) + { + const U16 HOURS_TO_SECONDS = 3600; + time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; + if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) + { + earliest = mFilterOps.mMinDate; + } + else if (!mFilterOps.mHoursAgo) + { + earliest = 0; + } + if (listener->getCreationDate() < earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } + // + //////////////////////////////////////////////////////////////////////////////// return TRUE; } @@ -359,6 +384,7 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date) mFilterOps.mMaxDate = llmax(mFilterOps.mMinDate, max_date); setModified(); } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) @@ -373,12 +399,14 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) setDateRange(0, time_max()); setModified(); } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } BOOL LLInventoryFilter::isSinceLogoff() const { return (mFilterOps.mMinDate == (time_t)mLastLogoff) && - (mFilterOps.mMaxDate == time_max()); + (mFilterOps.mMaxDate == time_max()) && + (mFilterOps.mFilterTypes & FILTERTYPE_DATE); } void LLInventoryFilter::clearModified() @@ -410,7 +438,9 @@ void LLInventoryFilter::setHoursAgo(U32 hours) setModified(FILTER_RESTART); } } + mFilterOps.mFilterTypes |= FILTERTYPE_DATE; } + void LLInventoryFilter::setShowFolderState(EFolderShow state) { if (mFilterOps.mShowFolderState != state) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index d65fb8f27c..8cac173fd8 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -61,7 +61,8 @@ public: FILTERTYPE_NONE = 0, FILTERTYPE_OBJECT = 1, // normal default search-by-object-type FILTERTYPE_CATEGORY = 2, // search by folder type - FILTERTYPE_UUID = 4 // find the object with UUID and any links to it + FILTERTYPE_UUID = 4, // find the object with UUID and any links to it + FILTERTYPE_DATE = 8 // search by date range }; // REFACTOR: Change this to an enum. -- cgit v1.2.3 From 724cbb8134567b7b8fd1e2fd8fd1c65d0d3aed78 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 7 Dec 2009 14:37:27 -0800 Subject: Made viewerclient.py a bit more robust against timing problems on startup. It now successfully retries to connect on windows. reviewed by nat. --- indra/newview/lllogininstance.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 955347bce2..7d3da152c1 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -189,8 +189,7 @@ void LLLoginInstance::constructAuthParams(const LLSD& credentials) bool LLLoginInstance::handleLoginEvent(const LLSD& event) { - std::cout << "LoginListener called!: \n"; - std::cout << event << "\n"; + LL_DEBUGS("Login") << "LoginListener called!: \n" << event << LL_ENDL; if(!(event.has("state") && event.has("change") && event.has("progress"))) { -- cgit v1.2.3 From b65334a4c133984fed9466db60df92756e8de05d Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Mon, 7 Dec 2009 16:25:08 -0800 Subject: L10N: Add much-needed linguistic context in the comments of strings.xml; L10N: consistency in phrasing on the 2 separate places in the Nav Bar where you create/edit a Landmark Also, add a separator to menu_NavBar so its easier to parse visually. --- indra/newview/skins/default/xui/en/menu_navbar.xml | 2 ++ indra/newview/skins/default/xui/en/strings.xml | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_navbar.xml b/indra/newview/skins/default/xui/en/menu_navbar.xml index e17eeb46f6..b71b866c4b 100644 --- a/indra/newview/skins/default/xui/en/menu_navbar.xml +++ b/indra/newview/skins/default/xui/en/menu_navbar.xml @@ -27,6 +27,8 @@ + All + Buy Buy for L$ @@ -2008,8 +2009,8 @@ this texture in your inventory none - - (Unknown) + + (Unknown) @@ -2019,7 +2020,8 @@ this texture in your inventory Total No group data found for group - + parent estate mainland teen @@ -2108,8 +2110,8 @@ this texture in your inventory Unknown file extension .%s Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh - Add Landmark... - Edit Landmark... + Add to My Landmarks... + Edit my Landmark... @@ -2780,7 +2782,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Add to My Landmarks - Edit My Landmark + Edit my Landmark See more info about the current location My location history Buy this land -- cgit v1.2.3 From a0770d5ec085b4cb46dcbd439aa9832ca0311f76 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 7 Dec 2009 19:54:49 -0500 Subject: LLSidepanelTaskInfo cosmetic cleanup. --HG-- branch : avatar-pipeline --- indra/newview/llsidepaneltaskinfo.cpp | 757 +++++++++++++++++----------------- indra/newview/llsidepaneltaskinfo.h | 6 + 2 files changed, 377 insertions(+), 386 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 09e067b5f9..3e3a63d438 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -104,9 +104,6 @@ BOOL LLSidepanelTaskInfo::postBuild() childSetPrevalidate("Object Name",LLLineEditor::prevalidateASCIIPrintableNoPipe); childSetPrevalidate("Object Description",LLLineEditor::prevalidateASCIIPrintableNoPipe); -// getChild("button set group")->setCommitCallback(boost::bind(&LLSidepanelTaskInfo::onClickGroup,this)); -// childSetAction("button deed",LLSidepanelTaskInfo::onClickDeedToGroup,this); - mLabelGroupName = getChild("Group Name Proxy"); return TRUE; @@ -119,6 +116,7 @@ void LLSidepanelTaskInfo::setVisible(BOOL visible) if (visible) { sActivePanel = this; + mObject = getFirstSelectedObject(); } else { @@ -126,10 +124,89 @@ void LLSidepanelTaskInfo::setVisible(BOOL visible) } } +void LLSidepanelTaskInfo::disableAll() +{ + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); + + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); + + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); + + //Next owner can: + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); + + //checkbox for sale + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); + + //checkbox include in search + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); + + LLComboBox* combo_sale_type = getChild("sale type"); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); + combo_sale_type->setEnabled(FALSE); + + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); + + childSetEnabled("label click action", FALSE); + LLComboBox* combo_click_action = getChild("clickaction"); + if (combo_click_action) + { + combo_click_action->setEnabled(FALSE); + combo_click_action->clear(); + } + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); +} + void LLSidepanelTaskInfo::refresh() { - LLButton* BtnDeedToGroup = getChild("button deed"); - if(BtnDeedToGroup) + LLButton* btn_deed_to_group = getChild("button deed"); + if (btn_deed_to_group) { std::string deedText; if (gWarningSettings.getBOOL("DeedObject")) @@ -140,156 +217,80 @@ void LLSidepanelTaskInfo::refresh() { deedText = getString("text deed"); } - BtnDeedToGroup->setLabelSelected(deedText); - BtnDeedToGroup->setLabelUnselected(deedText); + btn_deed_to_group->setLabelSelected(deedText); + btn_deed_to_group->setLabelUnselected(deedText); } + BOOL root_selected = TRUE; LLSelectNode* nodep = mObjectSelection->getFirstRootNode(); S32 object_count = mObjectSelection->getRootObjectCount(); - if(!nodep || 0 == object_count) + if (!nodep || (object_count == 0)) { nodep = mObjectSelection->getFirstNode(); object_count = mObjectSelection->getObjectCount(); root_selected = FALSE; } - //BOOL attachment_selected = mObjectSelection->isAttachment(); - //attachment_selected = false; LLViewerObject* objectp = NULL; - if(nodep) objectp = nodep->getObject(); - if(!nodep || !objectp)// || attachment_selected) + if (nodep) { - // ...nothing selected - childSetEnabled("perm_modify",false); - childSetText("perm_modify",LLStringUtil::null); - - childSetEnabled("Creator:",false); - childSetText("Creator Name",LLStringUtil::null); - childSetEnabled("Creator Name",false); - - childSetEnabled("Owner:",false); - childSetText("Owner Name",LLStringUtil::null); - childSetEnabled("Owner Name",false); - - childSetEnabled("Group:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("button set group",false); - - childSetText("Object Name",LLStringUtil::null); - childSetEnabled("Object Name",false); - childSetEnabled("Name:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("Description:",false); - childSetText("Object Description",LLStringUtil::null); - childSetEnabled("Object Description",false); - - childSetEnabled("Permissions:",false); - - childSetValue("checkbox share with group",FALSE); - childSetEnabled("checkbox share with group",false); - childSetEnabled("button deed",false); - - childSetValue("checkbox allow everyone move",FALSE); - childSetEnabled("checkbox allow everyone move",false); - childSetValue("checkbox allow everyone copy",FALSE); - childSetEnabled("checkbox allow everyone copy",false); - - //Next owner can: - childSetEnabled("Next owner can:",false); - childSetValue("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can modify",false); - childSetValue("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can copy",false); - childSetValue("checkbox next owner can transfer",FALSE); - childSetEnabled("checkbox next owner can transfer",false); - - //checkbox for sale - childSetValue("checkbox for sale",FALSE); - childSetEnabled("checkbox for sale",false); - - //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", false); - - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); - - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); - - childSetEnabled("label click action",false); - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) - { - ComboClickAction->setEnabled(FALSE); - ComboClickAction->clear(); - } - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + objectp = nodep->getObject(); + } + // ...nothing selected + if (!nodep || !objectp) + { + disableAll(); return; } // figure out a few variables - BOOL is_one_object = (object_count == 1); - + const BOOL is_one_object = (object_count == 1); + // BUG: fails if a root and non-root are both single-selected. - BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsModify()) - || LLSelectMgr::getInstance()->selectGetModify(); + const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) || + LLSelectMgr::getInstance()->selectGetModify(); const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); + S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = - { - getString("text modify info 1"), - getString("text modify info 2"), - getString("text modify info 3"), - getString("text modify info 4") - }; - if(!is_perm_modify) + { + getString("text modify info 1"), + getString("text modify info 2"), + getString("text modify info 3"), + getString("text modify info 4") + }; + if (!is_perm_modify) { string_index += 2; } - if(!is_one_object) + if (!is_one_object) { ++string_index; } - childSetEnabled("perm_modify",true); - childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:",true); + childSetEnabled("Permissions:", TRUE); // Update creator text field - childSetEnabled("Creator:",true); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, - creator_name); + creator_name); - childSetText("Creator Name",creator_name); - childSetEnabled("Creator Name",TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - childSetEnabled("Owner:",true); + childSetEnabled("Owner:", TRUE); - BOOL owners_identical; std::string owner_name; - owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); - -// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; - + const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); if (mOwnerID.isNull()) { - if(LLSelectMgr::getInstance()->selectIsGroupOwned()) + if (LLSelectMgr::getInstance()->selectIsGroupOwned()) { // Group owned already displayed by selectGetOwner } @@ -304,61 +305,53 @@ void LLSidepanelTaskInfo::refresh() if (!mLastOwnerID.isNull() && !last_owner_name.empty()) { owner_name.append(", last "); - owner_name.append( last_owner_name ); + owner_name.append(last_owner_name); } } } - - childSetText("Owner Name",owner_name); - childSetEnabled("Owner Name",TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - childSetEnabled("Group:",true); - childSetText("Group Name",LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) { - if(mLabelGroupName) + if (mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id,TRUE); mLabelGroupName->setEnabled(TRUE); } } else { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID())); + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - // figure out the contents of the name, description, & category - BOOL edit_name_desc = FALSE; - if(is_one_object && objectp->permModify()) - { - edit_name_desc = TRUE; - } - - childSetEnabled("Name:",true); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); + childSetEnabled("Description:", TRUE); + LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); - if(is_one_object) + if (is_one_object) { - if(keyboard_focus_view != LineEditorObjectName) + if (keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } - if(LineEditorObjectDesc) + if (LineEditorObjectDesc) { - if(keyboard_focus_view != LineEditorObjectDesc) + if (keyboard_focus_view != LineEditorObjectDesc) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -366,19 +359,25 @@ void LLSidepanelTaskInfo::refresh() } else { - childSetText("Object Name",LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } - if(edit_name_desc) + // figure out the contents of the name, description, & category + BOOL edit_name_desc = FALSE; + if (is_one_object && objectp->permModify()) { - childSetEnabled("Object Name",true); - childSetEnabled("Object Description",true); + edit_name_desc = TRUE; + } + if (edit_name_desc) + { + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - childSetEnabled("Object Name",false); - childSetEnabled("Object Description",false); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -387,10 +386,10 @@ void LLSidepanelTaskInfo::refresh() BOOL is_sale_price_mixed = FALSE; U32 num_for_sale = FALSE; LLSelectMgr::getInstance()->selectGetAggregateSaleInfo(num_for_sale, - is_for_sale_mixed, - is_sale_price_mixed, - total_sale_price, - individual_sale_price); + is_for_sale_mixed, + is_sale_price_mixed, + total_sale_price, + individual_sale_price); const BOOL self_owned = (gAgent.getID() == mOwnerID); const BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ; @@ -398,35 +397,35 @@ void LLSidepanelTaskInfo::refresh() const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer(); const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy(); - if(!owners_identical) + if (!owners_identical) { - childSetEnabled("Cost",false); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. - else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) + else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost",getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); - if(!edit_price->hasFocus()) + if (!edit_price->hasFocus()) { // If the sale price is mixed then set the cost to MIXED, otherwise // set to the actual cost. - if (num_for_sale > 0 && is_for_sale_mixed) + if ((num_for_sale > 0) && is_for_sale_mixed) { edit_price->setTentative(TRUE); } - else if (num_for_sale > 0 && is_sale_price_mixed) + else if ((num_for_sale > 0) && is_sale_price_mixed) { edit_price->setTentative(TRUE); } @@ -437,111 +436,99 @@ void LLSidepanelTaskInfo::refresh() } // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. - bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false; - childSetEnabled("Cost",enable_edit); - childSetEnabled("Edit Cost",enable_edit); + BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. - else if(!public_owned) + else if (!public_owned) { - childSetEnabled("Cost",false); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost",llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - childSetText("Edit Cost",LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost",getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes // based on who owns the object. // TODO: Creator permissions - BOOL valid_base_perms = FALSE; - BOOL valid_owner_perms = FALSE; - BOOL valid_group_perms = FALSE; - BOOL valid_everyone_perms = FALSE; - BOOL valid_next_perms = FALSE; - - U32 base_mask_on; - U32 base_mask_off; - U32 owner_mask_on; - U32 owner_mask_off; - U32 group_mask_on; - U32 group_mask_off; - U32 everyone_mask_on; - U32 everyone_mask_off; - U32 next_owner_mask_on = 0; - U32 next_owner_mask_off = 0; - - valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, - &base_mask_on, - &base_mask_off); - - valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - - valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, - &group_mask_on, - &group_mask_off); + U32 base_mask_on = 0; + U32 base_mask_off = 0; + //U32 owner_mask_off = 0; + U32 owner_mask_on = 0; + U32 group_mask_on = 0; + U32 group_mask_off = 0; + U32 everyone_mask_on = 0; + U32 everyone_mask_off = 0; + U32 next_owner_mask_on = 0; + U32 next_owner_mask_off = 0; + + BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, + &base_mask_on, + &base_mask_off); + /* + BOOL valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); + */ + BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, + &group_mask_on, + &group_mask_off); - valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, - &everyone_mask_on, - &everyone_mask_off); + BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, + &everyone_mask_on, + &everyone_mask_off); - valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, - &next_owner_mask_on, - &next_owner_mask_off); + BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, + &next_owner_mask_on, + &next_owner_mask_off); - if( gSavedSettings.getBOOL("DebugPermissions") ) + if (gSavedSettings.getBOOL("DebugPermissions") ) { std::string perm_string; if (valid_base_perms) { - perm_string = "B: "; - perm_string += mask_to_string(base_mask_on); - childSetText("B:",perm_string); - childSetVisible("B:",true); + perm_string = "B: " + mask_to_string(base_mask_on); + childSetText("B:", perm_string); + childSetVisible("B:", TRUE); - perm_string = "O: "; - perm_string += mask_to_string(owner_mask_on); - childSetText("O:",perm_string); - childSetVisible("O:",true); + perm_string = "O: " + mask_to_string(owner_mask_on); + childSetText("O:", perm_string); + childSetVisible("O:", TRUE); - perm_string = "G: "; - perm_string += mask_to_string(group_mask_on); - childSetText("G:",perm_string); - childSetVisible("G:",true); + perm_string = "G: " + mask_to_string(group_mask_on); + childSetText("G:", perm_string); + childSetVisible("G:", TRUE); - perm_string = "E: "; - perm_string += mask_to_string(everyone_mask_on); - childSetText("E:",perm_string); - childSetVisible("E:",true); + perm_string = "E: " + mask_to_string(everyone_mask_on); + childSetText("E:", perm_string); + childSetVisible("E:", TRUE); - perm_string = "N: "; - perm_string += mask_to_string(next_owner_mask_on); - childSetText("N:",perm_string); - childSetVisible("N:",true); + perm_string = "N: " + mask_to_string(next_owner_mask_on); + childSetText("N:", perm_string); + childSetVisible("N:", TRUE); } - perm_string = "F: "; U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; @@ -551,189 +538,187 @@ void LLSidepanelTaskInfo::refresh() flag_mask |= PERM_COPY; if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; - perm_string += mask_to_string(flag_mask); - childSetText("F:",perm_string); - childSetVisible("F:",true); + perm_string = "F:" + mask_to_string(flag_mask); + childSetText("F:", perm_string); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } - bool has_change_perm_ability = false; - bool has_change_sale_ability = false; + BOOL has_change_perm_ability = FALSE; + BOOL has_change_sale_ability = FALSE; - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { - has_change_perm_ability = true; + has_change_perm_ability = TRUE; } - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { - has_change_sale_ability = true; + has_change_sale_ability = TRUE; } if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group",true); - childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale",FALSE); - childSetEnabled("sale type",FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - childSetEnabled("Next owner can:",FALSE); - childSetEnabled("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can transfer",FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } - if(valid_group_perms) + if (valid_group_perms) { - if((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) + if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",FALSE); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } - else if((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) + else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group",FALSE); - childSetTentative("checkbox share with group",false); - childSetEnabled("button deed",false); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",true); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } - if(valid_everyone_perms) + if (valid_everyone_perms) { // Move - if(everyone_mask_on & PERM_MOVE) + if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } - else if(everyone_mask_off & PERM_MOVE) + else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move",FALSE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",true); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy - if(everyone_mask_on & PERM_COPY) + if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",!can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } - else if(everyone_mask_off & PERM_COPY) + else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy",FALSE); - childSetTentative("checkbox allow everyone copy",false); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",true); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } - if(valid_next_perms) + if (valid_next_perms) { // Modify == next owner canot modify - if(next_owner_mask_on & PERM_MODIFY) + if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } - else if(next_owner_mask_off & PERM_MODIFY) + else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",FALSE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",true); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy - if(next_owner_mask_on & PERM_COPY) + if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",!can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } - else if(next_owner_mask_off & PERM_COPY) + else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy",FALSE); - childSetTentative("checkbox next owner can copy",FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer - if(next_owner_mask_on & PERM_TRANSFER) + if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",!can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } - else if(next_owner_mask_off & PERM_TRANSFER) + else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",FALSE); - childSetTentative("checkbox next owner can transfer",FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -745,72 +730,70 @@ void LLSidepanelTaskInfo::refresh() LLComboBox* combo_sale_type = getChild("sale type"); if (valid_sale_info) { - combo_sale_type->setValue(sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); - combo_sale_type->setTentative(FALSE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); + combo_sale_type->setTentative( FALSE); // unfortunately this doesn't do anything at the moment. } else { // default option is sell copy, determined to be safest - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setTentative(TRUE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( LLSaleInfo::FS_COPY); + combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", num_for_sale != 0); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. - bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - if (num_for_sale && has_change_sale_ability && cannot_actually_sell) - { - childSetEnabled("checkbox for sale", true); - } - + const BOOL cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); + childSetEnabled("checkbox for sale", (num_for_sale && has_change_sale_ability && cannot_actually_sell)); + // Check search status of objects - BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); + const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; - bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", ! all_include_in_search); + const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) + if (ComboClickAction) { ComboClickAction->setCurrentByIndex((S32)click_action); } } - childSetEnabled("label click action",is_perm_modify && all_volume); - childSetEnabled("clickaction",is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); if (!getIsEditing()) { - const std::string no_item_names[]={ - "Object Name", - "Object Description", - "button set group", - "checkbox share with group", - "button deed", - "checkbox allow everyone move", - "checkbox allow everyone copy", - "checkbox for sale", - "sale type", - "Edit Cost", - "checkbox next owner can modify", - "checkbox next owner can copy", - "checkbox next owner can transfer", - "clickaction", - "search_check", - "perm_modify", - "Group Name", - }; - for(size_t t=0; tselectGetOwner(owner_id, name); LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if(owners_identical && (owner_id == gAgent.getID())) + if (owners_identical && (owner_id == gAgent.getID())) { - LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance("group_picker", LLSD(gAgent.getID())); + LLFloaterGroupPicker* fg = LLFloaterReg::showTypedInstance("group_picker", LLSD(gAgent.getID())); if (fg) { fg->setSelectGroupCallback( boost::bind(&LLSidepanelTaskInfo::cbGroupID, this, _1) ); - if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); @@ -857,7 +839,7 @@ void LLSidepanelTaskInfo::onClickGroup() void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id) { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(group_id, TRUE); } @@ -866,23 +848,23 @@ void LLSidepanelTaskInfo::cbGroupID(LLUUID group_id) static bool callback_deed_to_group(const LLSD& notification, const LLSD& response) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) + const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) { LLUUID group_id; - BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); - if(group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) + const BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); + if (group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) { LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); // LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } } - return false; + return FALSE; } void LLSidepanelTaskInfo::onClickDeedToGroup() { - LLNotificationsUtil::add( "DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); + LLNotificationsUtil::add("DeedObjectToGroup", LLSD(), LLSD(), callback_deed_to_group); } ///---------------------------------------------------------------------------- @@ -891,8 +873,8 @@ void LLSidepanelTaskInfo::onClickDeedToGroup() void LLSidepanelTaskInfo::onCommitPerm(LLCheckBoxCtrl *ctrl, U8 field, U32 perm) { - LLViewerObject* object = mObjectSelection->getFirstRootObject(); - if(!object) return; + const LLViewerObject* object = mObjectSelection->getFirstRootObject(); + if (!object) return; BOOL new_state = ctrl->get(); LLSelectMgr::getInstance()->selectionSetObjectPermissions(field, new_state, perm); @@ -960,28 +942,24 @@ void LLSidepanelTaskInfo::onCommitSaleType() void LLSidepanelTaskInfo::setAllSaleInfo() { llinfos << "LLSidepanelTaskInfo::setAllSaleInfo()" << llendl; - LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; + LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; LLCheckBoxCtrl *checkPurchase = getChild("checkbox for sale"); - // Set the sale type if the object(s) are for sale. - if(checkPurchase && checkPurchase->get()) + if (checkPurchase && checkPurchase->get()) { sale_type = static_cast(getChild("sale type")->getValue().asInteger()); } S32 price = -1; - - LLSpinCtrl *edit_price = getChild("Edit Cost"); + const LLSpinCtrl *edit_price = getChild("Edit Cost"); price = (edit_price->getTentative()) ? DEFAULT_PRICE : edit_price->getValue().asInteger(); - // If somehow an invalid price, turn the sale off. if (price < 0) sale_type = LLSaleInfo::FS_NOT; - LLSaleInfo sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); - + // If turned off for-sale, make sure click-action buy is turned // off as well if (sale_type == LLSaleInfo::FS_NOT) @@ -1001,8 +979,8 @@ struct LLSelectionPayable : public LLSelectedObjectFunctor { // can pay if you or your parent has money() event in script LLViewerObject* parent = (LLViewerObject*)obj->getParent(); - return (obj->flagTakesMoney() - || (parent && parent->flagTakesMoney())); + return (obj->flagTakesMoney() || + (parent && parent->flagTakesMoney())); } }; @@ -1029,7 +1007,7 @@ void LLSidepanelTaskInfo::onCommitClickAction(U8 click_action) { // Verify object has script with money() handler LLSelectionPayable payable; - bool can_pay = mObjectSelection->applyToObjects(&payable); + const BOOL can_pay = mObjectSelection->applyToObjects(&payable); if (!can_pay) { // Warn, but do it anyway. @@ -1104,6 +1082,13 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel() return sActivePanel; } +LLViewerObject* LLSidepanelTaskInfo::getObject() +{ + if (!mObject->isDead()) + return mObject; + return NULL; +} + LLViewerObject* LLSidepanelTaskInfo::getFirstSelectedObject() { LLSelectNode *node = mObjectSelection->getFirstRootNode(); diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index b6dd4dfb2c..83afac9da8 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -91,6 +91,8 @@ protected: void setAllSaleInfo(); + void disableAll(); + private: LLNameBox* mLabelGroupName; // group name @@ -107,6 +109,10 @@ private: LLButton* mPayBtn; LLButton* mBuyBtn; +protected: + LLViewerObject* getObject(); +private: + LLViewerObject* mObject; LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; }; -- cgit v1.2.3 From 5245fb69721bf4b70de85211da6721b0e0137e07 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Mon, 7 Dec 2009 17:07:52 -0800 Subject: merge fixes --- indra/newview/llinventorypanel.cpp | 1 + indra/newview/llviewermessage.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index bf70bb66fa..4cbf27b725 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -903,6 +903,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) if (!auto_open) return NULL; // D. Open the inventory side panel and use that. + LLSideTray *side_tray = LLSideTray::getInstance(); LLSidepanelInventory *sidepanel_inventory = dynamic_cast(side_tray->getPanel("sidepanel_inventory")); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 39d69067da..8c0529e344 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -829,8 +829,6 @@ void open_inventory_offer(const std::vector& items, const std::string& f for (std::vector::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - BOOL user_is_away = gAwayTimer.getStarted(); { const LLUUID& item_id = (*item_iter); LLInventoryItem* item = gInventory.getItem(item_id); @@ -839,6 +837,7 @@ void open_inventory_offer(const std::vector& items, const std::string& f LL_WARNS("Messaging") << "Unable to show inventory item: " << item_id << LL_ENDL; continue; } + //////////////////////////////////////////////////////////////////////////////// // Don't highlight if it's in certain "quiet" folders which don't need UI // notification (e.g. trash, cof, lost-and-found). -- cgit v1.2.3 From 6301211b7c9fc214c6dcfb6b8a573e62a0fb9bad Mon Sep 17 00:00:00 2001 From: Ramzi Linden Date: Mon, 7 Dec 2009 17:28:39 -0800 Subject: EXT-2855 delete 2 more entries in strings.xml that are not actually user-visible --- indra/newview/skins/default/xui/en/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index df991b173a..3b32912fbf 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2389,8 +2389,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Eyes Bugged -Eyes Shear Left Up -Eyes Shear Right Up + + -- cgit v1.2.3 From 432bf69ad6217abfda330cb648ae45dfc5cb1e66 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 8 Dec 2009 08:56:13 +0000 Subject: DEV-43897 linux viewer2 corrupted vorbis problem we were accidentally linking the duff fmod vorbis first because our dependancies weren't well-defined. --- indra/cmake/LLAudio.cmake | 3 ++- indra/newview/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLAudio.cmake b/indra/cmake/LLAudio.cmake index 89b790c6b0..7c248dfc72 100644 --- a/indra/cmake/LLAudio.cmake +++ b/indra/cmake/LLAudio.cmake @@ -6,4 +6,5 @@ set(LLAUDIO_INCLUDE_DIRS ${LIBS_OPEN_DIR}/llaudio ) -set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES}) +# be exhaustive here +set(LLAUDIO_LIBRARIES llaudio ${VORBISFILE_LIBRARIES} ${VORBIS_LIBRARIES} ${VORBISENC_LIBRARIES} ${OGG_LIBRARIES} ${OPENAL_LIBRARIES}) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f41505a82d..57d67bd560 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1523,7 +1523,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${BOOST_REGEX_LIBRARY} ${DBUSGLIB_LIBRARIES} ${OPENGL_LIBRARIES} - ${FMODWRAPPER_LIBRARY} + ${FMODWRAPPER_LIBRARY} # must come after LLAudio ${OPENGL_LIBRARIES} ${SDL_LIBRARY} ${SMARTHEAP_LIBRARY} -- cgit v1.2.3 From 5df04533f67abc3e0dce520d0ddb8d70bc7cae27 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 8 Dec 2009 10:17:41 +0000 Subject: DEV-41358: Updated the Search URL to the new staging area. --- indra/newview/skins/default/xui/en/floater_search.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index c5d6f885d3..82e4d87b28 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -14,7 +14,7 @@ width="670"> - http://eniac21.lindenlab.com:10001/viewer + http://int.searchwww-phx0.damballah.lindenlab.com/viewer -- cgit v1.2.3 From da2a0385ae6ee8962ed5d4f991df95df13d8e89a Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 8 Dec 2009 10:28:45 +0000 Subject: DEV-43439: Remove Back/Forward/Home buttons from Home side panel. As per request from Yoz. They will add navigation buttons to the actual HTML content. --- indra/newview/llpanelhome.cpp | 37 --------------- indra/newview/llpanelhome.h | 4 -- .../default/xui/en/panel_sidetray_home_tab.xml | 55 +--------------------- 3 files changed, 2 insertions(+), 94 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelhome.cpp b/indra/newview/llpanelhome.cpp index fb2629c692..92b6d2f619 100644 --- a/indra/newview/llpanelhome.cpp +++ b/indra/newview/llpanelhome.cpp @@ -69,48 +69,11 @@ BOOL LLPanelHome::postBuild() mBrowser->addObserver(this); mBrowser->setTrusted(true); mBrowser->setHomePageUrl(url); - - childSetAction("back", onClickBack, this); - childSetAction("forward", onClickForward, this); - childSetAction("home", onClickHome, this); } return TRUE; } -//static -void LLPanelHome::onClickBack(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateBack(); - } -} - -//static -void LLPanelHome::onClickForward(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateForward(); - } -} - -//static -void LLPanelHome::onClickHome(void* user_data) -{ - LLPanelHome *self = (LLPanelHome*)user_data; - if (self && self->mBrowser) - { - self->mBrowser->navigateHome(); - } -} - void LLPanelHome::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) { - // update back/forward button state - childSetEnabled("back", mBrowser->canNavigateBack()); - childSetEnabled("forward", mBrowser->canNavigateForward()); } diff --git a/indra/newview/llpanelhome.h b/indra/newview/llpanelhome.h index b5ca48b23f..dfeca45b29 100644 --- a/indra/newview/llpanelhome.h +++ b/indra/newview/llpanelhome.h @@ -53,10 +53,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - static void onClickBack(void* user_data); - static void onClickForward(void* user_data); - static void onClickHome(void* user_data); - private: // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); diff --git a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml index 4b841b0a09..1dd4eb095c 100644 --- a/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml +++ b/indra/newview/skins/default/xui/en/panel_sidetray_home_tab.xml @@ -20,58 +20,7 @@ top_pad="10" width="313"> - - - - - Date: Tue, 8 Dec 2009 10:51:33 +0000 Subject: DEV-43439: Added support for GRID substitution variable. The Home side panel URL, specified in settings.xml, now additionally supports a [GRID] substitution variable, with potential values equal to: "None", "Agni", "Aditi", etc. --- indra/newview/llviewerhelputil.cpp | 19 +++++-------------- indra/newview/llviewerhome.cpp | 2 ++ 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index 2642b2378e..0a03012af6 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -32,23 +32,14 @@ */ #include "llviewerprecompiledheaders.h" +#include "llviewerhelputil.h" -#include "llversionviewer.h" -#include "llviewerversion.h" - -//#include "llfloaterhelpbrowser.h" -//#include "llfloaterreg.h" -//#include "llfocusmgr.h" -//#include "llviewercontrol.h" -//#include "llappviewer.h" - +#include "llcontrol.h" #include "llstring.h" -#include "lluri.h" #include "llsys.h" - -#include "llcontrol.h" - -#include "llviewerhelputil.h" +#include "lluri.h" +#include "llversionviewer.h" +#include "llviewerversion.h" ////////////////////////////////////////////// diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp index ee1e46dc59..4556c3c5b1 100644 --- a/indra/newview/llviewerhome.cpp +++ b/indra/newview/llviewerhome.cpp @@ -40,6 +40,7 @@ #include "llsd.h" #include "llviewerversion.h" #include "llviewercontrol.h" +#include "llviewernetwork.h" //static std::string LLViewerHome::getHomeURL() @@ -52,6 +53,7 @@ std::string LLViewerHome::getHomeURL() substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); substitution["LANGUAGE"] = LLUI::getLanguage(); substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); + substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); std::string homeURL = gSavedSettings.getString("HomeSidePanelURL"); LLStringUtil::format(homeURL, substitution); -- cgit v1.2.3 From b133ed1ae0d6f7d1dd3738174895231c9a7aea2b Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 8 Dec 2009 11:22:45 +0000 Subject: EXT-2427: Added an About > Report Bug menu This menu brings up the Help Browser with the report_bug topic. To support this, I've created a new ShowHelp function that can be accessed from XUI. You can supply an optional help topic parameter, or if you specify no parameter then the default (F1) help is shown. --- indra/newview/llviewermenu.cpp | 26 +++++++++++++++++----- indra/newview/skins/default/xui/en/menu_login.xml | 3 +-- indra/newview/skins/default/xui/en/menu_viewer.xml | 11 +++++++-- 3 files changed, 31 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e68594ed6f..bf4d0c78e6 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5521,11 +5521,6 @@ class LLShowFloater : public view_listener_t { LLFloaterScriptDebug::show(LLUUID::null); } - else if (floater_name == "help f1") - { - LLViewerHelp* vhelp = LLViewerHelp::getInstance(); - vhelp->showTopic(vhelp->getTopicFromFocus()); - } else if (floater_name == "complaint reporter") { // Prevent menu from appearing in screen shot. @@ -5562,6 +5557,26 @@ class LLFloaterVisible : public view_listener_t } }; +class LLShowHelp : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string help_topic = userdata.asString(); + + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + if (help_topic.empty()) + { + vhelp->showTopic(vhelp->getTopicFromFocus()); + } + else + { + vhelp->showTopic(help_topic); + } + + return true; + } +}; + class LLShowSidetrayPanel : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7925,6 +7940,7 @@ void initialize_menus() // Generic actions view_listener_t::addMenu(new LLShowFloater(), "ShowFloater"); + view_listener_t::addMenu(new LLShowHelp(), "ShowHelp"); view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL"); view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile"); view_listener_t::addMenu(new LLToggleControl(), "ToggleControl"); diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index a22dc80f4e..9b439c16e0 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -45,8 +45,7 @@ name="Second Life Help" shortcut="F1"> + function="ShowHelp" /> + function="ShowHelp" /> + + + Date: Tue, 8 Dec 2009 12:20:22 +0000 Subject: EXT-2350: Added a help link to login panel. There is now a new "Need help logging in?" link on the right-hand side of the login panel. Clicking on this brings up the help browser with the pre_login_help topic (the same as pressing F1). --- indra/newview/llpanellogin.cpp | 14 +++++++++++++- indra/newview/llpanellogin.h | 1 + indra/newview/skins/default/textures/textures.xml | 4 ++-- indra/newview/skins/default/xui/en/panel_login.xml | 15 +++++++++++++-- 4 files changed, 29 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index d80d5c3d2e..e73c65e252 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -71,7 +71,6 @@ #include "llmediactrl.h" #include "llrootview.h" - #include "llfloatertos.h" #include "lltrans.h" #include "llglheaders.h" @@ -260,6 +259,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* create_new_account_text = getChild("create_new_account_text"); create_new_account_text->setClickedCallback(onClickNewAccount, NULL); + + LLTextBox* need_help_text = getChild("login_help"); + need_help_text->setClickedCallback(onClickHelp, NULL); #endif // get the web browser control @@ -963,6 +965,16 @@ void LLPanelLogin::onClickForgotPassword(void*) } } +//static +void LLPanelLogin::onClickHelp(void*) +{ + if (sInstance) + { + LLViewerHelp* vhelp = LLViewerHelp::getInstance(); + vhelp->showTopic(vhelp->getTopicFromFocus()); + } +} + // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index acb2001c22..e3d30d7d0c 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -96,6 +96,7 @@ private: // static bool newAccountAlertCallback(const LLSD& notification, const LLSD& response); static void onClickVersion(void*); static void onClickForgotPassword(void*); + static void onClickHelp(void*); static void onPassKey(LLLineEditor* caller, void* user_data); static void onSelectServer(LLUICtrl*, void*); static void onServerComboLostFocus(LLFocusableElement*); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7e309d2bad..6f9801491a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -194,8 +194,8 @@ with the same filename but different name - - + + diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index efe26d3887..22977b2274 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -167,8 +167,8 @@ text_color="EmphasisColor" halign="right" height="16" - top="17" - left_pad="10" + top="12" + left_pad="5" right="-10" name="create_new_account_text" width="180"> @@ -185,6 +185,17 @@ width="180"> Forgot your name or password? + + Need help logging in? + Date: Tue, 8 Dec 2009 14:56:19 +0000 Subject: DEV-43439: Created new LLVersionInfo API. Renamed llviewerversion to llversioninfo, to avoid confusion with llversionviewer in llcommon (llversion is already used by llwindow). Created new LLVersionInfo class with the following methods: static S32 getMajor(); static S32 getMinor(); static S32 getPatch(); static S32 getBuild(); static const std::string &getVersion(); static const std::string &getShortVersion(); static const std::string &getChannel(); All viewer code has been updated to use this API. Viewer code no longer directly includes llversionviewer.h from llcommon. --- indra/newview/CMakeLists.txt | 4 +- indra/newview/llappviewer.cpp | 33 ++++---- indra/newview/llcurrencyuimanager.cpp | 18 ++--- indra/newview/llfloaterabout.cpp | 15 ++-- indra/newview/llfloaterreporter.cpp | 6 +- indra/newview/llpanellogin.cpp | 13 +-- indra/newview/llstartup.cpp | 8 +- indra/newview/llversioninfo.cpp | 109 ++++++++++++++++++++++++++ indra/newview/llversioninfo.h | 71 +++++++++++++++++ indra/newview/llviewercontrol.cpp | 1 - indra/newview/llviewerhelp.cpp | 1 - indra/newview/llviewerhelputil.cpp | 13 ++- indra/newview/llviewerhome.cpp | 4 +- indra/newview/llviewermedia.cpp | 4 +- indra/newview/llviewerprecompiledheaders.h | 1 - indra/newview/tests/llviewerhelputil_test.cpp | 8 +- 16 files changed, 244 insertions(+), 65 deletions(-) create mode 100644 indra/newview/llversioninfo.cpp create mode 100644 indra/newview/llversioninfo.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9f525d82b9..f41505a82d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -448,6 +448,7 @@ set(viewer_SOURCE_FILES llurlsimstring.cpp llurlwhitelist.cpp llvectorperfoptions.cpp + llversioninfo.cpp llviewchildren.cpp llviewerassetstorage.cpp llviewerassettype.cpp @@ -497,7 +498,6 @@ set(viewer_SOURCE_FILES llviewertextureanim.cpp llviewertexturelist.cpp llviewerthrottle.cpp - llviewerversion.cpp llviewervisualparam.cpp llviewerwindow.cpp llviewerwindowlistener.cpp @@ -953,6 +953,7 @@ set(viewer_HEADER_FILES llurlsimstring.h llurlwhitelist.h llvectorperfoptions.h + llversioninfo.h llviewchildren.h llviewerassetstorage.h llviewerassettype.h @@ -999,7 +1000,6 @@ set(viewer_HEADER_FILES llviewertextureanim.h llviewertexturelist.h llviewerthrottle.h - llviewerversion.h llviewervisualparam.h llviewerwindow.h llviewerwindowlistener.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6bbc1eaa6a..508badcc6f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -35,8 +35,7 @@ #include "llappviewer.h" // Viewer includes -#include "llversionviewer.h" -#include "llviewerversion.h" +#include "llversioninfo.h" #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" @@ -650,7 +649,7 @@ bool LLAppViewer::init() // Build a string representing the current version number. gCurrentVersion = llformat("%s %s", gSavedSettings.getString("VersionChannelName").c_str(), - llGetViewerVersion().c_str()); + LLVersionInfo::getVersion().c_str()); ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -1871,7 +1870,7 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setString("ClientSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); - gSavedSettings.setString("VersionChannelName", LL_CHANNEL); + gSavedSettings.setString("VersionChannelName", LLVersionInfo::getChannel()); #ifndef LL_RELEASE_FOR_DOWNLOAD // provide developer build only overrides for these control variables that are not @@ -2482,10 +2481,10 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["SLLog"] = LLError::logFileName(); gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); - gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR; - gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR; - gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; - gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD; + gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor(); + gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor(); + gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch(); + gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::getBuild(); gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); @@ -2519,7 +2518,7 @@ void LLAppViewer::writeSystemInfo() // Dump some debugging info LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") - << " version " << llGetViewerShortVersion() << LL_ENDL; + << " version " << LLVersionInfo::getShortVersion() << LL_ENDL; // Dump the local time and time zone time_t now; @@ -2573,10 +2572,10 @@ void LLAppViewer::handleViewerCrash() //to check against no matter what gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); - gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR; - gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR; - gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; - gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD; + gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor(); + gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor(); + gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch(); + gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::getBuild(); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) @@ -4150,10 +4149,10 @@ void LLAppViewer::handleLoginComplete() // Store some data to DebugInfo in case of a freeze. gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); - gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR; - gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR; - gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; - gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD; + gDebugInfo["ClientInfo"]["MajorVersion"] = LLVersionInfo::getMajor(); + gDebugInfo["ClientInfo"]["MinorVersion"] = LLVersionInfo::getMinor(); + gDebugInfo["ClientInfo"]["PatchVersion"] = LLVersionInfo::getPatch(); + gDebugInfo["ClientInfo"]["BuildVersion"] = LLVersionInfo::getBuild(); LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 544711a862..00c05445e1 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -36,7 +36,7 @@ #include "lltextbox.h" #include "lllineeditor.h" #include "llviewercontrol.h" -#include "llversionviewer.h" +#include "llversioninfo.h" #include "llcurrencyuimanager.h" @@ -170,10 +170,10 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo() gAgent.getSecureSessionID().asString()); keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy); keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName")); - keywordArgs.appendInt("viewerMajorVersion", LL_VERSION_MAJOR); - keywordArgs.appendInt("viewerMinorVersion", LL_VERSION_MINOR); - keywordArgs.appendInt("viewerPatchVersion", LL_VERSION_PATCH); - keywordArgs.appendInt("viewerBuildVersion", LL_VERSION_BUILD); + keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor()); + keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor()); + keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch()); + keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::getBuild()); LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); @@ -244,10 +244,10 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password) keywordArgs.appendString("password", password); } keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName")); - keywordArgs.appendInt("viewerMajorVersion", LL_VERSION_MAJOR); - keywordArgs.appendInt("viewerMinorVersion", LL_VERSION_MINOR); - keywordArgs.appendInt("viewerPatchVersion", LL_VERSION_PATCH); - keywordArgs.appendInt("viewerBuildVersion", LL_VERSION_BUILD); + keywordArgs.appendInt("viewerMajorVersion", LLVersionInfo::getMajor()); + keywordArgs.appendInt("viewerMinorVersion", LLVersionInfo::getMinor()); + keywordArgs.appendInt("viewerPatchVersion", LLVersionInfo::getPatch()); + keywordArgs.appendInt("viewerBuildVersion", LLVersionInfo::getBuild()); LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index b2588cc01b..e80499688e 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -45,8 +45,7 @@ #include "llviewercontrol.h" #include "llviewerstats.h" #include "llviewerregion.h" -#include "llversionviewer.h" -#include "llviewerversion.h" +#include "llversioninfo.h" #include "llweb.h" // Linden library includes @@ -212,12 +211,12 @@ LLSD LLFloaterAbout::getInfo() // LLFloaterAbout. LLSD info; LLSD version; - version.append(LL_VERSION_MAJOR); - version.append(LL_VERSION_MINOR); - version.append(LL_VERSION_PATCH); - version.append(LL_VERSION_BUILD); + version.append(LLVersionInfo::getMajor()); + version.append(LLVersionInfo::getMinor()); + version.append(LLVersionInfo::getPatch()); + version.append(LLVersionInfo::getBuild()); info["VIEWER_VERSION"] = version; - info["VIEWER_VERSION_STR"] = llGetViewerVersion(); + info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion(); info["BUILD_DATE"] = __DATE__; info["BUILD_TIME"] = __TIME__; info["CHANNEL"] = gSavedSettings.getString("VersionChannelName"); @@ -285,7 +284,7 @@ static std::string get_viewer_release_notes_url() { LLSD query; query["channel"] = gSavedSettings.getString("VersionChannelName"); - query["version"] = llGetViewerVersion(); + query["version"] = LLVersionInfo::getVersion(); std::ostringstream url; url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index be821ad43b..408303a1e0 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -75,7 +75,7 @@ #include "llfloateravatarpicker.h" #include "lldir.h" #include "llselectmgr.h" -#include "llviewerversion.h" +#include "llversioninfo.h" #include "lluictrlfactory.h" #include "llviewernetwork.h" @@ -608,7 +608,7 @@ LLSD LLFloaterReporter::gatherReport() std::ostringstream details; - details << "V" << llGetViewerVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports + details << "V" << LLVersionInfo::getVersion() << std::endl << std::endl; // client version moved to body of email for abuse reports std::string object_name = childGetText("object_name"); if (!object_name.empty() && !mOwnerName.empty()) @@ -626,7 +626,7 @@ LLSD LLFloaterReporter::gatherReport() std::string version_string; version_string = llformat( "%s %s %s %s %s", - llGetViewerShortVersion().c_str(), + LLVersionInfo::getShortVersion().c_str(), platform, gSysCPU.getFamily().c_str(), gGLManager.mGLRenderer.c_str(), diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e73c65e252..a729b8c06f 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -39,7 +39,6 @@ #include "llfontgl.h" #include "llmd5.h" #include "llsecondlifeurls.h" -#include "llversionviewer.h" #include "v4color.h" #include "llbutton.h" @@ -57,7 +56,7 @@ #include "llui.h" #include "lluiconstants.h" #include "llurlsimstring.h" -#include "llviewerversion.h" +#include "llversioninfo.h" #include "llviewerhelp.h" #include "llviewertexturelist.h" #include "llviewermenu.h" // for handle_preferences() @@ -247,8 +246,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, getChild("login_widgets")->setDefaultBtn("connect_btn"); std::string channel = gSavedSettings.getString("VersionChannelName"); - std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), - llGetViewerBuildVersion().c_str()); + std::string version = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); LLTextBox* channel_text = getChild("channel_text"); channel_text->setTextArg("[CHANNEL]", channel); // though not displayed channel_text->setTextArg("[VERSION]", version); @@ -740,8 +740,9 @@ void LLPanelLogin::loadLoginPage() } // Channel and Version - std::string version = llformat("%s (%s)", llGetViewerShortVersion().c_str(), - llGetViewerBuildVersion().c_str()); + std::string version = llformat("%s (%d)", + LLVersionInfo::getShortVersion().c_str(), + LLVersionInfo::getBuild()); char* curl_channel = curl_escape(gSavedSettings.getString("VersionChannelName").c_str(), 0); char* curl_version = curl_escape(version.c_str(), 0); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 58df2ffb19..be0c92a76d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -77,7 +77,7 @@ #include "llsecondlifeurls.h" #include "llstring.h" #include "lluserrelations.h" -#include "llversionviewer.h" +#include "llversioninfo.h" #include "llviewercontrol.h" #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address @@ -542,9 +542,9 @@ bool idle_startup() if(!start_messaging_system( message_template_path, port, - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, + LLVersionInfo::getMajor(), + LLVersionInfo::getMinor(), + LLVersionInfo::getPatch(), FALSE, std::string(), responder, diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp new file mode 100644 index 0000000000..148931d3ad --- /dev/null +++ b/indra/newview/llversioninfo.cpp @@ -0,0 +1,109 @@ +/** + * @file llversioninfo.cpp + * @brief Routines to access the viewer version and build information + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 "llversioninfo.h" + +#include "llversionviewer.h" + +// +// Set the version numbers in indra/llcommon/llversionviewer.h +// + +//static +S32 LLVersionInfo::getMajor() +{ + return LL_VERSION_MAJOR; +} + +//static +S32 LLVersionInfo::getMinor() +{ + return LL_VERSION_MINOR; +} + +//static +S32 LLVersionInfo::getPatch() +{ + return LL_VERSION_PATCH; +} + +//static +S32 LLVersionInfo::getBuild() +{ + return LL_VERSION_BUILD; +} + +//static +const std::string &LLVersionInfo::getVersion() +{ + static std::string version(""); + + if (version.empty()) + { + // cache the version string + std::ostringstream stream; + stream << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH << "." + << LL_VERSION_BUILD; + version = stream.str(); + } + + return version; +} + +//static +const std::string &LLVersionInfo::getShortVersion() +{ + static std::string version(""); + + if (version.empty()) + { + // cache the version string + std::ostringstream stream; + stream << LL_VERSION_MAJOR << "." + << LL_VERSION_MINOR << "." + << LL_VERSION_PATCH; + version = stream.str(); + } + + return version; +} + +//static +const std::string &LLVersionInfo::getChannel() +{ + static std::string name(LL_CHANNEL); + return name; +} diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h new file mode 100644 index 0000000000..b05109e478 --- /dev/null +++ b/indra/newview/llversioninfo.h @@ -0,0 +1,71 @@ +/** + * @file llversioninfo.h + * @brief Routines to access the viewer version and build information + * @author Martin Reddy + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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_LLVERSIONINFO_H +#define LL_LLVERSIONINFO_H + +#include + +/// +/// This API provides version information for the viewer. This +/// includes access to the major, minor, patch, and build integer +/// values, as well as human-readable string representations. All +/// viewer code that wants to query the current version should +/// use this API. +/// +class LLVersionInfo +{ +public: + /// return the major verion number as an integer + static S32 getMajor(); + + /// return the minor verion number as an integer + static S32 getMinor(); + + /// return the patch verion number as an integer + static S32 getPatch(); + + /// return the build number as an integer + static S32 getBuild(); + + /// return the full viewer version as a string like "2.0.0.200030" + static const std::string &getVersion(); + + /// return the viewer version as a string like "2.0.0" + static const std::string &getShortVersion(); + + /// return the channel name, e.g. "Second Life" + static const std::string &getChannel(); +}; + +#endif diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 5e23a7e114..6339d23fa7 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -67,7 +67,6 @@ #include "lloverlaybar.h" #include "llkeyboard.h" #include "llerrorcontrol.h" -#include "llversionviewer.h" #include "llappviewer.h" #include "llvosurfacepatch.h" #include "llvowlsky.h" diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 056260791c..297c0cc111 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -37,7 +37,6 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llviewercontrol.h" -#include "llversionviewer.h" #include "llappviewer.h" #include "lllogininstance.h" diff --git a/indra/newview/llviewerhelputil.cpp b/indra/newview/llviewerhelputil.cpp index 0a03012af6..df08470518 100644 --- a/indra/newview/llviewerhelputil.cpp +++ b/indra/newview/llviewerhelputil.cpp @@ -38,8 +38,7 @@ #include "llstring.h" #include "llsys.h" #include "lluri.h" -#include "llversionviewer.h" -#include "llviewerversion.h" +#include "llversioninfo.h" ////////////////////////////////////////////// @@ -78,11 +77,11 @@ std::string LLViewerHelpUtil::buildHelpURL( const std::string &topic, substitution["CHANNEL"] = helpURLEncode(savedSettings.getString("VersionChannelName")); - substitution["VERSION"] = helpURLEncode(llGetViewerVersion()); - substitution["VERSION_MAJOR"] = buildHelpVersion(LL_VERSION_MAJOR); - substitution["VERSION_MINOR"] = buildHelpVersion(LL_VERSION_MINOR); - substitution["VERSION_PATCH"] = buildHelpVersion(LL_VERSION_PATCH); - substitution["VERSION_BUILD"] = buildHelpVersion(LL_VERSION_BUILD); + substitution["VERSION"] = helpURLEncode(LLVersionInfo::getVersion()); + substitution["VERSION_MAJOR"] = buildHelpVersion(LLVersionInfo::getMajor()); + substitution["VERSION_MINOR"] = buildHelpVersion(LLVersionInfo::getMinor()); + substitution["VERSION_PATCH"] = buildHelpVersion(LLVersionInfo::getPatch()); + substitution["VERSION_BUILD"] = buildHelpVersion(LLVersionInfo::getBuild()); substitution["OS"] = helpURLEncode(osinfo.getOSStringSimple()); diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp index 4556c3c5b1..58630978c4 100644 --- a/indra/newview/llviewerhome.cpp +++ b/indra/newview/llviewerhome.cpp @@ -38,7 +38,7 @@ #include "llui.h" #include "lluri.h" #include "llsd.h" -#include "llviewerversion.h" +#include "llversioninfo.h" #include "llviewercontrol.h" #include "llviewernetwork.h" @@ -49,7 +49,7 @@ std::string LLViewerHome::getHomeURL() // this value from settings.xml and support various substitutions LLSD substitution; - substitution["VERSION"] = llGetViewerVersion(); + substitution["VERSION"] = LLVersionInfo::getVersion(); substitution["CHANNEL"] = LLURI::escape(gSavedSettings.getString("VersionChannelName")); substitution["LANGUAGE"] = LLUI::getLanguage(); substitution["AUTH_KEY"] = LLURI::escape(getAuthKey()); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index a206768d33..952de00272 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -37,11 +37,11 @@ #include "llviewermediafocus.h" #include "llmimetypes.h" #include "llmediaentry.h" +#include "llversioninfo.h" #include "llviewercontrol.h" #include "llviewertexture.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llviewerversion.h" #include "llviewertexturelist.h" #include "llvovolume.h" #include "llpluginclassmedia.h" @@ -446,7 +446,7 @@ std::string LLViewerMedia::getCurrentUserAgent() // http://www.mozilla.org/build/revised-user-agent-strings.html std::ostringstream codec; codec << "SecondLife/"; - codec << llGetViewerVersion(); + codec << LLVersionInfo::getVersion(); codec << " (" << channel << "; " << skin_name << " skin)"; llinfos << codec.str() << llendl; diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 86f59b6e2f..6a0ad5757f 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -109,7 +109,6 @@ #include "llthread.h" #include "lltimer.h" #include "lluuidhashmap.h" -//#include "llversionviewer.h" //#include "processor.h" #include "stdenums.h" #include "stdtypes.h" diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 90e3e7a7e0..68743357a6 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -36,7 +36,7 @@ #include "../test/lltut.h" #include "../llviewerhelputil.h" -#include "../llviewerversion.h" +#include "../llversioninfo.h" #include "llcontrol.h" #include "llsys.h" @@ -76,7 +76,11 @@ std::string LLControlGroup::getString(const std::string& name) return test_stringvec[name]; } -const std::string &llGetViewerVersion() +S32 LLVersionInfo::getMajor() { return 2; } +S32 LLVersionInfo::getMinor() { return 0; } +S32 LLVersionInfo::getPatch() { return 0; } +S32 LLVersionInfo::getBuild() { return 200099; } +const std::string &LLVersionInfo::getVersion() { static std::string version = "2.0.0.200099"; return version; -- cgit v1.2.3 From 0c607a6b88eef34987fdbd79843b693548f4adec Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 8 Dec 2009 15:16:04 +0000 Subject: DEV-43679: Pass god mode through to search. The state of gAgent.isGodlike() is now passed through to the Search web pages via a new g=[0|1] query parameter. --- indra/newview/llfloatersearch.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 4d3724a758..2c618263ec 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -144,6 +144,10 @@ void LLFloaterSearch::search(const LLSD &key) // add the current localization information url += "&lang=" + LLUI::getLanguage(); + // add the user's god status + std::string godlike = gAgent.isGodlike() ? "1" : "0"; + url += "&g=" + godlike; + // and load the URL in the web view mBrowser->navigateTo(url); } -- cgit v1.2.3 From 05e4a307b83f7c5ad5f7bd22308b144e65904d2b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 12:59:54 -0500 Subject: Formatting cleanup for (currently unused) llsidepaneltaskinfo. --HG-- branch : avatar-pipeline --- indra/newview/llsidepaneltaskinfo.cpp | 95 ++++++++++++++++++++--------------- indra/newview/llsidepaneltaskinfo.h | 3 ++ 2 files changed, 57 insertions(+), 41 deletions(-) (limited to 'indra') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 3e3a63d438..464546cc77 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -106,6 +106,8 @@ BOOL LLSidepanelTaskInfo::postBuild() mLabelGroupName = getChild("Group Name Proxy"); + childSetCommitCallback("checkbox for sale",onClickForSale,this); + return TRUE; } @@ -474,7 +476,7 @@ void LLSidepanelTaskInfo::refresh() U32 base_mask_on = 0; U32 base_mask_off = 0; - //U32 owner_mask_off = 0; + U32 owner_mask_off = 0; U32 owner_mask_on = 0; U32 group_mask_on = 0; U32 group_mask_off = 0; @@ -486,11 +488,10 @@ void LLSidepanelTaskInfo::refresh() BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, &base_mask_on, &base_mask_off); - /* - BOOL valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - */ + //BOOL valid_owner_perms =// + LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, &group_mask_on, &group_mask_off); @@ -506,50 +507,41 @@ void LLSidepanelTaskInfo::refresh() if (gSavedSettings.getBOOL("DebugPermissions") ) { - std::string perm_string; if (valid_base_perms) { - perm_string = "B: " + mask_to_string(base_mask_on); - childSetText("B:", perm_string); - childSetVisible("B:", TRUE); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - perm_string = "O: " + mask_to_string(owner_mask_on); - childSetText("O:", perm_string); - childSetVisible("O:", TRUE); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - perm_string = "G: " + mask_to_string(group_mask_on); - childSetText("G:", perm_string); - childSetVisible("G:", TRUE); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - perm_string = "E: " + mask_to_string(everyone_mask_on); - childSetText("E:", perm_string); - childSetVisible("E:", TRUE); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - perm_string = "N: " + mask_to_string(next_owner_mask_on); - childSetText("N:", perm_string); - childSetVisible("N:", TRUE); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } + U32 flag_mask = 0x0; - if (objectp->permMove()) - flag_mask |= PERM_MOVE; - if (objectp->permModify()) - flag_mask |= PERM_MODIFY; - if (objectp->permCopy()) - flag_mask |= PERM_COPY; - if (objectp->permTransfer()) - flag_mask |= PERM_TRANSFER; - perm_string = "F:" + mask_to_string(flag_mask); - childSetText("F:", perm_string); - childSetVisible("F:", TRUE); + if (objectp->permMove()) flag_mask |= PERM_MOVE; + if (objectp->permModify()) flag_mask |= PERM_MODIFY; + if (objectp->permCopy()) flag_mask |= PERM_COPY; + if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; + + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:", FALSE); - childSetVisible("O:", FALSE); - childSetVisible("G:", FALSE); - childSetVisible("E:", FALSE); - childSetVisible("N:", FALSE); - childSetVisible("F:", FALSE); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } BOOL has_change_perm_ability = FALSE; @@ -745,8 +737,14 @@ void LLSidepanelTaskInfo::refresh() // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. - const BOOL cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - childSetEnabled("checkbox for sale", (num_for_sale && has_change_sale_ability && cannot_actually_sell)); + bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); + if (cannot_actually_sell) + { + if (num_for_sale && has_change_sale_ability) + { + childSetEnabled("checkbox for sale", true); + } + } // Check search status of objects const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); @@ -973,6 +971,21 @@ void LLSidepanelTaskInfo::setAllSaleInfo() } } +// static +void LLSidepanelTaskInfo::onClickForSale(LLUICtrl* ctrl, void* data) +{ + LLSidepanelTaskInfo* self = (LLSidepanelTaskInfo*)data; + self->updateUIFromSaleInfo(); +} + +void LLSidepanelTaskInfo::updateUIFromSaleInfo() +{ + /* + TODO: Update sale button enable/disable state and default + sale button settings when this sale button is enabled/disabled. + */ +} + struct LLSelectionPayable : public LLSelectedObjectFunctor { virtual bool apply(LLViewerObject* obj) diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 83afac9da8..7c6d9983ae 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -91,6 +91,9 @@ protected: void setAllSaleInfo(); + static void onClickForSale(LLUICtrl* ctrl, void *data); + void updateUIFromSaleInfo(); + void disableAll(); private: -- cgit v1.2.3 From ef35d12ec0d4d011fe3d6312da186d7e35886d99 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 13:25:03 -0500 Subject: Incorporated code formatting cleanup from llsidepaneltaskinfo into llpanelpermissions. No functionality changes. --HG-- branch : avatar-pipeline --- indra/newview/llpanelpermissions.cpp | 654 +++++++++++++++++------------------ 1 file changed, 316 insertions(+), 338 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 6a29d76aad..8b8b1bed37 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -181,6 +181,85 @@ LLPanelPermissions::~LLPanelPermissions() } +void LLPanelPermissions::disableAll() +{ + childSetEnabled("perm_modify", FALSE); + childSetText("perm_modify", LLStringUtil::null); + + childSetEnabled("Creator:", FALSE); + childSetText("Creator Name", LLStringUtil::null); + childSetEnabled("Creator Name", FALSE); + + childSetEnabled("Owner:", FALSE); + childSetText("Owner Name", LLStringUtil::null); + childSetEnabled("Owner Name", FALSE); + + childSetEnabled("Group:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("button set group", FALSE); + + childSetText("Object Name", LLStringUtil::null); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Name:", FALSE); + childSetText("Group Name", LLStringUtil::null); + childSetEnabled("Group Name", FALSE); + childSetEnabled("Description:", FALSE); + childSetText("Object Description", LLStringUtil::null); + childSetEnabled("Object Description", FALSE); + + childSetEnabled("Permissions:", FALSE); + + childSetValue("checkbox share with group", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); + + childSetValue("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetValue("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); + + //Next owner can: + childSetEnabled("Next owner can:", FALSE); + childSetValue("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); + + //checkbox for sale + childSetValue("checkbox for sale", FALSE); + childSetEnabled("checkbox for sale", FALSE); + + //checkbox include in search + childSetValue("search_check", FALSE); + childSetEnabled("search_check", FALSE); + + LLComboBox* combo_sale_type = getChild("sale type"); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); + combo_sale_type->setEnabled(FALSE); + + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); + + childSetEnabled("label click action", FALSE); + LLComboBox* combo_click_action = getChild("clickaction"); + if (combo_click_action) + { + combo_click_action->setEnabled(FALSE); + combo_click_action->clear(); + } + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); +} + void LLPanelPermissions::refresh() { LLButton* BtnDeedToGroup = getChild("button deed"); @@ -215,136 +294,58 @@ void LLPanelPermissions::refresh() if(!nodep || !objectp)// || attachment_selected) { // ...nothing selected - childSetEnabled("perm_modify",false); - childSetText("perm_modify",LLStringUtil::null); - - childSetEnabled("Creator:",false); - childSetText("Creator Name",LLStringUtil::null); - childSetEnabled("Creator Name",false); - - childSetEnabled("Owner:",false); - childSetText("Owner Name",LLStringUtil::null); - childSetEnabled("Owner Name",false); - - childSetEnabled("Group:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("button set group",false); - - childSetText("Object Name",LLStringUtil::null); - childSetEnabled("Object Name",false); - childSetEnabled("Name:",false); - childSetText("Group Name",LLStringUtil::null); - childSetEnabled("Group Name",false); - childSetEnabled("Description:",false); - childSetText("Object Description",LLStringUtil::null); - childSetEnabled("Object Description",false); - - childSetEnabled("Permissions:",false); - - childSetValue("checkbox share with group",FALSE); - childSetEnabled("checkbox share with group",false); - childSetEnabled("button deed",false); - - childSetValue("checkbox allow everyone move",FALSE); - childSetEnabled("checkbox allow everyone move",false); - childSetValue("checkbox allow everyone copy",FALSE); - childSetEnabled("checkbox allow everyone copy",false); - - //Next owner can: - childSetEnabled("Next owner can:",false); - childSetValue("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can modify",false); - childSetValue("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can copy",false); - childSetValue("checkbox next owner can transfer",FALSE); - childSetEnabled("checkbox next owner can transfer",false); - - //checkbox for sale - childSetValue("checkbox for sale",FALSE); - childSetEnabled("checkbox for sale",false); - - //checkbox include in search - childSetValue("search_check", FALSE); - childSetEnabled("search_check", false); - - LLComboBox* combo_sale_type = getChild("sale type"); - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setEnabled(FALSE); - - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); - - childSetEnabled("label click action",false); - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) - { - ComboClickAction->setEnabled(FALSE); - ComboClickAction->clear(); - } - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); - + disableAll(); return; } // figure out a few variables - BOOL is_one_object = (object_count == 1); - + const BOOL is_one_object = (object_count == 1); + // BUG: fails if a root and non-root are both single-selected. BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsModify()) - || LLSelectMgr::getInstance()->selectGetModify(); + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); + S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = - { - getString("text modify info 1"), - getString("text modify info 2"), - getString("text modify info 3"), - getString("text modify info 4") - }; - if(!is_perm_modify) + { + getString("text modify info 1"), + getString("text modify info 2"), + getString("text modify info 3"), + getString("text modify info 4") + }; + if (!is_perm_modify) { string_index += 2; } - if(!is_one_object) + if (!is_one_object) { ++string_index; } - childSetEnabled("perm_modify",true); - childSetText("perm_modify",MODIFY_INFO_STRINGS[string_index]); + childSetEnabled("perm_modify", TRUE); + childSetText("perm_modify", MODIFY_INFO_STRINGS[string_index]); - childSetEnabled("Permissions:",true); + childSetEnabled("Permissions:", TRUE); // Update creator text field - childSetEnabled("Creator:",true); + childSetEnabled("Creator:", TRUE); BOOL creators_identical; std::string creator_name; creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, - creator_name); + creator_name); - childSetText("Creator Name",creator_name); - childSetEnabled("Creator Name",TRUE); + childSetText("Creator Name", creator_name); + childSetEnabled("Creator Name", TRUE); // Update owner text field - childSetEnabled("Owner:",true); + childSetEnabled("Owner:", TRUE); - BOOL owners_identical; std::string owner_name; - owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); - -// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; - + const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); if (mOwnerID.isNull()) { - if(LLSelectMgr::getInstance()->selectIsGroupOwned()) + if (LLSelectMgr::getInstance()->selectIsGroupOwned()) { // Group owned already displayed by selectGetOwner } @@ -359,61 +360,53 @@ void LLPanelPermissions::refresh() if (!mLastOwnerID.isNull() && !last_owner_name.empty()) { owner_name.append(", last "); - owner_name.append( last_owner_name ); + owner_name.append(last_owner_name); } } } - - childSetText("Owner Name",owner_name); - childSetEnabled("Owner Name",TRUE); + childSetText("Owner Name", owner_name); + childSetEnabled("Owner Name", TRUE); // update group text field - childSetEnabled("Group:",true); - childSetText("Group Name",LLStringUtil::null); + childSetEnabled("Group:", TRUE); + childSetText("Group Name", LLStringUtil::null); LLUUID group_id; BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) { - if(mLabelGroupName) + if (mLabelGroupName) { - mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id,TRUE); mLabelGroupName->setEnabled(TRUE); } } else { - if(mLabelGroupName) + if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); mLabelGroupName->setEnabled(FALSE); } } - childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID())); - - // figure out the contents of the name, description, & category - BOOL edit_name_desc = FALSE; - if(is_one_object && objectp->permModify()) - { - edit_name_desc = TRUE; - } + childSetEnabled("button set group", owners_identical && (mOwnerID == gAgent.getID())); - childSetEnabled("Name:",true); + childSetEnabled("Name:", TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); - childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); + childSetEnabled("Description:", TRUE); + LLLineEditor* LineEditorObjectDesc = getChild("Object Description"); - if(is_one_object) + if (is_one_object) { - if(keyboard_focus_view != LineEditorObjectName) + if (keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } - if(LineEditorObjectDesc) + if (LineEditorObjectDesc) { - if(keyboard_focus_view != LineEditorObjectDesc) + if (keyboard_focus_view != LineEditorObjectDesc) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -421,19 +414,25 @@ void LLPanelPermissions::refresh() } else { - childSetText("Object Name",LLStringUtil::null); + childSetText("Object Name", LLStringUtil::null); LineEditorObjectDesc->setText(LLStringUtil::null); } - if(edit_name_desc) + // figure out the contents of the name, description, & category + BOOL edit_name_desc = FALSE; + if (is_one_object && objectp->permModify()) { - childSetEnabled("Object Name",true); - childSetEnabled("Object Description",true); + edit_name_desc = TRUE; + } + if (edit_name_desc) + { + childSetEnabled("Object Name", TRUE); + childSetEnabled("Object Description", TRUE); } else { - childSetEnabled("Object Name",false); - childSetEnabled("Object Description",false); + childSetEnabled("Object Name", FALSE); + childSetEnabled("Object Description", FALSE); } S32 total_sale_price = 0; @@ -442,10 +441,10 @@ void LLPanelPermissions::refresh() BOOL is_sale_price_mixed = FALSE; U32 num_for_sale = FALSE; LLSelectMgr::getInstance()->selectGetAggregateSaleInfo(num_for_sale, - is_for_sale_mixed, - is_sale_price_mixed, - total_sale_price, - individual_sale_price); + is_for_sale_mixed, + is_sale_price_mixed, + total_sale_price, + individual_sale_price); const BOOL self_owned = (gAgent.getID() == mOwnerID); const BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ; @@ -453,35 +452,35 @@ void LLPanelPermissions::refresh() const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer(); const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy(); - if(!owners_identical) + if (!owners_identical) { - childSetEnabled("Cost",false); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // You own these objects. - else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) + else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost",getString("Cost Per Unit")); + childSetText("Cost", getString("Cost Per Unit")); } else { - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } LLSpinCtrl *edit_price = getChild("Edit Cost"); - if(!edit_price->hasFocus()) + if (!edit_price->hasFocus()) { // If the sale price is mixed then set the cost to MIXED, otherwise // set to the actual cost. - if (num_for_sale > 0 && is_for_sale_mixed) + if ((num_for_sale > 0) && is_for_sale_mixed) { edit_price->setTentative(TRUE); } - else if (num_for_sale > 0 && is_sale_price_mixed) + else if ((num_for_sale > 0) && is_sale_price_mixed) { edit_price->setTentative(TRUE); } @@ -492,303 +491,279 @@ void LLPanelPermissions::refresh() } // The edit fields are only enabled if you can sell this object // and the sale price is not mixed. - bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false; - childSetEnabled("Cost",enable_edit); - childSetEnabled("Edit Cost",enable_edit); + BOOL enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : FALSE; + childSetEnabled("Cost", enable_edit); + childSetEnabled("Edit Cost", enable_edit); } // Someone, not you, owns these objects. - else if(!public_owned) + else if (!public_owned) { - childSetEnabled("Cost",false); - childSetEnabled("Edit Cost",false); + childSetEnabled("Cost", FALSE); + childSetEnabled("Edit Cost", FALSE); // Don't show a price if none of the items are for sale. if (num_for_sale) - childSetText("Edit Cost",llformat("%d",total_sale_price)); + childSetText("Edit Cost", llformat("%d",total_sale_price)); else - childSetText("Edit Cost",LLStringUtil::null); + childSetText("Edit Cost", LLStringUtil::null); // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost",getString("Cost Total")); + childSetText("Cost", getString("Cost Total")); else - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default")); } // This is a public object. else { - childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetEnabled("Cost", FALSE); + childSetText("Cost", getString("Cost Default")); - childSetText("Edit Cost",LLStringUtil::null); - childSetEnabled("Edit Cost",false); + childSetText("Edit Cost", LLStringUtil::null); + childSetEnabled("Edit Cost", FALSE); } // Enable and disable the permissions checkboxes // based on who owns the object. // TODO: Creator permissions - BOOL valid_base_perms = FALSE; - BOOL valid_owner_perms = FALSE; - BOOL valid_group_perms = FALSE; - BOOL valid_everyone_perms = FALSE; - BOOL valid_next_perms = FALSE; - - U32 base_mask_on; - U32 base_mask_off; - U32 owner_mask_on; - U32 owner_mask_off; - U32 group_mask_on; - U32 group_mask_off; - U32 everyone_mask_on; - U32 everyone_mask_off; - U32 next_owner_mask_on = 0; - U32 next_owner_mask_off = 0; - - valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, - &base_mask_on, - &base_mask_off); - - valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, - &owner_mask_on, - &owner_mask_off); - - valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, - &group_mask_on, - &group_mask_off); + U32 base_mask_on = 0; + U32 base_mask_off = 0; + U32 owner_mask_off = 0; + U32 owner_mask_on = 0; + U32 group_mask_on = 0; + U32 group_mask_off = 0; + U32 everyone_mask_on = 0; + U32 everyone_mask_off = 0; + U32 next_owner_mask_on = 0; + U32 next_owner_mask_off = 0; + + BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, + &base_mask_on, + &base_mask_off); + //BOOL valid_owner_perms =// + LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + &owner_mask_on, + &owner_mask_off); + BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, + &group_mask_on, + &group_mask_off); - valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, - &everyone_mask_on, - &everyone_mask_off); + BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, + &everyone_mask_on, + &everyone_mask_off); - valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, - &next_owner_mask_on, - &next_owner_mask_off); + BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, + &next_owner_mask_on, + &next_owner_mask_off); - if( gSavedSettings.getBOOL("DebugPermissions") ) + if (gSavedSettings.getBOOL("DebugPermissions") ) { - std::string perm_string; if (valid_base_perms) { - perm_string = "B: "; - perm_string += mask_to_string(base_mask_on); - childSetText("B:",perm_string); - childSetVisible("B:",true); + childSetText("B:", "B: " + mask_to_string(base_mask_on)); + childSetVisible("B:", TRUE); - perm_string = "O: "; - perm_string += mask_to_string(owner_mask_on); - childSetText("O:",perm_string); - childSetVisible("O:",true); + childSetText("O:", "O: " + mask_to_string(owner_mask_on)); + childSetVisible("O:", TRUE); - perm_string = "G: "; - perm_string += mask_to_string(group_mask_on); - childSetText("G:",perm_string); - childSetVisible("G:",true); + childSetText("G:", "G: " + mask_to_string(group_mask_on)); + childSetVisible("G:", TRUE); - perm_string = "E: "; - perm_string += mask_to_string(everyone_mask_on); - childSetText("E:",perm_string); - childSetVisible("E:",true); + childSetText("E:", "E: " + mask_to_string(everyone_mask_on)); + childSetVisible("E:", TRUE); - perm_string = "N: "; - perm_string += mask_to_string(next_owner_mask_on); - childSetText("N:",perm_string); - childSetVisible("N:",true); + childSetText("N:", "N: " + mask_to_string(next_owner_mask_on)); + childSetVisible("N:", TRUE); } - perm_string = "F: "; + U32 flag_mask = 0x0; - if (objectp->permMove()) - flag_mask |= PERM_MOVE; - if (objectp->permModify()) - flag_mask |= PERM_MODIFY; - if (objectp->permCopy()) - flag_mask |= PERM_COPY; - if (objectp->permTransfer()) - flag_mask |= PERM_TRANSFER; - perm_string += mask_to_string(flag_mask); - childSetText("F:",perm_string); - childSetVisible("F:",true); + if (objectp->permMove()) flag_mask |= PERM_MOVE; + if (objectp->permModify()) flag_mask |= PERM_MODIFY; + if (objectp->permCopy()) flag_mask |= PERM_COPY; + if (objectp->permTransfer()) flag_mask |= PERM_TRANSFER; + + childSetText("F:", "F:" + mask_to_string(flag_mask)); + childSetVisible("F:", TRUE); } else { - childSetVisible("B:",false); - childSetVisible("O:",false); - childSetVisible("G:",false); - childSetVisible("E:",false); - childSetVisible("N:",false); - childSetVisible("F:",false); + childSetVisible("B:", FALSE); + childSetVisible("O:", FALSE); + childSetVisible("G:", FALSE); + childSetVisible("E:", FALSE); + childSetVisible("N:", FALSE); + childSetVisible("F:", FALSE); } - bool has_change_perm_ability = false; - bool has_change_sale_ability = false; + BOOL has_change_perm_ability = FALSE; + BOOL has_change_sale_ability = FALSE; - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { - has_change_perm_ability = true; + has_change_perm_ability = TRUE; } - if(valid_base_perms - && (self_owned - || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) + if (valid_base_perms && + (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { - has_change_sale_ability = true; + has_change_sale_ability = TRUE; } if (!has_change_perm_ability && !has_change_sale_ability && !root_selected) { // ...must select root to choose permissions - childSetValue("perm_modify", getString("text modify warning")); + childSetValue("perm_modify", getString("text modify warning")); } if (has_change_perm_ability) { - childSetEnabled("checkbox share with group",true); - childSetEnabled("checkbox allow everyone move",owner_mask_on & PERM_MOVE); - childSetEnabled("checkbox allow everyone copy",owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); + childSetEnabled("checkbox share with group", TRUE); + childSetEnabled("checkbox allow everyone move", owner_mask_on & PERM_MOVE); + childSetEnabled("checkbox allow everyone copy", owner_mask_on & PERM_COPY && owner_mask_on & PERM_TRANSFER); } else { - childSetEnabled("checkbox share with group", FALSE); - childSetEnabled("checkbox allow everyone move", FALSE); - childSetEnabled("checkbox allow everyone copy", FALSE); + childSetEnabled("checkbox share with group", FALSE); + childSetEnabled("checkbox allow everyone move", FALSE); + childSetEnabled("checkbox allow everyone copy", FALSE); } if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) { - childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); + childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale)); // Set the checkbox to tentative if the prices of each object selected // are not the same. - childSetTentative("checkbox for sale", is_for_sale_mixed); - childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed); + childSetTentative("checkbox for sale", is_for_sale_mixed); + childSetEnabled("sale type", num_for_sale && can_transfer && !is_sale_price_mixed); - childSetEnabled("Next owner can:", TRUE); - childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY); - childSetEnabled("checkbox next owner can copy",base_mask_on & PERM_COPY); - childSetEnabled("checkbox next owner can transfer",next_owner_mask_on & PERM_COPY); + childSetEnabled("Next owner can:", TRUE); + childSetEnabled("checkbox next owner can modify", base_mask_on & PERM_MODIFY); + childSetEnabled("checkbox next owner can copy", base_mask_on & PERM_COPY); + childSetEnabled("checkbox next owner can transfer", next_owner_mask_on & PERM_COPY); } else { - childSetEnabled("checkbox for sale",FALSE); - childSetEnabled("sale type",FALSE); + childSetEnabled("checkbox for sale", FALSE); + childSetEnabled("sale type", FALSE); - childSetEnabled("Next owner can:",FALSE); - childSetEnabled("checkbox next owner can modify",FALSE); - childSetEnabled("checkbox next owner can copy",FALSE); - childSetEnabled("checkbox next owner can transfer",FALSE); + childSetEnabled("Next owner can:", FALSE); + childSetEnabled("checkbox next owner can modify", FALSE); + childSetEnabled("checkbox next owner can copy", FALSE); + childSetEnabled("checkbox next owner can transfer", FALSE); } - if(valid_group_perms) + if (valid_group_perms) { - if((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) + if ((group_mask_on & PERM_COPY) && (group_mask_on & PERM_MODIFY) && (group_mask_on & PERM_MOVE)) { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",FALSE); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } - else if((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) + else if ((group_mask_off & PERM_COPY) && (group_mask_off & PERM_MODIFY) && (group_mask_off & PERM_MOVE)) { - childSetValue("checkbox share with group",FALSE); - childSetTentative("checkbox share with group",false); - childSetEnabled("button deed",false); + childSetValue("checkbox share with group", FALSE); + childSetTentative("checkbox share with group", FALSE); + childSetEnabled("button deed", FALSE); } else { - childSetValue("checkbox share with group",TRUE); - childSetTentative("checkbox share with group",true); - childSetEnabled("button deed",gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); + childSetValue("checkbox share with group", TRUE); + childSetTentative("checkbox share with group", TRUE); + childSetEnabled("button deed", gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && (group_mask_on & PERM_MOVE) && (owner_mask_on & PERM_TRANSFER) && !group_owned && can_transfer); } } - if(valid_everyone_perms) + if (valid_everyone_perms) { // Move - if(everyone_mask_on & PERM_MOVE) + if (everyone_mask_on & PERM_MOVE) { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", FALSE); } - else if(everyone_mask_off & PERM_MOVE) + else if (everyone_mask_off & PERM_MOVE) { - childSetValue("checkbox allow everyone move",FALSE); - childSetTentative("checkbox allow everyone move",false); + childSetValue("checkbox allow everyone move", FALSE); + childSetTentative("checkbox allow everyone move", FALSE); } else { - childSetValue("checkbox allow everyone move",TRUE); - childSetTentative("checkbox allow everyone move",true); + childSetValue("checkbox allow everyone move", TRUE); + childSetTentative("checkbox allow everyone move", TRUE); } // Copy == everyone can't copy - if(everyone_mask_on & PERM_COPY) + if (everyone_mask_on & PERM_COPY) { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",!can_copy || !can_transfer); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", !can_copy || !can_transfer); } - else if(everyone_mask_off & PERM_COPY) + else if (everyone_mask_off & PERM_COPY) { - childSetValue("checkbox allow everyone copy",FALSE); - childSetTentative("checkbox allow everyone copy",false); + childSetValue("checkbox allow everyone copy", FALSE); + childSetTentative("checkbox allow everyone copy", FALSE); } else { - childSetValue("checkbox allow everyone copy",TRUE); - childSetTentative("checkbox allow everyone copy",true); + childSetValue("checkbox allow everyone copy", TRUE); + childSetTentative("checkbox allow everyone copy", TRUE); } } - if(valid_next_perms) + if (valid_next_perms) { // Modify == next owner canot modify - if(next_owner_mask_on & PERM_MODIFY) + if (next_owner_mask_on & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", FALSE); } - else if(next_owner_mask_off & PERM_MODIFY) + else if (next_owner_mask_off & PERM_MODIFY) { - childSetValue("checkbox next owner can modify",FALSE); - childSetTentative("checkbox next owner can modify",false); + childSetValue("checkbox next owner can modify", FALSE); + childSetTentative("checkbox next owner can modify", FALSE); } else { - childSetValue("checkbox next owner can modify",TRUE); - childSetTentative("checkbox next owner can modify",true); + childSetValue("checkbox next owner can modify", TRUE); + childSetTentative("checkbox next owner can modify", TRUE); } // Copy == next owner cannot copy - if(next_owner_mask_on & PERM_COPY) + if (next_owner_mask_on & PERM_COPY) { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",!can_copy); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", !can_copy); } - else if(next_owner_mask_off & PERM_COPY) + else if (next_owner_mask_off & PERM_COPY) { - childSetValue("checkbox next owner can copy",FALSE); - childSetTentative("checkbox next owner can copy",FALSE); + childSetValue("checkbox next owner can copy", FALSE); + childSetTentative("checkbox next owner can copy", FALSE); } else { - childSetValue("checkbox next owner can copy",TRUE); - childSetTentative("checkbox next owner can copy",TRUE); + childSetValue("checkbox next owner can copy", TRUE); + childSetTentative("checkbox next owner can copy", TRUE); } // Transfer == next owner cannot transfer - if(next_owner_mask_on & PERM_TRANSFER) + if (next_owner_mask_on & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",!can_transfer); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", !can_transfer); } - else if(next_owner_mask_off & PERM_TRANSFER) + else if (next_owner_mask_off & PERM_TRANSFER) { - childSetValue("checkbox next owner can transfer",FALSE); - childSetTentative("checkbox next owner can transfer",FALSE); + childSetValue("checkbox next owner can transfer", FALSE); + childSetTentative("checkbox next owner can transfer", FALSE); } else { - childSetValue("checkbox next owner can transfer",TRUE); - childSetTentative("checkbox next owner can transfer",TRUE); + childSetValue("checkbox next owner can transfer", TRUE); + childSetTentative("checkbox next owner can transfer", TRUE); } } @@ -800,48 +775,51 @@ void LLPanelPermissions::refresh() LLComboBox* combo_sale_type = getChild("sale type"); if (valid_sale_info) { - combo_sale_type->setValue(sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); - combo_sale_type->setTentative(FALSE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( sale_type == LLSaleInfo::FS_NOT ? LLSaleInfo::FS_COPY : sale_type); + combo_sale_type->setTentative( FALSE); // unfortunately this doesn't do anything at the moment. } else { // default option is sell copy, determined to be safest - combo_sale_type->setValue(LLSaleInfo::FS_COPY); - combo_sale_type->setTentative(TRUE); // unfortunately this doesn't do anything at the moment. + combo_sale_type->setValue( LLSaleInfo::FS_COPY); + combo_sale_type->setTentative( TRUE); // unfortunately this doesn't do anything at the moment. } - childSetValue("checkbox for sale", num_for_sale != 0); + childSetValue("checkbox for sale", (num_for_sale != 0)); // HACK: There are some old objects in world that are set for sale, // but are no-transfer. We need to let users turn for-sale off, but only // if for-sale is set. bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY); - if (num_for_sale && has_change_sale_ability && cannot_actually_sell) + if (cannot_actually_sell) { - childSetEnabled("checkbox for sale", true); + if (num_for_sale && has_change_sale_ability) + { + childSetEnabled("checkbox for sale", true); + } } - + // Check search status of objects - BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); + const BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; - bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); - childSetEnabled("search_check", has_change_sale_ability && all_volume); - childSetValue("search_check", include_in_search); - childSetTentative("search_check", ! all_include_in_search); + const BOOL all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); + childSetEnabled("search_check", has_change_sale_ability && all_volume); + childSetValue("search_check", include_in_search); + childSetTentative("search_check", !all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { - LLComboBox* ComboClickAction = getChild("clickaction"); - if(ComboClickAction) + LLComboBox* combo_click_action = getChild("clickaction"); + if(combo_click_action) { - std::string combo_value = click_action_to_string_value(click_action); - ComboClickAction->setValue(LLSD(combo_value)); + const std::string combo_value = click_action_to_string_value(click_action); + combo_click_action->setValue(LLSD(combo_value)); } } - childSetEnabled("label click action",is_perm_modify && all_volume); - childSetEnabled("clickaction",is_perm_modify && all_volume); + childSetEnabled("label click action", is_perm_modify && all_volume); + childSetEnabled("clickaction", is_perm_modify && all_volume); } -- cgit v1.2.3 From 65123f20de0c94afca51fc58cd199ee5cad0c6f1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 13:30:25 -0500 Subject: Incorporated code formatting cleanup from llsidepaneltaskinfo into llpanelpermissions. No functionality changes. --HG-- branch : avatar-pipeline --- indra/newview/llpanelpermissions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 805a4dbe97..38d3be532f 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -84,6 +84,9 @@ protected: static void onCommitIncludeInSearch(LLUICtrl* ctrl, void*); protected: + void disableAll(); + +private: LLNameBox* mLabelGroupName; // group name LLUUID mCreatorID; -- cgit v1.2.3