Add prettyDescription to most Partitioning jobs.

This commit is contained in:
Teo Mrnjavac 2015-04-09 15:16:09 +02:00
parent bf0296e155
commit 8568c2c816
10 changed files with 66 additions and 7 deletions

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -44,7 +45,17 @@ CreatePartitionJob::CreatePartitionJob( Device* device, Partition* partition )
QString
CreatePartitionJob::prettyName() const
{
return tr( "Create partition (file system: %1, size: %2 MB) on %3." )
return tr( "Create new <b>%2MB</b> partition on <b>%3</b> with file system %1." )
.arg( m_partition->fileSystem().name() )
.arg( m_partition->capacity() / 1024 / 1024 )
.arg( m_device->name() );
}
QString
CreatePartitionJob::prettyDescription() const
{
return tr( "Create new <b>%2MB</b> partition on <b>%3</b> with file system %1." )
.arg( m_partition->fileSystem().name() )
.arg( m_partition->capacity() / 1024 / 1024 )
.arg( m_device->name() );

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +39,7 @@ class CreatePartitionJob : public PartitionJob
public:
CreatePartitionJob( Device* device, Partition* partition );
QString prettyName() const override;
QString prettyDescription() const override;
Calamares::JobResult exec() override;
void updatePreview();

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -45,7 +46,14 @@ CreatePartitionTableJob::CreatePartitionTableJob( Device* device, PartitionTable
QString
CreatePartitionTableJob::prettyName() const
{
return tr( "Create partition table" ); // FIXME
return tr( "Create partition table" );
}
QString CreatePartitionTableJob::prettyDescription() const
{
return tr( "Create new %1 partition table on %2." )
.arg( PartitionTable::tableTypeToName( m_type ) )
.arg( m_device->deviceNode() );
}
Calamares::JobResult

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +39,7 @@ class CreatePartitionTableJob : public Calamares::Job
public:
CreatePartitionTableJob( Device* device, PartitionTable::TableType type );
QString prettyName() const override;
QString prettyDescription() const override;
Calamares::JobResult exec() override;
void updatePreview();

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,7 +39,14 @@ DeletePartitionJob::DeletePartitionJob( Device* device, Partition* partition )
QString
DeletePartitionJob::prettyName() const
{
return tr( "Delete partition %1" ).arg( m_partition->partitionPath() );
return tr( "Delete partition %1." ).arg( m_partition->partitionPath() );
}
QString
DeletePartitionJob::prettyDescription() const
{
return tr( "Delete partition <b>%1</b>." ).arg( m_partition->partitionPath() );
}
Calamares::JobResult

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,6 +39,7 @@ class DeletePartitionJob : public PartitionJob
public:
DeletePartitionJob( Device* device, Partition* partition );
QString prettyName() const override;
QString prettyDescription() const override;
Calamares::JobResult exec() override;
void updatePreview();

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -51,6 +52,16 @@ FormatPartitionJob::prettyName() const
.arg( m_device->name() );
}
QString
FormatPartitionJob::prettyDescription() const
{
return tr( "Format <b>%3MB</b> partition <b>%1</b> with file system <b>%2</b>." )
.arg( m_partition->partitionPath() )
.arg( m_partition->fileSystem().name() )
.arg( m_partition->capacity() / 1024 / 1024 );
}
Calamares::JobResult
FormatPartitionJob::exec()
{

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,6 +38,7 @@ class FormatPartitionJob : public PartitionJob
public:
FormatPartitionJob( Device* device, Partition* partition );
QString prettyName() const override;
QString prettyDescription() const override;
Calamares::JobResult exec() override;
Device* device() const

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -186,6 +187,16 @@ ResizePartitionJob::prettyName() const
return tr( "Resize partition %1." ).arg( partition()->partitionPath() );
}
QString
ResizePartitionJob::prettyDescription() const
{
return tr( "Resize <b>%2MB</b> partition <b>%1</b> to <b>%3MB</b>." )
.arg( partition()->partitionPath() )
.arg( partition()->capacity() / 1024 / 1024 )
.arg( ( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() / 1024 / 1024 );
}
Calamares::JobResult
ResizePartitionJob::exec()
{

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -36,6 +37,7 @@ class ResizePartitionJob : public PartitionJob
public:
ResizePartitionJob( Device* device, Partition* partition, qint64 firstSector, qint64 lastSector );
QString prettyName() const override;
QString prettyDescription() const override;
Calamares::JobResult exec() override;
void updatePreview();