diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-07 10:41:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-07 12:45:12 +0000 |
commit | 81f7824a9839d3230b4e58424a64a393e8ee0223 (patch) | |
tree | 948445ce9cae177b4684bcbed2e410b554a4ade5 /xmlsecurity | |
parent | de5a8470ca79d549258bf9da1dea7d4a0c183946 (diff) |
xmlsecurity DigitalSignaturesDialog: show signature type on the UI
The code already knew if the signature was AdES-enabled or not, but that
info wasn't available on the UI.
The values are all names of standards, Andras says it's OK to have them
non-translatable.
Change-Id: I20baf0871fe2c84b04b7fc64014061e341744db8
Reviewed-on: https://gerrit.libreoffice.org/31718
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 26 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui | 13 |
2 files changed, 34 insertions, 5 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 382c21260319..3be036fe8637 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -132,7 +132,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( m_bAdESCompliant = !DocumentSignatureHelper::isODFPre_1_2(m_sODFVersion); - Size aControlSize(275, 109); + Size aControlSize(375, 109); const long nControlWidth = aControlSize.Width(); aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); SvSimpleTableContainer *pSignatures = get<SvSimpleTableContainer>("signatures"); @@ -141,12 +141,12 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( m_pSignaturesLB = VclPtr<SvSimpleTable>::Create(*pSignatures); // Give the first column 6 percent, try to distribute the rest equally. - static long aTabs[] = { 5, 0, 6*nControlWidth/100, 30*nControlWidth/100, 54*nControlWidth/100, 78*nControlWidth/100 }; + static long aTabs[] = { 6, 0, 6*nControlWidth/100, 25*nControlWidth/100, 44*nControlWidth/100, 62*nControlWidth/100, 81*nControlWidth/100 }; m_pSignaturesLB->SetTabs(aTabs); m_pSignaturesLB->InsertHeaderEntry("\t" + get<FixedText>("signed")->GetText() + "\t" + get<FixedText>("issued")->GetText() + "\t" + get<FixedText>("date")->GetText() + "\t" - + get<FixedText>("description")->GetText()); + + get<FixedText>("description")->GetText() + "\t" + get<FixedText>("type")->GetText()); mbVerifySignatures = true; mbSignaturesChanged = false; @@ -503,6 +503,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() OUString aIssuer; OUString aDateTimeStr; OUString aDescription; + OUString aType; bool bSigValid = false; bool bCertValid = false; @@ -527,6 +528,24 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() // String with date and time information (#i20172#) aDateTimeStr = XmlSec::GetDateTimeString( rInfo.stDateTime ); aDescription = rInfo.ouDescription; + + // Decide type string. + if (maSignatureManager.mxStore.is()) + { + // XML based: XAdES or not. + if (!rInfo.ouCertDigest.isEmpty()) + aType = "XAdES"; + else + aType = "XML-DSig"; + } + else + { + // Assume PDF: PAdES or not. + if (rInfo.bHasSigningCertificate) + aType = "PAdES"; + else + aType = "PDF"; + } } bSigValid = ( rInfo.nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED ); @@ -576,6 +595,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() m_pSignaturesLB->SetEntryText( aIssuer, pEntry, 2 ); m_pSignaturesLB->SetEntryText( aDateTimeStr, pEntry, 3 ); m_pSignaturesLB->SetEntryText(aDescription, pEntry, 4); + m_pSignaturesLB->SetEntryText(aType, pEntry, 5); pEntry->SetUserData( reinterpret_cast<void*>(n) ); // missuse user data as index } } diff --git a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui index 1e82fddc3177..d79d7e9e30a9 100644 --- a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui +++ b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui @@ -201,8 +201,17 @@ <packing> <property name="left_attach">3</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="type"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Signature type</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">0</property> </packing> </child> </object> |