mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
* changed init of main window to CRuntimeConfig, btw. makes 8 in https://dev.vatsim-germany.org/issues/199 redundant * coreMode in main window gone * mode for external / local audio
42 lines
899 B
C++
42 lines
899 B
C++
#include "infowindow.h"
|
|
#include "ui_infowindow.h"
|
|
#include <QTimer>
|
|
#include <QDesktopWidget>
|
|
|
|
|
|
/*
|
|
* Constructor
|
|
*/
|
|
CInfoWindow::CInfoWindow(QWidget *parent) :
|
|
QWizardPage(parent),
|
|
ui(new Ui::InfoWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
}
|
|
|
|
/*
|
|
* Destructor
|
|
*/
|
|
CInfoWindow::~CInfoWindow() { }
|
|
|
|
/*
|
|
* Info message for some time
|
|
*/
|
|
void CInfoWindow::setInfoMessage(const QString &message, int displayTimeMs)
|
|
{
|
|
// center
|
|
const QRect parent = this->parentWidget()->geometry();
|
|
const QRect myself = this->rect();
|
|
int dx = (parent.width() - myself.width()) / 2;
|
|
int dy = (parent.height() - myself.height()) / 2;
|
|
dy -= 80; // some offset, in order to display further on top
|
|
this->move(dx, dy);
|
|
|
|
// message and display
|
|
this->ui->te_Message->setText(message);
|
|
this->show();
|
|
|
|
// hide after some time
|
|
QTimer::singleShot(displayTimeMs, this, SLOT(hide()));
|
|
}
|