diff options
-rw-r--r-- | sfx2/AllLangResTarget_sfx2.mk | 1 | ||||
-rw-r--r-- | sfx2/Module_sfx2.mk | 1 | ||||
-rw-r--r-- | sfx2/UI_sfx.mk | 16 | ||||
-rw-r--r-- | sfx2/inc/sfx2/passwd.hxx | 91 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfx.hrc | 6 | ||||
-rw-r--r-- | sfx2/source/appl/sfx.src | 14 | ||||
-rw-r--r-- | sfx2/source/dialog/dialog.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 261 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.hrc | 47 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.src | 144 | ||||
-rw-r--r-- | sfx2/source/inc/helpid.hrc | 1 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/password.ui | 329 |
12 files changed, 489 insertions, 423 deletions
diff --git a/sfx2/AllLangResTarget_sfx2.mk b/sfx2/AllLangResTarget_sfx2.mk index 0d16f680e95c..e10645505b33 100644 --- a/sfx2/AllLangResTarget_sfx2.mk +++ b/sfx2/AllLangResTarget_sfx2.mk @@ -58,7 +58,6 @@ $(eval $(call gb_SrsTarget_add_files,sfx/res,\ sfx2/source/dialog/mailwindow.src \ sfx2/source/dialog/mgetempl.src \ sfx2/source/dialog/newstyle.src \ - sfx2/source/dialog/passwd.src \ sfx2/source/dialog/printopt.src \ sfx2/source/dialog/recfloat.src \ sfx2/source/dialog/securitypage.src \ diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk index 1e316eb9a6e1..993ee47d3cf7 100644 --- a/sfx2/Module_sfx2.mk +++ b/sfx2/Module_sfx2.mk @@ -24,6 +24,7 @@ $(eval $(call gb_Module_add_targets,sfx2,\ Library_sfx \ Package_inc \ Package_sdi \ + UI_sfx \ )) $(eval $(call gb_Module_add_check_targets,sfx2,\ diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk new file mode 100644 index 000000000000..a084da170522 --- /dev/null +++ b/sfx2/UI_sfx.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UI_UI,sfx)) + +$(eval $(call gb_UI_add_uifiles,sfx,\ + sfx2/uiconfig/ui/password \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index 2e07153973c1..d4fd5ee884f3 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -34,6 +34,7 @@ #include <vcl/dialog.hxx> #include <vcl/edit.hxx> #include <vcl/fixed.hxx> +#include <vcl/layout.hxx> #include <sfx2/app.hxx> // defines --------------------------------------------------------------- @@ -50,23 +51,23 @@ class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog { private: - FixedLine maPasswordBox; - FixedText maUserFT; - Edit maUserED; - FixedText maPasswordFT; - Edit maPasswordED; - FixedText maConfirmFT; - Edit maConfirmED; - FixedText maMinLengthFT; - FixedLine maPassword2Box; - FixedText maPassword2FT; - Edit maPassword2ED; - FixedText maConfirm2FT; - Edit maConfirm2ED; + VclFrame* mpPassword1Box; + FixedText* mpUserFT; + Edit* mpUserED; + FixedText* mpPassword1FT; + Edit* mpPassword1ED; + FixedText* mpConfirm1FT; + Edit* mpConfirm1ED; - OKButton maOKBtn; - CancelButton maCancelBtn; - HelpButton maHelpBtn; + VclFrame* mpPassword2Box; + FixedText* mpPassword2FT; + Edit* mpPassword2ED; + FixedText* mpConfirm2FT; + Edit* mpConfirm2ED; + + FixedText* mpMinLengthFT; + + OKButton* mpOKBtn; String maConfirmStr; String maMinLenPwdStr; @@ -76,28 +77,52 @@ private: sal_uInt16 mnExtras; bool mbAsciiOnly; - DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* ); + DECL_DLLPRIVATE_LINK(EditModifyHdl, Edit*); DECL_DLLPRIVATE_LINK(OKHdl, void *); void SetPasswdText(); public: - SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL ); - - String GetUser() const { return maUserED.GetText(); } - String GetPassword() const { return maPasswordED.GetText(); } - String GetConfirm() const { return maConfirmED.GetText(); } - - String GetPassword2() const { return maPassword2ED.GetText(); } - String GetConfirm2() const { return maConfirm2ED.GetText(); } - void SetGroup2Text( const String& i_rText ) { maPassword2Box.SetText( i_rText ); } - - void SetMinLen( sal_uInt16 Len ); - void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); } - void ShowExtras( sal_uInt16 nExtras ) { mnExtras = nExtras; } - void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; } - - virtual short Execute(); + SfxPasswordDialog(Window* pParent, const String* pGroupText = NULL); + + String GetUser() const + { + return mpUserED->GetText(); + } + String GetPassword() const + { + return mpPassword1ED->GetText(); + } + String GetConfirm() const + { + return mpConfirm1ED->GetText(); + } + String GetPassword2() const + { + return mpPassword2ED->GetText(); + } + String GetConfirm2() const + { + return mpConfirm2ED->GetText(); + } + void SetGroup2Text(const String& i_rText) + { + mpPassword2Box->set_label(i_rText); + } + void SetMinLen(sal_uInt16 Len); + void SetEditHelpId(const OString& rId) + { + mpPassword1ED->SetHelpId( rId ); + } + void ShowExtras(sal_uInt16 nExtras) + { + mnExtras = nExtras; + } + void AllowAsciiOnly(bool i_bAsciiOnly = true) + { + mbAsciiOnly = i_bAsciiOnly; + } + virtual short Execute(); }; #endif // #ifndef _SFX_PASSWD_HXX diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index c215a18aae91..7971b85ed241 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -155,7 +155,7 @@ #define STR_STANDARD (RID_SFX_START+104) #define STR_READONLY (RID_SFX_START+105) -#define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106) +#define STR_SFX_FILTERNAME_ALL (RID_SFX_START+106) #define STR_EDIT (RID_SFX_START+108) #define STR_QUERY_SAVE_DOCUMENT (RID_SFX_START+110) #define STR_BYTES (RID_SFX_START+111) @@ -166,10 +166,12 @@ #define STR_STANDARD_SHORTCUT (RID_SFX_START+117) #define STR_REPAIREDDOCUMENT (RID_SFX_START+118) - #define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119) #define STR_SHARED (RID_SFX_START+120) #define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121) +#define STR_PASSWD (RID_SFX_START+122) +#define STR_PASSWD_EMPTY (RID_SFX_START+123) +#define STR_PASSWD_MIN_LEN (RID_SFX_START+124) #define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157) //========================================================================= diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src index 0b5c765319a6..1103841a3000 100644 --- a/sfx2/source/appl/sfx.src +++ b/sfx2/source/appl/sfx.src @@ -23,3 +23,17 @@ String STR_ACCTITLE_PRODUCTIVITYTOOLS Text [ en-US ] = "%PRODUCTNAME"; }; +String STR_PASSWD_MIN_LEN +{ + Text [ en-US ] = "(Minimum $(MINLEN) characters)" ; +}; + +String STR_PASSWD_EMPTY +{ + Text [ en-US ] = "(The password can be empty)" ; +}; + +String STR_PASSWD +{ + Text [ en-US ] = "Password" ; +}; diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index 27a9eab17f84..e27579d17cb2 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -32,7 +32,6 @@ #define RID_DLG_ALIEN_WARNING ( RC_DIALOG_BEGIN + 0) #define STR_RESET ( RC_DIALOG_BEGIN + 0) -#define DLG_PASSWD ( RC_DIALOG_BEGIN + 8) #define STR_TABPAGE_MANAGESTYLES ( RC_DIALOG_BEGIN + 12) #define MSG_TABPAGE_INVALIDNAME ( RC_DIALOG_BEGIN + 13) #define MSG_TABPAGE_INVALIDSTYLE ( RC_DIALOG_BEGIN + 14) diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index ae48a4880212..77dc3524b0e0 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -35,20 +35,17 @@ #include "sfx2/sfxresid.hxx" #include "dialog.hrc" -#include "passwd.hrc" - -#include "vcl/arrange.hxx" // ----------------------------------------------------------------------- IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit ) { - if( mbAsciiOnly && (pEdit == &maPasswordED || pEdit == &maPassword2ED) ) + if (mbAsciiOnly && (pEdit == mpPassword1ED || pEdit == mpPassword2ED)) { - rtl::OUString aTest( pEdit->GetText() ); + OUString aTest( pEdit->GetText() ); const sal_Unicode* pTest = aTest.getStr(); sal_Int32 nLen = aTest.getLength(); - rtl::OUStringBuffer aFilter( nLen ); + OUStringBuffer aFilter( nLen ); bool bReset = false; for( sal_Int32 i = 0; i < nLen; i++ ) { @@ -65,10 +62,10 @@ IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit ) } } - bool bEnable = maPasswordED.GetText().Len() >= mnMinLen; - if( maPassword2ED.IsVisible() ) - bEnable = (bEnable && (maPassword2ED.GetText().Len() >= mnMinLen)); - maOKBtn.Enable( bEnable ); + bool bEnable = mpPassword1ED->GetText().Len() >= mnMinLen; + if( mpPassword2ED->IsVisible() ) + bEnable = (bEnable && (mpPassword2ED->GetText().Len() >= mnMinLen)); + mpOKBtn->Enable( bEnable ); return 0; } IMPL_LINK_INLINE_END(SfxPasswordDialog, EditModifyHdl, Edit *, pEdit) @@ -85,8 +82,8 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl) { ErrorBox aBox( this, SfxResId( MSG_ERROR_WRONG_CONFIRM ) ); aBox.Execute(); - maConfirmED.SetText( String() ); - maConfirmED.GrabFocus(); + mpConfirm1ED->SetText( String() ); + mpConfirm1ED->GrabFocus(); } else EndDialog( RET_OK ); @@ -95,103 +92,44 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl) // CTOR / DTOR ----------------------------------------------------------- -SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText ) : - - ModalDialog( pParent, SfxResId ( DLG_PASSWD ) ), - - maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ), - maUserFT ( this, SfxResId( FT_PASSWD_USER ) ), - maUserED ( this, SfxResId( ED_PASSWD_USER ) ), - maPasswordFT ( this, SfxResId( FT_PASSWD_PASSWORD ) ), - maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ), - maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ), - maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ), - - maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ), - maPassword2Box ( this, 0 ), - maPassword2FT ( this, SfxResId( FT_PASSWD_PASSWORD2 ) ), - maPassword2ED ( this, SfxResId( ED_PASSWD_PASSWORD2 ) ), - maConfirm2FT ( this, SfxResId( FT_PASSWD_CONFIRM2 ) ), - maConfirm2ED ( this, SfxResId( ED_PASSWD_CONFIRM2 ) ), - maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ), - maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ), - maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ), - - maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ).toString() ), - maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ).toString() ), - maMainPwdStr ( ), - mnMinLen ( 5 ), - mnExtras ( 0 ), - mbAsciiOnly ( false ) - +SfxPasswordDialog::SfxPasswordDialog(Window* pParent, const String* pGroupText) + : ModalDialog(pParent, "PasswordDialog", "sfx/ui/password.ui") + , maMinLenPwdStr(SFX2_RESSTR(STR_PASSWD_MIN_LEN)) + , maEmptyPwdStr(SFX2_RESSTR(STR_PASSWD_EMPTY)) + , mnMinLen(5) + , mnExtras(0) + , mbAsciiOnly(false) { - maPasswordED.SetAccessibleName(SfxResId(TEXT_PASSWD).toString()); - FreeResource(); - - // setup layout - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - xLayout->setOuterBorder( 0 ); - - // get edit size, should be used as minimum - Size aEditSize( maUserED.GetSizePixel() ); - - // add labelcolumn for the labeled edit fields - boost::shared_ptr<vcl::LabelColumn> xEdits( new vcl::LabelColumn( xLayout.get() ) ); - size_t nChildIndex = xLayout->addChild( xEdits ); - xLayout->setBorders( nChildIndex, -2, -2, -2, 0 ); + get(mpPassword1Box, "password1frame"); + get(mpUserFT, "userft"); + get(mpUserED, "usered"); + get(mpPassword1FT, "pass1ft"); + get(mpPassword1ED, "pass1ed"); + get(mpConfirm1FT, "confirm1ft"); + get(mpConfirm1ED, "confirm1ed"); - // add group box - xEdits->addWindow( &maPasswordBox ); + get(mpPassword2Box, "password2frame"); + get(mpPassword2FT, "pass2ft"); + get(mpPassword2ED, "pass2ed"); + get(mpConfirm2FT, "confirm2ft"); + get(mpConfirm2ED, "confirm2ed"); - // add user line - xEdits->addRow( &maUserFT, &maUserED, -2, aEditSize ); + get(mpMinLengthFT, "minlenft"); - // add password line - xEdits->addRow( &maPasswordFT, &maPasswordED, -2, aEditSize ); + get(mpOKBtn, "ok"); - // add confirm line - xEdits->addRow( &maConfirmFT, &maConfirmED, -2, aEditSize ); - - // add second group box - xEdits->addWindow( &maPassword2Box ); - - // add second password line - xEdits->addRow( &maPassword2FT, &maPassword2ED, -2, aEditSize ); - - // add second confirm line - xEdits->addRow( &maConfirm2FT, &maConfirm2ED, -2, aEditSize ); - - // add password length warning line - xEdits->addWindow( &maMinLengthFT ); - - // add a FixedLine - FixedLine* pLine = new FixedLine( this, 0 ); - pLine->Show(); - addWindow( pLine, true ); - xLayout->addWindow( pLine ); - - // add button column - Size aBtnSize( maCancelBtn.GetSizePixel() ); - boost::shared_ptr<vcl::RowOrColumn> xButtons( new vcl::RowOrColumn( xLayout.get(), false ) ); - nChildIndex = xLayout->addChild( xButtons ); - xLayout->setBorders( nChildIndex, -2, 0, -2, -2 ); - - xButtons->addWindow( &maHelpBtn, 0, aBtnSize ); - xButtons->addChild( new vcl::Spacer( xButtons.get() ) ); - xButtons->addWindow( &maOKBtn, 0, aBtnSize ); - xButtons->addWindow( &maCancelBtn, 0, aBtnSize ); + mpPassword1ED->SetAccessibleName(SFX2_RESSTR(STR_PASSWD)); Link aLink = LINK( this, SfxPasswordDialog, EditModifyHdl ); - maPasswordED.SetModifyHdl( aLink ); - maPassword2ED.SetModifyHdl( aLink ); + mpPassword1ED->SetModifyHdl( aLink ); + mpPassword2ED->SetModifyHdl( aLink ); aLink = LINK( this, SfxPasswordDialog, OKHdl ); - maOKBtn.SetClickHdl( aLink ); + mpOKBtn->SetClickHdl( aLink ); - if ( pGroupText ) - maPasswordBox.SetText( *pGroupText ); + if (pGroupText) + mpPassword1Box->set_label(*pGroupText); -//set the text to the pasword length + //set the text to the pasword length SetPasswdText(); } @@ -201,13 +139,12 @@ void SfxPasswordDialog::SetPasswdText( ) { //set the new string to the minimum password length if( mnMinLen == 0 ) - maMinLengthFT.SetText( maEmptyPwdStr ); + mpMinLengthFT->SetText(maEmptyPwdStr); else { maMainPwdStr = maMinLenPwdStr; - maMainPwdStr.SearchAndReplace( rtl::OUString("$(MINLEN)"), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); - maMinLengthFT.SetText( maMainPwdStr ); - maMinLengthFT.Show(); + maMainPwdStr.SearchAndReplace( OUString("$(MINLEN)"), String::CreateFromInt32((sal_Int32) mnMinLen ), 0); + mpMinLengthFT->SetText(maMainPwdStr); } } @@ -224,106 +161,42 @@ void SfxPasswordDialog::SetMinLen( sal_uInt16 nLen ) short SfxPasswordDialog::Execute() { - maUserFT.Hide(); - maUserED.Hide(); - maConfirmFT.Hide(); - maConfirmED.Hide(); - maPasswordFT.Hide(); - maPassword2Box.Hide(); - maPassword2FT.Hide(); - maPassword2ED.Hide(); - maPassword2FT.Hide(); - maConfirm2FT.Hide(); - maConfirm2ED.Hide(); - - if( mnExtras != SHOWEXTRAS_NONE ) - maPasswordFT.Show(); - if( (mnExtras & SHOWEXTRAS_USER ) ) + mpUserFT->Hide(); + mpUserED->Hide(); + mpConfirm1FT->Hide(); + mpConfirm1ED->Hide(); + mpPassword1FT->Hide(); + mpPassword2Box->Hide(); + mpPassword2FT->Hide(); + mpPassword2ED->Hide(); + mpPassword2FT->Hide(); + mpConfirm2FT->Hide(); + mpConfirm2ED->Hide(); + + if (mnExtras != SHOWEXTRAS_NONE) + mpPassword1FT->Show(); + if (mnExtras & SHOWEXTRAS_USER) { - //TODO: Inevitably this layout logic will be wrong post merge until we can see the dialog to test it. - Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT ); - Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); - long nMinHeight = maHelpBtn.GetPosPixel().Y() + - maHelpBtn.GetSizePixel().Height() + a6Size.Height(); - sal_uInt16 nRowHided = 1; - - if ( SHOWEXTRAS_NONE == mnExtras ) - { - maUserFT.Hide(); - maUserED.Hide(); - maConfirmFT.Hide(); - maConfirmED.Hide(); - maPasswordFT.Hide(); - - Point aPos = maUserFT.GetPosPixel(); - long nEnd = maUserED.GetPosPixel().X() + maUserED.GetSizePixel().Width(); - maPasswordED.SetPosPixel( aPos ); - Size aSize = maPasswordED.GetSizePixel(); - aSize.Width() = nEnd - aPos.X(); - maPasswordED.SetSizePixel( aSize ); - - nRowHided = 2; - } - else if ( SHOWEXTRAS_USER == mnExtras ) - { - maConfirmFT.Hide(); - maConfirmED.Hide(); - } - else if ( SHOWEXTRAS_CONFIRM == mnExtras ) - { - maUserFT.Hide(); - maUserED.Hide(); - - Point aPwdPos1 = maPasswordFT.GetPosPixel(); - Point aPwdPos2 = maPasswordED.GetPosPixel(); - - Point aPos = maUserFT.GetPosPixel(); - maPasswordFT.SetPosPixel( aPos ); - aPos = maUserED.GetPosPixel(); - maPasswordED.SetPosPixel( aPos ); - - aPos = maConfirmFT.GetPosPixel(); - maConfirmFT.SetPosPixel( aPwdPos1 ); - maConfirmED.SetPosPixel( aPwdPos2 ); - maMinLengthFT.SetPosPixel(aPos); - } - - Size aBoxSize = maPasswordBox.GetSizePixel(); - aBoxSize.Height() -= ( nRowHided * maUserED.GetSizePixel().Height() ); - aBoxSize.Height() -= ( nRowHided * a3Size.Height() ); - maPasswordBox.SetSizePixel( aBoxSize ); - - long nDlgHeight = maPasswordBox.GetPosPixel().Y() + aBoxSize.Height() + a6Size.Height(); - if ( nDlgHeight < nMinHeight ) - nDlgHeight = nMinHeight; - Size aDlgSize = GetOutputSizePixel(); - aDlgSize.Height() = nDlgHeight; - SetOutputSizePixel( aDlgSize ); - - maUserFT.Show(); - maUserED.Show(); + mpUserFT->Show(); + mpUserED->Show(); } - if( (mnExtras & SHOWEXTRAS_CONFIRM ) ) + if (mnExtras & SHOWEXTRAS_CONFIRM) { - maConfirmFT.Show(); - maConfirmED.Show(); + mpConfirm1FT->Show(); + mpConfirm1ED->Show(); } - if( (mnExtras & SHOWEXTRAS_PASSWORD2) ) + if (mnExtras & SHOWEXTRAS_PASSWORD2) { - maPassword2Box.Show(); - maPassword2FT.Show(); - maPassword2ED.Show(); + mpPassword2Box->Show(); + mpPassword2FT->Show(); + mpPassword2ED->Show(); } - if( (mnExtras & SHOWEXTRAS_CONFIRM2 ) ) + if (mnExtras & SHOWEXTRAS_CONFIRM2) { - maConfirm2FT.Show(); - maConfirm2ED.Show(); + mpConfirm2FT->Show(); + mpConfirm2ED->Show(); } - boost::shared_ptr<vcl::RowOrColumn> xLayout = - boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - SetSizePixel( xLayout->getOptimalSize( WINDOWSIZE_PREFERRED ) ); - return ModalDialog::Execute(); } diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc deleted file mode 100644 index cea12b57bf14..000000000000 --- a/sfx2/source/dialog/passwd.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 _SFX_PASSWD_HRC -#define _SFX_PASSWD_HRC - -// defines --------------------------------------------------------------- - -#define GB_PASSWD_PASSWORD 10 -#define FT_PASSWD_USER 11 -#define ED_PASSWD_USER 12 -#define FT_PASSWD_PASSWORD 13 -#define ED_PASSWD_PASSWORD 14 -#define FT_PASSWD_CONFIRM 15 -#define ED_PASSWD_CONFIRM 16 -#define FT_PASSWD_MINLEN 17 - -#define BTN_PASSWD_OK 20 -#define BTN_PASSWD_CANCEL 21 -#define BTN_PASSWD_HELP 22 - -#define FT_PASSWD_PASSWORD2 25 -#define ED_PASSWD_PASSWORD2 26 -#define FT_PASSWD_CONFIRM2 27 -#define ED_PASSWD_CONFIRM2 28 - -#define STR_PASSWD_MIN_LEN 30 -#define STR_PASSWD_EMPTY 31 - -#define TEXT_PASSWD 32 - -#endif - diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src deleted file mode 100644 index cc0393f7d9b9..000000000000 --- a/sfx2/source/dialog/passwd.src +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 . - */ - -#include "helpid.hrc" -#include "dialog.hrc" -#include "passwd.hrc" - - // DLG_PASSWD ------------------------------------------------------------ -ModalDialog DLG_PASSWD -{ - HelpId = HID_PASSWD ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT( 200, 68 ); - Text [ en-US ] = "Enter Password" ; - Moveable = TRUE ; - FixedText FT_PASSWD_USER - { - Pos = MAP_APPFONT( 12, 15 ); - Size = MAP_APPFONT( 42, 10 ); - Text [ en-US ] = "~User"; - }; - Edit ED_PASSWD_USER - { - HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_USER"; - Border = TRUE; - Pos = MAP_APPFONT( 57, 14 ); - Size = MAP_APPFONT( 75, 12 ); - }; - FixedText FT_PASSWD_PASSWORD - { - Pos = MAP_APPFONT( 12, 30 ); - Size = MAP_APPFONT( 42, 10 ); - Text [ en-US ] = "~Password"; - }; - Edit ED_PASSWD_PASSWORD - { - HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_PASSWORD"; - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT( 57, 29 ); - Size = MAP_APPFONT( 75, 12 ); - }; - FixedText FT_PASSWD_CONFIRM - { - Pos = MAP_APPFONT( 12, 45 ); - Size = MAP_APPFONT( 42, 10 ); - Text [ en-US ] = "~Confirm"; - }; - Edit ED_PASSWD_CONFIRM - { - HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_CONFIRM"; - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT( 57, 44 ); - Size = MAP_APPFONT( 75, 12 ); - }; - - String STR_PASSWD_MIN_LEN - { - Text [ en-US ] = "(Minimum $(MINLEN) characters)" ; - }; - String STR_PASSWD_EMPTY - { - Text [ en-US ] = "(The password can be empty)" ; - }; - - FixedText FT_PASSWD_MINLEN - { - Pos = MAP_APPFONT(12, 65 ); - Size = MAP_APPFONT( 126, 10 ); - }; - - FixedLine GB_PASSWD_PASSWORD - { - Pos = MAP_APPFONT( 6, 3 ); - Size = MAP_APPFONT( 132, 8 ); - Text [ en-US ] = "Password" ; - }; - FixedText FT_PASSWD_PASSWORD2 - { - Pos = MAP_APPFONT( 12, 30 ); - Size = MAP_APPFONT( 42, 10 ); - Text [ en-US ] = "P~assword"; - }; - Edit ED_PASSWD_PASSWORD2 - { - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT( 57, 29 ); - Size = MAP_APPFONT( 75, 12 ); - }; - FixedText FT_PASSWD_CONFIRM2 - { - Pos = MAP_APPFONT( 12, 45 ); - Size = MAP_APPFONT( 42, 10 ); - Text [ en-US ] = "Confir~m"; - }; - Edit ED_PASSWD_CONFIRM2 - { - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT( 57, 44 ); - Size = MAP_APPFONT( 75, 12 ); - }; - OKButton BTN_PASSWD_OK - { - Disable = TRUE; - Pos = MAP_APPFONT( 144, 6 ); - Size = MAP_APPFONT( 50, 14 ); - DefButton = TRUE; - }; - CancelButton BTN_PASSWD_CANCEL - { - Pos = MAP_APPFONT( 144, 23 ); - Size = MAP_APPFONT( 50, 14 ); - }; - HelpButton BTN_PASSWD_HELP - { - Pos = MAP_APPFONT( 144, 43 ); - Size = MAP_APPFONT( 50, 14 ); - }; - String TEXT_PASSWD - { - Text [ en-US ] = "Password" ; - }; - -}; - diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index c8c8ea40fbc3..0a1f71ffad1e 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -23,7 +23,6 @@ // Help-Ids ----------------------------------------------------------------- #define HID_DOCINFO_EDT "SFX2_HID_DOCINFO_EDT" -#define HID_PASSWD "SFX2_HID_PASSWD" #define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR" #define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES" #define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT" diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui new file mode 100644 index 000000000000..598535c3b8a7 --- /dev/null +++ b/sfx2/uiconfig/ui/password.ui @@ -0,0 +1,329 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="PasswordDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Enter Password</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</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="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</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="cancel"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</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="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkFrame" id="password1frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="userft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">User</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> + <child> + <object class="GtkLabel" id="pass1ft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Password</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="GtkLabel" id="confirm1ft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Confirm</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="GtkEntry" id="usered"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="pass1ed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="editable">False</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="confirm1ed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="editable">False</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Password</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="password2frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="pass2ft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Password</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> + <child> + <object class="GtkLabel" id="confirm2ft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Confirm</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="GtkEntry" id="pass2ed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="editable">False</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="confirm2ed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="editable">False</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Second Password</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="minlenft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="xpad">6</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="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">help</action-widget> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> +</interface> |