[Tux4kids-commits] r1331 - tux4kids-admin/trunk/tux4kids-admin/src
Michał Świtakowski
swistakers-guest at alioth.debian.org
Sun Aug 2 23:49:29 UTC 2009
Author: swistakers-guest
Date: 2009-08-02 23:49:28 +0000 (Sun, 02 Aug 2009)
New Revision: 1331
Removed:
tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.h
tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.ui
Modified:
tux4kids-admin/trunk/tux4kids-admin/src/CMakeLists.txt
tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp
tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.h
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp
tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h
tux4kids-admin/trunk/tux4kids-admin/src/src.pro
Log:
connected dialogs with management widgets
Modified: tux4kids-admin/trunk/tux4kids-admin/src/CMakeLists.txt
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/CMakeLists.txt 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/CMakeLists.txt 2009-08-02 23:49:28 UTC (rev 1331)
@@ -15,7 +15,6 @@
studentTableProxyModel.cpp
manageClassesWidget.cpp
classTableModel.cpp
- manageClassDialog.cpp
manageTeachersWidget.cpp
teacherTableModel.cpp
classTableProxyModel.cpp
@@ -34,7 +33,6 @@
studentTableProxyModel.h
manageClassesWidget.h
classTableModel.h
- manageClassDialog.h
manageTeachersWidget.h
teacherTableModel.h
classTableProxyModel.h
@@ -48,7 +46,6 @@
manageStudentsWidget.ui
addStudentDialog.ui
manageClassesWidget.ui
- manageClassDialog.ui
manageTeachersWidget.ui
editClassDialog.ui
editTeacherDialog.ui )
Modified: tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp 2009-08-02 23:49:28 UTC (rev 1331)
@@ -10,6 +10,10 @@
m_ui->setupUi(this);
connect(m_ui->nameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
+ connect(m_ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
+ connect(m_ui->buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
+
+ validate();
}
EditClassDialog::~EditClassDialog()
@@ -26,10 +30,8 @@
{
if (isValid()) {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
- m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(true);
} else {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
- m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
}
}
Modified: tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp 2009-08-02 23:49:28 UTC (rev 1331)
@@ -11,6 +11,10 @@
connect(m_ui->firstNameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
connect(m_ui->lastNameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
+ connect(m_ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
+ connect(m_ui->buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
+
+ validate();
}
EditTeacherDialog::~EditTeacherDialog()
@@ -27,9 +31,7 @@
{
if (isValid()) {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
- m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(true);
} else {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
- m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
}
}
Deleted: tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.cpp 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.cpp 2009-08-02 23:49:28 UTC (rev 1331)
@@ -1,19 +0,0 @@
-#include "manageClassDialog.h"
-#include "ui_manageClassDialog.h"
-#include "mainController.h"
-
-ManageClassDialog::ManageClassDialog(MainController *mainController, QWidget *parent) :
- QDialog(parent),
- m_ui(new Ui::ManageClassDialog),
- m_mainController(mainController)
-{
- m_ui->setupUi(this);
-
- m_studentTableModel.setSchoolData(m_mainController->schoolData());
- m_ui->studentsTable->setModel(&m_studentTableModel);
-}
-
-ManageClassDialog::~ManageClassDialog()
-{
- delete m_ui;
-}
Deleted: tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.h 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.h 2009-08-02 23:49:28 UTC (rev 1331)
@@ -1,29 +0,0 @@
-#ifndef MANAGECLASSDIALOG_H
-#define MANAGECLASSDIALOG_H
-
-#include <QtGui/QDialog>
-#include <QPointer>
-
-#include "studentTableModel.h"
-
-class MainController;
-
-namespace Ui {
- class ManageClassDialog;
-}
-
-class ManageClassDialog : public QDialog
-{
- Q_OBJECT
-public:
- ManageClassDialog(MainController *mainController, QWidget *parent = 0);
- ~ManageClassDialog();
-
-private:
- Ui::ManageClassDialog *m_ui;
- QPointer <MainController> m_mainController;
- StudentTableModel m_studentTableModel;
-
-};
-
-#endif // MANAGECLASSDIALOG_H
Deleted: tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.ui 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassDialog.ui 2009-08-02 23:49:28 UTC (rev 1331)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ManageClassDialog</class>
- <widget class="QDialog" name="ManageClassDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>424</width>
- <height>367</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QFormLayout" name="formLayout">
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::ExpandingFieldsGrow</enum>
- </property>
- <item row="0" column="1">
- <widget class="QLineEdit" name="classNameEdit"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Class name:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTableView" name="studentsTable"/>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.cpp 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.cpp 2009-08-02 23:49:28 UTC (rev 1331)
@@ -1,8 +1,10 @@
#include "manageClassesWidget.h"
#include "ui_manageClassesWidget.h"
-#include "manageClassDialog.h"
+#include "editClassDialog.h"
#include "mainController.h"
+#include <QDebug>
+
ManageClassesWidget::ManageClassesWidget(MainController *mainController, QWidget *parent) :
QWidget(parent),
m_ui(new Ui::ManageClassesWidget),
@@ -14,6 +16,7 @@
m_ui->classesTable->setModel(&m_classTableProxyModel);
connect(m_ui->addClassButton, SIGNAL(clicked()), this, SLOT(addClicked()));
+ connect(m_ui->editClassButton, SIGNAL(clicked()), this, SLOT(editClicked()));
}
ManageClassesWidget::~ManageClassesWidget()
@@ -24,8 +27,45 @@
void ManageClassesWidget::addClicked()
{
if (m_addClassDialog == 0) {
- m_addClassDialog = new ManageClassDialog(m_mainController);
+ m_addClassDialog = new EditClassDialog(this);
+ connect(m_addClassDialog, SIGNAL(accepted()), this, SLOT(addAccepted()));
+ connect(m_addClassDialog, SIGNAL(rejected()), this, SLOT(addRejected()));
}
-
m_addClassDialog->showNormal();
}
+
+void ManageClassesWidget::editClicked()
+{
+ if (m_editClassDialog == 0) {
+ m_editClassDialog = new EditClassDialog(this);
+ connect(m_editClassDialog, SIGNAL(accepted()), this, SLOT(editAccepted()));
+ connect(m_editClassDialog, SIGNAL(rejected()), this, SLOT(editRejected()));
+ }
+ m_editClassDialog->showNormal();
+}
+
+void ManageClassesWidget::deleteClicked()
+{
+
+}
+
+void ManageClassesWidget::addAccepted()
+{
+ qDebug() << "add accepted";
+}
+
+void ManageClassesWidget::addRejected()
+{
+ qDebug() << "add rejected";
+}
+
+void ManageClassesWidget::editAccepted()
+{
+ qDebug() << "edit accepted";
+}
+
+void ManageClassesWidget::editRejected()
+{
+ qDebug() << "edit rejected";
+}
+
Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.h 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.h 2009-08-02 23:49:28 UTC (rev 1331)
@@ -11,7 +11,7 @@
}
class MainController;
-class ManageClassDialog;
+class EditClassDialog;
class ManageClassesWidget : public QWidget
{
@@ -24,11 +24,18 @@
Ui::ManageClassesWidget *m_ui;
QPointer<MainController> m_mainController;
- QPointer<ManageClassDialog> m_addClassDialog;
+ QPointer<EditClassDialog> m_addClassDialog;
+ QPointer<EditClassDialog> m_editClassDialog;
ClassTableProxyModel m_classTableProxyModel;
private slots:
void addClicked();
+ void editClicked();
+ void deleteClicked();
+ void addAccepted();
+ void addRejected();
+ void editAccepted();
+ void editRejected();
};
#endif // MANAGECLASSESWIDGET_H
Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.cpp 2009-08-02 23:49:28 UTC (rev 1331)
@@ -1,7 +1,10 @@
#include "manageTeachersWidget.h"
#include "ui_manageTeachersWidget.h"
#include "mainController.h"
+#include "editTeacherDialog.h"
+#include <QDebug>
+
ManageTeachersWidget::ManageTeachersWidget(MainController *mainController, QWidget *parent) :
QWidget(parent),
m_ui(new Ui::ManageTeachersWidget),
@@ -12,9 +15,59 @@
m_teacherTableProxyModel.setSourceModel(m_mainController->teacherTableModel());
m_ui->teachersTable->setModel(&m_teacherTableProxyModel);
+
+ connect(m_ui->addTeacherButton, SIGNAL(clicked()), this, SLOT(addClicked()));
+ connect(m_ui->editTeacherButton, SIGNAL(clicked()), this, SLOT(editClicked()));
+ connect(m_ui->deleteTeacherButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
}
ManageTeachersWidget::~ManageTeachersWidget()
{
delete m_ui;
}
+
+void ManageTeachersWidget::addClicked()
+{
+ if (m_addTeacherDialog == 0) {
+ m_addTeacherDialog = new EditTeacherDialog(this);
+ connect(m_addTeacherDialog, SIGNAL(accepted()), this, SLOT(addAccepted()));
+ connect(m_addTeacherDialog, SIGNAL(rejected()), this, SLOT(addRejected()));
+ }
+ m_addTeacherDialog->showNormal();
+}
+
+void ManageTeachersWidget::editClicked()
+{
+ if (m_editTeacherDialog == 0) {
+ m_editTeacherDialog = new EditTeacherDialog(this);
+ connect(m_editTeacherDialog, SIGNAL(accepted()), this, SLOT(editAccepted()));
+ connect(m_editTeacherDialog, SIGNAL(rejected()), this, SLOT(editRejected()));
+ }
+ m_editTeacherDialog->showNormal();;
+}
+
+void ManageTeachersWidget::deleteClicked()
+{
+
+}
+
+void ManageTeachersWidget::addAccepted()
+{
+ qDebug() << "add accepted";
+}
+
+void ManageTeachersWidget::addRejected()
+{
+ qDebug() << "add rejected";
+}
+
+void ManageTeachersWidget::editAccepted()
+{
+ qDebug() << "edit accepted";
+}
+
+void ManageTeachersWidget::editRejected()
+{
+ qDebug() << "edit rejected";
+}
+
Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.h 2009-08-02 23:49:28 UTC (rev 1331)
@@ -11,6 +11,7 @@
}
class MainController;
+class EditTeacherDialog;
class ManageTeachersWidget : public QWidget
{
@@ -23,6 +24,18 @@
Ui::ManageTeachersWidget *m_ui;
QPointer<MainController> m_mainController;
TeacherTableProxyModel m_teacherTableProxyModel;
+ QPointer<EditTeacherDialog> m_addTeacherDialog;
+ QPointer<EditTeacherDialog> m_editTeacherDialog;
+
+private slots:
+ void addClicked();
+ void editClicked();
+ void deleteClicked();
+ void addAccepted();
+ void addRejected();
+ void editAccepted();
+ void editRejected();
+
};
#endif // MANAGETEACHERSWIDGET_H
Modified: tux4kids-admin/trunk/tux4kids-admin/src/src.pro
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/src.pro 2009-08-02 22:01:20 UTC (rev 1330)
+++ tux4kids-admin/trunk/tux4kids-admin/src/src.pro 2009-08-02 23:49:28 UTC (rev 1331)
@@ -16,7 +16,6 @@
studentTableProxyModel.cpp \
manageClassesWidget.cpp \
classTableModel.cpp \
- manageClassDialog.cpp \
manageTeachersWidget.cpp \
teacherTableModel.cpp \
classTableProxyModel.cpp \
@@ -35,7 +34,6 @@
studentTableProxyModel.h \
manageClassesWidget.h \
classTableModel.h \
- manageClassDialog.h \
manageTeachersWidget.h \
teacherTableModel.h \
classTableProxyModel.h \
@@ -47,7 +45,6 @@
manageStudentsWidget.ui \
addStudentDialog.ui \
manageClassesWidget.ui \
- manageClassDialog.ui \
manageTeachersWidget.ui \
editTeacherDialog.ui \
editClassDialog.ui
More information about the Tux4kids-commits
mailing list