Skip to content
Snippets Groups Projects
Select Git revision
  • 7a8d39f1388ad06c10a64b11ebcd93512a68b9cb
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/windowsReleaseTest
  • release/releaseTest
  • release/releaseWindowsTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 4.0.0
  • 2.2.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
31 results

test_network.py

Blame
    • Eloi Bail's avatar
      730b9202
      tool: add a script to simulate network bandwith · 730b9202
      Eloi Bail authored
      add a python script to simulate network bandwith using netem tbf to
      throttle the connection.
      The bandwith used in upload is also monitored. The amount of packets
      dropped by netem is also monitored
      
      Change-Id: I895a81f51946914071b7fafa7a102931fa2ec7d6
      Tuleap: #1049
      730b9202
      History
      tool: add a script to simulate network bandwith
      Eloi Bail authored
      add a python script to simulate network bandwith using netem tbf to
      throttle the connection.
      The bandwith used in upload is also monitored. The amount of packets
      dropped by netem is also monitored
      
      Change-Id: I895a81f51946914071b7fafa7a102931fa2ec7d6
      Tuleap: #1049
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    HistoryDock.cpp 10.73 KiB
    #include "HistoryDock.h"
    
    #include <QtGui/QVBoxLayout>
    #include <kicon.h>
    #include <klineedit.h>
    #include <QtGui/QTreeWidget>
    #include <QtGui/QComboBox>
    #include <QtGui/QPushButton>
    #include <QtGui/QLabel>
    #include <kdatewidget.h>
    #include <QHeaderView>
    #include <QtGui/QCheckBox>
    #include <QDate>
    #include "SFLPhone.h"
    #include "widgets/HistoryTreeItem.h"
    #include "conf/ConfigurationSkeleton.h"
    #include "AkonadiBackend.h"
    #include "lib/sflphone_const.h"
    
    class QNumericTreeWidgetItem : public QTreeWidgetItem {
       public:
          QNumericTreeWidgetItem(QTreeWidget* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
          QNumericTreeWidgetItem(QTreeWidgetItem* parent):QTreeWidgetItem(parent),widget(0),weight(-1){}
          HistoryTreeItem* widget;
          int weight;
       private:
          bool operator<(const QTreeWidgetItem & other) const {
             int column = treeWidget()->sortColumn();
             if (dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)) {
                if (widget !=0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget != 0)
                   return widget->getTimeStamp() < dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->widget->getTimeStamp();
                else if (weight > 0 && dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight > 0)
                   return weight > dynamic_cast<QNumericTreeWidgetItem*>((QTreeWidgetItem*)&other)->weight;
             }
             return text(column) < other.text(column);
          }
    };
    
    HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent)
    {
       setMinimumSize(250,0);
       setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
       m_pFilterLE   = new KLineEdit();
       m_pItemView   = new HistoryTree(this);
       m_pSortByCBB  = new QComboBox();
       m_pSortByL    = new QLabel("Sort by:");
       m_pFromL      = new QLabel("From:");
       m_pToL        = new QLabel("To:");
       m_pFromDW     = new KDateWidget();
       m_pToDW       = new KDateWidget();
       m_pAllTimeCB  = new QCheckBox("Display all");
       m_pLinkPB     = new QPushButton(this);
       
       m_pAllTimeCB->setChecked(ConfigurationSkeleton::displayDataRange());
    
       m_pSortByL->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred);
       m_pSortByCBB->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
       m_pLinkPB->setMaximumSize(20,9999999);
       m_pLinkPB->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
       m_pLinkPB->setCheckable(true);
       
       m_pItemView->headerItem()->setText(0,"Calls"          );
       m_pItemView->header    ()->setClickable(true          );
       m_pItemView->header    ()->setSortIndicatorShown(true );
       m_pItemView->setAlternatingRowColors(true             );
       m_pItemView->setAcceptDrops( true                     );
       m_pItemView->setDragEnabled( true                     );
    
       m_pFilterLE->setPlaceholderText("Filter");
       m_pFilterLE->setClearButtonShown(true);