QTfrontend/hwform.cpp
changeset 97 e7c1df9cce2c
parent 87 ff213e443336
child 111 30ca06092a64
equal deleted inserted replaced
96:aeeb4da6b157 97:e7c1df9cce2c
   130 }
   130 }
   131 
   131 
   132 void HWForm::GoToDemos()
   132 void HWForm::GoToDemos()
   133 {
   133 {
   134 	QDir tmpdir;
   134 	QDir tmpdir;
   135 	tmpdir.cd(DATA_PATH);
   135 	tmpdir.cd(datadir->absolutePath());
   136 	tmpdir.cd("Demos");
   136 	tmpdir.cd("Demos");
   137 	tmpdir.setFilter(QDir::Files);
   137 	tmpdir.setFilter(QDir::Files);
   138 	ui.pagePlayDemo->DemosList->clear();
   138 	ui.pagePlayDemo->DemosList->clear();
   139 	ui.pagePlayDemo->DemosList->addItems(tmpdir.entryList(QStringList("*.hwd_1")).replaceInStrings(QRegExp("^(.*).hwd_1"), "\\1"));
   139 	ui.pagePlayDemo->DemosList->addItems(tmpdir.entryList(QStringList("*.hwd_1")).replaceInStrings(QRegExp("^(.*).hwd_1"), "\\1"));
   140 	ui.Pages->setCurrentIndex(ID_PAGE_DEMOS);
   140 	ui.Pages->setCurrentIndex(ID_PAGE_DEMOS);
   194 				tr("Please, select demo from the list above"),
   194 				tr("Please, select demo from the list above"),
   195 				tr("OK"));
   195 				tr("OK"));
   196 		return ;
   196 		return ;
   197 	}
   197 	}
   198 	game = new HWGame(config, 0);
   198 	game = new HWGame(config, 0);
   199 	game->PlayDemo(QString(DATA_PATH) + "/Demos/" + curritem->text() + ".hwd_1");
   199 	game->PlayDemo(datadir->absolutePath() + "/Demos/" + curritem->text() + ".hwd_1");
   200 }
   200 }
   201 
   201 
   202 void HWForm::NetConnect()
   202 void HWForm::NetConnect()
   203 {
   203 {
   204 	hwnet = new HWNet(config);
   204 	hwnet = new HWNet(config);