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

Client main window. More...

#include <MainWindow.hpp>

Inherits QMainWindow.

Public Member Functions

 MainWindow ()
 Constructor. More...
 
 ~MainWindow ()
 Destructor. More...
 
PythonCodeEditorcreate_new_python_editor ()
 create a new PythonCodeEditor, called from the PythonConsole More...
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
 Overrides QWidget::closeEvent(). More...
 

Private Types

enum  MainWinActions {
  ACTION_CONNECT_TO_SERVER, ACTION_CREATE_SSH_TUNNEL, ACTION_CREATE_REVERSE_SSH_TUNNEL, ACTION_DISCONNECT_FROM_SERVER,
  ACTION_SHUTDOWN_SERVER, ACTION_UPDATE_TREE, ACTION_OPEN_REMOTELY, ACTION_OPEN_LOCALLY,
  ACTION_SAVE_REMOTELY, ACTION_SAVE_LOCALLY, ACTION_RUN_SCRIPT, ACTION_QUIT,
  ACTION_TOGGLE_DEBUG_MODE, ACTION_TOGGLE_ADVANCED_MODE, ACTION_TOGGLE_INFO_PANE, ACTION_CLEAR_LOG,
  ACTION_HELP, ACTION_GOTO_WIKI, ACTION_GOTO_WEBSITE, ACTION_ABOUT_COOLFLuiD,
  ACTION_ABOUT_QT, ACTION_NEW_PYTHON_EDITOR, ACTION_NEW_REMOTE_FILE_COPY
}
 

Private Slots

void quit ()
 Slot called when the user wants to quit the application. More...
 
void toggle_advanced ()
 Slot called when the user wants to to toggle basic/advanced mode. More...
 
void toggle_debug_mode ()
 
void show_help ()
 
void go_to_web_site ()
 
void new_exception (const QString &)
 
void connect_to_server ()
 
void create_ssh_tunnel ()
 
void create_reverse_ssh_tunnel ()
 
void disconnect_from_server ()
 
void network_connected ()
 
void network_disconnected (common::SignalArgs &args)
 
void save_file_locally ()
 
void save_file_remotely ()
 
void open_file_locally ()
 
void open_file_remotely ()
 
void run_script ()
 
void new_python_script_editor ()
 
void new_remote_file_copy ()
 
void new_log_message (const QString &message, uiCommon::LogMessage::Type type)
 
void tab_clicked (int num)
 
void current_index_changed (const QModelIndex &newIndex, const QModelIndex &oldIndex)
 
void script_finished ()
 

Private Member Functions

void build_menus ()
 Creates actions and menus. More...
 
void set_file_open (bool fileOpen)
 Sets the client to a file open or a file not open state by enabling or disabling certain options(). More...
 
int confirm_close ()
 Asks to the user to confirm his request to close the connection or window. More...
 
void show_error (const QString &errorMessage)
 Shows an error message in a message box. More...
 
void set_connected_state (bool connected)
 
void set_running_script_state (bool running)
 

Private Attributes

TreeViewm_tree_view
 The Client that displays the model. More...
 
AboutCFDialogm_about_cf_dialog
 
CentralPanelm_central_panel
 Panel used to display and modify options for a selected object. More...
 
QMap< MainWindow::MainWinActions, QAction * > m_actions
 Hashmap containing all available actions for menu m_items. More...
 
QMenu * m_mnu_file
 "File" menu More...
 
QMenu * m_mnu_view
 "View" menu More...
 
QMenu * m_mnu_help
 
QMenu * m_mnu_open_file
 "Open file" sub-menu More...
 
QMenu * m_mnu_save_file
 "Save file" sub-menu More...
 
LoggingListm_log_list
 Text area displaying the log messages. More...
 
QSplitter * m_splitter
 Splitter used to allow user to resize the Client. More...
 
QTextStream m_log_file
 
QSplitter * m_central_splitter
 
QSplitter * m_python_tab_splitter
 
PythonConsolem_python_console
 Simple console to execute python command on the server. More...
 
QTabWidget * m_tab_window
 
QTableView * m_property_view
 
core::PropertyModelm_property_model
 
QLabel * m_lab_description
 
QScrollArea * m_scroll_description
 
TreeBrowserm_tree_browser
 
Tools::Shell::Interpreterm_script_runner
 
core::SSHTunnelcurrent_tunnel
 

Static Private Attributes

static const int CLOSE_DISC = 0
 Indicates that the user wants to disconnect from the server. More...
 
static const int CLOSE_SHUTDOWN = 1
 Indicates that the user wants to shutdown the server. More...
 
static const int CLOSE_CANCEL = 2
 Indicates that the user wants cancel his request to close the connection/window. More...
 

Detailed Description

Client main window.

Author
Quentin Gasper.

Definition at line 59 of file MainWindow.hpp.

Member Enumeration Documentation

enum MainWinActions
private
Enumerator
ACTION_CONNECT_TO_SERVER 
ACTION_CREATE_SSH_TUNNEL 
ACTION_CREATE_REVERSE_SSH_TUNNEL 
ACTION_DISCONNECT_FROM_SERVER 
ACTION_SHUTDOWN_SERVER 
ACTION_UPDATE_TREE 
ACTION_OPEN_REMOTELY 
ACTION_OPEN_LOCALLY 
ACTION_SAVE_REMOTELY 
ACTION_SAVE_LOCALLY 
ACTION_RUN_SCRIPT 
ACTION_QUIT 
ACTION_TOGGLE_DEBUG_MODE 
ACTION_TOGGLE_ADVANCED_MODE 
ACTION_TOGGLE_INFO_PANE 
ACTION_CLEAR_LOG 
ACTION_HELP 
ACTION_GOTO_WIKI 
ACTION_GOTO_WEBSITE 
ACTION_ABOUT_COOLFLuiD 
ACTION_ABOUT_QT 
ACTION_NEW_PYTHON_EDITOR 
ACTION_NEW_REMOTE_FILE_COPY 

Definition at line 63 of file MainWindow.hpp.

Constructor & Destructor Documentation

Constructor.

Builds all components used by the window. After the constructor, the window is visible and in a "@e Not connected" state.

Definition at line 73 of file MainWindow.cpp.

~MainWindow ( )

Destructor.

Frees the allocated memory.

Definition at line 185 of file MainWindow.cpp.

Member Function Documentation

void build_menus ( )
private

Creates actions and menus.

Definition at line 206 of file MainWindow.cpp.

void closeEvent ( QCloseEvent *  event)
protectedvirtual

Overrides QWidget::closeEvent().

This method is called when the user closes the window. If a network communication is active, he is prompt to confirm his action.

Parameters
eventClose event to manage the window closing.

Definition at line 419 of file MainWindow.cpp.

int confirm_close ( )
private

Asks to the user to confirm his request to close the connection or window.

Returns
Returns CLOSE_DISC if the user just wants to disconnect from the server, CLOSE_SHUTDOWN if the user wants to shutdown the server or SHUT_CANCEL if the user wants to cancel his action.

Definition at line 365 of file MainWindow.cpp.

void connect_to_server ( )
privateslot

Definition at line 512 of file MainWindow.cpp.

PythonCodeEditor * create_new_python_editor ( )

create a new PythonCodeEditor, called from the PythonConsole

Definition at line 673 of file MainWindow.cpp.

void create_reverse_ssh_tunnel ( )
privateslot

Definition at line 550 of file MainWindow.cpp.

void create_ssh_tunnel ( )
privateslot

Definition at line 539 of file MainWindow.cpp.

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

Definition at line 696 of file MainWindow.cpp.

void disconnect_from_server ( )
privateslot

Definition at line 561 of file MainWindow.cpp.

void go_to_web_site ( )
privateslot

Definition at line 492 of file MainWindow.cpp.

void network_connected ( )
privateslot

Definition at line 568 of file MainWindow.cpp.

void network_disconnected ( common::SignalArgs args)
privateslot

Definition at line 575 of file MainWindow.cpp.

void new_exception ( const QString &  msg)
privateslot

Definition at line 505 of file MainWindow.cpp.

void new_log_message ( const QString &  message,
uiCommon::LogMessage::Type  type 
)
privateslot

Definition at line 681 of file MainWindow.cpp.

void new_python_script_editor ( )
privateslot

Definition at line 665 of file MainWindow.cpp.

void new_remote_file_copy ( )
privateslot

Definition at line 669 of file MainWindow.cpp.

void open_file_locally ( )
privateslot

Definition at line 621 of file MainWindow.cpp.

void open_file_remotely ( )
privateslot

Definition at line 631 of file MainWindow.cpp.

void quit ( )
privateslot

Slot called when the user wants to quit the application.

The client disconnects form the server and exits immediately.

Definition at line 456 of file MainWindow.cpp.

void run_script ( )
privateslot

Definition at line 642 of file MainWindow.cpp.

void save_file_locally ( )
privateslot

Definition at line 602 of file MainWindow.cpp.

void save_file_remotely ( )
privateslot

Definition at line 612 of file MainWindow.cpp.

void script_finished ( )
privateslot

Definition at line 710 of file MainWindow.cpp.

void set_connected_state ( bool  connected)
private

Definition at line 584 of file MainWindow.cpp.

void set_file_open ( bool  fileOpen)
private

Sets the client to a file open or a file not open state by enabling or disabling certain options().

Parameters
fileOpenIf true, the client is set to a file open running state, otherwise it is set to a file not open state.

Definition at line 355 of file MainWindow.cpp.

void set_running_script_state ( bool  running)
private

Definition at line 595 of file MainWindow.cpp.

void show_error ( const QString &  errorMessage)
private

Shows an error message in a message box.

Parameters
errorMessageError message to show.

Definition at line 408 of file MainWindow.cpp.

void show_help ( )
privateslot

Definition at line 485 of file MainWindow.cpp.

void tab_clicked ( int  num)
privateslot

Definition at line 688 of file MainWindow.cpp.

void toggle_advanced ( )
privateslot

Slot called when the user wants to to toggle basic/advanced mode.

Definition at line 469 of file MainWindow.cpp.

void toggle_debug_mode ( )
privateslot

Definition at line 477 of file MainWindow.cpp.

Member Data Documentation

const int CLOSE_CANCEL = 2
staticprivate

Indicates that the user wants cancel his request to close the connection/window.

Used when the user does "Disconnect", "Quit", or closes the window.

Definition at line 207 of file MainWindow.hpp.

const int CLOSE_DISC = 0
staticprivate

Indicates that the user wants to disconnect from the server.

Used when the user does "Disconnect", "Quit", or closes the window.

Definition at line 196 of file MainWindow.hpp.

const int CLOSE_SHUTDOWN = 1
staticprivate

Indicates that the user wants to shutdown the server.

Used when the user does "Disconnect", "Quit", or closes the window.

Definition at line 201 of file MainWindow.hpp.

core::SSHTunnel* current_tunnel
private

Definition at line 267 of file MainWindow.hpp.

AboutCFDialog* m_about_cf_dialog
private

Definition at line 212 of file MainWindow.hpp.

QMap<MainWindow::MainWinActions, QAction *> m_actions
private

Hashmap containing all available actions for menu m_items.

The key is a number defined by one of the constant integer attributes of this class. The value is the action corresponding to this number.

Definition at line 222 of file MainWindow.hpp.

CentralPanel* m_central_panel
private

Panel used to display and modify options for a selected object.

Definition at line 216 of file MainWindow.hpp.

QSplitter* m_central_splitter
private

Definition at line 246 of file MainWindow.hpp.

QLabel* m_lab_description
private

Definition at line 259 of file MainWindow.hpp.

QTextStream m_log_file
private

Definition at line 244 of file MainWindow.hpp.

LoggingList* m_log_list
private

Text area displaying the log messages.

Definition at line 239 of file MainWindow.hpp.

QMenu* m_mnu_file
private

"File" menu

Definition at line 225 of file MainWindow.hpp.

QMenu* m_mnu_help
private

Definition at line 230 of file MainWindow.hpp.

QMenu* m_mnu_open_file
private

"Open file" sub-menu

Definition at line 233 of file MainWindow.hpp.

QMenu* m_mnu_save_file
private

"Save file" sub-menu

Definition at line 236 of file MainWindow.hpp.

QMenu* m_mnu_view
private

"View" menu

Definition at line 228 of file MainWindow.hpp.

core::PropertyModel* m_property_model
private

Definition at line 257 of file MainWindow.hpp.

QTableView* m_property_view
private

Definition at line 255 of file MainWindow.hpp.

PythonConsole* m_python_console
private

Simple console to execute python command on the server.

Definition at line 251 of file MainWindow.hpp.

QSplitter* m_python_tab_splitter
private

Definition at line 248 of file MainWindow.hpp.

Tools::Shell::Interpreter* m_script_runner
private

Definition at line 265 of file MainWindow.hpp.

QScrollArea* m_scroll_description
private

Definition at line 261 of file MainWindow.hpp.

QSplitter* m_splitter
private

Splitter used to allow user to resize the Client.

Definition at line 242 of file MainWindow.hpp.

QTabWidget* m_tab_window
private

Definition at line 253 of file MainWindow.hpp.

TreeBrowser* m_tree_browser
private

Definition at line 263 of file MainWindow.hpp.

TreeView* m_tree_view
private

The Client that displays the model.

Definition at line 210 of file MainWindow.hpp.


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