QTfrontend/ui/page/pagenetgame.cpp
changeset 6151 9fd5b70acb1a
parent 6060 fdfc01419815
child 6165 6fe3e922246e
--- a/QTfrontend/ui/page/pagenetgame.cpp	Wed Oct 19 02:10:27 2011 +0200
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Wed Oct 19 16:10:18 2011 +0200
@@ -61,7 +61,7 @@
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout;
 
-    leRoomName = new QLineEdit(this);
+    leRoomName = new HistoryLineEdit(this,10);
     leRoomName->setMaxLength(60);
     leRoomName->setMinimumWidth(200);
     leRoomName->setMaximumWidth(400);
@@ -124,13 +124,26 @@
 
 void PageNetGame::onUpdateClick()
 {
-    if (leRoomName->text().size())
+    if (!leRoomName->text().trimmed().isEmpty())
+    {
         emit askForUpdateRoomName(leRoomName->text());
+        leRoomName->rememberCurrentText();
+    }
     else
+    {
+        leRoomName->clear();
         QMessageBox::critical(this,
                 tr("Error"),
                 tr("Please enter room name"),
                 tr("OK"));
+    }
+}
+
+
+void PageNetGame::setRoomName(const QString & roomName)
+{
+    leRoomName->setText(roomName);
+    leRoomName->rememberCurrentText();
 }
 
 void PageNetGame::setMasterMode(bool isMaster)
@@ -140,3 +153,4 @@
     BtnUpdate->setVisible(isMaster);
     leRoomName->setVisible(isMaster);
 }
+