File indexing completed on 2024-05-05 17:43:13
0001 /* 0002 * SPDX-FileCopyrightText: 2017 Ivan Cukic <ivan.cukic (at) kde.org> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef PLASMAVAULT_KDED_UI_DIRECTORY_CHOOSER_WIDGET_H 0008 #define PLASMAVAULT_KDED_UI_DIRECTORY_CHOOSER_WIDGET_H 0009 0010 #include "dialogdsl.h" 0011 0012 class DirectoryChooserWidget : public DialogDsl::DialogModule 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 enum Flags { 0018 RequireNothing = 0, 0019 RequireEmptyMountPoint = 1, 0020 }; 0021 0022 DirectoryChooserWidget(Flags flags); 0023 ~DirectoryChooserWidget() override; 0024 0025 PlasmaVault::Vault::Payload fields() const override; 0026 void init(const PlasmaVault::Vault::Payload &payload) override; 0027 0028 private: 0029 class Private; 0030 QScopedPointer<Private> d; 0031 }; 0032 0033 inline DialogDsl::ModuleFactory directoryChooser(DirectoryChooserWidget::Flags flags) 0034 { 0035 return [=] { 0036 return new DirectoryChooserWidget(flags); 0037 }; 0038 } 0039 0040 #endif // include guard