diff --git a/src/interface/Interface_graphic.cpp b/src/interface/Interface_graphic.cpp index d53e0609156aa775748214c303e8fe4ecf6a9e48..5fea8abfa370157a2febe6d7bf1a7840afee984a 100644 --- a/src/interface/Interface_graphic.cpp +++ b/src/interface/Interface_graphic.cpp @@ -124,24 +124,8 @@ Interface_graphic::Interface_graphic(Core* core, QWidget *parent):QMainWindow(pa _ui_settings = NULL; _ui_node_selection=NULL; _ui_interval_selection=NULL; - // _cmd_window = NULL; _cmd_window = new Command_window(this,this); - /*if (!_ui_node_selection) { - _ui_node_selection = new Node_select(this, 0); - - //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); - // To close the window when we quit the application - connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); - } - - if (!_ui_interval_selection) { - _ui_interval_selection = new Interval_select(this, 0); - - //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); - // To close the window when we quit the application - connect(quit, SIGNAL(triggered()), _ui_interval_selection, SLOT(close())); - }*/ // For drag and drop operations setAcceptDrops(true); } @@ -221,14 +205,6 @@ void Interface_graphic::load_windows(){ exit(EXIT_FAILURE); } - /* Load the export combo box choice from a .ui file */ - /* file_kind_of_export.open(QFile::ReadOnly); - CKFP(_ui_kind_of_export_choice = loader->load(&file_kind_of_export, this), "Cannot open the .ui file : " << ":/window/kind_of_export.ui"); - CKFP(_ui_svg_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file"); - CKFP(_ui_png_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file"); - CKFP(_ui_counter_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file"); - file_kind_of_export.close();*/ - /* Set some windows properties */ _ui_info_window->setWindowFlags(_ui_info_window->windowFlags() | Qt::WindowStaysOnTopHint);/* Always display info_window on top */ _ui_time_selection_export->setWindowFlags(_ui_time_selection_export->windowFlags() | Qt::WindowStaysOnTopHint); @@ -248,10 +224,6 @@ void Interface_graphic::load_windows(){ CKFP(_ui_recent_files_menu = this->findChild<QMenu*>("menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file"); - // CKFP(Info::Render::_ui_render_min_value = this->findChild<QLabel*>("render_min_value"), "Cannot find the render_min_value label in the .ui file"); - // CKFP(Info::Render::_ui_render_max_value = this->findChild<QLabel*>("render_max_value"), "Cannot find the render_max_value label in the .ui file"); - - /* Help window */ CKFP(_ui_help_ok_button = _ui_help_window->findChild<QPushButton*>("help_ok"), "Cannot find the ok push button in the help dialog .ui file"); @@ -259,10 +231,6 @@ void Interface_graphic::load_windows(){ connect(_ui_counter_choice_to_export, SIGNAL(accepted()), this, SLOT(counter_choosed_triggered())); - /* connect(_ui_kind_of_export_choice, SIGNAL(accepted()), - this, SLOT(choice_of_the_export_pressed())); - */ - connect(_ui_help_ok_button, SIGNAL(clicked()), _ui_help_window, SLOT(close())); @@ -273,7 +241,9 @@ void Interface_graphic::load_windows(){ update_recent_files_menu(); /* - 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'. + 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! */ QMetaObject::connectSlotsByName(NULL); @@ -308,7 +278,6 @@ void Interface_graphic::error(const string &s) const{ _ui_info_window->show();/* show info_window */ } - void Interface_graphic::warning(const string &s) const{ if ( true==_no_warning ) return;/* do not display warning messages */ @@ -319,28 +288,18 @@ void Interface_graphic::warning(const string &s) const{ _ui_info_window->show();/* show info_window */ } - void Interface_graphic::information(const string &s) const{ QString buf = s.c_str(); _ui_info_trace_text->moveCursor(QTextCursor::End);/* Insert the new text on the end */ _ui_info_trace_text->insertHtml("<font color='green'>"+buf+"</font><br /><br />"); } - - - - /*********************************** - * - * * * Selected Trace entity informative function. * - * - * **********************************/ - void Interface_graphic::selection_information(const string &s) const{ QString buf = s.c_str(); _ui_info_selection_text->clear();/* Clear the current text (if exists) */ @@ -350,18 +309,10 @@ void Interface_graphic::selection_information(const string &s) const{ _ui_info_window->show();/* show info_window */ } - - - - /*********************************** - * - * * * Tool functions. * - * - * **********************************/ void Interface_graphic::opening_file(const string &path){ @@ -374,34 +325,22 @@ void Interface_graphic::opening_file(const string &path){ QApplication::setOverrideCursor(Qt::WaitCursor); - /* if (_core->draw_trace(path)==false){ - error("Draw trace failed"); - }*/ - - // _ui_render_area->build(); - _is_rendering_trace = true; - // _ui_render_area->updateGL(); - QApplication::restoreOverrideCursor(); - } - void Interface_graphic::bind_render_area(QGLWidget* render_area){ /* Bind the render area to a layout (_ui_render_area_layout) */ _ui_render_area = render_area; _ui_render_area_layout->addWidget(_ui_render_area); } - void Interface_graphic::set_scroll_bars_length(Element_pos new_x_virtual_length, Element_pos new_y_virtual_length){ _x_factor_virtual_to_real = _REAL_X_SCROLL_LENGTH / new_x_virtual_length; _y_factor_virtual_to_real = _REAL_Y_SCROLL_LENGTH / new_y_virtual_length; } - void Interface_graphic::linking_scroll_bars(Element_pos x_bar_new_value, Element_pos y_bar_new_value){ _on_manual_change = true; _ui_x_scroll->setValue(virtual_to_real_scroll_unit(x_bar_new_value, 'x')); @@ -472,15 +411,10 @@ void Interface_graphic::change_zoom_box_value(int new_value){ if(_ui_interval_selection!=NULL)_ui_interval_selection->update_values(); } - /*********************************** - * - * * * Widget slot functions. * - * - * **********************************/ void Interface_graphic::on_open_triggered(){ @@ -498,9 +432,6 @@ void Interface_graphic::on_open_triggered(){ } - -//void Interface_graphic::choice_of_the_export_pressed() { - void Interface_graphic::on_export_file_triggered(){ QStringList selected_files; @@ -509,8 +440,6 @@ void Interface_graphic::on_export_file_triggered(){ QString extension; signed int filename_size;/* Must be signed to check if size is negative */ - - if(_is_rendering_trace == false) return; @@ -761,12 +690,8 @@ void Interface_graphic::on_close_triggered(){ _is_rendering_trace = false; - - information(string("File closed.")); - - this->setWindowTitle(QString("ViTE")); } @@ -821,7 +746,6 @@ void Interface_graphic::on_shaded_states_triggered(){ } } - void Interface_graphic::on_toolbar_menu_triggered(){ static bool checked = true;/* Suppose that toolbar_menu is initially checked */ @@ -846,7 +770,6 @@ void Interface_graphic::on_show_info_triggered(){ _ui_info_window->hide(); } - void Interface_graphic::on_help_triggered(){ if(_ui_help_window->isVisible()){ @@ -931,16 +854,9 @@ void Interface_graphic::on_node_selection_triggered() { }else{ error("Must load a trace before using node selection on a trace"); } - //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); - // To close the window when we quit the application - //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); - //} } void Interface_graphic::on_interval_selection_triggered() { - - //if (!_ui_node_selection) { - // _ui_node_selection = new Node_select(this, 0); if(!_ui_interval_selection){ _ui_interval_selection = new Interval_select(this, 0); connect(quit, SIGNAL(triggered()), _ui_interval_selection, SLOT(close())); @@ -954,10 +870,6 @@ void Interface_graphic::on_interval_selection_triggered() { }else{ error("Must load a trace before using interval selection on a trace"); } - //connect( _ui_node_selection, SIGNAL(settings_changed()), this, SLOT(update_settings())); - // To close the window when we quit the application - //connect(quit, SIGNAL(triggered()), _ui_node_selection, SLOT(close())); - //} } void Interface_graphic::on_actionCommand_triggered(){ @@ -973,13 +885,11 @@ void Interface_graphic::on_actionCommand_triggered(){ } } - void Interface_graphic::on_no_warning_triggered(){ _no_warning = !_no_warning; Session::update_hide_warnings_settings(_no_warning); } - void Interface_graphic::on_no_arrows_triggered(){ std::cout << "no_arrows triggered" << std::endl; Info::Render::_no_arrows = !Info::Render::_no_arrows; @@ -996,8 +906,6 @@ void Interface_graphic::on_reload_from_file_triggered(){ Session::update_reload_type_setting(_reload_type); } - - void Interface_graphic::on_zoom_in_triggered(){ Element_pos t = 1; @@ -1087,12 +995,10 @@ void Interface_graphic::on_y_scroll_valueChanged(int new_value){ } } - void Interface_graphic::on_scale_container_state_valueChanged(int new_value){ _core->launch_action(Core::_STATE_RENDER_AREA_CHANGE_CONTAINER_SCALE, &new_value); } - void Interface_graphic::closeEvent(QCloseEvent *event){ // _ui_help_widget->close(); /* Now, release render */ @@ -1120,7 +1026,6 @@ const std::string Interface_graphic::get_filename() const{ return _trace_path; } - Core * Interface_graphic::get_console(){ return _core; } @@ -1216,7 +1121,6 @@ void Interface_graphic::end_parsing() { setDisabled(false); // Enable the main window } - void Interface_graphic::open_trace(const QString &filename) { // We open the trace