]> git.sur5r.net Git - bacula/bacula/commitdiff
Center bat run window on screen
authorKern Sibbald <kern@sibbald.com>
Sun, 12 Dec 2010 16:16:59 +0000 (17:16 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:43 +0000 (14:39 +0200)
bacula/src/qt-console/run/run.cpp

index 3c98acb6743e6ac372b3f2bd954f116aaa677af7..9510f56804e18660db123ac684ff0e53ba92c49e 100644 (file)
@@ -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();