[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Jun 27 08:41:33 UTC 2017


 include/vcl/msgbox.hxx       |    4 +++
 vcl/inc/svids.hrc            |    5 ++++
 vcl/source/src/stdtext.src   |   20 +++++++++++++++++
 vcl/source/window/msgbox.cxx |   48 +++++++++++++++++++++++++++++++++++++------
 4 files changed, 71 insertions(+), 6 deletions(-)

New commits:
commit 41905ffb2a3d8d1362fe55690bf2a716b1e04064
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Mon Jun 26 22:53:28 2017 +0200

    tdf#108809 Message boxes: Add more descriptive window title
    
    E.g. 'Error' for error boxes instead of just 'LibreOffice 6.0'
    
    Change-Id: I7142d15e9219a2aa6733523887cdf43b50200b7b
    Reviewed-on: https://gerrit.libreoffice.org/39284
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 01379bdcb73b..305e36c381ce 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -73,6 +73,7 @@ public:
                                 const OUString& rMessage );
 
     static Image        GetStandardImage();
+    static OUString     GetStandardText();
 };
 
 class VCL_DLLPUBLIC WarningBox : public MessBox
@@ -84,6 +85,7 @@ public:
     void                SetDefaultCheckBoxText();
 
     static Image        GetStandardImage();
+    static OUString     GetStandardText();
 };
 
 class VCL_DLLPUBLIC ErrorBox : public MessBox
@@ -94,6 +96,7 @@ public:
                                   const OUString& rMessage );
 
     static Image        GetStandardImage();
+    static OUString     GetStandardText();
 };
 
 class VCL_DLLPUBLIC QueryBox : public MessBox
@@ -105,6 +108,7 @@ public:
     void                SetDefaultCheckBoxText();
 
     static Image        GetStandardImage();
+    static OUString     GetStandardText();
 };
 
 #endif // INCLUDED_VCL_MSGBOX_HXX
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc
index 7f2de807de39..b4d4cca62529 100644
--- a/vcl/inc/svids.hrc
+++ b/vcl/inc/svids.hrc
@@ -130,6 +130,11 @@
 #define SV_APP_DEFAULT                              10804
 #define SV_APP_VCLBACKEND                           10805
 
+#define SV_MSGBOX_INFO                              10900
+#define SV_MSGBOX_WARNING                           10901
+#define SV_MSGBOX_ERROR                             10902
+#define SV_MSGBOX_QUERY                             10903
+
 #endif // INCLUDED_VCL_INC_SVIDS_HRC
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src
index 1189f858a0cb..d97c43ecc1eb 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -59,4 +59,24 @@ String SV_STDTEXT_ALLFILETYPES
     Text [en-US] = "Any type";
 };
 
+String SV_MSGBOX_INFO
+{
+    Text [en-US] = "Information";
+};
+
+String SV_MSGBOX_WARNING
+{
+    Text [en-US] = "Warning";
+};
+
+String SV_MSGBOX_ERROR
+{
+    Text [en-US] = "Error";
+};
+
+String SV_MSGBOX_QUERY
+{
+    Text [en-US] = "Confirmation";
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 26012733eaf5..297c06dd0c4e 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -371,7 +371,7 @@ InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) :
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( InfoBox::GetStandardImage() );
 }
@@ -381,7 +381,7 @@ InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( InfoBox::GetStandardImage() );
 }
@@ -392,13 +392,22 @@ Image InfoBox::GetStandardImage()
     return ImplGetSVData()->maWinData.maMsgBoxImgList[3];
 }
 
+OUString InfoBox::GetStandardText()
+{
+    ResMgr* pResMgr = ImplGetResMgr();
+    if( pResMgr )
+        return ResId(SV_MSGBOX_INFO, *pResMgr);
+
+    return Application::GetDisplayName();
+}
+
 WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle,
                         const OUString& rMessage ) :
     MessBox( pParent, nStyle, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( WarningBox::GetStandardImage() );
 }
@@ -416,12 +425,21 @@ Image WarningBox::GetStandardImage()
     return ImplGetSVData()->maWinData.maMsgBoxImgList[2];
 }
 
+OUString WarningBox::GetStandardText()
+{
+    ResMgr* pResMgr = ImplGetResMgr();
+    if( pResMgr )
+        return ResId(SV_MSGBOX_WARNING, *pResMgr);
+
+    return Application::GetDisplayName();
+}
+
 ErrorBox::ErrorBox( vcl::Window* pParent, const OUString& rMessage ) :
     MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( ErrorBox::GetStandardImage() );
 }
@@ -432,7 +450,7 @@ ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( ErrorBox::GetStandardImage() );
 }
@@ -452,12 +470,21 @@ Image ErrorBox::GetStandardImage()
     return ImplGetSVData()->maWinData.maMsgBoxImgList[0];
 }
 
+OUString ErrorBox::GetStandardText()
+{
+    ResMgr* pResMgr = ImplGetResMgr();
+    if( pResMgr )
+        return ResId(SV_MSGBOX_ERROR, *pResMgr);
+
+    return Application::GetDisplayName();
+}
+
 QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
     MessBox( pParent, nStyle, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
+        SetText( GetStandardText() );
 
     SetImage( QueryBox::GetStandardImage() );
 }
@@ -475,4 +502,13 @@ Image QueryBox::GetStandardImage()
     return ImplGetSVData()->maWinData.maMsgBoxImgList[1];
 }
 
+OUString QueryBox::GetStandardText()
+{
+    ResMgr* pResMgr = ImplGetResMgr();
+    if( pResMgr )
+        return ResId(SV_MSGBOX_QUERY, *pResMgr);
+
+    return Application::GetDisplayName();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list