# HG changeset patch
# User sheepluva
# Date 1295732634 -3600
# Node ID c02406028e02cba50996613d6723399d4e69777a
# Parent  7a720b5d2247cec73873d24d9b1d68c52aaf608c
trim net nick in frontend

diff -r 7a720b5d2247 -r c02406028e02 QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp	Sat Jan 22 22:31:05 2011 +0100
+++ b/QTfrontend/hwform.cpp	Sat Jan 22 22:43:54 2011 +0100
@@ -697,7 +697,7 @@
 
 void HWForm::NetConnectServer(const QString & host, quint16 port)
 {
-    _NetConnect(host, port, ui.pageOptions->editNetNick->text());
+    _NetConnect(host, port, ui.pageOptions->editNetNick->text().trimmed());
 }
 
 void HWForm::NetConnectOfficialServer()
diff -r 7a720b5d2247 -r c02406028e02 QTfrontend/pages.cpp
--- 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);
diff -r 7a720b5d2247 -r c02406028e02 QTfrontend/pages.h
--- a/QTfrontend/pages.h	Sat Jan 22 22:31:05 2011 +0100
+++ b/QTfrontend/pages.h	Sat Jan 22 22:43:54 2011 +0100
@@ -264,6 +264,7 @@
 private slots:
     void forceFullscreen(int index);
     void setFullscreen(void);
+    void trimNetNick();
 };
 
 class PageNet : public AbstractPage