summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmarketplaceinboxinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelmarketplaceinboxinventory.cpp')
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp92
1 files changed, 70 insertions, 22 deletions
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index 2c97d539a1..47f34434db 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -37,6 +37,8 @@
#include "llviewerfoldertype.h"
+#define DEBUGGING_FRESHNESS 0
+
//
// statics
//
@@ -66,7 +68,7 @@ void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& para
LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
- // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type
+ // leslie -- temporary HACK to work around sim not creating inbox with proper system folder type
if (root_id.isNull())
{
std::string start_folder_name(params.start_folder());
@@ -133,6 +135,27 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
return LLUICtrlFactory::create<LLInboxFolderViewFolder>(params);
}
+LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
+{
+ LLFolderViewItem::Params params;
+
+ params.name = bridge->getDisplayName();
+ params.icon = bridge->getIcon();
+ params.icon_open = bridge->getOpenIcon();
+
+ if (mShowItemLinkOverlays) // if false, then links show up just like normal items
+ {
+ params.icon_overlay = LLUI::getUIImage("Inv_Link");
+ }
+
+ params.creation_date = bridge->getCreationDate();
+ params.root = mFolderRoot;
+ params.listener = bridge;
+ params.rect = LLRect (0, 0, 0, 0);
+ params.tool_tip = params.name;
+
+ return LLUICtrlFactory::create<LLInboxFolderViewItem>(params);
+}
//
// LLInboxFolderViewFolder Implementation
@@ -141,7 +164,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge
LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p)
: LLFolderViewFolder(p)
, LLBadgeOwner(getHandle())
- , mFresh(true)
+ , mFresh(false)
{
#if SUPPORTING_FRESH_ITEM_COUNT
initBadgeParams(p.new_badge());
@@ -153,19 +176,6 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder()
}
// virtual
-time_t LLInboxFolderViewFolder::getCreationDate() const
-{
- time_t ret_val = LLFolderViewFolder::getCreationDate();
-
- if (!mCreationDate)
- {
- updateFlag();
- }
-
- return ret_val;
-}
-
-// virtual
void LLInboxFolderViewFolder::draw()
{
#if SUPPORTING_FRESH_ITEM_COUNT
@@ -180,29 +190,67 @@ void LLInboxFolderViewFolder::draw()
LLFolderViewFolder::draw();
}
-void LLInboxFolderViewFolder::updateFlag() const
+void LLInboxFolderViewFolder::computeFreshness()
+{
+ const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity");
+
+ if (!last_expansion.empty())
+ {
+ LLDate saved_freshness_date = LLDate(last_expansion);
+
+ mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch());
+
+#if DEBUGGING_FRESHNESS
+ if (mFresh)
+ {
+ llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_date.secondsSinceEpoch() << llendl;
+ }
+#endif
+ }
+ else
+ {
+ mFresh = true;
+ }
+}
+
+void LLInboxFolderViewFolder::deFreshify()
{
- LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxExpand"));
- mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch());
+ mFresh = false;
+
+ gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
}
void LLInboxFolderViewFolder::selectItem()
{
- mFresh = false;
LLFolderViewFolder::selectItem();
+
+ deFreshify();
}
void LLInboxFolderViewFolder::toggleOpen()
{
- mFresh = false;
LLFolderViewFolder::toggleOpen();
+
+ deFreshify();
}
-void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const
+void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
- updateFlag();
+
+ if (mParentFolder == mRoot)
+ {
+ computeFreshness();
+ }
}
+//
+// LLInboxFolderViewItem Implementation
+//
+
+BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return TRUE;
+}
// eof