diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-03-08 07:48:55 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@nokia.com> | 2012-03-08 07:48:55 +0100 |
commit | 4b8df15f3d904f39e78b975fb3bedba03dcce9c1 (patch) | |
tree | ca71b9f2ed39590a6b0fd28305cad9c9544e2d36 /src/plugins/texteditor | |
parent | 3a808b0fd8a2e9d89ff01f51ffa6014f8207979d (diff) | |
parent | 62fd2713d00ed3756cead7072cbbd61e631e6670 (diff) | |
download | qt-creator-4b8df15f3d904f39e78b975fb3bedba03dcce9c1.tar.gz |
Merge remote-tracking branch 'origin/2.5'
Conflicts:
src/plugins/remotelinux/startgdbserverdialog.cpp
Change-Id: I69597e20d5372e9baf12ac09fc20d39406683f9e
Diffstat (limited to 'src/plugins/texteditor')
-rw-r--r-- | src/plugins/texteditor/basehoverhandler.cpp | 12 | ||||
-rw-r--r-- | src/plugins/texteditor/basetexteditor.cpp | 4 | ||||
-rw-r--r-- | src/plugins/texteditor/basetextmark.cpp | 4 | ||||
-rw-r--r-- | src/plugins/texteditor/behaviorsettingspage.ui | 6 | ||||
-rw-r--r-- | src/plugins/texteditor/behaviorsettingswidget.cpp | 26 | ||||
-rw-r--r-- | src/plugins/texteditor/behaviorsettingswidget.h | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/behaviorsettingswidget.ui | 80 | ||||
-rw-r--r-- | src/plugins/texteditor/icodestylepreferences.cpp | 8 | ||||
-rw-r--r-- | src/plugins/texteditor/snippets/snippetssettingspage.cpp | 10 |
9 files changed, 103 insertions, 49 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index ff9c8ada74..d0e448433e 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -51,8 +51,8 @@ using namespace Core; BaseHoverHandler::BaseHoverHandler(QObject *parent) : QObject(parent), m_diagnosticTooltip(false) { // Listen for editor opened events in order to connect to tooltip/helpid requests - connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor *)), - this, SLOT(editorOpened(Core::IEditor *))); + connect(ICore::editorManager(), SIGNAL(editorOpened(Core::IEditor*)), + this, SLOT(editorOpened(Core::IEditor*))); } BaseHoverHandler::~BaseHoverHandler() @@ -63,11 +63,11 @@ void BaseHoverHandler::editorOpened(Core::IEditor *editor) if (acceptEditor(editor)) { BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(editor); if (textEditor) { - connect(textEditor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*, QPoint, int)), - this, SLOT(showToolTip(TextEditor::ITextEditor*, QPoint, int))); + connect(textEditor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)), + this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int))); - connect(textEditor, SIGNAL(contextHelpIdRequested(TextEditor::ITextEditor*, int)), - this, SLOT(updateContextHelpId(TextEditor::ITextEditor*, int))); + connect(textEditor, SIGNAL(contextHelpIdRequested(TextEditor::ITextEditor*,int)), + this, SLOT(updateContextHelpId(TextEditor::ITextEditor*,int))); } } } diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 53788c861c..9f8540965c 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -247,7 +247,7 @@ BaseTextEditorWidget::BaseTextEditorWidget(QWidget *parent) connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(slotUpdateExtraAreaWidth())); connect(this, SIGNAL(modificationChanged(bool)), this, SLOT(slotModificationChanged(bool))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(slotCursorPositionChanged())); - connect(this, SIGNAL(updateRequest(QRect, int)), this, SLOT(slotUpdateRequest(QRect, int))); + connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(slotUpdateRequest(QRect,int))); connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); // (void) new QShortcut(tr("CTRL+L"), this, SLOT(centerCursor()), 0, Qt::WidgetShortcut); @@ -2544,7 +2544,7 @@ void BaseTextEditorWidgetPrivate::setupDocumentSignals(BaseTextDocument *documen QObject::connect(doc, SIGNAL(contentsChange(int,int,int)), q, SLOT(editorContentsChange(int,int,int)), Qt::DirectConnection); QObject::connect(document, SIGNAL(changed()), q, SIGNAL(changed())); - QObject::connect(document, SIGNAL(titleChanged(QString)), q, SLOT(setDisplayName(const QString &))); + QObject::connect(document, SIGNAL(titleChanged(QString)), q, SLOT(setDisplayName(QString))); QObject::connect(document, SIGNAL(aboutToReload()), q, SLOT(documentAboutToBeReloaded())); QObject::connect(document, SIGNAL(reloaded()), q, SLOT(documentReloaded())); q->slotUpdateExtraAreaWidth(); diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 6247838e02..9737314651 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -45,8 +45,8 @@ BaseTextMarkRegistry::BaseTextMarkRegistry(QObject *parent) : QObject(parent) { Core::EditorManager *em = Core::EditorManager::instance(); - connect(em, SIGNAL(editorOpened(Core::IEditor *)), - SLOT(editorOpened(Core::IEditor *))); + connect(em, SIGNAL(editorOpened(Core::IEditor*)), + SLOT(editorOpened(Core::IEditor*))); } void BaseTextMarkRegistry::add(BaseTextMark *mark) diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index d2773135e5..0ff81ee3a0 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -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> diff --git a/src/plugins/texteditor/behaviorsettingswidget.cpp b/src/plugins/texteditor/behaviorsettingswidget.cpp index 4d954544ed..9bd9b8c4c7 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.cpp +++ b/src/plugins/texteditor/behaviorsettingswidget.cpp @@ -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); } diff --git a/src/plugins/texteditor/behaviorsettingswidget.h b/src/plugins/texteditor/behaviorsettingswidget.h index 486a22b7c6..53c30fd0c2 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.h +++ b/src/plugins/texteditor/behaviorsettingswidget.h @@ -95,6 +95,8 @@ private slots: void slotEncodingBoxChanged(int index); private: + void updateConstrainTooltipsBoxTooltip() const; + BehaviorSettingsWidgetPrivate *d; }; diff --git a/src/plugins/texteditor/behaviorsettingswidget.ui b/src/plugins/texteditor/behaviorsettingswidget.ui index 7cdbc4f39e..60ea6a35cd 100644 --- a/src/plugins/texteditor/behaviorsettingswidget.ui +++ b/src/plugins/texteditor/behaviorsettingswidget.ui @@ -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> @@ -335,26 +335,60 @@ Specifies how backspace interacts with indentation. </widget> </item> <item> - <widget class="QCheckBox" name="constrainTooltips"> - <property name="text"> - <string>Enable hover &tooltips only when Shift key is down</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="keyboardTooltips"> - <property name="text"> - <string>Enable &keyboard tooltips when pressing and releasing the Alt key</string> - </property> - </widget> - </item> - <item> <widget class="QCheckBox" name="camelCaseNavigation"> <property name="text"> <string>Enable built-in camel case &navigation</string> </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> diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp index 8f0f444214..51e8225208 100644 --- a/src/plugins/texteditor/icodestylepreferences.cpp +++ b/src/plugins/texteditor/icodestylepreferences.cpp @@ -192,8 +192,8 @@ void ICodeStylePreferences::setCurrentDelegate(ICodeStylePreferences *delegate) this, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings))); disconnect(d->m_currentDelegate, SIGNAL(currentValueChanged(QVariant)), this, SIGNAL(currentValueChanged(QVariant))); - disconnect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *)), - this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *))); + disconnect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), + this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*))); } d->m_currentDelegate = delegate; if (d->m_currentDelegate) { @@ -201,8 +201,8 @@ void ICodeStylePreferences::setCurrentDelegate(ICodeStylePreferences *delegate) this, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings))); connect(d->m_currentDelegate, SIGNAL(currentValueChanged(QVariant)), this, SIGNAL(currentValueChanged(QVariant))); - connect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *)), - this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences *))); + connect(d->m_currentDelegate, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), + this, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*))); } emit currentDelegateChanged(d->m_currentDelegate); emit currentPreferencesChanged(currentPreferences()); diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 6e719a4ea5..40eebb44d0 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -360,15 +360,15 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w) loadSettings(); loadSnippetGroup(m_ui.groupCombo->currentIndex()); - connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(selectSnippet(QModelIndex,int))); - connect(m_model, SIGNAL(rowsInserted(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(markSnippetsCollection())); - connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), + connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(markSnippetsCollection())); - connect(m_model, SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)), + connect(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(selectMovedSnippet(QModelIndex,int,int,QModelIndex,int))); - connect(m_model, SIGNAL(rowsMoved(QModelIndex, int, int, QModelIndex, int)), + connect(m_model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(markSnippetsCollection())); connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(markSnippetsCollection())); |