Commit ff3bcccf authored by Olivier Lagrasse's avatar Olivier Lagrasse
Browse files

- Restore some removed source code from the r837.

parent 3b51bfda
......@@ -78,8 +78,6 @@ Interface_graphic::Interface_graphic(Interface_console* core, QWidget *parent):Q
setMouseTracking (true);/* to catch mouse events */
_help_widget = new Help();
_stats_window = new Stats_window(this);
// _cmd_window = NULL;
_cmd_window = new Command_window(this,this);
......@@ -89,8 +87,7 @@ Interface_graphic::Interface_graphic(Interface_console* core, QWidget *parent):Q
Interface_graphic::~Interface_graphic(){
delete _stats_window;
delete _help_widget;
/* Qt desallocates this, _ui_info_window and _render_area automatically */
}
......@@ -111,7 +108,7 @@ void Interface_graphic::load_windows(){
QUiLoader loader;
QFile file_info( ":/window/info_window.ui");
QFile file_selection_export(":/window/option_export_window.ui");
QFile file_help(":/window/help_window.ui");
if (!QGLFormat::hasOpenGL())
qFatal("This system has no OpenGL support");
......@@ -123,9 +120,13 @@ void Interface_graphic::load_windows(){
/* Load the _option_export_window from a .ui file */
file_selection_export.open(QFile::ReadOnly);
CKFP(_ui_time_selection_export = loader.load(&file_selection_export, this), "Cannot open the .ui file : " << "option_export_window.ui");
CKFP(_ui_time_selection_export = loader.load(&file_selection_export, this), "Cannot open the .ui file : " << ":/window/option_export_window.ui");
file_selection_export.close();
/* Load the help dialog box from a .ui file */
file_help.open(QFile::ReadOnly);
CKFP(_ui_help_window = loader.load(&file_help, this), "Cannot open the .ui file : " << ":/window/help_window.ui");
file_help.close();
/* Set some windows properties */
_ui_info_window->setWindowFlags(_ui_info_window->windowFlags() | Qt::WindowStaysOnTopHint);/* Always display info_window on top */
......@@ -144,7 +145,7 @@ void Interface_graphic::load_windows(){
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");
// Export window
/* Export window */
CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_min_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "min_time"), "Cannot find the ok push button in the export dialog .ui file");
......@@ -160,10 +161,17 @@ void Interface_graphic::load_windows(){
CKFP(_ui_CheckBox_accuracy_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_accuracy"), "Cannot find the Line text \"accuracy\" in the export dialog .ui file");
CKFP(_ui_more_options_export = qFindChild<QCommandLinkButton*>(_ui_time_selection_export, "more_options"), "Cannot find the button \"more_options\" in the export dialog .ui file");
/* Help window */
CKFP(_ui_help_ok_button = qFindChild<QPushButton*>(_ui_help_window, "help_ok"), "Cannot find the ok push button in the help dialog .ui file");
connect(_ui_export_ok_button, SIGNAL(pressed()),
this, SLOT(option_export_ok_pressed()));
connect(_ui_help_ok_button, SIGNAL(clicked()),
_ui_help_window, SLOT(close()));
/*
Special function of Qt which allows methods declared as slots and which name are 'on_[widget]_[action]()' to be called when the 'widget' triggered the signal corresponding to 'action'.
/!\ -> use NULL as argument, else messages will be duplicated!
......@@ -529,7 +537,7 @@ void Interface_graphic::on_close_triggered(){
void Interface_graphic::on_quit_triggered(){
((QWidget*)_help_widget)->close();
((QWidget*)_ui_help_window)->close();
((QWidget*)this)->close();
}
......@@ -572,11 +580,11 @@ void Interface_graphic::on_show_info_triggered(){
void Interface_graphic::on_help_triggered(){
if(_help_widget->isVisible()){
_help_widget->hide();
if(_ui_help_window->isVisible()){
_ui_help_window->hide();
}
else{
_help_widget->show();
_ui_help_window->show();
}
}
......@@ -731,7 +739,7 @@ void Interface_graphic::on_scale_container_state_valueChanged(int new_value){
void Interface_graphic::closeEvent(QCloseEvent *event){
_help_widget->close();
// _ui_help_widget->close();
if(isEnabled()){
event->accept();/* accept to hide the window for a further destruction */
......
......@@ -61,7 +61,6 @@ class Interface_graphic;
#include "interface_console.hpp"
#include "resource.hpp"
#include "help.hpp"
#include "../statistics/Stats_window.hpp"
#include "../plugin/Command_window.hpp"
......@@ -236,6 +235,11 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public
*/
QWidget* _ui_time_selection_export;
/*!
* \brief Dialog box to give some help for user.
*/
QWidget* _ui_help_window;
/*!
* \brief Text area which informs the user about the trace resume.
*/
......@@ -251,12 +255,6 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public
*/
QPushButton* _ui_export_ok_button;
/*!
* \brief Text area which informs the user about the selected entity information.
*/
Help *_help_widget;
/*!
* \brief The window used to print stats.
*/
......@@ -267,6 +265,17 @@ class Interface_graphic : public QMainWindow, protected Ui::main_window, public
*/
Command_window * _cmd_window;
/***********************************
*
* Help window.
*
**********************************/
/*!
* \brief Button uses to close the help window.
*/
QPushButton* _ui_help_ok_button;
/***********************************
*
* Render area attribute.
......
......@@ -78,7 +78,6 @@ HEADERS += message/Message.hpp \
interface/interface_graphic.hpp \
interface/parsing_thread.hpp \
interface/resource.hpp \
interface/help.hpp \
# Render headers
render/render.hpp \
render/Render_area.hpp \
......@@ -150,7 +149,6 @@ SOURCES += message/Message.cpp \
interface/interface_console.cpp \
interface/interface_graphic.cpp \
interface/parsing_thread.cpp \
interface/help.cpp \
# Render code files
render/Render_area.cpp \
render/Render_opengl.cpp \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment