summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2010-09-15 14:42:28 +0200
committerRene Engelhard <rene@debian.org>2010-09-15 14:42:28 +0200
commitbd7a2fdda3a870186bf7122634ee8939d266a1b0 (patch)
treeabdf56b7e7e0314bc121106218b29521e1355281
parent392e4db4192abb549be4062c48a732a6d04d1753 (diff)
about-dialog-cleanup.diff: clean up about dialog, i#111425
-rw-r--r--sfx2/inc/about.hxx3
-rwxr-xr-xsfx2/inc/sfx2/sfx.hrc3
-rw-r--r--sfx2/source/dialog/about.cxx54
-rw-r--r--svx/source/intro/ooo.src14
4 files changed, 41 insertions, 33 deletions
diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx
index b3b347917ddc..000f50bd6fca 100644
--- a/sfx2/inc/about.hxx
+++ b/sfx2/inc/about.hxx
@@ -47,7 +47,7 @@ private:
OKButton aOKButton;
Image aAppLogo;
- FixedInfo aVersionText;
+ MultiLineEdit aVersionText;
MultiLineEdit aCopyrightText;
FixedInfo aBuildData;
@@ -55,6 +55,7 @@ private:
String aDevVersionStr;
String aAccelStr;
String aVersionData;
+ String aVersionTextStr;
String aCopyrightTextStr;
AccelList aAccelList;
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index a49b003b5b49..5daac0b91ae2 100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -216,7 +216,8 @@
#define ABOUT_STR_DEVELOPER_ARY 1
#define ABOUT_STR_FRENCH_COPYRIGHT 2
#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_BUILDVERSION (RID_SFX_START+5)
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
index fab379f9f215..14cf5fb25cc0 100644
--- a/sfx2/source/dialog/about.cxx
+++ b/sfx2/source/dialog/about.cxx
@@ -67,22 +67,6 @@
#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 )
-{
- 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(
const rtl::OUString &rPath, const rtl::OUString &rBmpFileName,
Image &rLogo )
@@ -158,10 +142,12 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
aOKButton ( this, ResId( ABOUT_BTN_OK, *rId.GetResMgr() ) ),
aVersionText ( this, ResId( ABOUT_FTXT_VERSION, *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 ),
aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ),
aDevVersionStr ( rVerStr ),
aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ),
+ aVersionTextStr( ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ),
aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
aTimer (),
nOff ( 0 ),
@@ -181,10 +167,15 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
SetFont( aFont );
// if necessary more info
- String sVersion = aVersionText.GetText();
+ String sVersion = aVersionTextStr;
sVersion.SearchAndReplaceAscii( "$(VER)", Application::GetDisplayName() );
sVersion += '\n';
sVersion += rVerStr;
+#ifdef BUILD_VER_STRING
+ String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) );
+ sVersion += '\n';
+ sVersion += aBuildString;
+#endif
aVersionText.SetText( sVersion );
// Initialisierung fuer Aufruf Entwickler
@@ -235,28 +226,37 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
aNewFont.SetSize( aSmaller );
aBuildData.SetFont( aNewFont );
aBuildData.SetBackground( aWall );
-#ifdef BUILD_VER_STRING
- String aBuildString( DEFINE_CONST_UNICODE( BUILD_VER_STRING ) );
-#else
- String aBuildString;
-#endif
- aBuildData.SetText( aBuildString );
+ // FIXME: What is the purpose of the build data?
+ // they are not showed even when set, so???
+ String aBuildDataString;
+ aBuildData.SetText( aBuildDataString );
aBuildData.Show();
+ aCopyrightText.SetText( aCopyrightTextStr );
+
// determine size and position of the dialog & elements
Size aAppLogoSiz = aAppLogo.GetSizePixel();
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() * 4 ;
- long nCtrlMargin = a6Size.Height() * 2;
+ long nDlgMargin = a6Size.Width() * 3 ;
+ long nCtrlMargin = aVTSize.Height() + ( a6Size.Height() * 2 );
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;
// OK-Button-Position (at the bottom and centered)
diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src
index 49f6f68fd7e4..c4500231cce3 100644
--- a/svx/source/intro/ooo.src
+++ b/svx/source/intro/ooo.src
@@ -75,22 +75,28 @@ ModalDialog RID_DEFAULTABOUT
Pos = MAP_APPFONT ( 174 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
- FixedText ABOUT_FTXT_VERSION
+ MultiLineEdit ABOUT_FTXT_VERSION
{
+ Border = FALSE ;
Pos = MAP_APPFONT ( 54 , 6 ) ;
Size = MAP_APPFONT ( 118 , 16 ) ;
- WordBreak = TRUE ;
- Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ AutoVScroll = TRUE ;
};
MultiLineEdit ABOUT_FTXT_COPYRIGHT
{
- Border = TRUE ;
+ Border = FALSE ;
Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ;
IgnoreTab = TRUE ;
ReadOnly = TRUE ;
AutoVScroll = TRUE ;
};
+ String ABOUT_STR_VERSION
+ {
+ Text[ en-US ] = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION";
+ };
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.";