diff options
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 39 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 113 |
3 files changed, 125 insertions, 29 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5ff51b8165..54d1b46016 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1187,7 +1187,7 @@ void LLPanelMainInventory::setUploadCostIfNeeded() LLMenuItemBranchGL* upload_menu = mMenuAdd->findChild<LLMenuItemBranchGL>("upload"); if(upload_menu) { - S32 upload_cost = -1;//LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); std::string cost_str; // getPriceUpload() returns -1 if no data available yet. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 10ceab2656..d0ac103f56 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -108,6 +108,7 @@ #include "lluilistener.h" #include "llappearancemgr.h" #include "lltrans.h" +#include "lleconomy.h" using namespace LLVOAvatarDefines; @@ -7658,6 +7659,42 @@ class LLWorldToggleCameraControls : public view_listener_t } }; +class LLUploadCostCalculator : public view_listener_t +{ + std::string mCostStr; + + bool handleEvent(const LLSD& userdata) + { + std::string menu_name = userdata.asString(); + gMenuHolder->childSetLabelArg(menu_name, "[COST]", mCostStr); + + return true; + } + + void calculateCost(); + +public: + LLUploadCostCalculator() + { + calculateCost(); + } +}; + +void LLUploadCostCalculator::calculateCost() +{ + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + + // getPriceUpload() returns -1 if no data available yet. + if(upload_cost >= 0) + { + mCostStr = llformat("%d", upload_cost); + } + else + { + mCostStr = llformat("%d", gSavedSettings.getU32("DefaultUploadCost")); + } +} + void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y) { static LLMenuGL* show_navbar_context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_hide_navbar.xml", @@ -7699,6 +7736,8 @@ void initialize_menus() enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service)); enable.add("IsGodCustomerService", boost::bind(&is_god_customer_service)); + view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts"); + // Agent commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying)); enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying)); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 16c2581d63..aff8f7ddf4 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -521,6 +521,52 @@ <menu_item_check.on_enable function="Tools.EnableToolNotPie" /> </menu_item_check> + <menu + create_jump_keys="true" + label="Select Linked Parts" + name="Select Linked Parts" + tear_off="true"> + <menu_item_call + label="Select Next Part" + name="Select Next Part" + shortcut="control|."> + <menu_item_call.on_click + function="Tools.SelectNextPart" + parameter="next" /> + <menu_item_call.on_enable + function="Tools.EnableSelectNextPart" /> + </menu_item_call> + <menu_item_call + label="Select Previous Part" + name="Select Previous Part" + shortcut="control|,"> + <menu_item_call.on_click + function="Tools.SelectNextPart" + parameter="previous" /> + <menu_item_call.on_enable + function="Tools.EnableSelectNextPart" /> + </menu_item_call> + <menu_item_call + label="Include Next Part" + name="Include Next Part" + shortcut="control|shift|."> + <menu_item_call.on_click + function="Tools.SelectNextPart" + parameter="includenext" /> + <menu_item_call.on_enable + function="Tools.EnableSelectNextPart" /> + </menu_item_call> + <menu_item_call + label="Include Previous Part" + name="Include Previous Part" + shortcut="control|shift|,"> + <menu_item_call.on_click + function="Tools.SelectNextPart" + parameter="includeprevious" /> + <menu_item_call.on_enable + function="Tools.EnableSelectNextPart" /> + </menu_item_call> + </menu> <menu_item_separator/> <menu_item_call label="Focus on Selection" @@ -764,49 +810,60 @@ </menu> <menu create_jump_keys="true" - label="Select Linked Parts" - name="Select Linked Parts" + label="Upload" + layout="topleft" + name="Upload" tear_off="true"> <menu_item_call - label="Select Next Part" - name="Select Next Part" - shortcut="control|."> + label="Image (L$[COST])..." + layout="topleft" + name="Upload Image" + shortcut="control|U"> <menu_item_call.on_click - function="Tools.SelectNextPart" - parameter="next" /> + function="File.UploadImage" + parameter="" /> <menu_item_call.on_enable - function="Tools.EnableSelectNextPart" /> + function="File.EnableUpload" /> + <menu_item_call.on_visible + function="Upload.CalculateCosts" + parameter="Upload Image" /> </menu_item_call> <menu_item_call - label="Select Previous Part" - name="Select Previous Part" - shortcut="control|,"> + label="Sound (L$[COST])..." + layout="topleft" + name="Upload Sound"> <menu_item_call.on_click - function="Tools.SelectNextPart" - parameter="previous" /> + function="File.UploadSound" + parameter="" /> <menu_item_call.on_enable - function="Tools.EnableSelectNextPart" /> + function="File.EnableUpload" /> + <menu_item_call.on_visible + function="Upload.CalculateCosts" + parameter="Upload Sound" /> </menu_item_call> <menu_item_call - label="Include Next Part" - name="Include Next Part" - shortcut="control|shift|."> + label="Animation (L$[COST])..." + layout="topleft" + name="Upload Animation"> <menu_item_call.on_click - function="Tools.SelectNextPart" - parameter="includenext" /> + function="File.UploadAnim" + parameter="" /> <menu_item_call.on_enable - function="Tools.EnableSelectNextPart" /> + function="File.EnableUpload" /> + <menu_item_call.on_visible + function="Upload.CalculateCosts" + parameter="Upload Animation" /> </menu_item_call> <menu_item_call - label="Include Previous Part" - name="Include Previous Part" - shortcut="control|shift|,"> + label="Bulk (L$[COST] per file)..." + layout="topleft" + name="Bulk Upload"> <menu_item_call.on_click - function="Tools.SelectNextPart" - parameter="includeprevious" /> - <menu_item_call.on_enable - function="Tools.EnableSelectNextPart" /> + function="File.UploadBulk" + parameter="" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> </menu> </menu> <menu @@ -3210,4 +3267,4 @@ </menu> </menu> </menu> -</menu_bar> +</menu_bar>
\ No newline at end of file |