diff options
-rw-r--r-- | indra/llui/llflatlistview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloaterland.cpp | 69 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.cpp | 131 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.h | 23 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 110 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.h | 43 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_picks.xml | 15 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/slider_bar.xml | 3 |
9 files changed, 332 insertions, 73 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 2481249f91..2e5aeec41d 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -492,6 +492,12 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask) { if (!item_pair) return; + if (!item_pair->first) + { + llwarning("Attempt to selet an item pair containing null panel item", 0); + return; + } + setFocus(TRUE); bool select_item = !isSelected(item_pair); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 7051447409..26a179074d 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -86,6 +86,7 @@ static std::string OWNER_ONLINE = "0"; static std::string OWNER_OFFLINE = "1"; static std::string OWNER_GROUP = "2"; +static std::string MATURITY = "[MATURITY]"; // constants used in callbacks below - syntactic sugar. static const BOOL BUY_GROUP_LAND = TRUE; @@ -102,9 +103,21 @@ public: virtual void changed() { LLFloaterLand::refreshAll(); } }; -// fills target textbox with maturity info(icon and text) +// class needed to get full access to textbox inside checkbox, because LLCheckBoxCtrl::setLabel() has string as its argument. +// It was introduced while implementing EXT-4706 +class LLCheckBoxWithTBAcess : public LLCheckBoxCtrl +{ +public: + LLTextBox* getTextBox() + { + return mLabel; + } +}; + +// inserts maturity info(icon and text) into target textbox // names_floater - pointer to floater which contains strings with maturity icons filenames -void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater); +// str_to_parse is string in format "txt1[MATURITY]txt2" where maturity icon and text will be inserted instead of [MATURITY] +void insert_maturity_into_textbox(LLTextBox* target_textbox, LLFloater* names_floater, std::string str_to_parse); //--------------------------------------------------------------------------- // LLFloaterLand @@ -558,7 +571,7 @@ void LLPanelLandGeneral::refresh() if (regionp) { - FillMaturityTextBox(mContentRating, gFloaterView->getParentFloater(this)); + insert_maturity_into_textbox(mContentRating, gFloaterView->getParentFloater(this), MATURITY); mLandType->setText(regionp->getSimProductName()); } @@ -2062,8 +2075,14 @@ void LLPanelLandOptions::refresh() { // not teen so fill in the data for the maturity control mMatureCtrl->setVisible(TRUE); - mMatureCtrl->setLabel(getString("mature_check_mature")); - mMatureCtrl->setToolTip(getString("mature_check_mature_tooltip")); + LLStyle::Params style; + style.image(LLUI::getUIImage(gFloaterView->getParentFloater(this)->getString("maturity_icon_moderate"))); + LLCheckBoxWithTBAcess* fullaccess_mature_ctrl = (LLCheckBoxWithTBAcess*)mMatureCtrl; + fullaccess_mature_ctrl->getTextBox()->setText(std::string("icon"),style); + fullaccess_mature_ctrl->getTextBox()->appendText(getString("mature_check_mature"), false); + fullaccess_mature_ctrl->setToolTip(getString("mature_check_mature_tooltip")); + fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), FALSE); + // they can see the checkbox, but its disposition depends on the // state of the region LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); @@ -2464,19 +2483,26 @@ void LLPanelLandAccess::refresh() } } + LLCheckBoxWithTBAcess* maturity_checkbox = (LLCheckBoxWithTBAcess*) getChild<LLCheckBoxCtrl>( "public_access"); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(region) { - std::string region_access = "("; - region_access += region->getSimAccessString(); - region_access += ")"; - childSetLabelArg( "public_access", "[MATURITY]", region_access ); + LLTextBox* maturity_textbox = maturity_checkbox->getTextBox(); + insert_maturity_into_textbox(maturity_textbox, gFloaterView->getParentFloater(this), getString("allow_public_access")); + maturity_checkbox->reshape(maturity_checkbox->getRect().getWidth(), maturity_checkbox->getRect().getHeight(), FALSE); } else { - childSetLabelArg( "public_access", "[MATURITY]", std::string() ); - } + std::string maturity_string = getString("allow_public_access"); + size_t maturity_pos = maturity_string.find(MATURITY); + if (maturity_pos != std::string::npos) + { + maturity_string.replace(maturity_pos, MATURITY.length(), std::string("")); + } + + maturity_checkbox->setLabel(maturity_string); + } if(parcel->getRegionDenyAnonymousOverride()) { @@ -2862,7 +2888,7 @@ void LLPanelLandCovenant::refresh() LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text"); if (region_maturity) { - FillMaturityTextBox(region_maturity, gFloaterView->getParentFloater(this)); + insert_maturity_into_textbox(region_maturity, gFloaterView->getParentFloater(this), MATURITY); } LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause"); @@ -2944,9 +2970,10 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name) } } -// fills target textbox with maturity info(icon and text) +// inserts maturity info(icon and text) into target textbox // names_floater - pointer to floater which contains strings with maturity icons filenames -void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater) +// str_to_parse is string in format "txt1[MATURITY]txt2" where maturity icon and text will be inserted instead of [MATURITY] +void insert_maturity_into_textbox(LLTextBox* target_textbox, LLFloater* names_floater, std::string str_to_parse) { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) @@ -2974,7 +3001,19 @@ void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater) break; } + size_t maturity_pos = str_to_parse.find(MATURITY); + + if (maturity_pos == std::string::npos) + { + return; + } + + std::string text_before_rating = str_to_parse.substr(0, maturity_pos); + std::string text_after_rating = str_to_parse.substr(maturity_pos + MATURITY.length()); + + target_textbox->setText(text_before_rating); // any text may be here instead of "icon" except "" - target_textbox->setText(std::string("icon"),style); + target_textbox->appendText(std::string("icon"), false, style); target_textbox->appendText(LLViewerParcelMgr::getInstance()->getSelectionRegion()->getSimAccessString(), false); + target_textbox->appendText(text_after_rating, false); } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 115c7a1aa5..021e1f5159 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1410,6 +1410,11 @@ void LLPanelClassifiedInfo::setClassifiedLocation(const std::string& location) childSetValue("classified_location", location); } +std::string LLPanelClassifiedInfo::getClassifiedLocation() +{ + return childGetValue("classified_location").asString(); +} + void LLPanelClassifiedInfo::setSnapshotId(const LLUUID& id) { mSnapshotCtrl->setValue(id); @@ -1651,6 +1656,7 @@ static const S32 CB_ITEM_PG = 1; LLPanelClassifiedEdit::LLPanelClassifiedEdit() : LLPanelClassifiedInfo() , mIsNew(false) + , mIsNewWithErrors(false) , mCanClose(false) , mPublishFloater(NULL) { @@ -1709,21 +1715,12 @@ BOOL LLPanelClassifiedEdit::postBuild() return TRUE; } -void LLPanelClassifiedEdit::onOpen(const LLSD& key) +void LLPanelClassifiedEdit::fillIn(const LLSD& key) { - LLUUID classified_id = key["classified_id"]; + setAvatarId(gAgent.getID()); - mIsNew = classified_id.isNull(); - - scrollToTop(); - - if(mIsNew) + if(key.isUndefined()) { - setAvatarId(gAgent.getID()); - - resetData(); - resetControls(); - setPosGlobal(gAgent.getPositionGlobal()); LLUUID snapshot_id = LLUUID::null; @@ -1746,25 +1743,55 @@ void LLPanelClassifiedEdit::onOpen(const LLSD& key) childSetValue("classified_name", makeClassifiedName()); childSetValue("classified_desc", desc); setSnapshotId(snapshot_id); - setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); - // server will set valid parcel id setParcelId(LLUUID::null); + } + else + { + setClassifiedId(key["classified_id"]); + setClassifiedName(key["name"]); + setDescription(key["desc"]); + setSnapshotId(key["snapshot_id"]); + setCategory((U32)key["category"].asInteger()); + setContentType((U32)key["content_type"].asInteger()); + setClassifiedLocation(key["location_text"]); + childSetValue("auto_renew", key["auto_renew"]); + childSetValue("price_for_listing", key["price_for_listing"].asInteger()); + } +} + +void LLPanelClassifiedEdit::onOpen(const LLSD& key) +{ + mIsNew = key.isUndefined(); + + scrollToTop(); + + // classified is not created yet + bool is_new = isNew() || isNewWithErrors(); + + if(is_new) + { + resetData(); + resetControls(); + + fillIn(key); - enableVerbs(true); - enableEditing(true); + if(isNew()) + { + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); + } } else { LLPanelClassifiedInfo::onOpen(key); - enableVerbs(false); - enableEditing(false); } - std::string save_btn_label = isNew() ? getString("publish_label") : getString("save_label"); + std::string save_btn_label = is_new ? getString("publish_label") : getString("save_label"); childSetLabelArg("save_changes_btn", "[LABEL]", save_btn_label); + enableVerbs(is_new); + enableEditing(is_new); resetDirty(); setInfoLoaded(false); } @@ -1776,6 +1803,14 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); if(c_info && getClassifiedId() == c_info->classified_id) { + // see LLPanelClassifiedEdit::sendUpdate() for notes + mIsNewWithErrors = false; + // for just created classified - panel will probably be closed when we get here. + if(!getVisible()) + { + return; + } + enableEditing(true); setClassifiedName(c_info->name); @@ -1785,19 +1820,22 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); // *HACK see LLPanelClassifiedEdit::sendUpdate() - getChild<LLComboBox>("category")->setCurrentByIndex(c_info->category - 1); - getChild<LLComboBox>("category")->resetDirty(); + setCategory(c_info->category - 1); bool mature = is_cf_mature(c_info->flags); bool auto_renew = is_cf_auto_renew(c_info->flags); - getChild<LLIconsComboBox>("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG); + setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG); childSetValue("auto_renew", auto_renew); childSetValue("price_for_listing", c_info->price_for_listing); childSetEnabled("price_for_listing", isNew()); resetDirty(); setInfoLoaded(true); + enableVerbs(false); + + // for just created classified - in case user opened edit panel before processProperties() callback + childSetLabelArg("save_changes_btn", "[LABEL]", getString("save_label")); } } } @@ -1828,7 +1866,12 @@ void LLPanelClassifiedEdit::resetDirty() LLPanelClassifiedInfo::resetDirty(); getChild<LLUICtrl>("classified_snapshot")->resetDirty(); getChild<LLUICtrl>("classified_name")->resetDirty(); - getChild<LLUICtrl>("classified_desc")->resetDirty(); + + LLTextEditor* desc = getChild<LLTextEditor>("classified_desc"); + // call blockUndo() to really reset dirty(and make isDirty work as intended) + desc->blockUndo(); + desc->resetDirty(); + getChild<LLUICtrl>("category")->resetDirty(); getChild<LLUICtrl>("content_type")->resetDirty(); getChild<LLUICtrl>("auto_renew")->resetDirty(); @@ -1877,15 +1920,31 @@ void LLPanelClassifiedEdit::stretchSnapshot() getChild<LLUICtrl>("edit_icon")->setShape(mSnapshotCtrl->getRect()); } +U32 LLPanelClassifiedEdit::getContentType() +{ + LLComboBox* ct_cb = getChild<LLComboBox>("content_type"); + return ct_cb->getCurrentIndex(); +} + +void LLPanelClassifiedEdit::setContentType(U32 content_type) +{ + LLIconsComboBox* ct_cb = getChild<LLIconsComboBox>("content_type"); + ct_cb->setCurrentByIndex(content_type); + ct_cb->resetDirty(); +} + +bool LLPanelClassifiedEdit::getAutoRenew() +{ + return childGetValue("auto_renew").asBoolean(); +} + void LLPanelClassifiedEdit::sendUpdate() { LLAvatarClassifiedInfo c_data; if(getClassifiedId().isNull()) { - LLUUID id; - id.generate(); - setClassifiedId(id); + setClassifiedId(LLUUID::generateNewID()); } c_data.agent_id = gAgent.getID(); @@ -1902,6 +1961,14 @@ void LLPanelClassifiedEdit::sendUpdate() c_data.price_for_listing = getPriceForListing(); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoUpdate(&c_data); + + if(isNew()) + { + // Lets assume there will be some error. + // Successful sendClassifiedInfoUpdate will trigger processProperties and + // let us know there was no error. + mIsNewWithErrors = true; + } } U32 LLPanelClassifiedEdit::getCategory() @@ -1910,6 +1977,13 @@ U32 LLPanelClassifiedEdit::getCategory() return cat_cb->getCurrentIndex(); } +void LLPanelClassifiedEdit::setCategory(U32 category) +{ + LLComboBox* cat_cb = getChild<LLComboBox>("category"); + cat_cb->setCurrentByIndex(category); + cat_cb->resetDirty(); +} + U8 LLPanelClassifiedEdit::getFlags() { bool auto_renew = childGetValue("auto_renew").asBoolean(); @@ -2005,17 +2079,14 @@ void LLPanelClassifiedEdit::onSaveClick() notifyInvalidName(); return; } - if(isNew()) + if(isNew() || isNewWithErrors()) { if(gStatusBar->getBalance() < getPriceForListing()) { LLNotificationsUtil::add("ClassifiedInsufficientFunds"); return; } - } - if(isNew()) - { mPublishFloater = LLFloaterReg::findTypedInstance<LLPublishClassifiedFloater>( "publish_classified", LLSD()); diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 58e7c9a4b4..1157649a16 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -256,6 +256,8 @@ public: void setClassifiedLocation(const std::string& location); + std::string getClassifiedLocation(); + void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } LLVector3d& getPosGlobal() { return mPosGlobal; } @@ -366,6 +368,8 @@ public: /*virtual*/ BOOL postBuild(); + void fillIn(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); @@ -382,28 +386,38 @@ public: bool isNew() { return mIsNew; } + bool isNewWithErrors() { return mIsNewWithErrors; } + bool canClose(); void draw(); void stretchSnapshot(); + U32 getCategory(); + + void setCategory(U32 category); + + U32 getContentType(); + + void setContentType(U32 content_type); + + bool getAutoRenew(); + + S32 getPriceForListing(); + protected: LLPanelClassifiedEdit(); void sendUpdate(); - U32 getCategory(); - void enableVerbs(bool enable); void enableEditing(bool enable); std::string makeClassifiedName(); - S32 getPriceForListing(); - void setPriceForListing(S32 price); U8 getFlags(); @@ -429,6 +443,7 @@ protected: private: bool mIsNew; + bool mIsNewWithErrors; bool mCanClose; LLPublishClassifiedFloater* mPublishFloater; diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index f0860e7027..0a7c39db46 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -192,7 +192,6 @@ LLPanelPicks::LLPanelPicks() mPicksAccTab(NULL), mClassifiedsAccTab(NULL), mPanelClassifiedInfo(NULL), - mPanelClassifiedEdit(NULL), mNoClassifieds(false), mNoPicks(false) { @@ -385,6 +384,9 @@ BOOL LLPanelPicks::postBuild() registar.add("Pick.Teleport", boost::bind(&LLPanelPicks::onClickTeleport, this)); registar.add("Pick.Map", boost::bind(&LLPanelPicks::onClickMap, this)); registar.add("Pick.Delete", boost::bind(&LLPanelPicks::onClickDelete, this)); + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registar; + enable_registar.add("Pick.Enable", boost::bind(&LLPanelPicks::onEnableMenuItem, this, _2)); + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_picks.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; @@ -421,6 +423,22 @@ bool LLPanelPicks::isActionEnabled(const LLSD& userdata) const return true; } +bool LLPanelPicks::isClassifiedPublished(LLClassifiedItem* c_item) +{ + if(c_item) + { + LLPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()]; + if(panel) + { + return !panel->isNewWithErrors(); + } + + // we've got this classified from server - it's published + return true; + } + return false; +} + void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) { if(!mPicksAccTab->getDisplayChildren()) @@ -657,6 +675,12 @@ void LLPanelPicks::updateButtons() childSetEnabled(XML_BTN_INFO, has_selected); childSetEnabled(XML_BTN_TELEPORT, has_selected); childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected); + + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); + if(c_item) + { + childSetEnabled(XML_BTN_INFO, isClassifiedPublished(c_item)); + } } void LLPanelPicks::setProfilePanel(LLPanelProfile* profile_panel) @@ -693,9 +717,10 @@ void LLPanelPicks::createNewPick() void LLPanelPicks::createNewClassified() { - createClassifiedEditPanel(); + LLPanelClassifiedEdit* panel = NULL; + createClassifiedEditPanel(&panel); - getProfilePanel()->openPanel(mPanelClassifiedEdit, LLSD()); + getProfilePanel()->openPanel(panel, LLSD()); } void LLPanelPicks::onClickInfo() @@ -780,11 +805,10 @@ void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) if(panel->isNew()) { + mEditClassifiedPanels[panel->getClassifiedId()] = panel; + LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), panel->getClassifiedId()); - - c_item->setClassifiedName(panel->getClassifiedName()); - c_item->setDescription(panel->getDescription()); - c_item->setSnapshotId(panel->getSnapshotId()); + c_item->fillIn(panel); LLSD c_value; c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId()); @@ -800,6 +824,11 @@ void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) mClassifiedsAccTab->changeOpenClose(false); showAccordion("tab_classifieds", true); } + else if(panel->isNewWithErrors()) + { + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); + c_item->fillIn(panel); + } else { onPanelClassifiedClose(panel); @@ -860,15 +889,16 @@ void LLPanelPicks::createClassifiedInfoPanel() } } -void LLPanelPicks::createClassifiedEditPanel() +void LLPanelPicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel) { - if(!mPanelClassifiedEdit) + if(panel) { - mPanelClassifiedEdit = LLPanelClassifiedEdit::create(); - mPanelClassifiedEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); - mPanelClassifiedEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelClassifiedSave, this, mPanelClassifiedEdit)); - mPanelClassifiedEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); - mPanelClassifiedEdit->setVisible(FALSE); + LLPanelClassifiedEdit* new_panel = LLPanelClassifiedEdit::create(); + new_panel->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, new_panel)); + new_panel->setSaveCallback(boost::bind(&LLPanelPicks::onPanelClassifiedSave, this, new_panel)); + new_panel->setCancelCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, new_panel)); + new_panel->setVisible(FALSE); + *panel = new_panel; } } @@ -941,16 +971,26 @@ void LLPanelPicks::onPanelClassifiedEdit() LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); - createClassifiedEditPanel(); - LLSD params; params["classified_id"] = c_item->getClassifiedId(); - params["avatar_id"] = c_item->getAvatarId(); + params["classified_creator_id"] = c_item->getAvatarId(); params["snapshot_id"] = c_item->getSnapshotId(); params["name"] = c_item->getClassifiedName(); params["desc"] = c_item->getDescription(); - - getProfilePanel()->openPanel(mPanelClassifiedEdit, params); + params["category"] = (S32)c_item->getCategory(); + params["content_type"] = (S32)c_item->getContentType(); + params["auto_renew"] = c_item->getAutoRenew(); + params["price_for_listing"] = c_item->getPriceForListing(); + params["location_text"] = c_item->getLocationText(); + + LLPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()]; + if(!panel) + { + createClassifiedEditPanel(&panel); + mEditClassifiedPanels[c_item->getClassifiedId()] = panel; + } + getProfilePanel()->openPanel(panel, params); + panel->setPosGlobal(c_item->getPosGlobal()); } void LLPanelPicks::onClickMenuEdit() @@ -965,6 +1005,20 @@ void LLPanelPicks::onClickMenuEdit() } } +bool LLPanelPicks::onEnableMenuItem(const LLSD& user_data) +{ + std::string param = user_data.asString(); + + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); + if(c_item && "info" == param) + { + // dont show Info panel if classified was not created + return isClassifiedPublished(c_item); + } + + return true; +} + inline LLPanelProfile* LLPanelPicks::getProfilePanel() { llassert_always(NULL != mProfilePanel); @@ -1153,6 +1207,24 @@ void LLClassifiedItem::setValue(const LLSD& value) childSetVisible("selected_icon", value["selected"]); } +void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) +{ + if(!panel) + { + return; + } + + setClassifiedName(panel->getClassifiedName()); + setDescription(panel->getDescription()); + setSnapshotId(panel->getSnapshotId()); + setCategory(panel->getCategory()); + setContentType(panel->getContentType()); + setAutoRenew(panel->getAutoRenew()); + setPriceForListing(panel->getPriceForListing()); + setPosGlobal(panel->getPosGlobal()); + setLocationText(panel->getClassifiedLocation()); +} + void LLClassifiedItem::setClassifiedName(const std::string& name) { childSetValue("name", name); diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 11e811275b..a98b8c413e 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -98,6 +98,8 @@ private: void onPlusMenuItemClicked(const LLSD& param); bool isActionEnabled(const LLSD& userdata) const; + bool isClassifiedPublished(LLClassifiedItem* c_item); + void onListCommit(const LLFlatListView* f_list); void onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab); @@ -114,6 +116,8 @@ private: void onPanelClassifiedEdit(); void onClickMenuEdit(); + bool onEnableMenuItem(const LLSD& user_data); + void createNewPick(); void createNewClassified(); @@ -140,7 +144,7 @@ private: void createPickInfoPanel(); void createPickEditPanel(); void createClassifiedInfoPanel(); - void createClassifiedEditPanel(); + void createClassifiedEditPanel(LLPanelClassifiedEdit** panel); LLMenuGL* mPopupMenu; LLPanelProfile* mProfilePanel; @@ -149,10 +153,16 @@ private: LLFlatListView* mClassifiedsList; LLPanelPickInfo* mPanelPickInfo; LLPanelClassifiedInfo* mPanelClassifiedInfo; - LLPanelClassifiedEdit* mPanelClassifiedEdit; LLPanelPickEdit* mPanelPickEdit; LLToggleableMenu* mPlusMenu; + // <classified_id, edit_panel> + typedef std::map<LLUUID, LLPanelClassifiedEdit*> panel_classified_edit_map_t; + + // This map is needed for newly created classifieds. The purpose of panel is to + // sit in this map and listen to LLPanelClassifiedEdit::processProperties callback. + panel_classified_edit_map_t mEditClassifiedPanels; + LLAccordionCtrlTab* mPicksAccTab; LLAccordionCtrlTab* mClassifiedsAccTab; @@ -245,6 +255,8 @@ public: /*virtual*/ void setValue(const LLSD& value); + void fillIn(LLPanelClassifiedEdit* panel); + LLUUID getAvatarId() {return mAvatarId;} void setAvatarId(const LLUUID& avatar_id) {mAvatarId = avatar_id;} @@ -255,7 +267,11 @@ public: void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } - const LLVector3d& getPosGlobal() { return mPosGlobal; } + const LLVector3d getPosGlobal() { return mPosGlobal; } + + void setLocationText(const std::string location) { mLocationText = location; } + + std::string getLocationText() { return mLocationText; } void setClassifiedName (const std::string& name); @@ -269,10 +285,31 @@ public: LLUUID getSnapshotId(); + void setCategory(U32 cat) { mCategory = cat; } + + U32 getCategory() { return mCategory; } + + void setContentType(U32 ct) { mContentType = ct; } + + U32 getContentType() { return mContentType; } + + void setAutoRenew(U32 renew) { mAutoRenew = renew; } + + bool getAutoRenew() { return mAutoRenew; } + + void setPriceForListing(S32 price) { mPriceForListing = price; } + + S32 getPriceForListing() { return mPriceForListing; } + private: LLUUID mAvatarId; LLUUID mClassifiedId; LLVector3d mPosGlobal; + std::string mLocationText; + U32 mCategory; + U32 mContentType; + bool mAutoRenew; + S32 mPriceForListing; }; #endif // LL_LLPANELPICKS_H diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index e048c092ec..2764befeac 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1886,6 +1886,10 @@ Only large parcels can be listed in search. name="access_estate_defined"> (Defined by the Estate) </panel.string> + <panel.string + name="allow_public_access"> + Allow Public Access ([MATURITY]) + </panel.string> <panel.string name="estate_override"> One or more of these options is set at the estate level @@ -1906,7 +1910,6 @@ Only large parcels can be listed in search. <check_box follows="top|left" height="16" - label="Allow Public Access [MATURITY]" layout="topleft" left_delta="0" name="public_access" diff --git a/indra/newview/skins/default/xui/en/menu_picks.xml b/indra/newview/skins/default/xui/en/menu_picks.xml index 7e07a97016..ebb49c9004 100644 --- a/indra/newview/skins/default/xui/en/menu_picks.xml +++ b/indra/newview/skins/default/xui/en/menu_picks.xml @@ -8,6 +8,9 @@ name="pick_info"> <menu_item_call.on_click function="Pick.Info" /> + <menu_item_call.on_enable + function="Pick.Enable" + parameter="info" /> </menu_item_call> <menu_item_call label="Edit" @@ -16,6 +19,9 @@ visible="false"> <menu_item_call.on_click function="Pick.Edit" /> + <menu_item_call.on_enable + function="Pick.Enable" + parameter="edit" /> </menu_item_call> <menu_item_call label="Teleport" @@ -23,6 +29,9 @@ name="pick_teleport"> <menu_item_call.on_click function="Pick.Teleport" /> + <menu_item_call.on_enable + function="Pick.Enable" + parameter="teleport" /> </menu_item_call> <menu_item_call label="Map" @@ -30,6 +39,9 @@ name="pick_map"> <menu_item_call.on_click function="Pick.Map" /> + <menu_item_call.on_enable + function="Pick.Enable" + parameter="map" /> </menu_item_call> <menu_item_separator layout="topleft" @@ -42,5 +54,8 @@ visible="false"> <menu_item_call.on_click function="Pick.Delete" /> + <menu_item_call.on_enable + function="Pick.Enable" + parameter="delete" /> </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml index 89d5950e98..ea63cac790 100644 --- a/indra/newview/skins/default/xui/en/widgets/slider_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/slider_bar.xml @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!--All horizontal sliders are configured to have no highlighted track. See EXT-5939. --> <slider_bar track_color="SliderTrackColor" thumb_outline_color="SliderThumbOutlineColor" thumb_center_color="SliderThumbCenterColor" @@ -7,6 +8,6 @@ thumb_image_disabled="SliderThumb_Disabled" track_image_horizontal="SliderTrack_Horiz" track_image_vertical="SliderTrack_Vert" - track_highlight_horizontal_image="SliderTrack_Horiz" + track_highlight_horizontal_image="transparent.j2c" track_highlight_vertical_image="SliderTrack_Vert" font="SansSerif" /> |