Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 17DB791DA for ; Mon, 18 Jun 2012 19:12:58 +0000 (UTC) Received: (qmail 38838 invoked by uid 500); 18 Jun 2012 19:12:58 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 38807 invoked by uid 500); 18 Jun 2012 19:12:57 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 38796 invoked by uid 99); 18 Jun 2012 19:12:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2012 19:12:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2012 19:12:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 807B72388C06; Mon, 18 Jun 2012 19:12:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1351463 - in /incubator/ooo/trunk/main: cui/source/dialogs/ cui/source/inc/ scp2/source/ooo/ svtools/inc/svtools/ svx/ svx/source/intro/ Date: Mon, 18 Jun 2012 19:12:30 -0000 To: ooo-commits@incubator.apache.org From: arielch@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120618191230.807B72388C06@eris.apache.org> Author: arielch Date: Mon Jun 18 19:12:29 2012 New Revision: 1351463 URL: http://svn.apache.org/viewvc?rev=1351463&view=rev Log: i119418 - Some Improvements in the About Dialog Removed: incubator/ooo/trunk/main/svx/AllLangResTarget_about.mk incubator/ooo/trunk/main/svx/source/intro/about_ooo.hrc incubator/ooo/trunk/main/svx/source/intro/about_ooo.src Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.cxx incubator/ooo/trunk/main/cui/source/dialogs/about.hrc incubator/ooo/trunk/main/cui/source/dialogs/about.src incubator/ooo/trunk/main/cui/source/inc/about.hxx incubator/ooo/trunk/main/scp2/source/ooo/common_brand.scp incubator/ooo/trunk/main/svtools/inc/svtools/svtools.hrc incubator/ooo/trunk/main/svx/Module_svx.mk Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.cxx?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/cui/source/dialogs/about.cxx (original) +++ incubator/ooo/trunk/main/cui/source/dialogs/about.cxx Mon Jun 18 19:12:29 2012 @@ -45,349 +45,292 @@ #include #include +#include +#include +#include + // defines --------------------------------------------------------------- -#define SCROLL_OFFSET 1 -#define SPACE_OFFSET 5 -#define SCROLL_TIMER 30 +#define _STRINGIFY(x) #x +#define STRINGIFY(x) _STRINGIFY(x) -#define WELCOME_URL DEFINE_CONST_UNICODE( "http://www.openoffice.org/welcome/credits.html" ) +// ----------------------------------------------------------------------- -// class AboutDialog ----------------------------------------------------- -static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size ) +static void layoutFixedText( FixedText &rControl, const Point& aPos, Size &aSize, const long nTextWidth ) { - Point aTextPos = rText.GetPosPixel(); - aTextPos.X() = a6Size.Width() * 2; - aTextPos.Y() = nY; - rText.SetPosPixel( aTextPos ); - - Size aTxtSiz = rText.GetSizePixel(); - aTxtSiz.Width() = nTextWidth; - Size aCalcSize = rText.CalcMinimumSize( nTextWidth ); - aTxtSiz.Height() = aCalcSize.Height(); - rText.SetSizePixel( aTxtSiz ); + aSize = rControl.GetSizePixel(); + // change the width + aSize.Width() = nTextWidth; + // set Position and Size, to calculate the minimum size + // this will update the Height + rControl.SetPosSizePixel( aPos, aSize ); + aSize = rControl.CalcMinimumSize(); + // update the size with the right Height + rControl.SetSizePixel( aSize ); +} - nY += aTxtSiz.Height(); +static void layoutEdit( Edit &rControl, const Point& aPos, Size &aSize, const long nTextWidth ) +{ + aSize = rControl.GetSizePixel(); + // change the width + aSize.Width() = nTextWidth; + // set Position and Size, to calculate the minimum size + // this will update the Height + rControl.SetPosSizePixel( aPos, aSize ); + aSize = rControl.CalcMinimumSize(); + // update the size with the right Height + rControl.SetSizePixel( aSize ); } -String InitDevVersionStr() +// ----------------------------------------------------------------------- + +AboutDialog::AboutDialog( Window* pParent, const ResId& rId ) : + SfxModalDialog( pParent, rId ), + maOKButton( this, ResId( RID_CUI_ABOUT_BTN_OK, *rId.GetResMgr() ) ), + maVersionText( this, ResId( RID_CUI_ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), + maBuildInfoEdit( this, ResId( RID_CUI_ABOUT_FTXT_BUILDDATA, *rId.GetResMgr() ) ), + maCopyrightEdit( this, ResId( RID_CUI_ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), + maCreditsLink( this, ResId( RID_CUI_ABOUT_FTXT_WELCOME_LINK, *rId.GetResMgr() ) ), + maCopyrightTextStr( ResId( RID_CUI_ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ) { - String sDefault; - String sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) ); - OSL_ENSURE( sBuildId.Len() > 0, "No BUILDID in bootstrap file" ); + // load image from module path + maAppLogo = SfxApplication::GetApplicationLogo(); - String sProductSource( utl::Bootstrap::getProductSource( sDefault ) ); - OSL_ENSURE( sProductSource.Len() > 0, "No ProductSource in bootstrap file" ); + InitControls(); - // the product source is something like "DEV300", where the - // build id is something like "300m12(Build:12345)". For better readability, - // strip the duplicate UPD ("300"). - if ( sProductSource.Len() ) - { - bool bMatchingUPD = - ( sProductSource.Len() >= 3 ) - && ( sBuildId.Len() >= 3 ) - && ( sProductSource.Copy( sProductSource.Len() - 3 ) == sBuildId.Copy( 0, 3 ) ); - OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); - if ( bMatchingUPD ) - sProductSource = sProductSource.Copy( 0, sProductSource.Len() - 3 ); + // set links + maCreditsLink.SetClickHdl( LINK( this, AboutDialog, OpenLinkHdl_Impl ) ); - // prepend the product source - sBuildId.Insert( sProductSource, 0 ); - } - - return sBuildId; + FreeResource(); + + SetHelpId( CMD_SID_ABOUT ); } -AboutDialog::AboutDialog( Window* pParent, const ResId& rId ) : +// ----------------------------------------------------------------------- - SfxModalDialog ( pParent, rId ), +AboutDialog::~AboutDialog() +{ +} - aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ), - aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), - aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), - aBuildData ( this ), - pDeveloperAry(0), - aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ), - aTimer (), - nOff ( 0 ), - m_nDeltaWidth ( 0 ), - m_nPendingScrolls( 0 ), - bNormal ( sal_True ) -{ - aDevVersionStr = InitDevVersionStr(); - - ::com::sun::star::lang::Locale aLocale; - ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "about", aLocale ); - if ( pResMgr ) - { - aCopyrightTextStr = String( ResId( ABOUT_STR_COPYRIGHT, *pResMgr ) ); - pDeveloperAry = new ResStringArray( ResId( ABOUT_STR_DEVELOPER_ARY, *pResMgr ) ); - delete pResMgr; - } +// ----------------------------------------------------------------------- - rtl::OUString sProduct; - utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct; +void AboutDialog::InitControls() +{ + // apply font, background et al. + ApplyStyleSettings(); - // load image from module path - aAppLogo = SfxApplication::GetApplicationLogo(); + // set strings + maCopyrightEdit.SetText( maCopyrightTextStr ); + maBuildInfoEdit.SetText( GetBuildVersionString() ); + maCreditsLink.SetURL( maCreditsLink.GetText() ); - // Transparenter Font - Font aFont = GetFont(); + // determine size and position of the dialog & elements + Size aDlgSize; + LayoutControls( aDlgSize ); + + // Change the width of the dialog + SetOutputSizePixel( aDlgSize ); +} + +// ----------------------------------------------------------------------- + +void AboutDialog::ApplyStyleSettings() +{ + // Transparenter Font + Font aFont = GetFont(); aFont.SetTransparent( sal_True ); - SetFont( aFont ); + SetFont( aFont ); - // if necessary more info - String sVersion = aVersionText.GetText(); - sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() ); - aVersionText.SetText( sVersion ); - - // Initialisierung fuer Aufruf Entwickler - if ( aAccelStr.Len() && ByteString(U2S(aAccelStr)).IsAlphaAscii() ) - { - Accelerator *pAccel = 0, *pPrevAccel = 0, *pFirstAccel = 0; - aAccelStr.ToUpperAscii(); - - for ( sal_uInt16 i = 0; i < aAccelStr.Len(); ++i ) - { - pPrevAccel = pAccel; - pAccel = new Accelerator; - aAccelList.Insert( pAccel, LIST_APPEND ); - sal_uInt16 nKey = aAccelStr.GetChar(i) - 'A' + KEY_A; - pAccel->InsertItem( 1, KeyCode( nKey, KEY_MOD1 ) ); - if ( i > 0 ) - pPrevAccel->SetAccel( 1, pAccel ); - if ( i == 0 ) - pFirstAccel = pAccel; - } - pAccel->SetSelectHdl( LINK( this, AboutDialog, AccelSelectHdl ) ); - GetpApp()->InsertAccel( pFirstAccel ); - } - - // set for background and text the correct system color - const StyleSettings& rSettings = GetSettings().GetStyleSettings(); - Color aWhiteCol( rSettings.GetWindowColor() ); - Wallpaper aWall( aWhiteCol ); - SetBackground( aWall ); - Font aNewFont( aCopyrightText.GetFont() ); - aNewFont.SetTransparent( sal_True ); - - aVersionText.SetFont( aNewFont ); - aCopyrightText.SetFont( aNewFont ); - - aVersionText.SetBackground(); - aCopyrightText.SetBackground(); - - Color aTextColor( rSettings.GetWindowTextColor() ); - aVersionText.SetControlForeground( aTextColor ); - aCopyrightText.SetControlForeground( aTextColor ); - aBuildData.SetBackground( ); - - Font aSmallFont = rSettings.GetInfoFont(); - Size aSmaller = aNewFont.GetSize(); - aSmaller.Width() = (long) (aSmaller.Width() * 0.75); - aSmaller.Height() = (long) (aSmaller.Height() * 0.75); - aNewFont.SetSize( aSmaller ); - aBuildData.SetFont( aNewFont ); - - String sRevision( utl::Bootstrap::getRevisionInfo() ); - - String aBuildString(aDevVersionStr); - aBuildString += (DEFINE_CONST_UNICODE(" - Rev. ")); - aBuildString += sRevision; + // set for background and text the correct system color + const StyleSettings& rSettings = GetSettings().GetStyleSettings(); + Color aWhiteCol( rSettings.GetWindowColor() ); + Wallpaper aWall( aWhiteCol ); + SetBackground( aWall ); + Font aNewFont( maCopyrightEdit.GetFont() ); + aNewFont.SetTransparent( sal_True ); + + maVersionText.SetFont( aNewFont ); + maCopyrightEdit.SetFont( aNewFont ); + + maVersionText.SetBackground(); + maCopyrightEdit.SetBackground(); + maBuildInfoEdit.SetBackground(); + maCreditsLink.SetBackground(); + + Color aTextColor( rSettings.GetWindowTextColor() ); + maVersionText.SetControlForeground( aTextColor ); + maCopyrightEdit.SetControlForeground( aTextColor ); + maBuildInfoEdit.SetControlForeground( aTextColor ); + maCreditsLink.SetControlForeground(); + + Size aSmaller = aNewFont.GetSize(); + aSmaller.Width() = (long) (aSmaller.Width() * 0.75); + aSmaller.Height() = (long) (aSmaller.Height() * 0.75); + aNewFont.SetSize( aSmaller ); + + maBuildInfoEdit.SetFont( aNewFont ); + + // the following is a hack to force the MultiLineEdit update its settings + // in order to reflect the Font + // See + // Window::SetControlFont + // MultiLineEdit::StateChanged + // MultiLineEdit::ImplInitSettings + // TODO Override SetFont in MultiLineEdit and do the following, + // otherwise SetFont has no effect at all! + aSmaller = PixelToLogic( aSmaller, MAP_POINT ); + aNewFont.SetSize( aSmaller ); + maBuildInfoEdit.SetControlFont( aNewFont ); +} -#ifdef BUILD_VER_STRING -#define _STRINGIFY(x) #x -#define STRINGIFY(x) _STRINGIFY(x) - aBuildString += '\n'; - aBuildString += ( DEFINE_CONST_UNICODE( STRINGIFY( BUILD_VER_STRING ) ) ); -#endif - aBuildData.SetText( aBuildString ); - aBuildData.Show(); +// ----------------------------------------------------------------------- - // determine size and position of the dialog & elements - Size aAppLogoSiz = aAppLogo.GetSizePixel(); - Size aOutSiz = GetOutputSizePixel(); - aOutSiz.Width() = aAppLogoSiz.Width(); +void AboutDialog::LayoutControls( Size& aDlgSize ) +{ + Size aAppLogoSiz = maAppLogo.GetSizePixel(); + + aDlgSize = GetOutputSizePixel(); + aDlgSize.Width() = aAppLogoSiz.Width(); - Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); + Size a6Size = maVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); - long nDlgMargin = a6Size.Width() * 4 ; + long nDlgMargin = a6Size.Width() * 2; long nCtrlMargin = a6Size.Height() * 2; - long nTextWidth = aOutSiz.Width() - nDlgMargin; - - aCopyrightText.SetText( aCopyrightTextStr ); + long nTextWidth = aDlgSize.Width() - ( nDlgMargin * 2 ); - // layout fixed text controls - layoutText( aVersionText, nY, nTextWidth, a6Size ); - if( aBuildString.Len() > 0 ) - { - nY += ( a6Size.Height() / 2 ); - layoutText( aBuildData, nY, nTextWidth, a6Size ); - } - nY += nCtrlMargin; + Point aPos( nDlgMargin, nY ); + Size aSize; + // layout fixed text control + layoutFixedText( maVersionText, aPos, aSize, nTextWidth ); + // set the next control closer + nY += aSize.Height() + (nCtrlMargin / 2); + + // Multiline edit with Build info + aPos.Y() = nY; + layoutEdit( maBuildInfoEdit, aPos, aSize, nTextWidth ); + nY += aSize.Height() + nCtrlMargin; - // OK-Button-Position (at the bottom and centered) - Size aOKSiz = aOKButton.GetSizePixel(); - Point aOKPnt = aOKButton.GetPosPixel(); - // Multiline edit with Copyright-Text - Point aCopyPnt = aCopyrightText.GetPosPixel(); - Size aCopySize = aCopyrightText.GetSizePixel(); - aCopySize.Width() = nTextWidth; - aCopySize.Height() = aOutSiz.Height() - nY - ( aOKSiz.Height() * 2 ) - nCtrlMargin; - - aCopyPnt.X() = ( aOutSiz.Width() - aCopySize.Width() ) / 2; - aCopyPnt.Y() = nY; - aCopyrightText.SetPosSizePixel( aCopyPnt, aCopySize ); - - nY += aCopySize.Height() + nCtrlMargin; - aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2; - aOKPnt.Y() = nY; - aOKButton.SetPosPixel( aOKPnt ); + aPos.Y() = nY; + layoutEdit( maCopyrightEdit, aPos, aSize, nTextWidth ); + // set the next control closer + nY += aSize.Height() + (nCtrlMargin/2); + + // Hyperlink + aPos.Y() = nY; + layoutFixedText( maCreditsLink, aPos, aSize, nTextWidth ); + nY += aSize.Height() + nCtrlMargin; + + // OK-Button-Position (at the bottom and centered) + Size aOKSiz = maOKButton.GetSizePixel(); + Point aOKPnt( ( aDlgSize.Width() - aOKSiz.Width() ) / 2, nY ); + maOKButton.SetPosPixel( aOKPnt ); - // Change the width of the dialog - SetOutputSizePixel( aOutSiz ); - - FreeResource(); - - SetHelpId( CMD_SID_ABOUT ); + aDlgSize.Height() = aOKPnt.Y() + aOKSiz.Height() + nCtrlMargin; } // ----------------------------------------------------------------------- -AboutDialog::~AboutDialog() +const rtl::OUString AboutDialog::GetBuildId() const { - // L"oschen des Entwickleraufrufs - delete pDeveloperAry; - if ( aAccelList.Count() ) - { - GetpApp()->RemoveAccel( aAccelList.First() ); - Accelerator* pAccel = aAccelList.Last(); + rtl::OUString sDefault; - while ( pAccel ) - { - delete pAccel; - pAccel = aAccelList.Prev(); - } - } -} + // Get buildid from version[rc|.ini] + rtl::OUString sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) ); + OSL_ENSURE( sBuildId.getLength() > 0, "No BUILDID in bootstrap file" ); + rtl::OUStringBuffer sBuildIdBuff( sBuildId ); + + // Get ProductSource from version[rc|.ini] + rtl::OUString sProductSource( utl::Bootstrap::getProductSource( sDefault ) ); + OSL_ENSURE( sProductSource.getLength() > 0, "No ProductSource in bootstrap file" ); + + // the product source is something like "AOO340", + // while the build id is something like "340m1(Build:9590)" + // For better readability, strip the duplicate ProductMajor ("340"). + if ( sProductSource.getLength() ) + { + bool bMatchingUPD = + ( sProductSource.getLength() >= 3 ) + && ( sBuildId.getLength() >= 3 ) + && ( sProductSource.copy( sProductSource.getLength() - 3 ) == sBuildId.copy( 0, 3 ) ); + OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); + if ( bMatchingUPD ) + sProductSource = sProductSource.copy( 0, sProductSource.getLength() - 3 ); -// ----------------------------------------------------------------------- + // prepend the product source + sBuildIdBuff.insert( 0, sProductSource ); + } -IMPL_LINK( AboutDialog, TimerHdl, Timer *, pTimer ) -{ - (void)pTimer; //unused - ++m_nPendingScrolls; - Invalidate( INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN ); - return 0; + return sBuildIdBuff.makeStringAndClear(); } // ----------------------------------------------------------------------- -IMPL_LINK( AboutDialog, AccelSelectHdl, Accelerator *, pAccelerator ) +const rtl::OUString AboutDialog::GetBuildVersionString() const { -#ifdef YURI_DARIO - aCopyrightText.SetHelpText( DEFINE_CONST_UNICODE("Conoscere qualcuno ovunque egli sia, con cui comprendersi nonostante le distanze\n" - "e le differenze, puo' trasformare la terra in un giardino. baci Valeria") ); + rtl::OUStringBuffer aBuildString( GetBuildId() ); + rtl::OUString sRevision( utl::Bootstrap::getRevisionInfo() ); + + if ( sRevision.getLength() > 0 ) + { + aBuildString.appendAscii( RTL_CONSTASCII_STRINGPARAM( " - Rev. " ) ); + aBuildString.append( sRevision ); + } + +#ifdef BUILD_VER_STRING + rtl::OUString sBuildVer( RTL_CONSTASCII_USTRINGPARAM( STRINGIFY( BUILD_VER_STRING ) ) ); + if ( sBuildVer.getLength() > 0 ) + { + aBuildString.append( sal_Unicode( '\n' ) ); + aBuildString.append( sBuildVer ); + } #endif - (void)pAccelerator; //unused - // init Timer - aTimer.SetTimeoutHdl( LINK( this, AboutDialog, TimerHdl ) ); - - // init scroll mode - nOff = GetOutputSizePixel().Height(); - MapMode aMapMode( MAP_PIXEL ); - SetMapMode( aMapMode ); - bNormal = sal_False; - - // start scroll Timer - aTimer.SetTimeout( SCROLL_TIMER ); - aTimer.Start(); - return 0; + return aBuildString.makeStringAndClear(); } // ----------------------------------------------------------------------- sal_Bool AboutDialog::Close() { - // stop Timer and finish the dialog - aTimer.Stop(); - EndDialog( RET_OK ); - return( sal_False ); + EndDialog( RET_OK ); + return( sal_False ); } // ----------------------------------------------------------------------- void AboutDialog::Paint( const Rectangle& rRect ) { - SetClipRegion( rRect ); + SetClipRegion( rRect ); + Point aPos( 0, 0 ); + DrawImage( aPos, maAppLogo ); - if ( bNormal ) // not in scroll mode - { - Point aPos( m_nDeltaWidth / 2, 0 ); - DrawImage( aPos, aAppLogo ); - return; - } - - // scroll the content - const int nDeltaY = -SCROLL_OFFSET * m_nPendingScrolls; - if( !nDeltaY ) - return; - nOff += nDeltaY; - Scroll( 0, nDeltaY, SCROLL_NOERASE ); - m_nPendingScrolls = 0; - - // draw the credits text - const Font aOrigFont = GetFont(); - const int nFullWidth = GetOutputSizePixel().Width(); - - int nY = nOff; - const int nDevCnt = static_cast( pDeveloperAry->Count() ); - for( int i = 0; i < nDevCnt; ++i ) - { - if( nY >= rRect.Bottom() ) - break; - - int nPos2 = nY + GetTextHeight() + 3; - if( nPos2 >= rRect.Top() + nDeltaY ) - { - const String aStr = pDeveloperAry->GetString(i); - const long nVal = pDeveloperAry->GetValue(i); - - if ( nVal ) - { - // emphasize the headers - Font aFont = aOrigFont; - aFont.SetWeight( (FontWeight)nVal ); - SetFont( aFont ); - nPos2 = nY + GetTextHeight() + 3; - } - - // clear text background - Rectangle aEraseRect( Point(0,nY), Size( nFullWidth, nPos2-nY)); - Erase( aEraseRect ); - - // draw centered text - const long nTextWidth = GetTextWidth( aStr ); - long nX = (nFullWidth - 5 - nTextWidth) / 2; - if( nX < 0 ) - nX = SPACE_OFFSET; - const Point aPnt( nX, nY ); - DrawText( aPnt, aStr ); - - // restore the font if needed - if( nVal ) - SetFont( aOrigFont ); - } - nY = nPos2; - } - - // close dialog if the whole text has been scrolled - if ( nY <= 0 ) - { - bNormal = sal_True; - Close(); - } + return; +} + +// ----------------------------------------------------------------------- + +IMPL_LINK ( AboutDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, EMPTYARG ) +{ + ::rtl::OUString sURL( maCreditsLink.GetURL() ); + if ( sURL.getLength() > 0 ) + { + try + { + com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xSMGR = + ::comphelper::getProcessServiceFactory(); + com::sun::star::uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( + xSMGR->createInstance( ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), + com::sun::star::uno::UNO_QUERY_THROW ); + if ( xSystemShell.is() ) + xSystemShell->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); + } + catch( const com::sun::star::uno::Exception& e ) + { + OSL_TRACE( "Caught exception: %s\n thread terminated.\n", + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } + } + return 0; } Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.hrc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.hrc?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/cui/source/dialogs/about.hrc (original) +++ incubator/ooo/trunk/main/cui/source/dialogs/about.hrc Mon Jun 18 19:12:29 2012 @@ -21,10 +21,11 @@ -#include - -#define ABOUT_BTN_OK 1 -#define ABOUT_FTXT_VERSION 1 -#define ABOUT_STR_ACCEL 3 -#define ABOUT_FTXT_COPYRIGHT 4 +#include +#define RID_CUI_ABOUT_BTN_OK 1 +#define RID_CUI_ABOUT_FTXT_VERSION 2 +#define RID_CUI_ABOUT_FTXT_COPYRIGHT 3 +#define RID_CUI_ABOUT_FTXT_BUILDDATA 4 +#define RID_CUI_ABOUT_STR_COPYRIGHT 5 +#define RID_CUI_ABOUT_FTXT_WELCOME_LINK 6 Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.src URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.src?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/cui/source/dialogs/about.src (original) +++ incubator/ooo/trunk/main/cui/source/dialogs/about.src Mon Jun 18 19:12:29 2012 @@ -27,37 +27,43 @@ ModalDialog RID_DEFAULTABOUT { HelpID = "cui:ModalDialog:RID_DEFAULTABOUT"; OutputSize = TRUE ; - Size = MAP_APPFONT ( 245 , 260 ) ; Moveable = TRUE ; SVLook = TRUE ; - Text [ x-comment ] = "PB: ; PB: only %PRODUCTNAME"; Text [ en-US ] = "About %PRODUCTNAME" ; - OKButton ABOUT_BTN_OK + OKButton RID_CUI_ABOUT_BTN_OK { DefButton = TRUE ; - Pos = MAP_APPFONT ( 174 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; - FixedText ABOUT_FTXT_VERSION + FixedText RID_CUI_ABOUT_FTXT_VERSION { - Pos = MAP_APPFONT ( 54 , 6 ) ; - Size = MAP_APPFONT ( 118 , 16 ) ; WordBreak = TRUE ; Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ; }; - MultiLineEdit ABOUT_FTXT_COPYRIGHT + MultiLineEdit RID_CUI_ABOUT_FTXT_BUILDDATA + { + //HelpID = "cui:MultiLineEdit:RID_DEFAULTABOUT:ABOUT_FTXT_BUILDDATA"; + Border = FALSE ; + IgnoreTab = TRUE ; + ReadOnly = TRUE ; + AutoVScroll = FALSE ; + }; + MultiLineEdit RID_CUI_ABOUT_FTXT_COPYRIGHT { HelpID = "cui:MultiLineEdit:RID_DEFAULTABOUT:ABOUT_FTXT_COPYRIGHT"; Border = FALSE ; - Pos = MAP_APPFONT ( 54 , 25 ) ; - Size = MAP_APPFONT ( 168 , 51 ) ; IgnoreTab = TRUE ; ReadOnly = TRUE ; - AutoVScroll = TRUE ; + AutoVScroll = FALSE ; + }; + FixedText RID_CUI_ABOUT_FTXT_WELCOME_LINK + { + Left = TRUE ; + Text = "http://www.openoffice.org/welcome/credits.html"; }; - String ABOUT_STR_ACCEL + String RID_CUI_ABOUT_STR_COPYRIGHT { - Text = "SDT" ; + Text[ en-US ] = "Copyright © 2012 Apache Software Foundation.\nAll rights reserved.\n\nThis product was created by %OOOVENDOR, based on Apache OpenOffice.\nApache OpenOffice acknowledges all community members, especially those mentioned at"; }; }; Modified: incubator/ooo/trunk/main/cui/source/inc/about.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/inc/about.hxx?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/cui/source/inc/about.hxx (original) +++ incubator/ooo/trunk/main/cui/source/inc/about.hxx Mon Jun 18 19:12:29 2012 @@ -25,53 +25,46 @@ // include --------------------------------------------------------------- -#include #include -#include #include +#include #include #include -#include // SfxModalDialog - -DECLARE_LIST( AccelList, Accelerator* ) +#include // SfxModalDialog // class AboutDialog ----------------------------------------------------- class AboutDialog : public SfxModalDialog { private: - OKButton aOKButton; - Image aAppLogo; + OKButton maOKButton; + FixedInfo maVersionText; + MultiLineEdit maBuildInfoEdit; + MultiLineEdit maCopyrightEdit; + svt::FixedHyperlink maCreditsLink; + + Image maAppLogo; + + String maCopyrightTextStr; + rtl::OUString maVersionData; + + void InitControls(); + void ApplyStyleSettings(); + void LayoutControls( Size& aDlgSize ); - FixedInfo aVersionText; - MultiLineEdit aCopyrightText; - FixedInfo aBuildData; - - ResStringArray* pDeveloperAry; - String aDevVersionStr; - String aAccelStr; - String aVersionData; - String aCopyrightTextStr; - - AccelList aAccelList; - - AutoTimer aTimer; - long nOff; - long m_nDeltaWidth; - int m_nPendingScrolls; + const rtl::OUString GetBuildId() const; + const rtl::OUString GetBuildVersionString() const; - sal_Bool bNormal; + DECL_DLLPRIVATE_LINK(OpenLinkHdl_Impl, svt::FixedHyperlink* ); protected: - virtual sal_Bool Close(); - virtual void Paint( const Rectangle& ); + virtual sal_Bool Close(); + virtual void Paint( const Rectangle& ); public: - AboutDialog( Window* pParent, const ResId& nId ); - ~AboutDialog(); + AboutDialog( Window* pParent, const ResId& nId ); + ~AboutDialog(); - DECL_LINK( TimerHdl, Timer * ); - DECL_LINK( AccelSelectHdl, Accelerator * ); }; #endif // #ifndef _ABOUT_HXX Modified: incubator/ooo/trunk/main/scp2/source/ooo/common_brand.scp URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/scp2/source/ooo/common_brand.scp?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/scp2/source/ooo/common_brand.scp (original) +++ incubator/ooo/trunk/main/scp2/source/ooo/common_brand.scp Mon Jun 18 19:12:29 2012 @@ -110,8 +110,7 @@ Module gid_Module_Langpack_Brand_Templat gid_Brand_Dir_Readme, gid_Brand_Dir_Share, gid_Brand_Dir_Share_Readme); - Files = (gid_Brand_File_Res_About, - gid_Brand_File_Res_Oirm, + Files = (gid_Brand_File_Res_Oirm, gid_Brand_File_Readme_Readme, gid_Brand_File_Readme_Readme_Html, gid_Brand_File_Share_Registry_Cjk_Xcd, @@ -1325,6 +1324,3 @@ File gid_Brand_File_Bin_Python Styles = (PACKED); End #endif - -BRAND_RES_FILE( gid_Brand_File_Res_About, about ) - Modified: incubator/ooo/trunk/main/svtools/inc/svtools/svtools.hrc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/inc/svtools/svtools.hrc?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/svtools/inc/svtools/svtools.hrc (original) +++ incubator/ooo/trunk/main/svtools/inc/svtools/svtools.hrc Mon Jun 18 19:12:29 2012 @@ -28,9 +28,6 @@ #define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0) #define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0) -#define ABOUT_STR_COPYRIGHT (RID_SVTOOLS_START + 1) -#define ABOUT_STR_DEVELOPER_ARY (RID_SVTOOLS_START + 2) - //............................................................................. // various unsorted stuff Modified: incubator/ooo/trunk/main/svx/Module_svx.mk URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/Module_svx.mk?rev=1351463&r1=1351462&r2=1351463&view=diff ============================================================================== --- incubator/ooo/trunk/main/svx/Module_svx.mk (original) +++ incubator/ooo/trunk/main/svx/Module_svx.mk Mon Jun 18 19:12:29 2012 @@ -30,7 +30,6 @@ $(eval $(call gb_Module_add_targets,svx, AllLangResTarget_svx \ AllLangResTarget_ofa \ AllLangResTarget_gal \ - AllLangResTarget_about \ AllLangResTarget_textconversiondlgs \ Package_inc \ Package_sdi \