From 130d017085a4fa609970245a49b6d1a97de404b2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 31 Oct 2011 12:01:10 -0700 Subject: * Updated inventory code to handle creation of the "Received Items" panel when the sim notifies the viewer that the folder is created. Unfortunately, the sim is not yet doing this so a relog is required to properly get this working. --- indra/newview/llinventorymodel.cpp | 10 +++++----- indra/newview/llsidepanelinventory.cpp | 21 ++++++--------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index fb02fe0ff7..dc25689fa3 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2528,9 +2528,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer tfolder = new LLViewerInventoryCategory(gAgent.getID()); tfolder->unpackMessage(msg, _PREHASH_FolderData, i); - //llinfos << "unpaked folder '" << tfolder->getName() << "' (" - // << tfolder->getUUID() << ") in " << tfolder->getParentUUID() - // << llendl; + llinfos << "unpacked folder '" << tfolder->getName() << "' (" + << tfolder->getUUID() << ") in " << tfolder->getParentUUID() + << llendl; if(tfolder->getUUID().notNull()) { folders.push_back(tfolder); @@ -2570,8 +2570,8 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer titem = new LLViewerInventoryItem; titem->unpackMessage(msg, _PREHASH_ItemData, i); - //llinfos << "unpaked item '" << titem->getName() << "' in " - // << titem->getParentUUID() << llendl; + llinfos << "unpaked item '" << titem->getName() << "' in " + << titem->getParentUUID() << llendl; U32 callback_id; msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id); if(titem->getUUID().notNull()) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index a24f6b24f0..91f8035556 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -113,21 +113,13 @@ public: switch (added_category_type) { case LLFolderType::FT_INBOX: + mSidepanelInventory->enableInbox(true); mSidepanelInventory->observeInboxModifications(added_category->getUUID()); break; case LLFolderType::FT_OUTBOX: + mSidepanelInventory->enableOutbox(true); mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); break; - case LLFolderType::FT_NONE: - // HACK until sim update to properly create folder with system type - if (added_category->getName() == "Received Items") - { - mSidepanelInventory->observeInboxModifications(added_category->getUUID()); - } - else if (added_category->getName() == "Merchant Outbox") - { - mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); - } default: break; } @@ -288,7 +280,6 @@ BOOL LLSidepanelInventory::postBuild() gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged)); - updateInboxOutbox(); // Update the verbs buttons state. updateVerbs(); @@ -316,20 +307,20 @@ void LLSidepanelInventory::updateInboxOutbox() // Set up observer for inbox changes, if we have an inbox already if (!inbox_id.isNull()) { - observeInboxModifications(inbox_id); - // Enable the display of the inbox if it exists enableInbox(true); + + observeInboxModifications(inbox_id); } #if ENABLE_MERCHANT_OUTBOX_PANEL // Set up observer for outbox changes, if we have an outbox already if (!outbox_id.isNull()) { - observeOutboxModifications(outbox_id); - // Enable the display of the outbox if it exists enableOutbox(true); + + observeOutboxModifications(outbox_id); } #endif } -- cgit v1.2.3 From 948b56e7c288471ce87838d12cb17b3f34885274 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 31 Oct 2011 12:05:56 -0700 Subject: * Added "clear all" button to the toybox floater with corresponding functions added to LLToolBarView to perform the action. * Updated toybox to new height size per XD. --- indra/newview/llfloatertoybox.cpp | 21 +++++++++++++++ indra/newview/llfloatertoybox.h | 1 + indra/newview/lltoolbarview.cpp | 30 ++++++++++++++++++++++ indra/newview/lltoolbarview.h | 4 +++ .../skins/default/xui/en/floater_toybox.xml | 24 ++++++++++++----- .../newview/skins/default/xui/en/notifications.xml | 18 +++++++++++-- 6 files changed, 90 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index f527937e8f..324afe661f 100644 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -42,6 +42,7 @@ LLFloaterToybox::LLFloaterToybox(const LLSD& key) , mToolBar(NULL) { mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this)); + mCommitCallbackRegistrar.add("Toybox.ClearAll", boost::bind(&LLFloaterToybox::onBtnClearAll, this)); } LLFloaterToybox::~LLFloaterToybox() @@ -121,15 +122,35 @@ static bool finish_restore_toybox(const LLSD& notification, const LLSD& response { LLToolBarView::loadDefaultToolbars(); } + return false; } + +static bool finish_clear_all_toybox(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + LLToolBarView::clearAllToolbars(); + } + + return false; +} + static LLNotificationFunctorRegistration finish_restore_toybox_reg("ConfirmRestoreToybox", finish_restore_toybox); +static LLNotificationFunctorRegistration finish_clear_all_toybox_reg("ConfirmClearAllToybox", finish_clear_all_toybox); void LLFloaterToybox::onBtnRestoreDefaults() { LLNotificationsUtil::add("ConfirmRestoreToybox"); } +void LLFloaterToybox::onBtnClearAll() +{ + LLNotificationsUtil::add("ConfirmClearAllToybox"); +} + BOOL LLFloaterToybox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/llfloatertoybox.h b/indra/newview/llfloatertoybox.h index 6f0275b8fe..10aee0e6f5 100644 --- a/indra/newview/llfloatertoybox.h +++ b/indra/newview/llfloatertoybox.h @@ -50,6 +50,7 @@ public: std::string& tooltip_msg); protected: + void onBtnClearAll(); void onBtnRestoreDefaults(); void onToolBarButtonEnter(LLView* button); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index ed1dfbb8cd..5ff0ccfeb2 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -315,6 +315,19 @@ bool LLToolBarView::loadToolbars(bool force_default) return true; } +bool LLToolBarView::clearToolbars() +{ + for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + { + if (mToolbars[i]) + { + mToolbars[i]->clearCommandsList(); + } + } + + return true; +} + //static bool LLToolBarView::loadDefaultToolbars() { @@ -332,6 +345,23 @@ bool LLToolBarView::loadDefaultToolbars() return retval; } +//static +bool LLToolBarView::clearAllToolbars() +{ + bool retval = false; + + if (gToolBarView) + { + retval = gToolBarView->clearToolbars(); + if (retval) + { + gToolBarView->saveToolbars(); + } + } + + return retval; +} + void LLToolBarView::saveToolbars() const { if (!mToolbarsLoaded) diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 4307d10258..f871d522a2 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -93,10 +93,14 @@ public: // Loads the toolbars from the existing user or default settings bool loadToolbars(bool force_default = false); // return false if load fails + + // Clears all buttons off the toolbars + bool clearToolbars(); void setToolBarsVisible(bool visible); static bool loadDefaultToolbars(); + static bool clearAllToolbars(); static void startDragTool(S32 x, S32 y, LLToolBarButton* toolbarButton); static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml index ef3951a1cd..493d44a9cf 100644 --- a/indra/newview/skins/default/xui/en/floater_toybox.xml +++ b/indra/newview/skins/default/xui/en/floater_toybox.xml @@ -5,7 +5,7 @@ can_minimize="false" can_resize="false" default_tab_group="1" - height="460" + height="330" help_topic="toybox" layout="topleft" legacy_header_height="18" @@ -46,7 +46,7 @@ Buttons will appear as shown or as icon-only depending on each toolbar's settings. + top="266" /> + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3ed8c30ca8..e4458f33b1 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4636,7 +4636,21 @@ Are you sure you want to quit? name="ConfirmRestoreToybox" type="alertmodal"> -Are you sure you want to restore your default buttons and toolbars? +This action will restore your default buttons and toolbars. + +You cannot undo this action. + + + + + +This action will return all buttons to the toolbox and your toolbars will be empty. You cannot undo this action. - + Date: Mon, 31 Oct 2011 12:49:57 -0700 Subject: EXP-1487 FIX -- Minimum window size on mac --- indra/llwindow/llwindowmacosx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 4dd11541b9..8057506736 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -2545,8 +2545,8 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e { // This is where we would constrain move/resize to a particular screen - const S32 MIN_WIDTH = 320; - const S32 MIN_HEIGHT = 240; + const S32 MIN_WIDTH = 1024; + const S32 MIN_HEIGHT = 768; Rect currentBounds; Rect previousBounds; -- cgit v1.2.3 From f6e3d0e5812b144cf476e8ea54f89739e5126bde Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 31 Oct 2011 13:27:25 -0700 Subject: EXP-1486 FIX -- Minimum window size on windows Reviewed by Callum. --- indra/llwindow/llwindowwin32.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 121c7880df..6ef49a9a9c 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2354,6 +2354,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ return 0; } + case WM_GETMINMAXINFO: + { + LPMINMAXINFO min_max = (LPMINMAXINFO)l_param; + min_max->ptMinTrackSize.x = 1024; + min_max->ptMinTrackSize.y = 768; + return 0; + } + case WM_SIZE: { window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SIZE"); -- cgit v1.2.3 From d86def6f03acc3b4a07a30a2f7912e6dc35edf27 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 31 Oct 2011 14:59:10 -0700 Subject: * Added support for items at the top level of "Received Items" instead of just folders. Top-level inbox items are counted both in the total item count and in the fresh item count. --- indra/newview/llfolderviewitem.h | 4 + indra/newview/llpanelmarketplaceinbox.cpp | 15 +++ indra/newview/llpanelmarketplaceinboxinventory.cpp | 107 +++++++++++++++++---- indra/newview/llpanelmarketplaceinboxinventory.h | 36 +++++-- .../xui/en/widgets/inbox_folder_view_item.xml | 19 ++++ 5 files changed, 154 insertions(+), 27 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 676eaf825d..a26515821d 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -556,6 +556,10 @@ public: folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); } folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); } folders_t::size_type getFoldersCount() const { return mFolders.size(); } + + items_t::const_iterator getItemsBegin() const { return mItems.begin(); } + items_t::const_iterator getItemsEnd() const { return mItems.end(); } + items_t::size_type getItemsCount() const { return mItems.size(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index ac528947a4..7cb4bbf891 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -151,6 +151,20 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const fresh_item_count++; } } + + LLFolderViewFolder::items_t::const_iterator items_it = inbox_folder->getItemsBegin(); + LLFolderViewFolder::items_t::const_iterator items_end = inbox_folder->getItemsEnd(); + + for (; items_it != items_end; ++items_it) + { + const LLFolderViewItem * item_view = *items_it; + const LLInboxFolderViewItem * inbox_item_view = dynamic_cast(item_view); + + if (inbox_item_view && inbox_item_view->isFresh()) + { + fresh_item_count++; + } + } } } @@ -171,6 +185,7 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const if (inbox_folder) { item_count += inbox_folder->getFoldersCount(); + item_count += inbox_folder->getItemsCount(); } } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 2e4bf55d51..b9fb5b8c55 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -45,6 +45,7 @@ static LLDefaultChildRegistry::Register r1("inbox_inventory_panel"); static LLDefaultChildRegistry::Register r2("inbox_folder_view_folder"); +static LLDefaultChildRegistry::Register r3("inbox_folder_view_item"); // @@ -137,7 +138,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) { - LLFolderViewItem::Params params; + LLInboxFolderViewItem::Params params; params.name = bridge->getDisplayName(); params.icon = bridge->getIcon(); @@ -171,10 +172,6 @@ LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) #endif } -LLInboxFolderViewFolder::~LLInboxFolderViewFolder() -{ -} - // virtual void LLInboxFolderViewFolder::draw() { @@ -190,6 +187,20 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } +void LLInboxFolderViewFolder::selectItem() +{ + LLFolderViewFolder::selectItem(); + + deFreshify(); +} + +void LLInboxFolderViewFolder::toggleOpen() +{ + LLFolderViewFolder::toggleOpen(); + + deFreshify(); +} + void LLInboxFolderViewFolder::computeFreshness() { const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity"); @@ -218,20 +229,6 @@ void LLInboxFolderViewFolder::deFreshify() gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); } -void LLInboxFolderViewFolder::selectItem() -{ - LLFolderViewFolder::selectItem(); - - deFreshify(); -} - -void LLInboxFolderViewFolder::toggleOpen() -{ - LLFolderViewFolder::toggleOpen(); - - deFreshify(); -} - void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; @@ -246,9 +243,81 @@ void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) // LLInboxFolderViewItem Implementation // +LLInboxFolderViewItem::LLInboxFolderViewItem(const Params& p) + : LLFolderViewItem(p) + , LLBadgeOwner(getHandle()) + , mFresh(false) +{ +#if SUPPORTING_FRESH_ITEM_COUNT + computeFreshness(); + + initBadgeParams(p.new_badge()); +#endif +} + BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask) { return TRUE; } +// virtual +void LLInboxFolderViewItem::draw() +{ +#if SUPPORTING_FRESH_ITEM_COUNT + if (!badgeHasParent()) + { + addBadgeToParentPanel(); + } + + setBadgeVisibility(mFresh); +#endif + + LLFolderViewItem::draw(); +} + +void LLInboxFolderViewItem::selectItem() +{ + LLFolderViewItem::selectItem(); + + deFreshify(); +} + +void LLInboxFolderViewItem::computeFreshness() +{ + const U32 last_expansion_utc = gSavedPerAccountSettings.getU32("LastInventoryInboxActivity"); + + if (last_expansion_utc > 0) + { + mFresh = (mCreationDate > last_expansion_utc); + +#if DEBUGGING_FRESHNESS + if (mFresh) + { + llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl; + } +#endif + } + else + { + mFresh = true; + } +} + +void LLInboxFolderViewItem::deFreshify() +{ + mFresh = false; + + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); +} + +void LLInboxFolderViewItem::setCreationDate(time_t creation_date_utc) +{ + mCreationDate = creation_date_utc; + + if (mParentFolder == mRoot) + { + computeFreshness(); + } +} + // eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 46eeb9ea7f..09b14ec547 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -69,16 +69,15 @@ public: }; LLInboxFolderViewFolder(const Params& p); - ~LLInboxFolderViewFolder(); void draw(); - void computeFreshness(); - void deFreshify(); - void selectItem(); void toggleOpen(); + void computeFreshness(); + void deFreshify(); + bool isFresh() const { return mFresh; } protected: @@ -88,15 +87,36 @@ protected: }; -class LLInboxFolderViewItem : public LLFolderViewItem +class LLInboxFolderViewItem : public LLFolderViewItem, public LLBadgeOwner { public: - LLInboxFolderViewItem(const Params& p) - : LLFolderViewItem(p) + struct Params : public LLInitParam::Block { - } + Optional new_badge; + + Params() + : new_badge("new_badge") + { + } + }; + + LLInboxFolderViewItem(const Params& p); BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + + void draw(); + + void selectItem(); + + void computeFreshness(); + void deFreshify(); + + bool isFresh() const { return mFresh; } + +protected: + void setCreationDate(time_t creation_date_utc); + + bool mFresh; }; #endif //LL_INBOXINVENTORYPANEL_H diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml new file mode 100644 index 0000000000..7a7a6e9a09 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_item.xml @@ -0,0 +1,19 @@ + + + + -- cgit v1.2.3