Kaydet (Commit) bd7a2fdd authored tarafından Petr Mladek's avatar Petr Mladek Kaydeden (comit) Rene Engelhard

about-dialog-cleanup.diff: clean up about dialog, i#111425

üst 392e4db4
...@@ -47,7 +47,7 @@ private: ...@@ -47,7 +47,7 @@ private:
OKButton aOKButton; OKButton aOKButton;
Image aAppLogo; Image aAppLogo;
FixedInfo aVersionText; MultiLineEdit aVersionText;
MultiLineEdit aCopyrightText; MultiLineEdit aCopyrightText;
FixedInfo aBuildData; FixedInfo aBuildData;
...@@ -55,6 +55,7 @@ private: ...@@ -55,6 +55,7 @@ private:
String aDevVersionStr; String aDevVersionStr;
String aAccelStr; String aAccelStr;
String aVersionData; String aVersionData;
String aVersionTextStr;
String aCopyrightTextStr; String aCopyrightTextStr;
AccelList aAccelList; AccelList aAccelList;
......
...@@ -216,7 +216,8 @@ ...@@ -216,7 +216,8 @@
#define ABOUT_STR_DEVELOPER_ARY 1 #define ABOUT_STR_DEVELOPER_ARY 1
#define ABOUT_STR_FRENCH_COPYRIGHT 2 #define ABOUT_STR_FRENCH_COPYRIGHT 2
#define ABOUT_STR_ACCEL 3 #define ABOUT_STR_ACCEL 3
#define ABOUT_STR_COPYRIGHT 4 #define ABOUT_STR_VERSION 4
#define ABOUT_STR_COPYRIGHT 5
#define RID_APPTITLE (RID_SFX_START+4) #define RID_APPTITLE (RID_SFX_START+4)
#define RID_BUILDVERSION (RID_SFX_START+5) #define RID_BUILDVERSION (RID_SFX_START+5)
......
...@@ -67,22 +67,6 @@ ...@@ -67,22 +67,6 @@
#define WELCOME_URL DEFINE_CONST_UNICODE( "http://www.openoffice.org/welcome/credits.html" ) #define WELCOME_URL DEFINE_CONST_UNICODE( "http://www.openoffice.org/welcome/credits.html" )
// class AboutDialog ----------------------------------------------------- // class AboutDialog -----------------------------------------------------
static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size )
{
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 );
nY += aTxtSiz.Height();
}
static bool impl_loadBitmap( static bool impl_loadBitmap(
const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, const rtl::OUString &rPath, const rtl::OUString &rBmpFileName,
Image &rLogo ) Image &rLogo )
...@@ -158,10 +142,12 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS ...@@ -158,10 +142,12 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ), aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ),
aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ),
aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
// FIXME: What is the purpose of the aBuildData when it is not connected to any widget?
aBuildData ( this ), aBuildData ( this ),
aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ), aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ),
aDevVersionStr ( rVerStr ), aDevVersionStr ( rVerStr ),
aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ), aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ),
aVersionTextStr( ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ),
aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ), aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
aTimer (), aTimer (),
nOff ( 0 ), nOff ( 0 ),
...@@ -181,10 +167,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS ...@@ -181,10 +167,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
SetFont( aFont ); SetFont( aFont );
// if necessary more info // if necessary more info
String sVersion = aVersionText.GetText(); String sVersion = aVersionTextStr;
sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() ); sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() );
sVersion += '\n'; sVersion += '\n';
sVersion += rVerStr; sVersion += rVerStr;
#ifdef BUILD_VER_STRING
String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) );
sVersion += '\n';
sVersion += aBuildString;
#endif
aVersionText.SetText( sVersion ); aVersionText.SetText( sVersion );
// Initialisierung fuer Aufruf Entwickler // Initialisierung fuer Aufruf Entwickler
...@@ -235,28 +226,37 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS ...@@ -235,28 +226,37 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
aNewFont.SetSize( aSmaller ); aNewFont.SetSize( aSmaller );
aBuildData.SetFont( aNewFont ); aBuildData.SetFont( aNewFont );
aBuildData.SetBackground( aWall ); aBuildData.SetBackground( aWall );
#ifdef BUILD_VER_STRING // FIXME: What is the purpose of the build data?
String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) ); // they are not showed even when set, so???
#else String aBuildDataString;
String aBuildString; aBuildData.SetText( aBuildDataString );
#endif
aBuildData.SetText( aBuildString );
aBuildData.Show(); aBuildData.Show();
aCopyrightText.SetText( aCopyrightTextStr );
// determine size and position of the dialog & elements // determine size and position of the dialog & elements
Size aAppLogoSiz = aAppLogo.GetSizePixel(); Size aAppLogoSiz = aAppLogo.GetSizePixel();
Size aOutSiz = GetOutputSizePixel(); Size aOutSiz = GetOutputSizePixel();
aOutSiz.Width() = aAppLogoSiz.Width(); aOutSiz.Width() = aAppLogoSiz.Width();
// analyze size of the aVersionText widget
// character size
Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); 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 nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 );
long nDlgMargin = a6Size.Width() * 4 ; long nDlgMargin = a6Size.Width() * 3 ;
long nCtrlMargin = a6Size.Height() * 2; long nCtrlMargin = aVTSize.Height() + ( a6Size.Height() * 2 );
long nTextWidth = aOutSiz.Width() - nDlgMargin; long nTextWidth = aOutSiz.Width() - nDlgMargin;
aCopyrightText.SetText( aCopyrightTextStr ); // 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 );
layoutText( aVersionText, nY, nTextWidth, a6Size );
nY += nCtrlMargin; nY += nCtrlMargin;
// OK-Button-Position (at the bottom and centered) // OK-Button-Position (at the bottom and centered)
......
...@@ -75,22 +75,28 @@ ModalDialog RID_DEFAULTABOUT ...@@ -75,22 +75,28 @@ ModalDialog RID_DEFAULTABOUT
Pos = MAP_APPFONT ( 174 , 6 ) ; Pos = MAP_APPFONT ( 174 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
}; };
FixedText ABOUT_FTXT_VERSION MultiLineEdit ABOUT_FTXT_VERSION
{ {
Border = FALSE ;
Pos = MAP_APPFONT ( 54 , 6 ) ; Pos = MAP_APPFONT ( 54 , 6 ) ;
Size = MAP_APPFONT ( 118 , 16 ) ; Size = MAP_APPFONT ( 118 , 16 ) ;
WordBreak = TRUE ; IgnoreTab = TRUE ;
Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ; ReadOnly = TRUE ;
AutoVScroll = TRUE ;
}; };
MultiLineEdit ABOUT_FTXT_COPYRIGHT MultiLineEdit ABOUT_FTXT_COPYRIGHT
{ {
Border = TRUE ; Border = FALSE ;
Pos = MAP_APPFONT ( 54 , 25 ) ; Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ; Size = MAP_APPFONT ( 168 , 51 ) ;
IgnoreTab = TRUE ; IgnoreTab = TRUE ;
ReadOnly = TRUE ; ReadOnly = TRUE ;
AutoVScroll = TRUE ; AutoVScroll = TRUE ;
}; };
String ABOUT_STR_VERSION
{
Text[ en-US ] = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION";
};
String ABOUT_STR_COPYRIGHT String ABOUT_STR_COPYRIGHT
{ {
Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment