Mentions légales du service

Skip to content
Snippets Groups Projects
Commit fddeffaa authored by Kevin Coulomb's avatar Kevin Coulomb
Browse files

Correction of a bug when selecting proc (now the root does not have to be selected)

parent f6332bcc
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,9 @@ void Command_window::on_execute_button_clicked(){
start_time = "0";
end_time = QString::fromStdString(_trace->get_max_date().to_string());
}
else if (cmd == "lapinou")
return;
else if (cmd == "lapinou"){
show_error();
}
else if( cmd == "TIME"){
_selected_containers.clear();
}
......@@ -84,27 +85,6 @@ void Command_window::on_execute_button_clicked(){
_console->get_console()->draw_trace(_console->get_filename(),Core::_DRAW_OPENGL);
// if(_ui_tree_box->text() !="" )
// arg<< _ui_tree_box->text();
/* if(_ui_arg4_box->text() !="" )
arg << _ui_arg4_box->text();
if(_ui_arg5_box->text()!="" )
arg <<_ui_arg5_box->text();*/
/*
std::cout <<"Valeur cmd: "<< _ui_cmd_box->text().toStdString () <<std::endl;
std::cout <<"Valeur 1: "<< _ui_arg1_box->text().toStdString () <<std::endl;
std::cout <<"Valeur 2: "<< _ui_arg2_box->text().toStdString () <<std::endl;
std::cout <<"Valeur 3: "<< _ui_arg3_box->text().toStdString () <<std::endl;
std::cout <<"Valeur 4: "<< _ui_arg4_box->text().toStdString () <<std::endl;
std::cout <<"Valeur 5: "<< _ui_arg5_box->text().toStdString () <<std::endl;
*/
/*
QProcess * proc =new QProcess();
proc->execute(cmd,arg);
delete proc;
//proc.*/
//Envoyer un signal pour dire de dessiner
}
......@@ -177,33 +157,16 @@ void Command_window::set_selected_nodes()
}
it ++;
}
/* bool b;
for( vector<const Container *>::const_iterator iter = _selected_containers.begin();
iter != _selected_containers.end();
iter ++)
{
b = false;
if(*iter)
{
if((*iter)->get_parent())
{
for( unsigned int i = 0 ;
i<_selected_containers.size() ;
i++ )
{
if(_selected_containers[i]==(*iter)->get_parent())
{
b = true;
// break;
}
}
if(!b)
{
_selected_containers.push_back((*iter)->get_parent());
fprintf(stdout,"adding parent\n");
b = false;
}
}
}
}*/
}
void Command_window::show_error(){
switch(fork()){
case -1 :
return;
case 0 :
execvp("xpenguins",NULL);
default :
break;
}
}
......@@ -38,6 +38,7 @@ private :
// void set_option(QString s);
void set_container_names();
void set_container_names_rec(QTreeWidgetItem *current_node, const Container *current_container);
void show_error();
public :
void set_selected_nodes();
Command_window( QWidget *parent, Interface_graphic * i);
......
......@@ -222,15 +222,31 @@ public:
}
//Adding the parent containers if not added yet
else{
for(std::vector<const Container*>::iterator it = container->begin() ;
it != container->end();
it ++){
//TODO
if( *it && (*it)->get_parent())
if(!is_in_set((*it)->get_parent(),container))
container->push_back((*it)->get_parent());
}
}
bool ended = false;
vector<const Container *> store;
store.clear();
while (!ended){
ended = true;
for(std::vector<const Container*>::iterator it = container->begin() ;
it != container->end();
it ++){
if( *it && (*it)->get_parent())
if(!is_in_set((*it)->get_parent(),container)){
store.push_back((*it)->get_parent());
ended = false;
}
}//end for
//TODO Warning the same container should be added more than 1 time
for(std::vector<const Container*>::iterator it = store.begin() ;
it != store.end();
it ++){
if( !is_in_set(*it,container))
container->push_back(*it);
}
store.clear();
}//end while
}//end else
interval = trace->get_interval_constrained();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment