Changeset 399 in flair-src for trunk/tools/FlairGCS/src/Manager.cpp


Ignore:
Timestamp:
Mar 16, 2021, 5:50:25 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

change color of status bar in gcs if high bandwidth usage is detected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/Manager.cpp

    r269 r399  
    7373  status=new QStatusBar();
    7474  status->setSizeGripEnabled(false);
    75   button_layout->addWidget(status, 1,0);
     75  managerLayout->addWidget(status);
    7676
    7777  UDT::startup();
     
    100100  icon_red = QIcon(":red.png");
    101101  icon_orange = QIcon(":orange.png");
    102  
    103102 
    104103  QTimer *timer = new QTimer(this);
     
    149148 
    150149  ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name);
    151   connect(udtSocket, SIGNAL(UDTStats(QString,bool)), newLayout, SIGNAL(UDTStats(QString,bool)));//connection in 2 steps to get udtsocket as sender
    152   connect(newLayout, SIGNAL(UDTStats(QString,bool)), this, SLOT(printUDTStats(QString,bool)));
     150  connect(udtSocket, SIGNAL(UDTStats(QString,QString,bool)), newLayout, SIGNAL(UDTStats(QString,QString,bool)));//connection in 2 steps to get udtsocket as sender
     151  connect(newLayout, SIGNAL(UDTStats(QString,QString,bool)), this, SLOT(printUDTStats(QString,QString,bool)));
    153152  connect(udtSocket, SIGNAL(dataReady(char *, int)), newLayout,SLOT(receive(char *, int)),Qt::BlockingQueuedConnection);
    154153  connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *)));
     
    246245}
    247246
    248 void Manager::printUDTStats(QString stats,bool loosingPackets) {
     247void Manager::printUDTStats(QString stats,QString stylesheet,bool loosingPackets) {
    249248  int index = -1;
    250249  for(int i=0;i<connections.count();i++) {
     
    264263 
    265264  if (tabBar->count() == 0) {
     265    status->setStyleSheet(stylesheet);
    266266    status->showMessage(stats);
    267267  } else if (index==tabBar->currentIndex()) {
     268    status->setStyleSheet(stylesheet);
    268269    status->showMessage(QString("%1: %2").arg(tabBar->tabText(index)).arg(stats));
    269270  }
Note: See TracChangeset for help on using the changeset viewer.