summaryrefslogtreecommitdiffstats
path: root/src/speedcheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/speedcheck.cpp')
-rw-r--r--src/speedcheck.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/speedcheck.cpp b/src/speedcheck.cpp
index b4dd718..882eeab 100644
--- a/src/speedcheck.cpp
+++ b/src/speedcheck.cpp
@@ -6,6 +6,7 @@
#include <QCoreApplication>
#include <QMessageBox>
+#include <QNetworkInterface>
#include <QFile>
#include <QDebug>
#include <QTimer>
@@ -17,6 +18,13 @@ SpeedCheck::SpeedCheck(QString fileName)
_fileName(fileName)
{
_ui->setupUi(this);
+ QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
+ foreach (QNetworkInterface iface, interfaces) {
+ if ((iface.flags().testFlag(QNetworkInterface::IsUp)) && !iface.flags().testFlag(QNetworkInterface::IsLoopBack)) {
+ _ui->comboBox->addItem(iface.name());
+ }
+ }
+
connect(_ui->btnStart, SIGNAL(clicked(bool)), this, SLOT(startClicked(bool)));
connect(_ui->btnQuit, SIGNAL(clicked(bool)), this, SLOT(quitClicked(bool)));
_timer.setInterval(200);
@@ -43,7 +51,7 @@ void SpeedCheck::startClicked(bool)
return;
}
_ui->picCpu->setDataSource(new CpuLoad());
- _ui->picSpeed->setDataSource(new NetworkSpeed());
+ _ui->picSpeed->setDataSource(new NetworkSpeed(_ui->comboBox->currentText()));
_ui->btnStart->setDisabled(true);
delete _thread;
_thread = new CopyThread(file, this);