diff options
| author | Steven Bennetts <steve@lindenlab.com> | 2009-10-01 17:44:44 +0000 |
|---|---|---|
| committer | Steven Bennetts <steve@lindenlab.com> | 2009-10-01 17:44:44 +0000 |
| commit | f05df68656d2abdc38d86cd6746398fa90eb8614 (patch) | |
| tree | 95f389551a7132b86dd96ff7c55b92674ee16756 /indra/newview/llpanelpick.cpp | |
| parent | 090977608d3d4e1d6d26689064910221c66f6084 (diff) | |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1868 https://svn.aws.productengine.com/secondlife/pe/stable-2@1876 -> viewer-2.0.0-3
* Bugs: EXT-1111 EXT-915 EXT-1131 EXT-1200 EXT-1202 EXT-1201 EXT-1205 EXT-1212 EXT-1173 EXT-1229 EXT-1218 EXT-1164 EXT-996 EXT-821 EXT-1030 EXT-1031 EXT-816
* Major Bugs: EXT-1142 (timeout during login due to processing group IMs)
* Changes: EXT-1216 (minimize message well)
Diffstat (limited to 'indra/newview/llpanelpick.cpp')
| -rw-r--r-- | indra/newview/llpanelpick.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 42185d28e5..5df3d4f1d6 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -39,8 +39,10 @@ #include "message.h" #include "llagent.h" #include "llbutton.h" +#include "lllineeditor.h" #include "llparcel.h" #include "llviewerparcelmgr.h" +#include "lltexteditor.h" #include "lltexturectrl.h" #include "lluiconstants.h" #include "llworldmap.h" @@ -73,7 +75,8 @@ LLPanelPick::LLPanelPick(BOOL edit_mode/* = FALSE */) mPickId(LLUUID::null), mCreatorId(LLUUID::null), mDataReceived(FALSE), - mIsPickNew(false) + mIsPickNew(false), + mLocationChanged(false) { if (edit_mode) { @@ -123,6 +126,16 @@ BOOL LLPanelPick::postBuild() if (mEditMode) { + enableSaveButton(FALSE); + + mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelPick::onPickChanged, this, _1)); + + LLLineEditor* line_edit = getChild<LLLineEditor>("pick_name"); + line_edit->setKeystrokeCallback(boost::bind(&LLPanelPick::onPickChanged, this, _1), NULL); + + LLTextEditor* text_edit = getChild<LLTextEditor>("pick_desc"); + text_edit->setKeystrokeCallback(boost::bind(&LLPanelPick::onPickChanged, this, _1)); + childSetAction("cancel_btn", boost::bind(&LLPanelPick::onClickCancel, this)); childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelPick::onClickSet, this)); childSetAction(XML_BTN_SAVE, boost::bind(&LLPanelPick::onClickSave, this)); @@ -287,6 +300,26 @@ void LLPanelPick::setEditMode( BOOL edit_mode ) updateButtons(); } +void LLPanelPick::onPickChanged(LLUICtrl* ctrl) +{ + if(mLocationChanged) + { + // Pick was enabled in onClickSet + return; + } + + if( mSnapshotCtrl->isDirty() + || getChild<LLLineEditor>("pick_name")->isDirty() + || getChild<LLTextEditor>("pick_desc")->isDirty() ) + { + enableSaveButton(TRUE); + } + else + { + enableSaveButton(FALSE); + } +} + ////////////////////////////////////////////////////////////////////////// // PROTECTED AREA ////////////////////////////////////////////////////////////////////////// @@ -466,6 +499,9 @@ void LLPanelPick::onClickSet() mSimName = parcel->getName(); } setPickLocation(createLocationText(std::string(""), SET_LOCATION_NOTICE, mSimName, mPosGlobal)); + + mLocationChanged = true; + enableSaveButton(TRUE); } // static @@ -552,3 +588,12 @@ void LLPanelPick::processParcelInfo(const LLParcelData& parcel_data) //*NOTE we don't removeObserver(...) ourselves cause LLRemoveParcelProcessor does it for us } + +void LLPanelPick::enableSaveButton(bool enable) +{ + if(!mEditMode) + { + return; + } + childSetEnabled(XML_BTN_SAVE, enable); +} |
