From b72d94e56d3f32417436efffcb6ef65411d47974 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 29 Jul 2018 20:58:07 -0700 Subject: [PATCH] Added a sweet "busy" window. --- tools/auto-tester/src/TestRailInterface.cpp | 9 ++- tools/auto-tester/src/TestRailInterface.h | 2 + tools/auto-tester/src/ui/BusyWindow.cpp | 18 ++++++ tools/auto-tester/src/ui/BusyWindow.h | 22 +++++++ tools/auto-tester/src/ui/BusyWindow.ui | 72 +++++++++++++++++++++ 5 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 tools/auto-tester/src/ui/BusyWindow.cpp create mode 100644 tools/auto-tester/src/ui/BusyWindow.h create mode 100644 tools/auto-tester/src/ui/BusyWindow.ui diff --git a/tools/auto-tester/src/TestRailInterface.cpp b/tools/auto-tester/src/TestRailInterface.cpp index 26c2b69896..e92ef59c77 100644 --- a/tools/auto-tester/src/TestRailInterface.cpp +++ b/tools/auto-tester/src/TestRailInterface.cpp @@ -20,6 +20,7 @@ #include TestRailInterface::TestRailInterface() { + _busyWindow.setModal(true); _testRailSelectorWindow.setModal(true); ////_testRailSelectorWindow.setURL("https://highfidelity.testrail.net"); @@ -287,12 +288,16 @@ void TestRailInterface::createAddTestCasesPythonScript(const QString& testDirect QProcess* process = new QProcess(); connect( process, &QProcess::started, - this, []() {QMessageBox::information(0, "Python process started", "TestRail is being updated"); } + this, [=]() { + _busyWindow.exec(); + } ); connect( process, static_cast(&QProcess::finished), - this, [](int exitCode, QProcess::ExitStatus exitStatus) {QMessageBox::information(0, "Python process finished", "TestRail tests have been added"); } + this, [=](int exitCode, QProcess::ExitStatus exitStatus) { + _busyWindow.hide(); + } ); process->start(command, parameters); diff --git a/tools/auto-tester/src/TestRailInterface.h b/tools/auto-tester/src/TestRailInterface.h index 2d7ca21f58..1908c1bbd3 100644 --- a/tools/auto-tester/src/TestRailInterface.h +++ b/tools/auto-tester/src/TestRailInterface.h @@ -11,6 +11,7 @@ #ifndef hifi_test_testrail_interface_h #define hifi_test_testrail_interface_h +#include "ui/BusyWindow.h" #include "ui/TestRailSelectorWindow.h" #include #include @@ -67,6 +68,7 @@ public: private: QDomDocument _document; + BusyWindow _busyWindow; TestRailSelectorWindow _testRailSelectorWindow; QString _url; diff --git a/tools/auto-tester/src/ui/BusyWindow.cpp b/tools/auto-tester/src/ui/BusyWindow.cpp new file mode 100644 index 0000000000..904dc47d75 --- /dev/null +++ b/tools/auto-tester/src/ui/BusyWindow.cpp @@ -0,0 +1,18 @@ +// +// BusyWindow.cpp +// +// Created by Nissim Hadar on 26 Jul 2017. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +#include "BusyWindow.h" + +#include + +#include + +BusyWindow::BusyWindow(QWidget *parent) { + setupUi(this); +} diff --git a/tools/auto-tester/src/ui/BusyWindow.h b/tools/auto-tester/src/ui/BusyWindow.h new file mode 100644 index 0000000000..62f2df7e04 --- /dev/null +++ b/tools/auto-tester/src/ui/BusyWindow.h @@ -0,0 +1,22 @@ +// +// BusyWindow.h +// +// Created by Nissim Hadar on 29 Jul 2017. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +#ifndef hifi_BusyWindow_h +#define hifi_BusyWindow_h + +#include "ui_BusyWindow.h" + +class BusyWindow : public QDialog, public Ui::BusyWindow { + Q_OBJECT + +public: + BusyWindow(QWidget* parent = Q_NULLPTR); +}; + +#endif \ No newline at end of file diff --git a/tools/auto-tester/src/ui/BusyWindow.ui b/tools/auto-tester/src/ui/BusyWindow.ui new file mode 100644 index 0000000000..f04a39418b --- /dev/null +++ b/tools/auto-tester/src/ui/BusyWindow.ui @@ -0,0 +1,72 @@ + + + BusyWindow + + + + 0 + 0 + 542 + 189 + + + + Updating TestRail - please wait + + + + + 30 + 850 + 500 + 28 + + + + + 12 + + + + similarity + + + + + + 40 + 40 + 481 + 101 + + + + 0 + + + 0 + + + + + + 50 + 60 + 431 + 61 + + + + + 20 + + + + Please wait for this window to close + + + + + + +