2020-09-16 00:35:12 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2018 Abhijeet Sharma <sharma.abhijeet2096@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#if !defined(EDITMOUNTPOINTDIALOGWIDGET_H)
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2017-09-11 16:27:51 +01:00
|
|
|
#define EDITMOUNTPOINTDIALOGWIDGET_H
|
2010-01-15 18:08:01 +00:00
|
|
|
|
|
|
|
#include "ui_editmountpointdialogwidgetbase.h"
|
2017-09-16 20:41:45 +01:00
|
|
|
#include <core/fstab.h>
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2017-06-04 23:04:52 +01:00
|
|
|
#include <map>
|
|
|
|
|
2010-01-15 18:08:01 +00:00
|
|
|
#include <QString>
|
2016-08-23 16:40:16 +01:00
|
|
|
#include <QWidget>
|
2010-01-15 18:08:01 +00:00
|
|
|
|
|
|
|
class Partition;
|
|
|
|
|
2016-08-23 16:40:16 +01:00
|
|
|
class QFile;
|
2010-01-15 18:08:01 +00:00
|
|
|
class QSpinBox;
|
|
|
|
class QCheckBox;
|
2018-03-31 20:27:05 +01:00
|
|
|
class QComboBox;
|
2014-05-14 01:01:34 +01:00
|
|
|
class QPushButton;
|
2010-01-15 18:08:01 +00:00
|
|
|
class QStringList;
|
|
|
|
|
|
|
|
class EditMountPointDialogWidget : public QWidget, public Ui::EditMountPointDialogWidgetBase
|
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
public:
|
2018-03-03 16:34:41 +00:00
|
|
|
EditMountPointDialogWidget(QWidget* parent, Partition& p);
|
2015-07-13 15:17:41 +01:00
|
|
|
~EditMountPointDialogWidget();
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
QPushButton& buttonMore() {
|
|
|
|
return *m_ButtonMore;
|
|
|
|
}
|
|
|
|
QLabel& labelName() {
|
|
|
|
return *m_LabelNameValue;
|
|
|
|
}
|
2018-03-31 20:27:05 +01:00
|
|
|
QComboBox& editPath() {
|
2015-07-13 15:17:41 +01:00
|
|
|
return *m_EditPath;
|
|
|
|
}
|
|
|
|
QSpinBox& spinDumpFreq() {
|
|
|
|
return *m_SpinDumpFreq;
|
|
|
|
}
|
|
|
|
QSpinBox& spinPassNumber() {
|
|
|
|
return *m_SpinPassNumber;
|
|
|
|
}
|
|
|
|
QLabel& labelType() {
|
|
|
|
return *m_LabelTypeValue;
|
|
|
|
}
|
2016-08-09 14:57:33 +01:00
|
|
|
QStringList options() const;
|
2015-07-13 15:17:41 +01:00
|
|
|
QRadioButton& radioUUID() {
|
|
|
|
return *m_RadioUUID;
|
|
|
|
}
|
|
|
|
QRadioButton& radioLabel() {
|
|
|
|
return *m_RadioLabel;
|
|
|
|
}
|
|
|
|
QRadioButton& radioDeviceNode() {
|
|
|
|
return *m_RadioDeviceNode;
|
|
|
|
}
|
2017-09-16 20:41:45 +01:00
|
|
|
FstabEntryList& fstabEntries() {
|
|
|
|
return m_fstabEntries;
|
|
|
|
}
|
2010-01-16 20:21:42 +00:00
|
|
|
|
2017-09-16 20:41:45 +01:00
|
|
|
void acceptChanges();
|
2018-03-03 16:34:41 +00:00
|
|
|
void removeMountPoint();
|
2015-07-13 15:17:41 +01:00
|
|
|
bool writeMountpoints(const QString& filename);
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2016-07-02 12:12:56 +01:00
|
|
|
protected:
|
|
|
|
void buttonSelectClicked(bool);
|
|
|
|
void buttonMoreClicked(bool);
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
private:
|
|
|
|
void setupOptions(const QStringList& options);
|
2018-04-09 15:14:48 +01:00
|
|
|
void setupRadio(const FstabEntry::Type entryType);
|
2017-06-04 23:04:52 +01:00
|
|
|
std::map<QString, QCheckBox*>& boxOptions() {
|
2015-07-13 15:17:41 +01:00
|
|
|
return m_BoxOptions;
|
|
|
|
}
|
2017-06-04 23:04:52 +01:00
|
|
|
const std::map<QString, QCheckBox*>& boxOptions() const {
|
2015-07-13 15:17:41 +01:00
|
|
|
return m_BoxOptions;
|
|
|
|
}
|
2017-09-16 20:41:45 +01:00
|
|
|
|
2018-03-03 16:34:41 +00:00
|
|
|
Partition& partition() {
|
|
|
|
return m_Partition;
|
|
|
|
}
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
const Partition& partition() const {
|
|
|
|
return m_Partition;
|
|
|
|
}
|
2010-01-15 18:08:01 +00:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
private:
|
2017-09-16 20:41:45 +01:00
|
|
|
FstabEntryList m_fstabEntries;
|
2018-04-01 18:47:34 +01:00
|
|
|
QList<FstabEntry *> entry; // All fstab entries for this partition
|
2018-03-31 20:27:05 +01:00
|
|
|
FstabEntry *currentEntry;
|
2018-03-03 16:34:41 +00:00
|
|
|
Partition& m_Partition;
|
2015-07-13 15:17:41 +01:00
|
|
|
QString m_Options;
|
2016-05-24 16:35:39 +01:00
|
|
|
QString m_deviceNode;
|
2018-03-31 20:27:05 +01:00
|
|
|
QStringList mountPointList;
|
2017-06-04 23:04:52 +01:00
|
|
|
std::map<QString, QCheckBox*> m_BoxOptions;
|
2018-03-31 20:27:05 +01:00
|
|
|
std::map<QString, QCheckBox*>::iterator iterator_BoxOptions;
|
2010-01-15 18:08:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|