QTfrontend/ui/page/pageroomslist.cpp
changeset 9541 312bb4384f33
parent 9080 9b42757d7e71
child 9549 ac5c1f691ce2
equal deleted inserted replaced
9539:ab44d44a6177 9541:312bb4384f33
   529 }
   529 }
   530 */
   530 */
   531 
   531 
   532 void PageRoomsList::onCreateClick()
   532 void PageRoomsList::onCreateClick()
   533 {
   533 {
   534     RoomNamePrompt prompt(parentWidget()->parentWidget(), m_gameSettings->value("frontend/lastroomname", QString()).toString());
   534     RoomNamePrompt prompt(this, m_gameSettings->value("frontend/lastroomname", QString()).toString());
   535     connect(&prompt, SIGNAL(roomNameChosen(const QString &)), this, SLOT(onRoomNameChosen(const QString &)));
   535     if(prompt.exec())
   536     prompt.exec();
   536         onRoomNameChosen(prompt.getRoomName(), prompt.getPassword());
   537 }
   537 }
   538 
   538 
   539 void PageRoomsList::onRoomNameChosen(const QString & roomName)
   539 void PageRoomsList::onRoomNameChosen(const QString & roomName, const QString & password)
   540 {
   540 {
   541     if (!roomName.trimmed().isEmpty())
   541     if (!roomName.trimmed().isEmpty())
   542     {
   542     {
   543         m_gameSettings->setValue("frontend/lastroomname", roomName);
   543         m_gameSettings->setValue("frontend/lastroomname", roomName);
   544         emit askForCreateRoom(roomName);
   544         emit askForCreateRoom(roomName, password);
   545     }
   545     }
   546     else
   546     else
   547     {
   547     {
   548         onCreateClick();
   548         onCreateClick();
   549     }
   549     }