make sure to show the right fs color even for extended partitions in the

new-partition-dialog

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1102170
This commit is contained in:
Volker Lanz 2010-03-11 23:33:41 +00:00
parent 68e10edfac
commit 3ab91021c1
2 changed files with 17 additions and 3 deletions

View File

@ -124,18 +124,29 @@ void NewDialog::onRoleChanged(bool)
else if (dialogWidget().radioLogical().isChecked())
r = PartitionRole::Logical;
// Make sure an extended partition gets correctly displayed: Set its file system to extended.
// Also make sure to set a primary's or logical's file system once the user goes back from
// extended to any of those.
if (r == PartitionRole::Extended)
updateFileSystem(FileSystem::Extended);
else
updateFileSystem(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText()));
dialogWidget().comboFileSystem().setEnabled(r != PartitionRole::Extended);
partition().setRoles(PartitionRole(r));
dialogWidget().partResizerWidget().update();
updateHideAndShow();
}
void NewDialog::onFilesystemChanged(int idx)
void NewDialog::updateFileSystem(FileSystem::Type t)
{
const FileSystem::Type t = FileSystem::typeForName(dialogWidget().comboFileSystem().itemText(idx));
partition().deleteFileSystem();
partition().setFileSystem(FileSystemFactory::create(t, partition().firstSector(), partition().lastSector()));
}
void NewDialog::onFilesystemChanged(int idx)
{
updateFileSystem(FileSystem::typeForName(dialogWidget().comboFileSystem().itemText(idx)));
setupConstraints();

View File

@ -25,6 +25,8 @@
#include "core/partition.h"
#include "fs/filesystem.h"
class Device;
/** @brief Dialog to create new Partitions.
@ -51,6 +53,7 @@ class NewDialog : public SizeDialogBase
void setupConnections();
void setupDialog();
void updateHideAndShow();
void updateFileSystem(FileSystem::Type t);
PartitionRole::Roles partitionRoles() const { return m_PartitionRoles; }
virtual bool canGrow() const { return true; }
virtual bool canShrink() const { return true; }