From 0e351bedb6ec15ecb4da6073c8db4edc34ccc0ba Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 24 Nov 2009 22:55:56 -0800 Subject: Removed llnotifications.h from all headers by adding llnotificationsptr.h Fixed many more includes --- indra/newview/llstartup.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d36ff1605e..2da4a16438 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -66,6 +66,7 @@ #include "llmemorystream.h" #include "llmessageconfig.h" #include "llmoveview.h" +#include "llnotifications.h" #include "llteleporthistory.h" #include "llregionhandle.h" #include "llsd.h" -- cgit v1.2.3 From cbc0783cd19f096b454cabe47174c97d3d42842b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 25 Nov 2009 01:15:50 -0800 Subject: Created lightweight LLNotificationsUtil::add(), switched most alerts to use it Cuts number of includes of llnotifications.h from 300+ to 40. --- indra/newview/llstartup.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2da4a16438..22282d8a2e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -67,6 +67,7 @@ #include "llmessageconfig.h" #include "llmoveview.h" #include "llnotifications.h" +#include "llnotificationsutil.h" #include "llteleporthistory.h" #include "llregionhandle.h" #include "llsd.h" @@ -445,16 +446,16 @@ bool idle_startup() if (LLFeatureManager::getInstance()->isSafe()) { - LLNotifications::instance().add("DisplaySetToSafe"); + LLNotificationsUtil::add("DisplaySetToSafe"); } else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && (gSavedSettings.getS32("LastFeatureVersion") != 0)) { - LLNotifications::instance().add("DisplaySetToRecommended"); + LLNotificationsUtil::add("DisplaySetToRecommended"); } else if (!gViewerWindow->getInitAlert().empty()) { - LLNotifications::instance().add(gViewerWindow->getInitAlert()); + LLNotificationsUtil::add(gViewerWindow->getInitAlert()); } gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); @@ -1157,7 +1158,7 @@ bool idle_startup() LLSD args; args["ERROR_MESSAGE"] = emsg.str(); LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; - LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done); } //setup map of datetime strings to codes and slt & local time offset from utc @@ -1180,7 +1181,7 @@ bool idle_startup() LLSD args; args["ERROR_MESSAGE"] = emsg.str(); LL_INFOS("LLStartup") << "Notification: " << args << LL_ENDL; - LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done); + LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done); transition_back_to_login_panel(emsg.str()); show_connect_box = true; } @@ -1900,7 +1901,7 @@ bool idle_startup() { msg = "AvatarMovedLast"; } - LLNotifications::instance().add(msg); + LLNotificationsUtil::add(msg); } } @@ -1985,7 +1986,7 @@ bool idle_startup() // initial outfit, but if the load hasn't started // already then something is wrong so fall back // to generic outfits. JC - LLNotifications::instance().add("WelcomeChooseSex", LLSD(), LLSD(), + LLNotificationsUtil::add("WelcomeChooseSex", LLSD(), LLSD(), callback_choose_gender); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; @@ -1993,7 +1994,7 @@ bool idle_startup() if (wearables_time > MAX_WEARABLES_TIME) { - LLNotifications::instance().add("ClothingLoading"); + LLNotificationsUtil::add("ClothingLoading"); LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; @@ -2319,12 +2320,12 @@ bool is_hex_string(U8* str, S32 len) void show_first_run_dialog() { - LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback); + LLNotificationsUtil::add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback); } bool first_run_dialog_callback(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; @@ -2347,7 +2348,7 @@ void set_startup_status(const F32 frac, const std::string& string, const std::st bool login_alert_status(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); // Buttons switch( option ) { @@ -2381,7 +2382,7 @@ void use_circuit_callback(void**, S32 result) { // Make sure user knows something bad happened. JC LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; - LLNotifications::instance().add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); + LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); reset_login(); } else @@ -2586,7 +2587,7 @@ const S32 OPT_FEMALE = 1; bool callback_choose_gender(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { case OPT_MALE: -- cgit v1.2.3 From 34d3d02101e1838a4d8b875850a12867866a2935 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Fri, 27 Nov 2009 16:07:14 +0200 Subject: fixed bug EXT-2785 All gestures appear in Gestures window only after inventory/gestures has been invoked Cause: Specific implementation of LLInventoryCompletionObserver. It call done() on startup before all items had been loaded. Changes: LLGesturemanager will be loaded appropriated inventory item itself. LLGestureInventoryfetchObserver has been removed. --HG-- branch : product-engine --- indra/newview/llstartup.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e7fe85bdf0..db8bda008e 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -101,7 +101,6 @@ #include "llfeaturemanager.h" #include "llfirstuse.h" #include "llfloaterchat.h" -#include "llfloatergesture.h" #include "llfloaterhud.h" #include "llfloaterland.h" #include "llfloaterpreference.h" @@ -299,23 +298,6 @@ namespace }; } -class LLGestureInventoryFetchObserver : public LLInventoryFetchObserver -{ -public: - LLGestureInventoryFetchObserver() {} - virtual void done() - { - // we've downloaded all the items, so repaint the dialog - LLFloaterGesture* floater = LLFloaterReg::findTypedInstance("gestures"); - if (floater) - { - floater->refreshAll(); - } - gInventory.removeObserver(this); - delete this; - } -}; - void update_texture_fetch() { LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread @@ -1825,11 +1807,8 @@ bool idle_startup() item_ids.push_back(item_id); } } - - LLGestureInventoryFetchObserver* fetch = new LLGestureInventoryFetchObserver(); - fetch->fetchItems(item_ids); - // deletes itself when done - gInventory.addObserver(fetch); + // no need to add gesture to inventory observer, it's already made in constructor + LLGestureManager::instance().fetchItems(item_ids); } } gDisplaySwapBuffers = TRUE; -- cgit v1.2.3