[Tux4kids-commits] r1412 - in tux4kids-admin/trunk: libtux4kidsadmin libtux4kidsadmin_tuxmath tux4kids-admin/src

Michał Świtakowski swistakers-guest at alioth.debian.org
Tue Aug 11 15:48:32 UTC 2009


Author: swistakers-guest
Date: 2009-08-11 15:48:31 +0000 (Tue, 11 Aug 2009)
New Revision: 1412

Added:
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.cpp
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.h
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions_p.h
Modified:
   tux4kids-admin/trunk/libtux4kidsadmin/profileDir.cpp
   tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/CMakeLists.txt
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/libtux4kidsadmin_tuxmath.pro
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath.cpp
   tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath_p.h
   tux4kids-admin/trunk/tux4kids-admin/src/manageStudentsWidget.cpp
Log:
+TuxmathOptions

Modified: tux4kids-admin/trunk/libtux4kidsadmin/profileDir.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/profileDir.cpp	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin/profileDir.cpp	2009-08-11 15:48:31 UTC (rev 1412)
@@ -9,8 +9,10 @@
 ProfileDirPrivate::ProfileDirPrivate(QString path)
 		: status(ProfileDir::NoError)
 {
+	qDebug() << "PD" << path;
 	mainDir.setPath(path);
 	if (!mainDir.exists()) {
+		qDebug() << "nie istnieje";
 		if (!QDir::root().mkpath(path)) {
 			status = ProfileDir::InitializationError;
 			return;
@@ -22,7 +24,11 @@
 		status = ProfileDir::InitializationError;
 		return;
 	}*/
-	dataDir = QDir(mainDir.absolutePath() + "/data");
+	if (!mainDir.mkdir("data")) {
+		status = ProfileDir::InitializationError;
+		return;
+	}
+	dataDir = QDir(mainDir.absoluteFilePath("data"));
 
 	attributes = new QSettings(mainDir.absolutePath() + "/attributes.ini", QSettings::IniFormat);
 	if (attributes->status() != QSettings::NoError) {

Modified: tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp	2009-08-11 15:48:31 UTC (rev 1412)
@@ -117,7 +117,7 @@
 {
 	Q_D(StudentDir);
 
-	ProfileDir *tmp = ProfileDirFactory::instance().create(profileType, profileType, this);
+	ProfileDir *tmp = ProfileDirFactory::instance().create(profileType, d->mainDir.absoluteFilePath(profileType), this);
 	if (tmp != 0) {
 		d->profiles.append(tmp);
 		return tmp;

Modified: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/CMakeLists.txt
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/CMakeLists.txt	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/CMakeLists.txt	2009-08-11 15:48:31 UTC (rev 1412)
@@ -4,10 +4,12 @@
 SET(LIBTUX4KIDSADMIN_TUXMATH_SOURCES 
 	libtux4kidsadmin_tuxmath.cpp
 	profileDirTuxmath.cpp 
-	profileDirTuxmathRegister.cpp )
+	profileDirTuxmathRegister.cpp 
+	tuxmathOptions.cpp )
 
 SET(LIBTUX4KIDSADMIN_TUXMATH_MOC_HEADERS 
-	profileDirTuxmath.h )
+	profileDirTuxmath.h
+	tuxmathOptions.h )
 
 # enable warnings
 ADD_DEFINITIONS( -Wall -DLIBTUX4KIDSADMIN_TUXMATH_LIBRARY )

Modified: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/libtux4kidsadmin_tuxmath.pro
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/libtux4kidsadmin_tuxmath.pro	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/libtux4kidsadmin_tuxmath.pro	2009-08-11 15:48:31 UTC (rev 1412)
@@ -4,11 +4,14 @@
 DEFINES += LIBTUX4KIDSADMIN_TUXMATH_LIBRARY
 SOURCES += libtux4kidsadmin_tuxmath.cpp \
     profileDirTuxmath.cpp \
-    profileDirTuxmathRegister.cpp
+    profileDirTuxmathRegister.cpp \
+    tuxmathOptions.cpp
 HEADERS += libtux4kidsadmin_tuxmath.h \
     libtux4kidsadmin_tuxmath_global.h \
     profileDirTuxmath.h \
-    profileDirTuxmath_p.h
+    profileDirTuxmath_p.h \
+    tuxmathOptions.h \
+    tuxmathOptions_p.h
 INCLUDEPATH += ../libtux4kidsadmin
 LIBS += -ltux4kidsadmin \
     -L../libtux4kidsadmin

Modified: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath.cpp	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath.cpp	2009-08-11 15:48:31 UTC (rev 1412)
@@ -1,5 +1,6 @@
 #include "profileDirTuxmath.h"
 #include "profileDirTuxmath_p.h"
+#include "tuxmathOptions.h"
 
 #include <QString>
 #include <QDebug>
@@ -9,7 +10,11 @@
 ProfileDirTuxmathPrivate::ProfileDirTuxmathPrivate(QString path)
 		: ProfileDirPrivate(path)
 {
+	if (status != ProfileDir::NoError) {
+		return;
+	}
 	attributes->setValue("profile_type", "tuxmath");
+	tuxmathOptions = new TuxmathOptions(dataDir.absoluteFilePath("options"));
 }
 
 ProfileDirTuxmathPrivate::~ProfileDirTuxmathPrivate()

Modified: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath_p.h
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath_p.h	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/profileDirTuxmath_p.h	2009-08-11 15:48:31 UTC (rev 1412)
@@ -3,6 +3,8 @@
 
 #include "profileDir_p.h"
 
+class TuxmathOptions;
+
 class ProfileDirTuxmathPrivate : public ProfileDirPrivate
 {
 public:
@@ -10,6 +12,8 @@
 
 	ProfileDirTuxmathPrivate(QString path);
 	virtual ~ProfileDirTuxmathPrivate();
+
+	TuxmathOptions *tuxmathOptions;
 };
 
 #endif // PROFILEDIRTUXMATHPRIVATE_H

Added: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.cpp	                        (rev 0)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.cpp	2009-08-11 15:48:31 UTC (rev 1412)
@@ -0,0 +1,38 @@
+#include "tuxmathOptions.h"
+#include "tuxmathOptions_p.h"
+
+TuxmathOptionsPrivate::TuxmathOptionsPrivate()
+{
+
+
+}
+
+TuxmathOptionsPrivate::~TuxmathOptionsPrivate()
+{
+
+}
+
+/****************************** TuxmathOptionsPrivate *******************/
+
+
+/*************************** TuxmathOptions *******************/
+
+TuxmathOptions::TuxmathOptions(QString path)
+		: d_ptr(new TuxmathOptionsPrivate())
+{
+	Q_D(TuxmathOptions);
+	d->q_ptr = this;
+}
+
+TuxmathOptions::TuxmathOptions(TuxmathOptionsPrivate &dd)
+		: d_ptr(&dd)
+{
+	d_ptr->q_ptr = this;
+}
+
+TuxmathOptions::~TuxmathOptions()
+{
+	Q_D(TuxmathOptions);
+	delete d;
+}
+

Added: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.h
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.h	                        (rev 0)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions.h	2009-08-11 15:48:31 UTC (rev 1412)
@@ -0,0 +1,24 @@
+#ifndef TUXMATHOPTIONS_H
+#define TUXMATHOPTIONS_H
+
+#include <QObject>
+
+class TuxmathOptionsPrivate;
+
+class TuxmathOptions : public QObject
+{
+	Q_OBJECT
+public:
+	TuxmathOptions(QString path);
+	~TuxmathOptions();
+
+protected:
+	TuxmathOptionsPrivate *d_ptr;
+	TuxmathOptions(TuxmathOptionsPrivate &dd);
+
+private:
+	Q_DECLARE_PRIVATE(TuxmathOptions)
+
+};
+
+#endif // TUXMATHOPTIONS_H

Added: tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions_p.h
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions_p.h	                        (rev 0)
+++ tux4kids-admin/trunk/libtux4kidsadmin_tuxmath/tuxmathOptions_p.h	2009-08-11 15:48:31 UTC (rev 1412)
@@ -0,0 +1,18 @@
+#ifndef TUXMATHOPTIONS_P_H
+#define TUXMATHOPTIONS_P_H
+
+#include <QtGlobal>
+#include <QString>
+
+class  TuxmathOptionsPrivate
+{
+public:
+	Q_DECLARE_PUBLIC(TuxmathOptions)
+
+	TuxmathOptionsPrivate();
+	virtual ~TuxmathOptionsPrivate();
+
+	TuxmathOptions *q_ptr;
+};
+
+#endif // TUXMATHOPTIONS_P_H

Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageStudentsWidget.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageStudentsWidget.cpp	2009-08-11 01:09:14 UTC (rev 1411)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageStudentsWidget.cpp	2009-08-11 15:48:31 UTC (rev 1412)
@@ -57,7 +57,9 @@
 	StudentDir *studentDir = m_mainController->schoolData()->addStudent();
 	studentDir->setFirstName(m_addStudentDialog->firstName());
 	studentDir->setLastName(m_addStudentDialog->lastName());
-
+	foreach (QString profileType, m_addStudentDialog->checkedApplicationNames()) {
+		studentDir->addProfileDir(profileType);
+	}
 }
 
 void ManageStudentsWidget::setEditButtons()




More information about the Tux4kids-commits mailing list