Commit 0fb7cad9 authored by shibakaneki's avatar shibakaneki

Added some logic in the teacher bar

parent bac4c4ca
...@@ -155,5 +155,10 @@ void UBWidgetList::setEmptyText(const QString &text) ...@@ -155,5 +155,10 @@ void UBWidgetList::setEmptyText(const QString &text)
} }
} }
bool UBWidgetList::empty()
{
return mWidgets.empty();
}
// TODO : - add onHover 'delete' button // TODO : - add onHover 'delete' button
...@@ -27,6 +27,7 @@ public: ...@@ -27,6 +27,7 @@ public:
void setMargin(int margin); void setMargin(int margin);
void setEmptyText(const QString& text); void setEmptyText(const QString& text);
int margin(); int margin();
bool empty();
protected: protected:
void resizeEvent(QResizeEvent* ev); void resizeEvent(QResizeEvent* ev);
......
...@@ -245,7 +245,11 @@ UBTeacherBarWidget::~UBTeacherBarWidget() ...@@ -245,7 +245,11 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
void UBTeacherBarWidget::onValueChanged() void UBTeacherBarWidget::onValueChanged()
{ {
if( mpTitle->text() == "") if( mpTitle->text() == "" &&
mpLinks->empty() &&
mpActions->empty() &&
mpDropMediaZone->empty() &&
mpComments->document()->toPlainText() == "")
{ {
mIconToLeft = QPixmap(":images/teacher_open_disabled.png"); mIconToLeft = QPixmap(":images/teacher_open_disabled.png");
mIconToRight = QPixmap(":images/teacher_close_disabled.png"); mIconToRight = QPixmap(":images/teacher_close_disabled.png");
...@@ -291,6 +295,7 @@ void UBTeacherBarWidget::onLinkButton() ...@@ -291,6 +295,7 @@ void UBTeacherBarWidget::onLinkButton()
mpLinks->addWidget(pUrl); mpLinks->addWidget(pUrl);
} }
// ---------------------------------------------------------------------------------------------
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent) UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent)
, mpText(NULL) , mpText(NULL)
, mpLayout(NULL) , mpLayout(NULL)
...@@ -359,11 +364,14 @@ QString UBTeacherStudentAction::comboValue() ...@@ -359,11 +364,14 @@ QString UBTeacherStudentAction::comboValue()
{ {
QString str; QString str;
// TODO : Implement this method if(NULL != mpCombo){
str = mpCombo->currentText();
}
return str; return str;
} }
// ---------------------------------------------------------------------------------------------
UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent) UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent)
{ {
...@@ -385,6 +393,10 @@ UBTeacherBarDropMediaZone::~UBTeacherBarDropMediaZone() ...@@ -385,6 +393,10 @@ UBTeacherBarDropMediaZone::~UBTeacherBarDropMediaZone()
} }
} }
bool UBTeacherBarDropMediaZone::empty()
{
return mWidget->empty();
}
void UBTeacherBarDropMediaZone::dragEnterEvent(QDragEnterEvent *pEvent) void UBTeacherBarDropMediaZone::dragEnterEvent(QDragEnterEvent *pEvent)
{ {
......
...@@ -45,6 +45,7 @@ class UBTeacherBarDropMediaZone : public QWidget ...@@ -45,6 +45,7 @@ class UBTeacherBarDropMediaZone : public QWidget
public: public:
UBTeacherBarDropMediaZone(QWidget* parent=0, const char* name="UBTeacherBarDropMediaZone"); UBTeacherBarDropMediaZone(QWidget* parent=0, const char* name="UBTeacherBarDropMediaZone");
~UBTeacherBarDropMediaZone(); ~UBTeacherBarDropMediaZone();
bool empty();
private: private:
QList<QWidget*>mWidgetList; QList<QWidget*>mWidgetList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment