QTfrontend/hwform.cpp
changeset 581 909141b17f68
parent 580 d3ebf84e9fad
child 585 7531ae5b146e
equal deleted inserted replaced
580:d3ebf84e9fad 581:909141b17f68
   151 	GoToPage(ID_PAGE_MULTIPLAYER);
   151 	GoToPage(ID_PAGE_MULTIPLAYER);
   152 }
   152 }
   153 
   153 
   154 void HWForm::GoToSaves()
   154 void HWForm::GoToSaves()
   155 {
   155 {
   156 	QDir tmpdir;
   156 	ui.pagePlayDemo->FillFromDir(PagePlayDemo::RT_Save);
   157 	tmpdir.cd(cfgdir->absolutePath());
       
   158 	tmpdir.cd("Saves");
       
   159 	ui.pagePlayDemo->FillFromDir(tmpdir, "hws_" + *cProtoVer);
       
   160 
   157 
   161 	GoToPage(ID_PAGE_DEMOS);
   158 	GoToPage(ID_PAGE_DEMOS);
   162 }
   159 }
   163 
   160 
   164 void HWForm::GoToDemos()
   161 void HWForm::GoToDemos()
   165 {
   162 {
   166 	QDir tmpdir;
   163 	ui.pagePlayDemo->FillFromDir(PagePlayDemo::RT_Demo);
   167 	tmpdir.cd(cfgdir->absolutePath());
       
   168 	tmpdir.cd("Demos");
       
   169 	ui.pagePlayDemo->FillFromDir(tmpdir, "hwd_" + *cProtoVer);
       
   170 
   164 
   171 	GoToPage(ID_PAGE_DEMOS);
   165 	GoToPage(ID_PAGE_DEMOS);
   172 }
   166 }
   173 
   167 
   174 void HWForm::GoToNet()
   168 void HWForm::GoToNet()
   301 	QListWidgetItem * curritem = ui.pagePlayDemo->DemosList->currentItem();
   295 	QListWidgetItem * curritem = ui.pagePlayDemo->DemosList->currentItem();
   302 	if (!curritem)
   296 	if (!curritem)
   303 	{
   297 	{
   304 		QMessageBox::critical(this,
   298 		QMessageBox::critical(this,
   305 				tr("Error"),
   299 				tr("Error"),
   306 				tr("Please, select demo from the list above"),
   300 				tr("Please, select record from the list above"),
   307 				tr("OK"));
   301 				tr("OK"));
   308 		return ;
   302 		return ;
   309 	}
   303 	}
   310 	CreateGame(0, 0);
   304 	CreateGame(0, 0);
   311 	game->PlayDemo(curritem->data(Qt::UserRole).toString());
   305 	game->PlayDemo(curritem->data(Qt::UserRole).toString());