#include <routerdescriptorview.h>
Public Slots | |
void | display (RouterDescriptor rd) |
void | display (QList< RouterDescriptor > rdlist) |
void | copySelectedText () |
Public Member Functions | |
RouterDescriptorView (QWidget *parent=0) | |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
Private Member Functions | |
quint64 | adjustUptime (quint64 uptime, QDateTime published) |
QString | formatPublished (QDateTime date) |
QString | formatUptime (quint64 seconds) |
QString | formatBandwidth (quint64 bandwidth) |
Definition at line 28 of file routerdescriptorview.h.
RouterDescriptorView::RouterDescriptorView | ( | QWidget * | parent = 0 |
) |
Default constructor.
Definition at line 32 of file routerdescriptorview.cpp.
References copySelectedText().
void RouterDescriptorView::display | ( | RouterDescriptor | rd | ) | [slot] |
Shows the given router descriptor.
Displays the given router descriptor.
Definition at line 173 of file routerdescriptorview.cpp.
void RouterDescriptorView::display | ( | QList< RouterDescriptor > | rdlist | ) | [slot] |
Shows all router descriptors in the given list.
Displays all router descriptors in the given list.
Definition at line 123 of file routerdescriptorview.cpp.
References adjustUptime(), b(), formatBandwidth(), formatPublished(), formatUptime(), i(), RouterDescriptor::ip(), RouterDescriptor::location(), RouterDescriptor::name(), RouterDescriptor::observedBandwidth(), RouterDescriptor::offline(), p(), RouterDescriptor::platform(), RouterDescriptor::published(), RouterDescriptor::status(), tcol(), trow(), and RouterDescriptor::uptime().
void RouterDescriptorView::copySelectedText | ( | ) | [slot] |
Copies any selected text to the clipboard.
Definition at line 62 of file routerdescriptorview.cpp.
References vApp.
Referenced by contextMenuEvent(), and RouterDescriptorView().
void RouterDescriptorView::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected, virtual] |
Displays a context menu for the user when they right-click on the widget.
Definition at line 44 of file routerdescriptorview.cpp.
References copySelectedText(), and IMG_COPY.
quint64 RouterDescriptorView::adjustUptime | ( | quint64 | uptime, | |
QDateTime | published | |||
) | [private] |
Adjusts the displayed uptime to include time since the router's descriptor was last published.
Adjusts the displayed uptime to include time since the router's descriptor was last published.
Definition at line 79 of file routerdescriptorview.cpp.
Referenced by display().
QString RouterDescriptorView::formatPublished | ( | QDateTime | date | ) | [private] |
Formats the descriptor's published date.
Format the date the descriptor was published.
Definition at line 71 of file routerdescriptorview.cpp.
References DATE_FORMAT.
Referenced by display().
QString RouterDescriptorView::formatUptime | ( | quint64 | seconds | ) | [private] |
Formats the router's uptime.
Format the uptime for this router in a readable format.
Definition at line 91 of file routerdescriptorview.cpp.
Referenced by display().
QString RouterDescriptorView::formatBandwidth | ( | quint64 | bandwidth | ) | [private] |
Formats the observed bandwidth into KB/s.
Format the bandwidth into KB/s.
Definition at line 116 of file routerdescriptorview.cpp.
Referenced by display().