From 3bd4f463f2ec6d2311ada5f229aed060ed1107a1 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 20 Jan 2016 17:04:27 -0500 Subject: [PATCH] Bug49 (partial): Correctly recreate tooltips in device bar for language change --- src/toolbars/DeviceToolBar.cpp | 19 +++++++++++++------ src/toolbars/DeviceToolBar.h | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index 1b9161e43..298dce9ae 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -97,7 +97,6 @@ void DeviceToolBar::Populate() wxID_ANY, wxDefaultPosition, wxDefaultSize); - mHost->SetName(_("Audio Host")); Add(mHost, 0, wxALIGN_CENTER); @@ -113,15 +112,12 @@ void DeviceToolBar::Populate() wxID_ANY, wxDefaultPosition, wxDefaultSize); - /* i18n-hint: (noun) It's the device used for recording.*/ - mInput->SetName(_("Recording Device")); Add(mInput, 0, wxALIGN_CENTER); mInputChannels = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); - mInputChannels->SetName(_("Recording Channels")); Add(mInputChannels, 0, wxALIGN_CENTER); // Output device @@ -135,8 +131,6 @@ void DeviceToolBar::Populate() wxID_ANY, wxDefaultPosition, wxDefaultSize); - /* i18n-hint: (noun) It's the device used for playback.*/ - mOutput->SetName(_("Playback Device")); Add(mOutput, 0, wxALIGN_CENTER); @@ -175,6 +169,8 @@ void DeviceToolBar::Populate() NULL, this); + SetNames(); + RefillCombos(); } @@ -347,9 +343,20 @@ void DeviceToolBar::EnableDisableButtons() } } +void DeviceToolBar::SetNames() +{ + /* i18n-hint: (noun) It's the device used for playback.*/ + mOutput->SetName(_("Playback Device")); + /* i18n-hint: (noun) It's the device used for recording.*/ + mInput->SetName(_("Recording Device")); + mHost->SetName(_("Audio Host")); + mInputChannels->SetName(_("Recording Channels")); +} + void DeviceToolBar::RegenerateTooltips() { #if wxUSE_TOOLTIPS + SetNames(); mOutput->SetToolTip(mOutput->GetName() + wxT(" - ") + mOutput->GetStringSelection()); mInput->SetToolTip(mInput->GetName() + wxT(" - ") + mInput->GetStringSelection()); mHost->SetToolTip(mHost->GetName() + wxT(" - ") + mHost->GetStringSelection()); diff --git a/src/toolbars/DeviceToolBar.h b/src/toolbars/DeviceToolBar.h index ba5374984..d528b7951 100644 --- a/src/toolbars/DeviceToolBar.h +++ b/src/toolbars/DeviceToolBar.h @@ -62,6 +62,7 @@ class DeviceToolBar:public ToolBar { void FillInputChannels(); void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out); void RepositionCombos(); + void SetNames(); void RegenerateTooltips(); void ShowComboDialog(wxChoice *combo, const wxString &title);