diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d58b7f6..0e6a5e7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -18,6 +18,9 @@ #include <QSvgRenderer> #include <QAbstractTextDocumentLayout> +#include <sys/types.h> +#include <sys/socket.h> + #include "mainwindow.h" #include "loginform.h" #include "settings.h" @@ -29,6 +32,7 @@ MainWindow::MainWindow(bool primary, int screen, const QRect &screenRect, QWidge QWidget(parent), m_ScreenRect(screenRect), m_Primary(primary), + m_LoginForm(NULL), m_messages(nullptr) { setObjectName(QString("MainWindow_%1").arg(screen)); @@ -254,4 +258,24 @@ void MainWindow::setBackground() this->setPalette(palette); } - +void MainWindow::showStandby() +{ + if (m_LoginForm != NULL) { + m_LoginForm->hide(); + } + QSvgWidget *img = new QSvgWidget(":/resources/gnome-face-tired.svg", this); + if (img->renderer()->isValid()) { + QSize sh = img->sizeHint().scaled(this->width() / 2, this->height() / 2, Qt::KeepAspectRatio); + img->setGeometry((this->width() - sh.width()) / 2, (this->height() - sh.height()) / 2, sh.width(), sh.height()); + img->show(); + } else { + qWarning() << "Shice!"; + } + QTimer::singleShot(8000, [this, img]() { + img->hide(); + img->deleteLater(); + if (this->m_LoginForm != NULL) { + m_LoginForm->show(); + } + }); +} |