Merged 2 msgboxes into 1 when first startup #4240

This commit is contained in:
Xinyu Hou 2014-11-27 19:08:30 +00:00
parent a0cc3d6e7f
commit d448fb777b

View File

@ -1138,19 +1138,37 @@ void MainWindow::installBonjour()
void MainWindow::promptAutoConnect() void MainWindow::promptAutoConnect()
{ {
int r = QMessageBox::question( if (isBonjourRunning()) {
this, tr("Synergy"), int r = QMessageBox::question(
tr("Do you want to enable auto connect?\n\n" this, tr("Synergy"),
"This feature helps you establish the connection."), tr("Do you want to enable auto connect?\n\n"
QMessageBox::Yes | QMessageBox::No); "This feature helps you establish the connection."),
QMessageBox::Yes | QMessageBox::No);
if (r == QMessageBox::Yes) { if (r == QMessageBox::Yes) {
m_AppConfig.setAutoConnect(true); m_AppConfig.setAutoConnect(true);
m_pCheckBoxAutoConnect->setChecked(true); m_pCheckBoxAutoConnect->setChecked(true);
}
else {
m_AppConfig.setAutoConnect(false);
m_pCheckBoxAutoConnect->setChecked(false);
}
} }
else { else {
m_AppConfig.setAutoConnect(false); int r = QMessageBox::question(
m_pCheckBoxAutoConnect->setChecked(false); this, tr("Synergy"),
tr("Do you want to enable auto connect and install Bonjour?\n\n"
"This feature helps you establish the connection."),
QMessageBox::Yes | QMessageBox::No);
if (r == QMessageBox::Yes) {
m_AppConfig.setAutoConnect(true);
downloadBonjour();
}
else {
m_AppConfig.setAutoConnect(false);
m_pCheckBoxAutoConnect->setChecked(false);
}
} }
m_AppConfig.setAutoConnectPrompted(true); m_AppConfig.setAutoConnectPrompted(true);