From 511662210a8a8b2dee814d4c3b41422671a0d04c 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.2