QTfrontend/hwform.cpp
changeset 530 f0b962214436
parent 502 bc178daca088
child 533 eebb7684ac22
equal deleted inserted replaced
529:812682c1ab62 530:f0b962214436
    57 	connect(ui.pageMain->BtnSetup,	SIGNAL(clicked()),	this, SLOT(GoToSetup()));
    57 	connect(ui.pageMain->BtnSetup,	SIGNAL(clicked()),	this, SLOT(GoToSetup()));
    58 	connect(ui.pageMain->BtnMultiplayer,	SIGNAL(clicked()),	this, SLOT(GoToMultiplayer()));
    58 	connect(ui.pageMain->BtnMultiplayer,	SIGNAL(clicked()),	this, SLOT(GoToMultiplayer()));
    59 	connect(ui.pageMain->BtnDemos,	SIGNAL(clicked()),	this, SLOT(GoToDemos()));
    59 	connect(ui.pageMain->BtnDemos,	SIGNAL(clicked()),	this, SLOT(GoToDemos()));
    60 	connect(ui.pageMain->BtnNet,	SIGNAL(clicked()),	this, SLOT(GoToNet()));
    60 	connect(ui.pageMain->BtnNet,	SIGNAL(clicked()),	this, SLOT(GoToNet()));
    61 	connect(ui.pageMain->BtnInfo,	SIGNAL(clicked()),	this, SLOT(GoToInfo()));
    61 	connect(ui.pageMain->BtnInfo,	SIGNAL(clicked()),	this, SLOT(GoToInfo()));
    62 	connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(close()));
    62 	connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
       
    63 	connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
    63 
    64 
    64 	connect(ui.pageLocalGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    65 	connect(ui.pageLocalGame->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
    65 	connect(ui.pageLocalGame->BtnSimpleGame,	SIGNAL(clicked()),	this, SLOT(SimpleGame()));
    66 	connect(ui.pageLocalGame->BtnSimpleGame,	SIGNAL(clicked()),	this, SLOT(SimpleGame()));
    66 
    67 
    67 	connect(ui.pageEditTeam->BtnTeamSave,	SIGNAL(clicked()),	this, SLOT(TeamSave()));
    68 	connect(ui.pageEditTeam->BtnTeamSave,	SIGNAL(clicked()),	this, SLOT(TeamSave()));
   197 	  if(hwnet || pnetserver) NetDisconnect();
   198 	  if(hwnet || pnetserver) NetDisconnect();
   198 	}
   199 	}
   199 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   200 	quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop();
   200 	OnPageShown(id, ui.Pages->currentIndex());
   201 	OnPageShown(id, ui.Pages->currentIndex());
   201 	ui.Pages->setCurrentIndex(id);
   202 	ui.Pages->setCurrentIndex(id);
       
   203 }
       
   204 
       
   205 void HWForm::btnExitPressed()
       
   206 {
       
   207 	eggTimer.start();
       
   208 }
       
   209 
       
   210 void HWForm::btnExitClicked()
       
   211 {
       
   212 	if (eggTimer.elapsed() < 3000)
       
   213 		close();
       
   214 	else
       
   215 	{
       
   216 		QPushButton * btn = findChild<QPushButton *>("imageButt");
       
   217 		if (btn)
       
   218 		{
       
   219 			btn->setIcon(QIcon(":/res/bonus.png"));
       
   220 		}
       
   221 	}
   202 }
   222 }
   203 
   223 
   204 void HWForm::NewTeam()
   224 void HWForm::NewTeam()
   205 {
   225 {
   206 	editedTeam = new HWTeam("unnamed");
   226 	editedTeam = new HWTeam("unnamed");