QTfrontend/pages.cpp
changeset 4870 c02406028e02
parent 4864 9001217d3af2
child 4892 b0610081ee95
--- a/QTfrontend/pages.cpp	Sat Jan 22 22:31:05 2011 +0100
+++ b/QTfrontend/pages.cpp	Sat Jan 22 22:43:54 2011 +0100
@@ -617,6 +617,7 @@
             editNetNick = new QLineEdit(groupMisc);
             editNetNick->setMaxLength(20);
             editNetNick->setText(QLineEdit::tr("unnamed"));
+            connect(editNetNick, SIGNAL(editingFinished()), this, SLOT(trimNetNick()));
             MiscLayout->addWidget(editNetNick, 0, 1);
 
             QLabel *labelLanguage = new QLabel(groupMisc);
@@ -832,6 +833,11 @@
     this->CBResolution->setEnabled(!this->CBFullscreen->isChecked());
 }
 
+void PageOptions::trimNetNick()
+{
+    editNetNick->setText(editNetNick->text().trimmed());
+}
+
 PageNet::PageNet(QWidget* parent) : AbstractPage(parent)
 {
     QFont * font14 = new QFont("MS Shell Dlg", 14);