QTfrontend/playrecordpage.cpp
changeset 581 909141b17f68
parent 580 d3ebf84e9fad
child 603 d7877468653b
--- a/QTfrontend/playrecordpage.cpp	Mon Aug 20 18:11:43 2007 +0000
+++ b/QTfrontend/playrecordpage.cpp	Mon Aug 20 18:47:24 2007 +0000
@@ -48,8 +48,23 @@
 	pageLayout->addWidget(DemosList, 0, 1);
 }
 
-void PagePlayDemo::FillFromDir(QDir dir, const QString & extension)
+void PagePlayDemo::FillFromDir(RecordType rectype)
 {
+	QDir dir;
+	QString extension;
+
+	dir.cd(cfgdir->absolutePath());
+	if (rectype == RT_Demo)
+	{
+		dir.cd("Demos");
+		extension = "hwd_" + *cProtoVer;
+		BtnPlayDemo->setText(QPushButton::tr("Play demo"));
+	} else
+	{
+		dir.cd("Saves");
+		extension = "hws_" + *cProtoVer;
+		BtnPlayDemo->setText(QPushButton::tr("Load"));
+	}
 	dir.setFilter(QDir::Files);
 
 	QStringList sl = dir.entryList(QStringList(QString("*.%1").arg(extension)));