Commit de9e92b8 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

EditProfileDialog: add GUI to change the terminal bell mode

The feature has been in the profile settings for a long time, but without
being exposed in the UI.

BUG: 407821
BUG: 425759
parent bc651759
......@@ -21,6 +21,7 @@
#include <QTimer>
#include <QUrl>
#include <QStandardPaths>
#include <QStringListModel>
#include <QRegularExpressionValidator>
// KDE
......@@ -467,6 +468,12 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr &profile)
_generalUi->terminalColumnsEntry->setFixedWidth(sizeEntryWidth);
_generalUi->terminalRowsEntry->setFixedWidth(sizeEntryWidth);
auto *bellModeModel = new QStringListModel({i18n("System Bell"), i18n("System Notifications"),
i18n("Visual Bell"), i18n("Ignore Bell Events")},
this);
_generalUi->terminalBellCombo->setModel(bellModeModel);
_generalUi->terminalBellCombo->setCurrentIndex(profile->property<int>(Profile::BellMode));
// signals and slots
connect(_generalUi->dirSelectButton, &QToolButton::clicked, this,
&Konsole::EditProfileDialog::selectInitialDir);
......@@ -489,6 +496,11 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr &profile)
connect(_generalUi->terminalRowsEntry,
QOverload<int>::of(&QSpinBox::valueChanged), this,
&Konsole::EditProfileDialog::terminalRowsEntryChanged);
connect(_generalUi->terminalBellCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, [this](const int index) {
updateTempProfileProperty(Profile::BellMode, index);
});
}
void EditProfileDialog::showEnvironmentEditor()
......
......@@ -315,6 +315,24 @@
</property>
</widget>
</item>
<item row="8" column="0" alignment="Qt::AlignRight">
<widget class="QLabel" name="terminalBellLabel">
<property name="text">
<string>Terminal bell mode:</string>
</property>
<property name="buddy">
<cstring>terminalBellCombo</cstring>
</property>
</widget>
</item>
<item row="8" column="1" colspan="1" alignment="Qt::AlignLeft">
<layout class="QHBoxLayout" name="terminalBellLayout">
<item>
<widget class="QComboBox" name="terminalBellCombo">
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment