Add prettyDescription to most Partitioning jobs.

main
Teo Mrnjavac 10 years ago
parent bf0296e155
commit 8568c2c816

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -44,10 +45,20 @@ CreatePartitionJob::CreatePartitionJob( Device* device, Partition* partition )
QString QString
CreatePartitionJob::prettyName() const 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->fileSystem().name() )
.arg( m_partition->capacity() / 1024 / 1024 ) .arg( m_partition->capacity() / 1024 / 1024 )
.arg( m_device->name() ); .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() );
} }
Calamares::JobResult Calamares::JobResult

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

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -45,7 +46,14 @@ CreatePartitionTableJob::CreatePartitionTableJob( Device* device, PartitionTable
QString QString
CreatePartitionTableJob::prettyName() const 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 Calamares::JobResult

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

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -38,7 +39,14 @@ DeletePartitionJob::DeletePartitionJob( Device* device, Partition* partition )
QString QString
DeletePartitionJob::prettyName() const 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 Calamares::JobResult

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

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -48,7 +49,17 @@ FormatPartitionJob::prettyName() const
.arg( m_partition->partitionPath() ) .arg( m_partition->partitionPath() )
.arg( m_partition->fileSystem().name() ) .arg( m_partition->fileSystem().name() )
.arg( m_partition->capacity() / 1024 / 1024 ) .arg( m_partition->capacity() / 1024 / 1024 )
.arg( m_device->name() ); .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 Calamares::JobResult

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

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> === /* === This file is part of Calamares - <http://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * 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 * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * 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() ); 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 Calamares::JobResult
ResizePartitionJob::exec() ResizePartitionJob::exec()
{ {

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

Loading…
Cancel
Save