From ea6292168a6acd4c263913f0ccd7dd64daf4f5cf Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Fri, 23 Feb 2018 01:45:58 +0100 Subject: Revert "Applied clang-format on source" This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e. --- src/lockeddialog.cpp | 64 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 25 deletions(-) (limited to 'src/lockeddialog.cpp') diff --git a/src/lockeddialog.cpp b/src/lockeddialog.cpp index 8883cd56..143d5838 100644 --- a/src/lockeddialog.cpp +++ b/src/lockeddialog.cpp @@ -23,35 +23,49 @@ along with Mod Organizer. If not, see . #include #include #include -#include // for Qt::FramelessWindowHint, etc - -LockedDialog::LockedDialog(QWidget* parent, bool unlockByButton) - : LockedDialogBase(parent, !unlockByButton), ui(new Ui::LockedDialog) { - ui->setupUi(this); - - // Supposedly the Qt::CustomizeWindowHint should use a customized window - // allowing us to select if there is a close button. In practice this doesn't - // seem to work. We will ignore pressing the close button if unlockByButton == true - Qt::WindowFlags flags = - this->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint; - if (m_allowClose) - flags |= Qt::WindowCloseButtonHint; - this->setWindowFlags(flags); - - if (!unlockByButton) { - ui->unlockButton->hide(); - ui->verticalLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); - } +#include // for Qt::FramelessWindowHint, etc + +LockedDialog::LockedDialog(QWidget *parent, bool unlockByButton) + : LockedDialogBase(parent, !unlockByButton) + , ui(new Ui::LockedDialog) +{ + ui->setupUi(this); + + // Supposedly the Qt::CustomizeWindowHint should use a customized window + // allowing us to select if there is a close button. In practice this doesn't + // seem to work. We will ignore pressing the close button if unlockByButton == true + Qt::WindowFlags flags = + this->windowFlags() | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint; + if (m_allowClose) + flags |= Qt::WindowCloseButtonHint; + this->setWindowFlags(flags); + + if (!unlockByButton) + { + ui->unlockButton->hide(); + ui->verticalLayout->addItem( + new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); + } } -LockedDialog::~LockedDialog() { delete ui; } +LockedDialog::~LockedDialog() +{ + delete ui; +} -void LockedDialog::setProcessName(const QString& name) { ui->processLabel->setText(name); } -void LockedDialog::on_unlockButton_clicked() { unlock(); } +void LockedDialog::setProcessName(const QString &name) +{ + ui->processLabel->setText(name); +} + +void LockedDialog::on_unlockButton_clicked() +{ + unlock(); +} void LockedDialog::unlock() { - LockedDialogBase::unlock(); - ui->label->setText("unlocking may take a few seconds"); - ui->unlockButton->setEnabled(false); + LockedDialogBase::unlock(); + ui->label->setText("unlocking may take a few seconds"); + ui->unlockButton->setEnabled(false); } -- cgit v1.3.1