Kaydet (Commit) dc57c8ce authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

TSCP: hide markings widgets if the list of markings is empty

Change-Id: I0d4a821935ef29b020409a34259a0c1fc487388f
Reviewed-on: https://gerrit.libreoffice.org/44183Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst aa73ca2e
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <svx/svxdllapi.h> #include <svx/svxdllapi.h>
#include <svx/ClassificationEditView.hxx> #include <svx/ClassificationEditView.hxx>
...@@ -32,6 +33,7 @@ private: ...@@ -32,6 +33,7 @@ private:
VclPtr<ListBox> m_pClassificationListBox; VclPtr<ListBox> m_pClassificationListBox;
VclPtr<ListBox> m_pRecentlyUsedListBox; VclPtr<ListBox> m_pRecentlyUsedListBox;
VclPtr<ListBox> m_pInternationalClassificationListBox; VclPtr<ListBox> m_pInternationalClassificationListBox;
VclPtr<FixedText> m_pMarkingLabel;
VclPtr<ListBox> m_pMarkingListBox; VclPtr<ListBox> m_pMarkingListBox;
VclPtr<ListBox> m_pIntellectualPropertyPartListBox; VclPtr<ListBox> m_pIntellectualPropertyPartListBox;
VclPtr<ListBox> m_pIntellectualPropertyPartNumberListBox; VclPtr<ListBox> m_pIntellectualPropertyPartNumberListBox;
......
...@@ -131,6 +131,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer ...@@ -131,6 +131,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
get(m_pRecentlyUsedListBox, "recentlyUsedCB"); get(m_pRecentlyUsedListBox, "recentlyUsedCB");
get(m_pClassificationListBox, "classificationCB"); get(m_pClassificationListBox, "classificationCB");
get(m_pInternationalClassificationListBox, "internationalClassificationCB"); get(m_pInternationalClassificationListBox, "internationalClassificationCB");
get(m_pMarkingLabel, "markingLabel");
get(m_pMarkingListBox, "markingCB"); get(m_pMarkingListBox, "markingCB");
get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberCB"); get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberCB");
get(m_pIntellectualPropertyPartListBox, "intellectualPropertyPartLB"); get(m_pIntellectualPropertyPartListBox, "intellectualPropertyPartLB");
...@@ -153,10 +154,18 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer ...@@ -153,10 +154,18 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent, const bool bPer
m_pInternationalClassificationListBox->InsertEntry(rName); m_pInternationalClassificationListBox->InsertEntry(rName);
m_pInternationalClassificationListBox->EnableAutoSize(true); m_pInternationalClassificationListBox->EnableAutoSize(true);
m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl)); if (!maHelper.GetMarkings().empty())
for (const OUString& rName : maHelper.GetMarkings()) {
m_pMarkingListBox->InsertEntry(rName); m_pMarkingListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectMarkingHdl));
m_pMarkingListBox->EnableAutoSize(true); for (const OUString& rName : maHelper.GetMarkings())
m_pMarkingListBox->InsertEntry(rName);
m_pMarkingListBox->EnableAutoSize(true);
}
else
{
m_pMarkingListBox->Show(false);
m_pMarkingLabel->Show(false);
}
m_pIntellectualPropertyPartNumberListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl)); m_pIntellectualPropertyPartNumberListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl));
for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers()) for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers())
...@@ -184,6 +193,7 @@ void ClassificationDialog::dispose() ...@@ -184,6 +193,7 @@ void ClassificationDialog::dispose()
m_pRecentlyUsedListBox.clear(); m_pRecentlyUsedListBox.clear();
m_pClassificationListBox.clear(); m_pClassificationListBox.clear();
m_pInternationalClassificationListBox.clear(); m_pInternationalClassificationListBox.clear();
m_pMarkingLabel.clear();
m_pMarkingListBox.clear(); m_pMarkingListBox.clear();
m_pIntellectualPropertyPartListBox.clear(); m_pIntellectualPropertyPartListBox.clear();
m_pIntellectualPropertyPartNumberListBox.clear(); m_pIntellectualPropertyPartNumberListBox.clear();
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="markingLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes" context="classificationdialog|label-Marking">Marking:</property> <property name="label" translatable="yes" context="classificationdialog|label-Marking">Marking:</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment