1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/svapp.hxx>
22 #include <strings.hrc>
23 #include "unknownauthdlg.hxx"
25 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
30 IMPL_LINK_NOARG(UnknownAuthDialog
, OKHdl_Impl
, weld::Button
&, void)
32 if (m_xOptionButtonAccept
->get_active())
34 m_xDialog
->response(RET_OK
);
38 m_xDialog
->response(RET_CANCEL
);
42 IMPL_LINK_NOARG(UnknownAuthDialog
, ViewCertHdl_Impl
, weld::Button
&, void)
44 uno::Reference
< css::security::XDocumentDigitalSignatures
> xDocumentDigitalSignatures(
45 css::security::DocumentDigitalSignatures::createDefault(m_xContext
) );
46 xDocumentDigitalSignatures
->setParentWindow(m_xDialog
->GetXWindow());
47 xDocumentDigitalSignatures
->showCertificate(m_rXCert
);
50 UnknownAuthDialog::UnknownAuthDialog(weld::Window
* pParent
,
51 const css::uno::Reference
< css::security::XCertificate
>& rXCert
,
52 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
)
53 : MessageDialogController(pParent
, "uui/ui/unknownauthdialog.ui",
55 , m_xCommandButtonOK(m_xBuilder
->weld_button("ok"))
56 , m_xView_Certificate(m_xBuilder
->weld_button("examine"))
57 , m_xOptionButtonAccept(m_xBuilder
->weld_radio_button("accept"))
58 , m_xOptionButtonDontAccept(m_xBuilder
->weld_radio_button("reject"))
59 , m_xContext(xContext
)
62 m_xView_Certificate
->connect_clicked(LINK(this, UnknownAuthDialog
, ViewCertHdl_Impl
));
63 m_xCommandButtonOK
->connect_clicked(LINK(this, UnknownAuthDialog
, OKHdl_Impl
));
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */