Commit 1bf50568 authored by Eike Ziller's avatar Eike Ziller
Browse files

Editor help tool tip options cleanup.



Change-Id: I3afa91d95bc92f5bd2879f32ca7ab7ff86b97714
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@nokia.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@nokia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 5e0e93d2
......@@ -14,6 +14,12 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="TextEditor::BehaviorSettingsWidget" name="behaviorWidget" native="true"/>
</item>
......
......@@ -97,16 +97,16 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.scrollWheelZooming, SIGNAL(clicked(bool)),
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.constrainTooltips, SIGNAL(clicked()),
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.camelCaseNavigation, SIGNAL(clicked()),
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.keyboardTooltips, SIGNAL(clicked()),
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.utf8BomBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotExtraEncodingChanged()));
connect(d->m_ui.encodingBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotEncodingBoxChanged(int)));
connect(d->m_ui.constrainTooltipsBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotBehaviorSettingsChanged()));
connect(d->m_ui.keyboardTooltips, SIGNAL(clicked()),
this, SLOT(slotBehaviorSettingsChanged()));
}
BehaviorSettingsWidget::~BehaviorSettingsWidget()
......@@ -175,20 +175,29 @@ void BehaviorSettingsWidget::assignedStorageSettings(StorageSettings *storageSet
storageSettings->m_addFinalNewLine = d->m_ui.addFinalNewLine->isChecked();
}
void BehaviorSettingsWidget::updateConstrainTooltipsBoxTooltip() const
{
if (d->m_ui.constrainTooltipsBox->currentIndex() == 0)
d->m_ui.constrainTooltipsBox->setToolTip("Display context-sensitive help or type information on mouseover.");
else
d->m_ui.constrainTooltipsBox->setToolTip("Display context-sensitive help or type information on Shift+Mouseover.");
}
void BehaviorSettingsWidget::setAssignedBehaviorSettings(const BehaviorSettings &behaviorSettings)
{
d->m_ui.mouseNavigation->setChecked(behaviorSettings.m_mouseNavigation);
d->m_ui.scrollWheelZooming->setChecked(behaviorSettings.m_scrollWheelZooming);
d->m_ui.constrainTooltips->setChecked(behaviorSettings.m_constrainHoverTooltips);
d->m_ui.constrainTooltipsBox->setCurrentIndex(behaviorSettings.m_constrainHoverTooltips ? 1 : 0);
d->m_ui.camelCaseNavigation->setChecked(behaviorSettings.m_camelCaseNavigation);
d->m_ui.keyboardTooltips->setChecked(behaviorSettings.m_keyboardTooltips);
updateConstrainTooltipsBoxTooltip();
}
void BehaviorSettingsWidget::assignedBehaviorSettings(BehaviorSettings *behaviorSettings) const
{
behaviorSettings->m_mouseNavigation = d->m_ui.mouseNavigation->isChecked();
behaviorSettings->m_scrollWheelZooming = d->m_ui.scrollWheelZooming->isChecked();
behaviorSettings->m_constrainHoverTooltips = d->m_ui.constrainTooltips->isChecked();
behaviorSettings->m_constrainHoverTooltips = (d->m_ui.constrainTooltipsBox->currentIndex() == 1);
behaviorSettings->m_camelCaseNavigation = d->m_ui.camelCaseNavigation->isChecked();
behaviorSettings->m_keyboardTooltips = d->m_ui.keyboardTooltips->isChecked();
}
......@@ -223,7 +232,9 @@ QString BehaviorSettingsWidget::collectUiKeywords() const
<< sep << d->m_ui.utf8BomLabel->text()
<< sep << d->m_ui.mouseNavigation->text()
<< sep << d->m_ui.scrollWheelZooming->text()
<< sep << d->m_ui.constrainTooltips->text()
<< sep << d->m_ui.helpTooltipsLabel->text()
<< sep << d->m_ui.constrainTooltipsBox->itemText(0)
<< sep << d->m_ui.constrainTooltipsBox->itemText(1)
<< sep << d->m_ui.camelCaseNavigation->text()
<< sep << d->m_ui.keyboardTooltips->text()
<< sep << d->m_ui.groupBoxStorageSettings->title()
......@@ -251,6 +262,7 @@ void BehaviorSettingsWidget::slotBehaviorSettingsChanged()
{
BehaviorSettings settings;
assignedBehaviorSettings(&settings);
updateConstrainTooltipsBoxTooltip();
emit behaviorSettingsChanged(settings);
}
......
......@@ -95,6 +95,8 @@ private slots:
void slotEncodingBoxChanged(int index);
private:
void updateConstrainTooltipsBoxTooltip() const;
BehaviorSettingsWidgetPrivate *d;
};
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>802</width>
<height>441</height>
<height>416</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
......@@ -276,13 +276,6 @@ Specifies how backspace interacts with indentation.
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="utf8BomLabel">
<property name="text">
<string>UTF-8 BOM:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="utf8BomBox">
<property name="toolTip">
......@@ -311,6 +304,13 @@ Specifies how backspace interacts with indentation.
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="utf8BomLabel">
<property name="text">
<string>UTF-8 BOM:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......@@ -334,20 +334,6 @@ Specifies how backspace interacts with indentation.
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="constrainTooltips">
<property name="text">
<string>Enable hover &amp;tooltips only when Shift key is down</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="keyboardTooltips">
<property name="text">
<string>Enable &amp;keyboard tooltips when pressing and releasing the Alt key</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="camelCaseNavigation">
<property name="text">
......@@ -355,6 +341,54 @@ Specifies how backspace interacts with indentation.
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="helpTooltipsLabel">
<property name="text">
<string>Show help tooltips:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="constrainTooltipsBox">
<item>
<property name="text">
<string>On Mouseover</string>
</property>
</item>
<item>
<property name="text">
<string>On Shift+Mouseover</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="keyboardTooltips">
<property name="toolTip">
<string>Press Alt to display context-sensitive help or type information as tooltips.</string>
</property>
<property name="text">
<string>Using keyboard shortcut (Alt)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
......@@ -366,7 +400,7 @@ Specifies how backspace interacts with indentation.
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<height>40</height>
</size>
</property>
</spacer>
......
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