From d6101558a171dbd2390792ac1e78d09fc2c27711 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 6 Jul 2009 21:58:04 +0000 Subject: Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux. svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5 --- indra/newview/lllocationinputctrl.cpp | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'indra/newview/lllocationinputctrl.cpp') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index fac0de0f33..2cee9de1eb 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -174,8 +174,7 @@ LLLocationInputCtrl::Params::Params() add_landmark_image_disabled("add_landmark_image_disabled"), add_landmark_button("add_landmark_button"), add_landmark_hpad("add_landmark_hpad", 0), - info_button("info_button"), - background("background") + info_button("info_button") { } @@ -185,11 +184,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mInfoBtn(NULL), mAddLandmarkBtn(NULL) { - // Background image. - LLButton::Params bg_params = p.background; - mBackground = LLUICtrlFactory::create(bg_params); - addChildInBack(mBackground); - // "Place information" button. LLButton::Params info_params = p.info_button; mInfoBtn = LLUICtrlFactory::create(info_params); @@ -213,8 +207,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) enableAddLandmarkButton(true); addChild(mAddLandmarkBtn); - setFocusReceivedCallback(boost::bind(&LLLocationInputCtrl::onFocusReceived, this)); - setFocusLostCallback(boost::bind(&LLLocationInputCtrl::onFocusLost, this)); setPrearrangeCallback(boost::bind(&LLLocationInputCtrl::onLocationPrearrange, this, _2)); updateWidgetlayout(); @@ -354,6 +346,7 @@ void LLLocationInputCtrl::onFocusReceived() void LLLocationInputCtrl::onFocusLost() { + LLUICtrl::onFocusLost(); refreshLocation(); } @@ -462,7 +455,6 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val) void LLLocationInputCtrl::updateAddLandmarkButton() { bool cur_parcel_landmarked = false; - // Determine whether there are landmarks pointing to the current parcel. LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; @@ -481,21 +473,14 @@ void LLLocationInputCtrl::updateWidgetlayout() { const LLRect& rect = getLocalRect(); const LLRect& hist_btn_rect = mButton->getRect(); - LLRect info_btn_rect = mButton->getRect(); + LLRect info_btn_rect = mInfoBtn->getRect(); // info button info_btn_rect.setOriginAndSize( - 0, (rect.getHeight() - info_btn_rect.getHeight()) / 2, + 2, (rect.getHeight() - info_btn_rect.getHeight()) / 2, info_btn_rect.getWidth(), info_btn_rect.getHeight()); mInfoBtn->setRect(info_btn_rect); - // background - mBackground->setRect(LLRect(info_btn_rect.getWidth(), rect.mTop, - rect.mRight - hist_btn_rect.getWidth(), rect.mBottom)); - - // history button - mButton->setRightHPad(0); - // "Add Landmark" button { LLRect al_btn_rect = mAddLandmarkBtn->getRect(); @@ -504,14 +489,4 @@ void LLLocationInputCtrl::updateWidgetlayout() (rect.getHeight() - al_btn_rect.getHeight()) / 2); mAddLandmarkBtn->setRect(al_btn_rect); } - - // text entry - if (mTextEntry) - { - LLRect text_entry_rect(rect); - text_entry_rect.mLeft = info_btn_rect.getWidth(); - text_entry_rect.mRight = mAddLandmarkBtn->getRect().mLeft; - text_entry_rect.stretch(0, -1); // make space for border - mTextEntry->setRect(text_entry_rect); - } } -- cgit v1.2.3 From 52aeaa32841e7d0b37abab0a2a2540c2be2f16b7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 7 Jul 2009 00:53:05 +0000 Subject: Merge skinning-14 to viewer-2, including refactoring many floaters to register them with LLFloaterReg, support for introspection of ParamBlock based UI widgets to dump XML schema, splitting llfolderview.cpp into three separate files to unravel dependencies and skeleton for for LLListView widget. Resolved conflicts in these files: lldraghandle.h, lluictrl.h, llchiclet.cpp, llfolderview.h/cpp, lliinventorybridge.cpp, llpanelpicks.cpp, llviewermenu.cpp, floater_mute.xml, floater_preferences.xml, notifications.xml, panel_preferences_audio.xml, panel_preferences_graphics1.xml, panel_region_general.xml svn merge -r124961:126284 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-14 --- indra/newview/lllocationinputctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/lllocationinputctrl.cpp') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 2cee9de1eb..c7ef6e16f7 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -167,7 +167,7 @@ private: //============================================================================ -static LLDefaultWidgetRegistry::Register r("location_input"); +static LLDefaultChildRegistry::Register r("location_input"); LLLocationInputCtrl::Params::Params() : add_landmark_image_enabled("add_landmark_image_enabled"), @@ -459,7 +459,7 @@ void LLLocationInputCtrl::updateAddLandmarkButton() LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsAgentParcelLandmark is_current_parcel_landmark; - gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, -- cgit v1.2.3 From f26f7e3e29019abf3a10f6925e30baca19eb4e2d Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 8 Jul 2009 05:19:19 +0000 Subject: merge -r 889-936 https://svn.aws.productengine.com/secondlife/pe/stable/ -> viewer-2-0 Also: * Moved media remote shortcut to Communicate menu * Changed mini map menu to toggle instead of show --- indra/newview/lllocationinputctrl.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/newview/lllocationinputctrl.cpp') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index c7ef6e16f7..99f6823ba1 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -50,7 +50,6 @@ #include "llinventorymodel.h" #include "lllandmarklist.h" #include "lllocationhistory.h" -#include "llpanelplaces.h" #include "llsidetray.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" @@ -352,10 +351,7 @@ void LLLocationInputCtrl::onFocusLost() void LLLocationInputCtrl::onInfoButtonClicked() { - LLSD key; - key["type"] = LLPanelPlaces::AGENT; - - LLSideTray::getInstance()->showPanel("panel_places", key); + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "agent")); } void LLLocationInputCtrl::onAddLandmarkButtonClicked() -- cgit v1.2.3 From e97f7728a90dd66014f6b3f0cd5e8d4c71f48691 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 30 Jul 2009 23:22:41 +0000 Subject: merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0/indra@1170 https://svn.aws.productengine.com/secondlife/pe/stable-1/indra@1187 -> viewer-2.0.0-3 --- indra/newview/lllocationinputctrl.cpp | 48 ++++++++--------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'indra/newview/lllocationinputctrl.cpp') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 99f6823ba1..94abd128c4 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -48,6 +48,7 @@ #include "llagent.h" #include "llfloaterland.h" #include "llinventorymodel.h" +#include "lllandmarkactions.h" #include "lllandmarklist.h" #include "lllocationhistory.h" #include "llsidetray.h" @@ -83,28 +84,6 @@ * and choose the appropriate image for the "Add landmark" button. */ -// Returns true if the given inventory item is a landmark pointing to the current parcel. -// Used to filter inventory items. -class LLIsAgentParcelLandmark : public LLInventoryCollectFunctor -{ -public: - /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) - { - if (!item || item->getType() != LLAssetType::AT_LANDMARK) - return false; - - LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); - if (!landmark) // the landmark not been loaded yet - return false; - - LLVector3d landmark_global_pos; - if (!landmark->getGlobalPos(landmark_global_pos)) - return false; - - return LLViewerParcelMgr::getInstance()->inAgentParcel(landmark_global_pos); - } -}; - /** * Initiates loading the landmarks that have been just added. * @@ -213,10 +192,10 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) // - Make the "Add landmark" button updated when either current parcel gets changed // or a landmark gets created or removed from the inventory. // - Update the location string on parcel change. - LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( + mParcelMgrConnection = LLViewerParcelMgr::getInstance()->setAgentParcelChangedCallback( boost::bind(&LLLocationInputCtrl::onAgentParcelChange, this)); - LLLocationHistory::getInstance()->setLoadedCallback( + mLocationHistoryConnection = LLLocationHistory::getInstance()->setLoadedCallback( boost::bind(&LLLocationInputCtrl::onLocationHistoryLoaded, this)); mRemoveLandmarkObserver = new LLRemoveLandmarkObserver(this); @@ -231,6 +210,9 @@ LLLocationInputCtrl::~LLLocationInputCtrl() gInventory.removeObserver(mAddLandmarkObserver); delete mRemoveLandmarkObserver; delete mAddLandmarkObserver; + + mParcelMgrConnection.disconnect(); + mLocationHistoryConnection.disconnect(); } void LLLocationInputCtrl::setEnabled(BOOL enabled) @@ -356,6 +338,10 @@ void LLLocationInputCtrl::onInfoButtonClicked() void LLLocationInputCtrl::onAddLandmarkButtonClicked() { + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + + // Floater "Add Landmark" functionality moved to Side Tray + // TODO* Disable floater "Add Landmark" call LLFloaterReg::showInstance("add_landmark"); } @@ -450,19 +436,7 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val) // depending on whether current parcel has been landmarked. void LLLocationInputCtrl::updateAddLandmarkButton() { - bool cur_parcel_landmarked = false; - // Determine whether there are landmarks pointing to the current parcel. - LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; - LLIsAgentParcelLandmark is_current_parcel_landmark; - gInventory.collectDescendentsIf(gInventory.getRootFolderID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - is_current_parcel_landmark); - cur_parcel_landmarked = !items.empty(); - - enableAddLandmarkButton(!cur_parcel_landmarked); + enableAddLandmarkButton(!LLLandmarkActions::landmarkAlreadyExists()); } void LLLocationInputCtrl::updateWidgetlayout() -- cgit v1.2.3