Update volumeDialog ok button status as the used and total size changes.
This commit is contained in:
parent
e6834393ae
commit
2917317619
|
@ -104,7 +104,7 @@ void VolumeDialog::setupConstraints()
|
|||
|
||||
void VolumeDialog::updateOkButtonStatus()
|
||||
{
|
||||
bool enable = true;
|
||||
bool enable = isLegeSize();
|
||||
|
||||
if (dialogWidget().vgName().text().isEmpty()) {
|
||||
enable = false;
|
||||
|
@ -152,6 +152,10 @@ void VolumeDialog::updateSizeInfos()
|
|||
dialogWidget().totalUsedSize().setText(Capacity::formatByteSize(totalUsedSize));
|
||||
dialogWidget().totalSectors().setText(QString::number(totalSectors));
|
||||
dialogWidget().totalLV().setText(QString::number(totalLV));
|
||||
|
||||
//Probably a bad design for updating state here; the state should be changed inside the update button function.
|
||||
m_IsLegalSize = totalSize > totalUsedSize;
|
||||
updateOkButtonStatus();
|
||||
}
|
||||
|
||||
void VolumeDialog::updatePartitionList()
|
||||
|
|
|
@ -75,6 +75,10 @@ protected:
|
|||
return m_TargetPVList;
|
||||
}
|
||||
|
||||
bool isLegeSize() const {
|
||||
return m_IsLegalSize;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void onPartitionListChanged();
|
||||
|
||||
|
@ -82,6 +86,7 @@ protected:
|
|||
VolumeWidget* m_DialogWidget;
|
||||
QString& m_TargetName;
|
||||
QStringList& m_TargetPVList;
|
||||
bool m_IsLegalSize;
|
||||
|
||||
QDialogButtonBox* dialogButtonBox;
|
||||
QPushButton* okButton;
|
||||
|
|
Loading…
Reference in New Issue