Added some logic in the teacher bar

preferencesAboutTextFull
shibakaneki 13 years ago
parent bac4c4caac
commit 0fb7cad988
  1. 5
      src/customWidgets/UBWidgetList.cpp
  2. 1
      src/customWidgets/UBWidgetList.h
  3. 16
      src/gui/UBTeacherBarWidget.cpp
  4. 1
      src/gui/UBTeacherBarWidget.h

@ -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;

Loading…
Cancel
Save