2016-06-30 00:17:05 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* Copyright (C) 2016 by Chantara Tith <tith.chantara@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2016-06-30 18:39:47 +01:00
|
|
|
#if !defined(VOLUMEDIALOG__H)
|
|
|
|
|
|
|
|
#define VOLUMEDIALOG__H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
class VolumeWidget;
|
2016-07-02 09:27:20 +01:00
|
|
|
class Partition;
|
2016-06-30 18:39:47 +01:00
|
|
|
|
|
|
|
class QDialogButtonBox;
|
|
|
|
class QPushButton;
|
|
|
|
class QVBoxLayout;
|
|
|
|
class QWidget;
|
|
|
|
class QString;
|
|
|
|
|
|
|
|
class VolumeDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_DISABLE_COPY(VolumeDialog)
|
|
|
|
|
|
|
|
public:
|
2016-07-03 18:15:50 +01:00
|
|
|
VolumeDialog(QWidget* parent, QString& vgname, QStringList& pvlist);
|
2016-06-30 18:39:47 +01:00
|
|
|
~VolumeDialog();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setupDialog();
|
2016-07-02 09:27:20 +01:00
|
|
|
virtual void setupConstraints();
|
2016-06-30 18:39:47 +01:00
|
|
|
virtual void setupConnections();
|
|
|
|
|
2016-07-02 09:27:20 +01:00
|
|
|
virtual void updateOkButtonStatus();
|
|
|
|
virtual void updatePartTable();
|
|
|
|
virtual void updateSizeInfos();
|
2016-07-03 18:15:50 +01:00
|
|
|
virtual void updatePartitionList();
|
|
|
|
|
|
|
|
virtual void onVolumeTypeChanged(int index);
|
2016-07-02 09:27:20 +01:00
|
|
|
|
2016-06-30 18:39:47 +01:00
|
|
|
VolumeWidget& dialogWidget() {
|
|
|
|
Q_ASSERT(m_DialogWidget);
|
|
|
|
return *m_DialogWidget;
|
|
|
|
}
|
|
|
|
const VolumeWidget& dialogWidget() const {
|
|
|
|
Q_ASSERT(m_DialogWidget);
|
|
|
|
return *m_DialogWidget;
|
|
|
|
}
|
|
|
|
|
2016-07-03 18:15:50 +01:00
|
|
|
QString& targetName() {
|
|
|
|
return m_TargetName;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QString& targetName() const {
|
|
|
|
return m_TargetName;
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList& targetPVList() {
|
|
|
|
return m_TargetPVList;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QStringList& targetPVList() const {
|
|
|
|
return m_TargetPVList;
|
2016-07-02 09:27:20 +01:00
|
|
|
}
|
|
|
|
|
2016-07-15 22:29:34 +01:00
|
|
|
bool isLegeSize() const {
|
|
|
|
return m_IsLegalSize;
|
|
|
|
}
|
|
|
|
|
2016-07-02 09:27:20 +01:00
|
|
|
protected:
|
|
|
|
virtual void onPartitionListChanged();
|
|
|
|
|
2016-06-30 18:39:47 +01:00
|
|
|
protected:
|
|
|
|
VolumeWidget* m_DialogWidget;
|
2016-07-03 18:15:50 +01:00
|
|
|
QString& m_TargetName;
|
|
|
|
QStringList& m_TargetPVList;
|
2016-07-15 22:29:34 +01:00
|
|
|
bool m_IsLegalSize;
|
2016-06-30 18:39:47 +01:00
|
|
|
|
|
|
|
QDialogButtonBox* dialogButtonBox;
|
|
|
|
QPushButton* okButton;
|
|
|
|
QPushButton* cancelButton;
|
|
|
|
QVBoxLayout *mainLayout;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|