]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/run/run.cpp
Center bat run window on screen
[bacula/bacula] / bacula / src / qt-console / run / run.cpp
index 714aac3f3574926494116048bbbe8e2f5131edb2..9510f56804e18660db123ac684ff0e53ba92c49e 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -31,7 +31,6 @@
  *
  *   Kern Sibbald, February MMVII
  *
- *  $Id$
  */ 
 
 #include "bat.h"
@@ -46,6 +45,7 @@ runPage::runPage()
 
 runPage::runPage(const QString &defJob)
 {
+   m_dockOnFirstUse = false;
    init();
    if (defJob != "")
       jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
@@ -57,6 +57,7 @@ runPage::runPage(const QString &defJob, const QString &level,
                  const QString &pool, const QString &storage,
                  const QString &client, const QString &fileset)
 {
+   m_dockOnFirstUse = false;
    init();
    jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
    job_name_change(0);
@@ -80,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();
@@ -109,7 +116,7 @@ void runPage::init()
    connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
 
    // find a way to place the new window at the cursor position
-   // or in the midle of the page
+   // or in the middle of the page
 //   dockPage();
    setCurrent();
 }