diff --git a/src/gui/scanprogressdialog.cpp b/src/gui/scanprogressdialog.cpp index da673f4..b14049e 100644 --- a/src/gui/scanprogressdialog.cpp +++ b/src/gui/scanprogressdialog.cpp @@ -1,46 +1,53 @@ /************************************************************************* * Copyright (C) 2010 by Volker Lanz * * Copyright (C) 2016 by Andrius Štikonas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * 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 * * along with this program. If not, see .* *************************************************************************/ #include "gui/scanprogressdialog.h" +#include + #include ScanProgressDialog::ScanProgressDialog(QWidget* parent) : QProgressDialog(parent) { setWindowTitle(xi18nc("@title:window", "Scanning devices...")); setMinimumWidth(280); setMinimumDuration(150); setValue(0); setAttribute(Qt::WA_ShowModal, true); } +void ScanProgressDialog::closeEvent(QCloseEvent* e) +{ + e->ignore(); +} + void ScanProgressDialog::setDeviceName(const QString& d) { if (d.isEmpty()) setLabelText(xi18nc("@label", "Scanning...")); else setLabelText(xi18nc("@label", "Scanning device: %1", d)); } void ScanProgressDialog::showEvent(QShowEvent* e) { - setCancelButton(0); + setCancelButton(nullptr); QProgressDialog::showEvent(e); } diff --git a/src/gui/scanprogressdialog.h b/src/gui/scanprogressdialog.h index c3bbb93..327828d 100644 --- a/src/gui/scanprogressdialog.h +++ b/src/gui/scanprogressdialog.h @@ -1,42 +1,42 @@ /************************************************************************* * Copyright (C) 2010 by Volker Lanz * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * 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 * * along with this program. If not, see .* *************************************************************************/ -#if !defined(SCANPROGRESSDIALOG_H) - +#ifndef SCANPROGRESSDIALOG_H #define SCANPROGRESSDIALOG_H #include class QShowEvent; class ScanProgressDialog : public QProgressDialog { public: ScanProgressDialog(QWidget* parent); void setProgress(int p) { setValue(p); } void setDeviceName(const QString& d); protected: + void closeEvent(QCloseEvent* e) override; void showEvent(QShowEvent* e) override; }; #endif