From d89793616e32cace99b5b76e47d51d141b20c7f2 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 28 Dec 2009 17:44:54 +0200 Subject: implemented minor task EXT-3454 Code improvements: Replace old-style calback with boost::function in the LLFloaterAvatarPicker --HG-- branch : product-engine --- indra/newview/llfloateravatarpicker.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.h') diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 13e491834e..e35466cec8 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -43,11 +43,10 @@ public: typedef boost::signals2::signal&), boost_boolean_combiner> validate_signal_t; typedef validate_signal_t::slot_type validate_callback_t; - // Call this to select an avatar. // The callback function will be called with an avatar name and UUID. - typedef void(*callback_t)(const std::vector&, const std::vector&, void*); - static LLFloaterAvatarPicker* show(callback_t callback, - void* userdata, + typedef boost::function&, const std::vector&)> select_callback_t; + // Call this to select an avatar. + static LLFloaterAvatarPicker* show(select_callback_t callback, BOOL allow_multiple = FALSE, BOOL closeOnSelect = FALSE); @@ -61,16 +60,16 @@ public: static void processAvatarPickerReply(class LLMessageSystem* msg, void**); private: - static void editKeystroke(class LLLineEditor* caller, void* user_data); + void editKeystroke(class LLLineEditor* caller, void* user_data); - static void onBtnFind(void* userdata); - static void onBtnSelect(void* userdata); - static void onBtnRefresh(void* userdata); - static void onRangeAdjust(LLUICtrl* source, void* data); - static void onBtnClose(void* userdata); - static void onList(class LLUICtrl* ctrl, void* userdata); - void onTabChanged(); - bool isSelectBtnEnabled(); + void onBtnFind(); + void onBtnSelect(); + void onBtnRefresh(); + void onRangeAdjust(); + void onBtnClose(); + void onList(); + void onTabChanged(); + bool isSelectBtnEnabled(); void populateNearMe(); void populateFriend(); @@ -87,9 +86,8 @@ private: BOOL mNearMeListComplete; BOOL mCloseOnSelect; - void (*mCallback)(const std::vector& name, const std::vector& id, void* userdata); - void* mCallbackUserdata; validate_signal_t mOkButtonValidateSignal; + select_callback_t mSelectionCallback; }; #endif -- cgit v1.2.3