diff options
Diffstat (limited to 'src/speedcheck.cpp')
-rw-r--r-- | src/speedcheck.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/speedcheck.cpp b/src/speedcheck.cpp index 9cde82b..f26bb1e 100644 --- a/src/speedcheck.cpp +++ b/src/speedcheck.cpp @@ -12,7 +12,7 @@ #include <QDebug> #include <QTimer> -SpeedCheck::SpeedCheck(QString fileName) +SpeedCheck::SpeedCheck(QString fileName, bool cml) : _ui(new Ui::MainWindow), _thread(NULL), _doQuit(false), @@ -29,6 +29,7 @@ SpeedCheck::SpeedCheck(QString fileName) connect(&_timer, SIGNAL(timeout()), this, SLOT(updateTimer())); qsrand((uint)QCoreApplication::applicationPid()); networkrefreshClicked(true); + if (cml) startClicked(true); } SpeedCheck::~SpeedCheck() @@ -38,7 +39,6 @@ SpeedCheck::~SpeedCheck() void SpeedCheck::logMessage(QString message) { - // qDebug() << message; _ui->statusBar->showMessage(message); } void SpeedCheck::selectClicked(bool) { @@ -66,7 +66,6 @@ void SpeedCheck::startClicked(bool) _timer.start(); _thread->start(); } - void SpeedCheck::quitClicked(bool) { if (_thread != NULL && _thread->isRunning()) { @@ -90,6 +89,7 @@ void SpeedCheck::testFinished() _ui->btnselect->setEnabled(true); _ui->comboBox->setEnabled(true); _ui->btnrefreshNetwork->setEnabled(true); + quitClicked(true); } void SpeedCheck::networkrefreshClicked(bool) { @@ -114,12 +114,17 @@ void SpeedCheck::updateNetworkInfos(int) { speed.remove(speed.length() - 1, 1); if (!wireless.exists()) { if (speed.toInt() < 1000) { - QMessageBox::warning(NULL, "Warning","Link Speed Slow"); _ui->networkSpeed->setStyleSheet("QLabel {color:orange;}"); _ui->networkSpeed->setToolTip("Networkspeed slow!"); } + else { + _ui->networkSpeed->setStyleSheet("QLabel {color:black;}"); + _ui->networkSpeed->setToolTip(""); + } _ui->connType->setText("wired"); _ui->networkSpeed->setEnabled(true); + _ui->link->setEnabled(true); + _ui->link->setText("Speed: "); _ui->networkSpeed->setText(speed + " MB/s"); } else { @@ -131,6 +136,6 @@ void SpeedCheck::updateNetworkInfos(int) { } void SpeedCheck::updateTimer() { - _ui->picCpu->readNextValue(); + _ui->picCpu->readNextValue(); _ui->picSpeed->readNextValue(); } |