diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:18:24 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:18:24 +0000 |
commit | 3dfe5a3feda289b66e92f17550e359d6c2460c0d (patch) | |
tree | 2d306b7ef59c57b80ed1b9ffab3224b0d95a83f2 /uui | |
parent | 13e27b36a954d5dac7e1b35e3752656050074c1d (diff) |
CWS-TOOLING: integrate CWS mav43
2008-12-17 14:42:56 +0100 tbo r265602 : #i97269# changed hid.lst and etab.win
2008-12-15 15:36:04 +0100 mav r265508 : #i95809# remove the stream as well
2008-12-12 13:20:09 +0100 mav r265411 : #i95809# small fixes
2008-12-12 13:12:07 +0100 mav r265410 : #i95809# fix streams handling
2008-12-12 10:45:29 +0100 mav r265397 : #i95809# close the stream if there is no storage
2008-12-12 10:24:38 +0100 mav r265396 : #i95809# close the stream if there is no temporary file
2008-12-12 00:56:13 +0100 mav r265383 : #i95809# adopt for linux
2008-12-12 00:51:25 +0100 mav r265382 : #i95809# adopt for linux
2008-12-12 00:38:31 +0100 mav r265381 : #i95809# check timestamp only if fs locking not active
2008-12-12 00:35:32 +0100 mav r265380 : #i95809# small fixes
2008-12-12 00:29:33 +0100 mav r265379 : #i95809# small fixes
2008-12-11 22:30:15 +0100 mav r265374 : #i97092# allow to use default master password
2008-12-11 22:20:56 +0100 mav r265372 : #i95809# avoid storage closing
2008-12-11 21:11:37 +0100 mav r265368 : #i97092# do not publish for now
2008-12-11 21:08:22 +0100 mav r265366 : #i95809# fix typo
2008-12-11 21:06:49 +0100 mav r265364 : #i95809# small fixes
2008-12-11 21:05:13 +0100 mav r265363 : #i95809# small fixes
2008-12-11 20:40:05 +0100 mav r265360 : #i95809# show warning if the document was touched
2008-12-11 20:39:44 +0100 mav r265359 : #i95809# show warning if the document was touched
2008-12-11 19:54:45 +0100 mav r265355 : #i95809# small fixes
2008-12-11 19:42:52 +0100 mav r265353 : #i95809# small fixes
2008-12-11 19:30:30 +0100 mav r265351 : #i95809# small fixes
2008-12-11 19:16:40 +0100 mav r265349 : #i95809# small fixes
2008-12-11 19:05:56 +0100 mav r265348 : #i95809# small fixes
2008-12-11 18:26:03 +0100 mav r265346 : #i95809# ignore the exception
2008-12-11 18:19:28 +0100 mav r265345 : #i95809# pure imput stream in case of local file URL means opening of document readonly
2008-12-11 17:41:56 +0100 mav r265341 : #i95809# unfortunately SfxMedium can not take the decision
2008-12-11 17:37:07 +0100 mav r265340 : #i95809# fix typo
2008-12-11 17:33:47 +0100 mav r265339 : #i95809# pure imput stream in case of local file URL means opening of document readonly
2008-12-11 16:12:26 +0100 mav r265330 : #i95809# let dialogs look better
2008-12-11 15:50:43 +0100 mav r265322 : #i97092# allow to use default master password
2008-12-11 13:35:39 +0100 mav r265295 : #i97092# allow to use default master password
2008-12-11 13:04:28 +0100 mav r265290 : #i97092# allow to use default master password
2008-12-11 12:34:52 +0100 mav r265284 : #i97092# allow to use default master password
2008-12-11 11:21:33 +0100 mav r265267 : #i95809# adopt for linux
2008-12-11 10:25:22 +0100 mav r265255 : #i97092# allow to use default master password
2008-12-11 10:24:35 +0100 mav r265254 : #i97092# allow to use default master password
2008-12-10 17:02:32 +0100 pb r265207 : fix: #i97092# more info text
2008-12-10 16:40:53 +0100 mav r265205 : #i95809# integrate new file locking UI in sfx workflow
2008-12-10 16:38:55 +0100 mav r265204 : #i95809# allow to ignore own lock on saving
2008-12-10 14:52:12 +0100 pb r265192 : fix: #i97092# new master password behavior
2008-12-10 14:51:22 +0100 pb r265191 : fix: #i97092# new master password bahavior
2008-12-10 14:49:46 +0100 pb r265189 : fix: #i97092# new master password bahavior
2008-12-10 10:55:19 +0100 mav r265155 : #i95809# allow to ignore own lock on saving
2008-12-09 17:47:51 +0100 mav r265124 : #i95809# allow to ignore own lock on saving
2008-12-07 11:24:57 +0100 mav r264949 : #i95809# let the request be derived from IOException
2008-12-05 18:31:35 +0100 mav r264915 : #i95809# use the locking related dialogs from InteractionHandler
2008-12-04 18:33:36 +0100 mav r264867 : #i95809# the requests for the new locking UI
2008-12-04 10:26:52 +0100 pb r264822 : fix: #i95809# new message boxes for locking
2008-12-04 10:23:51 +0100 pb r264821 : fix: #i95809# STR_OPENLOCKED_UNKNOWNUSER replaced by STR_UNKNOWNUSER
2008-12-04 10:18:23 +0100 pb r264820 : fix: #i95809# new message boxes for locking
2008-12-04 10:15:56 +0100 pb r264819 : fix: #i95809# new message boxes for locking
2008-12-03 16:06:46 +0100 mav r264796 : #i95809# system file locking support
2008-12-02 16:19:30 +0100 mav r264717 : #i95809# system file locking support
2008-12-02 16:07:10 +0100 mav r264716 : #i95809# system file locking support
2008-12-02 15:58:53 +0100 mav r264714 : #i95809# change the name
2008-12-02 15:58:06 +0100 mav r264713 : #i95809# do not allow to change ReadOnly flag in TypeDetection
2008-12-02 15:56:00 +0100 mav r264712 : #i95809# system file locking support
2008-12-02 15:43:20 +0100 mav r264708 : #i95809# change the name
2008-12-02 15:38:08 +0100 mav r264706 : #i95809# an options to control system file locking usage
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/alreadyopen.cxx | 63 | ||||
-rw-r--r-- | uui/source/alreadyopen.hxx | 43 | ||||
-rw-r--r-- | uui/source/alreadyopen.src | 65 | ||||
-rw-r--r-- | uui/source/filechanged.cxx | 52 | ||||
-rw-r--r-- | uui/source/filechanged.hxx | 43 | ||||
-rw-r--r-- | uui/source/filechanged.src | 49 | ||||
-rw-r--r-- | uui/source/iahndl.cxx | 186 | ||||
-rw-r--r-- | uui/source/iahndl.hxx | 23 | ||||
-rw-r--r-- | uui/source/ids.hrc | 27 | ||||
-rw-r--r-- | uui/source/lockfailed.cxx | 53 | ||||
-rw-r--r-- | uui/source/lockfailed.hxx | 45 | ||||
-rw-r--r-- | uui/source/lockfailed.src | 49 | ||||
-rw-r--r-- | uui/source/makefile.mk | 12 | ||||
-rw-r--r-- | uui/source/masterpasscrtdlg.cxx | 66 | ||||
-rw-r--r-- | uui/source/masterpasscrtdlg.hrc | 33 | ||||
-rw-r--r-- | uui/source/masterpasscrtdlg.hxx | 12 | ||||
-rw-r--r-- | uui/source/masterpasscrtdlg.src | 72 | ||||
-rw-r--r-- | uui/source/openlocked.src | 4 | ||||
-rw-r--r-- | uui/source/trylater.cxx | 54 | ||||
-rw-r--r-- | uui/source/trylater.hxx | 43 | ||||
-rw-r--r-- | uui/source/trylater.src | 53 |
21 files changed, 983 insertions, 64 deletions
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx new file mode 100644 index 000000000000..1f2b170f60fc --- /dev/null +++ b/uui/source/alreadyopen.cxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "ids.hrc" +#include "alreadyopen.hxx" + +AlreadyOpenQueryBox::AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage, sal_Bool bIsStoring ) : + MessBox(pParent, 0, + String( ResId( STR_ALREADYOPEN_TITLE, *pResMgr ) ), + aMessage ) +{ + SetImage( QueryBox::GetStandardImage() ); + + if ( bIsStoring ) + { + AddButton( String( ResId( STR_ALREADYOPEN_RETRY_SAVE_BTN, *pResMgr ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( String( ResId( STR_ALREADYOPEN_SAVE_BTN, *pResMgr ) ), RET_NO, 0 ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + } + else + { + AddButton( String( ResId( STR_ALREADYOPEN_READONLY_BTN, *pResMgr ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( String( ResId( STR_ALREADYOPEN_OPEN_BTN, *pResMgr ) ), RET_NO, 0 ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + } + + SetButtonHelpText( RET_YES, String::EmptyString() ); + SetButtonHelpText( RET_NO, String::EmptyString() ); +} + +AlreadyOpenQueryBox::~AlreadyOpenQueryBox() +{ +} + diff --git a/uui/source/alreadyopen.hxx b/uui/source/alreadyopen.hxx new file mode 100644 index 000000000000..2ba2db8a06b9 --- /dev/null +++ b/uui/source/alreadyopen.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _UUI_ALREADYOPEN_HXX +#define _UUI_ALREADYOPEN_HXX + +#include <vcl/msgbox.hxx> + +class AlreadyOpenQueryBox : public MessBox +{ +public: + AlreadyOpenQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage, sal_Bool bIsStoring ); + ~AlreadyOpenQueryBox(); +}; + +#endif + diff --git a/uui/source/alreadyopen.src b/uui/source/alreadyopen.src new file mode 100644 index 000000000000..e4222af91dce --- /dev/null +++ b/uui/source/alreadyopen.src @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.src,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define __RSC + +#ifndef UUI_IDS_HRC +#include <ids.hrc> +#endif + +String STR_ALREADYOPEN_TITLE +{ + Text = "Document in Use"; +}; +String STR_ALREADYOPEN_MSG +{ + Text [ en-US ] = "Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nOpen document read-only, or ignore own file locking and open the document for editing.\n\n"; +}; +String STR_ALREADYOPEN_READONLY_BTN +{ + Text [ en-US ] = "Open ~Read-Only"; +}; +String STR_ALREADYOPEN_OPEN_BTN +{ + Text [ en-US ] = "~Open"; +}; +String STR_ALREADYOPEN_SAVE_MSG +{ + Text [ en-US ] = "Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nClose document on other system and retry saving or ignore own file locking and save current document.\n\n"; +}; +String STR_ALREADYOPEN_RETRY_SAVE_BTN +{ + Text [ en-US ] = "~Retry Saving"; +}; +String STR_ALREADYOPEN_SAVE_BTN +{ + Text [ en-US ] = "~Save"; +}; + diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx new file mode 100644 index 000000000000..31e942309c0d --- /dev/null +++ b/uui/source/filechanged.cxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "ids.hrc" +#include "filechanged.hxx" + +FileChangedQueryBox::FileChangedQueryBox( Window* pParent, ResMgr* pResMgr ) : + MessBox(pParent, 0, + String( ResId( STR_FILECHANGED_TITLE, *pResMgr ) ), + String::EmptyString() ) +{ + SetImage( QueryBox::GetStandardImage() ); + + AddButton( String( ResId( STR_FILECHANGED_SAVEANYWAY_BTN, *pResMgr ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + + SetButtonHelpText( RET_YES, String::EmptyString() ); + SetMessText( String( ResId( STR_FILECHANGED_MSG, *pResMgr ) ) ); +} + +FileChangedQueryBox::~FileChangedQueryBox() +{ +} + diff --git a/uui/source/filechanged.hxx b/uui/source/filechanged.hxx new file mode 100644 index 000000000000..76f4ad3e8e97 --- /dev/null +++ b/uui/source/filechanged.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _UUI_FILECHANGED_HXX +#define _UUI_FILECHANGED_HXX + +#include <vcl/msgbox.hxx> + +class FileChangedQueryBox : public MessBox +{ +public: + FileChangedQueryBox( Window* pParent, ResMgr* pResMgr ); + ~FileChangedQueryBox(); +}; + +#endif + diff --git a/uui/source/filechanged.src b/uui/source/filechanged.src new file mode 100644 index 000000000000..4ebf0826e0a5 --- /dev/null +++ b/uui/source/filechanged.src @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.src,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define __RSC + +#ifndef UUI_IDS_HRC +#include <ids.hrc> +#endif + +String STR_FILECHANGED_TITLE +{ + Text = "Document Has Been Changed by Others"; +}; +String STR_FILECHANGED_MSG +{ + Text [ en-US ] = "The file has been changed since it was opened for editing in %PRODUCTNAME. Saving your version of the document will overwrite changes made by others.\n\nDo you want to save anyway?\n\n"; +}; +String STR_FILECHANGED_SAVEANYWAY_BTN +{ + Text [ en-US ] = "~Save Anyway"; +}; + diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 7c8781979629..ca5e13fa54c3 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -48,6 +48,10 @@ #include "com/sun/star/document/NoSuchFilterRequest.hpp" #include "com/sun/star/document/AmbigousFilterRequest.hpp" #include "com/sun/star/document/LockedDocumentRequest.hpp" +#include "com/sun/star/document/OwnLockOnDocumentRequest.hpp" +#include "com/sun/star/document/LockedOnSavingRequest.hpp" +#include "com/sun/star/document/ChangedByOthersRequest.hpp" +#include "com/sun/star/document/LockFileIgnoreRequest.hpp" #include "com/sun/star/document/XImporter.hpp" #include "com/sun/star/document/XInteractionFilterOptions.hpp" #include "com/sun/star/document/XInteractionFilterSelect.hpp" @@ -118,6 +122,10 @@ #include "sslwarndlg.hxx" #include "openlocked.hxx" #include "newerverwarn.hxx" +#include "alreadyopen.hxx" +#include "filechanged.hxx" +#include "trylater.hxx" +#include "lockfailed.hxx" #include <comphelper/processfactory.hxx> #include <svtools/zforlist.hxx> using namespace com::sun; @@ -1156,8 +1164,44 @@ void UUIInteractionHelper::handleDialogRequests( star::document::LockedDocumentRequest aLockedDocumentRequest; if (aAnyRequest >>= aLockedDocumentRequest ) { - handleLockedDocumentRequest( aLockedDocumentRequest, - rRequest->getContinuations() ); + handleLockedDocumentRequest( aLockedDocumentRequest.DocumentURL, + aLockedDocumentRequest.UserInfo, + rRequest->getContinuations(), + UUI_DOC_LOAD_LOCK ); + return; + } + + star::document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; + if (aAnyRequest >>= aOwnLockOnDocumentRequest ) + { + handleLockedDocumentRequest( aOwnLockOnDocumentRequest.DocumentURL, + aOwnLockOnDocumentRequest.TimeInfo, + rRequest->getContinuations(), + aOwnLockOnDocumentRequest.IsStoring ? UUI_DOC_OWN_SAVE_LOCK : UUI_DOC_OWN_LOAD_LOCK ); + return; + } + + star::document::LockedOnSavingRequest aLockedOnSavingRequest; + if (aAnyRequest >>= aLockedOnSavingRequest ) + { + handleLockedDocumentRequest( aLockedOnSavingRequest.DocumentURL, + aLockedOnSavingRequest.UserInfo, + rRequest->getContinuations(), + UUI_DOC_SAVE_LOCK ); + return; + } + + star::document::ChangedByOthersRequest aChangedByOthersRequest; + if (aAnyRequest >>= aChangedByOthersRequest ) + { + handleChangedByOthersRequest( rRequest->getContinuations() ); + return; + } + + star::document::LockFileIgnoreRequest aLockFileIgnoreRequest; + if (aAnyRequest >>= aLockFileIgnoreRequest ) + { + handleLockFileIgnoreRequest( rRequest->getContinuations() ); return; } } @@ -3306,10 +3350,12 @@ UUIInteractionHelper::handleBrokenPackageRequest( void UUIInteractionHelper::handleLockedDocumentRequest( - star::document::LockedDocumentRequest const & aRequest, + const ::rtl::OUString& aDocumentURL, + const ::rtl::OUString& aInfo, star::uno::Sequence< star::uno::Reference< star::task::XInteractionContinuation > > const & - rContinuations ) + rContinuations, + sal_uInt16 nMode ) SAL_THROW((star::uno::RuntimeException)) { star::uno::Reference< star::task::XInteractionApprove > xApprove; @@ -3329,22 +3375,49 @@ UUIInteractionHelper::handleLockedDocumentRequest( if (!xManager.get()) return; - ::rtl::OUString aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) ); + ::rtl::OUString aMessage; std::vector< rtl::OUString > aArguments; - aArguments.push_back( aRequest.DocumentURL ); - aArguments.push_back( aRequest.UserInfo.getLength() - ? aRequest.UserInfo - : ::rtl::OUString( String( ResId( STR_OPENLOCKED_UNKNOWNUSER, *xManager.get() ) ) ) ); + aArguments.push_back( aDocumentURL ); - aMessage = replaceMessageWithArguments( aMessage, aArguments ); + sal_Int32 nResult = RET_CANCEL; + if ( nMode == UUI_DOC_LOAD_LOCK ) + { + aArguments.push_back( aInfo.getLength() + ? aInfo + : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) ); + aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) ); + aMessage = replaceMessageWithArguments( aMessage, aArguments ); + + std::auto_ptr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox( + getParentProperty(), xManager.get(), aMessage ) ); + nResult = xDialog->Execute(); + } + else if ( nMode == UUI_DOC_SAVE_LOCK ) + { + aArguments.push_back( aInfo.getLength() + ? aInfo + : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) ); + aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) ); + aMessage = replaceMessageWithArguments( aMessage, aArguments ); + + std::auto_ptr< TryLaterQueryBox > xDialog(new TryLaterQueryBox( + getParentProperty(), xManager.get(), aMessage ) ); + nResult = xDialog->Execute(); + } + else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || nMode == UUI_DOC_OWN_SAVE_LOCK ) + { + aArguments.push_back( aInfo ); + aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK ? STR_ALREADYOPEN_SAVE_MSG : STR_ALREADYOPEN_MSG, *xManager.get() ) ); + aMessage = replaceMessageWithArguments( aMessage, aArguments ); - std::auto_ptr< OpenLockedQueryBox > - xDialog(new OpenLockedQueryBox( - getParentProperty(), xManager.get(), aMessage ) ); - sal_Int32 nResult = xDialog->Execute(); - if ( nResult == RET_YES ) // open the document readonly + std::auto_ptr< AlreadyOpenQueryBox > xDialog(new AlreadyOpenQueryBox( + getParentProperty(), xManager.get(), aMessage, nMode == UUI_DOC_OWN_SAVE_LOCK ) ); + nResult = xDialog->Execute(); + } + + if ( nResult == RET_YES ) xApprove->select(); - else if ( nResult == RET_NO ) // open the copy of the document + else if ( nResult == RET_NO ) xDisapprove->select(); else xAbort->select(); @@ -3357,3 +3430,84 @@ UUIInteractionHelper::handleLockedDocumentRequest( } } +void +UUIInteractionHelper::handleChangedByOthersRequest( + star::uno::Sequence< star::uno::Reference< + star::task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((star::uno::RuntimeException)) +{ + star::uno::Reference< star::task::XInteractionApprove > xApprove; + star::uno::Reference< star::task::XInteractionAbort > xAbort; + getContinuations( + rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0); + + if ( !xApprove.is() || !xAbort.is() ) + return; + + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if (!xManager.get()) + return; + + std::auto_ptr< FileChangedQueryBox > xDialog(new FileChangedQueryBox( + getParentProperty(), xManager.get() ) ); + sal_Int32 nResult = xDialog->Execute(); + + if ( nResult == RET_YES ) + xApprove->select(); + else + xAbort->select(); + } + catch (std::bad_alloc const &) + { + throw star::uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + star::uno::Reference< star::uno::XInterface >()); + } +} + +void +UUIInteractionHelper::handleLockFileIgnoreRequest( + star::uno::Sequence< star::uno::Reference< + star::task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((star::uno::RuntimeException)) +{ + star::uno::Reference< star::task::XInteractionApprove > xApprove; + star::uno::Reference< star::task::XInteractionAbort > xAbort; + getContinuations( + rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0); + + if ( !xApprove.is() || !xAbort.is() ) + return; + + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if (!xManager.get()) + return; + + std::auto_ptr< LockFailedQueryBox > xDialog(new LockFailedQueryBox( + getParentProperty(), xManager.get() ) ); + sal_Int32 nResult = xDialog->Execute(); + + if ( nResult == RET_OK ) + xApprove->select(); + else + xAbort->select(); + } + catch (std::bad_alloc const &) + { + throw star::uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + star::uno::Reference< star::uno::XInterface >()); + } +} + + diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index f3a82029dfad..b3257688cb8c 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -60,6 +60,11 @@ struct CntHTTPCookieRequest; #define DESCRIPTION_2 2 #define TITLE 3 +#define UUI_DOC_LOAD_LOCK 0 +#define UUI_DOC_OWN_LOAD_LOCK 1 +#define UUI_DOC_SAVE_LOCK 2 +#define UUI_DOC_OWN_SAVE_LOCK 3 + namespace cssu = com::sun::star::uno; namespace dcss = ::com::sun::star; @@ -68,7 +73,6 @@ namespace com { namespace sun { namespace star { class AmbigousFilterRequest; class FilterOptionsRequest; class NoSuchFilterRequest; - class LockedDocumentRequest; } namespace lang { class XMultiServiceFactory; @@ -374,11 +378,26 @@ private: rtl::OUString & rErrorString); void handleLockedDocumentRequest( - ::com::sun::star::document::LockedDocumentRequest const & aRequest, + const ::rtl::OUString& aDocumentURL, + const ::rtl::OUString& aInfo, + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + sal_uInt16 nMode ) + SAL_THROW((::com::sun::star::uno::RuntimeException)); + + void handleChangedByOthersRequest( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > const & rContinuations ) SAL_THROW((::com::sun::star::uno::RuntimeException)); + + void handleLockFileIgnoreRequest( + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((::com::sun::star::uno::RuntimeException)); + }; #endif // UUI_IAHNDL_HXX diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 047b96b100f4..bfe6a48aed94 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -65,11 +65,28 @@ #define DLG_UUI_SSLWARN (RID_UUI_START + 28) #define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29) #define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30) -#define STR_OPENLOCKED_TITLE (RID_UUI_START + 31) -#define STR_OPENLOCKED_MSG (RID_UUI_START + 32) -#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 33) -#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 34) -#define STR_OPENLOCKED_UNKNOWNUSER (RID_UUI_START + 35) +#define STR_UNKNOWNUSER (RID_UUI_START + 31) +#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32) +#define STR_OPENLOCKED_MSG (RID_UUI_START + 33) +#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34) +#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35) +#define STR_FILECHANGED_TITLE (RID_UUI_START + 36) +#define STR_FILECHANGED_MSG (RID_UUI_START + 37) +#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38) +#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39) +#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40) +#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41) +#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42) +#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43) +#define STR_LOCKFAILED_MSG (RID_UUI_START + 44) +#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45) +#define STR_TRYLATER_TITLE (RID_UUI_START + 46) +#define STR_TRYLATER_MSG (RID_UUI_START + 47) +#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48) +#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49) +#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50) +#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51) +#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) #define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 36) #define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx new file mode 100644 index 000000000000..20a3ff4798bd --- /dev/null +++ b/uui/source/lockfailed.cxx @@ -0,0 +1,53 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "ids.hrc" +#include "lockfailed.hxx" + +#include <vcl/button.hxx> + +LockFailedQueryBox::LockFailedQueryBox( Window* pParent, ResMgr* pResMgr ) : + MessBox(pParent, 0, + String( ResId( STR_LOCKFAILED_TITLE, *pResMgr ) ), + String::EmptyString() ) +{ + SetImage( ErrorBox::GetStandardImage() ); + + AddButton( BUTTON_OK, RET_OK, BUTTONDIALOG_OKBUTTON ); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + + SetMessText( String( ResId( STR_LOCKFAILED_MSG, *pResMgr ) ) ); + SetCheckBoxText( String( ResId( STR_LOCKFAILED_DONTSHOWAGAIN, *pResMgr ) ) ); +} + +LockFailedQueryBox::~LockFailedQueryBox() +{ +} + diff --git a/uui/source/lockfailed.hxx b/uui/source/lockfailed.hxx new file mode 100644 index 000000000000..9d368037475d --- /dev/null +++ b/uui/source/lockfailed.hxx @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _UUI_LOCKFAILED_HXX +#define _UUI_LOCKFAILED_HXX + +#include <vcl/msgbox.hxx> + +class CheckBox; + +class LockFailedQueryBox : public MessBox +{ +public: + LockFailedQueryBox( Window* pParent, ResMgr* pResMgr ); + ~LockFailedQueryBox(); +}; + +#endif + diff --git a/uui/source/lockfailed.src b/uui/source/lockfailed.src new file mode 100644 index 000000000000..6b21d6fc6448 --- /dev/null +++ b/uui/source/lockfailed.src @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.src,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define __RSC + +#ifndef UUI_IDS_HRC +#include <ids.hrc> +#endif + +String STR_LOCKFAILED_TITLE +{ + Text = "Document Could Not Be Locked"; +}; +String STR_LOCKFAILED_MSG +{ + Text [ en-US ] = "The file could not be locked for exclusive access by %PRODUCTNAME, due to missing permission to created a lock file on that file location."; +}; +String STR_LOCKFAILED_DONTSHOWAGAIN +{ + Text = "~Do not show this message again"; +}; + diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk index 456e28ce6b75..95b998ffd36d 100644 --- a/uui/source/makefile.mk +++ b/uui/source/makefile.mk @@ -1,8 +1,7 @@ #************************************************************************* -#************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -53,6 +52,10 @@ SLOFILES = \ $(SLO)$/unknownauthdlg.obj\ $(SLO)$/sslwarndlg.obj\ $(SLO)$/secmacrowarnings.obj\ + $(SLO)$/filechanged.obj\ + $(SLO)$/alreadyopen.obj\ + $(SLO)$/lockfailed.obj\ + $(SLO)$/trylater.obj\ $(SLO)$/newerverwarn.obj SRS1NAME=$(TARGET) @@ -70,6 +73,11 @@ SRC1FILES = \ unknownauthdlg.src\ sslwarndlg.src\ secmacrowarnings.src\ + filechanged.src\ + alreadyopen.src\ + lockfailed.src\ + trylater.src\ newerverwarn.src .INCLUDE: target.mk + diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx index 65a414a88542..30e8d1c64500 100644 --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -78,17 +78,25 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog ModalDialog( pParent, ResId( DLG_UUI_MASTERPASSWORD_CRT, *pResMgr ) ), - aFTMasterPasswordCrt ( this, ResId( FT_MASTERPASSWORD_CRT, *pResMgr ) ), - aEDMasterPasswordCrt ( this, ResId( ED_MASTERPASSWORD_CRT, *pResMgr ) ), + aFTInfoText ( this, ResId( FT_INFOTEXT, *pResMgr ) ), + aFLInfoText ( this, ResId( FL_INFOTEXT, *pResMgr ) ), + + aFTMasterPasswordCrt ( this, ResId( FT_MASTERPASSWORD_CRT, *pResMgr ) ), + aEDMasterPasswordCrt ( this, ResId( ED_MASTERPASSWORD_CRT, *pResMgr ) ), aFTMasterPasswordRepeat ( this, ResId( FT_MASTERPASSWORD_REPEAT, *pResMgr ) ), aEDMasterPasswordRepeat ( this, ResId( ED_MASTERPASSWORD_REPEAT, *pResMgr ) ), + + aFTCautionText ( this, ResId( FT_CAUTIONTEXT, *pResMgr ) ), + aFLCautionText ( this, ResId( FL_CAUTIONTEXT, *pResMgr ) ), + aFTMasterPasswordWarning ( this, ResId( FT_MASTERPASSWORD_WARNING, *pResMgr ) ), aFL ( this, ResId( FL_FIXED_LINE, *pResMgr ) ), aOKBtn ( this, ResId( BTN_MASTERPASSCRT_OK, *pResMgr ) ), aCancelBtn ( this, ResId( BTN_MASTERPASSCRT_CANCEL, *pResMgr ) ), aHelpBtn ( this, ResId( BTN_MASTERPASSCRT_HELP, *pResMgr ) ), + pResourceMgr ( pResMgr ), - nMinLen(5) + nMinLen ( 5 ) { FreeResource(); @@ -96,6 +104,8 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog aOKBtn.SetClickHdl( LINK( this, MasterPasswordCreateDialog, OKHdl_Impl ) ); aEDMasterPasswordCrt.SetModifyHdl( LINK( this, MasterPasswordCreateDialog, EditHdl_Impl ) ); + CalculateTextHeight(); + long nLableWidth = aFTMasterPasswordWarning.GetSizePixel().Width(); long nLabelHeight = aFTMasterPasswordWarning.GetSizePixel().Height(); long nTextWidth = aFTMasterPasswordWarning.GetCtrlTextWidth( aFTMasterPasswordWarning.GetText() ); @@ -128,3 +138,53 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog } }; +void MasterPasswordCreateDialog::CalculateTextHeight() +{ + Size aSize = aFTInfoText.GetSizePixel(); + Size aMinSize = aFTInfoText.CalcMinimumSize( aSize.Width() ); + long nDelta = 0; + + if ( aSize.Height() > aMinSize.Height() ) + { + aFTInfoText.SetSizePixel( aMinSize ); + nDelta = aSize.Height() - aMinSize.Height(); + Window* pWins[] = { &aFLInfoText, &aFTMasterPasswordCrt, &aEDMasterPasswordCrt, + &aFTMasterPasswordRepeat, &aEDMasterPasswordRepeat, &aFTCautionText, + &aFLCautionText, &aOKBtn, &aCancelBtn, &aHelpBtn }; + Window** pWindow = pWins; + const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[0] ); + for ( sal_Int32 i = 0; i < nCount; ++i, ++pWindow ) + { + Point aNewPos = (*pWindow)->GetPosPixel(); + aNewPos.Y() -= nDelta; + (*pWindow)->SetPosPixel( aNewPos ); + } + } + + aSize = aFTCautionText.GetSizePixel(); + aMinSize = aFTCautionText.CalcMinimumSize( aSize.Width() ); + + if ( aSize.Height() > aMinSize.Height() ) + { + aFTCautionText.SetSizePixel( aMinSize ); + long nTemp = aSize.Height() - aMinSize.Height(); + nDelta += nTemp; + Window* pWins[] = { &aFLCautionText, &aOKBtn, &aCancelBtn, &aHelpBtn }; + Window** pWindow = pWins; + const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[0] ); + for ( sal_Int32 i = 0; i < nCount; ++i, ++pWindow ) + { + Point aNewPos = (*pWindow)->GetPosPixel(); + aNewPos.Y() -= nTemp; + (*pWindow)->SetPosPixel( aNewPos ); + } + } + + if ( nDelta > 0 ) + { + Size aDlgSize = GetOutputSizePixel(); + aDlgSize.Height() -= nDelta; + SetSizePixel( aDlgSize ); + } +} + diff --git a/uui/source/masterpasscrtdlg.hrc b/uui/source/masterpasscrtdlg.hrc index dec23e7edabc..1c10e849fb5b 100644 --- a/uui/source/masterpasscrtdlg.hrc +++ b/uui/source/masterpasscrtdlg.hrc @@ -31,16 +31,45 @@ #ifndef UUI_MASTERPASSCRT_HRC #define UUI_MASTERPASSCRT_HRC +#include <svtools/controldims.hrc> + //============================================================================ -#define FT_MASTERPASSWORD_CRT 20 -#define ED_MASTERPASSWORD_CRT 21 + +#define FT_INFOTEXT 10 +#define FL_INFOTEXT 11 + +#define FT_MASTERPASSWORD_CRT 20 +#define ED_MASTERPASSWORD_CRT 21 #define FT_MASTERPASSWORD_REPEAT 22 #define ED_MASTERPASSWORD_REPEAT 23 #define FT_MASTERPASSWORD_WARNING 24 #define FL_FIXED_LINE 30 +#define FT_CAUTIONTEXT 30 +#define FL_CAUTIONTEXT 31 + #define BTN_MASTERPASSCRT_OK 50 #define BTN_MASTERPASSCRT_CANCEL 51 #define BTN_MASTERPASSCRT_HELP 52 +#define ROW_0 (RSC_SP_FLGR_INNERBORDER_TOP) +#define ROW_1 (ROW_0+7*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_2 (ROW_1+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_3 (ROW_2+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_4 (ROW_3+RSC_CD_TEXTBOX_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_5 (ROW_4+RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_6 (ROW_5+RSC_CD_TEXTBOX_HEIGHT+RSC_SP_CTRL_X) +#define ROW_7 (ROW_6+8*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_8 (ROW_7+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_CTRL_DESC_Y) +#define ROW_9 (ROW_8+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_X) + +#define COL_0 (RSC_SP_FLGR_INNERBORDER_LEFT) +#define COL_2 (DLG_WIDTH-RSC_SP_FLGR_INNERBORDER_LEFT-RSC_CD_PUSHBUTTON_WIDTH) +#define COL_1 (COL_2-RSC_SP_CTRL_GROUP_X-RSC_CD_PUSHBUTTON_WIDTH) + +#define DLG_WIDTH 180 +#define CTRL_WIDTH (DLG_WIDTH-2*RSC_SP_FLGR_INNERBORDER_LEFT) +#define DLG_HEIGHT (ROW_9) + #endif // UUI_MASTERPASSCRT_HRC + diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx index dba9ee0f130a..26d130a7a737 100644 --- a/uui/source/masterpasscrtdlg.hxx +++ b/uui/source/masterpasscrtdlg.hxx @@ -46,14 +46,22 @@ //============================================================================ class MasterPasswordCreateDialog : public ModalDialog { +private: + FixedText aFTInfoText; + FixedLine aFLInfoText; + FixedText aFTMasterPasswordCrt; Edit aEDMasterPasswordCrt; FixedText aFTMasterPasswordRepeat; Edit aEDMasterPasswordRepeat; + + FixedText aFTCautionText; + FixedLine aFLCautionText; + FixedText aFTMasterPasswordWarning; FixedLine aFL; OKButton aOKBtn; - CancelButton aCancelBtn; + CancelButton aCancelBtn; HelpButton aHelpBtn; @@ -68,6 +76,8 @@ public: private: ResMgr* pResourceMgr; sal_uInt16 nMinLen; + + void CalculateTextHeight(); }; #endif // UUI_MASTERPASSCRTDLG_HXX diff --git a/uui/source/masterpasscrtdlg.src b/uui/source/masterpasscrtdlg.src index cc16800feadd..e11d9abd166d 100644 --- a/uui/source/masterpasscrtdlg.src +++ b/uui/source/masterpasscrtdlg.src @@ -44,64 +44,74 @@ ModalDialog DLG_UUI_MASTERPASSWORD_CRT Moveable = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 175 ,135 ) ; + Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ; + Text [ en-US ] = "Set Master Password"; + FixedText FT_INFOTEXT + { + Pos = MAP_APPFONT ( COL_0 , ROW_0 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , 7*RSC_CD_FIXEDTEXT_HEIGHT ) ; + WordBreak = TRUE ; + Text [ en-US ] = "Passwords for web connections are protected by a master password. You will be asked to enter it once per session, if %PRODUCTNAME retrieves a password from the protected password list."; + }; + FixedLine FL_INFOTEXT + { + Pos = MAP_APPFONT ( 0 , ROW_1 ) ; + Size = MAP_APPFONT ( DLG_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ; + }; FixedText FT_MASTERPASSWORD_CRT { - Pos = MAP_APPFONT ( 3 , 4 ) ; - Size = MAP_APPFONT ( 169 , 9 ) ; - Text [ en-US ] = "Enter new password"; + Pos = MAP_APPFONT ( COL_0 , ROW_2 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ; + Text [ en-US ] = "~Enter password"; }; Edit ED_MASTERPASSWORD_CRT { + Pos = MAP_APPFONT ( COL_0 , ROW_3 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; - Pos = MAP_APPFONT ( 3 , 17 ) ; - Size = MAP_APPFONT ( 169 , 13 ) ; PassWord = TRUE ; }; FixedText FT_MASTERPASSWORD_REPEAT { - Pos = MAP_APPFONT ( 3 , 33 ) ; - Size = MAP_APPFONT ( 169 , 9 ) ; + Pos = MAP_APPFONT ( COL_0 , ROW_4 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ; Text [ en-US ] = "~Reenter password"; }; Edit ED_MASTERPASSWORD_REPEAT { + Pos = MAP_APPFONT ( COL_0 , ROW_5 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; - Pos = MAP_APPFONT ( 3 , 46 ) ; - Size = MAP_APPFONT ( 169 , 13 ) ; PassWord = TRUE ; }; - FixedText FT_MASTERPASSWORD_WARNING + FixedText FT_CAUTIONTEXT { - Pos = MAP_APPFONT ( 3 , 62 ) ; - Size = MAP_APPFONT ( 169 , 42 ) ; - Text [ en-US ] = "~Caution: Make sure you remember the Master Password you have set. If you forget your Master Password, you will be unable to access any of the information protected by it. Passwords are case-sensitive and at least five characters long."; - WordBreak = TRUE; + Pos = MAP_APPFONT ( COL_0 , ROW_6 ) ; + Size = MAP_APPFONT ( CTRL_WIDTH , 8*RSC_CD_FIXEDTEXT_HEIGHT ) ; + WordBreak = TRUE ; + Text [ en-US ] = "Caution: Make sure you remember the Master Password you have set. If you forget your Master Password, you will be unable to access any of the information protected by it. Passwords are case-sensitive and at least five characters long."; }; - FixedLine FL_FIXED_LINE
- {
- Pos = MAP_APPFONT( 0, 105 );
- Size = MAP_APPFONT( 175, 6 );
+ FixedLine FL_CAUTIONTEXT + { + Pos = MAP_APPFONT ( 0 , ROW_7 ) ; + Size = MAP_APPFONT ( DLG_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ; + }; + HelpButton BTN_MASTERPASSCRT_HELP + { + Pos = MAP_APPFONT ( COL_0 , ROW_8 ) ; + Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; }; - - OKButton BTN_MASTERPASSCRT_OK { - Pos = MAP_APPFONT ( 65 , 115 ) ; - Size = MAP_APPFONT ( 51 , 13 ) ; + Pos = MAP_APPFONT ( COL_1 , ROW_8 ) ; + Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; DefButton = TRUE ; }; CancelButton BTN_MASTERPASSCRT_CANCEL { - Pos = MAP_APPFONT ( 120 , 115 ) ; - Size = MAP_APPFONT ( 51 , 13 ) ; - }; - HelpButton BTN_MASTERPASSCRT_HELP - { - Pos = MAP_APPFONT ( 5 , 115 ) ; - Size = MAP_APPFONT ( 51 , 13 ) ; + Pos = MAP_APPFONT ( COL_2 , ROW_8 ) ; + Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; }; - Text [ en-US ] = "Change Master Password"; }; diff --git a/uui/source/openlocked.src b/uui/source/openlocked.src index 17f74b340fa1..58d65f54a4d3 100644 --- a/uui/source/openlocked.src +++ b/uui/source/openlocked.src @@ -40,7 +40,7 @@ String STR_OPENLOCKED_TITLE }; String STR_OPENLOCKED_MSG { - Text [ en-US ] = "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nOpen document read-only or open a copy of the document for editing."; + Text [ en-US ] = "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nOpen document read-only or open a copy of the document for editing.\n\n"; }; String STR_OPENLOCKED_OPENREADONLY_BTN { @@ -50,7 +50,7 @@ String STR_OPENLOCKED_OPENCOPY_BTN { Text [ en-US ] = "Open ~Copy"; }; -String STR_OPENLOCKED_UNKNOWNUSER +String STR_UNKNOWNUSER { Text [ en-US ] = "Unknown User"; }; diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx new file mode 100644 index 000000000000..9e7857dfc886 --- /dev/null +++ b/uui/source/trylater.cxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "ids.hrc" +#include "trylater.hxx" + +TryLaterQueryBox::TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ) : + MessBox(pParent, 0, + String( ResId( STR_TRYLATER_TITLE, *pResMgr ) ), + aMessage ) +{ + SetImage( QueryBox::GetStandardImage() ); + + AddButton( String( ResId( STR_TRYLATER_RETRYSAVING_BTN, *pResMgr ) ), RET_YES, + BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON); + AddButton( String( ResId( STR_TRYLATER_SAVEAS_BTN, *pResMgr ) ), RET_NO, 0); + AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON ); + + SetButtonHelpText( RET_YES, String::EmptyString() ); + SetButtonHelpText( RET_NO, String::EmptyString() ); +} + +TryLaterQueryBox::~TryLaterQueryBox() +{ +} + + diff --git a/uui/source/trylater.hxx b/uui/source/trylater.hxx new file mode 100644 index 000000000000..64140966fb3e --- /dev/null +++ b/uui/source/trylater.hxx @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _UUI_TRYLATER_HXX +#define _UUI_TRYLATER_HXX + +#include <vcl/msgbox.hxx> + +class TryLaterQueryBox : public MessBox +{ +public: + TryLaterQueryBox( Window* pParent, ResMgr* pResMgr, const String& aMessage ); + ~TryLaterQueryBox(); +}; + +#endif + diff --git a/uui/source/trylater.src b/uui/source/trylater.src new file mode 100644 index 000000000000..945ac8c74153 --- /dev/null +++ b/uui/source/trylater.src @@ -0,0 +1,53 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: openlocked.src,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define __RSC + +#ifndef UUI_IDS_HRC +#include <ids.hrc> +#endif + +String STR_TRYLATER_TITLE +{ + Text [ en-US ] = "Document in Use"; +}; +String STR_TRYLATER_MSG +{ + Text [ en-US ] = "Document file '$(ARG1)' is locked for editing by:\n\n$(ARG2)\n\nTry again later to save document or save a copy of that document.\n\n"; +}; +String STR_TRYLATER_RETRYSAVING_BTN +{ + Text [ en-US ] = "~Retry Saving"; +}; +String STR_TRYLATER_SAVEAS_BTN +{ + Text [ en-US ] = "~Save As..."; +}; + |