Warning, file /utilities/isoimagewriter/isoimagewriter/mainwindow.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2019 Farid Boudedja <farid.boudedja@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef MAINWINDOW_H 0008 #define MAINWINDOW_H 0009 0010 #include "usbdevice.h" 0011 #include "externalprogressbar.h" 0012 #include "isoverifier.h" 0013 0014 #include <QMainWindow> 0015 #include <QLabel> 0016 #include <QComboBox> 0017 #include <QPushButton> 0018 #include <QProgressBar> 0019 #include <QStackedWidget> 0020 #include <KPixmapSequenceOverlayPainter> 0021 0022 #if defined(USE_KAUTH) 0023 #include <kauth_version.h> 0024 #if KAUTH_VERSION >= QT_VERSION_CHECK(5, 92, 0) 0025 #include <KAuth/ExecuteJob> 0026 #else 0027 #include <KAuth> 0028 #endif 0029 #endif 0030 0031 class FetchIsoJob; 0032 class IsoLineEdit; 0033 0034 class MainWindow : public QMainWindow 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 explicit MainWindow(QWidget *parent = nullptr); 0040 0041 public slots: 0042 void scheduleEnumFlashDevices(); 0043 void showInputDialog(const QString &title, const QString &body); 0044 0045 signals: 0046 void inputTextReady(bool ok, const QString &text); 0047 void downloadProgressChanged(int percentage); 0048 void verificationResult(bool verified); 0049 0050 private: 0051 QLabel *m_busyLabel; 0052 QWidget *m_busyWidget; 0053 QLabel *m_isoImageSizeLabel; 0054 IsoLineEdit *m_isoImageLineEdit; 0055 QComboBox *m_usbDriveComboBox; 0056 QPushButton *m_createButton; 0057 QPushButton *m_cancelButton; 0058 QProgressBar *m_progressBar; 0059 QStackedWidget *m_centralStackedWidget; 0060 KPixmapSequenceOverlayPainter *m_busySpinner; 0061 FetchIsoJob *m_fetchIso = nullptr; 0062 0063 QString m_isoImagePath; 0064 quint64 m_isoImageSize; 0065 QString m_lastOpenedDir; 0066 bool m_isWriting; 0067 bool m_enumFlashDevicesWaiting; 0068 ExternalProgressBar m_externalProgressBar; 0069 0070 #if defined(USE_KAUTH) 0071 KAuth::ExecuteJob *m_job; 0072 #endif 0073 0074 void setupUi(); 0075 QWidget* createFormWidget(); 0076 QWidget* createConfirmWidget(); 0077 QWidget* createProgressWidget(); 0078 QWidget* createSuccessWidget(); 0079 void preprocessIsoImage(const QString& isoImagePath); 0080 void cleanUp(); 0081 void enumFlashDevices(); 0082 void writeToDevice(bool zeroing); 0083 0084 void dragEnterEvent(QDragEnterEvent* event) override; 0085 void dropEvent(QDropEvent* event) override; 0086 void closeEvent(QCloseEvent* event) override; 0087 0088 static void addFlashDeviceCallback(void* cbParam, UsbDevice* device); 0089 0090 private slots: 0091 void openIsoImage(); 0092 void writeIsoImage(); 0093 void updateProgressBar(int increment); 0094 void showWritingProgress(); 0095 void hideWritingProgress(); 0096 void showErrorMessage(const QString &message); 0097 void showSuccessMessage(); 0098 void showConfirmMessage(); 0099 void showIsoVerificationResult(IsoVerifier::VerifyResult result, const QString &error); 0100 void openUrl(const QUrl &url); 0101 0102 #if defined(USE_KAUTH) 0103 void cancelWriting(); 0104 void progressPercentUpdate(KJob* job, unsigned long percent); 0105 void progressStep(const QVariantMap &); 0106 void statusChanged(KAuth::Action::AuthStatus status); 0107 void finished(KJob* job); 0108 #endif 0109 }; 0110 0111 #endif // MAINWINDOW_H