Kaydet (Commit) d9922775 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert unknown authority dialog to .ui

Change-Id: Iec8a8826188c81ff3a0e7e563d1f5f1a9921c180
üst e2e5689a
......@@ -34,7 +34,6 @@ $(eval $(call gb_SrsTarget_add_files,uui/res,\
uui/source/passworderrs.src \
uui/source/secmacrowarnings.src \
uui/source/trylater.src \
uui/source/unknownauthdlg.src \
))
# vim: set noet sw=4 ts=4:
......@@ -13,6 +13,7 @@ $(eval $(call gb_UIConfig_add_uifiles,uui,\
uui/uiconfig/ui/masterpassworddlg \
uui/uiconfig/ui/setmasterpassworddlg \
uui/uiconfig/ui/sslwarndialog \
uui/uiconfig/ui/unknownauthdialog \
))
# vim: set noet sw=4 ts=4:
......@@ -145,12 +145,8 @@ executeUnknownAuthDialog(
{
SolarMutexGuard aGuard;
boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui"));
boost::scoped_ptr< UnknownAuthDialog > xDialog(
new UnknownAuthDialog( pParent,
rXCert,
xContext,
xManager.get()));
new UnknownAuthDialog(pParent, rXCert, xContext));
// Get correct resource string
OUString aMessage;
......@@ -158,6 +154,7 @@ executeUnknownAuthDialog(
std::vector< OUString > aArguments;
aArguments.push_back( getContentPart( rXCert->getSubjectName()) );
boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui"));
if (xManager.get())
{
ResId aResId(RID_UUI_ERRHDL, *xManager.get());
......
......@@ -38,8 +38,6 @@
#define STR_ERROR_SIMPLE_PASSWORD_WRONG (RID_UUI_START + 23)
#define STR_ERROR_PASSWORD_TO_OPEN_WRONG (RID_UUI_START + 24)
#define STR_ERROR_PASSWORD_TO_MODIFY_WRONG (RID_UUI_START + 25)
#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26)
#define DLG_UUI_SSLWARN (RID_UUI_START + 28)
#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30)
#define STR_UNKNOWNUSER (RID_UUI_START + 31)
#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32)
......@@ -158,7 +156,6 @@
#define HID_DLG_LOGIN "UUI_HID_DLG_LOGIN"
#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_XMLSECDLG_MACROWARN "UUI_HID_XMLSECDLG_MACROWARN"
#define HID_DLG_NEWERVERSIONWARNING "UUI_HID_DLG_NEWERVERSIONWARNING"
......
......@@ -32,7 +32,7 @@ using namespace css;
IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl)
{
if ( m_aOptionButtonAccept.IsChecked() )
if ( m_pOptionButtonAccept->IsChecked() )
{
EndDialog( RET_OK );
} else
......@@ -47,10 +47,10 @@ IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl)
IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl)
{
uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
uno::Reference< ::css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
::com::sun::star::security::DocumentDigitalSignatures::createDefault(m_xContext) );
xDocumentDigitalSignatures = uno::Reference< ::css::security::XDocumentDigitalSignatures >(
::css::security::DocumentDigitalSignatures::createDefault(m_xContext) );
xDocumentDigitalSignatures.get()->showCertificate(getCert());
......@@ -59,32 +59,21 @@ IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl)
// -----------------------------------------------------------------------
UnknownAuthDialog::UnknownAuthDialog
(
Window* pParent,
UnknownAuthDialog::UnknownAuthDialog(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_UNKNOWNAUTH, *pResMgr ) ),
m_aCommandButtonOK ( this, ResId( PB_OK, *pResMgr ) ),
m_aCommandButtonCancel ( this, ResId( PB_CANCEL, *pResMgr ) ),
m_aCommandButtonHelp ( this, ResId( PB_HELP, *pResMgr ) ),
m_aView_Certificate ( this, ResId( PB_VIEW__CERTIFICATE, *pResMgr ) ),
m_aOptionButtonAccept ( this, ResId( RB_ACCEPT_1, *pResMgr ) ),
m_aOptionButtonDontAccept ( this, ResId( RB_DONTACCEPT_2, *pResMgr ) ),
m_aLine ( this, ResId( FL_LINE, *pResMgr ) ),
m_aLabel1 ( this, ResId( FT_LABEL_1, *pResMgr ) ),
m_aWarnImage ( this, ResId( IMG_WARN, *pResMgr ) ),
m_xContext ( xContext ),
m_rXCert ( rXCert )
const css::uno::Reference< css::uno::XComponentContext >& xContext)
: MessageDialog(pParent, "UnknownAuthDialog",
"uui/ui/unknownauthdialog.ui")
, m_xContext(xContext)
, m_rXCert(rXCert)
{
FreeResource();
get(m_pOptionButtonAccept, "accept");
get(m_pOptionButtonDontAccept, "reject");
get(m_pCommandButtonOK, "ok");
get(m_pView_Certificate, "examine");
m_aWarnImage.SetImage( WarningBox::GetStandardImage() );
m_aView_Certificate.SetClickHdl( LINK( this, UnknownAuthDialog, ViewCertHdl_Impl ) );
m_aCommandButtonOK.SetClickHdl( LINK( this, UnknownAuthDialog, OKHdl_Impl ) );
m_pView_Certificate->SetClickHdl(LINK(this, UnknownAuthDialog, ViewCertHdl_Impl));
m_pCommandButtonOK->SetClickHdl(LINK(this, UnknownAuthDialog, OKHdl_Impl));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,9 +19,8 @@
#ifndef UUI_UNKNOWNAUTH_HXX
#define UUI_UNKNOWNAUTH_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,18 +28,13 @@
//=====================================================================
//= Https_UADialog
//=====================================================================
class UnknownAuthDialog : public ModalDialog
class UnknownAuthDialog : public MessageDialog
{
private:
PushButton m_aCommandButtonOK;
CancelButton m_aCommandButtonCancel;
HelpButton m_aCommandButtonHelp;
PushButton m_aView_Certificate;
RadioButton m_aOptionButtonAccept;
RadioButton m_aOptionButtonDontAccept;
FixedLine m_aLine;
FixedText m_aLabel1;
FixedImage m_aWarnImage;
PushButton* m_pCommandButtonOK;
PushButton* m_pView_Certificate;
RadioButton* m_pOptionButtonAccept;
RadioButton* m_pOptionButtonDontAccept;
const css::uno::Reference< css::uno::XComponentContext >& m_xContext;
const css::uno::Reference< css::security::XCertificate >& m_rXCert;
......@@ -48,16 +42,20 @@ private:
DECL_LINK(OKHdl_Impl, void *);
DECL_LINK(ViewCertHdl_Impl, void *);
public:
UnknownAuthDialog( Window* pParent,
const css::uno::Reference< css::security::XCertificate >& rXCert,
const css::uno::Reference< css::uno::XComponentContext >& xContext,
ResMgr * pResMgr );
public:
UnknownAuthDialog(Window* pParent,
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; }
void setDescriptionText( const OUString &aText ) { m_aLabel1.SetText( aText ); }
css::uno::Reference< css::security::XCertificate > getCert()
{
return m_rXCert;
}
void setDescriptionText(const OUString &rText)
{
set_primary_text(rText);
}
};
#endif // UUI_UNKNOWNAUTH_HXX
......
/* -*- 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 <unknownauthdlg.hrc>
ModalDialog DLG_UUI_UNKNOWNAUTH
{
HelpId = HID_DLG_UNKNOWNAUTH_UUI;
Border = TRUE ;
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT( 136, 79 );
Size = MAP_APPFONT( DLG_WIDTH, DLG_HEIGHT );
Text [ en-US ] = "Website Certified by an Unknown Authority";
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;};
};
};
PushButton PB_VIEW__CERTIFICATE
{
HelpID = "uui:PushButton:DLG_UUI_UNKNOWNAUTH:PB_VIEW__CERTIFICATE";
Pos = MAP_APPFONT( DLG_TEXT_START_X, RSC_SP_DLG_INNERBORDER_TOP + DLG_TEXT_1_HEIGHT + RSC_SP_CTRL_GROUP_Y );
Size = MAP_APPFONT( 70, RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "Examine Certificate...";
};
HelpButton PB_HELP
{
Pos = MAP_APPFONT( DLG_CTLBTN_HELP_START_X, DLG_CTLBTN_START_Y );
Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
Text [ en-US ] = "Help";
};
PushButton PB_OK
{
HelpID = "uui:PushButton:DLG_UUI_UNKNOWNAUTH: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 ] = "OK";
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT( DLG_CTLBTN_CANCEL_START_X, DLG_CTLBTN_START_Y );
Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
};
RadioButton RB_ACCEPT_1
{
HelpID = "uui:RadioButton:DLG_UUI_UNKNOWNAUTH:RB_ACCEPT_1";
Pos = MAP_APPFONT( DLG_TEXT_START_X, DLG_RADIOBTN_START_Y );
Size = MAP_APPFONT( 182, RSC_CD_RADIOBUTTON_HEIGHT );
Text [ en-US ] = "Accept this certificate temporarily for this session";
Check = TRUE;
};
RadioButton RB_DONTACCEPT_2
{
HelpID = "uui:RadioButton:DLG_UUI_UNKNOWNAUTH:RB_DONTACCEPT_2";
Pos = MAP_APPFONT( DLG_TEXT_START_X, DLG_RADIOBTN_START_Y + RSC_CD_RADIOBUTTON_HEIGHT );
Size = MAP_APPFONT( 182, RSC_CD_RADIOBUTTON_HEIGHT );
Text [ en-US ] = "Do not accept this certificate and do not connect to this Web site";
};
FixedText FT_LABEL_1
{
Pos = MAP_APPFONT( DLG_TEXT_START_X, RSC_SP_DLG_INNERBORDER_TOP );
Size = MAP_APPFONT( 190, DLG_TEXT_1_HEIGHT );
Text [ en-US ] = "No Text";
Border = FALSE;
WordBreak = TRUE;
};
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: */
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkMessageDialog" id="UnknownAuthDialog">
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="title" translatable="yes">Website Certified by an Unknown Authority</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">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">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">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">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="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">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>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkRadioButton" id="accept">
<property name="label" translatable="yes">Accept this certificate temporarily for this session</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">reject</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="reject">
<property name="label" translatable="yes">Do not accept this certificate and do not connect to this Web site</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">accept</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="examine">
<property name="label" translatable="yes">Examine Certificate...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="1">ok</action-widget>
<action-widget response="0">cancel</action-widget>
<action-widget response="10">help</action-widget>
</action-widgets>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment