void VolumeGroupDialog::updateSizeInfos()
{
    QStringList checkedPartitions = dialogWidget().listPV().checkedItems();
    m_TotalSize = FS::lvm2_pv::getPVSize(checkedPartitions);
    dialogWidget().totalSize().setText(Capacity::formatByteSize(m_TotalSize));

    //Probably a bad design for updating state here; the state should be changed inside the update button function.
    m_IsValidSize = m_TotalSize > m_TotalUsedSize;
    updateSectorInfos();
    updateOkButtonStatus();
}
void VolumeGroupDialog::updateSizeInfos()
{
    const QList <const Partition *> checkedPartitions = dialogWidget().listPV().checkedItems();
    m_TotalSize = 0;
    for (const auto &p : checkedPartitions)
        m_TotalSize += p->capacity() - p->capacity() % (dialogWidget().spinPESize().value() * Capacity::unitFactor(Capacity::Byte, Capacity::MiB)); // subtract space which is too small to hold PE

    dialogWidget().totalSize().setText(Capacity::formatByteSize(m_TotalSize));

    //Probably a bad design for updating state here; the state should be changed inside the update button function.
    m_IsValidSize = m_TotalSize >= m_TotalUsedSize;
    updateSectorInfos();
    updateOkButtonStatus();
}
void VolumeGroupDialog::setupConstraints()
{
    updateSizeInfos();
    updateOkButtonStatus();
}