Changeset 223

Show
Ignore:
Timestamp:
02/02/06 03:33:35 (3 years ago)
Author:
hipplej
Message:

A little more progress on the graph. All that's left is drawing the lines.

Location:
trunk/src/gui/bwgraph
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/bwgraph/bwgraph.cpp

    r216 r223  
    2727#define DATETIME_FMT  "MMM dd hh:mm:ss:zzz" 
    2828 
    29 /** Default constructor **/ 
     29/** Default constructor */ 
    3030BandwidthGraph::BandwidthGraph(TorControl *torControl, QWidget *parent, Qt::WFlags f) 
    3131: QDialog(parent, f) 
    3232{ 
    33   /** Invoke Qt Designer generated QObject setup routine */ 
     33  /* Invoke Qt Designer generated QObject setup routine */ 
    3434  ui.setupUi(this); 
    3535 
    36   /** Create Bandwidth Graph related QObjects */ 
     36  /* Create Bandwidth Graph related QObjects */ 
    3737  _settings = new VidaliaSettings(); 
    38   _timer = new QTimer(this); 
    39    
    40   /** Bind events to actions */ 
     38   
     39  /* Bind events to actions */ 
    4140  createActions(); 
    4241 
    43   /** Ask Tor to notify us about bandwidth updates */ 
     42  /* Ask Tor to notify us about bandwidth updates */ 
    4443  _torControl = torControl; 
    4544  _torControl->setEvent(TorEvents::Bandwidth, this, true); 
    46    
    47   /** Start the update timer **/ 
    48   _timer->start(REFRESH_RATE); 
    49  
    50   /** Initialize Sent/Receive data counters */ 
     45 
     46  /* Initialize Sent/Receive data counters */ 
    5147  reset(); 
    52  
    53   /** Hide Bandwidth Graph Settings frame */ 
     48   
     49  /* Hide Bandwidth Graph Settings frame */ 
    5450  showSettingsFrame(false); 
    5551 
    56   /** Turn off opacity group on unsupported platforms */ 
     52  /* Turn off opacity group on unsupported platforms */ 
    5753#if defined(Q_WS_WIN) 
    5854  if(!(QSysInfo::WV_2000 <= QSysInfo::WindowsVersion <= QSysInfo::WV_2003)) { 
     
    6662} 
    6763 
    68 /** Default destructor **/ 
     64/** Default destructor */ 
    6965BandwidthGraph::~BandwidthGraph() 
    7066{ 
     
    7268    delete _settings; 
    7369  } 
    74   /* Unregister this object for bandwidth update events */ 
    75   _torControl->setEvent(TorEvents::Bandwidth, this, false); 
    7670} 
    7771 
     
    7973 Custom event handler. Checks if the event is a bandwidth update event. If it 
    8074 is, it will add the data point to the history and updates the graph. 
    81 **/ 
     75*/ 
    8276void 
    8377BandwidthGraph::customEvent(QEvent *event) 
     
    9185/** 
    9286 Binds events to actions 
    93 **/ 
     87*/ 
    9488void 
    9589BandwidthGraph::createActions() 
    9690{ 
    97 //  connect(_timer, SIGNAL(timeout()), 
    98 //      this, SLOT(updateGraph())); 
    99    
    10091  connect(ui.btnToggleSettings, SIGNAL(toggled(bool)), 
    10192      this, SLOT(showSettingsFrame(bool))); 
     
    115106 
    116107/** 
    117  Fetches new statistics and plots them on the graph 
    118  and adds them to the data counters 
    119 **/ 
     108 Adds new data to the graph and the counters 
     109*/ 
    120110void 
    121111BandwidthGraph::updateGraph(quint64 bytesRead, quint64 bytesWritten) 
    122112{ 
    123   // add data points to graph 
    124   // add data value to counters 
    125  
    126   /* Obviously this isn't what you're going to do with the data, but this lets 
    127    * you see that it's working in the meantime. */ 
    128   ui.lblSent->setText(QString::number(bytesRead)); 
    129   ui.lblReceived->setText(QString::number(bytesWritten)); 
     113  /* Send the data in kilobits */ 
     114  ui.frmGraph->addPoints(bytesRead/1000.0, bytesWritten/1000.0); 
     115  ui.lblSent->setText(addDataToStr(bytesWritten, _totalSent)); 
     116  ui.lblReceived->setText(addDataToStr(bytesRead, _totalReceived)); 
     117} 
     118 
     119/** 
     120 Adds data to the total counters and returns a correctly 
     121 formatted string with the correct size suffix 
     122*/ 
     123QString 
     124BandwidthGraph::addDataToStr(quint64 data, quint64 &total) 
     125{ 
     126  total += data; 
     127 
     128  /* Determine the correct size suffix */ 
     129  if (total < 1000) { 
     130    /* Use bytes suffix */ 
     131    return tr("%1 bytes").arg(total, 0); 
     132  } else if (total < 1000000) { 
     133    /* Use KB suffix */ 
     134    return tr("%1 KB").arg(total/1000.0, 0, 'f', 2); 
     135  } else if (total < 1000000000) { 
     136    /* Use MB suffix */ 
     137    return tr("%1 MB").arg(total/1000000.0, 0, 'f', 2); 
     138  } else { 
     139    /* Use GB suffix */ 
     140    return tr("%1 MB").arg(total/1000000000.0, 0, 'f', 2); 
     141  } 
    130142} 
    131143 
    132144/** 
    133145 Loads the saved Bandwidth Graph settings 
    134 **/ 
     146*/ 
    135147void 
    136148BandwidthGraph::loadSettings() 
    137149{ 
    138   /** Set window opacity slider widget **/ 
     150  /* Set window opacity slider widget */ 
    139151  ui.sldrOpacity->setValue(_settings->getBWGraphOpacity()); 
    140152 
    141   /** Set the line filter checkboxes accordingly **/ 
     153  /* Set the line filter checkboxes accordingly */ 
    142154  uint filter = _settings->getBWGraphFilter(); 
    143155  ui.chkReceiveRate->setChecked(filter & BWGRAPH_REC); 
    144156  ui.chkSendRate->setChecked(filter & BWGRAPH_SEND); 
    145157 
    146   /** Set graph frame settings **/ 
     158  /* Set graph frame settings */ 
    147159  ui.frmGraph->setShowCounters(ui.chkReceiveRate->isChecked(), 
    148160                               ui.chkSendRate->isChecked()); 
     
    151163/**  
    152164 Resets the Sent/Received data counters and the log start time 
    153 **/ 
     165*/ 
    154166void 
    155167BandwidthGraph::reset() 
    156168{ 
    157   /** Reset the data counter labels **/ 
    158   ui.lblSent->setText(tr("0.0 MB")); 
    159   ui.lblReceived->setText(tr("0.0 MB")); 
    160  
    161   /** Reset the log start timer **/ 
     169  /* Reset the data total counters */ 
     170  _totalSent = 0; 
     171  _totalReceived = 0; 
     172   
     173  /* Reset the data counter labels */ 
     174  ui.lblSent->setText(tr("0 bytes")); 
     175  ui.lblReceived->setText(tr("0 bytes")); 
     176 
     177  /* Reset the data counter clock */ 
    162178  ui.lblStartTime->setText(QDateTime::currentDateTime().toString(DATETIME_FMT)); 
    163179 
    164   /** Reset the graph **/ 
     180  /* Reset the graph */ 
    165181  ui.frmGraph->resetGraph(); 
    166182} 
     
    168184/** 
    169185 Saves the Bandwidth Graph settings and adjusts the graph if necessary 
    170 **/ 
     186*/ 
    171187void 
    172188BandwidthGraph::saveChanges() 
    173189{ 
    174   /** Hide the settings frame and reset toggle button **/ 
     190  /* Hide the settings frame and reset toggle button */ 
    175191  showSettingsFrame(false); 
    176192   
    177   /** Save the opacity **/ 
     193  /* Save the opacity */ 
    178194  _settings->setBWGraphOpacity(ui.sldrOpacity->value()); 
    179195 
    180   /** Save the line filter values **/ 
     196  /* Save the line filter values */ 
    181197  _settings->setBWGraphFilter(BWGRAPH_REC, ui.chkReceiveRate->isChecked()); 
    182198  _settings->setBWGraphFilter(BWGRAPH_SEND, ui.chkSendRate->isChecked()); 
    183199 
    184   /** Update the graph frame settings **/ 
     200  /* Update the graph frame settings */ 
    185201  ui.frmGraph->setShowCounters(ui.chkReceiveRate->isChecked(), 
    186202                               ui.chkSendRate->isChecked()); 
     
    189205/**  
    190206 Simply restores the previously saved settings 
    191 **/ 
     207*/ 
    192208void  
    193209BandwidthGraph::cancelChanges() 
     
    202218/**  
    203219 Toggles the Settings pane on and off, changes toggle button text 
    204 **/ 
     220*/ 
    205221void 
    206222BandwidthGraph::showSettingsFrame(bool show) 
     
    219235/** 
    220236 Sets the opacity of the Bandwidth Graph window 
    221 **/ 
     237*/ 
    222238void 
    223239BandwidthGraph::setOpacity(int value) 
     
    225241  qreal newValue = value / 100.0; 
    226242 
    227   /** Opacity only supported by Mac and Win32 **/ 
     243  /* Opacity only supported by Mac and Win32 */ 
    228244  #if defined(Q_WS_MAC) 
    229245    this->setWindowOpacity(newValue); 
     
    239255/**  
    240256 Overloads the default show() slot so we can set opacity 
    241 **/ 
     257*/ 
    242258void 
    243259BandwidthGraph::show() 
  • trunk/src/gui/bwgraph/bwgraph.h

    r216 r223  
    2626 
    2727#include <QDateTime> 
    28 #include <QTimer> 
    2928#include <QEvent> 
    3029 
     
    4342 
    4443public: 
    45   /** Default constructor **/ 
     44  /** Default constructor */ 
    4645  BandwidthGraph(TorControl *torControl, QWidget *parent = 0, Qt::WFlags f = 0); 
    47   /** Default destructor **/ 
     46  /** Default destructor */ 
    4847  ~BandwidthGraph(); 
    4948 
     
    5756   
    5857private slots: 
    59   /** Adds new data to the graph and counters **/ 
     58  /** Adds new data to the graph and counters */ 
    6059  void updateGraph(quint64 bytesRead, quint64 bytesWritten); 
    6160  /** Called when settings button is toggled */ 
     
    7372  /** Create and bind actions to events **/ 
    7473  void createActions(); 
    75   /** Loads the saved Bandwidth Graph settings **/ 
     74  /** Loads the saved Bandwidth Graph settings */ 
    7675  void loadSettings(); 
     76  /** Adds the new data values to the total and returns a formatted string */ 
     77  QString addDataToStr(quint64 data, quint64 &total); 
    7778  
    7879  /** A TorControl object used to talk to Tor. */ 
    7980  TorControl* _torControl; 
    80   /** A QTimer object that handles calling the draw function **/ 
    81   QTimer* _timer; 
    82   /** A VidaliaSettings object that handles getting/saving settings **/ 
     81  /** A VidaliaSettings object that handles getting/saving settings */ 
    8382  VidaliaSettings* _settings; 
     83  /** Counters that keep track of the total data sent/received */ 
     84  quint64 _totalSent; 
     85  quint64 _totalReceived; 
    8486   
    85   /** Qt Designer generated object **/ 
     87  /** Qt Designer generated object */ 
    8688  Ui::BandwidthGraph ui; 
    8789}; 
  • trunk/src/gui/bwgraph/bwgraph.ui

    r213 r223  
    99    <x>0</x> 
    1010    <y>0</y> 
    11     <width>357</width> 
    12     <height>304</height> 
     11    <width>359</width> 
     12    <height>282</height> 
    1313   </rect> 
    1414  </property> 
     
    404404     </property> 
    405405     <item> 
    406       <layout class="QHBoxLayout" > 
    407        <property name="margin" > 
    408         <number>0</number> 
    409        </property> 
    410        <property name="spacing" > 
    411         <number>6</number> 
    412        </property> 
    413        <item> 
    414         <layout class="QHBoxLayout" > 
    415          <property name="margin" > 
    416           <number>0</number> 
    417          </property> 
    418          <property name="spacing" > 
    419           <number>0</number> 
    420          </property> 
    421          <item> 
    422           <widget class="QLabel" name="label_3" > 
    423            <property name="maximumSize" > 
    424             <size> 
    425              <width>16777215</width> 
    426              <height>27</height> 
    427             </size> 
    428            </property> 
    429            <property name="font" > 
    430             <font> 
    431              <family>Arial</family> 
    432              <pointsize>10</pointsize> 
    433              <weight>50</weight> 
    434              <italic>false</italic> 
    435              <bold>false</bold> 
    436              <underline>false</underline> 
    437              <strikeout>false</strikeout> 
    438             </font> 
    439            </property> 
    440            <property name="contextMenuPolicy" > 
    441             <enum>Qt::NoContextMenu</enum> 
    442            </property> 
    443            <property name="text" > 
    444             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;">Sent:&lt;/p>&lt;/body>&lt;/html></string> 
    445            </property> 
    446           </widget> 
    447          </item> 
    448          <item> 
    449           <widget class="QLabel" name="lblSent" > 
    450            <property name="maximumSize" > 
    451             <size> 
    452              <width>16777215</width> 
    453              <height>27</height> 
    454             </size> 
    455            </property> 
    456            <property name="font" > 
    457             <font> 
    458              <family>Arial</family> 
    459              <pointsize>10</pointsize> 
    460              <weight>50</weight> 
    461              <italic>false</italic> 
    462              <bold>false</bold> 
    463              <underline>false</underline> 
    464              <strikeout>false</strikeout> 
    465             </font> 
    466            </property> 
    467            <property name="contextMenuPolicy" > 
    468             <enum>Qt::NoContextMenu</enum> 
    469            </property> 
    470            <property name="frameShape" > 
    471             <enum>QFrame::Panel</enum> 
    472            </property> 
    473            <property name="frameShadow" > 
    474             <enum>QFrame::Sunken</enum> 
    475            </property> 
    476            <property name="text" > 
    477             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;">679.07 MB&lt;/p>&lt;/body>&lt;/html></string> 
    478            </property> 
    479            <property name="scaledContents" > 
    480             <bool>false</bool> 
    481            </property> 
    482           </widget> 
    483          </item> 
    484         </layout> 
    485        </item> 
    486        <item> 
    487         <layout class="QHBoxLayout" > 
    488          <property name="margin" > 
    489           <number>0</number> 
    490          </property> 
    491          <property name="spacing" > 
    492           <number>0</number> 
    493          </property> 
    494          <item> 
    495           <widget class="QLabel" name="label_2" > 
    496            <property name="maximumSize" > 
    497             <size> 
    498              <width>16777215</width> 
    499              <height>27</height> 
    500             </size> 
    501            </property> 
    502            <property name="font" > 
    503             <font> 
    504              <family>Arial</family> 
    505              <pointsize>10</pointsize> 
    506              <weight>50</weight> 
    507              <italic>false</italic> 
    508              <bold>false</bold> 
    509              <underline>false</underline> 
    510              <strikeout>false</strikeout> 
    511             </font> 
    512            </property> 
    513            <property name="contextMenuPolicy" > 
    514             <enum>Qt::NoContextMenu</enum> 
    515            </property> 
    516            <property name="text" > 
    517             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Received:&lt;/p>&lt;/body>&lt;/html></string> 
    518            </property> 
    519           </widget> 
    520          </item> 
    521          <item> 
    522           <widget class="QLabel" name="lblReceived" > 
    523            <property name="maximumSize" > 
    524             <size> 
    525              <width>16777215</width> 
    526              <height>27</height> 
    527             </size> 
    528            </property> 
    529            <property name="font" > 
    530             <font> 
    531              <family>Arial</family> 
    532              <pointsize>10</pointsize> 
    533              <weight>50</weight> 
    534              <italic>false</italic> 
    535              <bold>false</bold> 
    536              <underline>false</underline> 
    537              <strikeout>false</strikeout> 
    538             </font> 
    539            </property> 
    540            <property name="contextMenuPolicy" > 
    541             <enum>Qt::NoContextMenu</enum> 
    542            </property> 
    543            <property name="toolTip" > 
    544             <string/> 
    545            </property> 
    546            <property name="frameShape" > 
    547             <enum>QFrame::Panel</enum> 
    548            </property> 
    549            <property name="frameShadow" > 
    550             <enum>QFrame::Sunken</enum> 
    551            </property> 
    552            <property name="text" > 
    553             <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">435.38 MB&lt;/p>&lt;/body>&lt;/html></string> 
    554            </property> 
    555            <property name="scaledContents" > 
    556             <bool>false</bool> 
    557            </property> 
    558           </widget> 
    559          </item> 
    560         </layout> 
    561        </item> 
    562       </layout> 
     406      <widget class="QLabel" name="label_3" > 
     407       <property name="maximumSize" > 
     408        <size> 
     409         <width>16777215</width> 
     410         <height>27</height> 
     411        </size> 
     412       </property> 
     413       <property name="font" > 
     414        <font> 
     415         <family>Arial</family> 
     416         <pointsize>10</pointsize> 
     417         <weight>50</weight> 
     418         <italic>false</italic> 
     419         <bold>false</bold> 
     420         <underline>false</underline> 
     421         <strikeout>false</strikeout> 
     422        </font> 
     423       </property> 
     424       <property name="contextMenuPolicy" > 
     425        <enum>Qt::NoContextMenu</enum> 
     426       </property> 
     427       <property name="text" > 
     428        <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;">Sent:&lt;/p>&lt;/body>&lt;/html></string> 
     429       </property> 
     430      </widget> 
     431     </item> 
     432     <item> 
     433      <widget class="QLabel" name="lblSent" > 
     434       <property name="maximumSize" > 
     435        <size> 
     436         <width>16777215</width> 
     437         <height>18</height> 
     438        </size> 
     439       </property> 
     440       <property name="font" > 
     441        <font> 
     442         <family>Arial</family> 
     443         <pointsize>10</pointsize> 
     444         <weight>50</weight> 
     445         <italic>false</italic> 
     446         <bold>false</bold> 
     447         <underline>false</underline> 
     448         <strikeout>false</strikeout> 
     449        </font> 
     450       </property> 
     451       <property name="contextMenuPolicy" > 
     452        <enum>Qt::NoContextMenu</enum> 
     453       </property> 
     454       <property name="frameShape" > 
     455        <enum>QFrame::Panel</enum> 
     456       </property> 
     457       <property name="frameShadow" > 
     458        <enum>QFrame::Sunken</enum> 
     459       </property> 
     460       <property name="text" > 
     461        <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;">679.07 MB&lt;/p>&lt;/body>&lt;/html></string> 
     462       </property> 
     463       <property name="scaledContents" > 
     464        <bool>false</bool> 
     465       </property> 
     466      </widget> 
     467     </item> 
     468     <item> 
     469      <widget class="QLabel" name="label_2" > 
     470       <property name="maximumSize" > 
     471        <size> 
     472         <width>16777215</width> 
     473         <height>27</height> 
     474        </size> 
     475       </property> 
     476       <property name="font" > 
     477        <font> 
     478         <family>Arial</family> 
     479         <pointsize>10</pointsize> 
     480         <weight>50</weight> 
     481         <italic>false</italic> 
     482         <bold>false</bold> 
     483         <underline>false</underline> 
     484         <strikeout>false</strikeout> 
     485        </font> 
     486       </property> 
     487       <property name="contextMenuPolicy" > 
     488        <enum>Qt::NoContextMenu</enum> 
     489       </property> 
     490       <property name="text" > 
     491        <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Received:&lt;/p>&lt;/body>&lt;/html></string> 
     492       </property> 
     493      </widget> 
     494     </item> 
     495     <item> 
     496      <widget class="QLabel" name="lblReceived" > 
     497       <property name="maximumSize" > 
     498        <size> 
     499         <width>16777215</width> 
     500         <height>18</height> 
     501        </size> 
     502       </property> 
     503       <property name="font" > 
     504        <font> 
     505         <family>Arial</family> 
     506         <pointsize>10</pointsize> 
     507         <weight>50</weight> 
     508         <italic>false</italic> 
     509         <bold>false</bold> 
     510         <underline>false</underline> 
     511         <strikeout>false</strikeout> 
     512        </font> 
     513       </property> 
     514       <property name="contextMenuPolicy" > 
     515        <enum>Qt::NoContextMenu</enum> 
     516       </property> 
     517       <property name="toolTip" > 
     518        <string/> 
     519       </property> 
     520       <property name="frameShape" > 
     521        <enum>QFrame::Panel</enum> 
     522       </property> 
     523       <property name="frameShadow" > 
     524        <enum>QFrame::Sunken</enum> 
     525       </property> 
     526       <property name="text" > 
     527        <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:Arial; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">435.38 MB&lt;/p>&lt;/body>&lt;/html></string> 
     528       </property> 
     529       <property name="scaledContents" > 
     530        <bool>false</bool> 
     531       </property> 
     532      </widget> 
    563533     </item> 
    564534     <item> 
     
    569539       <property name="sizeHint" > 
    570540        <size> 
    571          <width>82</width> 
    572          <height>20</height> 
     541         <width>54</width> 
     542         <height>31</height> 
    573543        </size> 
    574544       </property> 
     
    588558      <font> 
    589559       <family>Arial</family> 
    590        <pointsize>8</pointsize> 
     560       <pointsize>10</pointsize> 
    591561       <weight>50</weight> 
    592562       <italic>false</italic> 
  • trunk/src/gui/bwgraph/graphframe.cpp

    r214 r223  
    2929{ 
    3030  /* Create Graph Frame related objects */ 
    31   _recvData = new QList<quint64>(); 
    32   _sendData = new QList<quint64>(); 
     31  _recvData = new QList<qreal>(); 
     32  _sendData = new QList<qreal>(); 
    3333   
    3434  /* Initialize graph values */ 
     
    6060  QDesktopWidget *desktop = QApplication::desktop(); 
    6161  int width = desktop->width(); 
    62   delete desktop; 
    6362  return width; 
    6463} 
     
    6867**/ 
    6968void 
    70 GraphFrame::addPoints(quint64 send, quint64 recv) 
     69GraphFrame::addPoints(qreal send, qreal recv) 
    7170{ 
    7271  /* If maximum number of points plotted, remove oldest */ 
     
    120119   
    121120  /* Fill in the background */ 
    122   painter->fillRect(this->frameRect(), QBrush(Qt::white)); 
     121  painter->fillRect(this->frameRect(), QBrush(Qt::black)); 
    123122  painter->drawRect(this->frameRect()); 
    124123   
     
    163162GraphFrame::paintRates(QPainter* painter) 
    164163{ 
     164  int rateX = SCALE_WIDTH + FONT_SIZE