From 602bb54261bf64664c65804736e748a1244257fe Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 12 Dec 2010 17:16:59 +0100 Subject: [PATCH] Center bat run window on screen --- bacula/src/qt-console/run/run.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index 3c98acb674..9510f56804 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -81,10 +81,16 @@ runPage::runPage(const QString &defJob, const QString &level, void runPage::init() { QDateTime dt; + QDesktopWidget *desk = QApplication::desktop(); + QRect scrn; m_name = tr("Run"); pgInitialize(); setupUi(this); + /* Get screen rectangle */ + scrn = desk->screenGeometry(desk->primaryScreen()); + /* Position this window in the middle of the screen */ + this->move((scrn.width()-this->width())/2, (scrn.height()-this->height())/2); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/run.png"))); m_conn = m_console->notifyOff(); -- 2.39.5