From e338b34fafd2e6c3574c7c43c2f0649132b66f1f Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 27 Jun 2011 20:43:09 +0200 Subject: [PATCH] Widgets classes: use "WindowTitle" property instead of "AccessibleName" As the interface for the "AccessibleName" property might not be available when Qt was built without accessibility support, use the "WindowTitle" property instead where appropriate. Closes #3300101. --- plugins/vibed/nine_button_selector.cpp | 2 +- plugins/vibed/vibed.cpp | 6 +++--- src/gui/AutomatableModelView.cpp | 8 +++----- src/gui/widgets/automatable_button.cpp | 9 ++++----- src/gui/widgets/automatable_slider.cpp | 2 +- src/gui/widgets/combobox.cpp | 4 ++-- src/gui/widgets/fader.cpp | 4 ++-- src/gui/widgets/knob.cpp | 8 ++++---- src/gui/widgets/lcd_spinbox.cpp | 6 +++--- 9 files changed, 23 insertions(+), 26 deletions(-) diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 9e9a4ee0d..8035030e2 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -251,7 +251,7 @@ void nineButtonSelector::updateButton( Uint8 _new_button ) void nineButtonSelector::contextMenuEvent( QContextMenuEvent * ) { - captionMenu contextMenu( accessibleName() ); + captionMenu contextMenu( windowTitle() ); contextMenu.addAction( embed::getIconPixmap( "help" ), tr( "&Help" ), this, SLOT( displayHelp() ) ); contextMenu.exec( QCursor::pos() ); diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 9ce83afb0..8f4c0dd41 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -459,7 +459,7 @@ vibedView::vibedView( Instrument * _instrument, 21, 127, this ); - m_harmonic->setAccessibleName( tr( "Octave" ) ); + m_harmonic->setWindowTitle( tr( "Octave" ) ); m_harmonic->setWhatsThis( tr( "The Octave selector is used to choose which harmonic of the note the " "string will ring at. For example, '-2' means the string will ring two " @@ -492,7 +492,7 @@ vibedView::vibedView( Instrument * _instrument, this); m_graph = new graph( this ); - m_graph->setAccessibleName( tr( "Impulse Editor" ) ); + m_graph->setWindowTitle( tr( "Impulse Editor" ) ); m_graph->setForeground( PLUGIN_NAME::getIconPixmap( "wavegraph4" ) ); m_graph->move( 76, 21 ); m_graph->resize(132, 104); @@ -540,7 +540,7 @@ vibedView::vibedView( Instrument * _instrument, // String selector is not a part of the model - m_stringSelector->setAccessibleName( tr( "String" ) ); + m_stringSelector->setWindowTitle( tr( "String" ) ); m_stringSelector->setWhatsThis( tr( "The String selector is used to choose which string the controls are " "editing. A Vibed instrument can contain up to nine independently " diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 7395ca161..744ba26f5 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -1,8 +1,8 @@ /* - * automatable_model_view.cpp - implementation of AutomatableModelView + * AutomatableModelView.cpp - implementation of AutomatableModelView + * + * Copyright (c) 2011 Tobias Doerffel * - * Copyright (c) 2008 Tobias Doerffel - * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -22,7 +22,6 @@ * */ - #include #include @@ -136,7 +135,6 @@ void AutomatableModelView::addDefaultActions( QMenu * _menu ) void AutomatableModelView::setModel( Model * _model, bool _old_model_valid ) { ModelView::setModel( _model, _old_model_valid ); - //setAccessibleName( _model->displayName(); } diff --git a/src/gui/widgets/automatable_button.cpp b/src/gui/widgets/automatable_button.cpp index 6dd51118a..776c0fc4f 100644 --- a/src/gui/widgets/automatable_button.cpp +++ b/src/gui/widgets/automatable_button.cpp @@ -2,8 +2,8 @@ * automatable_button.cpp - implementation of class automatableButton and * automatableButtonGroup * - * Copyright (c) 2006-2009 Tobias Doerffel - * + * Copyright (c) 2006-2011 Tobias Doerffel + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -23,7 +23,6 @@ * */ - #include "automatable_button.h" #include @@ -43,7 +42,7 @@ automatableButton::automatableButton( QWidget * _parent, BoolModelView( new BoolModel( false, NULL, _name, true ), this ), m_group( NULL ) { - setAccessibleName( _name ); + setWindowTitle( _name ); doConnections(); setFocusPolicy( Qt::NoFocus ); } @@ -171,7 +170,7 @@ automatableButtonGroup::automatableButtonGroup( QWidget * _parent, IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ) { hide(); - setAccessibleName( _name ); + setWindowTitle( _name ); } diff --git a/src/gui/widgets/automatable_slider.cpp b/src/gui/widgets/automatable_slider.cpp index b53014562..9649e9645 100644 --- a/src/gui/widgets/automatable_slider.cpp +++ b/src/gui/widgets/automatable_slider.cpp @@ -42,7 +42,7 @@ automatableSlider::automatableSlider( QWidget * _parent, IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ), m_showStatus( false ) { - setAccessibleName( _name ); + setWindowTitle( _name ); connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( changeValue( int ) ) ); diff --git a/src/gui/widgets/combobox.cpp b/src/gui/widgets/combobox.cpp index e71e98d81..9244344b9 100644 --- a/src/gui/widgets/combobox.cpp +++ b/src/gui/widgets/combobox.cpp @@ -1,7 +1,7 @@ /* * combobox.cpp - implementation of LMMS-combobox * - * Copyright (c) 2006-2010 Tobias Doerffel + * Copyright (c) 2006-2011 Tobias Doerffel * Copyright (c) 2008-2009 Paul Giblock * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -75,7 +75,7 @@ comboBox::comboBox( QWidget * _parent, const QString & _name ) : connect( &m_menu, SIGNAL( triggered( QAction * ) ), this, SLOT( setItem( QAction * ) ) ); - setAccessibleName( _name ); + setWindowTitle( _name ); doConnections(); } diff --git a/src/gui/widgets/fader.cpp b/src/gui/widgets/fader.cpp index da312892a..e94a26d94 100644 --- a/src/gui/widgets/fader.cpp +++ b/src/gui/widgets/fader.cpp @@ -79,7 +79,7 @@ fader::fader( FloatModel * _model, const QString & _name, QWidget * _parent ) : { s_textFloat = new textFloat; } - setAccessibleName( _name ); + setWindowTitle( _name ); setAttribute( Qt::WA_OpaquePaintEvent, true ); setMinimumSize( 23, 116 ); setMaximumSize( 23, 116); @@ -98,7 +98,7 @@ fader::~fader() void fader::contextMenuEvent( QContextMenuEvent * _ev ) { - captionMenu contextMenu( accessibleName() ); + captionMenu contextMenu( windowTitle() ); addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); _ev->accept(); diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 8866a4483..40dff8dcf 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -1,7 +1,7 @@ /* * knob.cpp - powerful knob-widget * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2011 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -71,7 +71,7 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name ) : s_textFloat = new textFloat; } - setAccessibleName( _name ); + setWindowTitle( _name ); if( m_knobNum != knobStyled ) { @@ -572,7 +572,7 @@ void knob::enterValue() configManager::inst()->value( "app", "displaydbv" ).toInt() ) { new_val = QInputDialog::getDouble( - this, accessibleName(), + this, windowTitle(), tr( "Please enter a new value between " "-96.0 dBV and 6.0 dBV:" ), 20.0 * log10( model()->value() / 100.0 ), @@ -589,7 +589,7 @@ void knob::enterValue() else { new_val = QInputDialog::getDouble( - this, accessibleName(), + this, windowTitle(), tr( "Please enter a new value between " "%1 and %2:" ). arg( model()->minValue() ). diff --git a/src/gui/widgets/lcd_spinbox.cpp b/src/gui/widgets/lcd_spinbox.cpp index 9ce515492..16708a2c3 100644 --- a/src/gui/widgets/lcd_spinbox.cpp +++ b/src/gui/widgets/lcd_spinbox.cpp @@ -1,7 +1,7 @@ /* * lcd_spinbox.cpp - class lcdSpinBox, an improved QLCDNumber * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2011 Tobias Doerffel * Copyright (c) 2008 Paul Giblock * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -52,7 +52,7 @@ lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent, { setEnabled( true ); - setAccessibleName( _name ); + setWindowTitle( _name ); m_lcdPixmap = new QPixmap( embed::getIconPixmap( "lcd_19green" ) ); @@ -77,7 +77,7 @@ lcdSpinBox::lcdSpinBox( int _num_digits, const QString & _lcd_style, { setEnabled( true ); - setAccessibleName( _name ); + setWindowTitle( _name ); // We should make a factory for these or something. m_lcdPixmap = new QPixmap( embed::getIconPixmap( QString( "lcd_" +