Add deactivating VG operation.
This commit is contained in:
parent
d033dc9827
commit
3b26d39d3c
|
@ -8,6 +8,7 @@ set(OPS_SRC
|
|||
ops/createpartitiontableoperation.cpp
|
||||
ops/createvolumegroupoperation.cpp
|
||||
ops/removevolumegroupoperation.cpp
|
||||
ops/deactivatevolumegroupoperation.cpp
|
||||
ops/resizevolumegroupoperation.cpp
|
||||
ops/setfilesystemlabeloperation.cpp
|
||||
ops/setpartflagsoperation.cpp
|
||||
|
@ -24,6 +25,7 @@ set(OPS_LIB_HDRS
|
|||
ops/createpartitiontableoperation.h
|
||||
ops/createvolumegroupoperation.h
|
||||
ops/removevolumegroupoperation.h
|
||||
ops/deactivatevolumegroupoperation.h
|
||||
ops/resizevolumegroupoperation.h
|
||||
ops/deleteoperation.h
|
||||
ops/newoperation.h
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/*************************************************************************
|
||||
* 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/>.*
|
||||
*************************************************************************/
|
||||
|
||||
#include "ops/deactivatevolumegroupoperation.h"
|
||||
#include "jobs/deactivatevolumegroupjob.h"
|
||||
#include "jobs/deactivatelogicalvolumejob.h"
|
||||
|
||||
#include "core/volumemanagerdevice.h"
|
||||
#include "core/partitiontable.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
/** Creates a new RemoveVolumeGroupOperation.
|
||||
@param d the Device to create the new PartitionTable on
|
||||
@param t the type for the new PartitionTable
|
||||
*/
|
||||
DeactivateVolumeGroupOperation::DeactivateVolumeGroupOperation(VolumeManagerDevice& dev) :
|
||||
Operation(),
|
||||
m_DeactivateVolumeGroupJob(new DeactivateVolumeGroupJob(dev)),
|
||||
m_DeactivateLogicalVolumeJob(new DeactivateLogicalVolumeJob(dev)),
|
||||
m_Device(dev)
|
||||
{
|
||||
addJob(deactivateLogicalVolumeJob());
|
||||
addJob(deactivateVolumeGroupJob());
|
||||
}
|
||||
|
||||
QString DeactivateVolumeGroupOperation::description() const
|
||||
{
|
||||
return xi18nc("@info/plain", "Deactivate volume group.");
|
||||
}
|
||||
|
||||
void DeactivateVolumeGroupOperation::preview()
|
||||
{
|
||||
}
|
||||
|
||||
void DeactivateVolumeGroupOperation::undo()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/*************************************************************************
|
||||
* 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/>.*
|
||||
*************************************************************************/
|
||||
|
||||
#if !defined(DEACTIVATEVOLUMEGROUPOPERATION_H)
|
||||
|
||||
#define DEACTIVATEVOLUMEGROUPOPERATION_H
|
||||
|
||||
#include "util/libpartitionmanagerexport.h"
|
||||
|
||||
#include "ops/operation.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
class DeactivateLogicalVolumeJob;
|
||||
class DeactivateVolumeGroupJob;
|
||||
class VolumeManagerDevice;
|
||||
class OperationStack;
|
||||
|
||||
class LIBKPMCORE_EXPORT DeactivateVolumeGroupOperation : public Operation
|
||||
{
|
||||
Q_DISABLE_COPY(DeactivateVolumeGroupOperation)
|
||||
|
||||
friend class OperationStack;
|
||||
|
||||
public:
|
||||
DeactivateVolumeGroupOperation(VolumeManagerDevice& dev);
|
||||
|
||||
public:
|
||||
QString iconName() const override {
|
||||
return QStringLiteral("edit-delete");
|
||||
}
|
||||
|
||||
QString description() const override;
|
||||
|
||||
virtual bool targets(const Device&) const override {
|
||||
return true;
|
||||
}
|
||||
virtual bool targets(const Partition&) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void preview() override;
|
||||
virtual void undo() override;
|
||||
|
||||
protected:
|
||||
DeactivateVolumeGroupJob* deactivateVolumeGroupJob() {
|
||||
return m_DeactivateVolumeGroupJob;
|
||||
}
|
||||
|
||||
DeactivateLogicalVolumeJob* deactivateLogicalVolumeJob() {
|
||||
return m_DeactivateLogicalVolumeJob;
|
||||
}
|
||||
|
||||
VolumeManagerDevice& device() {
|
||||
return m_Device;
|
||||
}
|
||||
|
||||
private:
|
||||
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
||||
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
||||
VolumeManagerDevice& m_Device;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue