Logo Search packages:      
Sourcecode: qtoctave version File versions  Download package

void VariableList::line_ready ( QString  line  )  [slot]

Callback to line_ready signal from OctaveConnection.

Parameters:
line line from Octave.

Definition at line 42 of file variables_list.cpp.

{
      if( line.startsWith("~~whos:") )
      {
            QString s(line);
            s.remove(0,7);
            if( s.trimmed().isEmpty() ) return;
            
            if( s.startsWith("*** dynamically") )
            {
                  //text->append("<b>"+s+"</b>");
                  s.remove(0,4);
                  
                  last_root_item=dynamically_item;
                  last_root_item->setText(0,s.trimmed());
                  last_root_item->setToolTip(0,s.trimmed());
                  last_root_item->setIcon(0,QIcon( QString( ICON_PATH )+"/connect_established.png"  ) );
                  QFont font(tree->font());
                  font.setBold(true);
                  last_root_item->setFont(0,font);
            }
            else if( s.startsWith("*** local") )
            {
                  //text->append("<b>"+s+"</b>");
                  s.remove(0,4);
                  
                  last_root_item=local_item;
                  last_root_item->setText(0,s.trimmed());
                  last_root_item->setToolTip(0,s.trimmed());
                  last_root_item->setIcon(0,QIcon( QString( ICON_PATH )+"/personal.png"  ) );
                  QFont font(tree->font());
                  font.setBold(true);
                  last_root_item->setFont(0,font);
            }
            else if( s.startsWith("*** currently") )
            {
                  //text->append("<b>"+s+"</b>");
                  s.remove(0,4);
                  
                  last_root_item=currently_item;
                  last_root_item->setText(0,s.trimmed());
                  last_root_item->setToolTip(0,s.trimmed());
                  last_root_item->setIcon(0,QIcon( QString( ICON_PATH )+"/run.png"  ) );
                  QFont font(tree->font());
                  font.setBold(true);
                  last_root_item->setFont(0,font);
            }
            else if( s.startsWith("   ") )
            {
                  //text->append("<pre>"+s+"</pre>");
                  QTreeWidgetItem *item=new QTreeWidgetItem(last_root_item);
                  QStringList list = s.trimmed().split(QRegExp("\\s+"));
                  int i=0;
                  for(;i<list.size() && i<4;i++)
                  {
                        item->setText(i,list.at(i+1) );
                        item->setToolTip(i,list.at(i+1) );
                  }
                  s=list.at(i++);
                  for(;i<list.size();i++) s+=list.at(i);
                  item->setText(3,s);
                  item->setToolTip(3,s);
                  item->setText(4,list.at(0) );
                  item->setToolTip(4,list.at(0) );
                  //tree->resizeColumnToContents(1);
                  //tree->resizeColumnToContents(2);
                  for(i=1;i<5;i++) tree->resizeColumnToContents(i);
            }
            else if( s.startsWith("  ") )
            {
                  //text->append("<pre>"+s+"</pre>");
            }
            else
            {
                  //text->append(s);
                  QTreeWidgetItem *item=new QTreeWidgetItem(last_root_item);
                  item->setText(0,s.trimmed());
                  item->setToolTip(0,s.trimmed());
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index