Update of /cvsroot/audacity/audacity-src/src/toolbars
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25282/toolbars

Modified Files:
        ControlToolBar.h DeviceToolBar.cpp DeviceToolBar.h 
        EditToolBar.cpp EditToolBar.h MeterToolBar.cpp MeterToolBar.h 
        MixerToolBar.cpp SelectionBar.cpp SelectionBar.h ToolBar.cpp 
        ToolBar.h ToolManager.cpp ToolManager.h ToolsToolBar.cpp 
        TranscriptionToolBar.cpp TranscriptionToolBar.h 
Log Message:
Fix toolbars to update tooltips when the language changes.


Index: MeterToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/MeterToolBar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- MeterToolBar.h      16 Sep 2007 13:46:01 -0000      1.3
+++ MeterToolBar.h      29 May 2009 17:07:39 -0000      1.4
@@ -36,6 +36,7 @@
    virtual void Populate();
    virtual void Repaint(wxDC *dc) {};
    virtual void EnableDisableButtons() {};
+   virtual void UpdatePrefs();
 
    void GetMeters(Meter **playMeter, Meter **recordMeter);
    void StartMonitoring();
@@ -43,6 +44,7 @@
    virtual void OnSize(wxSizeEvent & event);
 
  private:
+   void RegenerateTooltips();
 
    wxGridBagSizer *mSizer;
    Meter *mPlayMeter;

Index: ToolManager.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ToolManager.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- ToolManager.cpp     16 May 2009 11:13:13 -0000      1.21
+++ ToolManager.cpp     29 May 2009 17:07:39 -0000      1.22
@@ -854,6 +854,21 @@
 }
 
 //
+// Tell the toolbars that preferences have been updated
+//
+void ToolManager::UpdatePrefs()
+{
+   for( int ndx = 0; ndx < ToolBarCount; ndx++ ) 
+   {
+      ToolBar *bar = mBars[ ndx ];
+      if( bar )
+      {
+         bar->UpdatePrefs();
+      }
+   }
+}
+
+//
 // Handle toolbar dragging
 //
 void ToolManager::OnMouse( wxMouseEvent & event )

Index: ToolsToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ToolsToolBar.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ToolsToolBar.cpp    6 Dec 2008 01:17:27 -0000       1.8
+++ ToolsToolBar.cpp    29 May 2009 17:07:39 -0000      1.9
@@ -156,6 +156,10 @@
    return;
 }
 
+void ToolsToolBar::UpdatePrefs()
+{
+   RegenerateToolsTooltips();
+}
 
 AButton * ToolsToolBar::MakeTool( teBmps eTool, 
    int id, const wxChar *label)

Index: TranscriptionToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/TranscriptionToolBar.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- TranscriptionToolBar.cpp    23 Mar 2009 22:36:25 -0000      1.12
+++ TranscriptionToolBar.cpp    29 May 2009 17:07:39 -0000      1.13
@@ -139,8 +139,7 @@
 AButton *TranscriptionToolBar::AddButton(
    teBmps eFore, teBmps eDisabled,
    int id,
-   const wxChar *label,
-   const wxChar *tip)
+   const wxChar *label)
 {
    AButton *&r = mButtons[id];
 
@@ -156,10 +155,6 @@
 // JKC: Unlike ControlToolBar, does not have a focus rect.  Shouldn't it?
 // r->SetFocusRect( r->GetRect().Deflate( 4, 4 ) );
 
-#if wxUSE_TOOLTIPS
-   r->SetToolTip(tip);
-#endif
-
    Add( r, 0, wxALIGN_CENTER );
 
    return r;
@@ -172,8 +167,7 @@
    MakeButtonBackgroundsSmall();
 
    AddButton(bmpPlay,     bmpPlayDisabled,   TTB_PlaySpeed,
-      _("Play at selected speed"),
-      _("Play-at-speed"));
+      _("Play at selected speed"));
    
    //Add a slider that controls the speed of playback.
    const int SliderWidth=100;
@@ -197,32 +191,23 @@
 
 #ifdef EXPERIMENTAL_VOICE_DETECTION
    AddButton(bmpTnStartOn,     bmpTnStartOnDisabled,  TTB_StartOn,
-      _("Adjust left selection to next onset"),
-      _("Left-to-On"));
+      _("Adjust left selection to next onset"));
    AddButton(bmpTnEndOn,       bmpTnEndOnDisabled,   TTB_EndOn,
-      _("Adjust right selection to previous offset"),
-      _("Right-to-Off"));
+      _("Adjust right selection to previous offset"));
    AddButton(bmpTnStartOff,    bmpTnStartOffDisabled,  TTB_StartOff,
-      _("Adjust left selection to next offset"),
-      _("Left-to-Off"));
+      _("Adjust left selection to next offset"));
    AddButton(bmpTnEndOff,      bmpTnEndOffDisabled,    TTB_EndOff,
-      _("Adjust right selection to previous onset"),
-      _("Right-to-On"));
+      _("Adjust right selection to previous onset"));
    AddButton(bmpTnSelectSound, bmpTnSelectSoundDisabled, TTB_SelectSound,
-      _("Select region of sound around cursor"),
-      _("Select-Sound"));
+      _("Select region of sound around cursor"));
    AddButton(bmpTnSelectSilence, bmpTnSelectSilenceDisabled, TTB_SelectSilence,
-      _("Select region of silence around cursor"),
-      _("Select-Silence"));
+      _("Select region of silence around cursor"));
    AddButton(bmpTnAutomateSelection,   bmpTnAutomateSelectionDisabled,  
TTB_AutomateSelection,
-      _("Automatically make labels from words"),
-      _("Make Labels"));
+      _("Automatically make labels from words"));
    AddButton(bmpTnMakeTag, bmpTnMakeTagDisabled,  TTB_MakeLabel,  
-      _("Add label at selection"),
-      _("Add Label"));
+      _("Add label at selection"));
    AddButton(bmpTnCalibrate, bmpTnCalibrateDisabled, TTB_Calibrate,
-      _("Calibrate voicekey"),
-      _("Calibrate"));
+      _("Calibrate voicekey"));
  
    mSensitivitySlider = new ASlider(this,
                                     TTB_SensitivitySlider,
@@ -255,6 +240,42 @@
 
    // Add a little space
    Add(2, -1);
+
+   UpdatePrefs();
+}
+
+void TranscriptionToolBar::UpdatePrefs()
+{
+   RegenerateTooltips();
+
+   // Set label to pull in language change
+   SetLabel(_("Transcription"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
+}
+
+void TranscriptionToolBar::RegenerateTooltips()
+{
+#if wxUSE_TOOLTIPS
+   mButtons[TTB_PlaySpeed]->SetToolTip(_("Play-at-speed"));
+   mPlaySpeedSlider->SetToolTip(_("Playback Speed"));
+
+#ifdef EXPERIMENTAL_VOICE_DETECTION
+   mButtons[TTB_StartOn]->SetToolTip(_("Left-to-On"));
+   mButtons[TTB_EndOn]->SetToolTip(   _("Right-to-Off"));
+   mButtons[TTB_StartOff]->SetToolTip(   _("Left-to-Off"));
+   mButtons[TTB_EndOff]->SetToolTip(   _("Right-to-On"));
+   mButtons[TTB_SelectSound]->SetToolTip(   _("Select-Sound"));
+   mButtons[TTB_SelectSilence]->SetToolTip(   _("Select-Silence"));
+   mButtons[TTB_AutomateSelection]->SetToolTip(   _("Make Labels"));
+   mButtons[TTB_MakeLabel]->SetToolTip(   _("Add Label"));
+   mButtons[TTB_Calibrate]->SetToolTip(   _("Calibrate"));
+ 
+   mSensitivitySlider->SetToolTip(_("Sensitivity"));
+   mKeyTypeChoice->SetToolTip(_("Key type"));
+#endif
+#endif
 }
 
 void TranscriptionToolBar::OnFocus(wxFocusEvent &event)

Index: DeviceToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/DeviceToolBar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DeviceToolBar.h     5 Jun 2008 22:53:57 -0000       1.3
+++ DeviceToolBar.h     29 May 2009 17:07:39 -0000      1.4
@@ -40,6 +40,8 @@
    void OnChoice(wxCommandEvent & event);
 
  private:
+   void RegenerateTooltips();
+
    wxBitmap *mPlayBitmap;
    wxBitmap *mRecordBitmap;
 

Index: ToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ToolBar.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ToolBar.cpp 16 May 2009 11:13:13 -0000      1.17
+++ ToolBar.cpp 29 May 2009 17:07:39 -0000      1.18
@@ -95,7 +95,6 @@
    mType = type;
    mLabel = label;
    mSection = section;
-   mTitle.Printf( _("Audacity %s ToolBar"), mLabel.c_str() );
    mResizable = resizable;
 
    // Initialize everything
@@ -118,7 +117,7 @@
 //
 wxString ToolBar::GetTitle()
 {
-   return mTitle;
+   return wxString::Format( _("Audacity %s ToolBar"), GetLabel().c_str() );
 }
 
 //
@@ -146,6 +145,14 @@
 }
 
 //
+// Set the toolbar label
+//
+void ToolBar::SetLabel(const wxString & label)
+{
+   mLabel = label;
+}
+
+//
 // Returns whether the toolbar is resizable or not
 //
 bool ToolBar::IsResizable()
@@ -204,8 +211,8 @@
                     wxDefaultPosition,
                     wxDefaultSize,
                     wxNO_BORDER | wxTAB_TRAVERSAL,
-                    mTitle );
-   SetLabel( mLabel );
+                    GetTitle() );
+   wxPanel::SetLabel( GetLabel() );
 
    // Go do the rest of the creation
    ReCreateButtons();
@@ -262,10 +269,25 @@
    Layout();
 }
 
+// The application preferences have changed, so update any elements that may
+// depend on them.
+void ToolBar::UpdatePrefs()
+{
+#if wxUSE_TOOLTIPS
+   // Change the tooltip of the grabber
+   mGrabber->SetToolTip( GetTitle() );
+#endif
+
+   return;
+}
+
+//
+// Return the pointer to the ToolBock where this bar lives
+//
 ToolDock *ToolBar::GetDock()
 {
    return mDock;
-};
+}
 
 //
 // Toggle the docked/floating state

Index: ControlToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ControlToolBar.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ControlToolBar.h    10 Sep 2007 21:12:36 -0000      1.5
+++ ControlToolBar.h    29 May 2009 17:07:39 -0000      1.6
@@ -84,10 +84,10 @@
    AButton *MakeButton(teBmps eFore, teBmps eDisabled,
       int id,
       bool processdownevents,
-      const wxChar *label,
-      const wxChar *tip);
+      const wxChar *label);
    void MakeLoopImage();
    void ArrangeButtons();
+   void RegenerateToolsTooltips();
    void SetupCutPreviewTracks(double playStart, double cutStart,
                              double cutEnd, double playEnd);
    void ClearCutPreviewTracks();

Index: TranscriptionToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/TranscriptionToolBar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TranscriptionToolBar.h      18 Oct 2007 23:49:05 -0000      1.3
+++ TranscriptionToolBar.h      29 May 2009 17:07:39 -0000      1.4
@@ -84,6 +84,7 @@
    virtual void Populate();
    virtual void Repaint(wxDC *dc) {};
    virtual void EnableDisableButtons();
+   virtual void UpdatePrefs();
 
    void OnFocus(wxFocusEvent &event);
    void OnCaptureKey(wxCommandEvent &event);
@@ -97,9 +98,10 @@
    AButton *AddButton(
       teBmps eFore, teBmps eDisabled,
       int id,
-      const wxChar *label, const wxChar *tip);
+      const wxChar *label);
    void GetSamples(WaveTrack *t, sampleCount *s0, sampleCount *slen);
    void SetButton(bool newstate, AButton *button);
+   void RegenerateTooltips();
    
    AButton *mButtons[TTBNumButtons];
    wxImage *upImage;

Index: ToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ToolBar.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ToolBar.h   25 Jul 2008 03:39:51 -0000      1.8
+++ ToolBar.h   29 May 2009 17:07:39 -0000      1.9
@@ -81,16 +81,19 @@
    virtual void Create(wxWindow *parent);
    virtual void EnableDisableButtons() = 0;
    virtual void ReCreateButtons();
-
-   void SetDocked(ToolDock *dock, bool pushed);
+   virtual void UpdatePrefs();
 
    int GetType();
    wxString GetTitle();
    wxString GetLabel();
    wxString GetSection();
    ToolDock *GetDock();
+
+   void SetLabel(const wxString & label);
    void SetDock( ToolDock *dock);
 
+   void SetDocked(ToolDock *dock, bool pushed);
+
    bool Expose(bool show = true);
 
    bool IsResizable();
@@ -167,7 +170,6 @@
 
    wxPoint mResizeStart;
 
-   wxString mTitle;
    wxString mLabel;
    wxString mSection;
    int mType;

Index: MixerToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/MixerToolBar.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- MixerToolBar.cpp    29 Mar 2009 03:39:08 -0000      1.12
+++ MixerToolBar.cpp    29 May 2009 17:07:39 -0000      1.13
@@ -235,6 +235,12 @@
    // Notify someone that we've changed our size
    Updated();
 #endif
+
+   // Set label to pull in language change
+   SetLabel(_("Mixer"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
 }
 
 void MixerToolBar::UpdateControls()

Index: EditToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/EditToolBar.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- EditToolBar.cpp     7 Jul 2008 15:45:56 -0000       1.8
+++ EditToolBar.cpp     29 May 2009 17:07:39 -0000      1.9
@@ -73,7 +73,7 @@
 
 //Standard contructor
 EditToolBar::EditToolBar()
-: ToolBar(EditBarID, _NoAcc("&Edit"), wxT("Edit"))
+: ToolBar(EditBarID, _("Edit"), wxT("Edit"))
 {
 }
 
@@ -100,7 +100,7 @@
    teBmps eFore, teBmps eDisabled,
    int id,
    const wxChar *label,
-   const wxChar *tip, bool toggle)
+   bool toggle)
 {
    AButton *&r = mButtons[id];
 
@@ -116,9 +116,6 @@
 // JKC: Unlike ControlToolBar, does not have a focus rect.  Shouldn't it?
 // r->SetFocusRect( r->GetRect().Deflate( 4, 4 ) );
 
-#if wxUSE_TOOLTIPS
-   r->SetToolTip(tip);
-#endif
    Add( r, 0, wxALIGN_CENTER );
 
    return r;
@@ -130,54 +127,79 @@
 
    /* Buttons */
    AddButton(bmpCut, bmpCutDisabled, ETBCutID,
-      _("Cut"), _("Cut"));
+      _("Cut"));
    AddButton(bmpCopy, bmpCopyDisabled, ETBCopyID,
-      _("Copy"), _("Copy"));
+      _("Copy"));
    AddButton(bmpPaste, bmpPasteDisabled, ETBPasteID,
-      _("Paste"), _("Paste"));
+      _("Paste"));
    AddButton(bmpTrim, bmpTrimDisabled, ETBTrimID,
-      _("Trim outside selection"),_("Trim"));
+      _("Trim outside selection"));
    AddButton(bmpSilence, bmpSilenceDisabled, ETBSilenceID,
-      _("Silence selection"),_("Silence"));
+      _("Silence selection"));
+
    AddSeparator();
+
    AddButton(bmpUndo, bmpUndoDisabled, ETBUndoID,
-      _("Undo"), _("Undo"));
+      _("Undo"));
    AddButton(bmpRedo, bmpRedoDisabled, ETBRedoID,
-      _NoAcc("&Redo"), _NoAcc("&Redo"));
+      _("Redo"));
+
    AddSeparator();
 
    AddButton(bmpLinkTracks, bmpLinkTracksDisabled, ETBLinkID,
-      _("Link Tracks"), _("Link Tracks"), true);
+      _("Link Tracks"), true);
    
    AddSeparator();
    
    AddButton(bmpZoomIn, bmpZoomInDisabled, ETBZoomInID,
-      _("Zoom In"),_("Zoom In"));
+      _("Zoom In"));
    AddButton(bmpZoomOut, bmpZoomOutDisabled, ETBZoomOutID,
-      _("Zoom Out"),_("Zoom Out"));
-
-   #if 0 // Disabled for version 1.2.0 since it doesn't work quite right...
-   AddButton(bmpZoomToggle, bmpZoomToggleDisabled, ETBZoomToggleID,
-      _("Zoom Toggle"),_("Zoom Toggle"));
-   #endif
+      _("Zoom Out"));
 
-    AddButton(bmpZoomSel, bmpZoomSelDisabled, ETBZoomSelID,
-      _("Fit selection in window"),_("Fit Selection"));
+   AddButton(bmpZoomSel, bmpZoomSelDisabled, ETBZoomSelID,
+      _("Fit selection in window"));
    AddButton(bmpZoomFit, bmpZoomFitDisabled, ETBZoomFitID,
-      _("Fit project in window"),_("Fit Project"));
+      _("Fit project in window"));
 
    mButtons[ETBZoomInID]->SetEnabled(false);
    mButtons[ETBZoomOutID]->SetEnabled(false);
 
-   #if 0 // Disabled for version 1.2.0 since it doesn't work quite right...
-   mButtons[ETBZoomToggleID]->SetEnabled(false);
-   #endif
-
    mButtons[ETBZoomSelID]->SetEnabled(false);
    mButtons[ETBZoomFitID]->SetEnabled(false);
    mButtons[ETBPasteID]->SetEnabled(false);
    
    mButtons[ETBLinkID]->PushDown();
+
+   RegenerateTooltips();
+}
+
+void EditToolBar::UpdatePrefs()
+{
+   RegenerateTooltips();
+
+   // Set label to pull in language change
+   SetLabel(_("Edit"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
+}
+
+void EditToolBar::RegenerateTooltips()
+{
+#if wxUSE_TOOLTIPS
+   mButtons[ETBCutID]->SetToolTip(_("Cut"));
+   mButtons[ETBCopyID]->SetToolTip(_("Copy"));
+   mButtons[ETBPasteID]->SetToolTip(_("Paste"));
+   mButtons[ETBTrimID]->SetToolTip(_("Trim"));
+   mButtons[ETBSilenceID]->SetToolTip(_("Silence"));
+   mButtons[ETBUndoID]->SetToolTip(_("Undo"));
+   mButtons[ETBRedoID]->SetToolTip(_("Redo"));
+   mButtons[ETBLinkID]->SetToolTip(_("Link Tracks"));
+   mButtons[ETBZoomInID]->SetToolTip(_("Zoom In"));
+   mButtons[ETBZoomOutID]->SetToolTip(_("Zoom Out"));
+   mButtons[ETBZoomSelID]->SetToolTip(_("Fit Selection"));
+   mButtons[ETBZoomFitID]->SetToolTip(_("Fit Project"));
+#endif
 }
 
 void EditToolBar::OnButton(wxCommandEvent &event)

Index: SelectionBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/SelectionBar.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- SelectionBar.cpp    25 Apr 2009 17:56:04 -0000      1.28
+++ SelectionBar.cpp    29 May 2009 17:07:39 -0000      1.29
@@ -280,6 +280,21 @@
    SetMinSize( GetSizer()->GetMinSize() );
 }
 
+void SelectionBar::UpdatePrefs()
+{
+   mRate = (double) 
gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), 
AudioIO::GetOptimalSupportedSampleRate());
+
+   wxCommandEvent e;
+   e.SetInt(mLeftTime->GetFormatIndex());
+   OnUpdate(e);
+
+   // Set label to pull in language change
+   SetLabel(_("Selection"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
+}
+
 void SelectionBar::SetListener(SelectionBarListener *l)
 {
    mListener = l;
@@ -349,7 +364,6 @@
     * which as they have no effect on the object state, so we just use the 
first
     * one to hand */
    wxString formatName =  mLeftTime->GetBuiltinName(index);
-   wxString formatString = mLeftTime->GetBuiltinFormat(index);
 
    gPrefs->Write(wxT("/SelectionFormat"), formatName);
 
@@ -369,6 +383,7 @@
 
    ValuesToControls();
 
+   wxString formatString = mLeftTime->GetBuiltinFormat(index);
    mLeftTime->SetFormatString(formatString);
    mRightTime->SetFormatString(formatString);
    mAudioTime->SetFormatString(formatString);
@@ -386,13 +401,6 @@
    Updated();
 }
 
-void SelectionBar::UpdateDisplay()
-{
-   wxCommandEvent e;
-   e.SetInt(mLeftTime->GetFormatIndex());
-   OnUpdate(e);
-}
-
 void SelectionBar::ValuesToControls()
 {
    mLeftTime->SetTimeValue(mStart);

Index: MeterToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/MeterToolBar.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- MeterToolBar.cpp    8 Mar 2009 20:28:57 -0000       1.9
+++ MeterToolBar.cpp    29 May 2009 17:07:39 -0000      1.10
@@ -90,10 +90,7 @@
    mRecordMeter->SetLabel( _("Meter-Record") );
    mSizer->Add( mRecordMeter, wxGBPosition( 0, 1 ), wxDefaultSpan, wxEXPAND );
 
-#if wxUSE_TOOLTIPS
-   mPlayMeter->SetToolTip( _("Output level meter") );
-   mRecordMeter->SetToolTip( _("Input level meter - click to monitor input") );
-#endif
+   RegenerateTooltips();
 
 #if defined(THIS_PROBABY_SHOULD_NOT_BE_DONE_HERE)
    // If AudioIO changes the meters while it's currently busy, then crashes are
@@ -104,6 +101,30 @@
 #endif
 }
 
+void MeterToolBar::UpdatePrefs()
+{
+   mPlayMeter->UpdatePrefs();
+   mPlayMeter->HandleLayout();
+   mRecordMeter->UpdatePrefs();
+   mRecordMeter->HandleLayout();
+
+   RegenerateTooltips();
+
+   // Set label to pull in language change
+   SetLabel(_("Meter"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
+}
+
+void MeterToolBar::RegenerateTooltips()
+{
+#if wxUSE_TOOLTIPS
+   mPlayMeter->SetToolTip( _("Output level meter") );
+   mRecordMeter->SetToolTip( _("Input level meter - click to monitor input") );
+#endif
+}
+
 bool MeterToolBar::DestroyChildren()
 {
    mPlayMeter = NULL;

Index: EditToolBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/EditToolBar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- EditToolBar.h       3 Jul 2008 15:26:49 -0000       1.3
+++ EditToolBar.h       29 May 2009 17:07:39 -0000      1.4
@@ -65,15 +65,18 @@
    void Populate();
    void Repaint(wxDC *dc) {};
    void EnableDisableButtons();
+   void UpdatePrefs();
 
  private:
 
    AButton *AddButton(teBmps eFore, teBmps eDisabled,
-      int id, const wxChar *label, const wxChar *tip, bool toggle=false);
+      int id, const wxChar *label, bool toggle = false);
 
    void AddSeparator();
 
    void MakeButtons();
+
+   void RegenerateTooltips();
    
    AButton *mButtons[ETBNumButtons];
 

Index: ToolManager.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ToolManager.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ToolManager.h       25 Jul 2008 03:39:51 -0000      1.10
+++ ToolManager.h       29 May 2009 17:07:39 -0000      1.11
@@ -50,6 +50,7 @@
    ~ToolManager();
 
    void LayoutToolBars();
+   void UpdatePrefs();
 
    bool IsDocked( int type );
 

Index: DeviceToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/DeviceToolBar.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- DeviceToolBar.cpp   6 Apr 2009 23:21:44 -0000       1.5
+++ DeviceToolBar.cpp   29 May 2009 17:07:39 -0000      1.6
@@ -107,11 +107,8 @@
                                wxDefaultSize,
                                outputs);
    mOutput->SetName(_("Output Device"));
-#if wxUSE_TOOLTIPS
-   mOutput->SetToolTip(_("Output Device"));
-#endif
-   Add(mOutput, 0, wxALIGN_CENTER);
 
+   Add(mOutput, 0, wxALIGN_CENTER);
    if (outputs.GetCount() == 0)
       mOutput->Enable(false);
 
@@ -128,9 +125,7 @@
                          wxDefaultSize,
                          inputs);
    mInput->SetName(_("Input Device"));
-#if wxUSE_TOOLTIPS
-   mInput->SetToolTip(_("Input Device"));
-#endif
+
    Add(mInput, 0, wxALIGN_CENTER);
    if (inputs.GetCount() == 0)
       mInput->Enable(false);
@@ -193,8 +188,23 @@
 void DeviceToolBar::UpdatePrefs()
 {
    mInput->SetStringSelection(gPrefs->Read(wxT("/AudioIO/RecordingDevice"), 
wxT("")));
-
    mOutput->SetStringSelection(gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), 
wxT("")));
+
+   RegenerateTooltips();
+
+   // Set label to pull in language change
+   SetLabel(_("Device"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
+}
+
+void DeviceToolBar::RegenerateTooltips()
+{
+#if wxUSE_TOOLTIPS
+   mOutput->SetToolTip(_("Output Device"));
+   mInput->SetToolTip(_("Input Device"));
+#endif
 }
 
 void DeviceToolBar::OnChoice(wxCommandEvent &event)

Index: SelectionBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/SelectionBar.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- SelectionBar.h      25 Apr 2009 17:56:04 -0000      1.8
+++ SelectionBar.h      29 May 2009 17:07:39 -0000      1.9
@@ -50,6 +50,7 @@
    virtual void Populate();
    virtual void Repaint(wxDC *dc) {};
    virtual void EnableDisableButtons() {};
+   virtual void UpdatePrefs();
 
    void SetTimes(double start, double end, double audio);
    double GetLeftTime();
@@ -59,15 +60,6 @@
    void SetRate(double rate);
    void SetListener(SelectionBarListener *l);
 
-   // msmeyer: Call this to enable/disable menu items
-   // in the "rate" menu, f.e. if sound card selection
-   // has changed.
-   void UpdateRates();
-
-   // lll: Call this when something more drastic has changed
-   // in the display, f.e. when the language has changed.
-   void UpdateDisplay();
-
  private:
 
    void ValuesToControls();
@@ -89,6 +81,8 @@
 
    void ModifySelection();
 
+   void UpdateRates();
+
    SelectionBarListener * mListener;
    double mRate;
    double mStart, mEnd, mAudio;


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to