Skip to content

Commit

Permalink
Refactor UpdateDisplay() to call UpdateUploadRate()
Browse files Browse the repository at this point in the history
  • Loading branch information
pgScorpio and ann0see committed Sep 22, 2024
1 parent 4652c90 commit 052d875
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 052d875

Please sign in to comment.