/* SPDX-FileCopyrightText: 2010 Volker Lanz SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas SPDX-License-Identifier: GPL-3.0-or-later */ #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& device) { if (device.isEmpty()) { setLabelText(xi18nc("@label", "Scanning...")); } else { setLabelText(xi18nc("@label", "Scanning device: %1", device)); } } void ScanProgressDialog::showEvent(QShowEvent* e) { setCancelButton(nullptr); QProgressDialog::showEvent(e); }