bugfix: 0000016: Join network game without giving address = crash

This commit is contained in:
doitux
2010-04-22 12:56:56 +00:00
parent a447ec927e
commit 1ae72aeb75
3 changed files with 39 additions and 21 deletions
@@ -44,7 +44,8 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile
treeWidget->setDisabled(TRUE);
}
connect( lineEdit_ipAddress, SIGNAL( editingFinished ()), this, SLOT( checkIp() ) );
connect( lineEdit_ipAddress, SIGNAL( editingFinished()), this, SLOT( checkIp() ) );
connect( lineEdit_ipAddress, SIGNAL( textChanged(QString)), this, SLOT( connectButtonTest() ) );
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
@@ -98,6 +99,8 @@ void joinNetworkGameDialogImpl::exec() {
checkBox_ipv6->setEnabled(socket_has_ipv6());
checkBox_sctp->setEnabled(socket_has_sctp());
connectButtonTest();
QDialog::exec();
}
@@ -286,3 +289,13 @@ void joinNetworkGameDialogImpl::checkIp() {
QString tmp = lineEdit_ipAddress->text();
lineEdit_ipAddress->setText(tmp.remove(" "));
}
void joinNetworkGameDialogImpl::connectButtonTest() {
if(lineEdit_ipAddress->text().isEmpty()) {
pushButton_connect->setDisabled(TRUE);
}
else {
pushButton_connect->setDisabled(FALSE);
}
}
@@ -49,6 +49,7 @@ public slots:
void deleteServerProfile();
void keyPressEvent ( QKeyEvent * event );
void checkIp();
void connectButtonTest();
};
#endif