From: Kern Sibbald Date: Sun, 12 Dec 2010 16:16:59 +0000 (+0100) Subject: Center bat run window on screen X-Git-Tag: Release-7.0.0~1289 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=602bb54261bf64664c65804736e748a1244257fe;p=bacula%2Fbacula Center bat run window on screen --- 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();