From 6bbcf67db399a46592086c623118d18163a70452 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 20 Jan 2012 17:03:04 -0800 Subject: EXP-1152 : Fix width computation in inventory panel so that the horizontal slider shows up only when really needed. --- indra/newview/llfolderviewitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 8d6114c887..9944a9dd3d 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -423,7 +423,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) : 0; if (mLabelWidthDirty) { - mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mSearchableLabel); + mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix); mLabelWidthDirty = false; } -- cgit v1.2.3 From a8243c11c4188de46f3d321cb6d8c87fdae18b47 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 20 Jan 2012 18:39:59 -0800 Subject: EXP-1823 : Don't display the do not show preview message on item we have no preview method for in the first place... --- indra/newview/llviewermessage.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6bb13bb8d7..716f47150e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -135,6 +135,7 @@ extern BOOL gDebugClicks; // function prototypes bool check_offer_throttle(const std::string& from_name, bool check_only); +bool check_asset_previewable(const LLAssetType::EType asset_type); static void process_money_balance_reply_extended(LLMessageSystem* msg); //inventory offer throttle globals @@ -1147,7 +1148,18 @@ bool check_offer_throttle(const std::string& from_name, bool check_only) } } } - + +// Return "true" if we have a preview method for that asset type, "false" otherwise +bool check_asset_previewable(const LLAssetType::EType asset_type) +{ + return (asset_type == LLAssetType::AT_NOTECARD) || + (asset_type == LLAssetType::AT_LANDMARK) || + (asset_type == LLAssetType::AT_TEXTURE) || + (asset_type == LLAssetType::AT_ANIMATION) || + (asset_type == LLAssetType::AT_SCRIPT) || + (asset_type == LLAssetType::AT_SOUND); +} + void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name) { for (uuid_vec_t::const_iterator obj_iter = objects.begin(); @@ -1171,7 +1183,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam // Either an inventory item or a category. const LLInventoryItem* item = dynamic_cast(obj); - if (item) + if (item && check_asset_previewable(asset_type)) { //////////////////////////////////////////////////////////////////////////////// // Special handling for various types. @@ -1246,6 +1258,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam LLFloaterReg::showInstance("preview_sound", LLSD(obj_id), take_focus); break; default: + LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type) << LL_ENDL; break; } } -- cgit v1.2.3 From 535f1b23e83dc88863715c0c5be86b19ed0e5031 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 23 Jan 2012 17:41:40 +0200 Subject: EXP-1826 WIP Potential fix: prevent dereferencing invalid pointer. --- indra/newview/llagentwearables.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 13b62cb019..dd7e509e8d 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -816,7 +816,10 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index) if (wearable) { mWearableDatas[type].erase(mWearableDatas[type].begin() + index); - gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE); + if (isAgentAvatarValid()) + { + gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE); + } wearable->setLabelUpdated(); } } -- cgit v1.2.3 From b2ef7661a0893d4da884849236441d9ab0552606 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 23 Jan 2012 17:44:33 +0200 Subject: EXP-1821 FIXED Don't open group chat for the selected group if user double-clicks on empty space in the group list. --- indra/newview/llgrouplist.cpp | 16 ++++++++++++++++ indra/newview/llgrouplist.h | 1 + 2 files changed, 17 insertions(+) (limited to 'indra') diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index bbf66ca750..129cddda45 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -123,6 +123,22 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask) return handled; } +// virtual +BOOL LLGroupList::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLView::handleDoubleClick(x, y, mask); + // Handle double click only for the selected item in the list, skip clicks on empty space. + if (handled) + { + if (mDoubleClickSignal) + { + (*mDoubleClickSignal)(this, x, y, mask); + } + } + + return handled; +} + void LLGroupList::setNameFilter(const std::string& filter) { std::string filter_upper = filter; diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index d7051db891..8abf14b3d0 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -51,6 +51,7 @@ public: virtual void draw(); // from LLView /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); // from LLView + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); // from LLView void setNameFilter(const std::string& filter); void toggleIcons(); -- cgit v1.2.3 From f324e67780cb002149b11d0fbf49f5d1794b7299 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 23 Jan 2012 17:49:09 +0200 Subject: EXP-1801 FIXED Fixed the "snapshot to disk" shortcut (Ctrl+`) to respect preferred snapshot format. Restoring mistakenly removed code. --- indra/newview/llviewermenufile.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7e830e14bf..8ee514e7c2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -527,8 +527,22 @@ class LLFileTakeSnapshotToDisk : public view_listener_t FALSE)) { gViewerWindow->playSnapshotAnimAndSound(); - - LLPointer formatted = new LLImagePNG; + LLPointer formatted; + switch(LLFloaterSnapshot::ESnapshotFormat(gSavedSettings.getS32("SnapshotFormat"))) + { + case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG: + formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); + break; + case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: + formatted = new LLImagePNG; + break; + case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP: + formatted = new LLImageBMP; + break; + default: + llwarns << "Unknown Local Snapshot format" << llendl; + return true; + } formatted->enableOverSize() ; formatted->encode(raw, 0); formatted->disableOverSize() ; -- cgit v1.2.3 From 8f60dc01366732713be8290a84bc50ba10059e73 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 23 Jan 2012 17:50:04 +0200 Subject: EXT-1836 FIXED Avoid assigning NULL to an std::string. --- indra/newview/llfilepicker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 8024755e86..360e35f6d3 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -1073,8 +1073,11 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer } // set the default path for this usage context. - picker->mContextToPathMap[picker->mCurContextName] = - gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget)); + const char* cur_folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget)); + if (cur_folder != NULL) + { + picker->mContextToPathMap[picker->mCurContextName] = cur_folder; + } gtk_widget_destroy(widget); gtk_main_quit(); -- cgit v1.2.3 From 0c528df35ed6d7ecf6b847983f842aa38ef1636a Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 23 Jan 2012 20:17:38 +0200 Subject: EXP-1671 FIXED Hide "Translate chat" checkbox when translation is not configured. --- indra/newview/llfloatertranslationsettings.cpp | 2 +- indra/newview/llnearbychatbar.cpp | 6 +- indra/newview/llnearbychatbar.h | 2 +- .../skins/default/xui/en/panel_nearby_chat.xml | 84 ++++++++++++++-------- 4 files changed, 61 insertions(+), 33 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp index 428a02e9f0..1a17183efd 100644 --- a/indra/newview/llfloatertranslationsettings.cpp +++ b/indra/newview/llfloatertranslationsettings.cpp @@ -293,6 +293,6 @@ void LLFloaterTranslationSettings::onBtnOK() gSavedSettings.setString("TranslationService", getSelectedService()); gSavedSettings.setString("BingTranslateAPIKey", getEnteredBingKey()); gSavedSettings.setString("GoogleTranslateAPIKey", getEnteredGoogleKey()); - LLNearbyChatBar::getInstance()->enableTranslationCheckbox(LLTranslate::isTranslationConfigured()); + LLNearbyChatBar::getInstance()->showTranslationCheckbox(LLTranslate::isTranslationConfigured()); closeFloater(false); } diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4512c14b7a..b4224e30e6 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -124,7 +124,7 @@ BOOL LLNearbyChatBar::postBuild() // virtual void LLNearbyChatBar::onOpen(const LLSD& key) { - enableTranslationCheckbox(LLTranslate::isTranslationConfigured()); + showTranslationCheckbox(LLTranslate::isTranslationConfigured()); } bool LLNearbyChatBar::applyRectControl() @@ -170,9 +170,9 @@ void LLNearbyChatBar::showHistory() } } -void LLNearbyChatBar::enableTranslationCheckbox(BOOL enable) +void LLNearbyChatBar::showTranslationCheckbox(BOOL show) { - getChild("translate_chat_checkbox")->setEnabled(enable); + getChild("translate_chat_checkbox_lp")->setVisible(show); } void LLNearbyChatBar::draw() diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index baf12a06ea..8547cf0bce 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -61,7 +61,7 @@ public: static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); void showHistory(); - void enableTranslationCheckbox(BOOL enable); + void showTranslationCheckbox(BOOL show); /*virtual*/void setMinimized(BOOL b); protected: diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml index d492f9bd68..6cfd929bc0 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat.xml @@ -1,35 +1,63 @@ - - + + + + + + + + -- cgit v1.2.3 From 3ebaa5b0a69f7ae63c74bc4a1a80a5ec5b988569 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 23 Jan 2012 11:23:02 -0800 Subject: made add() method chainable on Multiple<> params --- indra/llxuixml/llinitparam.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index ab20957760..4ab1d891a3 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1253,15 +1253,16 @@ namespace LLInitParam return mValues.back(); } - void add(const value_t& item) + self_t& add(const value_t& item) { param_value_t param_value; param_value.setValue(item); mValues.push_back(param_value); setProvided(); + return *this; } - void add(const typename name_value_lookup_t::name_t& name) + self_t& add(const typename name_value_lookup_t::name_t& name) { value_t value; @@ -1271,6 +1272,8 @@ namespace LLInitParam add(value); mValues.back().setValueName(name); } + + return *this; } // implicit conversion @@ -1441,13 +1444,14 @@ namespace LLInitParam return mValues.back(); } - void add(const value_t& item) + self_t& add(const value_t& item) { mValues.push_back(item); setProvided(); + return *this; } - void add(const typename name_value_lookup_t::name_t& name) + self_t& add(const typename name_value_lookup_t::name_t& name) { value_t value; @@ -1457,6 +1461,7 @@ namespace LLInitParam add(value); mValues.back().setValueName(name); } + return *this; } // implicit conversion -- cgit v1.2.3