Replace the "Help Support" menu item by the "License Information" one

This commit is contained in:
Fridrich Štrba 2010-09-24 13:33:29 +02:00
parent 8787bad986
commit 07b5ca666c
12 changed files with 110 additions and 26 deletions

View File

@ -74,7 +74,7 @@
<menu:menuitem menu:id=".uno:HelpIndex"/> <menu:menuitem menu:id=".uno:HelpIndex"/>
<menu:menuitem menu:id=".uno:ExtendedHelp"/> <menu:menuitem menu:id=".uno:ExtendedHelp"/>
<menu:menuseparator/> <menu:menuseparator/>
<menu:menuitem menu:id=".uno:HelpSupport"/> <menu:menuitem menu:id=".uno:ShowLicense"/>
<menu:menuseparator/> <menu:menuseparator/>
<menu:menuitem menu:id=".uno:About"/> <menu:menuitem menu:id=".uno:About"/>
</menu:menupopup> </menu:menupopup>

View File

@ -4140,9 +4140,9 @@
<value xml:lang="en-US">Optio~n Bar</value> <value xml:lang="en-US">Optio~n Bar</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:HelpSupport" oor:op="replace"> <node oor:name=".uno:ShowLicense" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Support</value> <value xml:lang="en-US">License Information...</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:StatusBarVisible" oor:op="replace"> <node oor:name=".uno:StatusBarVisible" oor:op="replace">

View File

@ -46,3 +46,7 @@ $(SYSLICDEST)$/LICENSE_en-US : source$/license$/license_en-US.txt
$(SYSLICDEST)$/LICENSE_en-US.html : source$/license$/license_en-US.html $(SYSLICDEST)$/LICENSE_en-US.html : source$/license$/license_en-US.html
@-$(MKDIRHIER) $(SYSLICDEST) @-$(MKDIRHIER) $(SYSLICDEST)
$(COPY) $< $@ $(COPY) $< $@
$(SYSLICDEST)$/LICENSE.odt : source$/license$/license.odt
@-$(MKDIRHIER) $(SYSLICDEST)
$(COPY) $< $@

Binary file not shown.

View File

@ -0,0 +1,46 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# 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.
#
#*************************************************************************
PRJ=..
PRJNAME=readlicense_oo
TARGET=odt
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
all: $(MISC)$/LICENSE.odt
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
$(MISC)$/LICENSE.odt: LICENSE.odt
$(COPY) LICENSE.odt $@

View File

@ -2,5 +2,6 @@ ro readlicense_oo : l10n solenv LIBXSLT:libxslt NULL
ro readlicense_oo usr1 - all ro_root NULL ro readlicense_oo usr1 - all ro_root NULL
ro readlicense_oo\docs\readme nmake - all ro_readme NULL ro readlicense_oo\docs\readme nmake - all ro_readme NULL
ro readlicense_oo\html nmake - all ro_html NULL ro readlicense_oo\html nmake - all ro_html NULL
ro readlicense_oo\odt nmake - all ro_odt NULL
ro readlicense_oo nmake - all ro_conv NULL ro readlicense_oo nmake - all ro_conv NULL

View File

@ -10,6 +10,8 @@ dos: echo =====================================================================
# FIXME: is - can you solve this? # FIXME: is - can you solve this?
..\%__SRC%\misc\license\unx\LICENSE* %_DEST%\bin%_EXT%\osl ..\%__SRC%\misc\license\unx\LICENSE* %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\unx\LICENSE*.html %_DEST%\bin%_EXT%\osl ..\%__SRC%\misc\license\unx\LICENSE*.html %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\unx\LICENSE*.odt %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\wnt\LICENSE*.odt %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\wnt\license*.txt %_DEST%\bin%_EXT%\osl ..\%__SRC%\misc\license\wnt\license*.txt %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\wnt\license*.html %_DEST%\bin%_EXT%\osl ..\%__SRC%\misc\license\wnt\license*.html %_DEST%\bin%_EXT%\osl
..\%__SRC%\misc\license\wnt\license*.rtf %_DEST%\bin%_EXT%\osl ..\%__SRC%\misc\license\wnt\license*.rtf %_DEST%\bin%_EXT%\osl
@ -24,6 +26,8 @@ mkdir: %_DEST%\bin%_EXT%\ure
# Why? It comes from cws_src680_langsupporter. # Why? It comes from cws_src680_langsupporter.
..\%__SRC%\misc\THIRDPARTYLICENSEREADME.html %_DEST%\bin%_EXT%\THIRDPARTYLICENSEREADME.html ..\%__SRC%\misc\THIRDPARTYLICENSEREADME.html %_DEST%\bin%_EXT%\THIRDPARTYLICENSEREADME.html
..\%__SRC%\misc\LICENSE.odt %_DEST%\bin%_EXT%\LICENSE.odt
dos: echo ===================================================================== dos: echo =====================================================================
dos: echo Delivering README files dos: echo Delivering README files
dos: echo ===================================================================== dos: echo =====================================================================

View File

@ -124,7 +124,7 @@
#define SID_HELP_ZOOMOUT (SID_SFX_START + 418) #define SID_HELP_ZOOMOUT (SID_SFX_START + 418)
#define SID_HELP_HELPFILEBOX (SID_SFX_START + 419) #define SID_HELP_HELPFILEBOX (SID_SFX_START + 419)
#define SID_HELP_HELPFILEBOX_SELECTED (SID_SFX_START + 420) #define SID_HELP_HELPFILEBOX_SELECTED (SID_SFX_START + 420)
#define SID_HELP_SUPPORTPAGE (SID_SFX_START + 1683) #define SID_SHOW_LICENSE (SID_SFX_START + 1683)
#define SID_HELP_TUTORIALS (SID_SFX_START + 1695) #define SID_HELP_TUTORIALS (SID_SFX_START + 1695)
// default-ids for document // default-ids for document

View File

@ -167,7 +167,7 @@ interface Application
ExecMethod = MiscExec_Impl ; ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ; StateMethod = MiscState_Impl ;
] ]
SID_HELP_SUPPORTPAGE SID_SHOW_LICENSE
[ [
ExecMethod = MiscExec_Impl ; ExecMethod = MiscExec_Impl ;
] ]

View File

@ -7366,7 +7366,7 @@ SfxVoidItem UpdateConfiguration SID_UPDATE_CONFIG
] ]
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
SfxVoidItem HelpSupport SID_HELP_SUPPORTPAGE SfxVoidItem ShowLicense SID_SHOW_LICENSE
() ()
[ [
/* flags: */ /* flags: */

View File

@ -51,6 +51,8 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp> #include <com/sun/star/system/SystemShellExecuteException.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include "comphelper/configurationhelper.hxx" #include "comphelper/configurationhelper.hxx"
@ -74,6 +76,7 @@
#include <vcl/help.hxx> #include <vcl/help.hxx>
#include <vcl/stdtext.hxx> #include <vcl/stdtext.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
#include <unotools/pathoptions.hxx> #include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx> #include <unotools/moduleoptions.hxx>
@ -158,6 +161,23 @@ long QuitAgain_Impl( void* pObj, void* pArg )
return 0; return 0;
} }
namespace {
sal_Bool checkURL( const char *pName, rtl::OUString &rURL )
{
using namespace osl;
DirectoryItem aDirItem;
rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") );
rURL += rtl::OUString::createFromAscii( pName );
rtl::Bootstrap::expandMacros( rURL );
if (rURL.getLength() != 0)
return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None;
else
return sal_False;
}
}
void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{ {
DBG_MEMTEST(); DBG_MEMTEST();
@ -340,26 +360,35 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break; break;
} }
case SID_SHOW_LICENSE:
{
try {
Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
Sequence < com::sun::star::beans::PropertyValue > args(2);
args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
args[0].Value <<= sal_True;
args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
args[1].Value <<= sal_True;
rtl::OUString aURL;
if ( checkURL ( "LICENSE.odt", aURL ) ||
checkURL ( "LICENSE.html", aURL ) ||
checkURL ( "LICENSE", aURL ) ) {
xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args );
}
} catch (const ::com::sun::star::uno::Exception &) {
}
break;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_HELPINDEX: case SID_HELPINDEX:
case SID_HELP_SUPPORTPAGE:
{ {
Help* pHelp = Application::GetHelp(); Help* pHelp = Application::GetHelp();
if ( pHelp ) if ( pHelp )
{ {
ULONG nHelpId = ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE ) ? 66056 : 0; ULONG nHelpId = 0;
if ( 66056 == nHelpId ) pHelp->Start( nHelpId, NULL ); // show start page
{
// show Support page with new URL
String sHelpURL = SfxHelp::CreateHelpURL( nHelpId, String() );
String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) );
sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp");
sHelpURL += sParams;
sHelpURL += String::CreateFromAscii("&UseDB=no");
pHelp->Start( sHelpURL, NULL );
}
else
pHelp->Start( nHelpId, NULL ); // show start page
bDone = TRUE; bDone = TRUE;
} }
break; break;

View File

@ -1049,11 +1049,11 @@
HelpID = SID_HELPBALLOONS ; \ HelpID = SID_HELPBALLOONS ; \
Text [ en-US ] = "~Extended Tips" ; \ Text [ en-US ] = "~Extended Tips" ; \
#define ITEM_HELP_SUPPORTPAGE \ #define ITEM_SHOW_LICENSE \
Identifier = SID_HELP_SUPPORTPAGE ; \ Identifier = SID_SHOW_LICENSE ; \
Command = ".uno:HelpSupport" ; \ Command = ".uno:ShowLicense" ; \
HelpID = SID_HELP_SUPPORTPAGE ; \ HelpID = SID_SHOW_LICENSE ; \
Text [ en-US ] = "~Support" ; \ Text [ en-US ] = "License information..." ; \
#define ITEM_HELP_ONLINE_REGISTRATION \ #define ITEM_HELP_ONLINE_REGISTRATION \
Identifier = SID_ONLINE_REGISTRATION ; \ Identifier = SID_ONLINE_REGISTRATION ; \
@ -1106,7 +1106,7 @@
};\ };\
MenuItem\ MenuItem\
{\ {\
ITEM_HELP_SUPPORTPAGE\ ITEM_SHOW_MENU\
};\ };\
MenuItem\ MenuItem\
{\ {\