summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMoritz Duge <moritz.duge@allotropia.de>2024-07-04 19:53:29 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-07-25 10:21:39 +0200
commit36a589989660338bfaec65736f6a6b5b129d5e37 (patch)
tree677f76754bf638b9c0e20330181fa6ac6788c60f /xmlsecurity
parent27e5a74960f50ec041ef7c9e5026afe70a2b4adc (diff)
tdf#161909: Fix resizing and behavior for "View Certificate" dialog.
- Set appropriate larger default size. - Disable editing of details area. - Add comments to distinguish GPG and X.509 code. Change-Id: Idcca012c1eef96c6daa78498e85da6f70c97a90f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170004 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx12
-rw-r--r--xmlsecurity/uiconfig/ui/viewcertdialog.ui2
2 files changed, 10 insertions, 4 deletions
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 5d197490bac1..f0a763dd6251 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -156,15 +156,17 @@ void CertificateViewerDetailsTP::InsertElement(const OUString& rField, const OUS
m_xElementsLB->set_text(m_xElementsLB->n_children() -1, rValue, 1);
}
+// X.509 + GPG
CertificateViewerDetailsTP::CertificateViewerDetailsTP(weld::Container* pParent, CertificateViewer* pDlg)
: CertificateViewerTP(pParent, u"xmlsec/ui/certdetails.ui"_ustr, u"CertDetails"_ustr, pDlg)
, m_xElementsLB(mxBuilder->weld_tree_view(u"tablecontainer"_ustr))
, m_xValueDetails(mxBuilder->weld_text_view(u"valuedetails"_ustr))
{
- const int nWidth = m_xElementsLB->get_approximate_digit_width() * 60;
- const int nHeight = m_xElementsLB->get_height_rows(8);
+ const int nWidth = m_xElementsLB->get_approximate_digit_width() * 100;
+ const int nHeight = m_xElementsLB->get_height_rows(14);
m_xElementsLB->set_size_request(nWidth, nHeight);
m_xValueDetails->set_size_request(nWidth, nHeight);
+ m_xValueDetails->set_editable(false);
m_xElementsLB->set_column_fixed_widths( { nWidth / 2 } );
// fill list box
@@ -230,6 +232,7 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP(weld::Container* pParent,
aDetails = xmlsec::GetHexString( aSeq, pHexSep, nLineBreak );
InsertElement( XsResId( STR_THUMBPRINT_MD5 ), aLBEntry, aDetails, true );
+ m_xElementsLB->columns_autosize();
m_xElementsLB->connect_changed(LINK(this, CertificateViewerDetailsTP, ElementSelectHdl));
}
@@ -251,6 +254,7 @@ IMPL_LINK_NOARG(CertificateViewerDetailsTP, ElementSelectHdl, weld::TreeView&, v
m_xValueDetails->set_text(aElementText);
}
+// X.509
CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParent, CertificateViewer* pDlg)
: CertificateViewerTP(pParent, u"xmlsec/ui/certpage.ui"_ustr, u"CertPage"_ustr, pDlg)
, mpParent(pDlg)
@@ -262,11 +266,13 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParen
, mxCertOK(mxBuilder->weld_label(u"certok"_ustr))
, mxCertNotValidated(mxBuilder->weld_label(u"certnotok"_ustr))
{
- const int nWidth = mxCertPathLB->get_approximate_digit_width() * 60;
+ const int nWidth = mxCertPathLB->get_approximate_digit_width() * 100;
const int nHeight = mxCertPathLB->get_height_rows(6);
mxCertPathLB->set_size_request(nWidth, nHeight);
mxCertStatusML->set_size_request(nWidth, nHeight);
+ mxCertStatusML->set_editable(false);
+ mxCertPathLB->columns_autosize();
mxCertPathLB->connect_changed( LINK( this, CertificateViewerCertPathTP, CertSelectHdl ) );
mxViewCertPB->connect_clicked( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) );
}
diff --git a/xmlsecurity/uiconfig/ui/viewcertdialog.ui b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
index 9af0b89676e8..b00967671ba5 100644
--- a/xmlsecurity/uiconfig/ui/viewcertdialog.ui
+++ b/xmlsecurity/uiconfig/ui/viewcertdialog.ui
@@ -6,7 +6,7 @@
<property name="can-focus">False</property>
<property name="border-width">6</property>
<property name="title" translatable="yes" context="viewcertdialog|ViewCertDialog">View Certificate</property>
- <property name="resizable">False</property>
+ <property name="resizable">True</property>
<property name="modal">True</property>
<property name="default-width">0</property>
<property name="default-height">0</property>