summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-21 20:57:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-21 21:14:29 +0000
commita5650e388de543501788b0745396ee1d25164c2a (patch)
tree845b114e5ae13e3f50e3c04cc92dde03d581f681 /uui
parent12b0a95b9777a46efc885811f5c7e7182855a834 (diff)
convert ssl warning dialog to .ui
Change-Id: I658cc3f1c63f8cfb18463befa3a0efbd92139659
Diffstat (limited to 'uui')
-rw-r--r--uui/AllLangResTarget_uui.mk1
-rw-r--r--uui/UIConfig_uui.mk1
-rw-r--r--uui/source/iahndl-ssl.cxx8
-rw-r--r--uui/source/ids.hrc1
-rw-r--r--uui/source/sslwarndlg.cxx57
-rw-r--r--uui/source/sslwarndlg.hrc54
-rw-r--r--uui/source/sslwarndlg.hxx30
-rw-r--r--uui/source/sslwarndlg.src95
-rw-r--r--uui/uiconfig/ui/sslwarndialog.ui78
9 files changed, 113 insertions, 212 deletions
diff --git a/uui/AllLangResTarget_uui.mk b/uui/AllLangResTarget_uui.mk
index 4ef3d39de5e9..84ea812bf3fa 100644
--- a/uui/AllLangResTarget_uui.mk
+++ b/uui/AllLangResTarget_uui.mk
@@ -33,7 +33,6 @@ $(eval $(call gb_SrsTarget_add_files,uui/res,\
uui/source/passworddlg.src \
uui/source/passworderrs.src \
uui/source/secmacrowarnings.src \
- uui/source/sslwarndlg.src \
uui/source/trylater.src \
uui/source/unknownauthdlg.src \
))
diff --git a/uui/UIConfig_uui.mk b/uui/UIConfig_uui.mk
index 3b34479de4c4..e826a48730ed 100644
--- a/uui/UIConfig_uui.mk
+++ b/uui/UIConfig_uui.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UIConfig_UIConfig,uui))
$(eval $(call gb_UIConfig_add_uifiles,uui,\
uui/uiconfig/ui/masterpassworddlg \
uui/uiconfig/ui/setmasterpassworddlg \
+ uui/uiconfig/ui/sslwarndialog \
))
# vim: set noet sw=4 ts=4:
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: */
diff --git a/uui/uiconfig/ui/sslwarndialog.ui b/uui/uiconfig/ui/sslwarndialog.ui
new file mode 100644
index 000000000000..3c522e0f81ac
--- /dev/null
+++ b/uui/uiconfig/ui/sslwarndialog.ui
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkMessageDialog" id="SSLWarnDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">Security Warning: </property>
+ <property name="resizable">False</property>
+ <property name="type_hint">dialog</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="message_type">warning</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="messagedialog-vbox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">24</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="messagedialog-action_area">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes">Continue</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes">Cancel Connection</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="view">
+ <property name="label" translatable="yes">View Certificate</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="1">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="-1">view</action-widget>
+ </action-widgets>
+ </object>
+</interface>