forked from qt-creator/qt-creator
Terminal: Make audible bell configurable
Change-Id: I6cc02f2f1b873f39352151265fb7ba1fe0f170fc Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -104,12 +104,19 @@ TerminalSettings::TerminalSettings()
|
||||
"instead of closing the terminal."));
|
||||
sendEscapeToTerminal.setDefaultValue(false);
|
||||
|
||||
audibleBell.setSettingsKey("AudibleBell");
|
||||
audibleBell.setLabelText(Tr::tr("Audible bell"));
|
||||
audibleBell.setToolTip(Tr::tr("If enabled, the terminal will beep when a bell "
|
||||
"character is received."));
|
||||
audibleBell.setDefaultValue(true);
|
||||
|
||||
registerAspect(&font);
|
||||
registerAspect(&fontSize);
|
||||
registerAspect(&shell);
|
||||
registerAspect(&allowBlinkingCursor);
|
||||
registerAspect(&enableTerminal);
|
||||
registerAspect(&sendEscapeToTerminal);
|
||||
registerAspect(&audibleBell);
|
||||
|
||||
setupColor(this,
|
||||
foregroundColor,
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
Utils::BoolAspect allowBlinkingCursor;
|
||||
|
||||
Utils::BoolAspect sendEscapeToTerminal;
|
||||
Utils::BoolAspect audibleBell;
|
||||
};
|
||||
|
||||
} // namespace Terminal
|
||||
|
||||
@@ -378,9 +378,10 @@ QWidget *TerminalSettingsPage::widget()
|
||||
Column {
|
||||
Group {
|
||||
title(Tr::tr("General")),
|
||||
Row {
|
||||
Column {
|
||||
settings.enableTerminal, st,
|
||||
settings.sendEscapeToTerminal, st
|
||||
settings.sendEscapeToTerminal, st,
|
||||
settings.audibleBell, st,
|
||||
},
|
||||
},
|
||||
Group {
|
||||
|
||||
@@ -332,7 +332,11 @@ void TerminalWidget::setupSurface()
|
||||
connect(m_surface.get(), &Internal::TerminalSurface::unscroll, this, [this] {
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
});
|
||||
connect(m_surface.get(), &Internal::TerminalSurface::bell, this, [] { QApplication::beep(); });
|
||||
connect(m_surface.get(), &Internal::TerminalSurface::bell, this, [] {
|
||||
if (TerminalSettings::instance().audibleBell.value())
|
||||
QApplication::beep();
|
||||
});
|
||||
|
||||
if (m_shellIntegration) {
|
||||
connect(m_shellIntegration.get(),
|
||||
&ShellIntegration::commandChanged,
|
||||
|
||||
Reference in New Issue
Block a user