Skip to content

Commit 21d11da

Browse files
committed
Add settings checkbox to enable/disable tooltips
1 parent fe88e3e commit 21d11da

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

src/clientsettingsdlg.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
397397
"A second sound device may be required to hear the alerts." ) );
398398
chbAudioAlerts->setAccessibleName ( tr ( "Audio Alerts check box" ) );
399399

400+
// show tooltips
401+
chbShowToolTips->setWhatsThis ( "<b>" + tr ( "Show ToolTips" ) + ":</b> " +
402+
tr ( "Enable or disable the showing of ToolTips when the mouse points to certain items." ) );
403+
chbShowToolTips->setAccessibleName ( tr ( "Show ToolTips check box" ) );
404+
400405
// init driver button
401406
#if defined( _WIN32 ) && !defined( WITH_JACK )
402407
butDriverSetup->setText ( tr ( "ASIO Device Settings" ) );
@@ -480,6 +485,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
480485
// init audio alerts
481486
chbAudioAlerts->setCheckState ( pSettings->bEnableAudioAlerts ? Qt::Checked : Qt::Unchecked );
482487

488+
// init show tooltips
489+
chbShowToolTips->setCheckState ( pSettings->bShowToolTips ? Qt::Checked : Qt::Unchecked );
490+
483491
// update feedback detection
484492
chbDetectFeedback->setCheckState ( pSettings->bEnableFeedbackDetection ? Qt::Checked : Qt::Unchecked );
485493

@@ -645,6 +653,8 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, CClientSettings* pNSet
645653

646654
QObject::connect ( chbAudioAlerts, &QCheckBox::stateChanged, this, &CClientSettingsDlg::OnAudioAlertsChanged );
647655

656+
QObject::connect ( chbShowToolTips, &QCheckBox::stateChanged, this, &CClientSettingsDlg::OnShowToolTipsChanged );
657+
648658
// line edits
649659
QObject::connect ( edtNewClientLevel, &QLineEdit::editingFinished, this, &CClientSettingsDlg::OnNewClientLevelEditingFinished );
650660

@@ -998,6 +1008,8 @@ void CClientSettingsDlg::OnMeterStyleActivated ( int iMeterStyleIdx )
9981008

9991009
void CClientSettingsDlg::OnAudioAlertsChanged ( int value ) { pSettings->bEnableAudioAlerts = value == Qt::Checked; }
10001010

1011+
void CClientSettingsDlg::OnShowToolTipsChanged ( int value ) { pSettings->bShowToolTips = value == Qt::Checked; }
1012+
10011013
void CClientSettingsDlg::OnAutoJitBufStateChanged ( int value )
10021014
{
10031015
pClient->SetDoAutoSockBufSize ( value == Qt::Checked );

src/clientsettingsdlg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public slots:
9797
void OnGUIDesignActivated ( int iDesignIdx );
9898
void OnMeterStyleActivated ( int iMeterStyleIdx );
9999
void OnAudioAlertsChanged ( int value );
100+
void OnShowToolTipsChanged ( int value );
100101
void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; }
101102
void OnAliasTextChanged ( const QString& strNewName );
102103
void OnInstrumentActivated ( int iCntryListItem );
@@ -116,6 +117,7 @@ public slots:
116117
void GUIDesignChanged();
117118
void MeterStyleChanged();
118119
void AudioAlertsChanged();
120+
void ShowToolTipsChanged();
119121
void AudioChannelsChanged();
120122
void CustomDirectoriesChanged();
121123
void NumMixerPanelRowsChanged ( int value );

src/clientsettingsdlgbase.ui

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@
276276
</property>
277277
</widget>
278278
</item>
279+
<item>
280+
<widget class="QLabel" name="lblShowToolTips">
281+
<property name="text">
282+
<string/>
283+
</property>
284+
</widget>
285+
</item>
279286
</layout>
280287
</item>
281288
<item>
@@ -322,6 +329,13 @@
322329
</property>
323330
</widget>
324331
</item>
332+
<item>
333+
<widget class="QCheckBox" name="chbShowToolTips">
334+
<property name="text">
335+
<string>Show Tooltips</string>
336+
</property>
337+
</widget>
338+
</item>
325339
</layout>
326340
</item>
327341
</layout>
@@ -1358,6 +1372,7 @@
13581372
<tabstop>cbxLanguage</tabstop>
13591373
<tabstop>spnMixerRows</tabstop>
13601374
<tabstop>chbAudioAlerts</tabstop>
1375+
<tabstop>chbShowToolTips</tabstop>
13611376
<tabstop>cbxSoundcard</tabstop>
13621377
<tabstop>butDriverSetup</tabstop>
13631378
<tabstop>cbxLInChan</tabstop>

src/settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ void CClientSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
289289
bEnableAudioAlerts = bValue;
290290
}
291291

292+
// show tooltips
293+
if ( GetFlagIniSet ( IniXMLDocument, "client", "showtooltips", bValue ) )
294+
{
295+
bShowToolTips = bValue;
296+
}
297+
292298
// name
293299
pClient->ChannelInfo.strName = FromBase64ToString (
294300
GetIniSetting ( IniXMLDocument, "client", "name_base64", ToBase64 ( QCoreApplication::translate ( "CMusProfDlg", "No Name" ) ) ) );
@@ -652,6 +658,9 @@ void CClientSettings::WriteSettingsToXML ( QDomDocument& IniXMLDocument, bool is
652658
// audio alerts
653659
SetFlagIniSet ( IniXMLDocument, "client", "enableaudioalerts", bEnableAudioAlerts );
654660

661+
// show tooltips
662+
SetFlagIniSet ( IniXMLDocument, "client", "showtooltips", bShowToolTips );
663+
655664
// name
656665
PutIniSetting ( IniXMLDocument, "client", "name_base64", ToBase64 ( pClient->ChannelInfo.strName ) );
657666

src/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class CClientSettings : public CSettings
157157
eDirectoryType ( AT_DEFAULT ),
158158
bEnableFeedbackDetection ( true ),
159159
bEnableAudioAlerts ( false ),
160+
bShowToolTips ( true ),
160161
vecWindowPosSettings(), // empty array
161162
vecWindowPosChat(), // empty array
162163
vecWindowPosConnect(), // empty array
@@ -191,6 +192,7 @@ class CClientSettings : public CSettings
191192
int iCustomDirectoryIndex; // index of selected custom directory
192193
bool bEnableFeedbackDetection;
193194
bool bEnableAudioAlerts;
195+
bool bShowToolTips;
194196

195197
// window position/state settings
196198
QByteArray vecWindowPosSettings;

0 commit comments

Comments
 (0)