[Tux4kids-commits] r1329 - tux4kids-admin/trunk/tux4kids-admin/src

Michał Świtakowski swistakers-guest at alioth.debian.org
Sun Aug 2 21:53:57 UTC 2009


Author: swistakers-guest
Date: 2009-08-02 21:53:57 +0000 (Sun, 02 Aug 2009)
New Revision: 1329

Modified:
   tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp
   tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.h
   tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.ui
   tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp
   tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.h
   tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.ui
   tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.ui
   tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui
Log:
work on gui

Modified: tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.cpp	2009-08-02 21:53:57 UTC (rev 1329)
@@ -1,14 +1,35 @@
 #include "editClassDialog.h"
 #include "ui_editClassDialog.h"
 
+#include <QPushButton>
+
 EditClassDialog::EditClassDialog(QWidget *parent) :
 		QDialog(parent),
 		m_ui(new Ui::EditClassDialog)
 {
 	m_ui->setupUi(this);
+
+	connect(m_ui->nameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
 }
 
 EditClassDialog::~EditClassDialog()
 {
 	delete m_ui;
 }
+
+bool EditClassDialog::isValid() const
+{
+	return !m_ui->nameEdit->text().simplified().isEmpty();
+}
+
+void EditClassDialog::validate()
+{
+	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/editClassDialog.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.h	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.h	2009-08-02 21:53:57 UTC (rev 1329)
@@ -16,6 +16,12 @@
 
 private:
 	Ui::EditClassDialog *m_ui;
+
+	bool isValid() const;
+
+private slots:
+	void validate();
+
 };
 
 #endif // EDITCLASSDIALOG_H

Modified: tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.ui	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editClassDialog.ui	2009-08-02 21:53:57 UTC (rev 1329)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>EditClassDialog</class>
- <widget class="QDialog" name="EditClassDialog" >
-  <property name="geometry" >
+ <widget class="QDialog" name="EditClassDialog">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,9 +10,44 @@
     <height>300</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Dialog</string>
   </property>
+  <widget class="QWidget" name="formLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>90</x>
+     <y>40</y>
+     <width>160</width>
+     <height>80</height>
+    </rect>
+   </property>
+   <layout class="QFormLayout" name="formLayout">
+    <item row="0" column="0">
+     <widget class="QLabel" name="label">
+      <property name="text">
+       <string>Name:</string>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="1">
+     <widget class="QLineEdit" name="nameEdit"/>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QDialogButtonBox" name="buttonBox">
+   <property name="geometry">
+    <rect>
+     <x>190</x>
+     <y>250</y>
+     <width>163</width>
+     <height>26</height>
+    </rect>
+   </property>
+   <property name="standardButtons">
+    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+   </property>
+  </widget>
  </widget>
  <resources/>
  <connections/>

Modified: tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.cpp	2009-08-02 21:53:57 UTC (rev 1329)
@@ -1,14 +1,35 @@
 #include "editTeacherDialog.h"
 #include "ui_editTeacherDialog.h"
 
+#include <QPushButton>
+
 EditTeacherDialog::EditTeacherDialog(QWidget *parent) :
 		QDialog(parent),
 		m_ui(new Ui::EditTeacherDialog)
 {
 	m_ui->setupUi(this);
+
+	connect(m_ui->firstNameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
+	connect(m_ui->lastNameEdit, SIGNAL(textEdited(QString)), this, SLOT(validate()));
 }
 
 EditTeacherDialog::~EditTeacherDialog()
 {
 	delete m_ui;
 }
+
+bool EditTeacherDialog::isValid() const
+{
+	return (!m_ui->firstNameEdit->text().simplified().isEmpty() && !m_ui->lastNameEdit->text().simplified().isEmpty());
+}
+
+void EditTeacherDialog::validate()
+{
+	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.h
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.h	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.h	2009-08-02 21:53:57 UTC (rev 1329)
@@ -16,6 +16,11 @@
 
 private:
 	Ui::EditTeacherDialog *m_ui;
+
+	bool isValid() const;
+
+private slots:
+	void validate();
 };
 
 #endif // EDITTEACHERDIALOG_H

Modified: tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.ui	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/editTeacherDialog.ui	2009-08-02 21:53:57 UTC (rev 1329)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>EditTeacherDialog</class>
- <widget class="QDialog" name="EditTeacherDialog" >
-  <property name="geometry" >
+ <widget class="QDialog" name="EditTeacherDialog">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,9 +10,54 @@
     <height>300</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Dialog</string>
   </property>
+  <widget class="QWidget" name="formLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>130</x>
+     <y>30</y>
+     <width>160</width>
+     <height>80</height>
+    </rect>
+   </property>
+   <layout class="QFormLayout" name="formLayout">
+    <item row="0" column="0">
+     <widget class="QLabel" name="label">
+      <property name="text">
+       <string>Firstname:</string>
+      </property>
+     </widget>
+    </item>
+    <item row="1" column="0">
+     <widget class="QLabel" name="label_2">
+      <property name="text">
+       <string>Last name:</string>
+      </property>
+     </widget>
+    </item>
+    <item row="0" column="1">
+     <widget class="QLineEdit" name="firstNameEdit"/>
+    </item>
+    <item row="1" column="1">
+     <widget class="QLineEdit" name="lastNameEdit"/>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QDialogButtonBox" name="buttonBox">
+   <property name="geometry">
+    <rect>
+     <x>200</x>
+     <y>220</y>
+     <width>163</width>
+     <height>26</height>
+    </rect>
+   </property>
+   <property name="standardButtons">
+    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+   </property>
+  </widget>
  </widget>
  <resources/>
  <connections/>

Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.ui	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageClassesWidget.ui	2009-08-02 21:53:57 UTC (rev 1329)
@@ -34,11 +34,42 @@
     </widget>
    </item>
    <item>
-    <widget class="QPushButton" name="addClassButton">
-     <property name="text">
-      <string>Add</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="deleteClassButton">
+       <property name="text">
+        <string>Delete</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="addClassButton">
+       <property name="text">
+        <string>Add</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="editClassButton">
+       <property name="text">
+        <string>Edit</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
   </layout>
  </widget>

Modified: tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui
===================================================================
--- tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui	2009-08-02 13:51:32 UTC (rev 1328)
+++ tux4kids-admin/trunk/tux4kids-admin/src/manageTeachersWidget.ui	2009-08-02 21:53:57 UTC (rev 1329)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>300</height>
+    <width>420</width>
+    <height>339</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -33,6 +33,44 @@
      </property>
     </widget>
    </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="deleteTeacherButton">
+       <property name="text">
+        <string>Delete</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="spacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="addTeacherButton">
+       <property name="text">
+        <string>Add</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="editTeacherButton">
+       <property name="text">
+        <string>Edit</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
   </layout>
  </widget>
  <resources/>




More information about the Tux4kids-commits mailing list