Skip to content

Commit

Permalink
Merge pull request #3369 from ann0see/refactoring/UploadRateSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
ann0see authored Oct 17, 2024
2 parents 18285f9 + 052d875 commit 815011f
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/clientsettingsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1063,25 +1063,31 @@ void CClientSettingsDlg::OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton
UpdateDisplay();
}

/// @method
/// @brief Sets upstream rate label to current upload rate if the client is connected, else resets label
void CClientSettingsDlg::UpdateUploadRate()
{
// update upstream rate information label
lblUpstreamValue->setText ( QString().setNum ( pClient->GetUploadRateKbps() ) );
lblUpstreamUnit->setText ( "kbps" );
// update upstream rate information label if needed
if ( pClient->IsConnected() )
{
lblUpstreamValue->setText ( QString().setNum ( pClient->GetUploadRateKbps() ) );
lblUpstreamUnit->setText ( "kbps" );
}
else
{
// clear text labels with client parameters
lblUpstreamValue->setText ( "---" );
lblUpstreamUnit->setText ( "" );
}
}

/// @method
/// @brief Updates slider controls (settings might have been changed) and upstream rate information label
void CClientSettingsDlg::UpdateDisplay()
{
// update slider controls (settings might have been changed)
UpdateJitterBufferFrame();
UpdateSoundCardFrame();

if ( !pClient->IsRunning() )
{
// clear text labels with client parameters
lblUpstreamValue->setText ( "---" );
lblUpstreamUnit->setText ( "" );
}
UpdateUploadRate();
}

void CClientSettingsDlg::UpdateDirectoryComboBox()
Expand Down

0 comments on commit 815011f

Please sign in to comment.