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)
}
}
bool UBWidgetList::empty()
{
return mWidgets.empty();
}
// TODO : - add onHover 'delete' button
......@@ -27,6 +27,7 @@ public:
void setMargin(int margin);
void setEmptyText(const QString& text);
int margin();
bool empty();
protected:
void resizeEvent(QResizeEvent* ev);
......
......@@ -245,7 +245,11 @@ UBTeacherBarWidget::~UBTeacherBarWidget()
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");
mIconToRight = QPixmap(":images/teacher_close_disabled.png");
......@@ -291,6 +295,7 @@ void UBTeacherBarWidget::onLinkButton()
mpLinks->addWidget(pUrl);
}
// ---------------------------------------------------------------------------------------------
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent)
, mpText(NULL)
, mpLayout(NULL)
......@@ -359,11 +364,14 @@ QString UBTeacherStudentAction::comboValue()
{
QString str;
// TODO : Implement this method
if(NULL != mpCombo){
str = mpCombo->currentText();
}
return str;
}
// ---------------------------------------------------------------------------------------------
UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent)
{
......@@ -385,6 +393,10 @@ UBTeacherBarDropMediaZone::~UBTeacherBarDropMediaZone()
}
}
bool UBTeacherBarDropMediaZone::empty()
{
return mWidget->empty();
}
void UBTeacherBarDropMediaZone::dragEnterEvent(QDragEnterEvent *pEvent)
{
......
......@@ -45,6 +45,7 @@ class UBTeacherBarDropMediaZone : public QWidget
public:
UBTeacherBarDropMediaZone(QWidget* parent=0, const char* name="UBTeacherBarDropMediaZone");
~UBTeacherBarDropMediaZone();
bool empty();
private:
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