diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-12-16 16:02:47 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-12-16 16:02:47 -0800 |
commit | 2beaa0585e90bd019d8c73142f886eead4a364ee (patch) | |
tree | 2f1eabe3a5c9b924b2f797f8b528eaf9b989587d | |
parent | 9a55888ec47376800fec55ee1bb0471ac5c4a848 (diff) | |
parent | 015f07408b68f6bc08fc27c13b6f93813173f93b (diff) |
Merge from viewer-experience
-rw-r--r-- | indra/llui/llbutton.cpp | 18 | ||||
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 13 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 31 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llavataractions.cpp | 19 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_edit.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 20 | ||||
-rw-r--r-- | indra/newview/skins/paths.xml | 2 |
10 files changed, 107 insertions, 14 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 93d8282aa7..f0d92d597a 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -589,15 +589,23 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height) // virtual void LLButton::draw() { + static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true); F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency(); bool flash = FALSE; - if( mFlashing ) + if( mFlashing) { - F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); - // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); + if ( sEnableButtonFlashing) + { + F32 elapsed = mFlashingTimer.getElapsedTimeF32(); + S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f); + // flash on or off? + flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f); + } + else + { // otherwise just highlight button in flash color + flash = true; + } } bool pressed_by_keyboard = FALSE; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index d5f8707381..5fc2cc350d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -98,24 +98,25 @@ class LLCustomButtonIconCtrl : public LLButton { public: struct Params - : public LLInitParam::Block<Params, LLButton::Params> + : public LLInitParam::Block<Params, LLButton::Params> { // LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value Optional<S32> icon_ctrl_pad; - Params(): - icon_ctrl_pad("icon_ctrl_pad", 1) + Params() + : icon_ctrl_pad("icon_ctrl_pad", 1) {} }; protected: friend class LLUICtrlFactory; - LLCustomButtonIconCtrl(const Params& p): - LLButton(p), + + LLCustomButtonIconCtrl(const Params& p) + : LLButton(p), mIcon(NULL), mIconAlignment(LLFontGL::HCENTER), mIconCtrlPad(p.icon_ctrl_pad) - {} + {} public: diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3b768166f1..1f890b625f 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -598,7 +598,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s pos = getEditableIndex(pos, true); - segment_set_t::iterator seg_iter = getSegIterContaining(pos); + segment_set_t::iterator seg_iter = getEditableSegIterContaining(pos); LLTextSegmentPtr default_segment; @@ -1510,8 +1510,37 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg } } +LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index) +{ + segment_set_t::iterator it = getSegIterContaining(index); + if (it == mSegments.end()) return it; + + if (!(*it)->canEdit() + && index == (*it)->getStart() + && it != mSegments.begin()) + { + it--; + } + return it; +} + +LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const +{ + segment_set_t::const_iterator it = getSegIterContaining(index); + if (it == mSegments.end()) return it; + + if (!(*it)->canEdit() + && index == (*it)->getStart() + && it != mSegments.begin()) + { + it--; + } + return it; +} + LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) { + static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); if (index > getLength()) { return mSegments.end(); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index b699601908..0549141b72 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -461,6 +461,8 @@ protected: void getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const; void getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp ); LLTextSegmentPtr getSegmentAtLocalPos( S32 x, S32 y, bool hit_past_end_of_line = true); + segment_set_t::iterator getEditableSegIterContaining(S32 index); + segment_set_t::const_iterator getEditableSegIterContaining(S32 index) const; segment_set_t::iterator getSegIterContaining(S32 index); segment_set_t::const_iterator getSegIterContaining(S32 index) const; void clearSegments(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a6d859aab2..c51197bbf1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1150,6 +1150,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>EnableButtonFlashing</key> + <map> + <key>Comment</key> + <string>Allow UI to flash buttons to get your attention</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>ButtonHPad</key> <map> <key>Comment</key> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index e7e098e423..9a7cdcfa21 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -680,12 +680,29 @@ namespace action_give_inventory std::string items; build_items_string(inventory_selected_uuids, items); + int folders_count = 0; + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + + //traverse through selected inventory items and count folders among them + for ( ; it != inventory_selected_uuids.end() && folders_count <=1 ; ++it) + { + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); + if (NULL != inv_cat) + { + folders_count++; + } + } + + // EXP-1599 + // In case of sharing multiple folders, make the confirmation + // dialog contain a warning that only one folder can be shared at a time. + std::string notification = (folders_count > 1) ? "ShareFolderConfirmation" : "ShareItemsConfirmation"; LLSD substitutions; substitutions["RESIDENTS"] = residents; substitutions["ITEMS"] = items; LLShareInfo::instance().mAvatarNames = avatar_names; LLShareInfo::instance().mAvatarUuids = avatar_uuids; - LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, LLSD(), &give_inventory_cb); + LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb); } } diff --git a/indra/newview/skins/default/xui/en/menu_edit.xml b/indra/newview/skins/default/xui/en/menu_edit.xml index fab76c497c..99061e089a 100644 --- a/indra/newview/skins/default/xui/en/menu_edit.xml +++ b/indra/newview/skins/default/xui/en/menu_edit.xml @@ -6,6 +6,7 @@ <menu_item_call label="Undo" name="Undo" + allow_key_repeat="true" shortcut="control|Z"> <menu_item_call.on_click function="Edit.Undo" /> @@ -15,6 +16,7 @@ <menu_item_call label="Redo" name="Redo" + allow_key_repeat="true" shortcut="control|Y"> <menu_item_call.on_click function="Edit.Redo" /> @@ -43,6 +45,7 @@ <menu_item_call label="Paste" name="Paste" + allow_key_repeat="true" shortcut="control|V"> <menu_item_call.on_click function="Edit.Paste" /> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 3c98f8e892..454e4e89a6 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1161,6 +1161,7 @@ enabled="false" label="Undo" name="Undo" + allow_key_repeat="true" shortcut="control|Z"> <on_click function="Edit.Undo" @@ -1172,6 +1173,7 @@ enabled="false" label="Redo" name="Redo" + allow_key_repeat="true" shortcut="control|Y"> <on_click function="Edit.Redo" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 39cc1c2cb2..871a9d4a1d 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6965,6 +6965,26 @@ With the following Residents: <notification icon="notifytip.tga" + name="ShareFolderConfirmation" + type="alertmodal"> +Only one folder at a time can be shared. + +Are you sure you want to share the following items: + +<nolink>[ITEMS]</nolink> + +With the following Residents: + +[RESIDENTS] + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="Ok"/> + </notification> + + <notification + icon="notifytip.tga" name="ItemsShared" type="notifytip"> Items successfully shared. diff --git a/indra/newview/skins/paths.xml b/indra/newview/skins/paths.xml index e6d68488ea..3c0da041c7 100644 --- a/indra/newview/skins/paths.xml +++ b/indra/newview/skins/paths.xml @@ -1,4 +1,4 @@ -<paths> +<paths> <directory> <subdir>xui</subdir> <subdir>en</subdir> |