remove whitespaces in ipaddress field

This commit is contained in:
doitux
2007-06-13 11:08:16 +00:00
parent f225ef8956
commit 55e628d94f
2 changed files with 10 additions and 0 deletions
@@ -42,6 +42,8 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile
treeWidget->setDisabled(TRUE);
}
connect( lineEdit_ipAddress, SIGNAL( editingFinished ()), this, SLOT( checkIp() ) );
connect( pushButton_connect, SIGNAL( clicked() ), this, SLOT( startClient() ) );
connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( saveServerProfile() ) );
connect( pushButton_delete, SIGNAL( clicked() ), this, SLOT( deleteServerProfile() ) );
@@ -278,3 +280,10 @@ void joinNetworkGameDialogImpl::keyPressEvent ( QKeyEvent * event ) {
// std::cout << "key" << event->key();
if (event->key() == 16777220) { pushButton_connect->click(); } //ENTER
}
void joinNetworkGameDialogImpl::checkIp() {
//remove whitespaces
QString tmp = lineEdit_ipAddress->text();
lineEdit_ipAddress->setText(tmp.remove(" "));
}