QTfrontend/pages.cpp
changeset 1315 c2f09811bb8c
parent 1314 e56b178d6d62
child 1334 b58afaadf7ae
equal deleted inserted replaced
1314:e56b178d6d62 1315:c2f09811bb8c
   634 	BtnJoin = addButton(tr("Join"), pageLayout, 1, 1);
   634 	BtnJoin = addButton(tr("Join"), pageLayout, 1, 1);
   635 	BtnRefresh = addButton(tr("Refresh"), pageLayout, 2, 1);
   635 	BtnRefresh = addButton(tr("Refresh"), pageLayout, 2, 1);
   636 
   636 
   637 	connect(BtnCreate, SIGNAL(clicked()), this, SLOT(onCreateClick()));
   637 	connect(BtnCreate, SIGNAL(clicked()), this, SLOT(onCreateClick()));
   638 	connect(BtnJoin, SIGNAL(clicked()), this, SLOT(onJoinClick()));
   638 	connect(BtnJoin, SIGNAL(clicked()), this, SLOT(onJoinClick()));
       
   639 	connect(BtnRefresh, SIGNAL(clicked()), this, SLOT(onRefreshClick()));
   639 	connect(roomsList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(onJoinClick()));
   640 	connect(roomsList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(onJoinClick()));
   640 }
   641 }
   641 
   642 
   642 void PageRoomsList::setRoomsList(const QStringList & list)
   643 void PageRoomsList::setRoomsList(const QStringList & list)
   643 {
   644 {
   651 	if (roomName->text().size())
   652 	if (roomName->text().size())
   652 		emit askForCreateRoom(roomName->text());
   653 		emit askForCreateRoom(roomName->text());
   653 	else
   654 	else
   654 		QMessageBox::critical(this,
   655 		QMessageBox::critical(this,
   655 				tr("Error"),
   656 				tr("Error"),
   656 				tr("Please, select record from the list"),
   657 				tr("Please, enter room name"),
   657 				tr("OK"));
   658 				tr("OK"));
   658 }
   659 }
   659 
   660 
   660 void PageRoomsList::onJoinClick()
   661 void PageRoomsList::onJoinClick()
   661 {
   662 {
   669 		return ;
   670 		return ;
   670 	}
   671 	}
   671 	emit askForJoinRoom(curritem->data(Qt::DisplayRole).toString());
   672 	emit askForJoinRoom(curritem->data(Qt::DisplayRole).toString());
   672 }
   673 }
   673 
   674 
       
   675 void PageRoomsList::onRefreshClick()
       
   676 {
       
   677 	emit askForRoomList();
       
   678 }
       
   679