Skip to content

Commit

Permalink
Merge branch 'errorTextenabled'
Browse files Browse the repository at this point in the history
* errorTextenabled:
  Added the errorTextEnabled property of a ctkWorkflowGroupBox.
  • Loading branch information
finetjul committed Aug 17, 2011
2 parents 5ebd600 + 1a66cb7 commit b6314ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Libs/Widgets/ctkWorkflowGroupBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ctkWorkflowGroupBoxPrivate: public Ui_ctkWorkflowGroupBox
~ctkWorkflowGroupBoxPrivate();

bool HideWidgetsOfNonCurrentSteps;
bool ErrorTextEnabled;

ctkWorkflowStep* StepShownPreviously;
ctkWorkflowStep* StepShownCurrently;
Expand All @@ -59,6 +60,8 @@ ctkWorkflowGroupBoxPrivate::ctkWorkflowGroupBoxPrivate()
{
this->HideWidgetsOfNonCurrentSteps = false;

this->ErrorTextEnabled = true;

this->StepShownPreviously = 0;
this->StepShownCurrently = 0;
}
Expand Down Expand Up @@ -93,6 +96,8 @@ ctkWorkflowGroupBox::~ctkWorkflowGroupBox()
// --------------------------------------------------------------------------
CTK_GET_CPP(ctkWorkflowGroupBox, bool, hideWidgetsOfNonCurrentSteps, HideWidgetsOfNonCurrentSteps);
CTK_SET_CPP(ctkWorkflowGroupBox, bool, setHideWidgetsOfNonCurrentSteps, HideWidgetsOfNonCurrentSteps);
CTK_GET_CPP(ctkWorkflowGroupBox, bool, errorTextEnabled, ErrorTextEnabled);
CTK_SET_CPP(ctkWorkflowGroupBox, bool, setErrorTextEnabled, ErrorTextEnabled);
CTK_GET_CPP(ctkWorkflowGroupBox, QLayout*, clientAreaLayout, ClientAreaLayout);

// --------------------------------------------------------------------------
Expand All @@ -113,7 +118,7 @@ void ctkWorkflowGroupBox::updateGroupBox(ctkWorkflowStep* currentStep)
d->SubTitleTextBrowser->setVisible(!this->subTitle().isEmpty());
d->PreTextBrowser->setVisible(!this->preText().isEmpty());
d->PostTextBrowser->setVisible(!this->postText().isEmpty());
d->ErrorTextBrowser->setVisible(!this->errorText().isEmpty());
d->ErrorTextBrowser->setVisible(!this->errorText().isEmpty() && d->ErrorTextEnabled);
}

// disable/hide the previously shown step
Expand Down
10 changes: 10 additions & 0 deletions Libs/Widgets/ctkWorkflowGroupBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class CTK_WIDGETS_EXPORT ctkWorkflowGroupBox : public QWidget
Q_PROPERTY(QString preText READ preText WRITE setPreText)
Q_PROPERTY(QString postText READ postText WRITE setPostText)
Q_PROPERTY(bool hideWidgetsOfNonCurrentSteps READ hideWidgetsOfNonCurrentSteps WRITE setHideWidgetsOfNonCurrentSteps)
Q_PROPERTY(bool errorTextEnabled READ errorTextEnabled WRITE setErrorTextEnabled)

public:

Expand Down Expand Up @@ -91,6 +92,15 @@ class CTK_WIDGETS_EXPORT ctkWorkflowGroupBox : public QWidget
bool hideWidgetsOfNonCurrentSteps()const;
void setHideWidgetsOfNonCurrentSteps(bool newHideWidgetsOfNonCurrentSteps);

///
/// If errorTextEnabled is turned on, then a possible error text
/// will be shown just underneath the client area.
/// If it is turned off, then a possible error text will never
/// be shown.
/// (Default ON).
bool errorTextEnabled()const;
void setErrorTextEnabled(bool newErrorTextEnabled);

public slots:

virtual void updateGroupBox(ctkWorkflowStep* currentStep);
Expand Down
2 changes: 1 addition & 1 deletion Libs/Widgets/ctkWorkflowWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CTK_WIDGETS_EXPORT ctkWorkflowWidget : public QWidget

/// Get the widget constaining the title, subtitle, pre-text, post-text, error-text and client area
/// layout.
virtual ctkWorkflowGroupBox* workflowGroupBox()const;
Q_INVOKABLE virtual ctkWorkflowGroupBox* workflowGroupBox()const;

/// Set/get whether or not to associate a buttonBoxWidget with this step (default true)
bool showButtonBoxWidget()const;
Expand Down

0 comments on commit b6314ac

Please sign in to comment.