diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-21 20:57:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-21 21:14:29 +0000 |
commit | a5650e388de543501788b0745396ee1d25164c2a (patch) | |
tree | 845b114e5ae13e3f50e3c04cc92dde03d581f681 /uui/source | |
parent | 12b0a95b9777a46efc885811f5c7e7182855a834 (diff) |
convert ssl warning dialog to .ui
Change-Id: I658cc3f1c63f8cfb18463befa3a0efbd92139659
Diffstat (limited to 'uui/source')
-rw-r--r-- | uui/source/iahndl-ssl.cxx | 8 | ||||
-rw-r--r-- | uui/source/ids.hrc | 1 | ||||
-rw-r--r-- | uui/source/sslwarndlg.cxx | 57 | ||||
-rw-r--r-- | uui/source/sslwarndlg.hrc | 54 | ||||
-rw-r--r-- | uui/source/sslwarndlg.hxx | 30 | ||||
-rw-r--r-- | uui/source/sslwarndlg.src | 95 |
6 files changed, 34 insertions, 211 deletions
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 96c043a9ff7f..06d1167ba892 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -193,12 +193,8 @@ executeSSLWarnDialog( { SolarMutexGuard aGuard; - boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui")); boost::scoped_ptr< SSLWarnDialog > xDialog( - new SSLWarnDialog( pParent, - rXCert, - xContext, - xManager.get())); + new SSLWarnDialog(pParent, rXCert, xContext)); // Get correct resource string OUString aMessage_1; @@ -226,6 +222,8 @@ executeSSLWarnDialog( break; } + boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui")); + if (xManager.get()) { ResId aResId(RID_UUI_ERRHDL, *xManager.get()); diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 5f9aa50d7549..b5abde8b6b30 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -159,7 +159,6 @@ #define HID_DLG_FILTER_SELECT "UUI_HID_DLG_FILTER_SELECT" #define HID_DLG_PASSWORD_UUI "UUI_HID_DLG_PASSWORD_UUI" #define HID_DLG_UNKNOWNAUTH_UUI "UUI_HID_DLG_UNKNOWNAUTH_UUI" -#define HID_DLG_SSLWARN_UUI "UUI_HID_DLG_SSLWARN_UUI" #define HID_XMLSECDLG_MACROWARN "UUI_HID_XMLSECDLG_MACROWARN" #define HID_DLG_NEWERVERSIONWARNING "UUI_HID_DLG_NEWERVERSIONWARNING" diff --git a/uui/source/sslwarndlg.cxx b/uui/source/sslwarndlg.cxx index 312ce82b5c0b..4cc92dc9d64f 100644 --- a/uui/source/sslwarndlg.cxx +++ b/uui/source/sslwarndlg.cxx @@ -20,7 +20,6 @@ #include <vcl/msgbox.hxx> #include <ids.hrc> -#include <sslwarndlg.hrc> #include <sslwarndlg.hxx> #include <comphelper/processfactory.hxx> @@ -28,54 +27,38 @@ using namespace css; -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(SSLWarnDialog, OKHdl_Impl) -{ - EndDialog( RET_OK ); - return 1; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl) +void SSLWarnDialog::ViewCert() { - uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures; + uno::Reference< ::css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures; - xDocumentDigitalSignatures = ::com::sun::star::security::DocumentDigitalSignatures::createDefault( m_xContext ); + xDocumentDigitalSignatures = ::css::security::DocumentDigitalSignatures::createDefault( m_xContext ); xDocumentDigitalSignatures.get()->showCertificate(getCert()); - - return 0; } // ----------------------------------------------------------------------- -SSLWarnDialog::SSLWarnDialog -( - Window* pParent, +SSLWarnDialog::SSLWarnDialog(Window* pParent, const css::uno::Reference< css::security::XCertificate >& rXCert, - const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext, - ResMgr* pResMgr -) : - - ModalDialog( pParent, ResId( DLG_UUI_SSLWARN, *pResMgr ) ), - m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ), - m_aOkButton ( this, ResId( PB_OK, *pResMgr ) ), - m_aCancelButton ( this, ResId( PB_CANCEL, *pResMgr ) ), - m_aCommandButtonViewCert ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ), - m_aLine ( this, ResId( FL_LINE, *pResMgr ) ), - m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ), - m_xContext ( xContext ), - m_rXCert ( rXCert ) + const css::uno::Reference< css::uno::XComponentContext >& xContext) + : MessageDialog(pParent, "SSLWarnDialog", "uui/ui/sslwarndialog.ui") + , m_xContext(xContext) + , m_rXCert(rXCert) { - FreeResource(); - m_aWarnImage.SetImage( WarningBox::GetStandardImage() ); m_pParent = pParent; - m_aCommandButtonViewCert.SetClickHdl( LINK( this, SSLWarnDialog, ViewCertHdl_Impl ) ); - m_aOkButton.SetClickHdl( LINK( this, SSLWarnDialog, OKHdl_Impl ) ); }; - +void SSLWarnDialog::response(short nResponseId) +{ + switch (nResponseId) + { + case -1: + ViewCert(); + break; + default: + MessageDialog::response(nResponseId); + break; + } +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/sslwarndlg.hrc b/uui/source/sslwarndlg.hrc deleted file mode 100644 index 6367dfae6c1a..000000000000 --- a/uui/source/sslwarndlg.hrc +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef UUI_SSLWARN_HRC -#define UUI_SSLWARN_HRC - -#include <svtools/controldims.hrc> - -// local identifiers -#define FT_LABEL_1 1 -#define PB_OK 4 -#define PB_VIEW__CERTIFICATE 5 -#define PB_CANCEL 6 -#define IMG_WARN 7 -#define FL_LINE 9 - -// Dims - -#define DLG_WIDTH 240 -#define DLG_HEIGHT 125 - -#define DLG_WARMIMG_HEIGHT 20 -#define DLG_WARMIMG_WIDTH 20 - -#define DLG_TEXT_1_HEIGHT 90 - -#define DLG_TEXT_START_X RSC_SP_DLG_INNERBORDER_LEFT + DLG_WARMIMG_WIDTH + RSC_SP_CTRL_X - -#define DLG_CTLBTN_START_Y DLG_HEIGHT - RSC_SP_CTRL_X - RSC_CD_PUSHBUTTON_HEIGHT - -#define DLG_CTLBTN_CANCEL_PUSHBUTTON_WIDTH RSC_CD_PUSHBUTTON_WIDTH + 20 -#define DLG_CTLBTN_CANCEL_START_X DLG_WIDTH - 45 - DLG_CTLBTN_CANCEL_PUSHBUTTON_WIDTH -#define DLG_CTLBTN_OK_START_X DLG_CTLBTN_CANCEL_START_X - RSC_CD_PUSHBUTTON_WIDTH - RSC_SP_CTRL_GROUP_X -#define DLG_CTLBTN_CERT_PUSHBUTTON_WIDTH RSC_CD_PUSHBUTTON_WIDTH + 25 -#define DLG_CTLBTN_CERT_START_X DLG_TEXT_START_X -#endif //UUI_SSLWARN_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/sslwarndlg.hxx b/uui/source/sslwarndlg.hxx index 0f2ce7ab0a77..c843ed6a3654 100644 --- a/uui/source/sslwarndlg.hxx +++ b/uui/source/sslwarndlg.hxx @@ -19,9 +19,9 @@ #ifndef UUI_SSLWARN_HXX #define UUI_SSLWARN_HXX -#include <vcl/dialog.hxx> #include <vcl/fixed.hxx> #include <vcl/button.hxx> +#include <vcl/layout.hxx> #include <com/sun/star/security/XCertificate.hpp> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/uno/XComponentContext.hpp> @@ -29,35 +29,27 @@ //===================================================================== //= Https_WarnDialog //===================================================================== -class SSLWarnDialog : public ModalDialog +class SSLWarnDialog : public MessageDialog { private: - FixedText m_aLabel1; - PushButton m_aOkButton; - CancelButton m_aCancelButton; - PushButton m_aCommandButtonViewCert; - FixedLine m_aLine; - FixedImage m_aWarnImage; - - const css::uno::Reference< css::uno::XComponentContext >& m_xContext; const css::uno::Reference< css::security::XCertificate >& m_rXCert; Window* m_pParent; - DECL_LINK(OKHdl_Impl, void *); - DECL_LINK(ViewCertHdl_Impl, void *); + void ViewCert(); - public: +public: SSLWarnDialog( Window* pParent, - const css::uno::Reference< css::security::XCertificate >& rXCert, - const css::uno::Reference< css::uno::XComponentContext >& xContext, - ResMgr * pResMgr ); + const css::uno::Reference< css::security::XCertificate >& rXCert, + const css::uno::Reference< css::uno::XComponentContext >& xContext ); + + css::uno::Reference< css::security::XCertificate > getCert() { return m_rXCert; } - css::uno::Reference< css::security::XCertificate > getCert() { return m_rXCert; }; + Window* getParent() { return m_pParent; } - Window* getParent() { return m_pParent; }; + virtual void response(short nResponseId); - void setDescription1Text( const OUString &aText ) { m_aLabel1.SetText( aText ); }; + void setDescription1Text(const OUString &aText) { set_primary_text(aText); } }; #endif // UUI_SSLWARN_HXX diff --git a/uui/source/sslwarndlg.src b/uui/source/sslwarndlg.src deleted file mode 100644 index 3e28cc4689ec..000000000000 --- a/uui/source/sslwarndlg.src +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#define __RSC - -#include <ids.hrc> -#include <sslwarndlg.hrc> - -ModalDialog DLG_UUI_SSLWARN -{ - HelpId = HID_DLG_SSLWARN_UUI; - Border = TRUE ; - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT( DLG_WIDTH, DLG_HEIGHT ); - - Text [ en-US ] = "Security Warning: "; - - FixedText FT_LABEL_1 - { - Pos = MAP_APPFONT( DLG_TEXT_START_X, RSC_SP_DLG_INNERBORDER_TOP ); - Size = MAP_APPFONT( 195, DLG_TEXT_1_HEIGHT ); - - Text [ en-US ] = "No Text"; - - Border = FALSE; - WordBreak = TRUE; - }; - - PushButton PB_VIEW__CERTIFICATE - { - HelpID = "uui:PushButton:DLG_UUI_SSLWARN:PB_VIEW__CERTIFICATE"; - Pos = MAP_APPFONT( DLG_CTLBTN_CERT_START_X, DLG_CTLBTN_START_Y ); - Size = MAP_APPFONT( DLG_CTLBTN_CERT_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); - - Text [ en-US ] = "View Certificate"; - - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT( DLG_CTLBTN_CANCEL_START_X, DLG_CTLBTN_START_Y ); - Size = MAP_APPFONT( DLG_CTLBTN_CANCEL_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); - - Text [ en-US ] = "Cancel Connection"; - - }; - - PushButton PB_OK - { - HelpID = "uui:PushButton:DLG_UUI_SSLWARN:PB_OK"; - Pos = MAP_APPFONT( DLG_CTLBTN_OK_START_X, DLG_CTLBTN_START_Y ); - Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); - - Text [ en-US ] = "Continue"; - - }; - - FixedImage IMG_WARN - { - Pos = MAP_APPFONT( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ); - Size = MAP_APPFONT( DLG_WARMIMG_WIDTH , DLG_WARMIMG_HEIGHT ); - - Fixed = Image - { - /* ImageBitmap = Bitmap { File = "certificate_40x56.png"; }; */ - MaskColor = Color{Red=0xffff;Green=0x0000;Blue=0xffff;}; - }; - - }; - - FixedLine FL_LINE - { - Pos = MAP_APPFONT( 0, DLG_CTLBTN_START_Y - RSC_SP_FLGR_INNERBORDER_TOP - RSC_CD_FIXEDLINE_HEIGHT ); - Size = MAP_APPFONT( DLG_WIDTH, RSC_CD_FIXEDLINE_HEIGHT ); - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |