File indexing completed on 2025-01-05 04:55:50

0001 /*
0002     progressdialog.h
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
0005     SPDX-FileCopyrightText: 2004 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include "kleo_export.h"
0013 
0014 #include <QProgressDialog>
0015 
0016 #ifndef QT_NO_PROGRESSDIALOG
0017 
0018 #include <QGpgME/Job>
0019 
0020 #include <QString>
0021 
0022 namespace Kleo
0023 {
0024 
0025 /**
0026    @short A progress dialog for Kleo::Jobs
0027 */
0028 class KLEO_EXPORT ProgressDialog : public QProgressDialog
0029 {
0030     Q_OBJECT
0031 public:
0032     ProgressDialog(QGpgME::Job *job, const QString &baseText, QWidget *widget = nullptr, Qt::WindowFlags f = {});
0033     ~ProgressDialog() override;
0034 
0035 public Q_SLOTS:
0036     /*! reimplementation */
0037     void setMinimumDuration(int ms);
0038 
0039 private Q_SLOTS:
0040     void slotProgress(int current, int total);
0041     void slotDone();
0042 
0043 private:
0044     QString mBaseText;
0045 };
0046 
0047 }
0048 
0049 #else
0050 #ifndef LIBKLEO_NO_PROGRESSDIALOG
0051 #define LIBKLEO_NO_PROGRESSDIALOG
0052 #endif
0053 #endif // QT_NO_PROGRESSDIALOG