Skip to content

Commit

Permalink
Updater: Center the notification dialog after mode change
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 31, 2012
1 parent c549b6b commit 79d38b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doomsday/engine/portable/src/updater/updateavailabledialog.cpp
Expand Up @@ -25,8 +25,10 @@
#include "updatersettingsdialog.h"
#include "versioninfo.h"
#include "window.h"
#include <de/App>
#include <de/Log>
#include <QUrl>
#include <QDesktopWidget>
#include <QDesktopServices>
#include <QVBoxLayout>
#include <QDialogButtonBox>
Expand Down Expand Up @@ -235,6 +237,8 @@ UpdateAvailableDialog::UpdateAvailableDialog(const VersionInfo& latestVersion, d
{
d = new Instance(this, latestVersion);
d->changeLog = changeLogUri;

connect(DENG2_APP, SIGNAL(displayModeChanged()), this, SLOT(recenterDialog()));
}

UpdateAvailableDialog::~UpdateAvailableDialog()
Expand Down Expand Up @@ -272,3 +276,11 @@ void UpdateAvailableDialog::editSettings()
emit checkAgain();
}
}

void UpdateAvailableDialog::recenterDialog()
{
LOG_DEBUG("Recentering the updater notification dialog.");

QRect screen = QApplication::desktop()->screenGeometry(0);
move(screen.center() - rect().center());
}
Expand Up @@ -44,6 +44,7 @@ public slots:
void neverCheckToggled(bool);
void showWhatsNew();
void editSettings();
void recenterDialog();

signals:
void checkAgain();
Expand Down

0 comments on commit 79d38b3

Please sign in to comment.