From a22009d0cc23faf2c989e44db2020003750e7db8 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 30 Jul 2020 09:29:50 +0200 Subject: [PATCH] Check current balance before allowing bulk uploads --- indra/newview/llviewermenufile.cpp | 9 +++++++++ indra/newview/skins/default/xui/de/notifications.xml | 4 ++++ indra/newview/skins/default/xui/en/notifications.xml | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e9e2f3fefa..f1dca806dc 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -518,6 +518,15 @@ const void upload_bulk(const std::vector& filenames, LLFilePicker:: LLSD args; args["COST"] = expected_upload_cost; args["COUNT"] = expected_upload_count; + // Check balance before trying to upload + S32 current_balance = gStatusBar->getBalance(); + if (expected_upload_cost > current_balance) + { + args["BALANCE"] = current_balance; + LLNotificationsUtil::add("NotEnoughMoneyForBulkUpload", args); + return; + } + // LLNotificationsUtil::add("BulkUploadCostConfirmation", args, LLSD(), boost::bind(do_bulk_upload, filtered_filenames, _1, _2)); if (filtered_filenames.size() > expected_upload_count) diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index c4673ae74f..b836fa142d 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -3552,6 +3552,10 @@ Voreinstellung überschreiben oder einen anderen Namen wählen Das Hochladen von [COUNT] Gegenständen wird insgesamt [COST] L$ kosten. Möchten Sie mit dem Hochladen fortfahren? + +Ihr aktueller Kontostand von [BALANCE] L$ reicht nicht aus, um [COUNT] Gegenstände für insgesamt [COST] L$ hochzuladen. + + Die ausgewählten Dateien können nicht per Mehrfach-Upload hochgeladen werden. diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index cb8dd90ae3..4ba5bb147d 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9258,6 +9258,16 @@ This will upload [COUNT] items at a total cost of L$[COST]. Do you wish to conti notext="Cancel" yestext="Upload"/> + + +Your current balance of L$[BALANCE] is not enough to upload [COUNT] items at a total cost of L$[COST]. + +