xref: /trunk/main/cui/source/dialogs/about.cxx (revision ffeaba5b3a860a170bf7f9103daace50358ba7ce)
12ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32ee96f1cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42ee96f1cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52ee96f1cSAndrew Rist  * distributed with this work for additional information
62ee96f1cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72ee96f1cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
82ee96f1cSAndrew Rist  * "License"); you may not use this file except in compliance
92ee96f1cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
112ee96f1cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
132ee96f1cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
142ee96f1cSAndrew Rist  * software distributed under the License is distributed on an
152ee96f1cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162ee96f1cSAndrew Rist  * KIND, either express or implied.  See the License for the
172ee96f1cSAndrew Rist  * specific language governing permissions and limitations
182ee96f1cSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
202ee96f1cSAndrew Rist  *************************************************************/
212ee96f1cSAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_cui.hxx"
24cdf0e10cSrcweir 
25ca04f111SAriel Constenla-Haile #include <comphelper/processfactory.hxx>
26ca04f111SAriel Constenla-Haile #include <dialmgr.hxx>
27ca04f111SAriel Constenla-Haile #include <osl/file.hxx>
28ca04f111SAriel Constenla-Haile #include <rtl/bootstrap.hxx>
294524451eSJürgen Schmidt //#include <rtl/ustrbuf.hxx>
30cdf0e10cSrcweir #include <sfx2/sfxcommands.h>
31ca04f111SAriel Constenla-Haile #include <sfx2/sfxdefs.hxx>
32ca04f111SAriel Constenla-Haile #include <sfx2/sfxuno.hxx>
33ca04f111SAriel Constenla-Haile #include <svtools/filter.hxx>
34cdf0e10cSrcweir #include <svtools/svtools.hrc>
35ca04f111SAriel Constenla-Haile #include <tools/stream.hxx>
36ca04f111SAriel Constenla-Haile #include <tools/urlobj.hxx>
37ca04f111SAriel Constenla-Haile #include <unotools/bootstrap.hxx>
38ca04f111SAriel Constenla-Haile #include <unotools/configmgr.hxx>
39ca04f111SAriel Constenla-Haile #include <vcl/graph.hxx>
407168672cSAriel Constenla-Haile #include <vcl/imagerepository.hxx>
41ca04f111SAriel Constenla-Haile #include <vcl/msgbox.hxx>
42ca04f111SAriel Constenla-Haile #include <vcl/svapp.hxx>
43ca04f111SAriel Constenla-Haile #include <vcl/tabctrl.hxx>
44ca04f111SAriel Constenla-Haile #include <vcl/tabdlg.hxx>
45ca04f111SAriel Constenla-Haile #include <vcl/tabpage.hxx>
46cdf0e10cSrcweir 
4723c0a6f8SAriel Constenla-Haile #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
489807c9deSAriel Constenla-Haile #include <com/sun/star/system/SystemShellExecute.hpp>
497168672cSAriel Constenla-Haile #include <com/sun/star/uno/Any.h>
5023c0a6f8SAriel Constenla-Haile 
51ca04f111SAriel Constenla-Haile #include "about.hxx"
52ca04f111SAriel Constenla-Haile #include "about.hrc"
53cdf0e10cSrcweir 
54a392ac37SAriel Constenla-Haile #define _STRINGIFY(x) #x
55a392ac37SAriel Constenla-Haile #define STRINGIFY(x) _STRINGIFY(x)
56cdf0e10cSrcweir 
577168672cSAriel Constenla-Haile /* On Windows/OS2, all the three files have .txt extension
587168672cSAriel Constenla-Haile    and the README file name is in lowercase
597168672cSAriel Constenla-Haile    Readme files are localized and have the locale in their file name:
607168672cSAriel Constenla-Haile    README_de README_en-US
617168672cSAriel Constenla-Haile */
627168672cSAriel Constenla-Haile #if defined(WNT) || defined(OS2)
637168672cSAriel Constenla-Haile #define FILE_EXTENSION  ".txt"
647168672cSAriel Constenla-Haile #define README_FILE     "readme"
657168672cSAriel Constenla-Haile #else
667168672cSAriel Constenla-Haile #define FILE_EXTENSION
677168672cSAriel Constenla-Haile #define README_FILE     "README"
687168672cSAriel Constenla-Haile #endif
697168672cSAriel Constenla-Haile #define LICENSE_FILE    "LICENSE" FILE_EXTENSION
707168672cSAriel Constenla-Haile #define NOTICE_FILE     "NOTICE"  FILE_EXTENSION
717168672cSAriel Constenla-Haile 
727168672cSAriel Constenla-Haile // Dir where the files are located
73910823aeSJürgen Schmidt #define OOO_DIR_SHARE_README  "${OOO_BASE_DIR}/share/readme/"
747168672cSAriel Constenla-Haile 
757168672cSAriel Constenla-Haile using namespace com::sun::star;
767168672cSAriel Constenla-Haile 
77ca04f111SAriel Constenla-Haile namespace
78ca04f111SAriel Constenla-Haile {
79cdf0e10cSrcweir 
lcl_layoutFixedText(FixedText & rControl,const Point & aPos,Size & aSize,const long nTextWidth)80ca04f111SAriel Constenla-Haile     static void lcl_layoutFixedText( FixedText &rControl,
81ca04f111SAriel Constenla-Haile                                      const Point& aPos,
82ca04f111SAriel Constenla-Haile                                      Size &aSize,
83ca04f111SAriel Constenla-Haile                                      const long nTextWidth )
84a392ac37SAriel Constenla-Haile     {
8523c0a6f8SAriel Constenla-Haile         aSize = rControl.GetSizePixel();
8623c0a6f8SAriel Constenla-Haile         // change the width
8723c0a6f8SAriel Constenla-Haile         aSize.Width() = nTextWidth;
8823c0a6f8SAriel Constenla-Haile         // set Position and Size, to calculate the minimum size
8923c0a6f8SAriel Constenla-Haile         // this will update the Height
9023c0a6f8SAriel Constenla-Haile         rControl.SetPosSizePixel( aPos, aSize );
9123c0a6f8SAriel Constenla-Haile         aSize = rControl.CalcMinimumSize();
9223c0a6f8SAriel Constenla-Haile         // update the size with the right Height
9323c0a6f8SAriel Constenla-Haile         rControl.SetSizePixel( aSize );
94a392ac37SAriel Constenla-Haile     }
95cdf0e10cSrcweir 
lcl_layoutEdit(Edit & rControl,const Point & aPos,Size & aSize,const long nTextWidth)96ca04f111SAriel Constenla-Haile     static void lcl_layoutEdit( Edit &rControl,
97ca04f111SAriel Constenla-Haile                                 const Point& aPos,
98ca04f111SAriel Constenla-Haile                                 Size &aSize,
99ca04f111SAriel Constenla-Haile                                 const long nTextWidth )
10023c0a6f8SAriel Constenla-Haile     {
10123c0a6f8SAriel Constenla-Haile         aSize = rControl.GetSizePixel();
10223c0a6f8SAriel Constenla-Haile         // change the width
10323c0a6f8SAriel Constenla-Haile         aSize.Width() = nTextWidth;
10423c0a6f8SAriel Constenla-Haile         // set Position and Size, to calculate the minimum size
10523c0a6f8SAriel Constenla-Haile         // this will update the Height
10623c0a6f8SAriel Constenla-Haile         rControl.SetPosSizePixel( aPos, aSize );
10723c0a6f8SAriel Constenla-Haile         aSize = rControl.CalcMinimumSize();
10823c0a6f8SAriel Constenla-Haile         // update the size with the right Height
10923c0a6f8SAriel Constenla-Haile         rControl.SetSizePixel( aSize );
11023c0a6f8SAriel Constenla-Haile     }
111cdf0e10cSrcweir 
lcl_readTxtFile(const rtl::OUString & rFile,rtl::OUString & sText)112ca04f111SAriel Constenla-Haile     static void lcl_readTxtFile( const rtl::OUString &rFile, rtl::OUString &sText )
113ca04f111SAriel Constenla-Haile     {
114ca04f111SAriel Constenla-Haile         rtl::OUString sFile( rFile );
115ca04f111SAriel Constenla-Haile         rtl::Bootstrap::expandMacros( sFile );
116ca04f111SAriel Constenla-Haile         osl::File aFile(sFile);
117ca04f111SAriel Constenla-Haile         if ( aFile.open(OpenFlag_Read) == osl::FileBase::E_None )
118ca04f111SAriel Constenla-Haile         {
119ca04f111SAriel Constenla-Haile             osl::DirectoryItem aItem;
120ca04f111SAriel Constenla-Haile             osl::DirectoryItem::get(sFile, aItem);
121ca04f111SAriel Constenla-Haile 
122ca04f111SAriel Constenla-Haile             osl::FileStatus aStatus(FileStatusMask_FileSize);
123ca04f111SAriel Constenla-Haile             aItem.getFileStatus(aStatus);
124ca04f111SAriel Constenla-Haile 
125ca04f111SAriel Constenla-Haile             sal_uInt64 nBytesRead = 0;
126ca04f111SAriel Constenla-Haile             sal_uInt64 nPosition = 0;
127ca04f111SAriel Constenla-Haile             sal_uInt32 nBytes = (sal_uInt32)aStatus.getFileSize();
128ca04f111SAriel Constenla-Haile 
129ca04f111SAriel Constenla-Haile             sal_Char *pBuffer = new sal_Char[nBytes];
130ca04f111SAriel Constenla-Haile 
131ca04f111SAriel Constenla-Haile             while ( aFile.read( pBuffer + nPosition,
132ca04f111SAriel Constenla-Haile                                 nBytes-nPosition,
133ca04f111SAriel Constenla-Haile                                 nBytesRead ) == osl::FileBase::E_None
134ca04f111SAriel Constenla-Haile                     && nPosition + nBytesRead < nBytes)
135ca04f111SAriel Constenla-Haile             {
136ca04f111SAriel Constenla-Haile                 nPosition += nBytesRead;
137ca04f111SAriel Constenla-Haile             }
138ca04f111SAriel Constenla-Haile 
139ca04f111SAriel Constenla-Haile             OSL_ENSURE( nBytes < STRING_MAXLEN, "Text file has too much bytes!" );
140ca04f111SAriel Constenla-Haile             if ( nBytes > STRING_MAXLEN )
141ca04f111SAriel Constenla-Haile                 nBytes = STRING_MAXLEN - 1;
142ca04f111SAriel Constenla-Haile 
143ca04f111SAriel Constenla-Haile             sText = rtl::OUString( pBuffer,
144ca04f111SAriel Constenla-Haile                                 nBytes,
145ca04f111SAriel Constenla-Haile                                 RTL_TEXTENCODING_UTF8,
146ca04f111SAriel Constenla-Haile                                 OSTRING_TO_OUSTRING_CVTFLAGS
147ca04f111SAriel Constenla-Haile                                 | RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE);
148ca04f111SAriel Constenla-Haile             delete[] pBuffer;
149ca04f111SAriel Constenla-Haile         }
150ca04f111SAriel Constenla-Haile     }
151ca04f111SAriel Constenla-Haile 
152ca04f111SAriel Constenla-Haile     class ReadmeDialog;
153ca04f111SAriel Constenla-Haile 
154ca04f111SAriel Constenla-Haile     class ReadmeTabPage : public TabPage
155ca04f111SAriel Constenla-Haile     {
156ca04f111SAriel Constenla-Haile     private:
157ca04f111SAriel Constenla-Haile         MultiLineEdit maText;
158ca04f111SAriel Constenla-Haile         String        msText;
159ca04f111SAriel Constenla-Haile 
160ca04f111SAriel Constenla-Haile     public:
161ca04f111SAriel Constenla-Haile         ReadmeTabPage(Window *pParent, const String &sText);
162ca04f111SAriel Constenla-Haile         ~ReadmeTabPage();
163ca04f111SAriel Constenla-Haile 
164ca04f111SAriel Constenla-Haile         void Adjust(const Size &aSz, const Size &a6Size);
165ca04f111SAriel Constenla-Haile     };
166ca04f111SAriel Constenla-Haile 
ReadmeTabPage(Window * pParent,const String & sText)167ca04f111SAriel Constenla-Haile     ReadmeTabPage::ReadmeTabPage(Window *pParent, const String &sText)
168ca04f111SAriel Constenla-Haile         : TabPage(pParent, CUI_RES( RID_CUI_README_TBPAGE))
169ca04f111SAriel Constenla-Haile         ,maText( this, CUI_RES( RID_CUI_README_TBPAGE_EDIT ))
170ca04f111SAriel Constenla-Haile         ,msText( sText )
171ca04f111SAriel Constenla-Haile     {
172ca04f111SAriel Constenla-Haile         FreeResource();
173ca04f111SAriel Constenla-Haile 
174ca04f111SAriel Constenla-Haile         maText.SetText(msText);
175ca04f111SAriel Constenla-Haile         maText.Show();
176ca04f111SAriel Constenla-Haile     }
177ca04f111SAriel Constenla-Haile 
~ReadmeTabPage()178ca04f111SAriel Constenla-Haile     ReadmeTabPage::~ReadmeTabPage()
179ca04f111SAriel Constenla-Haile     {
180ca04f111SAriel Constenla-Haile     }
181ca04f111SAriel Constenla-Haile 
Adjust(const Size & aSz,const Size & a6Size)182ca04f111SAriel Constenla-Haile     void ReadmeTabPage::Adjust(const Size &aSz, const Size &a6Size)
183ca04f111SAriel Constenla-Haile     {
184ca04f111SAriel Constenla-Haile         long nDlgMargin  = a6Size.Width() * 2;
185ca04f111SAriel Constenla-Haile         long nCtrlMargin = a6Size.Height() * 2;
186ca04f111SAriel Constenla-Haile         maText.SetPosPixel( Point(a6Size.Width(), a6Size.Height()) );
187ca04f111SAriel Constenla-Haile         maText.SetSizePixel( Size(aSz.Width() - nDlgMargin, aSz.Height() - nCtrlMargin) );
188ca04f111SAriel Constenla-Haile     }
189ca04f111SAriel Constenla-Haile 
190ca04f111SAriel Constenla-Haile     class ReadmeDialog : public ModalDialog
191ca04f111SAriel Constenla-Haile     {
192ca04f111SAriel Constenla-Haile     private:
193ca04f111SAriel Constenla-Haile         TabControl      maTabCtrl;
194ca04f111SAriel Constenla-Haile         OKButton        maBtnOK;
195ca04f111SAriel Constenla-Haile 
196ca04f111SAriel Constenla-Haile         ReadmeTabPage  *maReadmeTabPage;
197ca04f111SAriel Constenla-Haile         ReadmeTabPage  *maLicenseTabPage;
198ca04f111SAriel Constenla-Haile         ReadmeTabPage  *maNoticeTabPage;
199ca04f111SAriel Constenla-Haile 
200ca04f111SAriel Constenla-Haile         DECL_LINK( ActivatePageHdl, TabControl * );
201ca04f111SAriel Constenla-Haile         DECL_LINK( DeactivatePageHdl, TabControl * );
202ca04f111SAriel Constenla-Haile 
203ca04f111SAriel Constenla-Haile     public:
204ca04f111SAriel Constenla-Haile         ReadmeDialog( Window* );
205ca04f111SAriel Constenla-Haile         ~ReadmeDialog();
206ca04f111SAriel Constenla-Haile     };
207ca04f111SAriel Constenla-Haile 
ReadmeDialog(Window * pParent)208ca04f111SAriel Constenla-Haile     ReadmeDialog::ReadmeDialog( Window * pParent )
209ca04f111SAriel Constenla-Haile         : ModalDialog( pParent, CUI_RES( RID_CUI_README_DLG ) )
210ca04f111SAriel Constenla-Haile         , maTabCtrl( this, CUI_RES(RID_CUI_README_TBCTL) )
211ca04f111SAriel Constenla-Haile         , maBtnOK( this, CUI_RES(RID_CUI_README_OKBTN) )
212ca04f111SAriel Constenla-Haile         , maReadmeTabPage(0)
213ca04f111SAriel Constenla-Haile         , maLicenseTabPage(0)
214ca04f111SAriel Constenla-Haile         , maNoticeTabPage(0)
215ca04f111SAriel Constenla-Haile     {
216ca04f111SAriel Constenla-Haile         FreeResource();
217ca04f111SAriel Constenla-Haile 
218ca04f111SAriel Constenla-Haile         maTabCtrl.Show();
219ca04f111SAriel Constenla-Haile 
2207168672cSAriel Constenla-Haile         // Notice and License are not localized
221910823aeSJürgen Schmidt         const rtl::OUString sLicense( RTL_CONSTASCII_USTRINGPARAM( OOO_DIR_SHARE_README LICENSE_FILE ) );
222910823aeSJürgen Schmidt         const rtl::OUString sNotice( RTL_CONSTASCII_USTRINGPARAM(  OOO_DIR_SHARE_README NOTICE_FILE ) );
2237168672cSAriel Constenla-Haile 
2247168672cSAriel Constenla-Haile         // get localized README
2257168672cSAriel Constenla-Haile         rtl::OUStringBuffer aBuff;
2267168672cSAriel Constenla-Haile         lang::Locale aLocale = Application::GetSettings().GetUILocale();
227910823aeSJürgen Schmidt         aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( OOO_DIR_SHARE_README README_FILE "_" ) );
2287168672cSAriel Constenla-Haile         aBuff.append( aLocale.Language );
2297168672cSAriel Constenla-Haile         if ( aLocale.Country.getLength() )
2307168672cSAriel Constenla-Haile         {
2317168672cSAriel Constenla-Haile             aBuff.append( sal_Unicode( '-') );
2327168672cSAriel Constenla-Haile             aBuff.append( aLocale.Country );
2337168672cSAriel Constenla-Haile             if ( aLocale.Variant.getLength() )
2347168672cSAriel Constenla-Haile             {
2357168672cSAriel Constenla-Haile                 aBuff.append( sal_Unicode( '-' ) );
2367168672cSAriel Constenla-Haile                 aBuff.append( aLocale.Variant );
2377168672cSAriel Constenla-Haile             }
2387168672cSAriel Constenla-Haile         }
2397168672cSAriel Constenla-Haile #if defined(WNT) || defined(OS2)
2407168672cSAriel Constenla-Haile         aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( FILE_EXTENSION ) );
2417168672cSAriel Constenla-Haile #endif
242ca04f111SAriel Constenla-Haile 
243ca04f111SAriel Constenla-Haile         rtl::OUString sReadmeTxt, sLicenseTxt, sNoticeTxt;
2447168672cSAriel Constenla-Haile         lcl_readTxtFile( aBuff.makeStringAndClear(), sReadmeTxt );
245ca04f111SAriel Constenla-Haile         lcl_readTxtFile( sLicense, sLicenseTxt );
246ca04f111SAriel Constenla-Haile         lcl_readTxtFile( sNotice, sNoticeTxt );
247ca04f111SAriel Constenla-Haile 
248ca04f111SAriel Constenla-Haile         maReadmeTabPage = new ReadmeTabPage( &maTabCtrl, sReadmeTxt );
249ca04f111SAriel Constenla-Haile         maLicenseTabPage = new ReadmeTabPage( &maTabCtrl, sLicenseTxt );
250ca04f111SAriel Constenla-Haile         maNoticeTabPage = new ReadmeTabPage( &maTabCtrl, sNoticeTxt );
251ca04f111SAriel Constenla-Haile 
252ca04f111SAriel Constenla-Haile         maTabCtrl.SetTabPage( RID_CUI_READMEPAGE, maReadmeTabPage );
253ca04f111SAriel Constenla-Haile         maTabCtrl.SetTabPage( RID_CUI_LICENSEPAGE, maLicenseTabPage );
254ca04f111SAriel Constenla-Haile         maTabCtrl.SetTabPage( RID_CUI_NOTICEPAGE, maNoticeTabPage );
255ca04f111SAriel Constenla-Haile 
256ca04f111SAriel Constenla-Haile         maTabCtrl.SelectTabPage( RID_CUI_READMEPAGE );
257ca04f111SAriel Constenla-Haile 
258ca04f111SAriel Constenla-Haile         Size aTpSz  = maReadmeTabPage->GetOutputSizePixel();
259ca04f111SAriel Constenla-Haile         Size a6Size = maReadmeTabPage->LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
260ca04f111SAriel Constenla-Haile 
261ca04f111SAriel Constenla-Haile         maReadmeTabPage->Adjust( aTpSz, a6Size );
262ca04f111SAriel Constenla-Haile         maLicenseTabPage->Adjust( aTpSz, a6Size );
263ca04f111SAriel Constenla-Haile         maNoticeTabPage->Adjust( aTpSz, a6Size );
264ca04f111SAriel Constenla-Haile 
265ca04f111SAriel Constenla-Haile         Size aDlgSize = GetOutputSizePixel();
266ca04f111SAriel Constenla-Haile         Size aOkBtnSz = maBtnOK.GetSizePixel();
267ca04f111SAriel Constenla-Haile         Point aOKPnt( aDlgSize.Width() / 2 - aOkBtnSz.Width() / 2 , maBtnOK.GetPosPixel().Y() );
268ca04f111SAriel Constenla-Haile         maBtnOK.SetPosPixel( aOKPnt );
269ca04f111SAriel Constenla-Haile     }
270ca04f111SAriel Constenla-Haile 
~ReadmeDialog()271ca04f111SAriel Constenla-Haile     ReadmeDialog::~ReadmeDialog()
272ca04f111SAriel Constenla-Haile     {
273ca04f111SAriel Constenla-Haile         delete maReadmeTabPage;
274ca04f111SAriel Constenla-Haile         delete maLicenseTabPage;
275ca04f111SAriel Constenla-Haile         delete maNoticeTabPage;
276ca04f111SAriel Constenla-Haile     }
277ca04f111SAriel Constenla-Haile }
278ca04f111SAriel Constenla-Haile 
27923c0a6f8SAriel Constenla-Haile // -----------------------------------------------------------------------
280cdf0e10cSrcweir 
AboutDialog(Window * pParent,const ResId & rId)28123c0a6f8SAriel Constenla-Haile AboutDialog::AboutDialog( Window* pParent, const ResId & rId ) :
28223c0a6f8SAriel Constenla-Haile     SfxModalDialog( pParent, rId ),
28323c0a6f8SAriel Constenla-Haile     maOKButton( this, ResId( RID_CUI_ABOUT_BTN_OK, *rId.GetResMgr() ) ),
284ca04f111SAriel Constenla-Haile     maReadmeButton( this, ResId( RID_CUI_ABOUT_BTN_README, *rId.GetResMgr() ) ),
28523c0a6f8SAriel Constenla-Haile     maVersionText( this, ResId( RID_CUI_ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ),
28623c0a6f8SAriel Constenla-Haile     maBuildInfoEdit( this, ResId( RID_CUI_ABOUT_FTXT_BUILDDATA, *rId.GetResMgr() ) ),
28723c0a6f8SAriel Constenla-Haile     maCopyrightEdit( this, ResId( RID_CUI_ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
2884524451eSJürgen Schmidt     maCreditsLink( this, ResId( RID_CUI_ABOUT_FTXT_WELCOME_LINK, *rId.GetResMgr() ) )
2894524451eSJürgen Schmidt //  maCopyrightTextStr( ResId( RID_CUI_ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) )
29023c0a6f8SAriel Constenla-Haile {
2917168672cSAriel Constenla-Haile     bool bLoad = vcl::ImageRepository::loadBrandingImage(
2927168672cSAriel Constenla-Haile             rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about")),
2937168672cSAriel Constenla-Haile             maAppLogo );
2947168672cSAriel Constenla-Haile     OSL_ENSURE( bLoad, "Can't load about image");
2957168672cSAriel Constenla-Haile 
2967168672cSAriel Constenla-Haile     bLoad = vcl::ImageRepository::loadBrandingImage(
2977168672cSAriel Constenla-Haile             rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("logo")),
2987168672cSAriel Constenla-Haile             maMainLogo );
2997168672cSAriel Constenla-Haile     OSL_ENSURE( bLoad, "Can't load logo image");
300cdf0e10cSrcweir 
3014524451eSJürgen Schmidt     const String vendor( ResId( RID_CUI_ABOUT_STR_COPYRIGHT_VENDOR, *rId.GetResMgr() ) );
3024524451eSJürgen Schmidt     String createdRes( ResId( RID_CUI_ABOUT_STR_CREATED, *rId.GetResMgr() ) );
3034524451eSJürgen Schmidt     if ( !vendor.EqualsAscii("Apache Software Foundation") ) {
3044524451eSJürgen Schmidt         createdRes = String( ResId( RID_CUI_ABOUT_STR_CREATED_VENDOR, *rId.GetResMgr() ));
3054524451eSJürgen Schmidt     }
3064524451eSJürgen Schmidt     const String copyrightAcknowledge( ResId( RID_CUI_ABOUT_STR_ACKNOWLEDGE, *rId.GetResMgr() ) );
3074524451eSJürgen Schmidt 
3084524451eSJürgen Schmidt     rtl::OUStringBuffer sbcopyright(250);
3094524451eSJürgen Schmidt     sbcopyright.appendAscii("Copyright ");
3104524451eSJürgen Schmidt     sbcopyright.append((sal_Unicode)0x00a9);
3114524451eSJürgen Schmidt     sbcopyright.appendAscii(" ");
312*ffeaba5bSmseidel     rtl::OUString sYear( RTL_CONSTASCII_USTRINGPARAM("2025") );
3134524451eSJürgen Schmidt     if (vendor.EqualsAscii("Apache Software Foundation")) {
3144524451eSJürgen Schmidt         sbcopyright.append(sYear);
3154524451eSJürgen Schmidt         sbcopyright.appendAscii(" The Apache Software Foundation.\n\n");
3164524451eSJürgen Schmidt     } else {
3174524451eSJürgen Schmidt #ifdef COPYRIGHT_YEAR
3184524451eSJürgen Schmidt         const rtl::OUString sDefYear( RTL_CONSTASCII_USTRINGPARAM( STRINGIFY( COPYRIGHT_YEAR ) ) );
3194524451eSJürgen Schmidt         if ( sDefYear.getLength() > 0 )
3204524451eSJürgen Schmidt         {
3214524451eSJürgen Schmidt             sYear = sDefYear;
3224524451eSJürgen Schmidt         }
3234524451eSJürgen Schmidt #endif
3244524451eSJürgen Schmidt         sbcopyright.append(sYear);
3254524451eSJürgen Schmidt         sbcopyright.appendAscii(" ");
3264524451eSJürgen Schmidt         sbcopyright.append(vendor);
3274524451eSJürgen Schmidt         sbcopyright.appendAscii(".\nPortion copyright The Apache Software Foundation.\n\n");
3284524451eSJürgen Schmidt     }
3294524451eSJürgen Schmidt     sbcopyright.append( createdRes );
3304524451eSJürgen Schmidt     sbcopyright.appendAscii("\n\n");
3314524451eSJürgen Schmidt     sbcopyright.append( copyrightAcknowledge );
3324524451eSJürgen Schmidt     maCopyrightTextStr = sbcopyright.makeStringAndClear();
3334524451eSJürgen Schmidt 
33423c0a6f8SAriel Constenla-Haile     InitControls();
335cdf0e10cSrcweir 
33623c0a6f8SAriel Constenla-Haile     // set links
337ca04f111SAriel Constenla-Haile     maReadmeButton.SetClickHdl( LINK( this, AboutDialog, ShowReadme_Impl ) );
33823c0a6f8SAriel Constenla-Haile     maCreditsLink.SetClickHdl( LINK( this, AboutDialog, OpenLinkHdl_Impl ) );
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     FreeResource();
341cdf0e10cSrcweir 
342cdf0e10cSrcweir     SetHelpId( CMD_SID_ABOUT );
343cdf0e10cSrcweir }
344cdf0e10cSrcweir 
345cdf0e10cSrcweir // -----------------------------------------------------------------------
346cdf0e10cSrcweir 
~AboutDialog()347cdf0e10cSrcweir AboutDialog::~AboutDialog()
348cdf0e10cSrcweir {
349cdf0e10cSrcweir }
350cdf0e10cSrcweir 
351cdf0e10cSrcweir // -----------------------------------------------------------------------
352cdf0e10cSrcweir 
InitControls()35323c0a6f8SAriel Constenla-Haile void AboutDialog::InitControls()
354cdf0e10cSrcweir {
35523c0a6f8SAriel Constenla-Haile     // apply font, background et al.
35623c0a6f8SAriel Constenla-Haile     ApplyStyleSettings();
35723c0a6f8SAriel Constenla-Haile 
35823c0a6f8SAriel Constenla-Haile     // set strings
35923c0a6f8SAriel Constenla-Haile     maCopyrightEdit.SetText( maCopyrightTextStr );
36023c0a6f8SAriel Constenla-Haile     maBuildInfoEdit.SetText( GetBuildVersionString() );
36123c0a6f8SAriel Constenla-Haile     maCreditsLink.SetURL( maCreditsLink.GetText() );
36223c0a6f8SAriel Constenla-Haile 
36323c0a6f8SAriel Constenla-Haile     // determine size and position of the dialog & elements
36423c0a6f8SAriel Constenla-Haile     Size aDlgSize;
36523c0a6f8SAriel Constenla-Haile     LayoutControls( aDlgSize );
36623c0a6f8SAriel Constenla-Haile 
36723c0a6f8SAriel Constenla-Haile     // Change the width of the dialog
36823c0a6f8SAriel Constenla-Haile     SetOutputSizePixel( aDlgSize );
369cdf0e10cSrcweir }
370cdf0e10cSrcweir 
371cdf0e10cSrcweir // -----------------------------------------------------------------------
372cdf0e10cSrcweir 
ApplyStyleSettings()37323c0a6f8SAriel Constenla-Haile void AboutDialog::ApplyStyleSettings()
374cdf0e10cSrcweir {
3756a0f49f0Smseidel     // transparent font
37623c0a6f8SAriel Constenla-Haile     Font aFont = GetFont();
37723c0a6f8SAriel Constenla-Haile     aFont.SetTransparent( sal_True );
37823c0a6f8SAriel Constenla-Haile     SetFont( aFont );
37923c0a6f8SAriel Constenla-Haile 
38023c0a6f8SAriel Constenla-Haile     // set for background and text the correct system color
38123c0a6f8SAriel Constenla-Haile     const StyleSettings& rSettings = GetSettings().GetStyleSettings();
3827168672cSAriel Constenla-Haile     Color aWindowColor( rSettings.GetWindowColor() );
3837168672cSAriel Constenla-Haile     Wallpaper aWall( aWindowColor );
38423c0a6f8SAriel Constenla-Haile     SetBackground( aWall );
385910823aeSJürgen Schmidt 
38623c0a6f8SAriel Constenla-Haile     Font aNewFont( maCopyrightEdit.GetFont() );
38723c0a6f8SAriel Constenla-Haile     aNewFont.SetTransparent( sal_True );
38823c0a6f8SAriel Constenla-Haile 
38923c0a6f8SAriel Constenla-Haile     maVersionText.SetFont( aNewFont );
39023c0a6f8SAriel Constenla-Haile     maCopyrightEdit.SetFont( aNewFont );
39123c0a6f8SAriel Constenla-Haile 
3927168672cSAriel Constenla-Haile     maVersionText.SetBackground(aWall);
3937168672cSAriel Constenla-Haile     maCopyrightEdit.SetBackground(aWall);
3947168672cSAriel Constenla-Haile     maBuildInfoEdit.SetBackground(aWall);
3957168672cSAriel Constenla-Haile     maCreditsLink.SetBackground(aWall);
39623c0a6f8SAriel Constenla-Haile 
39723c0a6f8SAriel Constenla-Haile     Color aTextColor( rSettings.GetWindowTextColor() );
39823c0a6f8SAriel Constenla-Haile     maVersionText.SetControlForeground( aTextColor );
39923c0a6f8SAriel Constenla-Haile     maCopyrightEdit.SetControlForeground( aTextColor );
40023c0a6f8SAriel Constenla-Haile     maBuildInfoEdit.SetControlForeground( aTextColor );
40123c0a6f8SAriel Constenla-Haile     maCreditsLink.SetControlForeground();
40223c0a6f8SAriel Constenla-Haile 
40323c0a6f8SAriel Constenla-Haile     Size aSmaller = aNewFont.GetSize();
40423c0a6f8SAriel Constenla-Haile     aSmaller.Width() = (long) (aSmaller.Width() * 0.75);
40523c0a6f8SAriel Constenla-Haile     aSmaller.Height() = (long) (aSmaller.Height() * 0.75);
40623c0a6f8SAriel Constenla-Haile     aNewFont.SetSize( aSmaller );
40723c0a6f8SAriel Constenla-Haile 
40823c0a6f8SAriel Constenla-Haile     maBuildInfoEdit.SetFont( aNewFont );
40923c0a6f8SAriel Constenla-Haile 
41023c0a6f8SAriel Constenla-Haile     // the following is a hack to force the MultiLineEdit update its settings
41123c0a6f8SAriel Constenla-Haile     // in order to reflect the Font
41223c0a6f8SAriel Constenla-Haile     // See
41323c0a6f8SAriel Constenla-Haile     //      Window::SetControlFont
41423c0a6f8SAriel Constenla-Haile     //      MultiLineEdit::StateChanged
41523c0a6f8SAriel Constenla-Haile     //      MultiLineEdit::ImplInitSettings
41623c0a6f8SAriel Constenla-Haile     // TODO Override SetFont in MultiLineEdit and do the following,
41723c0a6f8SAriel Constenla-Haile     // otherwise SetFont has no effect at all!
41823c0a6f8SAriel Constenla-Haile     aSmaller = PixelToLogic( aSmaller, MAP_POINT );
41923c0a6f8SAriel Constenla-Haile     aNewFont.SetSize( aSmaller );
42023c0a6f8SAriel Constenla-Haile     maBuildInfoEdit.SetControlFont( aNewFont );
42123c0a6f8SAriel Constenla-Haile }
42223c0a6f8SAriel Constenla-Haile 
42323c0a6f8SAriel Constenla-Haile // -----------------------------------------------------------------------
42423c0a6f8SAriel Constenla-Haile 
LayoutControls(Size & aDlgSize)42523c0a6f8SAriel Constenla-Haile void AboutDialog::LayoutControls( Size& aDlgSize )
42623c0a6f8SAriel Constenla-Haile {
427ca04f111SAriel Constenla-Haile     Size aMainLogoSz = maMainLogo.GetSizePixel();
42823c0a6f8SAriel Constenla-Haile     Size aAppLogoSiz = maAppLogo.GetSizePixel();
42923c0a6f8SAriel Constenla-Haile 
43023c0a6f8SAriel Constenla-Haile     aDlgSize = GetOutputSizePixel();
431325547baSAriel Constenla-Haile     long nCol1 = aMainLogoSz.Width();
432325547baSAriel Constenla-Haile     long nCol2 = aAppLogoSiz.Width() ? aAppLogoSiz.Width() : aDlgSize.Width();
43323c0a6f8SAriel Constenla-Haile 
43423c0a6f8SAriel Constenla-Haile     Size a6Size      = maVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
43523c0a6f8SAriel Constenla-Haile     long nDlgMargin  = a6Size.Width() * 2;
43623c0a6f8SAriel Constenla-Haile     long nCtrlMargin = a6Size.Height() * 2;
437325547baSAriel Constenla-Haile     long nTextWidth  = nCol2 - nDlgMargin;
438ca04f111SAriel Constenla-Haile     long nY          = aAppLogoSiz.Height() + a6Size.Height();
43923c0a6f8SAriel Constenla-Haile 
440325547baSAriel Constenla-Haile     aDlgSize.Width() = nCol1 + a6Size.Width() + nCol2;
441ca04f111SAriel Constenla-Haile 
442325547baSAriel Constenla-Haile     Point aPos( nCol1 + a6Size.Width(), nY );
44323c0a6f8SAriel Constenla-Haile     Size aSize;
44423c0a6f8SAriel Constenla-Haile     // layout fixed text control
445ca04f111SAriel Constenla-Haile     lcl_layoutFixedText( maVersionText, aPos, aSize, nTextWidth );
446ca04f111SAriel Constenla-Haile     nY += aSize.Height() + a6Size.Height();
44723c0a6f8SAriel Constenla-Haile 
44823c0a6f8SAriel Constenla-Haile     // Multiline edit with Build info
44923c0a6f8SAriel Constenla-Haile     aPos.Y() = nY;
450ca04f111SAriel Constenla-Haile     lcl_layoutEdit( maBuildInfoEdit, aPos, aSize, nTextWidth );
451ca04f111SAriel Constenla-Haile     nY += aSize.Height() + a6Size.Height();
45223c0a6f8SAriel Constenla-Haile 
45323c0a6f8SAriel Constenla-Haile     // Multiline edit with Copyright-Text
45423c0a6f8SAriel Constenla-Haile     aPos.Y() = nY;
455ca04f111SAriel Constenla-Haile     lcl_layoutEdit( maCopyrightEdit, aPos, aSize, nTextWidth );
456ca04f111SAriel Constenla-Haile     nY += aSize.Height() + a6Size.Height();
45723c0a6f8SAriel Constenla-Haile 
45823c0a6f8SAriel Constenla-Haile     // Hyperlink
45923c0a6f8SAriel Constenla-Haile     aPos.Y() = nY;
460ca04f111SAriel Constenla-Haile     lcl_layoutFixedText( maCreditsLink, aPos, aSize, nTextWidth );
461ca04f111SAriel Constenla-Haile     nY += aSize.Height();
462ca04f111SAriel Constenla-Haile 
463ca04f111SAriel Constenla-Haile     nY = std::max( nY, aMainLogoSz.Height() );
464ca04f111SAriel Constenla-Haile     nY += nCtrlMargin;
465ca04f111SAriel Constenla-Haile 
466ca04f111SAriel Constenla-Haile     // logos position
467ca04f111SAriel Constenla-Haile     maMainLogoPos = Point( 0, nY / 2 - aMainLogoSz.Height() / 2 );
468325547baSAriel Constenla-Haile     maAppLogoPos = Point( nCol1 + a6Size.Width(), 0 );
46923c0a6f8SAriel Constenla-Haile 
47023c0a6f8SAriel Constenla-Haile     // OK-Button-Position (at the bottom and centered)
47123c0a6f8SAriel Constenla-Haile     Size aOKSiz = maOKButton.GetSizePixel();
472ca04f111SAriel Constenla-Haile     Point aOKPnt( ( aDlgSize.Width() - aOKSiz.Width() ) - a6Size.Width(), nY );
47323c0a6f8SAriel Constenla-Haile     maOKButton.SetPosPixel( aOKPnt );
47423c0a6f8SAriel Constenla-Haile 
475ca04f111SAriel Constenla-Haile     maReadmeButton.SetPosPixel( Point(a6Size.Width(), nY) );
476ca04f111SAriel Constenla-Haile 
477ca04f111SAriel Constenla-Haile     aDlgSize.Height() = aOKPnt.Y() + aOKSiz.Height() + a6Size.Width();
47823c0a6f8SAriel Constenla-Haile }
47923c0a6f8SAriel Constenla-Haile 
48023c0a6f8SAriel Constenla-Haile // -----------------------------------------------------------------------
48123c0a6f8SAriel Constenla-Haile 
GetBuildId() const48223c0a6f8SAriel Constenla-Haile const rtl::OUString AboutDialog::GetBuildId() const
48323c0a6f8SAriel Constenla-Haile {
48423c0a6f8SAriel Constenla-Haile     rtl::OUString sDefault;
48523c0a6f8SAriel Constenla-Haile 
48623c0a6f8SAriel Constenla-Haile     // Get buildid from version[rc|.ini]
48723c0a6f8SAriel Constenla-Haile     rtl::OUString sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) );
48823c0a6f8SAriel Constenla-Haile     OSL_ENSURE( sBuildId.getLength() > 0, "No BUILDID in bootstrap file" );
48923c0a6f8SAriel Constenla-Haile     rtl::OUStringBuffer sBuildIdBuff( sBuildId );
49023c0a6f8SAriel Constenla-Haile 
49123c0a6f8SAriel Constenla-Haile     // Get ProductSource from version[rc|.ini]
49223c0a6f8SAriel Constenla-Haile     rtl::OUString sProductSource( utl::Bootstrap::getProductSource( sDefault ) );
49323c0a6f8SAriel Constenla-Haile     OSL_ENSURE( sProductSource.getLength() > 0, "No ProductSource in bootstrap file" );
49423c0a6f8SAriel Constenla-Haile 
49523c0a6f8SAriel Constenla-Haile     // the product source is something like "AOO340",
49623c0a6f8SAriel Constenla-Haile     // while the build id is something like "340m1(Build:9590)"
49723c0a6f8SAriel Constenla-Haile     // For better readability, strip the duplicate ProductMajor ("340").
49823c0a6f8SAriel Constenla-Haile     if ( sProductSource.getLength() )
49923c0a6f8SAriel Constenla-Haile     {
50073167bc4SArrigo Marchiori         sal_Int32 nMajorLength = sProductSource.getLength() - 3;
50123c0a6f8SAriel Constenla-Haile         bool bMatchingUPD =
50223c0a6f8SAriel Constenla-Haile                 ( sProductSource.getLength() >= 3 )
50373167bc4SArrigo Marchiori             &&  ( sBuildId.getLength() >= nMajorLength )
50473167bc4SArrigo Marchiori             &&  ( sProductSource.copy( 3 ) == sBuildId.copy( 0, nMajorLength ) );
50523c0a6f8SAriel Constenla-Haile         OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" );
50623c0a6f8SAriel Constenla-Haile         if ( bMatchingUPD )
50773167bc4SArrigo Marchiori             sProductSource = sProductSource.copy( 0, sProductSource.getLength() - nMajorLength );
50823c0a6f8SAriel Constenla-Haile 
50923c0a6f8SAriel Constenla-Haile         // prepend the product source
51023c0a6f8SAriel Constenla-Haile         sBuildIdBuff.insert( 0, sProductSource );
51123c0a6f8SAriel Constenla-Haile     }
51223c0a6f8SAriel Constenla-Haile 
51323c0a6f8SAriel Constenla-Haile     return sBuildIdBuff.makeStringAndClear();
51423c0a6f8SAriel Constenla-Haile }
51523c0a6f8SAriel Constenla-Haile 
51623c0a6f8SAriel Constenla-Haile // -----------------------------------------------------------------------
51723c0a6f8SAriel Constenla-Haile 
GetBuildVersionString() const51823c0a6f8SAriel Constenla-Haile const rtl::OUString AboutDialog::GetBuildVersionString() const
51923c0a6f8SAriel Constenla-Haile {
52023c0a6f8SAriel Constenla-Haile     rtl::OUStringBuffer aBuildString( GetBuildId() );
52123c0a6f8SAriel Constenla-Haile     rtl::OUString sRevision( utl::Bootstrap::getRevisionInfo() );
52223c0a6f8SAriel Constenla-Haile 
52323c0a6f8SAriel Constenla-Haile     if ( sRevision.getLength() > 0 )
52423c0a6f8SAriel Constenla-Haile     {
52523c0a6f8SAriel Constenla-Haile         aBuildString.appendAscii( RTL_CONSTASCII_STRINGPARAM( "  -  Rev. " ) );
52623c0a6f8SAriel Constenla-Haile         aBuildString.append( sRevision );
52723c0a6f8SAriel Constenla-Haile     }
52823c0a6f8SAriel Constenla-Haile 
52923c0a6f8SAriel Constenla-Haile #ifdef BUILD_VER_STRING
53023c0a6f8SAriel Constenla-Haile     rtl::OUString sBuildVer( RTL_CONSTASCII_USTRINGPARAM( STRINGIFY( BUILD_VER_STRING ) ) );
53123c0a6f8SAriel Constenla-Haile     if ( sBuildVer.getLength() > 0 )
53223c0a6f8SAriel Constenla-Haile     {
53323c0a6f8SAriel Constenla-Haile         aBuildString.append( sal_Unicode( '\n' ) );
53423c0a6f8SAriel Constenla-Haile         aBuildString.append( sBuildVer );
53523c0a6f8SAriel Constenla-Haile     }
536cdf0e10cSrcweir #endif
537cdf0e10cSrcweir 
53823c0a6f8SAriel Constenla-Haile     return aBuildString.makeStringAndClear();
539cdf0e10cSrcweir }
540cdf0e10cSrcweir 
541cdf0e10cSrcweir // -----------------------------------------------------------------------
542cdf0e10cSrcweir 
Close()543cdf0e10cSrcweir sal_Bool AboutDialog::Close()
544cdf0e10cSrcweir {
545cdf0e10cSrcweir     EndDialog( RET_OK );
546cdf0e10cSrcweir     return( sal_False );
547cdf0e10cSrcweir }
548cdf0e10cSrcweir 
549cdf0e10cSrcweir // -----------------------------------------------------------------------
550cdf0e10cSrcweir 
Paint(const Rectangle & rRect)551cdf0e10cSrcweir void AboutDialog::Paint( const Rectangle& rRect )
552cdf0e10cSrcweir {
553cdf0e10cSrcweir     SetClipRegion( rRect );
554910823aeSJürgen Schmidt 
555910823aeSJürgen Schmidt     // workaround to ensure that the background is painted correct
5566a0f49f0Smseidel     // on MacOS for example the background was gray and the image and other controls white
557910823aeSJürgen Schmidt     SetFillColor(GetSettings().GetStyleSettings().GetWindowColor());
558910823aeSJürgen Schmidt     SetLineColor();
559910823aeSJürgen Schmidt     DrawRect(rRect);
560910823aeSJürgen Schmidt 
561ca04f111SAriel Constenla-Haile     DrawImage( maMainLogoPos, maMainLogo );
562ca04f111SAriel Constenla-Haile     DrawImage( maAppLogoPos, maAppLogo );
563cdf0e10cSrcweir 
564cdf0e10cSrcweir     return;
565cdf0e10cSrcweir }
566cdf0e10cSrcweir 
56723c0a6f8SAriel Constenla-Haile // -----------------------------------------------------------------------
568cdf0e10cSrcweir 
IMPL_LINK(AboutDialog,OpenLinkHdl_Impl,svt::FixedHyperlink *,EMPTYARG)56923c0a6f8SAriel Constenla-Haile IMPL_LINK ( AboutDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, EMPTYARG )
570cdf0e10cSrcweir {
57123c0a6f8SAriel Constenla-Haile     ::rtl::OUString sURL( maCreditsLink.GetURL() );
57223c0a6f8SAriel Constenla-Haile     if ( sURL.getLength() > 0 )
573cdf0e10cSrcweir     {
57423c0a6f8SAriel Constenla-Haile         try
575cdf0e10cSrcweir         {
5764ad1da77SJian Fang Zhang             uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell(
5779807c9deSAriel Constenla-Haile                 com::sun::star::system::SystemShellExecute::create(
5789807c9deSAriel Constenla-Haile                     ::comphelper::getProcessComponentContext() ) );
57923c0a6f8SAriel Constenla-Haile             if ( xSystemShell.is() )
5804ad1da77SJian Fang Zhang                 xSystemShell->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
581cdf0e10cSrcweir         }
5827168672cSAriel Constenla-Haile         catch( const uno::Exception& e )
583cdf0e10cSrcweir         {
58423c0a6f8SAriel Constenla-Haile             OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
58523c0a6f8SAriel Constenla-Haile                 rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
586cdf0e10cSrcweir         }
587cdf0e10cSrcweir     }
5887168672cSAriel Constenla-Haile 
58923c0a6f8SAriel Constenla-Haile     return 0;
59023c0a6f8SAriel Constenla-Haile }
591ca04f111SAriel Constenla-Haile 
IMPL_LINK(AboutDialog,ShowReadme_Impl,PushButton *,EMPTYARG)592ca04f111SAriel Constenla-Haile IMPL_LINK ( AboutDialog, ShowReadme_Impl, PushButton*, EMPTYARG )
593ca04f111SAriel Constenla-Haile {
594ca04f111SAriel Constenla-Haile     ReadmeDialog aDlg( this );
595ca04f111SAriel Constenla-Haile     aDlg.Execute();
596ca04f111SAriel Constenla-Haile 
597ca04f111SAriel Constenla-Haile     return 0;
598ca04f111SAriel Constenla-Haile }
5996a0f49f0Smseidel 
6006a0f49f0Smseidel /* vim: set noet sw=4 ts=4: */
601