diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-12-21 13:03:14 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-12-21 13:03:14 -0800 |
commit | 2f91768d96683515383570c8aae21bd126fd0ad6 (patch) | |
tree | 8c0a34f7e5aa4ae519d3c10e1c6fc8e9b83cb006 /indra/newview/llpanelclassified.cpp | |
parent | d74d0d5c41d5ea114cef19aa7e54834d1c3b554b (diff) | |
parent | 0e6f0e5ca16f534ff14c57c77c323bed2d6e730c (diff) |
merge.
Diffstat (limited to 'indra/newview/llpanelclassified.cpp')
-rw-r--r-- | indra/newview/llpanelclassified.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 0dae667e7f..e29320ffc2 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1557,6 +1557,11 @@ void LLPanelClassifiedEdit::resetControls() childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); } +bool LLPanelClassifiedEdit::canClose() +{ + return isValidName(); +} + void LLPanelClassifiedEdit::sendUpdate() { LLAvatarClassifiedInfo c_data; @@ -1671,6 +1676,12 @@ void LLPanelClassifiedEdit::onChange() void LLPanelClassifiedEdit::onSaveClick() { + if(!isValidName()) + { + notifyInvalidName(); + return; + } + sendUpdate(); resetDirty(); } @@ -1681,6 +1692,34 @@ std::string LLPanelClassifiedEdit::getLocationNotice() return location_notice; } +bool LLPanelClassifiedEdit::isValidName() +{ + std::string name = getClassifiedName(); + if (name.empty()) + { + return false; + } + if (!isalnum(name[0])) + { + return false; + } + + return true; +} + +void LLPanelClassifiedEdit::notifyInvalidName() +{ + std::string name = getClassifiedName(); + if (name.empty()) + { + LLNotificationsUtil::add("BlankClassifiedName"); + } + else if (!isalnum(name[0])) + { + LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); + } +} + void LLPanelClassifiedEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) { ctrl->setVisible(TRUE); |