From ebbb468a795d503a8869467d642d5f4962a3d7bf Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 9 Nov 2009 16:56:33 -0800 Subject: FIX DEV-42093 - Make sure to navigate home if current URL is empty on "Apply" This change gets rid of the crufty (and confusing) "apply()" functions from llpanelmediasettings*. Those functions were never being called, yet changes were being made in them. Instead, I added "preApply()" and "postApply()" to each of these panels, which the floater (who really does the "apply()"ing) now calls before and after it applies the changes to the media data. --- indra/newview/llpanelmediasettingssecurity.h | 56 +++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'indra/newview/llpanelmediasettingssecurity.h') diff --git a/indra/newview/llpanelmediasettingssecurity.h b/indra/newview/llpanelmediasettingssecurity.h index 2555bb8dc8..638664e59d 100644 --- a/indra/newview/llpanelmediasettingssecurity.h +++ b/indra/newview/llpanelmediasettingssecurity.h @@ -41,31 +41,37 @@ class LLFloaterMediaSettings; class LLPanelMediaSettingsSecurity : public LLPanel { - public: - BOOL postBuild(); - virtual void draw(); - static void apply(void*); - void getValues(LLSD &fill_me_in); - - LLPanelMediaSettingsSecurity(); - ~LLPanelMediaSettingsSecurity(); - - static void initValues( void* userdata, const LLSD& media_settings,bool editable ); - static void clearValues( void* userdata, bool editable); - void addWhiteListItem(const std::string& url); - void setParent( LLFloaterMediaSettings* parent ); - const std::string makeValidUrl( const std::string& src_url ); - bool passesWhiteList( const std::string& added_url, const std::string& test_url ); - - protected: - LLFloaterMediaSettings* mParent; - - private: - LLCheckBoxCtrl* mEnableWhiteList; - LLScrollListCtrl* mWhiteListList; - - static void onBtnAdd(void*); - static void onBtnDel(void*); +public: + LLPanelMediaSettingsSecurity(); + ~LLPanelMediaSettingsSecurity(); + + BOOL postBuild(); + virtual void draw(); + + // XXX TODO: put these into a common parent class? + // Hook that the floater calls before applying changes from the panel + void preApply(); + // Function that asks the panel to fill in values associated with the panel + void getValues(LLSD &fill_me_in); + // Hook that the floater calls after applying changes to the panel + void postApply(); + + static void initValues( void* userdata, const LLSD& media_settings,bool editable ); + static void clearValues( void* userdata, bool editable); + void addWhiteListItem(const std::string& url); + void setParent( LLFloaterMediaSettings* parent ); + const std::string makeValidUrl( const std::string& src_url ); + bool passesWhiteList( const std::string& added_url, const std::string& test_url ); + +protected: + LLFloaterMediaSettings* mParent; + +private: + LLCheckBoxCtrl* mEnableWhiteList; + LLScrollListCtrl* mWhiteListList; + + static void onBtnAdd(void*); + static void onBtnDel(void*); }; #endif // LL_LLPANELMEDIAMEDIASETTINGSSECURITY_H -- cgit v1.2.3