diff options
Diffstat (limited to 'indra/newview/llpanelgroup.h')
-rw-r--r-- | indra/newview/llpanelgroup.h | 110 |
1 files changed, 44 insertions, 66 deletions
diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 445fb28502..6db6738d18 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -45,101 +45,79 @@ class LLPanelGroupTab; class LLTabContainer; class LLAgent; -class LLPanelGroupTabObserver -{ -public: - LLPanelGroupTabObserver() {}; - virtual ~LLPanelGroupTabObserver(){}; - virtual void tabChanged() = 0; -}; class LLPanelGroup : public LLPanel, - public LLGroupMgrObserver, - public LLPanelGroupTabObserver + public LLGroupMgrObserver { public: - LLPanelGroup(const std::string& filename, - const std::string& name, - const LLUUID& group_id, - const std::string& initial_tab_selected = std::string()); + LLPanelGroup(); virtual ~LLPanelGroup(); virtual BOOL postBuild(); - static void onBtnOK(void*); - static void onBtnCancel(void*); - static void onBtnApply(void*); - static void onBtnRefresh(void*); - static void onClickTab(void*,bool); - void handleClickTab(); - void setGroupID(const LLUUID& group_id); - void selectTab(std::string tab_name); - - // Called when embedded in a floater during a close attempt. - BOOL canClose(); - - // Checks if the current tab needs to be applied, and tries to switch to the requested tab. - BOOL attemptTransition(); - - // Switches to the requested tab (will close() if requested is NULL) - void transitionToTab(); - - void updateTabVisibility(); - - // Used by attemptTransition to query the user's response to a tab that needs to apply. - bool handleNotifyCallback(const LLSD& notification, const LLSD& response); - bool apply(); - void refreshData(); - void close(); void draw(); + void onOpen(const LLSD& key); + // Group manager observer trigger. virtual void changed(LLGroupChange gc); - // PanelGroupTab observer trigger - virtual void tabChanged(); - - void setAllowEdit(BOOL v) { mAllowEdit = v; } - void showNotice(const std::string& subject, const std::string& message, const bool& has_inventory, const std::string& inventory_name, LLOfferInfo* inventory_offer); + + void notifyObservers(); + + bool apply(); + void refreshData(); + + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + + void setAllowEdit(BOOL v) { mAllowEdit = v; } + + + static void refreshCreatedGroup(const LLUUID& group_id); + + static void showNotice(const std::string& subject, + const std::string& message, + const LLUUID& group_id, + const bool& has_inventory, + const std::string& inventory_name, + LLOfferInfo* inventory_offer); + + protected: - LLPanelGroupTab* mCurrentTab; - LLPanelGroupTab* mRequestedTab; - LLTabContainer* mTabContainer; - BOOL mIgnoreTransition; + void onBtnCreate(); + void onBackBtnClick(); - LLButton* mApplyBtn; + static void onBtnApply(void*); + static void onBtnRefresh(void*); - LLTimer mRefreshTimer; - BOOL mForceClose; +protected: + bool apply(LLPanelGroupTab* tab); + + LLTimer mRefreshTimer; - std::string mInitialTab; - std::string mFilename; + BOOL mAllowEdit; std::string mDefaultNeedsApplyMesg; std::string mWantApplyMesg; - BOOL mAllowEdit; - BOOL mShowingNotifyDialog; + std::vector<LLPanelGroupTab* > mTabs; + }; class LLPanelGroupTab : public LLPanel { public: - LLPanelGroupTab(const std::string& name, const LLUUID& group_id) - : LLPanel(name), mGroupID(group_id), mAllowEdit(TRUE), mHasModal(FALSE) { } + LLPanelGroupTab(); virtual ~LLPanelGroupTab(); - // Factory that returns a new LLPanelGroupFoo tab. - static void* createTab(void* data); - // Triggered when the tab becomes active. virtual void activate() { } @@ -167,7 +145,6 @@ public: virtual std::string getHelpText() const { return mHelpText; } // Display anything returned by getHelpText - static void onClickHelp(void* data); void handleClickHelp(); // This just connects the help button callback. @@ -177,20 +154,21 @@ public: void setAllowEdit(BOOL v) { mAllowEdit = v; } - void addObserver(LLPanelGroupTabObserver *obs); - void removeObserver(LLPanelGroupTabObserver *obs); - void notifyObservers(); + virtual void setGroupID(const LLUUID& id) {mGroupID = id;}; + + void notifyObservers() {}; + + const LLUUID& getGroupID() const { return mGroupID;} + + virtual void setupCtrls (LLPanel* parent) {}; protected: LLUUID mGroupID; - LLTabContainer* mTabContainer; std::string mHelpText; BOOL mAllowEdit; BOOL mHasModal; - typedef std::set<LLPanelGroupTabObserver*> observer_list_t; - observer_list_t mObservers; }; #endif // LL_LLPANELGROUP_H |