From 302f57e47fdab9e043a72e6a83f0f2b1992f2a99 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 6 Feb 2013 20:17:35 +0200 Subject: CHUI-744 FIXED KeepConversationLogTranscripts setting is moved to settings_per_account.xml --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/app_settings/settings_per_account.xml | 11 +++++++++++ indra/newview/llconversationlog.cpp | 4 ++-- indra/newview/llfloaterimcontainer.cpp | 4 ++-- indra/newview/llfloaterimnearbychat.cpp | 2 +- indra/newview/llimview.cpp | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fb4cc6de62..79376f7467 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4667,17 +4667,6 @@ Value 1 - KeepConversationLogTranscripts - - Comment - Keep a conversation log and transcripts - Persist - 1 - Type - S32 - Value - 2 - LandBrushSize Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 6864328339..0b589e2da6 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -281,6 +281,17 @@ Value 0 + KeepConversationLogTranscripts + + Comment + Keep a conversation log and transcripts + Persist + 1 + Type + S32 + Value + 2 + ShowFavoritesOnLogin Comment diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 04abda1799..c5be2f59be 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -190,7 +190,7 @@ LLConversationLog::LLConversationLog() : mAvatarNameCacheConnection(), mLoggingEnabled(false) { - LLControlVariable * keep_log_ctrlp = gSavedSettings.getControl("KeepConversationLogTranscripts").get(); + LLControlVariable * keep_log_ctrlp = gSavedPerAccountSettings.getControl("KeepConversationLogTranscripts").get(); S32 log_mode = keep_log_ctrlp->getValue(); if (log_mode > 0) @@ -369,7 +369,7 @@ void LLConversationLog::sessionAdded(const LLUUID& session_id, const std::string void LLConversationLog::cache() { - if (gSavedSettings.getS32("KeepConversationLogTranscripts") > 0) + if (gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0) { saveToFile(getFileName()); } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 5a284cc7b7..2b13ce6377 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1141,7 +1141,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) if ("conversation_log" == item) { - return gSavedSettings.getS32("KeepConversationLogTranscripts") > 0; + return gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; } //Enable Chat history item for ad-hoc and group conversations @@ -1792,7 +1792,7 @@ void LLFloaterIMContainer::updateSpeakBtnState() bool LLFloaterIMContainer::isConversationLoggingAllowed() { - return gSavedSettings.getS32("KeepConversationLogTranscripts") > 0; + return gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; } void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, bool is_flashes) diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 345418bffc..430326203f 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -542,7 +542,7 @@ void LLFloaterIMNearbyChat::addMessage(const LLChat& chat,bool archive,const LLS } // logging - if (!args["do_not_log"].asBoolean() && gSavedSettings.getS32("KeepConversationLogTranscripts") > 1) + if (!args["do_not_log"].asBoolean() && gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 1) { std::string from_name = chat.mFromName; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1cceb68e2a..d4c8d8c4f4 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -928,7 +928,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, bool LLIMModel::logToFile(const std::string& file_name, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { - if (gSavedSettings.getS32("KeepConversationLogTranscripts") > 1) + if (gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 1) { std::string from_name = from; -- cgit v1.2.3 From f944608ab93199a5588ec2c969268b094b8be7c8 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Wed, 6 Feb 2013 20:00:43 +0200 Subject: CHUI-707: "Chat" toolbar button stop flashing after setting toolbar buttons view to "Icons only": save/restore flashing states --- indra/llui/lltoolbar.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 071046fe6d..b9256dd890 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -872,8 +872,15 @@ void LLToolBar::reshape(S32 width, S32 height, BOOL called_from_parent) void LLToolBar::createButtons() { + std::set set_flashing; + BOOST_FOREACH(LLToolBarButton* button, mButtons) { + if (button->getFlashTimer() && button->getFlashTimer()->isFlashingInProgress()) + { + set_flashing.insert(button->getCommandId().uuid()); + } + if (mButtonRemoveSignal) { (*mButtonRemoveSignal)(button); @@ -896,6 +903,11 @@ void LLToolBar::createButtons() { (*mButtonAddSignal)(button); } + + if (set_flashing.find(button->getCommandId().uuid()) != set_flashing.end()) + { + button->setFlashing(true); + } } mNeedsLayout = true; } -- cgit v1.2.3 From ec0ac12eba9d944ade7bd734226a03ea2eb47229 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 6 Feb 2013 20:51:14 +0200 Subject: CHUI-712 FIXED IM log files renamed with ll.txt will create double files for users --- indra/newview/llconversationlog.cpp | 8 +- indra/newview/llconversationlog.h | 1 - indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/lllogchat.cpp | 147 ++++++++++++++++++---------------- indra/newview/lllogchat.h | 9 +-- 5 files changed, 82 insertions(+), 85 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index c5be2f59be..82176b3a06 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -532,14 +532,8 @@ void LLConversationLog::onClearLogResponse(const LLSD& notification, const LLSD& { if (0 == LLNotificationsUtil::getSelectedOption(notification, response)) { - deleteTranscripts(); + LLLogChat::deleteTranscripts(); mConversations.clear(); notifyObservers(); } } - -void LLConversationLog::deleteTranscripts() -{ - gDirUtilp->deleteFilesInDir(gDirUtilp->getPerAccountChatLogsDir(), "*." + LL_TRANSCRIPT_FILE_EXTENSION); - LLFloaterIMSessionTab::processChatHistoryStyleUpdate(true); -} diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 5213c9b3ab..d5b6eccb29 100644 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -140,7 +140,6 @@ public: void onClearLog(); void onClearLogResponse(const LLSD& notification, const LLSD& response); - void deleteTranscripts(); bool getIsLoggingEnabled() { return mLoggingEnabled; } bool isLogEmpty() { return mConversations.empty(); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 4f86c26a67..da24bb3b8f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1584,7 +1584,7 @@ void LLFloaterPreference::onDeleteTranscriptsResponse(const LLSD& notification, { if (0 == LLNotificationsUtil::getSelectedOption(notification, response)) { - LLConversationLog::instance().deleteTranscripts(); + LLLogChat::deleteTranscripts(); updateDeleteTranscriptsButton(); } } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 545b44ef92..17b72c5023 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -33,6 +33,7 @@ #include "llviewercontrol.h" #include "lldiriterator.h" +#include "llfloaterimsessiontab.h" #include "llinstantmessage.h" #include "llsingleton.h" // for LLSingleton @@ -40,6 +41,7 @@ #include #include #include +#include #if LL_MSVC #pragma warning(push) @@ -62,7 +64,7 @@ const std::string LL_IM_TIME("time"); const std::string LL_IM_TEXT("message"); const std::string LL_IM_FROM("from"); const std::string LL_IM_FROM_ID("from_id"); -const std::string LL_TRANSCRIPT_FILE_EXTENSION("ll.txt"); +const std::string LL_TRANSCRIPT_FILE_EXTENSION("txt"); const static std::string IM_SEPARATOR(": "); const static std::string NEW_LINE("\n"); @@ -85,6 +87,7 @@ const static std::string MULTI_LINE_PREFIX(" "); * Note: "You" was used as an avatar names in viewers of previous versions */ const static boost::regex TIMESTAMP_AND_STUFF("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]\\s+|\\[\\d{1,2}:\\d{2}\\]\\s+)?(.*)$"); +const static boost::regex TIMESTAMP("^(\\[\\d{4}/\\d{1,2}/\\d{1,2}\\s+\\d{1,2}:\\d{2}\\]|\\[\\d{1,2}:\\d{2}\\]).*"); /** * Regular expression suitable to match names like @@ -328,69 +331,6 @@ void LLLogChat::saveHistory(const std::string& filename, } } -void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLineType, const LLSD&, void*), void* userdata) -{ - if(!filename.size()) - { - llwarns << "Filename is Empty!" << llendl; - return ; - } - - LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ - if (!fptr) - { - callback(LOG_EMPTY, LLSD(), userdata); - return; //No previous conversation with this name. - } - else - { - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline=TRUE; - - if ( fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END) ) - { //File is smaller than recall size. Get it all. - firstline = FALSE; - if ( fseek(fptr, 0, SEEK_SET) ) - { - fclose(fptr); - return; - } - } - - while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) - { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; - - if (!firstline) - { - LLSD item; - std::string line(buffer); - std::istringstream iss(line); - - if (!LLChatLogParser::parse(line, item)) - { - item["message"] = line; - callback(LOG_LINE, item, userdata); - } - else - { - callback(LOG_LLSD, item, userdata); - } - } - else - { - firstline = FALSE; - } - } - callback(LOG_END, LLSD(), userdata); - - fclose(fptr); - } -} - // static void LLLogChat::loadChatHistory(const std::string& file_name, std::list& messages, const LLSD& load_params) { @@ -506,19 +446,46 @@ std::string LLLogChat::oldLogFileName(std::string filename) void LLLogChat::getListOfTranscriptFiles(std::vector& list_of_transcriptions) { // get Users log directory - std::string directory = gDirUtilp->getPerAccountChatLogsDir(); + std::string dirname = gDirUtilp->getPerAccountChatLogsDir(); // add final OS dependent delimiter - directory += gDirUtilp->getDirDelimiter(); + dirname += gDirUtilp->getDirDelimiter(); // create search pattern std::string pattern = "*." + LL_TRANSCRIPT_FILE_EXTENSION; - LLDirIterator iter(directory, pattern); - std::string scanResult; - while (iter.next(scanResult)) + LLDirIterator iter(dirname, pattern); + std::string filename; + while (iter.next(filename)) { - list_of_transcriptions.push_back(scanResult); + std::string fullname = gDirUtilp->add(dirname, filename); + + LLFILE * filep = LLFile::fopen(fullname, "rb"); + if (NULL != filep) + { + char buffer[LOG_RECALL_SIZE]; + + fseek(filep, 0, SEEK_END); // seek to end of file + S32 bytes_to_read = ftell(filep); // get current file pointer + fseek(filep, 0, SEEK_SET); // seek back to beginning of file + + // limit the number characters to read from file + if (bytes_to_read >= LOG_RECALL_SIZE) + { + bytes_to_read = LOG_RECALL_SIZE - 1; + } + + if (bytes_to_read > 0 && NULL != fgets(buffer, bytes_to_read, filep)) + { + //matching a timestamp + boost::match_results matches; + if (boost::regex_match(std::string(buffer), matches, TIMESTAMP)) + { + list_of_transcriptions.push_back(gDirUtilp->add(dirname, filename)); + } + } + LLFile::close(filep); + } } } @@ -533,6 +500,46 @@ boost::signals2::connection LLLogChat::setSaveHistorySignal(const save_history_s return sSaveHistorySignal->connect(cb); } +//static +void LLLogChat::deleteTranscripts() +{ + std::vector list_of_transcriptions; + getListOfTranscriptFiles(list_of_transcriptions); + + BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions) + { + S32 retry_count = 0; + while (retry_count < 5) + { + if (0 != LLFile::remove(fullpath)) + { + retry_count++; + S32 result = errno; + LL_WARNS("LLLogChat::deleteTranscripts") << "Problem removing " << fullpath << " - errorcode: " + << result << " attempt " << retry_count << LL_ENDL; + + if(retry_count >= 5) + { + LL_WARNS("LLLogChat::deleteTranscripts") << "Failed to remove " << fullpath << LL_ENDL; + return; + } + + ms_sleep(100); + } + else + { + if (retry_count) + { + LL_WARNS("LLLogChat::deleteTranscripts") << "Successfully removed " << fullpath << LL_ENDL; + } + break; + } + } + } + + LLFloaterIMSessionTab::processChatHistoryStyleUpdate(true); +} + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name //which are more strict by its nature (only firstname and secondname) //Example, an object's name can be written like "Object " diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index b35a94b4b3..5fbb4ade96 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -51,16 +51,13 @@ public: const std::string& line); static void getListOfTranscriptFiles(std::vector& list); - /** @deprecated @see loadChatHistory() */ - static void loadHistory(const std::string& filename, - void (*callback)(ELogLineType, const LLSD&, void*), - void* userdata); - static void loadChatHistory(const std::string& file_name, std::list& messages, const LLSD& load_params = LLSD()); typedef boost::signals2::signal save_history_signal_t; static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); + static void deleteTranscripts(); + private: static std::string cleanFileName(std::string filename); static save_history_signal_t * sSaveHistorySignal; @@ -123,6 +120,6 @@ extern const std::string LL_IM_TIME; //("time"); extern const std::string LL_IM_TEXT; //("message"); extern const std::string LL_IM_FROM; //("from"); extern const std::string LL_IM_FROM_ID; //("from_id"); -extern const std::string LL_TRANSCRIPT_FILE_EXTENSION; //("ll.txt"); +extern const std::string LL_TRANSCRIPT_FILE_EXTENSION; //("txt"); #endif -- cgit v1.2.3 From 7ed270ff9dfdbc905dbee70907d3057a5ae490e7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 6 Feb 2013 18:11:52 -0800 Subject: CHUI-735 : Fixed! Move the delete key handling from the llfolderview to the llinventorypanel level. --- indra/llui/llfolderview.cpp | 23 ----------------------- indra/llui/llfolderview.h | 3 --- indra/newview/llinventorypanel.cpp | 8 ++++++++ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index c756ff84e1..dca14cc48f 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1336,29 +1336,6 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) } -BOOL LLFolderView::canDoDelete() const -{ - if (mSelectedItems.size() == 0) return FALSE; - - for (selected_items_t::const_iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) - { - if (!(*item_it)->getViewModelItem()->isItemRemovable()) - { - return FALSE; - } - } - return TRUE; -} - -void LLFolderView::doDelete() -{ - if(mSelectedItems.size() > 0) - { - removeSelectedItems(); - } -} - - BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { mKeyboardSelection = FALSE; diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 05b2abb9d3..11fccdace4 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -180,9 +180,6 @@ public: virtual BOOL canPaste() const; virtual void paste(); - virtual BOOL canDoDelete() const; - virtual void doDelete(); - LLFolderViewItem* getNextUnselectedItem(); // Public rename functionality - can only start the process diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 019ba8f5b2..0653a097f5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1365,6 +1365,14 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) LLInventoryAction::doToSelected(mInventory, mFolderRoot, "open"); handled = TRUE; } + break; + case KEY_DELETE: + if (mask == MASK_NONE) + { + LLInventoryAction::doToSelected(mInventory, mFolderRoot, "delete"); + handled = TRUE; + } + break; } return handled; } -- cgit v1.2.3 From 68a4a8402ccd614f5cdb40cb53efa85166c12598 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Thu, 7 Feb 2013 19:39:46 +0200 Subject: CHUI-722 Fixed! Add ? button to titlebar on floaters: Conversation Log, Nearby Chat History, and IM History --- indra/newview/skins/default/xui/en/floater_conversation_log.xml | 1 + indra/newview/skins/default/xui/en/floater_conversation_preview.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index 7229292a14..19a4cbc119 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -3,6 +3,7 @@ Date: Thu, 7 Feb 2013 13:27:32 -0800 Subject: CHUI-735 : Fixed! Handle the backspace case, suppress the search string handling from LLFolderView (it's in the search edit field now). --- indra/llui/llfolderview.cpp | 14 -------------- indra/newview/llinventorypanel.cpp | 3 +++ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index dca14cc48f..8feaf654f0 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1275,20 +1275,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) break; } - if (!handled && mParentPanel->hasFocus()) - { - if (key == KEY_BACKSPACE) - { - mSearchTimer.reset(); - if (mSearchString.size()) - { - mSearchString.erase(mSearchString.size() - 1, 1); - } - search(getCurSelectedItem(), mSearchString, FALSE); - handled = TRUE; - } - } - return handled; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0653a097f5..578b83fd28 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1367,6 +1367,9 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) } break; case KEY_DELETE: + case KEY_BACKSPACE: + // Delete selected items if delete or backspace key hit on the inventory panel + // Note: on Mac laptop keyboards, backspace and delete are one and the same if (mask == MASK_NONE) { LLInventoryAction::doToSelected(mInventory, mFolderRoot, "delete"); -- cgit v1.2.3 From 29a57c16c976eb39b3a0e82872435e0228044ba9 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 7 Feb 2013 14:41:38 -0800 Subject: CHUI-736: When auto-exit DND mode upon startup, stored conversations are not highlighted. When the dnd im is processed, now flash the conversation line item. --- indra/newview/llimview.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index d4c8d8c4f4..2eaef48049 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -107,6 +107,7 @@ void process_dnd_im(const LLSD& notification) { LLSD data = notification["substitutions"]; LLUUID sessionID = data["SESSION_ID"].asUUID(); + LLUUID fromID = data["FROM_ID"].asUUID(); //re-create the IM session if needed //(when coming out of DND mode upon app restart) @@ -119,14 +120,22 @@ void process_dnd_im(const LLSD& notification) { name = av_name.getDisplayName(); } - + LLIMModel::getInstance()->newSession(sessionID, name, IM_NOTHING_SPECIAL, - data["FROM_ID"], + fromID, false, false); //will need slight refactor to retrieve whether offline message or not (assume online for now) + + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance("im_container"); + + if (im_box) + { + im_box->flashConversationItemWidget(sessionID, true); + } + } } -- cgit v1.2.3 From c55e4a61242cd3cf94e0a28398fd33a4eb8ea683 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 8 Feb 2013 02:03:28 +0000 Subject: CHUI-703 FIX Notification buttons: "Join","Decline","Info" are duplicated after relogin while group invitation Changed LLPersistentNotificationStorage::saveNotification() to use notification->asLLSD(true) to skip duplicates Changed LLDockControl::mDockWidget to be a LLHandle instead of a LLView* to fix crash (from accessing deleted LLView) --- indra/llui/lldockcontrol.cpp | 31 +++++++++++++---------- indra/llui/lldockcontrol.h | 4 +-- indra/newview/llpersistentnotificationstorage.cpp | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index af39e41fa6..602113432e 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -31,7 +31,6 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) : - mDockWidget(dockWidget), mDockableFloater(dockableFloater), mDockTongue(dockTongue), mDockTongueX(0), @@ -39,6 +38,11 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, { mDockAt = dockAt; + if (dockWidget != NULL) + { + mDockWidget = dockWidget->getHandle(); + } + if (dockableFloater->isDocked()) { on(); @@ -62,7 +66,7 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, repositionDockable(); } - if (mDockWidget != NULL) + if (getDock() != NULL) { mDockWidgetVisible = isDockVisible(); } @@ -78,14 +82,15 @@ LLDockControl::~LLDockControl() void LLDockControl::setDock(LLView* dockWidget) { - mDockWidget = dockWidget; - if (mDockWidget != NULL) + if (dockWidget != NULL) { + mDockWidget = dockWidget->getHandle(); repositionDockable(); mDockWidgetVisible = isDockVisible(); } else { + mDockWidget = LLHandle(); mDockWidgetVisible = false; } } @@ -97,8 +102,8 @@ void LLDockControl::getAllowedRect(LLRect& rect) void LLDockControl::repositionDockable() { - if (!mDockWidget) return; - LLRect dockRect = mDockWidget->calcScreenRect(); + if (!getDock()) return; + LLRect dockRect = getDock()->calcScreenRect(); LLRect rootRect; LLRect floater_rect = mDockableFloater->calcScreenRect(); mGetAllowedRectCallback(rootRect); @@ -150,13 +155,13 @@ bool LLDockControl::isDockVisible() { bool res = true; - if (mDockWidget != NULL) + if (getDock() != NULL) { //we should check all hierarchy - res = mDockWidget->isInVisibleChain(); + res = getDock()->isInVisibleChain(); if (res) { - LLRect dockRect = mDockWidget->calcScreenRect(); + LLRect dockRect = getDock()->calcScreenRect(); switch (mDockAt) { @@ -169,7 +174,7 @@ bool LLDockControl::isDockVisible() // assume that parent for all dockable floaters // is the root view LLRect dockParentRect = - mDockWidget->getRootView()->calcScreenRect(); + getDock()->getRootView()->calcScreenRect(); if (dockRect.mRight <= dockParentRect.mLeft || dockRect.mLeft >= dockParentRect.mRight) { @@ -189,7 +194,7 @@ bool LLDockControl::isDockVisible() void LLDockControl::moveDockable() { // calculate new dockable position - LLRect dockRect = mDockWidget->calcScreenRect(); + LLRect dockRect = getDock()->calcScreenRect(); LLRect rootRect; mGetAllowedRectCallback(rootRect); @@ -263,7 +268,7 @@ void LLDockControl::moveDockable() // calculate dock tongue position - dockParentRect = mDockWidget->getParent()->calcScreenRect(); + dockParentRect = getDock()->getParent()->calcScreenRect(); if (dockRect.getCenterX() < dockParentRect.mLeft) { mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; @@ -299,7 +304,7 @@ void LLDockControl::moveDockable() } // calculate dock tongue position - dockParentRect = mDockWidget->getParent()->calcScreenRect(); + dockParentRect = getDock()->getParent()->calcScreenRect(); if (dockRect.getCenterX() < dockParentRect.mLeft) { mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2; diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index c9602011f6..a1cfa0072c 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -63,7 +63,7 @@ public: void setDock(LLView* dockWidget); LLView* getDock() { - return mDockWidget; + return mDockWidget.get(); } void repositionDockable(); void drawToungue(); @@ -83,7 +83,7 @@ private: bool mRecalculateDockablePosition; bool mDockWidgetVisible; DocAt mDockAt; - LLView* mDockWidget; + LLHandle mDockWidget; LLRect mPrevDockRect; LLRect mRootRect; LLRect mFloaterRect; diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 224aaa2146..11c12e6c10 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -75,7 +75,7 @@ void LLPersistentNotificationStorage::saveNotifications() continue; } - data.append(notification->asLLSD()); + data.append(notification->asLLSD(true)); } writeNotifications(output); -- cgit v1.2.3 From 4a0dd9ec76bfc9a3207b0e75608343f29fb26358 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 8 Feb 2013 19:16:38 +0000 Subject: CHUI-703 FIX Notification buttons: "Join","Decline","Info" are duplicated after relogin while group invitation Renamed LLDockControl::mDockWidget to mDockWidgetHandle for clarity --- indra/llui/lldockcontrol.cpp | 6 +++--- indra/llui/lldockcontrol.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 602113432e..bd42497cb6 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -40,7 +40,7 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, if (dockWidget != NULL) { - mDockWidget = dockWidget->getHandle(); + mDockWidgetHandle = dockWidget->getHandle(); } if (dockableFloater->isDocked()) @@ -84,13 +84,13 @@ void LLDockControl::setDock(LLView* dockWidget) { if (dockWidget != NULL) { - mDockWidget = dockWidget->getHandle(); + mDockWidgetHandle = dockWidget->getHandle(); repositionDockable(); mDockWidgetVisible = isDockVisible(); } else { - mDockWidget = LLHandle(); + mDockWidgetHandle = LLHandle(); mDockWidgetVisible = false; } } diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index a1cfa0072c..98a9c7236d 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -63,7 +63,7 @@ public: void setDock(LLView* dockWidget); LLView* getDock() { - return mDockWidget.get(); + return mDockWidgetHandle.get(); } void repositionDockable(); void drawToungue(); @@ -83,7 +83,7 @@ private: bool mRecalculateDockablePosition; bool mDockWidgetVisible; DocAt mDockAt; - LLHandle mDockWidget; + LLHandle mDockWidgetHandle; LLRect mPrevDockRect; LLRect mRootRect; LLRect mFloaterRect; -- cgit v1.2.3 From 2e2026a4f8359aba26e330fc8ec9ce4a3d40e666 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Feb 2013 20:51:02 -0800 Subject: CHUI-746 : Fixed! Undid the MAINT-2276 hack now that submenus do work thanks to CHUI-682 --- indra/newview/llpaneloutfitedit.cpp | 13 +++---------- indra/newview/skins/default/xui/en/menu_cof_gear.xml | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 30f137bdba..c09d4393c8 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -186,11 +186,8 @@ private: // Populate the menu with items like "New Skin", "New Pants", etc. static void populateCreateWearableSubmenus(LLMenuGL* menu) { - // MAINT-2276...these menus are created as dummies because they are not available - // when this function is called. This prevents their parent from popping up later. - // - //LLView* menu_clothes = gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE); - //LLView* menu_bp = gMenuHolder->getChildView("COF.Geear.New_Body_Parts", FALSE); + LLView* menu_clothes = gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE); + LLView* menu_bp = gMenuHolder->getChildView("COF.Gear.New_Body_Parts", FALSE); for (U8 i = LLWearableType::WT_SHAPE; i != (U8) LLWearableType::WT_COUNT; ++i) { @@ -203,11 +200,7 @@ private: p.on_click.function_name = "Wearable.Create"; p.on_click.parameter = LLSD(type_name); - //LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp; - // This is a work-around for MAINT-2276 wherein the parent toggleable menu does not appear - // It puts everything under one menu, but that menu appears, which is better than not. - // - LLView* parent = menu; + LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp; LLUICtrlFactory::create(p, parent); } } diff --git a/indra/newview/skins/default/xui/en/menu_cof_gear.xml b/indra/newview/skins/default/xui/en/menu_cof_gear.xml index a6e9a40e31..45cf780557 100644 --- a/indra/newview/skins/default/xui/en/menu_cof_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_cof_gear.xml @@ -9,5 +9,5 @@ + name="COF.Gear.New_Body_Parts" /> -- cgit v1.2.3 From 5ecac2e900054526c5e9e2fe5610f470ad06df32 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 8 Feb 2013 22:38:54 -0800 Subject: CHUI-735 : Fixed! Refactor the code to move isSelectionRemovable() to the LLInventoryPanel level. Use it when using the delete key. --- indra/newview/llinventorypanel.cpp | 32 +++++++++++++++++++++++++++++++- indra/newview/llinventorypanel.h | 1 + indra/newview/llpanelmaininventory.cpp | 22 +--------------------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 578b83fd28..1357b613bb 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1370,7 +1370,7 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) case KEY_BACKSPACE: // Delete selected items if delete or backspace key hit on the inventory panel // Note: on Mac laptop keyboards, backspace and delete are one and the same - if (mask == MASK_NONE) + if (isSelectionRemovable() && (mask == MASK_NONE)) { LLInventoryAction::doToSelected(mInventory, mFolderRoot, "delete"); handled = TRUE; @@ -1380,6 +1380,36 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask ) return handled; } +bool LLInventoryPanel::isSelectionRemovable() +{ + bool can_delete = false; + if (mFolderRoot) + { + std::set selection_set = mFolderRoot->getSelectionList(); + if (!selection_set.empty()) + { + can_delete = true; + for (std::set::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + LLFolderViewItem *item = *iter; + const LLFolderViewModelItemInventory *listener = static_cast(item->getViewModelItem()); + if (!listener) + { + can_delete = false; + } + else + { + can_delete &= listener->isItemRemovable(); + can_delete &= !listener->isItemInTrash(); + } + } + } + } + return can_delete; +} + /************************************************************************/ /* Recent Inventory Panel related class */ /************************************************************************/ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 6eb85fbad2..00a90325ad 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -162,6 +162,7 @@ public: void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); void clearSelection(); + bool isSelectionRemovable(); LLInventoryFilter& getFilter(); const LLInventoryFilter& getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 82b79db60a..d6535c88e9 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1112,27 +1112,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "delete") { - BOOL can_delete = FALSE; - LLFolderView* root = getActivePanel()->getRootFolder(); - if (root) - { - can_delete = TRUE; - std::set selection_set = root->getSelectionList(); - if (selection_set.empty()) return FALSE; - for (std::set::iterator iter = selection_set.begin(); - iter != selection_set.end(); - ++iter) - { - LLFolderViewItem *item = *iter; - const LLFolderViewModelItemInventory *listener = static_cast(item->getViewModelItem()); - llassert(listener); - if (!listener) return FALSE; - can_delete &= listener->isItemRemovable(); - can_delete &= !listener->isItemInTrash(); - } - return can_delete; - } - return FALSE; + return getActivePanel()->isSelectionRemovable(); } if (command_name == "save_texture") { -- cgit v1.2.3