[Tux4kids-commits] r1303 - tux4kids-admin/trunk/tux4kids-admin/src
Michał Świtakowski
swistakers-guest at alioth.debian.org
Fri Jul 31 11:31:31 UTC 2009
Author: swistakers-guest
Date: 2009-07-31 11:31:31 +0000 (Fri, 31 Jul 2009)
New Revision: 1303
Modified:
tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.cpp
tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.h
tux4kids-admin/trunk/tux4kids-admin/src/mainWindow.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui
tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp
tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h
Log:
some GUI elements
Modified: tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.cpp 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.cpp 2009-07-31 11:31:31 UTC (rev 1303)
@@ -44,6 +44,23 @@
return QVariant();
}
+QVariant ClassTableModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+ if (role != Qt::DisplayRole)
+ return QVariant();
+
+ if (orientation == Qt::Vertical) {
+ return section + 1;
+ } else if (orientation == Qt::Horizontal) {
+ switch (section) {
+ case ClassName:
+ return tr("Class name");
+ }
+ }
+
+ return QVariant();
+}
+
Qt::ItemFlags ClassTableModel::flags(const QModelIndex &index) const
{
Qt::ItemFlags result;
Modified: tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.h 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/classTableModel.h 2009-07-31 11:31:31 UTC (rev 1303)
@@ -18,6 +18,7 @@
int rowCount(const QModelIndex &parent = QModelIndex()) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
void setSchoolDatabase(SchoolDatabase *schoolDatabase);
private:
Modified: tux4kids-admin/trunk/tux4kids-admin/src/mainWindow.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/mainWindow.cpp 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/mainWindow.cpp 2009-07-31 11:31:31 UTC (rev 1303)
@@ -4,6 +4,7 @@
#include "manageStudentsWidget.h"
#include "mainController.h"
#include "manageClassesWidget.h"
+#include "manageTeachersWidget.h"
MainWindow::MainWindow(MainController *mainController, QWidget *parent) : QMainWindow(parent), m_ui(new Ui::MainWindow)
{
@@ -11,7 +12,8 @@
m_mainController = mainController;
m_ui->tabWidget->insertTab(1, new ManageStudentsWidget(m_mainController, this), tr("Students"));
- m_ui->tabWidget->insertTab(2, new ManageClassesWidget(m_mainController, this), tr("Classes and Teachers"));
+ m_ui->tabWidget->insertTab(2, new ManageClassesWidget(m_mainController, this), tr("Classes"));
+ m_ui->tabWidget->insertTab(3, (new ManageTeachersWidget(this)), tr("Teachers"));
connect(m_ui->actionPlugins, SIGNAL(triggered()), this, SLOT(pluginsManagerClicked()));
}
Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui 2009-07-31 11:31:31 UTC (rev 1303)
@@ -1,10 +1,8 @@
-<ui version="4.0" >
- <author/>
- <comment/>
- <exportmacro/>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>ManageTeachersWidget</class>
- <widget class="QWidget" name="ManageTeachersWidget" >
- <property name="geometry" >
+ <widget class="QWidget" name="ManageTeachersWidget">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -12,10 +10,15 @@
<height>300</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Form</string>
</property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTableView" name="teachersTable"/>
+ </item>
+ </layout>
</widget>
- <pixmapfunction/>
+ <resources/>
<connections/>
</ui>
Modified: tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.cpp 2009-07-31 11:31:31 UTC (rev 1303)
@@ -46,6 +46,25 @@
return QVariant();
}
+QVariant TeacherTableModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+ if (role != Qt::DisplayRole)
+ return QVariant();
+
+ if (orientation == Qt::Vertical) {
+ return section + 1;
+ } else if (orientation == Qt::Horizontal) {
+ switch (section) {
+ case TeacherFirstName:
+ return tr("First name");
+ case TeacherLastName:
+ return tr("Last name");
+ }
+ }
+
+ return QVariant();
+}
+
Qt::ItemFlags TeacherTableModel::flags(const QModelIndex &index) const
{
Qt::ItemFlags result;
Modified: tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h 2009-07-31 11:15:32 UTC (rev 1302)
+++ tux4kids-admin/trunk/tux4kids-admin/src/teacherTableModel.h 2009-07-31 11:31:31 UTC (rev 1303)
@@ -17,6 +17,7 @@
int columnCount(const QModelIndex &parent = QModelIndex()) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::DisplayRole);
More information about the Tux4kids-commits
mailing list