From dc5d118e65603773263040afdf2c97633869e4ca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 May 2013 14:42:59 +0000 Subject: [PATCH] Use " Preferences" as generic wxPreferencesEditor dialog title. This is more appropriate than just "Preferences" under MSW and GTK which use the generic wxPreferencesEditor, OS X has its own native version which continues to correctly use "Preferences" for the title. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/preferences/preferences.cpp | 5 +++++ src/generic/preferencesg.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/samples/preferences/preferences.cpp b/samples/preferences/preferences.cpp index f1ab3b6152..990fb0d437 100644 --- a/samples/preferences/preferences.cpp +++ b/samples/preferences/preferences.cpp @@ -224,6 +224,11 @@ bool MyApp::OnInit() if ( !wxApp::OnInit() ) return false; + // This will be used in the title of the preferences dialog under some + // platforms, don't leave it as default "Preferences" because this would + // result in rather strange "Preferences Preferences" title. + SetAppDisplayName("wxWidgets Sample"); + MyFrame *frame = new MyFrame(); frame->Show(true); diff --git a/src/generic/preferencesg.cpp b/src/generic/preferencesg.cpp index 1481c63302..30365e7ebc 100644 --- a/src/generic/preferencesg.cpp +++ b/src/generic/preferencesg.cpp @@ -27,6 +27,7 @@ #ifndef wxHAS_PREF_EDITOR_NATIVE +#include "wx/app.h" #include "wx/dialog.h" #include "wx/notebook.h" #include "wx/sizer.h" @@ -100,7 +101,12 @@ protected: wxGenericPrefsDialog *CreateDialog(wxWindow *parent) { if ( m_title.empty() ) - m_title = _("Preferences"); + { + // Use the default title, which should include the application name + // under both MSW and GTK (and OSX uses its own native + // implementation anyhow). + m_title.Printf(_("%s Preferences"), wxTheApp->GetAppDisplayName()); + } wxGenericPrefsDialog *dlg = new wxGenericPrefsDialog(parent, m_title); -- 2.47.2