diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-28 13:00:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-28 13:00:24 +0100 |
commit | 8294f08c84f3eda7d0e3d3db419f9c8e29b05f11 (patch) | |
tree | 562d722d893c8d0530ec36680e94401f95508bcc /cui | |
parent | d372b48727d693ad515f93d11132c707d57b1319 (diff) |
add Build Id: string and fix size calculations
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/about.cxx | 58 | ||||
-rw-r--r-- | cui/source/dialogs/about.hrc | 7 | ||||
-rw-r--r-- | cui/source/dialogs/about.src | 4 | ||||
-rw-r--r-- | cui/source/inc/about.hxx | 1 |
4 files changed, 39 insertions, 31 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 94942e9dc832..3157a9b48fd7 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -92,7 +92,8 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : aInfoLink ( this, ResId( ABOUT_FTXT_LINK, *rId.GetResMgr() ) ), aVersionTextStr( ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ), aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ), - aLinkStr ( ResId( ABOUT_STR_LINK, *rId.GetResMgr() ) ) + aLinkStr ( ResId( ABOUT_STR_LINK, *rId.GetResMgr() ) ), + m_sBuildStr(ResId(ABOUT_STR_BUILD, *rId.GetResMgr())) { rtl::OUString sProduct; utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct; @@ -109,6 +110,8 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : String sVersion = aVersionTextStr; sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() ); sVersion += '\n'; + sVersion += m_sBuildStr; + sVersion += ' '; sVersion += GetBuildId(); #ifdef BUILD_VER_STRING String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); @@ -146,52 +149,51 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : if (aAppLogoSiz.Width() < 300) aAppLogoSiz.Width() = 300; - Size aOutSiz = GetOutputSizePixel(); - aOutSiz.Width() = aAppLogoSiz.Width(); + Size aOutSiz = GetOutputSizePixel(); + aOutSiz.Width() = aAppLogoSiz.Width(); // analyze size of the aVersionText widget // character size Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); // preferred Version widget size - Size aVTSize = aVersionText.CalcMinimumSize(); long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); long nDlgMargin = a6Size.Width() * 3 ; long nCtrlMargin = a6Size.Height() * 2; long nTextWidth = aOutSiz.Width() - nDlgMargin; // finally set the aVersionText widget position and size - Size aVTCopySize = aVTSize; - Point aVTCopyPnt; - aVTCopySize.Width() = nTextWidth; - aVTCopyPnt.X() = ( aOutSiz.Width() - aVTCopySize.Width() ) / 2; - aVTCopyPnt.Y() = nY; - aVersionText.SetPosSizePixel( aVTCopyPnt, aVTCopySize ); + Size aVTSize = aVersionText.GetSizePixel(); + aVTSize.Width() = nTextWidth; + aVersionText.SetSizePixel(aVTSize); + aVTSize = aVersionText.CalcMinimumSize(); + Point aVTPnt; + aVTPnt.X() = ( aOutSiz.Width() - aVTSize.Width() ) / 2; + aVTPnt.Y() = nY; + aVersionText.SetPosSizePixel( aVTPnt, aVTSize ); - nY += aVTSize.Height(); - nY += nCtrlMargin; + nY += aVTSize.Height() + nCtrlMargin; // Multiline edit with Copyright-Text // preferred Version widget size - Size aCTSize = aCopyrightText.CalcMinimumSize(); + Size aCTSize = aCopyrightText.GetSizePixel(); + aCTSize.Width() = nTextWidth; + aCopyrightText.SetSizePixel(aCTSize); + aCTSize = aCopyrightText.CalcMinimumSize(); + Point aCTPnt; + aCTPnt.X() = ( aOutSiz.Width() - aCTSize.Width() ) / 2; + aCTPnt.Y() = nY; + aCopyrightText.SetPosSizePixel( aCTPnt, aCTSize ); - Size aCTCopySize = aCTSize; - Point aCTCopyPnt; - aCTCopySize.Width() = nTextWidth; - aCTCopyPnt.X() = ( aOutSiz.Width() - aCTCopySize.Width() ) / 2; - aCTCopyPnt.Y() = nY; - aCopyrightText.SetPosSizePixel( aCTCopyPnt, aCTCopySize ); - - nY += aCTSize.Height(); - nY += nCtrlMargin; + nY += aCTSize.Height() + nCtrlMargin; // FixedHyperlink with more info link - Size aLinkSize = aInfoLink.CalcMinimumSize(); - Point aLinkPnt; - aLinkPnt.X() = ( aOutSiz.Width() - aLinkSize.Width() ) / 2; - aLinkPnt.Y() = nY; - aInfoLink.SetPosSizePixel( aLinkPnt, aLinkSize ); + Size aLTSize = aInfoLink.CalcMinimumSize(); + Point aLTPnt; + aLTPnt.X() = ( aOutSiz.Width() - aLTSize.Width() ) / 2; + aLTPnt.Y() = nY; + aInfoLink.SetPosSizePixel( aLTPnt, aLTSize ); - nY += aLinkSize.Height() + nCtrlMargin; + nY += aLTSize.Height() + nCtrlMargin; // OK-Button-Position (at the bottom and centered) Size aOKSiz = aOKButton.GetSizePixel(); diff --git a/cui/source/dialogs/about.hrc b/cui/source/dialogs/about.hrc index e106489d7933..d1b60c33fda2 100644 --- a/cui/source/dialogs/about.hrc +++ b/cui/source/dialogs/about.hrc @@ -31,6 +31,7 @@ #define ABOUT_FTXT_VERSION 2 #define ABOUT_FTXT_COPYRIGHT 3 #define ABOUT_FTXT_LINK 4 -#define ABOUT_STR_VERSION 5 -#define ABOUT_STR_COPYRIGHT 6 -#define ABOUT_STR_LINK 7 +#define ABOUT_STR_BUILD 5 +#define ABOUT_STR_VERSION 6 +#define ABOUT_STR_COPYRIGHT 7 +#define ABOUT_STR_LINK 8 diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src index f3a5b4738fc7..2e8c7226991a 100644 --- a/cui/source/dialogs/about.src +++ b/cui/source/dialogs/about.src @@ -80,4 +80,8 @@ ModalDialog RID_DEFAULTABOUT { Text[ en-US ] = "http://www.libreoffice.org/credits.html"; }; + String ABOUT_STR_BUILD + { + Text[ en-US ] = "Build ID:"; + }; }; diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx index f1ad4a84d81e..0909e9356e52 100644 --- a/cui/source/inc/about.hxx +++ b/cui/source/inc/about.hxx @@ -57,6 +57,7 @@ private: String aVersionTextStr; String aCopyrightTextStr; String aLinkStr; + String m_sBuildStr; protected: virtual sal_Bool Close(); |