refactor: MainWindow only act on when the rb for mode is Checked, this prevents doing the full coreModeToggled twice when changing modes
This commit is contained in:
parent
12860646d2
commit
c1172ab8b5
2 changed files with 8 additions and 2 deletions
|
|
@ -523,8 +523,14 @@ void MainWindow::showMyFingerprint()
|
|||
fingerprintDialog.exec();
|
||||
}
|
||||
|
||||
void MainWindow::coreModeToggled()
|
||||
void MainWindow::coreModeToggled(bool checked)
|
||||
{
|
||||
// this method is called when rbClient or rbServer toggles
|
||||
// with both being in the same group one must be turned on if the other is turned off
|
||||
// only react to toggle on to avoid calling everything twice when the user switches modes
|
||||
if (!checked)
|
||||
return;
|
||||
|
||||
auto serverMode = ui->rbModeServer->isChecked();
|
||||
|
||||
const auto mode = serverMode ? QStringLiteral("server enabled") : QStringLiteral("client enabled");
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ private:
|
|||
void updateSecurityIcon(bool visible);
|
||||
void updateNetworkInfo();
|
||||
|
||||
void coreModeToggled();
|
||||
void coreModeToggled(bool checked);
|
||||
void updateModeControls(bool serverMode);
|
||||
void updateModeControlLabels();
|
||||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
|
|
|
|||
Loading…
Reference in a new issue