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
+24 -20
View File
@@ -69,24 +69,28 @@
<string>Connect to Network Game</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Profile Name:</string>
</property>
<property name="buddy">
<cstring>lineEdit_profileName</cstring>
</property>
</widget>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Profile Name:</string>
</property>
<property name="buddy">
<cstring>lineEdit_profileName</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_profileName">
<property name="text">
<string>myServerProfile1</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="lineEdit_profileName">
<property name="text">
<string>myServerProfile1</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
@@ -126,7 +130,7 @@
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<item row="2" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
@@ -169,7 +173,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="2" column="2">
<item row="2" column="1">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
@@ -212,7 +216,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="3" column="0" colspan="3">
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Server Profiles</string>
@@ -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