Added a sweet "busy" window.

This commit is contained in:
NissimHadar 2018-07-29 20:58:07 -07:00
parent 9247e8dc16
commit b72d94e56d
5 changed files with 121 additions and 2 deletions

View file

@ -20,6 +20,7 @@
#include <QTextStream>
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<void(QProcess::*)(int, QProcess::ExitStatus)>(&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);

View file

@ -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 <QDirIterator>
#include <QtXml/QDomDocument>
@ -67,6 +68,7 @@ public:
private:
QDomDocument _document;
BusyWindow _busyWindow;
TestRailSelectorWindow _testRailSelectorWindow;
QString _url;

View file

@ -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 <QtCore/QFileInfo>
#include <cmath>
BusyWindow::BusyWindow(QWidget *parent) {
setupUi(this);
}

View file

@ -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

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BusyWindow</class>
<widget class="QDialog" name="BusyWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>542</width>
<height>189</height>
</rect>
</property>
<property name="windowTitle">
<string>Updating TestRail - please wait</string>
</property>
<widget class="QLabel" name="errorLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>850</y>
<width>500</width>
<height>28</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>similarity</string>
</property>
</widget>
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>40</x>
<y>40</y>
<width>481</width>
<height>101</height>
</rect>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>50</x>
<y>60</y>
<width>431</width>
<height>61</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Please wait for this window to close</string>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>