Updated some minor EOU (Ease Of Use) in the teacher bar

preferencesAboutTextFull
shibakaneki 13 years ago
parent 40be502737
commit c905eb3879
  1. 3
      resources/style.qss
  2. 1
      src/gui/UBTBDocumentEditWidget.cpp
  3. 2
      src/gui/UBTBDocumentPreviewWidget.cpp
  4. 42
      src/gui/UBTeacherBarPreviewWidget.cpp
  5. 7
      src/gui/UBTeacherBarPreviewWidget.h
  6. 6
      src/gui/UBTeacherBarWidget.cpp
  7. 1
      src/gui/UBTeacherBarWidget.h

@ -27,7 +27,8 @@ QWidget#UBMediaVideoContainer
border: 2px solid #999999; border: 2px solid #999999;
} }
QWidget#UBTeacherBarPreviewWidget
QWidget#UBTBPreviewWidget
{ {
background: #FFFFFF; background: #FFFFFF;
border-radius: 10px; border-radius: 10px;

@ -192,7 +192,6 @@ void UBTBDocumentEditWidget::clearFields()
void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw) void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw)
{ {
mpDataMgr->setKeywords(kw); mpDataMgr->setKeywords(kw);
qDebug() << ">>> KEYWORD CHANGED: " << kw;
emit valueChanged(); emit valueChanged();
} }

@ -29,7 +29,7 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM
mpContainer = new QWidget(this); mpContainer = new QWidget(this);
mpContainer->setLayout(&mContainerLayout); mpContainer->setLayout(&mContainerLayout);
mpContainer->setObjectName("UBTeacherBarPreviewWidget"); mpContainer->setObjectName("UBTBPreviewWidget");
// Session Title // Session Title
mpSessionLabel = new QLabel(tr("Session"), mpContainer); mpSessionLabel = new QLabel(tr("Session"), mpContainer);

@ -144,6 +144,7 @@ UBTBPreviewContainer::~UBTBPreviewContainer()
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget *parent, const char *name):QWidget(parent) UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpEditButton(NULL) , mpEditButton(NULL)
, mpDocumentButton(NULL)
, mpSessionTitle(NULL) , mpSessionTitle(NULL)
, mpTitle(NULL) , mpTitle(NULL)
, mpTitleLabel(NULL) , mpTitleLabel(NULL)
@ -155,20 +156,27 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
setObjectName(name); setObjectName(name);
mpDataMgr = pDataMgr; mpDataMgr = pDataMgr;
setLayout(&mLayout); setLayout(&mLayout);
mLayout.setContentsMargins(0, 0, 0, 0);
setAttribute(Qt::WA_StyledBackground, true); setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet()); setStyleSheet(UBApplication::globalStyleSheet());
// Build the Preview widget // Build the Preview widget
mpContainer = new QWidget(this);
mpContainer->setObjectName("UBTBPreviewWidget");
mpContainer->setLayout(&mContainerLayout);
mLayout.addWidget(mpContainer, 1);
// Session Title // Session Title
mpTitleContainer = new QWidget(this); mpTitleContainer = new QWidget(mpContainer);
mpTitleContainer->setLayout(&mTitleLayout); mpTitleContainer->setLayout(&mTitleLayout);
mpSessionTitle = new QLabel(this); mpSessionTitle = new QLabel(mpContainer);
mpSessionTitle->setText(tr("Session: ")); mpSessionTitle->setText(tr("Session: "));
mpSessionTitle->setWordWrap(true); mpSessionTitle->setWordWrap(true);
mpSessionTitle->setAlignment(Qt::AlignRight); mpSessionTitle->setAlignment(Qt::AlignRight);
mpSessionTitle->setObjectName("UBTBPreviewSessionTitle"); mpSessionTitle->setObjectName("UBTBPreviewSessionTitle");
mLayout.addWidget(mpSessionTitle); mContainerLayout.addWidget(mpSessionTitle);
// Title // Title
mpTitleContainer->setLayout(&mTitleLayout); mpTitleContainer->setLayout(&mTitleLayout);
@ -187,27 +195,32 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
mpPageNbrLabel->setObjectName("UBTBPreviewSessionTitle"); mpPageNbrLabel->setObjectName("UBTBPreviewSessionTitle");
mTitleLayout.addWidget(mpPageNbrLabel); mTitleLayout.addWidget(mpPageNbrLabel);
mTitleLayout.addWidget(&mTitleSeparator); mTitleLayout.addWidget(&mTitleSeparator);
mLayout.addWidget(mpTitleContainer); mContainerLayout.addWidget(mpTitleContainer);
// Content // Content
mpContentContainer = new UBTBPreviewContainer(this); mpContentContainer = new UBTBPreviewContainer(mpContainer);
mLayout.addWidget(mpContentContainer, 1); mContainerLayout.addWidget(mpContentContainer, 1);
// License // License
mLayout.addWidget(&mLicenseSeparator); mContainerLayout.addWidget(&mLicenseSeparator);
mpLicenseLabel = new UBTBLicenseWidget(this); mpLicenseLabel = new UBTBLicenseWidget(mpContainer);
mLayout.addWidget(mpLicenseLabel); mContainerLayout.addWidget(mpLicenseLabel);
// Edit button // Document Button
mpEditButton = new QPushButton(tr("Edit infos"), this); mpDocumentButton = new QPushButton(tr("Document View"), this);
mpDocumentButton->setObjectName("DockPaletteWidgetButton");
// Edit Button
mpEditButton = new QPushButton(tr("Edit"), this);
mpEditButton->setObjectName("DockPaletteWidgetButton"); mpEditButton->setObjectName("DockPaletteWidgetButton");
mEditLayout.addStretch(1); mEditLayout.addWidget(mpDocumentButton, 0);
mEditLayout.addWidget(mpEditButton, 0); mEditLayout.addWidget(mpEditButton, 0);
mEditLayout.addStretch(1); mEditLayout.addStretch(1);
mLayout.addLayout(&mEditLayout, 0); mLayout.addLayout(&mEditLayout, 0);
connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit())); connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit()));
connect(mpDocumentButton, SIGNAL(clicked()), this, SLOT(onDocumentClicked()));
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged())); connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(onActiveSceneChanged()));
} }
@ -225,6 +238,11 @@ void UBTeacherBarPreviewWidget::onEdit()
emit showEditMode(); emit showEditMode();
} }
void UBTeacherBarPreviewWidget::onDocumentClicked()
{
emit showDocumentPreview();
}
void UBTeacherBarPreviewWidget::updateFields() void UBTeacherBarPreviewWidget::updateFields()
{ {
// Session Title // Session Title

@ -62,6 +62,7 @@ public:
signals: signals:
void showEditMode(); void showEditMode();
void showDocumentPreview();
protected: protected:
void showEvent(QShowEvent* ev); void showEvent(QShowEvent* ev);
@ -69,6 +70,7 @@ protected:
private slots: private slots:
void onEdit(); void onEdit();
void onActiveSceneChanged(); void onActiveSceneChanged();
void onDocumentClicked();
private: private:
void generateActions(); void generateActions();
@ -77,8 +79,12 @@ private:
void generateComments(); void generateComments();
QVBoxLayout mLayout; QVBoxLayout mLayout;
QVBoxLayout mContainerLayout;
QHBoxLayout mEditLayout; QHBoxLayout mEditLayout;
QPushButton* mpEditButton; QPushButton* mpEditButton;
QPushButton* mpDocumentButton;
QWidget* mpContainer;
// Titles // Titles
QVBoxLayout mTitleLayout; QVBoxLayout mTitleLayout;
@ -95,7 +101,6 @@ private:
// License // License
UBTBSeparator mLicenseSeparator; UBTBSeparator mLicenseSeparator;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget* mpLicenseLabel; UBTBLicenseWidget* mpLicenseLabel;

@ -57,6 +57,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect(UBApplication::boardController, SIGNAL(activeDocumentChanged()), this, SLOT(onActiveDocumentChanged())); connect(UBApplication::boardController, SIGNAL(activeDocumentChanged()), this, SLOT(onActiveDocumentChanged()));
connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode())); connect(mpPreview, SIGNAL(showEditMode()), this, SLOT(onShowEditMode()));
connect(mpPreview, SIGNAL(showDocumentPreview()), this, SLOT(onShowDocumentPreview()));
connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); connect(mpDocPreviewWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); connect(mpDocEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState))); connect(mpPageEditWidget, SIGNAL(changeTBState(eTeacherBarState)), this, SLOT(onTBStateChanged(eTeacherBarState)));
@ -150,6 +151,11 @@ void UBTeacherBarWidget::onShowEditMode()
onTBStateChanged(eTeacherBarState_PageEdit); onTBStateChanged(eTeacherBarState_PageEdit);
} }
void UBTeacherBarWidget::onShowDocumentPreview()
{
onTBStateChanged(eTeacherBarState_DocumentPreview);
}
void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state) void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state)
{ {
switch(state){ switch(state){

@ -48,6 +48,7 @@ private slots:
void onShowEditMode(); void onShowEditMode();
void onTBStateChanged(eTeacherBarState state); void onTBStateChanged(eTeacherBarState state);
void onActiveDocumentChanged(); void onActiveDocumentChanged();
void onShowDocumentPreview();
private: private:
bool isEmpty(); bool isEmpty();

Loading…
Cancel
Save