COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
CentralPanel Class Reference

Panel to view and modify options of an object. More...

#include <CentralPanel.hpp>

Inherits QWidget.

Public Slots

void bt_apply_clicked ()
 Slot called when user clicks on "Commit changes" button. More...
 

Public Member Functions

 CentralPanel (QWidget *parent=nullptr)
 Constructor. More...
 
 ~CentralPanel ()
 Destructor. More...
 
bool is_modified () const
 Indicates wether at least one option has been modified. More...
 
void list_modified_options (core::CommitDetails &commitDetails) const
 Build containers with modified options. More...
 
QString current_path () const
 Gives the current path. More...
 

Private Slots

void current_index_changed (const QModelIndex &newIndex, const QModelIndex &oldIndex)
 Slot called when the model current index changed. More...
 
void advanced_mode_changed (bool advanced)
 Slot called when the model advanced status has changed. More...
 
void data_changed (const QModelIndex &first, const QModelIndex &last)
 Slot called when data changed in the underlying model. More...
 
void bt_see_changes_clicked ()
 Slot called when user wants to see what options have been modified. More...
 
void bt_forget_clicked ()
 Slot called when user wants to clear all the changes. More...
 
void value_changed ()
 Slot called when an option value has been modified. More...
 

Private Member Functions

void set_options (const QList< boost::shared_ptr< cf3::common::Option > > &list)
 Sets new graphical options. More...
 
void set_buttons_visible (bool visible)
 Set the buttons to a visible/invisible state. More...
 
void set_buttons_enabled (bool enabled)
 Set the buttons to a enabled/disabled state. More...
 

Private Attributes

QScrollArea * m_scroll_basic_options
 Scroll area for basic options. More...
 
QScrollArea * m_scroll_advanced_options
 Scroll area for advanced options. More...
 
OptionLayoutm_basic_option_layout
 List containing basic options components. More...
 
OptionLayoutm_advanced_option_layout
 List containing advanced options components. More...
 
QPushButton * m_bt_apply
 Button used to commit changes made. More...
 
QPushButton * m_bt_forget
 Button used to reset changes. More...
 
QPushButton * m_bt_see_changes
 Button used to see changes made. More...
 
QGridLayout * m_main_layout
 Main layout containing basic and advanced option panels. More...
 
QGroupBox * m_gbox_basic_options
 Its layout is #m_basicOptionsLayout. More...
 
QGroupBox * m_gbox_advanced_options
 Its layout is #m_advancedOptionsLayout. More...
 
bool m_advanced_mode
 Indicates if the panel is in advanced mode or not. More...
 
QString m_current_path
 The path of the component of which options are currently displayed. More...
 
QSplitter * m_splitter
 Splitter between basic and advanced options. More...
 

Detailed Description

Panel to view and modify options of an object.

This class allows user to display and modify options of an object.

Author
Quentin Gasper.

Definition at line 46 of file CentralPanel.hpp.

Constructor & Destructor Documentation

CentralPanel ( QWidget *  parent = nullptr)

Constructor.

Builds an CentralPanel with no options. The panel is neither in read-only mode nor advanced mode.

Parameters
parentThe parent widget. Default value is nullptr

Definition at line 32 of file CentralPanel.cpp.

Destructor.

Frees the allocated memory. Parent is not destroyed.

Definition at line 100 of file CentralPanel.cpp.

Member Function Documentation

void advanced_mode_changed ( bool  advanced)
privateslot

Slot called when the model advanced status has changed.

If status is advanced, the basic options layout is always visible, so that the user knows he is playing with advanced options. If the current option has no advanced option, the advanced option layout remains hidden.

Parameters
advancedIf true, advanced options are showed up.
Todo:
what if options are modified ???

Definition at line 268 of file CentralPanel.cpp.

void bt_apply_clicked ( )
slot

Slot called when user clicks on "Commit changes" button.

If at least one option has been modified, changesMade signal is emitted.

Definition at line 230 of file CentralPanel.cpp.

void bt_forget_clicked ( )
privateslot

Slot called when user wants to clear all the changes.

Definition at line 315 of file CentralPanel.cpp.

void bt_see_changes_clicked ( )
privateslot

Slot called when user wants to see what options have been modified.

Definition at line 304 of file CentralPanel.cpp.

void current_index_changed ( const QModelIndex &  newIndex,
const QModelIndex &  oldIndex 
)
privateslot

Slot called when the model current index changed.

Options are replaced by the new ones.

Parameters
newIndexThe new current index.
oldIndexThe old current index. This parameter is not used.

Definition at line 258 of file CentralPanel.cpp.

QString current_path ( ) const

Gives the current path.

Returns
Returns the current path.

Definition at line 197 of file CentralPanel.cpp.

void data_changed ( const QModelIndex &  first,
const QModelIndex &  last 
)
privateslot

Slot called when data changed in the underlying model.

This slot considers that only one index has changed, instead of a range. If the first, the last and the model current indexes are the same and valid, the option layouts are updated with the new options.

Parameters
firstThe first index of the range.
lastThe last index of the range.

Definition at line 294 of file CentralPanel.cpp.

bool is_modified ( ) const

Indicates wether at least one option has been modified.

Returns
Returns true if at least one option has been modified.

Definition at line 179 of file CentralPanel.cpp.

void list_modified_options ( core::CommitDetails commitDetails) const

Build containers with modified options.

This method allows to get old and new values of each modified option. The old value is the original one, that the option had when it was created. The new value is the current option value. All intermediate values (i.e. : if user modified several times the same option) are ignored.

Parameters
commitDetailsThe object where values will be stored.

Definition at line 186 of file CentralPanel.cpp.

void set_buttons_enabled ( bool  enabled)
private

Set the buttons to a enabled/disabled state.

Parameters
enabledIf true, buttons are set to enabled.

Definition at line 217 of file CentralPanel.cpp.

void set_buttons_visible ( bool  visible)
private

Set the buttons to a visible/invisible state.

Parameters
visibleIf true, buttons are set to visible.

Definition at line 208 of file CentralPanel.cpp.

void set_options ( const QList< boost::shared_ptr< cf3::common::Option > > &  list)
private

Sets new graphical options.

All existing options in the layouts are removed.

Parameters
listThe list of options to set. Can be empty.
Todo:
why don't we use PropertyList?

Definition at line 125 of file CentralPanel.cpp.

void value_changed ( )
privateslot

Slot called when an option value has been modified.

Definition at line 322 of file CentralPanel.cpp.

Member Data Documentation

bool m_advanced_mode
private

Indicates if the panel is in advanced mode or not.

If true, the panel is in advanced mode. Advanced options() (if any) are displayed. Otherwise, they are m_hidden.

Definition at line 172 of file CentralPanel.hpp.

OptionLayout* m_advanced_option_layout
private

List containing advanced options components.

Definition at line 140 of file CentralPanel.hpp.

OptionLayout* m_basic_option_layout
private

List containing basic options components.

Definition at line 137 of file CentralPanel.hpp.

QPushButton* m_bt_apply
private

Button used to commit changes made.

Definition at line 143 of file CentralPanel.hpp.

QPushButton* m_bt_forget
private

Button used to reset changes.

Definition at line 146 of file CentralPanel.hpp.

QPushButton* m_bt_see_changes
private

Button used to see changes made.

Definition at line 149 of file CentralPanel.hpp.

QString m_current_path
private

The path of the component of which options are currently displayed.

Definition at line 175 of file CentralPanel.hpp.

QGroupBox* m_gbox_advanced_options
private

Its layout is #m_advancedOptionsLayout.

Groupbox used to display advanced options() components with a titled border.

Definition at line 166 of file CentralPanel.hpp.

QGroupBox* m_gbox_basic_options
private

Its layout is #m_basicOptionsLayout.

Groupbox used to display basic options() components with a titled border.

Definition at line 160 of file CentralPanel.hpp.

QGridLayout* m_main_layout
private

Main layout containing basic and advanced option panels.

This layout is composed of three lines and one column.

Definition at line 154 of file CentralPanel.hpp.

QScrollArea* m_scroll_advanced_options
private

Scroll area for advanced options.

Definition at line 134 of file CentralPanel.hpp.

QScrollArea* m_scroll_basic_options
private

Scroll area for basic options.

Definition at line 131 of file CentralPanel.hpp.

QSplitter* m_splitter
private

Splitter between basic and advanced options.

Definition at line 178 of file CentralPanel.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin