leslie_linden avatar leslie_linden committed 910dae5 Merge

Merge from viewer-experience-merge

Comments (0)

Files changed (11)

indra/newview/app_settings/settings_per_account.xml

             <string />
         </map>
     <key>LastInventoryInboxActivity</key>
-       <map>
-            <key>Comment</key>
+        <map>
+        <key>Comment</key>
             <string>The last time the received items inbox was poked by the user.</string>
-            <key>Persist</key>
+        <key>Persist</key>
             <integer>1</integer>
-            <key>Type</key>
-            <string>String</string>
-            <key>Value</key>
-            <string />
+        <key>Type</key>
+            <string>U32</string>
+        <key>Value</key>
+            <integer>0</integer>
         </map>
     <key>LastLogoff</key>
         <map>

indra/newview/llinventoryfilter.cpp

 // has user modified default filter params?
 BOOL LLInventoryFilter::isNotDefault() const
 {
-	return mFilterOps.mFilterObjectTypes != mDefaultFilterOps.mFilterObjectTypes 
-		|| mFilterOps.mFilterCategoryTypes != mDefaultFilterOps.mFilterCategoryTypes 
-		|| mFilterOps.mFilterWearableTypes != mDefaultFilterOps.mFilterWearableTypes 
-		|| mFilterOps.mFilterTypes != FILTERTYPE_OBJECT
-		|| mFilterOps.mFilterLinks != FILTERLINK_INCLUDE_LINKS
-		|| mFilterSubString.size() 
-		|| mFilterOps.mPermissions != mDefaultFilterOps.mPermissions
-		|| mFilterOps.mMinDate != mDefaultFilterOps.mMinDate 
-		|| mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate
-		|| mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo;
+	BOOL not_default = FALSE;
+
+	not_default |= (mFilterOps.mFilterObjectTypes != mDefaultFilterOps.mFilterObjectTypes);
+	not_default |= (mFilterOps.mFilterCategoryTypes != mDefaultFilterOps.mFilterCategoryTypes);
+	not_default |= (mFilterOps.mFilterWearableTypes != mDefaultFilterOps.mFilterWearableTypes);
+	not_default |= (mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes);
+	not_default |= (mFilterOps.mFilterLinks != mDefaultFilterOps.mFilterLinks);
+	not_default |= (mFilterSubString.size());
+	not_default |= (mFilterOps.mPermissions != mDefaultFilterOps.mPermissions);
+	not_default |= (mFilterOps.mMinDate != mDefaultFilterOps.mMinDate);
+	not_default |= (mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate);
+	not_default |= (mFilterOps.mHoursAgo != mDefaultFilterOps.mHoursAgo);
+
+	return not_default;
 }
 
 BOOL LLInventoryFilter::isActive() const

indra/newview/llinventorypanel.cpp

 	mScroller(NULL),
 	mSortOrderSetting(p.sort_order_setting),
 	mInventory(p.inventory),
+	mAcceptsDragAndDrop(p.accepts_drag_and_drop),
 	mAllowMultiSelect(p.allow_multi_select),
 	mShowItemLinkOverlays(p.show_item_link_overlays),
 	mShowLoadStatus(p.show_load_status),
 								   EAcceptance* accept,
 								   std::string& tooltip_msg)
 {
-	BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+	BOOL handled = FALSE;
 
-	// If folder view is empty the (x, y) point won't be in its rect
-	// so the handler must be called explicitly.
-	// but only if was not handled before. See EXT-6746.
-	if (!handled && !mFolderRoot->hasVisibleChildren())
+	if (mAcceptsDragAndDrop)
 	{
-		handled = mFolderRoot->handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
-	}
+		handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
 
-	if (handled)
-	{
-		mFolderRoot->setDragAndDropThisFrame();
+		// If folder view is empty the (x, y) point won't be in its rect
+		// so the handler must be called explicitly.
+		// but only if was not handled before. See EXT-6746.
+		if (!handled && !mFolderRoot->hasVisibleChildren())
+		{
+			handled = mFolderRoot->handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+		}
+
+		if (handled)
+		{
+			mFolderRoot->setDragAndDropThisFrame();
+		}
 	}
 
 	return handled;

indra/newview/llinventorypanel.h

 		Optional<bool>						use_label_suffix;
 		Optional<bool>						show_load_status;
 		Optional<LLScrollContainer::Params>	scroll;
+		Optional<bool>						accepts_drag_and_drop;
 
 		Params()
 		:	sort_order_setting("sort_order_setting"),
 			start_folder("start_folder"),
 			use_label_suffix("use_label_suffix", true),
 			show_load_status("show_load_status"),
-			scroll("scroll")
+			scroll("scroll"),
+			accepts_drag_and_drop("accepts_drag_and_drop")
 		{}
 	};
 
 	LLInventoryModel*			mInventory;
 	LLInventoryObserver*		mInventoryObserver;
 	LLInvPanelComplObserver*	mCompletionObserver;
+	BOOL						mAcceptsDragAndDrop;
 	BOOL 						mAllowMultiSelect;
 	BOOL 						mShowItemLinkOverlays; // Shows link graphic over inventory item icons
 	BOOL						mShowLoadStatus;

indra/newview/llpanelmarketplaceinbox.cpp

 	
 	// Set the sort order newest to oldest
 	mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
+	mInventoryPanel->getFilter()->markDefault();
 
 	// Set selection callback for proper update of inventory status buttons
 	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
 
 	sidepanel_inventory->clearSelections(true, false, true);
 
-	gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+	gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
 }
 
 BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)

indra/newview/llpanelmarketplaceinboxinventory.cpp

 
 void LLInboxFolderViewFolder::computeFreshness()
 {
-	const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity");
+	const U32 last_expansion = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity");
 
-	if (!last_expansion.empty())
+	if (last_expansion > 0)
 	{
-		// Inventory DB timezone is hardcoded to PDT or GMT-7, which is 7 hours behind GMT
-		const F64 SEVEN_HOURS_IN_SECONDS = 7 * 60 * 60;
-		const F64 saved_freshness_inventory_db_timezone = LLDate(last_expansion).secondsSinceEpoch() - SEVEN_HOURS_IN_SECONDS;
-
-		mFresh = (mCreationDate > saved_freshness_inventory_db_timezone);
+		mFresh = (mCreationDate > last_expansion);
 
 #if DEBUGGING_FRESHNESS
 		if (mFresh)
 		{
-			llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_inventory_db_timezone << llendl;
+			llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion << llendl;
 		}
 #endif
 	}
 {
 	mFresh = false;
 
-	gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+	gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
 }
 
 void LLInboxFolderViewFolder::selectItem()

indra/newview/llpanelmarketplaceoutbox.cpp

 	LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect();
 	mInventoryPanel->setShape(inventory_placeholder_rect);
 	
-	// Set the sort order newest to oldest, and a selection change callback
+	// Set the sort order newest to oldest
 	mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);	
+	mInventoryPanel->getFilter()->markDefault();
+
+	// Set selection callback for proper update of inventory status buttons
 	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this));
 	
 	// Set up the note to display when the outbox is empty

indra/newview/llsidepanelinventory.cpp

 
 	if (inbox_expanded && inboxPanel->isInVisibleChain())
 	{
-		gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+		gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
 	}
 }
 
 #else
 	if (mInboxEnabled && getChild<LLButton>(INBOX_BUTTON_NAME)->getToggleState())
 	{
-		gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString());
+		gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected());
 	}
 #endif
 

indra/newview/llsidetray.cpp

 using namespace std;
 using namespace LLNotificationsUI;
 
+class LLSideTrayButton;
+
 static LLRootViewRegistry::Register<LLSideTray>	t1("side_tray");
 static LLDefaultChildRegistry::Register<LLSideTrayTab>	t2("sidetray_tab");
 
 
 	bool			mHasBadge;
 	LLBadge::Params	mBadgeParams;
+	LLSideTrayButton*	mSideTrayButton;
 };
 
+//////////////////////////////////////////////////////////////////////////////
+// LLSideTrayButton
+// Side Tray tab button with "tear off" handling.
+//////////////////////////////////////////////////////////////////////////////
+
+class LLSideTrayButton : public LLButton
+{
+public:
+	/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask)
+	{
+		// Route future Mouse messages here preemptively.  (Release on mouse up.)
+		// No handler needed for focus lost since this class has no state that depends on it.
+		gFocusMgr.setMouseCapture(this);
+
+		localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY);
+
+		// Note: don't pass on to children
+		return TRUE;
+	}
+
+	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask)
+	{
+		// We only handle the click if the click both started and ended within us
+		if( !hasMouseCapture() ) return FALSE;
+
+		S32 screen_x;
+		S32 screen_y;
+		localPointToScreen(x, y, &screen_x, &screen_y);
+
+		S32 delta_x = screen_x - mDragLastScreenX;
+		S32 delta_y = screen_y - mDragLastScreenY;
+
+		LLSideTray* side_tray = LLSideTray::getInstance();
+
+		// Check if the tab we are dragging is docked.
+		if (!side_tray->isTabAttached(mTabName)) return FALSE;
+
+		// Same value is hardcoded in LLDragHandle::handleHover().
+		const S32 undock_threshold = 12;
+
+		// Detach a tab if it has been pulled further than undock_threshold.
+		if (delta_x <= -undock_threshold ||	delta_x >= undock_threshold	||
+			delta_y <= -undock_threshold ||	delta_y >= undock_threshold)
+		{
+			LLSideTrayTab* tab = side_tray->getTab(mTabName);
+			if (!tab) return FALSE;
+
+			tab->setDocked(false);
+
+			LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab->getName());
+			if (!floater_tab) return FALSE;
+
+			LLRect original_rect = floater_tab->getRect();
+			S32 header_snap_y = floater_tab->getHeaderHeight() / 2;
+			S32 snap_x = screen_x - original_rect.mLeft - original_rect.getWidth() / 2;
+			S32 snap_y = screen_y - original_rect.mTop + header_snap_y;
+
+			// Move the floater to appear "under" the mouse pointer.
+			floater_tab->setRect(original_rect.translate(snap_x, snap_y));
+
+			// Snap the mouse pointer to the center of the floater header
+			// and call 'mouse down' event handler to begin dragging.
+			floater_tab->handleMouseDown(original_rect.getWidth() / 2,
+				original_rect.getHeight() - header_snap_y,
+				mask);
+
+			return TRUE;
+		}
+
+		return FALSE;
+	}
+
+	void setBadgeDriver(LLSideTrayTabBadgeDriver* driver)
+	{
+		mBadgeDriver = driver;
+	}
+
+	void setVisible(BOOL visible)
+	{
+		setBadgeVisibility(visible);
+
+		LLButton::setVisible(visible);
+	}
+
+protected:
+	LLSideTrayButton(const LLButton::Params& p)
+		: LLButton(p)
+		, mDragLastScreenX(0)
+		, mDragLastScreenY(0)
+		, mBadgeDriver(NULL)
+	{
+		// Find out the tab name to use in handleHover().
+		size_t pos = getName().find("_button");
+		llassert(pos != std::string::npos);
+		mTabName = getName().substr(0, pos);
+	}
+
+	friend class LLUICtrlFactory;
+
+	void draw()
+	{
+		if (mBadgeDriver)
+		{
+			setBadgeLabel(mBadgeDriver->getBadgeString());
+		}
+
+		LLButton::draw();
+	}
+
+private:
+	S32		mDragLastScreenX;
+	S32		mDragLastScreenY;
+
+	std::string					mTabName;
+	LLSideTrayTabBadgeDriver*	mBadgeDriver;
+};
+
+
+////////////////////////////////////////////////////
+// LLSideTrayTab implementation
+////////////////////////////////////////////////////
+
 LLSideTrayTab::LLSideTrayTab(const Params& p)
 :	LLPanel(),
 	mTabTitle(p.tab_title),
 	mImageSelected(p.image_selected),
 	mDescription(p.description),
 	mMainPanel(NULL),
-	mBadgeParams(p.badge)
+	mBadgeParams(p.badge),
+	mSideTrayButton(NULL)
 {
 	mHasBadge = p.badge.isProvided();
 }
 
 	bool docking = !isDocked();
 
+	if (mSideTrayButton)
+	{
+		mSideTrayButton->setVisible(docking);
+	}
+
 	// Hide the "Tear Off" button when a tab gets undocked
 	// and show "Dock" button instead.
 	getChild<LLButton>("undock")->setVisible(docking);
 LLPanel* tab_cast<LLPanel*>(LLSideTrayTab* tab) { return tab; }
 
 //////////////////////////////////////////////////////////////////////////////
-// LLSideTrayButton
-// Side Tray tab button with "tear off" handling.
-//////////////////////////////////////////////////////////////////////////////
-
-class LLSideTrayButton : public LLButton
-{
-public:
-	/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask)
-	{
-		// Route future Mouse messages here preemptively.  (Release on mouse up.)
-		// No handler needed for focus lost since this class has no state that depends on it.
-		gFocusMgr.setMouseCapture(this);
-
-		localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY);
-
-		// Note: don't pass on to children
-		return TRUE;
-	}
-
-	/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask)
-	{
-		// We only handle the click if the click both started and ended within us
-		if( !hasMouseCapture() ) return FALSE;
-
-		S32 screen_x;
-		S32 screen_y;
-		localPointToScreen(x, y, &screen_x, &screen_y);
-
-		S32 delta_x = screen_x - mDragLastScreenX;
-		S32 delta_y = screen_y - mDragLastScreenY;
-
-		LLSideTray* side_tray = LLSideTray::getInstance();
-
-		// Check if the tab we are dragging is docked.
-		if (!side_tray->isTabAttached(mTabName)) return FALSE;
-
-		// Same value is hardcoded in LLDragHandle::handleHover().
-		const S32 undock_threshold = 12;
-
-		// Detach a tab if it has been pulled further than undock_threshold.
-		if (delta_x <= -undock_threshold ||	delta_x >= undock_threshold	||
-			delta_y <= -undock_threshold ||	delta_y >= undock_threshold)
-		{
-			LLSideTrayTab* tab = side_tray->getTab(mTabName);
-			if (!tab) return FALSE;
-
-			tab->setDocked(false);
-
-			LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab->getName());
-			if (!floater_tab) return FALSE;
-
-			LLRect original_rect = floater_tab->getRect();
-			S32 header_snap_y = floater_tab->getHeaderHeight() / 2;
-			S32 snap_x = screen_x - original_rect.mLeft - original_rect.getWidth() / 2;
-			S32 snap_y = screen_y - original_rect.mTop + header_snap_y;
-
-			// Move the floater to appear "under" the mouse pointer.
-			floater_tab->setRect(original_rect.translate(snap_x, snap_y));
-
-			// Snap the mouse pointer to the center of the floater header
-			// and call 'mouse down' event handler to begin dragging.
-			floater_tab->handleMouseDown(original_rect.getWidth() / 2,
-										 original_rect.getHeight() - header_snap_y,
-										 mask);
-
-			return TRUE;
-		}
-
-		return FALSE;
-	}
-
-	void setBadgeDriver(LLSideTrayTabBadgeDriver* driver)
-	{
-		mBadgeDriver = driver;
-	}
-
-protected:
-	LLSideTrayButton(const LLButton::Params& p)
-		: LLButton(p)
-		, mDragLastScreenX(0)
-		, mDragLastScreenY(0)
-		, mBadgeDriver(NULL)
-	{
-		// Find out the tab name to use in handleHover().
-		size_t pos = getName().find("_button");
-		llassert(pos != std::string::npos);
-		mTabName = getName().substr(0, pos);
-	}
-
-	friend class LLUICtrlFactory;
-
-	void draw()
-	{
-		if (mBadgeDriver)
-		{
-			setBadgeLabel(mBadgeDriver->getBadgeString());
-		}
-
-		LLButton::draw();
-	}
-
-private:
-	S32		mDragLastScreenX;
-	S32		mDragLastScreenY;
-
-	std::string					mTabName;
-	LLSideTrayTabBadgeDriver*	mBadgeDriver;
-};
-
-//////////////////////////////////////////////////////////////////////////////
 // LLSideTray
 //////////////////////////////////////////////////////////////////////////////
 
 	{
 		// Keep previously active tab visible if requested.
 		if (keep_prev_visible) tab_to_keep_visible = mActiveTab;
-	toggleTabButton(mActiveTab);
+		toggleTabButton(mActiveTab);
 	}
 
 	//select new tab
 
 	if (mActiveTab)
 	{
-	toggleTabButton(mActiveTab);
-	LLSD key;//empty
-	mActiveTab->onOpen(key);
+		toggleTabButton(mActiveTab);
+		LLSD key;//empty
+		mActiveTab->onOpen(key);
 	}
 
 	//arrange();
 	LLButton* button;
 	if (allowTearOff)
 	{
-		button = LLUICtrlFactory::create<LLSideTrayButton>(bparams);
+		mSideTrayButton = LLUICtrlFactory::create<LLSideTrayButton>(bparams);
+
+		button = mSideTrayButton;
 	}
 	else
 	{

indra/newview/skins/default/xui/en/panel_main_inventory.xml

      left="0"
      name="All Items"
      sort_order_setting="InventorySortOrder"
-	 show_item_link_overlays="true"
+     show_item_link_overlays="true"
      top="16"
      width="288" />
     <recent_inventory_panel
+     accepts_drag_and_drop="false"
      bg_opaque_color="DkGray2"
      bg_alpha_color="DkGray2"
      background_visible="true"
      layout="topleft"
      left_delta="0"
      name="Recent Items"
-	 show_item_link_overlays="true"
+     show_item_link_overlays="true"
      width="290" />
   </tab_container>
   <layout_stack

indra/newview/skins/default/xui/en/widgets/inventory_panel.xml

   background_visible="true"
   background_opaque="true"
   show_load_status="true"
+  accepts_drag_and_drop="true"
   >
     <scroll
-		name="Inventory Scroller"
-        follows="all"
-		reserve_scroll_corner="true"
-        tab_stop="true"
-        />
+      name="Inventory Scroller"
+      follows="all"
+      reserve_scroll_corner="true"
+      tab_stop="true"
+    />
 </panel>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.