mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
GUI: headers: fix removal status text for mandatory elements with default values
Fixes #2320.
This commit is contained in:
parent
21d09d4bcd
commit
0d7d5ca3dd
3
NEWS.md
3
NEWS.md
@ -26,6 +26,9 @@
|
||||
#2304.
|
||||
* MKVToolNix GUI: header editor: fixed a crash when saving the file fails
|
||||
(e.g. because it isn't writable). Fixes #2319.
|
||||
* MKVToolNix GUI: header editor: the editor was wrongfully claiming that
|
||||
mandatory elements with default values cannot be removed in the "status"
|
||||
text. Fixes #2320.
|
||||
|
||||
## Other changes
|
||||
|
||||
|
@ -73,8 +73,10 @@ ValuePage::init() {
|
||||
auto semantic = find_ebml_semantic(KaxSegment::ClassInfos, m_callbacks.GlobalId);
|
||||
if (semantic && semantic->Mandatory) {
|
||||
std::unique_ptr<EbmlElement> elt(&semantic->Create());
|
||||
m_cbAddOrRemove->setEnabled(elt->DefaultISset());
|
||||
m_mayBeRemoved = elt->DefaultISset();
|
||||
}
|
||||
|
||||
m_cbAddOrRemove->setEnabled(m_mayBeRemoved);
|
||||
}
|
||||
|
||||
sizePolicy.setHeightForWidth(m_lStatus->sizePolicy().hasHeightForWidth());
|
||||
@ -169,8 +171,7 @@ ValuePage::retranslateUi() {
|
||||
|
||||
m_lStatusLabel->setText(QY("Status:"));
|
||||
if (m_present) {
|
||||
auto semantic = find_ebml_semantic(KaxSegment::ClassInfos, m_callbacks.GlobalId);
|
||||
if (semantic && semantic->Mandatory)
|
||||
if (!m_mayBeRemoved)
|
||||
m_lStatus->setText(Q("%1 %2").arg(QY("This element is currently present in the file.")).arg(QY("It cannot be removed because it is a mandatory header field.")));
|
||||
else
|
||||
m_lStatus->setText(Q("%1 %2").arg(QY("This element is currently present in the file.")).arg(QY("You can let the header editor remove the element from the file.")));
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
QLabel *m_lTitle{}, *m_lTypeLabel{}, *m_lType{}, *m_lDescriptionLabel{}, *m_lDescription{}, *m_lStatusLabel{}, *m_lStatus{}, *m_lOriginalValueLabel{}, *m_lOriginalValue{}, *m_lValueLabel{};
|
||||
|
||||
EbmlElement *m_element{};
|
||||
bool m_present{};
|
||||
bool m_present{}, m_mayBeRemoved{};
|
||||
|
||||
PageBase &m_topLevelPage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user