1
0

Misc. changes

This commit is contained in:
Scott E. Graves
2017-02-18 23:05:53 -06:00
parent 3c18bf8b69
commit ca2a44f4e7
3 changed files with 31 additions and 23 deletions

View File

@@ -80,18 +80,26 @@ void CSiaApi::_CSiaRenter::AutoThreadCallback(const CSiaCurl& siaCurl)
fileTree->BuildTree(result);
auto fileList = fileTree->GetFileList();
std::uint64_t total = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetFileSize(), [](const std::uint64_t& sz, const CSiaFilePtr& file)
if (fileList.size())
{
return sz + file->GetFileSize();
});
std::uint64_t total = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetFileSize(), [](const std::uint64_t& sz, const CSiaFilePtr& file)
{
return sz + file->GetFileSize();
});
std::uint32_t totalProgress = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetUploadProgress(), [](const std::uint32_t& progress, const CSiaFilePtr& file)
std::uint32_t totalProgress = std::accumulate(std::next(fileList.begin()), fileList.end(), fileList[0]->GetUploadProgress(), [](const std::uint32_t& progress, const CSiaFilePtr& file)
{
return progress + file->GetUploadProgress();
}) / fileList.size();
SetTotalUsedBytes(total);
SetTotalUploadProgress(totalProgress);
}
else
{
return progress + file->GetUploadProgress();
}) / fileList.size();
SetTotalUsedBytes(total);
SetTotalUploadProgress(totalProgress);
SetTotalUsedBytes(0);
SetTotalUploadProgress(100);
}
}
else
{

View File

@@ -237,44 +237,44 @@
<div id="ID_Tab_Renter" style="display: none">
<h3>Renter Settings <a href="javascript:void(0)" id="ID_Renter_Edit">edit</a></h3>
<table width="inherit">
<table width="inherit" style="margin: 0 auto">
<tr>
<td style="text-align: right">Total Funding:</td>
<td id="ID_Renter_AllocatedFunds"></td>
<td colspan="40%"></td>
<td id="ID_Renter_AllocatedFunds" style="min-width:120px; word-wrap: break-word;"></td>
<td colspan="50%"></td>
<td style="text-align: right">Used Funding:</td>
<td id="ID_Renter_UsedFunds"></td>
<td id="ID_Renter_UsedFunds" style="min-width:120px; word-wrap: break-word;"></td>
</tr>
<tr>
<td style="text-align: right">Available Funding:</td>
<td id="ID_Renter_AvailableFunds"></td>
<td colspan="40%"></td>
<td colspan="50%"></td>
<td style="text-align: right">Host Count:</td>
<td id="ID_Renter_HostCount"></td>
</tr>
<tr>
<td>
<br />
<td colspan="100%">
<hr />
</td>
</tr>
<tr>
<td style="text-align: right">Total GB:</td>
<td id="ID_Renter_EstimatedSpace"></td>
<td colspan="40%"></td>
<td colspan="50%"></td>
<td style="text-align: right">Price (per GB):</td>
<td id="ID_Renter_EstimatedCost"></td>
</tr>
<tr>
<td style="text-align: right">Available GB:</td>
<td id="ID_Renter_AvailablSpace"></td>
<td colspan="40%"></td>
<td colspan="50%"></td>
<td style="text-align: right">Download (per GB):</td>
<td id="ID_Renter_EstimatedDownlodCost"></td>
</tr>
<tr>
<td style="text-align: right">Used GB:</td>
<td id="ID_Renter_UsedSpace"></td>
<td colspan="40%"></td>
<td colspan="50%"></td>
<td style="text-align: right">Upload (per GB):</td>
<td id="ID_Renter_EstimatedUploadCost"></td>
</tr>
@@ -289,11 +289,11 @@
<div id="ID_TabWindow" style="display: none">
<div class="box">
<h3>Receive Address</h3>
<label id="ID_WalletReceiveAddress"></label>
<label id="ID_WalletReceiveAddress" style="text-align: center; width: inherit;display: block;"></label>
</div>
<div id="ID_ActiveTab" class="box"></div>
<div class="box">
<h3>Mounting</h3>
<h3>Mount Location</h3>
<p>Choose an available drive letter and click 'Mount'</p>
<table>
<tr>

View File

@@ -466,7 +466,7 @@ void CSiaDriveDlg::ClearDisplay()
SetWalletConfirmedBalance(L"...");
SetWalletUnconfirmedBalance(L"...");
SetWalletTotalBalance(L"...");
SetWalletReceiveAddress(L"");
SetWalletReceiveAddress(L"...");
SetRenterAllocatedFunds(0);
SetRenterAvailableFunds(0);
@@ -790,7 +790,7 @@ bool CSiaDriveDlg::UpdateSiaInfo()
SetWalletConfirmedBalance(SiaCurrencyToString(confirmed));
SetWalletUnconfirmedBalance(SiaCurrencyToString(unconfirmed));
SetWalletTotalBalance(SiaCurrencyToString(total));
if (_receiveAddress.empty())
if (_receiveAddress.empty() || _receiveAddress == L"...")
{
String receiveAddress;
_siaApi->GetWallet()->GetAddress(receiveAddress);