GUI: added option to suppress all beeps
This commit is contained in:
parent
303da9304d
commit
7f2dd3cd8b
@ -237,6 +237,8 @@ void rwSettings(bool writing)
|
|||||||
|
|
||||||
SETTING_RW(prefs.termMatchType, "/Recoll/prefs/query/termMatchType",
|
SETTING_RW(prefs.termMatchType, "/Recoll/prefs/query/termMatchType",
|
||||||
Int, 0);
|
Int, 0);
|
||||||
|
SETTING_RW(prefs.noBeeps, "/Recoll/prefs/query/noBeeps", Bool, false);
|
||||||
|
|
||||||
// This is not really the current program version, just a value to
|
// This is not really the current program version, just a value to
|
||||||
// be used in case we have incompatible changes one day
|
// be used in case we have incompatible changes one day
|
||||||
SETTING_RW(prefs.rclVersion, "/Recoll/prefs/rclVersion", Int, 1009);
|
SETTING_RW(prefs.rclVersion, "/Recoll/prefs/rclVersion", Int, 1009);
|
||||||
|
|||||||
@ -135,7 +135,9 @@ class PrefsPack {
|
|||||||
// Program version that wrote this. Not used for now, in prevision
|
// Program version that wrote this. Not used for now, in prevision
|
||||||
// of the case where we might need an incompatible change
|
// of the case where we might need an incompatible change
|
||||||
int rclVersion;
|
int rclVersion;
|
||||||
|
// Suppress all noises
|
||||||
|
bool noBeeps;
|
||||||
|
|
||||||
bool showTrayIcon;
|
bool showTrayIcon;
|
||||||
bool closeToTray;
|
bool closeToTray;
|
||||||
|
|
||||||
|
|||||||
@ -375,7 +375,7 @@ void Preview::doSearch(const QString &_text, bool next, bool reverse,
|
|||||||
if (found) {
|
if (found) {
|
||||||
m_canBeep = true;
|
m_canBeep = true;
|
||||||
} else {
|
} else {
|
||||||
if (m_canBeep)
|
if (m_canBeep && !prefs.noBeeps)
|
||||||
QApplication::beep();
|
QApplication::beep();
|
||||||
m_canBeep = false;
|
m_canBeep = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,7 +250,12 @@ void RclMain::previewPrevOrNextInTab(Preview * w, int sid, int docnum, bool nxt)
|
|||||||
else
|
else
|
||||||
docnum--;
|
docnum--;
|
||||||
if (docnum < 0 || !m_source || docnum >= m_source->getResCnt()) {
|
if (docnum < 0 || !m_source || docnum >= m_source->getResCnt()) {
|
||||||
QApplication::beep();
|
if (!prefs.noBeeps) {
|
||||||
|
LOGDEB("Beeping\n");
|
||||||
|
QApplication::beep();
|
||||||
|
} else {
|
||||||
|
LOGDEB("Not beeping because nobeep is set\n");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -260,6 +260,16 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="noBeepsCB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Suppress all beeps.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="ssNoCompleteCB">
|
<widget class="QCheckBox" name="ssNoCompleteCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@ -126,6 +126,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
filterBT_RB->setChecked(1);
|
filterBT_RB->setChecked(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
noBeepsCB->setChecked(prefs.noBeeps);
|
||||||
ssNoCompleteCB->setChecked(prefs.ssearchNoComplete);
|
ssNoCompleteCB->setChecked(prefs.ssearchNoComplete);
|
||||||
ssSearchOnCompleteCB->setChecked(prefs.ssearchStartOnComplete);
|
ssSearchOnCompleteCB->setChecked(prefs.ssearchStartOnComplete);
|
||||||
ssSearchOnCompleteCB->setEnabled(!prefs.ssearchNoComplete);
|
ssSearchOnCompleteCB->setEnabled(!prefs.ssearchNoComplete);
|
||||||
@ -261,6 +262,7 @@ void UIPrefsDialog::setupReslistFontPB()
|
|||||||
|
|
||||||
void UIPrefsDialog::accept()
|
void UIPrefsDialog::accept()
|
||||||
{
|
{
|
||||||
|
prefs.noBeeps = noBeepsCB->isChecked();
|
||||||
prefs.ssearchNoComplete = ssNoCompleteCB->isChecked();
|
prefs.ssearchNoComplete = ssNoCompleteCB->isChecked();
|
||||||
prefs.ssearchStartOnComplete = ssSearchOnCompleteCB->isChecked();
|
prefs.ssearchStartOnComplete = ssSearchOnCompleteCB->isChecked();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user