From 148a29ea1ec97922180ca8f0f6ced9a4a9e05c07 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 9 Nov 2009 15:54:54 +0200 Subject: Implemented major task EXT-2251 - Implement panels for creating, editing and viewing Classifieds. --HG-- branch : product-engine --- indra/newview/llpanelclassified.h | 126 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) (limited to 'indra/newview/llpanelclassified.h') diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 417eddf460..eccc83cf53 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -198,5 +198,131 @@ private: void* mUserData; }; +#include "llavatarpropertiesprocessor.h" + +class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + static LLPanelClassifiedInfo* create(); + + virtual ~LLPanelClassifiedInfo(); + + virtual void setExitCallback(const commit_callback_t& cb); + + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } + + LLUUID& getAvatarId() { return mAvatarId; } + + virtual void setSnapshotId(const LLUUID& id); + + virtual LLUUID getSnapshotId(); + + virtual void setClassifiedId(const LLUUID& id) { mClassifiedId = id; } + + virtual LLUUID& getClassifiedId() { return mClassifiedId; } + + virtual void setClassifiedName(const std::string& name); + + virtual std::string getClassifiedName(); + + virtual void setDescription(const std::string& desc); + + virtual std::string getDescription(); + + virtual void setClassifiedLocation(const std::string& location); + + virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + + virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + +protected: + + LLPanelClassifiedInfo(); + + virtual void resetData(); + + virtual void resetControls(); + + static std::string createLocationText( + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global); + + void onClickMap(); + void onClickTeleport(); + void onClickBack(); + void onExit(); + +private: + + LLUUID mAvatarId; + LLUUID mClassifiedId; + LLVector3d mPosGlobal; +}; + +class LLPanelClassifiedEdit : public LLPanelClassifiedInfo +{ +public: + + static LLPanelClassifiedEdit* create(); + + virtual ~LLPanelClassifiedEdit(); + + BOOL postBuild(); + + void onOpen(const LLSD& key); + + void processProperties(void* data, EAvatarProcessorType type); + + BOOL isDirty() const; + + void resetDirty(); + + void setSaveCallback(const commit_callback_t& cb); + + void setCancelCallback(const commit_callback_t& cb); + + void resetControls(); + + virtual bool isNewClassified() { return mNewClassified; } + +protected: + + LLPanelClassifiedEdit(); + + void sendUpdate(); + + U32 getCategory(); + + void enableSaveButton(bool enable); + + std::string makeClassifiedName(); + + void setParcelId(const LLUUID& id) { mParcelId = id; } + + LLUUID getParcelId() { return mParcelId; } + + S32 getPriceForListing(); + + U8 getClassifiedFlags(); + + void onClickSetLocation(); + void onSnapshotChanged(LLUICtrl* ctrl); + void onClassifiedChanged(); + void onClickSave(); + +private: + LLTextureCtrl* mSnapshotCtrl; + + LLUUID mParcelId; + bool mNewClassified; +}; #endif // LL_LLPANELCLASSIFIED_H -- cgit v1.2.3 From d04539f74a2922db40a6f90f16929b29056f666b Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 10 Nov 2009 13:21:02 +0200 Subject: Update for major task EXT-2251 - Implement panels for creating, editing and viewing Classifieds. Fixed bugs, improved functionality. --HG-- branch : product-engine --- indra/newview/llpanelclassified.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpanelclassified.h') diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index eccc83cf53..7e384824ab 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -208,8 +208,6 @@ public: virtual ~LLPanelClassifiedInfo(); - virtual void setExitCallback(const commit_callback_t& cb); - /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); @@ -218,7 +216,7 @@ public: virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } - LLUUID& getAvatarId() { return mAvatarId; } + virtual LLUUID& getAvatarId() { return mAvatarId; } virtual void setSnapshotId(const LLUUID& id); @@ -242,6 +240,16 @@ public: virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + virtual void setParcelId(const LLUUID& id) { mParcelId = id; } + + virtual LLUUID getParcelId() { return mParcelId; } + + virtual bool getInfoLoaded() { return mInfoLoaded; } + + virtual void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } + + virtual void setExitCallback(const commit_callback_t& cb); + protected: LLPanelClassifiedInfo(); @@ -265,6 +273,8 @@ private: LLUUID mAvatarId; LLUUID mClassifiedId; LLVector3d mPosGlobal; + LLUUID mParcelId; + bool mInfoLoaded; }; class LLPanelClassifiedEdit : public LLPanelClassifiedInfo @@ -305,23 +315,15 @@ protected: std::string makeClassifiedName(); - void setParcelId(const LLUUID& id) { mParcelId = id; } - - LLUUID getParcelId() { return mParcelId; } - S32 getPriceForListing(); U8 getClassifiedFlags(); void onClickSetLocation(); - void onSnapshotChanged(LLUICtrl* ctrl); void onClassifiedChanged(); void onClickSave(); private: - LLTextureCtrl* mSnapshotCtrl; - - LLUUID mParcelId; bool mNewClassified; }; -- cgit v1.2.3 From 107525aa5a82b1cd4b2152e498d93d5db6577a15 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 10 Nov 2009 17:00:29 +0200 Subject: Update for major task EXT-2251 - Implement panels for creating, editing and viewing Classifieds. Fixed bugs, cleared code. --HG-- branch : product-engine --- indra/newview/llpanelclassified.h | 72 ++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 32 deletions(-) (limited to 'indra/newview/llpanelclassified.h') diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 7e384824ab..187bdbb37e 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -37,6 +37,7 @@ #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H +#include "llavatarpropertiesprocessor.h" #include "llpanel.h" #include "llclassifiedinfo.h" #include "v3dmath.h" @@ -55,6 +56,8 @@ class LLTextureCtrl; class LLUICtrl; class LLMessageSystem; +// *TODO deprecated, should be removed. +// New class implemented in ticket EXT-2095 class LLPanelClassified : public LLPanel { public: @@ -198,8 +201,6 @@ private: void* mUserData; }; -#include "llavatarpropertiesprocessor.h" - class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver { public: @@ -214,39 +215,39 @@ public: /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } + void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } - virtual LLUUID& getAvatarId() { return mAvatarId; } + LLUUID& getAvatarId() { return mAvatarId; } - virtual void setSnapshotId(const LLUUID& id); + void setSnapshotId(const LLUUID& id); - virtual LLUUID getSnapshotId(); + LLUUID getSnapshotId(); - virtual void setClassifiedId(const LLUUID& id) { mClassifiedId = id; } + void setClassifiedId(const LLUUID& id) { mClassifiedId = id; } - virtual LLUUID& getClassifiedId() { return mClassifiedId; } + LLUUID& getClassifiedId() { return mClassifiedId; } - virtual void setClassifiedName(const std::string& name); + void setClassifiedName(const std::string& name); - virtual std::string getClassifiedName(); + std::string getClassifiedName(); - virtual void setDescription(const std::string& desc); + void setDescription(const std::string& desc); - virtual std::string getDescription(); + std::string getDescription(); - virtual void setClassifiedLocation(const std::string& location); + void setClassifiedLocation(const std::string& location); - virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } - virtual LLVector3d& getPosGlobal() { return mPosGlobal; } + LLVector3d& getPosGlobal() { return mPosGlobal; } - virtual void setParcelId(const LLUUID& id) { mParcelId = id; } + void setParcelId(const LLUUID& id) { mParcelId = id; } - virtual LLUUID getParcelId() { return mParcelId; } + LLUUID getParcelId() { return mParcelId; } - virtual bool getInfoLoaded() { return mInfoLoaded; } + bool getInfoLoaded() { return mInfoLoaded; } - virtual void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } + void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } virtual void setExitCallback(const commit_callback_t& cb); @@ -285,23 +286,23 @@ public: virtual ~LLPanelClassifiedEdit(); - BOOL postBuild(); + /*virtual*/ BOOL postBuild(); - void onOpen(const LLSD& key); + /*virtual*/ void onOpen(const LLSD& key); - void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - BOOL isDirty() const; + /*virtual*/ BOOL isDirty() const; - void resetDirty(); + /*virtual*/ void resetDirty(); void setSaveCallback(const commit_callback_t& cb); void setCancelCallback(const commit_callback_t& cb); - void resetControls(); + /*virtual*/ void resetControls(); - virtual bool isNewClassified() { return mNewClassified; } + bool isNew() { return mIsNew; } protected: @@ -311,20 +312,27 @@ protected: U32 getCategory(); - void enableSaveButton(bool enable); + void enableVerbs(bool enable); + + void enableEditing(bool enable); std::string makeClassifiedName(); S32 getPriceForListing(); - U8 getClassifiedFlags(); + U8 getFlags(); + + std::string getLocationNotice(); + + void onSetLocationClick(); + void onChange(); + void onSaveClick(); - void onClickSetLocation(); - void onClassifiedChanged(); - void onClickSave(); + void onTexturePickerMouseEnter(LLUICtrl* ctrl); + void onTexturePickerMouseLeave(LLUICtrl* ctrl); private: - bool mNewClassified; + bool mIsNew; }; #endif // LL_LLPANELCLASSIFIED_H -- cgit v1.2.3