add a check when scanning devices if support for all file systems we found is
present. if not, show a messagebox with detailed information what is missing. svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1128887
This commit is contained in:
parent
68ccea7ac2
commit
e9871e0e82
|
@ -65,6 +65,28 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool btrfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
// m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool btrfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("e2fsprogs", KUrl("http://e2fsprogs.sf.net"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 btrfs::maxCapacity() const
|
qint64 btrfs::maxCapacity() const
|
||||||
{
|
{
|
||||||
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
||||||
|
|
|
@ -65,6 +65,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -61,9 +61,31 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ext2::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool ext2::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("e2fsprogs", KUrl("http://e2fsprogs.sf.net"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 ext2::maxCapacity() const
|
qint64 ext2::maxCapacity() const
|
||||||
{
|
{
|
||||||
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 ext2::readUsedCapacity(const QString& deviceNode) const
|
qint64 ext2::readUsedCapacity(const QString& deviceNode) const
|
||||||
|
|
|
@ -65,6 +65,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportShrink() const { return m_Shrink; }
|
virtual CommandSupportType supportShrink() const { return m_Shrink; }
|
||||||
virtual CommandSupportType supportMove() const { return m_Move; }
|
virtual CommandSupportType supportMove() const { return m_Move; }
|
||||||
|
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_Create;
|
static CommandSupportType m_Create;
|
||||||
static CommandSupportType m_Grow;
|
static CommandSupportType m_Grow;
|
||||||
|
|
|
@ -69,6 +69,30 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fat16::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool fat16::supportToolName() const
|
||||||
|
{
|
||||||
|
// also, dd for updating the UUID, but let's assume it's there ;-)
|
||||||
|
return SupportTool("dosfstools", KUrl("http://www.daniel-baumann.ch/software/dosfstools/"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
qint64 fat16::minCapacity() const
|
qint64 fat16::minCapacity() const
|
||||||
{
|
{
|
||||||
return 16 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
return 16 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
||||||
|
|
|
@ -65,6 +65,8 @@ namespace FS
|
||||||
|
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -355,3 +355,13 @@ FileSystem::Type FileSystem::defaultFileSystem()
|
||||||
{
|
{
|
||||||
return static_cast<FileSystem::Type>(Config::defaultFileSystem());
|
return static_cast<FileSystem::Type>(Config::defaultFileSystem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FileSystem::supportToolFound() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool FileSystem::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool();
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
#define FILESYSTEM__H
|
#define FILESYSTEM__H
|
||||||
|
|
||||||
|
#include <kurl.h>
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -41,6 +43,15 @@ class FileSystem
|
||||||
Q_DISABLE_COPY(FileSystem)
|
Q_DISABLE_COPY(FileSystem)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
class SupportTool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SupportTool(const QString& n = QString(), const KUrl& u = KUrl()) : name(n), url(u) {}
|
||||||
|
|
||||||
|
const QString name;
|
||||||
|
const KUrl url;
|
||||||
|
};
|
||||||
|
|
||||||
/** Supported FileSystem types */
|
/** Supported FileSystem types */
|
||||||
enum Type
|
enum Type
|
||||||
{
|
{
|
||||||
|
@ -128,6 +139,9 @@ class FileSystem
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
virtual QString name() const;
|
virtual QString name() const;
|
||||||
virtual FileSystem::Type type() const { return m_Type; } /**< @return the FileSystem's type */
|
virtual FileSystem::Type type() const { return m_Type; } /**< @return the FileSystem's type */
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,29 @@ namespace FS
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
// m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
// m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
// m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone;
|
||||||
|
// m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool hfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("hfsutils", KUrl("http://www.mars.org/home/rob/proj/hfs/"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
qint64 hfs::maxCapacity() const
|
qint64 hfs::maxCapacity() const
|
||||||
{
|
{
|
||||||
return 2 * Capacity::unitFactor(Capacity::Byte, Capacity::TiB);
|
return 2 * Capacity::unitFactor(Capacity::Byte, Capacity::TiB);
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -49,6 +49,28 @@ namespace FS
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hfsplus::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
// m_GetLabel != cmdSupportNone &&
|
||||||
|
// m_SetLabel != cmdSupportNone &&
|
||||||
|
// m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
// m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone;
|
||||||
|
// m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool hfsplus::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("hfsplus", KUrl());
|
||||||
|
}
|
||||||
|
|
||||||
qint64 hfsplus::maxCapacity() const
|
qint64 hfsplus::maxCapacity() const
|
||||||
{
|
{
|
||||||
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -59,11 +59,38 @@ namespace FS
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool jfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone;
|
||||||
|
// m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool jfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("jfsutils", KUrl("http://jfs.sourceforge.net/"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 jfs::minCapacity() const
|
qint64 jfs::minCapacity() const
|
||||||
{
|
{
|
||||||
return 16 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
return 16 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 jfs::maxCapacity() const
|
||||||
|
{
|
||||||
|
return 32 * Capacity::unitFactor(Capacity::Byte, Capacity::PiB);
|
||||||
|
}
|
||||||
|
|
||||||
qint64 jfs::readUsedCapacity(const QString& deviceNode) const
|
qint64 jfs::readUsedCapacity(const QString& deviceNode) const
|
||||||
{
|
{
|
||||||
ExternalCommand cmd("jfs_debugfs", QStringList() << deviceNode);
|
ExternalCommand cmd("jfs_debugfs", QStringList() << deviceNode);
|
||||||
|
|
|
@ -61,6 +61,9 @@ namespace FS
|
||||||
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
||||||
|
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -48,6 +48,28 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool linuxswap::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
// m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
// m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
// m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool linuxswap::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("util-linux", KUrl("http://www.kernel.org/pub/linux/utils/util-linux-ng/"));
|
||||||
|
}
|
||||||
|
|
||||||
bool linuxswap::create(Report& report, const QString& deviceNode) const
|
bool linuxswap::create(Report& report, const QString& deviceNode) const
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, "mkswap", QStringList() << deviceNode);
|
ExternalCommand cmd(report, "mkswap", QStringList() << deviceNode);
|
||||||
|
|
|
@ -66,6 +66,9 @@ namespace FS
|
||||||
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_Create;
|
static CommandSupportType m_Create;
|
||||||
static CommandSupportType m_Grow;
|
static CommandSupportType m_Grow;
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -68,6 +68,28 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ntfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool ntfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("ntfsprogs", KUrl("http://www.linux-ntfs.org/doku.php?id=ntfsprogs"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 ntfs::maxCapacity() const
|
qint64 ntfs::maxCapacity() const
|
||||||
{
|
{
|
||||||
return 256 * Capacity::unitFactor(Capacity::Byte, Capacity::TiB);
|
return 256 * Capacity::unitFactor(Capacity::Byte, Capacity::TiB);
|
||||||
|
|
|
@ -67,6 +67,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -68,6 +68,28 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ocfs2::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
// m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool ocfs2::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("ocfs2-tools", KUrl("http://oss.oracle.com/projects/ocfs2-tools/"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 ocfs2::maxCapacity() const
|
qint64 ocfs2::maxCapacity() const
|
||||||
{
|
{
|
||||||
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
return Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
||||||
|
|
|
@ -65,6 +65,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -50,6 +50,28 @@ namespace FS
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool reiser4::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
// m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
// m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone;
|
||||||
|
// m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool reiser4::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("reiser4progs", KUrl("http://www.kernel.org/pub/linux/utils/fs/reiser4/reiser4progs/"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 reiser4::maxCapacity() const
|
qint64 reiser4::maxCapacity() const
|
||||||
{
|
{
|
||||||
// looks like it's actually unknown. see
|
// looks like it's actually unknown. see
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -62,6 +62,28 @@ namespace FS
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool reiserfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone &&
|
||||||
|
m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool reiserfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("reiserfsprogs", KUrl("http://www.kernel.org/pub/linux/utils/fs/reiserfs/"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 reiserfs::minCapacity() const
|
qint64 reiserfs::minCapacity() const
|
||||||
{
|
{
|
||||||
return 32 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
return 32 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
||||||
|
|
|
@ -68,6 +68,8 @@ namespace FS
|
||||||
|
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -46,6 +46,8 @@ namespace FS
|
||||||
virtual CommandSupportType supportCopy() const { return m_Copy; }
|
virtual CommandSupportType supportCopy() const { return m_Copy; }
|
||||||
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
virtual CommandSupportType supportBackup() const { return m_Backup; }
|
||||||
|
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_Move;
|
static CommandSupportType m_Move;
|
||||||
static CommandSupportType m_Copy;
|
static CommandSupportType m_Copy;
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace FS
|
||||||
|
|
||||||
virtual CommandSupportType supportCreate() const { return m_Create; }
|
virtual CommandSupportType supportCreate() const { return m_Create; }
|
||||||
|
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_Create;
|
static CommandSupportType m_Create;
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace FS
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void init() {}
|
static void init() {}
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,38 @@ namespace FS
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool xfs::supportToolFound() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
m_GetUsed != cmdSupportNone &&
|
||||||
|
m_GetLabel != cmdSupportNone &&
|
||||||
|
m_SetLabel != cmdSupportNone &&
|
||||||
|
m_Create != cmdSupportNone &&
|
||||||
|
m_Check != cmdSupportNone &&
|
||||||
|
// m_UpdateUUID != cmdSupportNone &&
|
||||||
|
m_Grow != cmdSupportNone &&
|
||||||
|
// m_Shrink != cmdSupportNone &&
|
||||||
|
m_Copy != cmdSupportNone &&
|
||||||
|
m_Move != cmdSupportNone &&
|
||||||
|
m_Backup != cmdSupportNone;
|
||||||
|
// m_GetUUID != cmdSupportNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::SupportTool xfs::supportToolName() const
|
||||||
|
{
|
||||||
|
return SupportTool("xfsprogs", KUrl("http://oss.sgi.com/projects/xfs/"));
|
||||||
|
}
|
||||||
|
|
||||||
qint64 xfs::minCapacity() const
|
qint64 xfs::minCapacity() const
|
||||||
{
|
{
|
||||||
return 32 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
return 32 * Capacity::unitFactor(Capacity::Byte, Capacity::MiB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 xfs::maxCapacity() const
|
||||||
|
{
|
||||||
|
return 8 * Capacity::unitFactor(Capacity::Byte, Capacity::EiB);
|
||||||
|
}
|
||||||
|
|
||||||
qint64 xfs::readUsedCapacity(const QString& deviceNode) const
|
qint64 xfs::readUsedCapacity(const QString& deviceNode) const
|
||||||
{
|
{
|
||||||
ExternalCommand cmd("xfs_db", QStringList() << "-c" << "sb 0" << "-c" << "print" << deviceNode);
|
ExternalCommand cmd("xfs_db", QStringList() << "-c" << "sb 0" << "-c" << "print" << deviceNode);
|
||||||
|
|
|
@ -62,6 +62,9 @@ namespace FS
|
||||||
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
virtual CommandSupportType supportSetLabel() const { return m_SetLabel; }
|
||||||
|
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual SupportTool supportToolName() const;
|
||||||
|
virtual bool supportToolFound() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace FS
|
||||||
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
virtual CommandSupportType supportGetUUID() const { return m_GetUUID; }
|
||||||
|
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
|
virtual bool supportToolFound() const { return true; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
|
|
|
@ -88,6 +88,8 @@ void FileSystemSupportDialog::setupDialog()
|
||||||
// if a file is an image of a supported or unsupported (or even invalid) filesystem
|
// if a file is an image of a supported or unsupported (or even invalid) filesystem
|
||||||
item->setIcon(i++, yes);
|
item->setIcon(i++, yes);
|
||||||
|
|
||||||
|
item->setText(i++, fs->supportToolName().name.isEmpty() ? "---" : fs->supportToolName().name);
|
||||||
|
|
||||||
dialogWidget().tree().addTopLevelItem(item);
|
dialogWidget().tree().addTopLevelItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,11 @@ Some file systems need external tools to be installed for them to be supported.
|
||||||
<string>Restore</string>
|
<string>Restore</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Support Tools</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -623,6 +623,7 @@ void MainWindow::on_m_DeviceScanner_finished()
|
||||||
listDevices().setSelectedDevice(operationStack().previewDevices()[0]->deviceNode());
|
listDevices().setSelectedDevice(operationStack().previewDevices()[0]->deviceNode());
|
||||||
|
|
||||||
updateSeletedDeviceMenu();
|
updateSeletedDeviceMenu();
|
||||||
|
checkFileSystemSupport();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateSeletedDeviceMenu()
|
void MainWindow::updateSeletedDeviceMenu()
|
||||||
|
@ -1040,3 +1041,63 @@ void MainWindow::onPropertiesDevice(const QString&)
|
||||||
delete dlg;
|
delete dlg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QStringList checkSupportInNode(const PartitionNode* parent)
|
||||||
|
{
|
||||||
|
QStringList rval;
|
||||||
|
|
||||||
|
foreach(const PartitionNode* node, parent->children())
|
||||||
|
{
|
||||||
|
const Partition* p = dynamic_cast<const Partition*>(node);
|
||||||
|
|
||||||
|
if (p == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (node->children().size() > 0)
|
||||||
|
rval << checkSupportInNode(node);
|
||||||
|
|
||||||
|
if (!p->fileSystem().supportToolFound() && !p->fileSystem().supportToolName().name.isEmpty())
|
||||||
|
rval << QString("<tr>"
|
||||||
|
"<td>%1</td>"
|
||||||
|
"<td>%2</td>"
|
||||||
|
"<td>%3</td>"
|
||||||
|
"<td><a href=\"%4\">%4</a></td>"
|
||||||
|
"</tr>")
|
||||||
|
.arg(p->deviceNode())
|
||||||
|
.arg(p->fileSystem().name())
|
||||||
|
.arg(p->fileSystem().supportToolName().name)
|
||||||
|
.arg(p->fileSystem().supportToolName().url.prettyUrl());
|
||||||
|
}
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::checkFileSystemSupport()
|
||||||
|
{
|
||||||
|
QStringList supportList;
|
||||||
|
|
||||||
|
foreach(const Device* d, operationStack().previewDevices())
|
||||||
|
supportList << checkSupportInNode(d->partitionTable());
|
||||||
|
|
||||||
|
supportList.sort();
|
||||||
|
supportList.removeDuplicates();
|
||||||
|
|
||||||
|
if (!supportList.isEmpty())
|
||||||
|
KMessageBox::information(this,
|
||||||
|
i18nc("@info",
|
||||||
|
"<para>No support tools were found for file systems currently present on hard disks in this computer:</para>"
|
||||||
|
"<table style='margin-top:12px'>"
|
||||||
|
"<tr>"
|
||||||
|
"<td style='font-weight:bold;padding-right:12px;white-space:nowrap;'>Partition</td>"
|
||||||
|
"<td style='font-weight:bold;padding-right:12px;white-space:nowrap;'>File System</td>"
|
||||||
|
"<td style='font-weight:bold;padding-right:12px;white-space:nowrap;'>Support Tools</td>"
|
||||||
|
"<td style='font-weight:bold;padding-right:12px;white-space:nowrap;'>URL</td>"
|
||||||
|
"</tr>"
|
||||||
|
"%1"
|
||||||
|
"</table>"
|
||||||
|
"<para>As long as the support tools for these file systems are not installed you will not be able to modify them.</para>"
|
||||||
|
"<para>You should find packages with these support tools in your distribution's package manager.</para>",
|
||||||
|
supportList.join("\n")),
|
||||||
|
i18nc("@title:window", "Missing File System Support Packages"),
|
||||||
|
"showInformationOnMissingFileSystemSupport", KMessageBox::Notify | KMessageBox::AllowLink);
|
||||||
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, publi
|
||||||
void saveConfig() const;
|
void saveConfig() const;
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
void updateSeletedDeviceMenu();
|
void updateSeletedDeviceMenu();
|
||||||
|
void checkFileSystemSupport();
|
||||||
|
|
||||||
void enableActions();
|
void enableActions();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue