[Tux4kids-commits] r1299 - in tux4kids-admin/trunk/tux4kids-admin: . src
Michał Świtakowski
swistakers-guest at alioth.debian.org
Fri Jul 31 01:19:04 UTC 2009
Author: swistakers-guest
Date: 2009-07-31 01:19:04 +0000 (Fri, 31 Jul 2009)
New Revision: 1299
Added:
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui
tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp
tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h
Removed:
tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.cpp
tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.h
tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.ui
tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.cpp
tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.h
Modified:
tux4kids-admin/trunk/tux4kids-admin/src/src.pro
Log:
corrected files placement
Deleted: tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.cpp 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.cpp 2009-07-31 01:19:04 UTC (rev 1299)
@@ -1,14 +0,0 @@
-#include "manageTeachersWidget.h"
-#include "ui_manageTeachersWidget.h"
-
-ManageTeachersWidget::ManageTeachersWidget(QWidget *parent) :
- QWidget(parent),
- m_ui(new Ui::ManageTeachersWidget)
-{
- m_ui->setupUi(this);
-}
-
-ManageTeachersWidget::~ManageTeachersWidget()
-{
- delete m_ui;
-}
Deleted: tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.h 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.h 2009-07-31 01:19:04 UTC (rev 1299)
@@ -1,21 +0,0 @@
-#ifndef MANAGETEACHERSWIDGET_H
-#define MANAGETEACHERSWIDGET_H
-
-#include <QtGui/QWidget>
-
-namespace Ui {
- class ManageTeachersWidget;
-}
-
-class ManageTeachersWidget : public QWidget
-{
- Q_OBJECT
-public:
- ManageTeachersWidget(QWidget *parent = 0);
- ~ManageTeachersWidget();
-
-private:
- Ui::ManageTeachersWidget *m_ui;
-};
-
-#endif // MANAGETEACHERSWIDGET_H
Deleted: tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.ui 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.ui 2009-07-31 01:19:04 UTC (rev 1299)
@@ -1,21 +0,0 @@
-<ui version="4.0" >
- <author/>
- <comment/>
- <exportmacro/>
- <class>ManageTeachersWidget</class>
- <widget class="QWidget" name="ManageTeachersWidget" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Form</string>
- </property>
- </widget>
- <pixmapfunction/>
- <connections/>
-</ui>
Copied: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp (from rev 1298, tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.cpp)
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp (rev 0)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp 2009-07-31 01:19:04 UTC (rev 1299)
@@ -0,0 +1,14 @@
+#include "manageTeachersWidget.h"
+#include "ui_manageTeachersWidget.h"
+
+ManageTeachersWidget::ManageTeachersWidget(QWidget *parent) :
+ QWidget(parent),
+ m_ui(new Ui::ManageTeachersWidget)
+{
+ m_ui->setupUi(this);
+}
+
+ManageTeachersWidget::~ManageTeachersWidget()
+{
+ delete m_ui;
+}
Copied: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h (from rev 1298, tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.h)
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h (rev 0)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h 2009-07-31 01:19:04 UTC (rev 1299)
@@ -0,0 +1,21 @@
+#ifndef MANAGETEACHERSWIDGET_H
+#define MANAGETEACHERSWIDGET_H
+
+#include <QtGui/QWidget>
+
+namespace Ui {
+ class ManageTeachersWidget;
+}
+
+class ManageTeachersWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ ManageTeachersWidget(QWidget *parent = 0);
+ ~ManageTeachersWidget();
+
+private:
+ Ui::ManageTeachersWidget *m_ui;
+};
+
+#endif // MANAGETEACHERSWIDGET_H
Copied: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui (from rev 1298, tux4kids-admin/trunk/tux4kids-admin/manageTeachersWidget.ui)
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui (rev 0)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui 2009-07-31 01:19:04 UTC (rev 1299)
@@ -0,0 +1,21 @@
+<ui version="4.0" >
+ <author/>
+ <comment/>
+ <exportmacro/>
+ <class>ManageTeachersWidget</class>
+ <widget class="QWidget" name="ManageTeachersWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ </widget>
+ <pixmapfunction/>
+ <connections/>
+</ui>
Modified: tux4kids-admin/trunk/tux4kids-admin/src/src.pro
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/src.pro 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/src/src.pro 2009-07-31 01:19:04 UTC (rev 1299)
@@ -17,8 +17,8 @@
manageClassesWidget.cpp \
classTableModel.cpp \
manageClassDialog.cpp \
- ../manageTeachersWidget.cpp \
- ../teacherTableModel.cpp
+ manageTeachersWidget.cpp \
+ teacherTableModel.cpp
HEADERS += mainWindow.h \
mainController.h \
pluginManager.h \
@@ -32,14 +32,14 @@
manageClassesWidget.h \
classTableModel.h \
manageClassDialog.h \
- ../manageTeachersWidget.h \
- ../teacherTableModel.h
+ manageTeachersWidget.h \
+ teacherTableModel.h
FORMS += mainWindow.ui \
pluginManagerDialog.ui \
manageStudentsWidget.ui \
addStudentDialog.ui \
manageClassesWidget.ui \
manageClassDialog.ui \
- ../manageTeachersWidget.ui
+ manageTeachersWidget.ui
LIBS += -ltux4kidsadmin \
-L../../libtux4kidsadmin
Copied: tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp (from rev 1298, tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.cpp)
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp (rev 0)
+++ tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp 2009-07-31 01:19:04 UTC (rev 1299)
@@ -0,0 +1,52 @@
+#include "teacherTableModel.h"
+#include "schoolDatabase.h"
+
+TeacherTableModel::TeacherTableModel(QObject *parent)
+ : QAbstractTableModel(parent)
+{
+}
+
+int TeacherTableModel::columnCount(const QModelIndex &parent) const
+{
+ return m_teachers.size();
+}
+
+int TeacherTableModel::rowCount(const QModelIndex &parent) const
+{
+ return 3;
+}
+
+void TeacherTableModel::setSchoolDatabase(SchoolDatabase *schoolDatabase)
+{
+ m_schoolDatabase = schoolDatabase;
+ m_teachers = m_schoolDatabase->teacherList();
+ connect(m_schoolDatabase, SIGNAL(teacherAdded(const Teacher &)),
+ this, SLOT(teacherAdded(const Teacher &)));
+ connect(m_schoolDatabase, SIGNAL(teacherUpdated(const Teacher &)),
+ this, SLOT(updateTeacher(const Teacher &)));
+ connect(m_schoolDatabase, SIGNAL(teacherDeleted(const Teacher &)),
+ this, SLOT(deleteTeacher(const Teacher &)));
+
+}
+
+void TeacherTableModel::addTeacher(const Teacher &teacher)
+{
+ beginInsertRows(QModelIndex(), m_teachers.size(), m_teachers.size());
+ m_teachers.append(teacher);
+ endInsertRows();
+}
+
+void TeacherTableModel::updateTeacher(const Teacher &teacher)
+{
+ int pos = m_teachers.indexOf(teacher);
+ m_teachers[pos] = teacher;
+ emit dataChanged(index(pos, 0), index(pos, columnCount() - 1));
+}
+
+void TeacherTableModel::deleteTeacher(const Teacher &teacher)
+{
+ int pos = m_teachers.indexOf(teacher);
+ beginRemoveRows(QModelIndex(), pos, pos);
+ m_teachers.removeAt(pos);
+ endRemoveRows();
+}
Copied: tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h (from rev 1298, tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.h)
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h (rev 0)
+++ tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h 2009-07-31 01:19:04 UTC (rev 1299)
@@ -0,0 +1,38 @@
+#ifndef TEACHERTABLEMODEL_H
+#define TEACHERTABLEMODEL_H
+
+#include <QAbstractTableModel>
+#include <QPointer>
+
+#include "teacher.h"
+
+class SchoolDatabase;
+
+class TeacherTableModel : public QAbstractTableModel
+{
+ Q_OBJECT
+public:
+ TeacherTableModel(QObject *parent = 0);
+ void setSchoolDatabase(SchoolDatabase *schoolDatabase);
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+
+protected:
+
+ enum TeacherField {
+ TeacherSelected = 0,
+ TeacherFirstName = 1,
+ TeacherLastName = 2
+ };
+
+ QPointer<SchoolDatabase> m_schoolDatabase;
+ QList<Teacher> m_teachers;
+
+private slots:
+ void addTeacher(const Teacher &teacher);
+ void updateTeacher(const Teacher &teacher);
+ void deleteTeacher(const Teacher &teacher);
+
+};
+
+#endif // TEACHERTABLEMODEL_H
Deleted: tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.cpp 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.cpp 2009-07-31 01:19:04 UTC (rev 1299)
@@ -1,52 +0,0 @@
-#include "teacherTableModel.h"
-#include "schoolDatabase.h"
-
-TeacherTableModel::TeacherTableModel(QObject *parent)
- : QAbstractTableModel(parent)
-{
-}
-
-int TeacherTableModel::columnCount(const QModelIndex &parent) const
-{
- return m_teachers.size();
-}
-
-int TeacherTableModel::rowCount(const QModelIndex &parent) const
-{
- return 3;
-}
-
-void TeacherTableModel::setSchoolDatabase(SchoolDatabase *schoolDatabase)
-{
- m_schoolDatabase = schoolDatabase;
- m_teachers = m_schoolDatabase->teacherList();
- connect(m_schoolDatabase, SIGNAL(teacherAdded(const Teacher &)),
- this, SLOT(teacherAdded(const Teacher &)));
- connect(m_schoolDatabase, SIGNAL(teacherUpdated(const Teacher &)),
- this, SLOT(updateTeacher(const Teacher &)));
- connect(m_schoolDatabase, SIGNAL(teacherDeleted(const Teacher &)),
- this, SLOT(deleteTeacher(const Teacher &)));
-
-}
-
-void TeacherTableModel::addTeacher(const Teacher &teacher)
-{
- beginInsertRows(QModelIndex(), m_teachers.size(), m_teachers.size());
- m_teachers.append(teacher);
- endInsertRows();
-}
-
-void TeacherTableModel::updateTeacher(const Teacher &teacher)
-{
- int pos = m_teachers.indexOf(teacher);
- m_teachers[pos] = teacher;
- emit dataChanged(index(pos, 0), index(pos, columnCount() - 1));
-}
-
-void TeacherTableModel::deleteTeacher(const Teacher &teacher)
-{
- int pos = m_teachers.indexOf(teacher);
- beginRemoveRows(QModelIndex(), pos, pos);
- m_teachers.removeAt(pos);
- endRemoveRows();
-}
Deleted: tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.h 2009-07-31 01:16:16 UTC (rev 1298)
+++ tux4kids-admin/trunk/tux4kids-admin/teacherTableModel.h 2009-07-31 01:19:04 UTC (rev 1299)
@@ -1,38 +0,0 @@
-#ifndef TEACHERTABLEMODEL_H
-#define TEACHERTABLEMODEL_H
-
-#include <QAbstractTableModel>
-#include <QPointer>
-
-#include "teacher.h"
-
-class SchoolDatabase;
-
-class TeacherTableModel : public QAbstractTableModel
-{
- Q_OBJECT
-public:
- TeacherTableModel(QObject *parent = 0);
- void setSchoolDatabase(SchoolDatabase *schoolDatabase);
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
-
-protected:
-
- enum TeacherField {
- TeacherSelected = 0,
- TeacherFirstName = 1,
- TeacherLastName = 2
- };
-
- QPointer<SchoolDatabase> m_schoolDatabase;
- QList<Teacher> m_teachers;
-
-private slots:
- void addTeacher(const Teacher &teacher);
- void updateTeacher(const Teacher &teacher);
- void deleteTeacher(const Teacher &teacher);
-
-};
-
-#endif // TEACHERTABLEMODEL_H
More information about the Tux4kids-commits
mailing list