QTfrontend/main.cpp.in
changeset 321 1148eeb0557e
parent 277 04a613bab65c
child 400 450ff6326084
--- a/QTfrontend/main.cpp.in	Fri Jan 12 15:23:16 2007 +0000
+++ b/QTfrontend/main.cpp.in	Fri Jan 12 16:04:45 2007 +0000
@@ -22,12 +22,14 @@
 #include <QMessageBox>
 #include <QFileInfo>
 #include <QDateTime>
+#include <QTextStream>
 #include "hwform.h"
 #include "hwconsts.h"
 
 QDir * bindir;
 QDir * cfgdir;
 QDir * datadir;
+QStringList * Themes;
 
 bool checkForDir(const QString & dir)
 {
@@ -80,6 +82,20 @@
 		return 1;
 	}
 
+	Themes = new QStringList();
+	QFile themesfile(datadir->absolutePath() + "/Themes/themes.cfg");
+	if (themesfile.open(QIODevice::ReadOnly)) {
+		QTextStream stream(&themesfile);
+		QString str;
+		while (!stream.atEnd())
+		{
+			Themes->append(stream.readLine());
+		}
+		themesfile.close();
+	} else {
+		QMessageBox::critical(0, "Error", "Cannot access themes.cfg", "OK");
+	}
+
 	HWForm *Form = new HWForm();
 	Form->show();
 	return app.exec();