Merge remote branch 'origin/2.0'

Conflicts:
	src/plugins/cpptools/cppcodecompletion.cpp
This commit is contained in:
con
2010-05-12 17:25:40 +02:00
65 changed files with 1014 additions and 512 deletions

View File

@@ -37,7 +37,7 @@ leave room for the Qt 4 target page.
<wizard version="1" kind="project" <wizard version="1" kind="project"
class="qt4project" firstpage="10" class="qt4project" firstpage="10"
id="QmlRuntimePlugin" category="F.Projects"> id="QmlRuntimePlugin" category="F.Projects">
<description>Creates a plug-in for the QML runtime.</description> <description>Creates a C++ plugin to extend the funtionality of the QML runtime.</description>
<displayname>QML Runtime Plug-in</displayname> <displayname>QML Runtime Plug-in</displayname>
<displaycategory>QML Runtime Plug-in</displaycategory> <displaycategory>QML Runtime Plug-in</displaycategory>
<files> <files>

View File

@@ -2102,7 +2102,12 @@ Sollen sie überschrieben werden?</translation>
<translation>Neu</translation> <translation>Neu</translation>
</message> </message>
<message> <message>
<location line="+542"/> <location line="+516"/>
<source>Open Project</source>
<translation>Projekt öffnen</translation>
</message>
<message>
<location line="+38"/>
<source>Settings...</source> <source>Settings...</source>
<translation>Einstellungen...</translation> <translation>Einstellungen...</translation>
</message> </message>
@@ -2236,7 +2241,7 @@ Sollen sie überschrieben werden?</translation>
<context> <context>
<name>Core::Internal::OutputPaneManager</name> <name>Core::Internal::OutputPaneManager</name>
<message> <message>
<location filename="../../../src/plugins/coreplugin/outputpane.cpp" line="+206"/> <location filename="../../../src/plugins/coreplugin/outputpane.cpp" line="+209"/>
<source>Output</source> <source>Output</source>
<translation>Ausgaben</translation> <translation>Ausgaben</translation>
</message> </message>
@@ -2256,7 +2261,7 @@ Sollen sie überschrieben werden?</translation>
<translation>Vorangehender Eintrag</translation> <translation>Vorangehender Eintrag</translation>
</message> </message>
<message> <message>
<location line="+4"/> <location line="+5"/>
<location line="+195"/> <location line="+195"/>
<source>Maximize Output Pane</source> <source>Maximize Output Pane</source>
<translation>Ausgabepanel maximiert darstellen</translation> <translation>Ausgabepanel maximiert darstellen</translation>
@@ -2429,9 +2434,13 @@ Sollen sie überschrieben werden?</translation>
<context> <context>
<name>Core::ModeManager</name> <name>Core::ModeManager</name>
<message> <message>
<location filename="../../../src/plugins/coreplugin/modemanager.cpp" line="+180"/>
<source>Switch to %1 mode</source> <source>Switch to %1 mode</source>
<translation>Gehe zu Mode &apos;%1&apos;</translation> <translation type="obsolete">Gehe zu Mode &apos;%1&apos;</translation>
</message>
<message>
<location filename="../../../src/plugins/coreplugin/modemanager.cpp" line="+180"/>
<source>Switch to &lt;b&gt;%1&lt;/b&gt; mode</source>
<translation>Gehe zu Mode &lt;b&gt;&apos;%1&apos;&lt;/b&gt;</translation>
</message> </message>
</context> </context>
<context> <context>
@@ -7620,7 +7629,7 @@ on slow machines. In this case, the value should be increased.</source>
<context> <context>
<name>Git::Internal::LocalBranchModel</name> <name>Git::Internal::LocalBranchModel</name>
<message> <message>
<location filename="../../../src/plugins/git/branchmodel.cpp" line="+196"/> <location filename="../../../src/plugins/git/branchmodel.cpp" line="+197"/>
<source>&lt;New branch&gt;</source> <source>&lt;New branch&gt;</source>
<translation>&lt;Neuer Branch&gt;</translation> <translation>&lt;Neuer Branch&gt;</translation>
</message> </message>
@@ -9447,7 +9456,7 @@ on slow machines. In this case, the value should be increased.</source>
<translation>Umgebungsvariablen</translation> <translation>Umgebungsvariablen</translation>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/perforce/settingspage.cpp" line="+136"/> <location filename="../../../src/plugins/perforce/settingspage.cpp" line="+137"/>
<source>Perforce</source> <source>Perforce</source>
<translation>Perforce</translation> <translation>Perforce</translation>
</message> </message>
@@ -9596,7 +9605,7 @@ on slow machines. In this case, the value should be increased.</source>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp" line="+181"/> <location filename="../../../src/plugins/qmldesigner/components/pluginmanager/pluginpath.cpp" line="+181"/>
<location filename="../../../src/plugins/qmldesigner/core/pluginmanager/widgetpluginpath.cpp" line="+204"/> <location filename="../../../src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp" line="+204"/>
<source>Failed Plugins</source> <source>Failed Plugins</source>
<translation>Nicht geladene Plugins (Fehlschlag beim Ladevorgang)</translation> <translation>Nicht geladene Plugins (Fehlschlag beim Ladevorgang)</translation>
</message> </message>
@@ -9972,7 +9981,7 @@ Fehler: %2</translation>
<context> <context>
<name>ProjectExplorer::Internal::AllProjectsFind</name> <name>ProjectExplorer::Internal::AllProjectsFind</name>
<message> <message>
<location filename="../../../src/plugins/projectexplorer/allprojectsfind.cpp" line="+64"/> <location filename="../../../src/plugins/projectexplorer/allprojectsfind.cpp" line="+65"/>
<source>All Projects</source> <source>All Projects</source>
<translation>Alle Projekte</translation> <translation>Alle Projekte</translation>
</message> </message>
@@ -10033,7 +10042,22 @@ Fehler: %2</translation>
<context> <context>
<name>ProjectExplorer::Internal::BuildStepsPage</name> <name>ProjectExplorer::Internal::BuildStepsPage</name>
<message> <message>
<location filename="../../../src/plugins/projectexplorer/buildstepspage.cpp" line="+259"/> <location filename="../../../src/plugins/projectexplorer/buildstepspage.cpp" line="+176"/>
<source>Move Up</source>
<translation>Nach oben</translation>
</message>
<message>
<location line="+6"/>
<source>Move Down</source>
<translation>Nach unten</translation>
</message>
<message>
<location line="+6"/>
<source>Remove Item</source>
<translation>Element löschen</translation>
</message>
<message>
<location line="+80"/>
<source>Removing Step failed</source> <source>Removing Step failed</source>
<translation>Das Entfernen des Build-Schritts schlug fehl</translation> <translation>Das Entfernen des Build-Schritts schlug fehl</translation>
</message> </message>
@@ -10058,7 +10082,7 @@ Fehler: %2</translation>
<translation>Schritt zur Bereinigung hinzufügen</translation> <translation>Schritt zur Bereinigung hinzufügen</translation>
</message> </message>
<message> <message>
<location line="-210"/> <location line="-218"/>
<source>Build Steps</source> <source>Build Steps</source>
<translation>Erstellungsschritte</translation> <translation>Erstellungsschritte</translation>
</message> </message>
@@ -10116,7 +10140,7 @@ Fehler: %2</translation>
<context> <context>
<name>ProjectExplorer::Internal::CurrentProjectFind</name> <name>ProjectExplorer::Internal::CurrentProjectFind</name>
<message> <message>
<location filename="../../../src/plugins/projectexplorer/currentprojectfind.cpp" line="+64"/> <location filename="../../../src/plugins/projectexplorer/currentprojectfind.cpp" line="+65"/>
<source>Current Project</source> <source>Current Project</source>
<translation>Aktuelles Projekt</translation> <translation>Aktuelles Projekt</translation>
</message> </message>
@@ -10490,7 +10514,7 @@ No project selected</extracomment>
<translation>Sitzungen...</translation> <translation>Sitzungen...</translation>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/projectexplorer/projectwelcomepagewidget.cpp" line="+127"/> <location filename="../../../src/plugins/projectexplorer/projectwelcomepagewidget.cpp" line="+128"/>
<source>%1 (last session)</source> <source>%1 (last session)</source>
<translation>%1 (zuletzt benutzt)</translation> <translation>%1 (zuletzt benutzt)</translation>
</message> </message>
@@ -10500,12 +10524,11 @@ No project selected</extracomment>
<translation>%1 (aktuelle Sitzung)</translation> <translation>%1 (aktuelle Sitzung)</translation>
</message> </message>
<message> <message>
<location line="+42"/>
<source>Open Project</source> <source>Open Project</source>
<translation>Projekt öffnen</translation> <translation type="obsolete">Projekt öffnen</translation>
</message> </message>
<message> <message>
<location line="+22"/> <location line="+47"/>
<source>New Project</source> <source>New Project</source>
<translation>Neues Projekt</translation> <translation>Neues Projekt</translation>
</message> </message>
@@ -11646,7 +11669,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation>
<translation>Schon gewusst?</translation> <translation>Schon gewusst?</translation>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp" line="+71"/> <location filename="../../../src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp" line="+72"/>
<source>The Qt Creator User Interface</source> <source>The Qt Creator User Interface</source>
<translation>Die Benutzeroberfläche von Qt Creator</translation> <translation>Die Benutzeroberfläche von Qt Creator</translation>
</message> </message>
@@ -11661,13 +11684,13 @@ unter Versionsverwaltung (%2) gestellt werden?</translation>
<translation>Erstellen einer Qt-Quick-Anwendung</translation> <translation>Erstellen einer Qt-Quick-Anwendung</translation>
</message> </message>
<message> <message>
<location line="+35"/> <location line="+38"/>
<location line="+58"/> <location line="+53"/>
<source>Choose an example...</source> <source>Choose an example...</source>
<translation>Beispiel wählen...</translation> <translation>Beispiel wählen...</translation>
</message> </message>
<message> <message>
<location line="+69"/> <location line="+85"/>
<source>Copy Project to writable Location?</source> <source>Copy Project to writable Location?</source>
<translation>Soll das Projekt in ein schreibbares Verzeichnis kopiert werden?</translation> <translation>Soll das Projekt in ein schreibbares Verzeichnis kopiert werden?</translation>
</message> </message>
@@ -11820,6 +11843,11 @@ unter Versionsverwaltung (%2) gestellt werden?</translation>
<source>Explore Qt Quick Examples</source> <source>Explore Qt Quick Examples</source>
<translation>Qt Quick-Beispiele öffnen</translation> <translation>Qt Quick-Beispiele öffnen</translation>
</message> </message>
<message>
<location/>
<source>Open Project...</source>
<translation>Projekt öffnen...</translation>
</message>
</context> </context>
<context> <context>
<name>Qt4ProjectManager::Internal::GuiAppWizard</name> <name>Qt4ProjectManager::Internal::GuiAppWizard</name>
@@ -11948,7 +11976,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation>
<context> <context>
<name>Qt4ProjectManager::Internal::QMakeStepFactory</name> <name>Qt4ProjectManager::Internal::QMakeStepFactory</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qmakestep.cpp" line="+473"/> <location filename="../../../src/plugins/qt4projectmanager/qmakestep.cpp" line="+486"/>
<source>qmake</source> <source>qmake</source>
<translation>qmake</translation> <translation>qmake</translation>
</message> </message>
@@ -12301,6 +12329,12 @@ unter Versionsverwaltung (%2) gestellt werden?</translation>
<comment>Qt Version is meant for Maemo</comment> <comment>Qt Version is meant for Maemo</comment>
<translation>Maemo</translation> <translation>Maemo</translation>
</message> </message>
<message>
<location line="+2"/>
<source>Qt Simulator</source>
<comment>Qt Version is meant for Qt Simulator</comment>
<translation>Qt Simulator</translation>
</message>
<message> <message>
<location line="+2"/> <location line="+2"/>
<source>unkown</source> <source>unkown</source>
@@ -12769,13 +12803,13 @@ Installiere Anwendung auf &apos;%2&apos;...</translation>
<context> <context>
<name>Qt4ProjectManager::QMakeStep</name> <name>Qt4ProjectManager::QMakeStep</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qmakestep.cpp" line="-392"/> <location filename="../../../src/plugins/qt4projectmanager/qmakestep.cpp" line="-405"/>
<source>qmake</source> <source>qmake</source>
<comment>QMakeStep display name.</comment> <comment>QMakeStep display name.</comment>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+107"/> <location line="+120"/>
<source>&lt;font color=&quot;#0000ff&quot;&gt;Configuration is faulty, please check the Build Issues view for details.&lt;/font&gt;</source> <source>&lt;font color=&quot;#0000ff&quot;&gt;Configuration is faulty, please check the Build Issues view for details.&lt;/font&gt;</source>
<translation>&lt;font color=&quot;#0000ff&quot;&gt;Die Konfiguration ist fehlerhaft. Details befinden sich in der Ansicht &quot;Build-Probleme&quot;.&lt;/font&gt;</translation> <translation>&lt;font color=&quot;#0000ff&quot;&gt;Die Konfiguration ist fehlerhaft. Details befinden sich in der Ansicht &quot;Build-Probleme&quot;.&lt;/font&gt;</translation>
</message> </message>
@@ -12814,7 +12848,7 @@ Installiere Anwendung auf &apos;%2&apos;...</translation>
<context> <context>
<name>Qt4ProjectManager::QtVersionManager</name> <name>Qt4ProjectManager::QtVersionManager</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+387"/> <location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+388"/>
<source>&lt;not found&gt;</source> <source>&lt;not found&gt;</source>
<translation>&lt;nicht gefunden&gt;</translation> <translation>&lt;nicht gefunden&gt;</translation>
</message> </message>
@@ -14034,7 +14068,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich
<context> <context>
<name>TextEditor::BaseTextEditorEditable</name> <name>TextEditor::BaseTextEditorEditable</name>
<message> <message>
<location line="+4718"/> <location line="+4802"/>
<source>Line: %1, Col: %2</source> <source>Line: %1, Col: %2</source>
<translation>Zeile: %1, Spalte: %2</translation> <translation>Zeile: %1, Spalte: %2</translation>
</message> </message>
@@ -14584,12 +14618,12 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation>
<message> <message>
<location line="+6"/> <location line="+6"/>
<source>Go to Block Start With Selection</source> <source>Go to Block Start With Selection</source>
<translation>Zum Blockanfang mit Auswahl gehen</translation> <translation>Bis Blockanfang markieren</translation>
</message> </message>
<message> <message>
<location line="+5"/> <location line="+5"/>
<source>Go to Block End With Selection</source> <source>Go to Block End With Selection</source>
<translation>Zum Blockende mit Auswahl gehen</translation> <translation>Bis Blockende markieren</translation>
</message> </message>
<message> <message>
<location line="-61"/> <location line="-61"/>
@@ -14747,7 +14781,87 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation>
<translation>Ctrl+J</translation> <translation>Ctrl+J</translation>
</message> </message>
<message> <message>
<location line="+94"/> <location line="+5"/>
<source>Goto Line Start</source>
<translation>Zeilenanfang</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Line End</source>
<translation>Zeilenende</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Line</source>
<translation>Nächste Zeile</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Line</source>
<translation>Vorangehende Zeile</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Character</source>
<translation>Vorangehendes Zeichen</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Character</source>
<translation>Nächstes Zeichen</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Word</source>
<translation>Vorangehendes Wort</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Word</source>
<translation>Nächstes Wort</translation>
</message>
<message>
<location line="+4"/>
<source>Goto Line Start With Selection</source>
<translation>Bis Zeilenanfang markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Line End With Selection</source>
<translation>Bis Zeilenende markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Line With Selection</source>
<translation>Bis zur nächsten Zeile markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Line With Selection</source>
<translation>Bis zur vorangehenden Zeile markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Character With Selection</source>
<translation>Vorangehendes Zeichen markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Character With Selection</source>
<translation>Nächstes Zeichen markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Previous Word With Selection</source>
<translation>Vorangehendes Wort markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Goto Next Word With Selection</source>
<translation>Nächstes Wort markieren</translation>
</message>
<message>
<location line="+96"/>
<source>&lt;line number&gt;</source> <source>&lt;line number&gt;</source>
<translation>&lt;Zeilennummer&gt;</translation> <translation>&lt;Zeilennummer&gt;</translation>
</message> </message>
@@ -15108,7 +15222,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation>
<context> <context>
<name>Utils::DetailsButton</name> <name>Utils::DetailsButton</name>
<message> <message>
<location filename="../../../src/libs/utils/detailsbutton.cpp" line="+136"/> <location filename="../../../src/libs/utils/detailsbutton.cpp" line="+68"/>
<source>Details</source> <source>Details</source>
<translation>Details</translation> <translation>Details</translation>
</message> </message>
@@ -15809,9 +15923,8 @@ p, li { white-space: pre-wrap; }
<translation>&lt;b&gt;Qt Apps&lt;/b&gt;&lt;br /&gt;&lt;font color=&apos;gray&apos;&gt;Finden Sie freie, Qt-basierte Applikationen&lt;/font&gt;</translation> <translation>&lt;b&gt;Qt Apps&lt;/b&gt;&lt;br /&gt;&lt;font color=&apos;gray&apos;&gt;Finden Sie freie, Qt-basierte Applikationen&lt;/font&gt;</translation>
</message> </message>
<message> <message>
<location line="+31"/> <location line="+34"/>
<source>http://labs.trolltech.com/blogs/feed</source> <source>http://labs.trolltech.com/blogs/feed</source>
<extracomment>Add localized feed here only if one exists</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
@@ -17390,7 +17503,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<context> <context>
<name>CMakeProjectManager::Internal::CMakeTarget</name> <name>CMakeProjectManager::Internal::CMakeTarget</name>
<message> <message>
<location filename="../../../src/plugins/cmakeprojectmanager/cmaketarget.cpp" line="+47"/> <location filename="../../../src/plugins/cmakeprojectmanager/cmaketarget.cpp" line="+49"/>
<location filename="../../../src/plugins/projectexplorer/userfileaccessor.cpp" line="+772"/> <location filename="../../../src/plugins/projectexplorer/userfileaccessor.cpp" line="+772"/>
<source>Desktop</source> <source>Desktop</source>
<comment>CMake Default target display name</comment> <comment>CMake Default target display name</comment>
@@ -18382,7 +18495,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<translation>Es ist kein Ziel festgelegt.</translation> <translation>Es ist kein Ziel festgelegt.</translation>
</message> </message>
<message> <message>
<location line="+103"/> <location line="+102"/>
<source>Qt Creator</source> <source>Qt Creator</source>
<translation>Qt Creator</translation> <translation>Qt Creator</translation>
</message> </message>
@@ -18473,7 +18586,13 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<translation>Maemo</translation> <translation>Maemo</translation>
</message> </message>
<message> <message>
<location line="+378"/> <location line="+2"/>
<source>Qt Simulator</source>
<comment>Qt4 Simulator target display name</comment>
<translation>Qt Simulator</translation>
</message>
<message>
<location line="+383"/>
<source>&lt;b&gt;Device:&lt;/b&gt; Not connected</source> <source>&lt;b&gt;Device:&lt;/b&gt; Not connected</source>
<translation>&lt;b&gt;Gerät:&lt;/b&gt; Nicht angeschlossen</translation> <translation>&lt;b&gt;Gerät:&lt;/b&gt; Nicht angeschlossen</translation>
</message> </message>
@@ -18505,7 +18624,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<translation>-Neues Formular-</translation> <translation>-Neues Formular-</translation>
</message> </message>
<message> <message>
<location line="+179"/> <location line="+182"/>
<source>Cannot save to file &quot;%1&quot;: permission denied.</source> <source>Cannot save to file &quot;%1&quot;: permission denied.</source>
<translation>Die Datei &quot;%1&quot; konnte wegen nicht ausreichender Zugriffsrechte nicht geschrieben werden.</translation> <translation>Die Datei &quot;%1&quot; konnte wegen nicht ausreichender Zugriffsrechte nicht geschrieben werden.</translation>
</message> </message>
@@ -18550,7 +18669,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<translation>Kein QmlDesigner-Plugin.</translation> <translation>Kein QmlDesigner-Plugin.</translation>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/pluginmanager/widgetpluginpath.cpp" line="-133"/> <location filename="../../../src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp" line="-133"/>
<source>Failed to create instance of file &apos;%1&apos;: %2</source> <source>Failed to create instance of file &apos;%1&apos;: %2</source>
<translation>Es konnte keine Instanz der Datei &apos;%1&apos; erzeugt werden: %2</translation> <translation>Es konnte keine Instanz der Datei &apos;%1&apos; erzeugt werden: %2</translation>
</message> </message>
@@ -18712,7 +18831,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<context> <context>
<name>QmlDesigner::RewriterView</name> <name>QmlDesigner::RewriterView</name>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/model/rewriterview.cpp" line="+79"/> <location filename="../../../src/plugins/qmldesigner/designercore/model/rewriterview.cpp" line="+79"/>
<source>Error parsing</source> <source>Error parsing</source>
<translation>Fehler beim Parsen</translation> <translation>Fehler beim Parsen</translation>
</message> </message>
@@ -19200,7 +19319,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<context> <context>
<name>QtVersion</name> <name>QtVersion</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+902"/> <location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+928"/>
<source>No qmake path set</source> <source>No qmake path set</source>
<translation>Es ist keine qmake-Pfad gesetzt</translation> <translation>Es ist keine qmake-Pfad gesetzt</translation>
</message> </message>
@@ -19220,7 +19339,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<translation>Der Pfad zu den ausführbaren Dateien der Qt-Installation konnte nicht bestimmt werden, möglicherweise ist der Pfad zu qmake falsch?</translation> <translation>Der Pfad zu den ausführbaren Dateien der Qt-Installation konnte nicht bestimmt werden, möglicherweise ist der Pfad zu qmake falsch?</translation>
</message> </message>
<message> <message>
<location line="+122"/> <location line="+128"/>
<source>The Qt Version has no toolchain.</source> <source>The Qt Version has no toolchain.</source>
<translation>Dieser Qt-Version ist keine Toolchain zugeordnet.</translation> <translation>Dieser Qt-Version ist keine Toolchain zugeordnet.</translation>
</message> </message>
@@ -19262,7 +19381,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<context> <context>
<name>TextEditor</name> <name>TextEditor</name>
<message> <message>
<location filename="../../../src/plugins/texteditor/texteditorconstants.h" line="+111"/> <location filename="../../../src/plugins/texteditor/texteditorconstants.h" line="+127"/>
<source>Text Editor</source> <source>Text Editor</source>
<translation>Text Editor</translation> <translation>Text Editor</translation>
</message> </message>
@@ -19318,7 +19437,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
<context> <context>
<name>trk::Launcher</name> <name>trk::Launcher</name>
<message> <message>
<location filename="../../../src/shared/symbianutils/launcher.cpp" line="+492"/> <location filename="../../../src/shared/symbianutils/launcher.cpp" line="+506"/>
<source>Cannot open remote file &apos;%1&apos;: %2</source> <source>Cannot open remote file &apos;%1&apos;: %2</source>
<translation>Die Datei &apos;%1&apos; auf dem Gerät konnte nicht geöffnet werden: %2</translation> <translation>Die Datei &apos;%1&apos; auf dem Gerät konnte nicht geöffnet werden: %2</translation>
</message> </message>
@@ -19892,7 +20011,7 @@ Please check your project settings.</source>
<context> <context>
<name>Qt4ProjectManager::Internal::Qt4TargetFactory</name> <name>Qt4ProjectManager::Internal::Qt4TargetFactory</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qt4target.cpp" line="-271"/> <location filename="../../../src/plugins/qt4projectmanager/qt4target.cpp" line="-274"/>
<source>Debug</source> <source>Debug</source>
<translation>Debug</translation> <translation>Debug</translation>
</message> </message>
@@ -20313,7 +20432,7 @@ Please check your project settings.</source>
<context> <context>
<name>Core::CommandMappings</name> <name>Core::CommandMappings</name>
<message> <message>
<location filename="../../../src/plugins/coreplugin/actionmanager/commandmappings.cpp" line="+138"/> <location filename="../../../src/plugins/coreplugin/actionmanager/commandmappings.cpp" line="+139"/>
<source>Command</source> <source>Command</source>
<translation>Kommando</translation> <translation>Kommando</translation>
</message> </message>
@@ -20434,7 +20553,7 @@ Please check your project settings.</source>
<context> <context>
<name>QmlDesigner::Internal::SubComponentManagerPrivate</name> <name>QmlDesigner::Internal::SubComponentManagerPrivate</name>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/metainfo/subcomponentmanager.cpp" line="+307"/> <location filename="../../../src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp" line="+307"/>
<source>QML Components</source> <source>QML Components</source>
<translation>QML-Komponenten</translation> <translation>QML-Komponenten</translation>
</message> </message>
@@ -20735,7 +20854,7 @@ Haben Sie Qemu gestartet?</translation>
<context> <context>
<name>Qt4ProjectManager::Internal::S60CreatePackageStepConfigWidget</name> <name>Qt4ProjectManager::Internal::S60CreatePackageStepConfigWidget</name>
<message> <message>
<location line="+47"/> <location line="+49"/>
<source>self-signed</source> <source>self-signed</source>
<translation>Selbstsigniert</translation> <translation>Selbstsigniert</translation>
</message> </message>
@@ -21319,14 +21438,22 @@ Haben Sie Qemu gestartet?</translation>
<context> <context>
<name>Designer::Internal::FormEditorFactory</name> <name>Designer::Internal::FormEditorFactory</name>
<message> <message>
<location filename="../../../src/plugins/designer/formeditorfactory.cpp" line="+93"/>
<source>This file can only be edited in Design Mode.</source> <source>This file can only be edited in Design Mode.</source>
<translation>Datei kann nur im Entwurfsmodus bearbeitet werden.</translation> <translation type="obsolete">Datei kann nur im Entwurfsmodus bearbeitet werden.</translation>
</message>
<message>
<source>Open Designer</source>
<translation type="obsolete">Designer öffnen</translation>
</message>
<message>
<location filename="../../../src/plugins/designer/formeditorfactory.cpp" line="+93"/>
<source>This file can only be edited in &lt;b&gt;Design&lt;/b&gt; mode.</source>
<translation>Datei kann nur im &lt;b&gt;Entwurfsmodus&lt;/b&gt; bearbeitet werden.</translation>
</message> </message>
<message> <message>
<location line="+1"/> <location line="+1"/>
<source>Open Designer</source> <source>Switch mode</source>
<translation>Designer öffnen</translation> <translation>Modus umschalten</translation>
</message> </message>
</context> </context>
<context> <context>
@@ -21410,7 +21537,7 @@ Haben Sie Qemu gestartet?</translation>
<translation>Status</translation> <translation>Status</translation>
</message> </message>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp" line="+297"/> <location filename="../../../src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp" line="+300"/>
<source>Qt Creator can set up the following targets for project &lt;b&gt;%1&lt;/b&gt;:</source> <source>Qt Creator can set up the following targets for project &lt;b&gt;%1&lt;/b&gt;:</source>
<comment>%1: Project name</comment> <comment>%1: Project name</comment>
<translation>Qt Creator kann für das Projekt &lt;b&gt;%1&lt;/b&gt; die folgenden Ziele anlegen:</translation> <translation>Qt Creator kann für das Projekt &lt;b&gt;%1&lt;/b&gt; die folgenden Ziele anlegen:</translation>
@@ -21444,7 +21571,7 @@ Haben Sie Qemu gestartet?</translation>
<translation>&lt;b&gt;Warnung:&lt;/b&gt; </translation> <translation>&lt;b&gt;Warnung:&lt;/b&gt; </translation>
</message> </message>
<message> <message>
<location line="-295"/> <location line="-298"/>
<source>Import</source> <source>Import</source>
<comment>Is this an import of an existing build or a new one?</comment> <comment>Is this an import of an existing build or a new one?</comment>
<translation>Import</translation> <translation>Import</translation>
@@ -21943,7 +22070,7 @@ Namen &lt;E-Mail&gt; Alias &lt;E-Mail?</translation>
<context> <context>
<name>QmlDesigner::Internal::ModelPrivate</name> <name>QmlDesigner::Internal::ModelPrivate</name>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/model/model.cpp" line="+172"/> <location filename="../../../src/plugins/qmldesigner/designercore/model/model.cpp" line="+172"/>
<source>invalid type</source> <source>invalid type</source>
<translation>ungültiger Typ</translation> <translation>ungültiger Typ</translation>
</message> </message>
@@ -22428,7 +22555,7 @@ Namen &lt;E-Mail&gt; Alias &lt;E-Mail?</translation>
<context> <context>
<name>Qt4ProjectManager::QtVersion</name> <name>Qt4ProjectManager::QtVersion</name>
<message> <message>
<location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="-989"/> <location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="-1021"/>
<source>The Qt version is invalid: %1</source> <source>The Qt version is invalid: %1</source>
<extracomment>%1: Reason for being invalid</extracomment> <extracomment>%1: Reason for being invalid</extracomment>
<translation>Ungültige Qt-Version: %1</translation> <translation>Ungültige Qt-Version: %1</translation>
@@ -22558,7 +22685,7 @@ Namen &lt;E-Mail&gt; Alias &lt;E-Mail?</translation>
<context> <context>
<name>InvalidIdException</name> <name>InvalidIdException</name>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/exceptions/invalididexception.cpp" line="+59"/> <location filename="../../../src/plugins/qmldesigner/designercore/exceptions/invalididexception.cpp" line="+59"/>
<source>Ids have to be unique: </source> <source>Ids have to be unique: </source>
<translation>Ids müssen eindeutig sein: </translation> <translation>Ids müssen eindeutig sein: </translation>
</message> </message>
@@ -22579,7 +22706,7 @@ Ids müssen mit einem Kleinbuchstaben beginnen und dürfen nur alphanumerische Z
<context> <context>
<name>QmlDesigner::InvalidArgumentException</name> <name>QmlDesigner::InvalidArgumentException</name>
<message> <message>
<location filename="../../../src/plugins/qmldesigner/core/exceptions/invalidargumentexception.cpp" line="+60"/> <location filename="../../../src/plugins/qmldesigner/designercore/exceptions/invalidargumentexception.cpp" line="+60"/>
<source>Failed to create item of type %1</source> <source>Failed to create item of type %1</source>
<translation>Es konnte kein Element des Typs %1 erzeugt werden</translation> <translation>Es konnte kein Element des Typs %1 erzeugt werden</translation>
</message> </message>

File diff suppressed because it is too large Load Diff

View File

@@ -574,6 +574,17 @@ QString PluginManager::testDataDirectory() const
return s; return s;
} }
/*!
\fn void PluginManager::profilingReport(const char *what, const PluginSpec *spec = 0)
Create a profiling entry showing the elapsed time if profiling is activated.
*/
void PluginManager::profilingReport(const char *what, const PluginSpec *spec)
{
d->profilingReport(what, spec);
}
//============PluginManagerPrivate=========== //============PluginManagerPrivate===========
/*! /*!
@@ -601,6 +612,7 @@ PluginSpecPrivate *PluginManagerPrivate::privateSpec(PluginSpec *spec)
PluginManagerPrivate::PluginManagerPrivate(PluginManager *pluginManager) : PluginManagerPrivate::PluginManagerPrivate(PluginManager *pluginManager) :
extension(QLatin1String("xml")), extension(QLatin1String("xml")),
m_profileElapsedMS(0), m_profileElapsedMS(0),
m_profilingVerbosity(0),
q(pluginManager) q(pluginManager)
{ {
} }
@@ -679,6 +691,13 @@ void PluginManagerPrivate::addObject(QObject *obj)
if (debugLeaks) if (debugLeaks)
qDebug() << "PluginManagerPrivate::addObject" << obj << obj->objectName(); qDebug() << "PluginManagerPrivate::addObject" << obj << obj->objectName();
if (m_profilingVerbosity && !m_profileTimer.isNull()) {
// Report a timestamp when adding an object. Useful for profiling
// its initialization time.
const int absoluteElapsedMS = m_profileTimer->elapsed();
qDebug(" %-43s %8dms", obj->metaObject()->className(), absoluteElapsedMS);
}
allObjects.append(obj); allObjects.append(obj);
} }
emit q->objectAdded(obj); emit q->objectAdded(obj);
@@ -954,6 +973,8 @@ void PluginManagerPrivate::initProfiling()
m_profileTimer->start(); m_profileTimer->start();
m_profileElapsedMS = 0; m_profileElapsedMS = 0;
qDebug("Profiling started"); qDebug("Profiling started");
} else {
m_profilingVerbosity++;
} }
} }
@@ -966,7 +987,7 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s
if (spec) { if (spec) {
qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS); qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS);
} else { } else {
qDebug("%-22s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS); qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS);
} }
} }
} }

View File

@@ -118,6 +118,8 @@ public:
bool runningTests() const; bool runningTests() const;
QString testDataDirectory() const; QString testDataDirectory() const;
void profilingReport(const char *what, const PluginSpec *spec = 0);
signals: signals:
void objectAdded(QObject *obj); void objectAdded(QObject *obj);
void aboutToRemoveObject(QObject *obj); void aboutToRemoveObject(QObject *obj);

View File

@@ -85,6 +85,7 @@ public:
QStringList arguments; QStringList arguments;
QScopedPointer<QTime> m_profileTimer; QScopedPointer<QTime> m_profileTimer;
int m_profileElapsedMS; int m_profileElapsedMS;
unsigned m_profilingVerbosity;
// Look in argument descriptions of the specs for the option. // Look in argument descriptions of the specs for the option.
PluginSpec *pluginForOption(const QString &option, bool *requiresArgument) const; PluginSpec *pluginForOption(const QString &option, bool *requiresArgument) const;

View File

@@ -106,6 +106,11 @@ Interpreter::ObjectValue *Bind::findFunctionScope(AST::FunctionDeclaration *node
return _functionScopes.value(node); return _functionScopes.value(node);
} }
bool Bind::isGroupedPropertyBinding(AST::Node *node) const
{
return _groupedPropertyBindings.contains(node);
}
ObjectValue *Bind::switchObjectValue(ObjectValue *newObjectValue) ObjectValue *Bind::switchObjectValue(ObjectValue *newObjectValue)
{ {
ObjectValue *oldObjectValue = _currentObjectValue; ObjectValue *oldObjectValue = _currentObjectValue;
@@ -139,7 +144,6 @@ ExpressionNode *Bind::expression(UiScriptBinding *ast) const
ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer) ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitializer *initializer)
{ {
ObjectValue *parentObjectValue = 0; ObjectValue *parentObjectValue = 0;
const QString typeName = toString(qualifiedTypeNameId);
// normal component instance // normal component instance
ASTObjectValue *objectValue = new ASTObjectValue(qualifiedTypeNameId, initializer, _doc, &_engine); ASTObjectValue *objectValue = new ASTObjectValue(qualifiedTypeNameId, initializer, _doc, &_engine);
@@ -204,8 +208,20 @@ bool Bind::visit(UiPublicMember *)
bool Bind::visit(UiObjectDefinition *ast) bool Bind::visit(UiObjectDefinition *ast)
{ {
// an UiObjectDefinition may be used to group property bindings
// think anchors { ... }
bool isGroupedBinding = false;
for (UiQualifiedId *it = ast->qualifiedTypeNameId; it; it = it->next) {
if (!it->next)
isGroupedBinding = it->name->asString().at(0).isLower();
}
if (!isGroupedBinding) {
ObjectValue *value = bindObject(ast->qualifiedTypeNameId, ast->initializer); ObjectValue *value = bindObject(ast->qualifiedTypeNameId, ast->initializer);
_qmlObjects.insert(ast, value); _qmlObjects.insert(ast, value);
} else {
_groupedPropertyBindings.insert(ast);
}
return false; return false;
} }

View File

@@ -63,6 +63,7 @@ public:
Interpreter::Context *context) const; Interpreter::Context *context) const;
Interpreter::ObjectValue *findFunctionScope(AST::FunctionDeclaration *node) const; Interpreter::ObjectValue *findFunctionScope(AST::FunctionDeclaration *node) const;
bool isGroupedPropertyBinding(AST::Node *node) const;
static QString toString(AST::UiQualifiedId *qualifiedId, QChar delimiter = QChar('.')); static QString toString(AST::UiQualifiedId *qualifiedId, QChar delimiter = QChar('.'));
@@ -100,6 +101,7 @@ private:
Interpreter::ObjectValue *_rootObjectValue; Interpreter::ObjectValue *_rootObjectValue;
QHash<AST::Node *, Interpreter::ObjectValue *> _qmlObjects; QHash<AST::Node *, Interpreter::ObjectValue *> _qmlObjects;
QSet<AST::Node *> _groupedPropertyBindings;
QHash<AST::FunctionDeclaration *, Interpreter::ObjectValue *> _functionScopes; QHash<AST::FunctionDeclaration *, Interpreter::ObjectValue *> _functionScopes;
QStringList _includedScripts; QStringList _includedScripts;

View File

@@ -1472,6 +1472,8 @@ const Value *Context::lookup(const QString &name)
const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId *qmlTypeName) const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId *qmlTypeName)
{ {
const ObjectValue *objectValue = typeEnvironment(doc); const ObjectValue *objectValue = typeEnvironment(doc);
if (!objectValue)
return 0;
for (UiQualifiedId *iter = qmlTypeName; objectValue && iter; iter = iter->next) { for (UiQualifiedId *iter = qmlTypeName; objectValue && iter; iter = iter->next) {
if (! iter->name) if (! iter->name)
@@ -1490,6 +1492,8 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId
const ObjectValue *Context::lookupType(const QmlJS::Document *doc, const QStringList &qmlTypeName) const ObjectValue *Context::lookupType(const QmlJS::Document *doc, const QStringList &qmlTypeName)
{ {
const ObjectValue *objectValue = typeEnvironment(doc); const ObjectValue *objectValue = typeEnvironment(doc);
if (!objectValue)
return 0;
foreach (const QString &name, qmlTypeName) { foreach (const QString &name, qmlTypeName) {
const Value *value = objectValue->property(name, this); const Value *value = objectValue->property(name, this);

View File

@@ -66,10 +66,24 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
{ {
ScopeChain &scopeChain = _context->scopeChain(); ScopeChain &scopeChain = _context->scopeChain();
if (_doc->bind()->isGroupedPropertyBinding(node)) {
UiObjectDefinition *definition = cast<UiObjectDefinition *>(node);
if (!definition)
return;
const Value *v = scopeObjectLookup(definition->qualifiedTypeNameId);
if (!v)
return;
const ObjectValue *object = v->asObjectValue();
if (!object)
return;
scopeChain.qmlScopeObjects.clear(); scopeChain.qmlScopeObjects.clear();
scopeChain.qmlScopeObjects += object;
}
const ObjectValue *scopeObject = _doc->bind()->findQmlObject(node); const ObjectValue *scopeObject = _doc->bind()->findQmlObject(node);
if (scopeObject) { if (scopeObject) {
scopeChain.qmlScopeObjects.clear();
scopeChain.qmlScopeObjects += scopeObject; scopeChain.qmlScopeObjects += scopeObject;
} else { } else {
return; // Probably syntax errors, where we're working with a "recovered" AST. return; // Probably syntax errors, where we're working with a "recovered" AST.
@@ -130,3 +144,28 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
} }
} }
} }
const Value *ScopeBuilder::scopeObjectLookup(AST::UiQualifiedId *id)
{
// do a name lookup on the scope objects
const Value *result = 0;
foreach (const ObjectValue *scopeObject, _context->scopeChain().qmlScopeObjects) {
const ObjectValue *object = scopeObject;
for (UiQualifiedId *it = id; it; it = it->next) {
result = object->property(it->name->asString(), _context);
if (!result)
break;
if (it->next) {
object = result->asObjectValue();
if (!object) {
result = 0;
break;
}
}
}
if (result)
break;
}
return result;
}

View File

@@ -13,6 +13,7 @@ namespace AST {
namespace Interpreter { namespace Interpreter {
class Context; class Context;
class Value;
} }
class QMLJS_EXPORT ScopeBuilder class QMLJS_EXPORT ScopeBuilder
@@ -27,6 +28,7 @@ public:
private: private:
void setQmlScopeObject(AST::Node *node); void setQmlScopeObject(AST::Node *node);
const Interpreter::Value *scopeObjectLookup(AST::UiQualifiedId *id);
Document::Ptr _doc; Document::Ptr _doc;
Interpreter::Context *_context; Interpreter::Context *_context;

View File

@@ -50,6 +50,12 @@ const char * const IDE_VERSION_LONG = IDE_VERSION;
const char * const IDE_AUTHOR = "Nokia Corporation"; const char * const IDE_AUTHOR = "Nokia Corporation";
const char * const IDE_YEAR = "2010"; const char * const IDE_YEAR = "2010";
#ifdef IDE_VERSION_DESCRIPTION
const char * const IDE_VERSION_DESCRIPTION_STR = STRINGIFY(IDE_VERSION_DESCRIPTION);
#else
const char * const IDE_VERSION_DESCRIPTION_STR = "";
#endif
#ifdef IDE_REVISION #ifdef IDE_REVISION
const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION); const char * const IDE_REVISION_STR = STRINGIFY(IDE_REVISION);
#else #else

View File

@@ -61,7 +61,11 @@ VersionDialog::VersionDialog(QWidget *parent)
layout->setSizeConstraint(QLayout::SetFixedSize); layout->setSizeConstraint(QLayout::SetFixedSize);
QString version = QLatin1String(IDE_VERSION_LONG); QString version = QLatin1String(IDE_VERSION_LONG);
version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate);
QString ideVersionDescription;
#ifdef IDE_VERSION_DESCRIPTION
ideVersionDescription = tr("(%1)").arg(QLatin1String(IDE_VERSION_DESCRIPTION_STR));
#endif
QString ideRev; QString ideRev;
#ifdef IDE_REVISION #ifdef IDE_REVISION
@@ -70,21 +74,23 @@ VersionDialog::VersionDialog(QWidget *parent)
#endif #endif
const QString description = tr( const QString description = tr(
"<h3>Qt Creator %1</h3>" "<h3>Qt Creator %1 %8</h3>"
"Based on Qt %2 (%3 bit)<br/>" "Based on Qt %2 (%3 bit)<br/>"
"<br/>" "<br/>"
"Built on %4 at %5<br />" "Built on %4 at %5<br />"
"<br/>" "<br/>"
"%8" "%9"
"<br/>" "<br/>"
"Copyright 2008-%6 %7. All rights reserved.<br/>" "Copyright 2008-%6 %7. All rights reserved.<br/>"
"<br/>" "<br/>"
"The program is provided AS IS with NO WARRANTY OF ANY KIND, " "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
"PARTICULAR PURPOSE.<br/>") "PARTICULAR PURPOSE.<br/>")
.arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize), .arg(version,
QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(IDE_YEAR), QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(IDE_YEAR),
(QLatin1String(IDE_AUTHOR)), ideRev); (QLatin1String(IDE_AUTHOR)), ideVersionDescription,
ideRev);
QLabel *copyRightLabel = new QLabel(description); QLabel *copyRightLabel = new QLabel(description);
copyRightLabel->setWordWrap(true); copyRightLabel->setWordWrap(true);

View File

@@ -215,16 +215,16 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
wizardParameters.setDisplayName(tr("C++ Class")); wizardParameters.setDisplayName(tr("C++ Class"));
wizardParameters.setId(QLatin1String("A.Class")); wizardParameters.setId(QLatin1String("A.Class"));
wizardParameters.setKind(Core::IWizard::ClassWizard); wizardParameters.setKind(Core::IWizard::ClassWizard);
wizardParameters.setDescription(tr("Creates a header and a source file for a new class.")); wizardParameters.setDescription(tr("Creates a C++ header and a source file for a new class that you can add to a C++ project."));
addAutoReleasedObject(new CppClassWizard(wizardParameters, core)); addAutoReleasedObject(new CppClassWizard(wizardParameters, core));
wizardParameters.setKind(Core::IWizard::FileWizard); wizardParameters.setKind(Core::IWizard::FileWizard);
wizardParameters.setDescription(tr("Creates a C++ source file.")); wizardParameters.setDescription(tr("Creates a C++ source file that you can add to a C++ project."));
wizardParameters.setDisplayName(tr("C++ Source File")); wizardParameters.setDisplayName(tr("C++ Source File"));
wizardParameters.setId(QLatin1String("B.Source")); wizardParameters.setId(QLatin1String("B.Source"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core)); addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core));
wizardParameters.setDescription(tr("Creates a C++ header file.")); wizardParameters.setDescription(tr("Creates a C++ header file that you can add to a C++ project."));
wizardParameters.setDisplayName(tr("C++ Header File")); wizardParameters.setDisplayName(tr("C++ Header File"));
wizardParameters.setId(QLatin1String("C.Header")); wizardParameters.setId(QLatin1String("C.Header"));
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core)); addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));

View File

@@ -32,15 +32,15 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <texteditor/texteditorsettings.h>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
using namespace CppTools::Internal; using namespace CppTools::Internal;
CompletionSettingsPage::CompletionSettingsPage(CppCodeCompletion *completion) CompletionSettingsPage::CompletionSettingsPage()
: m_completion(completion) : m_page(new Ui_CompletionSettingsPage)
, m_page(new Ui_CompletionSettingsPage)
{ {
} }
@@ -64,23 +64,27 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent)
QWidget *w = new QWidget(parent); QWidget *w = new QWidget(parent);
m_page->setupUi(w); m_page->setupUi(w);
const TextEditor::CompletionSettings &settings =
TextEditor::TextEditorSettings::instance()->completionSettings();
int caseSensitivityIndex = 0; int caseSensitivityIndex = 0;
switch (m_completion->caseSensitivity()) { switch (settings.m_caseSensitivity) {
case CppCodeCompletion::CaseSensitive: case TextEditor::CaseSensitive:
caseSensitivityIndex = 0; caseSensitivityIndex = 0;
break; break;
case CppCodeCompletion::CaseInsensitive: case TextEditor::CaseInsensitive:
caseSensitivityIndex = 1; caseSensitivityIndex = 1;
break; break;
case CppCodeCompletion::FirstLetterCaseSensitive: case TextEditor::FirstLetterCaseSensitive:
caseSensitivityIndex = 2; caseSensitivityIndex = 2;
break; break;
} }
m_page->caseSensitivity->setCurrentIndex(caseSensitivityIndex); m_page->caseSensitivity->setCurrentIndex(caseSensitivityIndex);
m_page->autoInsertBrackets->setChecked(m_completion->autoInsertBrackets()); m_page->autoInsertBrackets->setChecked(settings.m_autoInsertBrackets);
m_page->partiallyComplete->setChecked(m_completion->isPartialCompletionEnabled()); m_page->partiallyComplete->setChecked(settings.m_partiallyComplete);
m_page->spaceAfterFunctionName->setChecked(m_completion->isSpaceAfterFunctionName()); m_page->spaceAfterFunctionName->setChecked(settings.m_spaceAfterFunctionName);
if (m_searchKeywords.isEmpty()) { if (m_searchKeywords.isEmpty()) {
QTextStream(&m_searchKeywords) << m_page->caseSensitivityLabel->text() QTextStream(&m_searchKeywords) << m_page->caseSensitivityLabel->text()
<< ' ' << m_page->autoInsertBrackets->text() << ' ' << m_page->autoInsertBrackets->text()
@@ -88,15 +92,19 @@ QWidget *CompletionSettingsPage::createPage(QWidget *parent)
<< ' ' << m_page->spaceAfterFunctionName->text(); << ' ' << m_page->spaceAfterFunctionName->text();
m_searchKeywords.remove(QLatin1Char('&')); m_searchKeywords.remove(QLatin1Char('&'));
} }
return w; return w;
} }
void CompletionSettingsPage::apply() void CompletionSettingsPage::apply()
{ {
m_completion->setCaseSensitivity(caseSensitivity()); TextEditor::CompletionSettings settings;
m_completion->setAutoInsertBrackets(m_page->autoInsertBrackets->isChecked()); settings.m_caseSensitivity = caseSensitivity();
m_completion->setPartialCompletionEnabled(m_page->partiallyComplete->isChecked()); settings.m_autoInsertBrackets = m_page->autoInsertBrackets->isChecked();
m_completion->setSpaceAfterFunctionName(m_page->spaceAfterFunctionName->isChecked()); settings.m_partiallyComplete = m_page->partiallyComplete->isChecked();
settings.m_spaceAfterFunctionName = m_page->spaceAfterFunctionName->isChecked();
TextEditor::TextEditorSettings::instance()->setCompletionSettings(settings);
} }
bool CompletionSettingsPage::matches(const QString &s) const bool CompletionSettingsPage::matches(const QString &s) const
@@ -104,14 +112,14 @@ bool CompletionSettingsPage::matches(const QString &s) const
return m_searchKeywords.contains(s, Qt::CaseInsensitive); return m_searchKeywords.contains(s, Qt::CaseInsensitive);
} }
CppCodeCompletion::CaseSensitivity CompletionSettingsPage::caseSensitivity() const TextEditor::CaseSensitivity CompletionSettingsPage::caseSensitivity() const
{ {
switch (m_page->caseSensitivity->currentIndex()) { switch (m_page->caseSensitivity->currentIndex()) {
case 0: // Full case 0: // Full
return CppCodeCompletion::CaseSensitive; return TextEditor::CaseSensitive;
case 1: // None case 1: // None
return CppCodeCompletion::CaseInsensitive; return TextEditor::CaseInsensitive;
default: // First letter default: // First letter
return CppCodeCompletion::FirstLetterCaseSensitive; return TextEditor::FirstLetterCaseSensitive;
} }
} }

View File

@@ -30,10 +30,9 @@
#ifndef COMPLETIONSETTINGSPAGE_H #ifndef COMPLETIONSETTINGSPAGE_H
#define COMPLETIONSETTINGSPAGE_H #define COMPLETIONSETTINGSPAGE_H
#include <texteditor/completionsettings.h>
#include <texteditor/texteditoroptionspage.h> #include <texteditor/texteditoroptionspage.h>
#include "cppcodecompletion.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class Ui_CompletionSettingsPage; class Ui_CompletionSettingsPage;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -41,12 +40,14 @@ QT_END_NAMESPACE
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {
// TODO: Move this class to the text editor plugin
class CompletionSettingsPage : public TextEditor::TextEditorOptionsPage class CompletionSettingsPage : public TextEditor::TextEditorOptionsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
CompletionSettingsPage(CppCodeCompletion *completion); CompletionSettingsPage();
~CompletionSettingsPage(); ~CompletionSettingsPage();
QString id() const; QString id() const;
@@ -58,9 +59,8 @@ public:
virtual bool matches(const QString &) const; virtual bool matches(const QString &) const;
private: private:
CppCodeCompletion::CaseSensitivity caseSensitivity() const; TextEditor::CaseSensitivity caseSensitivity() const;
CppCodeCompletion *m_completion;
Ui_CompletionSettingsPage *m_page; Ui_CompletionSettingsPage *m_page;
QString m_searchKeywords; QString m_searchKeywords;
}; };

View File

@@ -57,6 +57,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h> #include <coreplugin/mimedatabase.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <texteditor/completionsettings.h>
#include <texteditor/itexteditor.h> #include <texteditor/itexteditor.h>
#include <texteditor/itexteditable.h> #include <texteditor/itexteditable.h>
#include <texteditor/basetexteditor.h> #include <texteditor/basetexteditor.h>
@@ -436,10 +437,6 @@ CppCodeCompletion::CppCodeCompletion(CppModelManager *manager)
m_manager(manager), m_manager(manager),
m_editor(0), m_editor(0),
m_startPosition(-1), m_startPosition(-1),
m_caseSensitivity(FirstLetterCaseSensitive),
m_autoInsertBrackets(true),
m_partialCompletionEnabled(true),
m_spaceAfterFunctionName(false),
m_forcedCompletion(false), m_forcedCompletion(false),
m_completionOperator(T_EOF_SYMBOL), m_completionOperator(T_EOF_SYMBOL),
m_objcEnabled(true) m_objcEnabled(true)
@@ -451,46 +448,6 @@ QIcon CppCodeCompletion::iconForSymbol(Symbol *symbol) const
return m_icons.iconForSymbol(symbol); return m_icons.iconForSymbol(symbol);
} }
CppCodeCompletion::CaseSensitivity CppCodeCompletion::caseSensitivity() const
{
return m_caseSensitivity;
}
void CppCodeCompletion::setCaseSensitivity(CaseSensitivity caseSensitivity)
{
m_caseSensitivity = caseSensitivity;
}
bool CppCodeCompletion::autoInsertBrackets() const
{
return m_autoInsertBrackets;
}
void CppCodeCompletion::setAutoInsertBrackets(bool autoInsertBrackets)
{
m_autoInsertBrackets = autoInsertBrackets;
}
bool CppCodeCompletion::isPartialCompletionEnabled() const
{
return m_partialCompletionEnabled;
}
void CppCodeCompletion::setPartialCompletionEnabled(bool partialCompletionEnabled)
{
m_partialCompletionEnabled = partialCompletionEnabled;
}
bool CppCodeCompletion::isSpaceAfterFunctionName() const
{
return m_spaceAfterFunctionName;
}
void CppCodeCompletion::setSpaceAfterFunctionName(bool spaceAfterFunctionName)
{
m_spaceAfterFunctionName = spaceAfterFunctionName;
}
/* /*
Searches backwards for an access operator. Searches backwards for an access operator.
*/ */
@@ -1512,7 +1469,7 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
return; return;
if (m_completionOperator != T_LPAREN) { if (m_completionOperator != T_LPAREN) {
filter(m_completions, completions, key, m_caseSensitivity); filter(m_completions, completions, key);
} else if (m_completionOperator == T_LPAREN || } else if (m_completionOperator == T_LPAREN ||
m_completionOperator == T_SIGNAL || m_completionOperator == T_SIGNAL ||
@@ -1590,7 +1547,9 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
//qDebug() << "current symbol:" << overview.prettyName(symbol->name()) //qDebug() << "current symbol:" << overview.prettyName(symbol->name())
//<< overview.prettyType(symbol->type()); //<< overview.prettyType(symbol->type());
if (m_autoInsertBrackets && symbol && symbol->type()) { const bool autoInsertBrackets = completionSettings().m_autoInsertBrackets;
if (autoInsertBrackets && symbol && symbol->type()) {
if (Function *function = symbol->type()->asFunctionType()) { if (Function *function = symbol->type()->asFunctionType()) {
// If the member is a function, automatically place the opening parenthesis, // If the member is a function, automatically place the opening parenthesis,
// except when it might take template parameters. // except when it might take template parameters.
@@ -1603,7 +1562,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
extraChars += QLatin1Char('<'); extraChars += QLatin1Char('<');
} }
} else if (! function->isAmbiguous()) { } else if (! function->isAmbiguous()) {
if (m_spaceAfterFunctionName) if (completionSettings().m_spaceAfterFunctionName)
extraChars += QLatin1Char(' '); extraChars += QLatin1Char(' ');
extraChars += QLatin1Char('('); extraChars += QLatin1Char('(');
@@ -1631,7 +1590,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
} }
} }
if (m_autoInsertBrackets && item.data.canConvert<CompleteFunctionDeclaration>()) { if (autoInsertBrackets && item.data.canConvert<CompleteFunctionDeclaration>()) {
// everything from the closing parenthesis on are extra chars, to // everything from the closing parenthesis on are extra chars, to
// make sure an auto-inserted ")" gets replaced by ") const" if necessary // make sure an auto-inserted ")" gets replaced by ") const" if necessary
int closingParen = toInsert.lastIndexOf(QLatin1Char(')')); int closingParen = toInsert.lastIndexOf(QLatin1Char(')'));
@@ -1667,7 +1626,7 @@ bool CppCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem
} else if (completionItems.count() == 1) { } else if (completionItems.count() == 1) {
complete(completionItems.first()); complete(completionItems.first());
return true; return true;
} else if (m_partialCompletionEnabled && m_completionOperator != T_LPAREN) { } else if (m_completionOperator != T_LPAREN) {
return TextEditor::ICompletionCollector::partiallyComplete(completionItems); return TextEditor::ICompletionCollector::partiallyComplete(completionItems);
} }

View File

@@ -86,18 +86,6 @@ public:
QIcon iconForSymbol(CPlusPlus::Symbol *symbol) const; QIcon iconForSymbol(CPlusPlus::Symbol *symbol) const;
CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(CaseSensitivity caseSensitivity);
bool autoInsertBrackets() const;
void setAutoInsertBrackets(bool autoInsertBrackets);
bool isPartialCompletionEnabled() const;
void setPartialCompletionEnabled(bool partialCompletionEnabled);
bool isSpaceAfterFunctionName() const;
void setSpaceAfterFunctionName(bool spaceAfterFunctionName);
private: private:
void addKeywords(); void addKeywords();
void addMacros(const QString &fileName, const CPlusPlus::Snapshot &snapshot); void addMacros(const QString &fileName, const CPlusPlus::Snapshot &snapshot);
@@ -159,10 +147,6 @@ private:
TextEditor::ITextEditable *m_editor; TextEditor::ITextEditable *m_editor;
int m_startPosition; // Position of the cursor from which completion started int m_startPosition; // Position of the cursor from which completion started
CaseSensitivity m_caseSensitivity;
bool m_autoInsertBrackets;
bool m_partialCompletionEnabled;
bool m_spaceAfterFunctionName;
bool m_forcedCompletion; bool m_forcedCompletion;
unsigned m_completionOperator; unsigned m_completionOperator;
bool m_objcEnabled; bool m_objcEnabled;

View File

@@ -51,6 +51,7 @@
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <coreplugin/filemanager.h> #include <coreplugin/filemanager.h>
#include <texteditor/texteditorsettings.h>
#include <cppeditor/cppeditorconstants.h> #include <cppeditor/cppeditorconstants.h>
#include <QtCore/QtConcurrentRun> #include <QtCore/QtConcurrentRun>
@@ -109,8 +110,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
m_modelManager, SLOT(updateSourceFiles(QStringList))); m_modelManager, SLOT(updateSourceFiles(QStringList)));
addAutoReleasedObject(m_modelManager); addAutoReleasedObject(m_modelManager);
m_completion = new CppCodeCompletion(m_modelManager); CppCodeCompletion *completion = new CppCodeCompletion(m_modelManager);
addAutoReleasedObject(m_completion); addAutoReleasedObject(completion);
CppLocatorFilter *locatorFilter = new CppLocatorFilter(m_modelManager, CppLocatorFilter *locatorFilter = new CppLocatorFilter(m_modelManager,
core->editorManager()); core->editorManager());
@@ -118,7 +119,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager())); addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager())); addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
addAutoReleasedObject(new CppCurrentDocumentFilter(m_modelManager, core->editorManager())); addAutoReleasedObject(new CppCurrentDocumentFilter(m_modelManager, core->editorManager()));
addAutoReleasedObject(new CompletionSettingsPage(m_completion)); addAutoReleasedObject(new CompletionSettingsPage);
addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings)); addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings));
// Menus // Menus
@@ -139,17 +140,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
mcpptools->addAction(command); mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource())); connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
// Restore settings // Set completion settings and keep them up to date
QSettings *settings = Core::ICore::instance()->settings(); TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance();
settings->beginGroup(QLatin1String("CppTools")); completion->setCompletionSettings(textEditorSettings->completionSettings());
settings->beginGroup(QLatin1String("Completion")); connect(textEditorSettings, SIGNAL(completionSettingsChanged(TextEditor::CompletionSettings)),
const int caseSensitivity = settings->value(QLatin1String("CaseSensitivity"), m_completion->caseSensitivity()).toInt(); completion, SLOT(setCompletionSettings(TextEditor::CompletionSettings)));
m_completion->setCaseSensitivity((CppCodeCompletion::CaseSensitivity) caseSensitivity);
m_completion->setAutoInsertBrackets(settings->value(QLatin1String("AutoInsertBraces"), true).toBool());
m_completion->setPartialCompletionEnabled(settings->value(QLatin1String("PartiallyComplete"), true).toBool());
m_completion->setSpaceAfterFunctionName(settings->value(QLatin1String("SpaceAfterFunctionName"), false).toBool());
settings->endGroup();
settings->endGroup();
return true; return true;
} }
@@ -170,16 +165,6 @@ void CppToolsPlugin::extensionsInitialized()
void CppToolsPlugin::aboutToShutdown() void CppToolsPlugin::aboutToShutdown()
{ {
// Save settings
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(QLatin1String("CppTools"));
settings->beginGroup(QLatin1String("Completion"));
settings->setValue(QLatin1String("CaseSensitivity"), (int) m_completion->caseSensitivity());
settings->setValue(QLatin1String("AutoInsertBraces"), m_completion->autoInsertBrackets());
settings->setValue(QLatin1String("PartiallyComplete"), m_completion->isPartialCompletionEnabled());
settings->setValue(QLatin1String("SpaceAfterFunctionName"), m_completion->isSpaceAfterFunctionName());
settings->endGroup();
settings->endGroup();
} }
void CppToolsPlugin::switchHeaderSource() void CppToolsPlugin::switchHeaderSource()

View File

@@ -50,7 +50,6 @@ QT_END_NAMESPACE
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {
class CppCodeCompletion;
class CppModelManager; class CppModelManager;
struct CppFileSettings; struct CppFileSettings;
@@ -79,7 +78,6 @@ private:
int m_context; int m_context;
CppModelManager *m_modelManager; CppModelManager *m_modelManager;
CppCodeCompletion *m_completion;
QSharedPointer<CppFileSettings> m_fileSettings; QSharedPointer<CppFileSettings> m_fileSettings;
static CppToolsPlugin *m_instance; static CppToolsPlugin *m_instance;

View File

@@ -53,7 +53,7 @@ QIcon CheckoutWizard::icon() const
QString CheckoutWizard::description() const QString CheckoutWizard::description() const
{ {
return tr("Checks out a project from a CVS repository."); return tr("Checks out a project from a CVS repository and tries to load the contained project.");
} }
QString CheckoutWizard::displayName() const QString CheckoutWizard::displayName() const

View File

@@ -1584,11 +1584,12 @@ IDebuggerEngine *createCdbEngine(DebuggerManager *parent,
// Create engine // Create engine
QString errorMessage; QString errorMessage;
IDebuggerEngine *engine = CdbDebugEngine::create(parent, options, &errorMessage); IDebuggerEngine *engine = CdbDebugEngine::create(parent, options, &errorMessage);
if (!engine) { if (engine) {
QObject::connect(optionsPage, SIGNAL(debuggerPathsChanged()), engine, SLOT(syncDebuggerPaths()));
} else {
optionsPage->setFailureMessage(errorMessage); optionsPage->setFailureMessage(errorMessage);
qWarning("%s\n" ,qPrintable(errorMessage)); qWarning("%s\n" ,qPrintable(errorMessage));
} }
QObject::connect(optionsPage, SIGNAL(debuggerPathsChanged()), engine, SLOT(syncDebuggerPaths()));
return engine; return engine;
} }

View File

@@ -129,14 +129,16 @@ void FormEditorPlugin::initializeTemplates()
const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE); const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE);
wizardParameters.setDisplayName(tr("Qt Designer Form")); wizardParameters.setDisplayName(tr("Qt Designer Form"));
wizardParameters.setId(QLatin1String("D.Form")); wizardParameters.setId(QLatin1String("D.Form"));
wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui).")); wizardParameters.setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
"for implementation purposes. You can add the form and class to an existing Qt C++ Project."));
addAutoReleasedObject(new FormWizard(wizardParameters, this)); addAutoReleasedObject(new FormWizard(wizardParameters, this));
#ifdef CPP_ENABLED #ifdef CPP_ENABLED
wizardParameters.setKind(Core::IWizard::ClassWizard); wizardParameters.setKind(Core::IWizard::ClassWizard);
wizardParameters.setDisplayName(tr("Qt Designer Form Class")); wizardParameters.setDisplayName(tr("Qt Designer Form Class"));
wizardParameters.setId(QLatin1String("C.FormClass")); wizardParameters.setId(QLatin1String("C.FormClass"));
wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui) with a matching class.")); wizardParameters.setDescription(tr("Creates a Qt Designer form that you can add to a Qt C++ project. "
"This is useful if you already have an existing class for the UI business logic."));
addAutoReleasedObject(new FormClassWizard(wizardParameters, this)); addAutoReleasedObject(new FormClassWizard(wizardParameters, this));
addAutoReleasedObject(new CppSettingsPage); addAutoReleasedObject(new CppSettingsPage);
#endif #endif

View File

@@ -96,7 +96,8 @@ Core::BaseFileWizardParameters GenericProjectWizard::parameters()
parameters.setIcon(QIcon(QLatin1String(":/wizards/images/console.png"))); parameters.setIcon(QIcon(QLatin1String(":/wizards/images/console.png")));
parameters.setDisplayName(tr("Import Existing Project")); parameters.setDisplayName(tr("Import Existing Project"));
parameters.setId(QLatin1String("Z.Makefile")); parameters.setId(QLatin1String("Z.Makefile"));
parameters.setDescription(tr("Creates a generic project, supporting any build system.")); parameters.setDescription(tr("Imports existing projects that do not use qmake or CMake. "
"This allows you to use Qt Creator as a code editor."));
parameters.setCategory(QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY)); parameters.setCategory(QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_CATEGORY));
parameters.setDisplayCategory(QCoreApplication::translate("ProjectExplorer", ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY)); parameters.setDisplayCategory(QCoreApplication::translate("ProjectExplorer", ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY));
return parameters; return parameters;

View File

@@ -52,7 +52,7 @@ QIcon CloneWizard::icon() const
QString CloneWizard::description() const QString CloneWizard::description() const
{ {
return tr("Clones a project from a git repository."); return tr("Clones a project from a Git repository and tries to load the contained project.");
} }
QString CloneWizard::displayName() const QString CloneWizard::displayName() const

View File

@@ -80,7 +80,7 @@ QIcon GitoriousCloneWizard::icon() const
QString GitoriousCloneWizard::description() const QString GitoriousCloneWizard::description() const
{ {
return tr("Clones a project from a Gitorious repository."); return tr("Clones a project from a Gitorious repository and tries to load the contained project.");
} }
QString GitoriousCloneWizard::displayName() const QString GitoriousCloneWizard::displayName() const

View File

@@ -53,7 +53,7 @@ QIcon CloneWizard::icon() const
QString CloneWizard::description() const QString CloneWizard::description() const
{ {
return tr("Clone a Mercurial repository"); return tr("Clones a Mercurial repository and tries to load the contained project.");
} }
QString CloneWizard::displayName() const QString CloneWizard::displayName() const

View File

@@ -389,7 +389,7 @@ void ColorBox::mouseMoveEvent(QMouseEvent *e)
void GradientLine::setItemNode(const QVariant &itemNode) void GradientLine::setItemNode(const QVariant &itemNode)
{ {
if (!itemNode.value<ModelNode>().isValid() || !QmlItemNode(itemNode.value<ModelNode>()).hasNodeParent()) if (!itemNode.value<ModelNode>().isValid())
return; return;
m_itemNode = itemNode.value<ModelNode>(); m_itemNode = itemNode.value<ModelNode>();
setup(); setup();
@@ -442,6 +442,8 @@ void GradientLine::setActiveColor(const QColor &newColor)
void GradientLine::setupGradient() void GradientLine::setupGradient()
{ {
ModelNode modelNode = m_itemNode.modelNode(); ModelNode modelNode = m_itemNode.modelNode();
if (!modelNode.isValid())
return;
m_colorList.clear(); m_colorList.clear();
m_stops.clear(); m_stops.clear();

View File

@@ -74,7 +74,7 @@ void QmlAnchorBindingProxy::setup(const QmlItemNode &fxItemNode)
if (horizontalCentered()) if (horizontalCentered())
m_horizontalTarget = m_fxItemNode.anchors().instanceAnchor(AnchorLine::HorizontalCenter).qmlItemNode(); m_horizontalTarget = m_fxItemNode.anchors().instanceAnchor(AnchorLine::HorizontalCenter).qmlItemNode();
emit itemNodeChanged();
emit parentChanged(); emit parentChanged();
emit topAnchorChanged(); emit topAnchorChanged();
emit bottomAnchorChanged(); emit bottomAnchorChanged();

View File

@@ -477,8 +477,7 @@ CodeCompletion::CodeCompletion(ModelManagerInterface *modelManager, QObject *par
: TextEditor::ICompletionCollector(parent), : TextEditor::ICompletionCollector(parent),
m_modelManager(modelManager), m_modelManager(modelManager),
m_editor(0), m_editor(0),
m_startPosition(0), m_startPosition(0)
m_caseSensitivity(Qt::CaseSensitive)
{ {
Q_ASSERT(modelManager); Q_ASSERT(modelManager);
} }
@@ -486,12 +485,6 @@ CodeCompletion::CodeCompletion(ModelManagerInterface *modelManager, QObject *par
CodeCompletion::~CodeCompletion() CodeCompletion::~CodeCompletion()
{ } { }
Qt::CaseSensitivity CodeCompletion::caseSensitivity() const
{ return m_caseSensitivity; }
void CodeCompletion::setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
{ m_caseSensitivity = caseSensitivity; }
TextEditor::ITextEditable *CodeCompletion::editor() const TextEditor::ITextEditable *CodeCompletion::editor() const
{ return m_editor; } { return m_editor; }
@@ -637,7 +630,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
// Set up the current scope chain. // Set up the current scope chain.
QList<AST::Node *> astPath = semanticInfo.astPath(editor->position()); QList<AST::Node *> astPath = semanticInfo.astPath(editor->position());
context.build(astPath , document, snapshot, m_modelManager->importPaths()); context.build(astPath, document, snapshot, m_modelManager->importPaths());
// Search for the operator that triggered the completion. // Search for the operator that triggered the completion.
QChar completionOperator; QChar completionOperator;
@@ -854,7 +847,7 @@ void CodeCompletion::completions(QList<TextEditor::CompletionItem> *completions)
else if (length > 0) { else if (length > 0) {
const QString key = m_editor->textAt(m_startPosition, length); const QString key = m_editor->textAt(m_startPosition, length);
filter(m_completions, completions, key, FirstLetterCaseSensitive); filter(m_completions, completions, key);
if (completions->size() == 1) { if (completions->size() == 1) {
if (key == completions->first().text) if (key == completions->first().text)

View File

@@ -55,9 +55,6 @@ public:
CodeCompletion(ModelManagerInterface *modelManager, QObject *parent = 0); CodeCompletion(ModelManagerInterface *modelManager, QObject *parent = 0);
virtual ~CodeCompletion(); virtual ~CodeCompletion();
Qt::CaseSensitivity caseSensitivity() const;
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity);
virtual TextEditor::ITextEditable *editor() const; virtual TextEditor::ITextEditable *editor() const;
virtual int startPosition() const; virtual int startPosition() const;
virtual bool shouldRestartCompletion(); virtual bool shouldRestartCompletion();
@@ -81,7 +78,6 @@ private:
TextEditor::ITextEditable *m_editor; TextEditor::ITextEditable *m_editor;
int m_startPosition; int m_startPosition;
QList<TextEditor::CompletionItem> m_completions; QList<TextEditor::CompletionItem> m_completions;
Qt::CaseSensitivity m_caseSensitivity;
QList<TextEditor::CompletionItem> m_snippets; QList<TextEditor::CompletionItem> m_snippets;
QDateTime m_snippetFileLastModified; QDateTime m_snippetFileLastModified;

View File

@@ -77,8 +77,7 @@ QmlJSEditorPlugin::QmlJSEditorPlugin() :
m_modelManager(0), m_modelManager(0),
m_wizard(0), m_wizard(0),
m_editor(0), m_editor(0),
m_actionHandler(0), m_actionHandler(0)
m_completion(0)
{ {
m_instance = this; m_instance = this;
} }
@@ -148,19 +147,16 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION); cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
m_completion = new CodeCompletion(m_modelManager); CodeCompletion *completion = new CodeCompletion(m_modelManager);
addAutoReleasedObject(m_completion); addAutoReleasedObject(completion);
addAutoReleasedObject(new HoverHandler()); addAutoReleasedObject(new HoverHandler);
// Restore settings // Set completion settings and keep them up to date
QSettings *settings = Core::ICore::instance()->settings(); TextEditor::TextEditorSettings *textEditorSettings = TextEditor::TextEditorSettings::instance();
settings->beginGroup(QLatin1String("CppTools")); // ### FIXME: completion->setCompletionSettings(textEditorSettings->completionSettings());
settings->beginGroup(QLatin1String("Completion")); connect(textEditorSettings, SIGNAL(completionSettingsChanged(TextEditor::CompletionSettings)),
const bool caseSensitive = settings->value(QLatin1String("CaseSensitive"), true).toBool(); completion, SLOT(setCompletionSettings(TextEditor::CompletionSettings)));
m_completion->setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
settings->endGroup();
settings->endGroup();
error_message->clear(); error_message->clear();

View File

@@ -52,7 +52,6 @@ class QmlFileWizard;
namespace Internal { namespace Internal {
class QmlJSEditorFactory; class QmlJSEditorFactory;
class CodeCompletion;
class QmlJSTextEditor; class QmlJSTextEditor;
class QmlJSPreviewRunner; class QmlJSPreviewRunner;
@@ -92,7 +91,6 @@ private:
QmlFileWizard *m_wizard; QmlFileWizard *m_wizard;
QmlJSEditorFactory *m_editor; QmlJSEditorFactory *m_editor;
TextEditor::TextEditorActionHandler *m_actionHandler; TextEditor::TextEditorActionHandler *m_actionHandler;
CodeCompletion *m_completion;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -61,7 +61,8 @@ Core::BaseFileWizardParameters QmlProjectApplicationWizard::parameters()
parameters.setIcon(QIcon(QLatin1String(":/wizards/images/console.png"))); parameters.setIcon(QIcon(QLatin1String(":/wizards/images/console.png")));
parameters.setDisplayName(tr("Qt QML Application")); parameters.setDisplayName(tr("Qt QML Application"));
parameters.setId(QLatin1String("QA.QML Application")); parameters.setId(QLatin1String("QA.QML Application"));
parameters.setDescription(tr("Creates a Qt QML application.")); parameters.setDescription(tr("Creates a Qt QML application project with a single QML file containing the main view.\n\n"
"QML application projects are executed through the QML runtime and do not need to be built."));
parameters.setCategory(QLatin1String(Constants::QML_WIZARD_CATEGORY)); parameters.setCategory(QLatin1String(Constants::QML_WIZARD_CATEGORY));
parameters.setDisplayCategory(QCoreApplication::translate(Constants::QML_WIZARD_TR_SCOPE, parameters.setDisplayCategory(QCoreApplication::translate(Constants::QML_WIZARD_TR_SCOPE,
Constants::QML_WIZARD_TR_CATEGORY)); Constants::QML_WIZARD_TR_CATEGORY));

View File

@@ -627,16 +627,6 @@ bool QtVersion::supportsShadowBuilds() const
// We can not support shadow building with the ABLD system // We can not support shadow building with the ABLD system
return false; return false;
} }
if (targets.contains(Constants::MAEMO_DEVICE_TARGET_ID)) {
#if defined(Q_OS_WIN)
// qmake -unix fails with shadow building on windows
return false;
#else
// ... but works fine anywhere else
return true;
#endif
}
return true; return true;
} }

View File

@@ -57,7 +57,8 @@ ConsoleAppWizard::ConsoleAppWizard()
QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE), QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE),
QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY), QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY),
tr("Qt Console Application"), tr("Qt Console Application"),
tr("Creates a Qt console application."), tr("Creates a project containing a single main.cpp file with a stub implementation.\n\n"
"Preselects a desktop Qt for building the application if available."),
QIcon(QLatin1String(":/wizards/images/console.png"))) QIcon(QLatin1String(":/wizards/images/console.png")))
{ {
} }

View File

@@ -44,7 +44,8 @@ EmptyProjectWizard::EmptyProjectWizard()
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE),
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY),
tr("Empty Qt Project"), tr("Empty Qt Project"),
tr("Creates an empty Qt project."), tr("Creates a qmake-based project without any files. This allows you to create "
"an application without any default classes."),
QIcon(QLatin1String(":/wizards/images/gui.png"))) QIcon(QLatin1String(":/wizards/images/gui.png")))
{ {
} }

View File

@@ -81,7 +81,9 @@ GuiAppWizard::GuiAppWizard()
QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE), QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE),
QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY), QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY),
tr("Qt Gui Application"), tr("Qt Gui Application"),
tr("Creates a Qt Gui Application with one form."), tr("Creates a Qt application for the desktop. "
"Includes a Qt Designer-based main window.\n\n"
"Preselects a desktop Qt for building the application if available."),
QIcon(QLatin1String(":/wizards/images/gui.png"))), QIcon(QLatin1String(":/wizards/images/gui.png"))),
m_createMobileProject(false) m_createMobileProject(false)
{ {

View File

@@ -53,7 +53,9 @@ LibraryWizard::LibraryWizard()
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE),
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY),
tr("C++ Library"), tr("C++ Library"),
tr("Creates a Qt based C++ Library."), tr("Creates a C++ library based on qmake. This can be used to create:<ul>"
"<li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li>"
"<li>a shared or static C++ library for use with another project at linktime</li></ul>."),
QIcon(QLatin1String(":/wizards/images/lib.png"))) QIcon(QLatin1String(":/wizards/images/lib.png")))
{ {
} }

View File

@@ -42,7 +42,9 @@ MobileGuiAppWizard::MobileGuiAppWizard() :
QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE), QLatin1String(Constants::QT_APP_WIZARD_TR_SCOPE),
QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY), QLatin1String(Constants::QT_APP_WIZARD_TR_CATEGORY),
tr("Mobile Qt Application"), tr("Mobile Qt Application"),
tr("Creates a mobile Qt Gui Application with one form."), tr("Creates a Qt application optimized for mobile devices "
"with a Qt Designer-based main window.\n\n"
"Preselects Qt for Simulator and mobile targets if available"),
QIcon(QLatin1String(":/projectexplorer/images/SymbianDevice.png")), QIcon(QLatin1String(":/projectexplorer/images/SymbianDevice.png")),
true) true)
{ {

View File

@@ -49,7 +49,9 @@ TestWizard::TestWizard() :
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_SCOPE),
QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY), QLatin1String(ProjectExplorer::Constants::PROJECT_WIZARD_TR_CATEGORY),
tr("Qt Unit Test"), tr("Qt Unit Test"),
tr("Creates a Qt Unit Test."), tr("Creates a QTestLib-based unit test for a feature or a class. "
"Unit tests allow you to verify that the code is fit for use "
"and that there are no regressions."),
QIcon(QLatin1String(":/wizards/images/console.png"))) QIcon(QLatin1String(":/wizards/images/console.png")))
{ {
} }

View File

@@ -75,7 +75,7 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
addObject(m_editor); addObject(m_editor);
Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard); Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
wizardParameters.setDescription(tr("Creates a Qt Resource file (.qrc).")); wizardParameters.setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt C++ project."));
wizardParameters.setDisplayName(tr("Qt Resource file")); wizardParameters.setDisplayName(tr("Qt Resource file"));
wizardParameters.setId(QLatin1String("F.Resource")); wizardParameters.setId(QLatin1String("F.Resource"));
wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT)); wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));

View File

@@ -53,7 +53,7 @@ QIcon CheckoutWizard::icon() const
QString CheckoutWizard::description() const QString CheckoutWizard::description() const
{ {
return tr("Checks out a project from a Subversion repository."); return tr("Checks out a project from a Subversion repository and tries to load the contained project.");
} }
QString CheckoutWizard::displayName() const QString CheckoutWizard::displayName() const

View File

@@ -34,6 +34,7 @@
#include "basetexteditor_p.h" #include "basetexteditor_p.h"
#include "behaviorsettings.h" #include "behaviorsettings.h"
#include "codecselector.h" #include "codecselector.h"
#include "completionsettings.h"
#include "completionsupport.h" #include "completionsupport.h"
#include "tabsettings.h" #include "tabsettings.h"
#include "texteditorconstants.h" #include "texteditorconstants.h"
@@ -179,7 +180,7 @@ static void convertToPlainText(QString &txt)
BaseTextEditor::BaseTextEditor(QWidget *parent) BaseTextEditor::BaseTextEditor(QWidget *parent)
: QPlainTextEdit(parent) : QPlainTextEdit(parent)
{ {
d = new BaseTextEditorPrivate(); d = new BaseTextEditorPrivate;
d->q = this; d->q = this;
d->m_extraArea = new TextEditExtraArea(this); d->m_extraArea = new TextEditExtraArea(this);
d->m_extraArea->setMouseTracking(true); d->m_extraArea->setMouseTracking(true);
@@ -195,8 +196,6 @@ BaseTextEditor::BaseTextEditor(QWidget *parent)
d->m_lastScrollPos = -1; d->m_lastScrollPos = -1;
setCursorWidth(2); setCursorWidth(2);
d->m_allowSkippingOfBlockEnd = false;
// from RESEARCH // from RESEARCH
setLayoutDirection(Qt::LeftToRight); setLayoutDirection(Qt::LeftToRight);
@@ -221,7 +220,6 @@ BaseTextEditor::BaseTextEditor(QWidget *parent)
// parentheses matcher // parentheses matcher
d->m_parenthesesMatchingEnabled = false;
d->m_formatRange = true; d->m_formatRange = true;
d->m_matchFormat.setForeground(Qt::red); d->m_matchFormat.setForeground(Qt::red);
d->m_rangeFormat.setBackground(QColor(0xb4, 0xee, 0xb4)); d->m_rangeFormat.setBackground(QColor(0xb4, 0xee, 0xb4));
@@ -1709,6 +1707,16 @@ bool BaseTextEditor::isParenthesesMatchingEnabled() const
return d->m_parenthesesMatchingEnabled; return d->m_parenthesesMatchingEnabled;
} }
void BaseTextEditor::setAutoParenthesesEnabled(bool b)
{
d->m_autoParenthesesEnabled = b;
}
bool BaseTextEditor::isAutoParenthesesEnabled() const
{
return d->m_autoParenthesesEnabled;
}
void BaseTextEditor::setHighlightCurrentLine(bool b) void BaseTextEditor::setHighlightCurrentLine(bool b)
{ {
d->m_highlightCurrentLine = b; d->m_highlightCurrentLine = b;
@@ -1837,8 +1845,10 @@ BaseTextEditorPrivate::BaseTextEditorPrivate()
: :
m_contentsChanged(false), m_contentsChanged(false),
m_lastCursorChangeWasInteresting(false), m_lastCursorChangeWasInteresting(false),
m_document(new BaseTextDocument()), m_allowSkippingOfBlockEnd(false),
m_document(new BaseTextDocument),
m_parenthesesMatchingEnabled(false), m_parenthesesMatchingEnabled(false),
m_autoParenthesesEnabled(true),
m_extraArea(0), m_extraArea(0),
m_mouseOnCollapsedMarker(false), m_mouseOnCollapsedMarker(false),
m_marksVisible(false), m_marksVisible(false),
@@ -3889,13 +3899,16 @@ QString BaseTextEditor::autoComplete(QTextCursor &cursor, const QString &textToI
const bool checkBlockEnd = d->m_allowSkippingOfBlockEnd; const bool checkBlockEnd = d->m_allowSkippingOfBlockEnd;
d->m_allowSkippingOfBlockEnd = false; // consume blockEnd. d->m_allowSkippingOfBlockEnd = false; // consume blockEnd.
if (!d->m_autoParenthesesEnabled)
return QString();
if (!contextAllowsAutoParentheses(cursor, textToInsert)) if (!contextAllowsAutoParentheses(cursor, textToInsert))
return QString(); return QString();
const QString text = textToInsert; const QString text = textToInsert;
const QChar lookAhead = characterAt(cursor.selectionEnd()); const QChar lookAhead = characterAt(cursor.selectionEnd());
QChar character = textToInsert.at(0); const QChar character = textToInsert.at(0);
const QString parentheses = QLatin1String("()"); const QString parentheses = QLatin1String("()");
const QString brackets = QLatin1String("[]"); const QString brackets = QLatin1String("[]");
if (parentheses.contains(character) || brackets.contains(character)) { if (parentheses.contains(character) || brackets.contains(character)) {
@@ -3950,17 +3963,20 @@ bool BaseTextEditor::autoBackspace(QTextCursor &cursor)
{ {
d->m_allowSkippingOfBlockEnd = false; d->m_allowSkippingOfBlockEnd = false;
if (!d->m_autoParenthesesEnabled)
return false;
int pos = cursor.position(); int pos = cursor.position();
if (pos == 0) if (pos == 0)
return false; return false;
QTextCursor c = cursor; QTextCursor c = cursor;
c.setPosition(pos - 1); c.setPosition(pos - 1);
QChar lookAhead = characterAt(pos); const QChar lookAhead = characterAt(pos);
QChar lookBehind = characterAt(pos-1); const QChar lookBehind = characterAt(pos - 1);
QChar lookFurtherBehind = characterAt(pos-2); const QChar lookFurtherBehind = characterAt(pos - 2);
QChar character = lookBehind; const QChar character = lookBehind;
if (character == QLatin1Char('(') || character == QLatin1Char('[')) { if (character == QLatin1Char('(') || character == QLatin1Char('[')) {
QTextCursor tmp = cursor; QTextCursor tmp = cursor;
TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp); TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp);
@@ -4005,7 +4021,10 @@ bool BaseTextEditor::autoBackspace(QTextCursor &cursor)
int BaseTextEditor::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor) int BaseTextEditor::paragraphSeparatorAboutToBeInserted(QTextCursor &cursor)
{ {
if (characterAt(cursor.position()-1) != QLatin1Char('{')) if (!d->m_autoParenthesesEnabled)
return 0;
if (characterAt(cursor.position() - 1) != QLatin1Char('{'))
return 0; return 0;
if (!contextAllowsAutoParentheses(cursor)) if (!contextAllowsAutoParentheses(cursor))
@@ -4908,6 +4927,11 @@ void BaseTextEditor::setStorageSettings(const StorageSettings &storageSettings)
d->m_document->setStorageSettings(storageSettings); d->m_document->setStorageSettings(storageSettings);
} }
void BaseTextEditor::setCompletionSettings(const TextEditor::CompletionSettings &completionSettings)
{
setAutoParenthesesEnabled(completionSettings.m_autoInsertBrackets);
}
void BaseTextEditor::collapse() void BaseTextEditor::collapse()
{ {
QTextDocument *doc = document(); QTextDocument *doc = document();

View File

@@ -59,6 +59,7 @@ class BaseTextDocument;
class BaseTextEditorEditable; class BaseTextEditorEditable;
class FontSettings; class FontSettings;
struct BehaviorSettings; struct BehaviorSettings;
struct CompletionSettings;
struct DisplaySettings; struct DisplaySettings;
struct StorageSettings; struct StorageSettings;
struct TabSettings; struct TabSettings;
@@ -160,13 +161,15 @@ public:
void setParenthesesMatchingEnabled(bool b); void setParenthesesMatchingEnabled(bool b);
bool isParenthesesMatchingEnabled() const; bool isParenthesesMatchingEnabled() const;
void setAutoParenthesesEnabled(bool b);
bool isAutoParenthesesEnabled() const;
void setHighlightCurrentLine(bool b); void setHighlightCurrentLine(bool b);
bool highlightCurrentLine() const; bool highlightCurrentLine() const;
void setLineNumbersVisible(bool b); void setLineNumbersVisible(bool b);
bool lineNumbersVisible() const; bool lineNumbersVisible() const;
void setMarksVisible(bool b); void setMarksVisible(bool b);
bool marksVisible() const; bool marksVisible() const;
@@ -366,6 +369,7 @@ public slots:
virtual void setDisplaySettings(const TextEditor::DisplaySettings &); virtual void setDisplaySettings(const TextEditor::DisplaySettings &);
virtual void setBehaviorSettings(const TextEditor::BehaviorSettings &); virtual void setBehaviorSettings(const TextEditor::BehaviorSettings &);
virtual void setStorageSettings(const TextEditor::StorageSettings &); virtual void setStorageSettings(const TextEditor::StorageSettings &);
virtual void setCompletionSettings(const TextEditor::CompletionSettings &);
protected: protected:
bool viewportEvent(QEvent *event); bool viewportEvent(QEvent *event);

View File

@@ -265,7 +265,6 @@ public:
int m_cursorBlockNumber; int m_cursorBlockNumber;
bool m_inKeyPressEvent; bool m_inKeyPressEvent;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -0,0 +1,86 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "completionsettings.h"
#include <QtCore/QSettings>
static const char * const groupPostfix = "Completion";
static const char * const caseSensitivityKey = "CaseSensitivity";
static const char * const autoInsertBracesKey = "AutoInsertBraces";
static const char * const partiallyCompleteKey = "PartiallyComplete";
static const char * const spaceAfterFunctionNameKey = "SpaceAfterFunctionName";
using namespace TextEditor;
CompletionSettings::CompletionSettings()
: m_caseSensitivity(FirstLetterCaseSensitive)
, m_autoInsertBrackets(true)
, m_partiallyComplete(true)
, m_spaceAfterFunctionName(false)
{
}
void CompletionSettings::toSettings(const QString &category, QSettings *s) const
{
QString group = QLatin1String(groupPostfix);
if (!category.isEmpty())
group.insert(0, category);
s->beginGroup(group);
s->setValue(QLatin1String(caseSensitivityKey), (int) m_caseSensitivity);
s->setValue(QLatin1String(autoInsertBracesKey), m_autoInsertBrackets);
s->setValue(QLatin1String(partiallyCompleteKey), m_partiallyComplete);
s->setValue(QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName);
s->endGroup();
}
void CompletionSettings::fromSettings(const QString &category, const QSettings *s)
{
QString group = QLatin1String(groupPostfix);
if (!category.isEmpty())
group.insert(0, category);
group += QLatin1Char('/');
*this = CompletionSettings(); // Assign defaults
m_caseSensitivity = (CaseSensitivity) s->value(group + QLatin1String(caseSensitivityKey), m_caseSensitivity).toInt();
m_autoInsertBrackets = s->value(group + QLatin1String(autoInsertBracesKey), m_autoInsertBrackets).toBool();
m_partiallyComplete = s->value(group + QLatin1String(partiallyCompleteKey), m_partiallyComplete).toBool();
m_spaceAfterFunctionName = s->value(group + QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName).toBool();
}
bool CompletionSettings::equals(const CompletionSettings &cs) const
{
return m_caseSensitivity == cs.m_caseSensitivity
&& m_autoInsertBrackets == cs.m_autoInsertBrackets
&& m_partiallyComplete == cs.m_partiallyComplete
&& m_spaceAfterFunctionName == cs.m_spaceAfterFunctionName
;
}

View File

@@ -0,0 +1,70 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef COMPLETIONSETTINGS_H
#define COMPLETIONSETTINGS_H
#include "texteditor_global.h"
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace TextEditor {
enum CaseSensitivity {
CaseInsensitive,
CaseSensitive,
FirstLetterCaseSensitive
};
/**
* Settings that describe how the code completion behaves.
*/
struct TEXTEDITOR_EXPORT CompletionSettings
{
CompletionSettings();
void toSettings(const QString &category, QSettings *s) const;
void fromSettings(const QString &category, const QSettings *s);
bool equals(const CompletionSettings &bs) const;
CaseSensitivity m_caseSensitivity;
bool m_autoInsertBrackets;
bool m_partiallyComplete;
bool m_spaceAfterFunctionName;
};
inline bool operator==(const CompletionSettings &t1, const CompletionSettings &t2) { return t1.equals(t2); }
inline bool operator!=(const CompletionSettings &t1, const CompletionSettings &t2) { return !t1.equals(t2); }
} // namespace TextEditor
#endif // COMPLETIONSETTINGS_H

View File

@@ -28,11 +28,27 @@
**************************************************************************/ **************************************************************************/
#include "icompletioncollector.h" #include "icompletioncollector.h"
#include "completionsettings.h"
#include "itexteditable.h" #include "itexteditable.h"
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
#include <algorithm> #include <algorithm>
using namespace TextEditor; using namespace TextEditor;
using namespace TextEditor::Internal;
namespace TextEditor {
namespace Internal {
struct ICompletionCollectorPrivate
{
public:
CompletionSettings m_completionSettings;
};
} // namespace Internal
} // namespace TextEditor
bool ICompletionCollector::compareChar(const QChar &l, const QChar &r) bool ICompletionCollector::compareChar(const QChar &l, const QChar &r)
{ {
@@ -62,6 +78,27 @@ bool ICompletionCollector::completionItemLessThan(const CompletionItem &i1, cons
return lessThan(lower1, lower2); return lessThan(lower1, lower2);
} }
ICompletionCollector::ICompletionCollector(QObject *parent)
: QObject(parent)
, m_d(new Internal::ICompletionCollectorPrivate)
{
}
ICompletionCollector::~ICompletionCollector()
{
delete m_d;
}
void ICompletionCollector::setCompletionSettings(const CompletionSettings &settings)
{
m_d->m_completionSettings = settings;
}
const CompletionSettings &ICompletionCollector::completionSettings() const
{
return m_d->m_completionSettings;
}
QList<CompletionItem> ICompletionCollector::getCompletions() QList<CompletionItem> ICompletionCollector::getCompletions()
{ {
QList<CompletionItem> completionItems; QList<CompletionItem> completionItems;
@@ -88,6 +125,9 @@ QList<CompletionItem> ICompletionCollector::getCompletions()
bool ICompletionCollector::partiallyComplete(const QList<TextEditor::CompletionItem> &completionItems) bool ICompletionCollector::partiallyComplete(const QList<TextEditor::CompletionItem> &completionItems)
{ {
if (! m_d->m_completionSettings.m_partiallyComplete)
return false;
// Compute common prefix // Compute common prefix
QString firstKey = completionItems.first().text; QString firstKey = completionItems.first().text;
QString lastKey = completionItems.last().text; QString lastKey = completionItems.last().text;
@@ -113,9 +153,10 @@ bool ICompletionCollector::partiallyComplete(const QList<TextEditor::CompletionI
void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items, void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items,
QList<TextEditor::CompletionItem> *filteredItems, QList<TextEditor::CompletionItem> *filteredItems,
const QString &key, const QString &key)
ICompletionCollector::CaseSensitivity caseSensitivity)
{ {
const TextEditor::CaseSensitivity caseSensitivity = m_d->m_completionSettings.m_caseSensitivity;
/* /*
* This code builds a regular expression in order to more intelligently match * This code builds a regular expression in order to more intelligently match
* camel-case style. This means upper-case characters will be rewritten as follows: * camel-case style. This means upper-case characters will be rewritten as follows:
@@ -132,8 +173,8 @@ void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items
bool first = true; bool first = true;
const QLatin1String wordContinuation("[a-z0-9_]*"); const QLatin1String wordContinuation("[a-z0-9_]*");
foreach (const QChar &c, key) { foreach (const QChar &c, key) {
if (caseSensitivity == CaseInsensitive || if (caseSensitivity == TextEditor::CaseInsensitive ||
(caseSensitivity == FirstLetterCaseSensitive && !first)) { (caseSensitivity == TextEditor::FirstLetterCaseSensitive && !first)) {
keyRegExp += QLatin1String("(?:"); keyRegExp += QLatin1String("(?:");
if (c.isUpper() && !first) if (c.isUpper() && !first)
@@ -158,7 +199,7 @@ void ICompletionCollector::filter(const QList<TextEditor::CompletionItem> &items
if (hasKey) { if (hasKey) {
if (item.text.startsWith(key, Qt::CaseSensitive)) { if (item.text.startsWith(key, Qt::CaseSensitive)) {
item.relevance = 2; item.relevance = 2;
} else if (caseSensitivity != CaseSensitive } else if (caseSensitivity != TextEditor::CaseSensitive
&& item.text.startsWith(key, Qt::CaseInsensitive)) { && item.text.startsWith(key, Qt::CaseInsensitive)) {
item.relevance = 1; item.relevance = 1;
} }

View File

@@ -38,8 +38,13 @@
namespace TextEditor { namespace TextEditor {
namespace Internal {
class ICompletionCollectorPrivate;
}
class ICompletionCollector; class ICompletionCollector;
class ITextEditable; class ITextEditable;
struct CompletionSettings;
struct CompletionItem struct CompletionItem
{ {
@@ -73,8 +78,10 @@ class TEXTEDITOR_EXPORT ICompletionCollector : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
ICompletionCollector(QObject *parent = 0) : QObject(parent) {} ICompletionCollector(QObject *parent = 0);
virtual ~ICompletionCollector() {} virtual ~ICompletionCollector();
const CompletionSettings &completionSettings() const;
virtual QList<CompletionItem> getCompletions(); virtual QList<CompletionItem> getCompletions();
virtual bool shouldRestartCompletion(); virtual bool shouldRestartCompletion();
@@ -120,21 +127,20 @@ public:
// helpers // helpers
enum CaseSensitivity {
CaseInsensitive,
CaseSensitive,
FirstLetterCaseSensitive
};
void filter(const QList<TextEditor::CompletionItem> &items, void filter(const QList<TextEditor::CompletionItem> &items,
QList<TextEditor::CompletionItem> *filteredItems, QList<TextEditor::CompletionItem> *filteredItems,
const QString &key, const QString &key);
CaseSensitivity caseSensitivity);
public slots:
void setCompletionSettings(const TextEditor::CompletionSettings &);
protected: protected:
static bool compareChar(const QChar &item, const QChar &other); static bool compareChar(const QChar &item, const QChar &other);
static bool lessThan(const QString &item, const QString &other); static bool lessThan(const QString &item, const QString &other);
static bool completionItemLessThan(const CompletionItem &item, const CompletionItem &other); static bool completionItemLessThan(const CompletionItem &item, const CompletionItem &other);
private:
Internal::ICompletionCollectorPrivate *m_d;
}; };
class TEXTEDITOR_EXPORT IQuickFixCollector : public ICompletionCollector class TEXTEDITOR_EXPORT IQuickFixCollector : public ICompletionCollector

View File

@@ -34,7 +34,8 @@ SOURCES += texteditorplugin.cpp \
itexteditor.cpp \ itexteditor.cpp \
texteditoroverlay.cpp \ texteditoroverlay.cpp \
texteditoroptionspage.cpp \ texteditoroptionspage.cpp \
basetextdocumentlayout.cpp basetextdocumentlayout.cpp \
completionsettings.cpp
HEADERS += texteditorplugin.h \ HEADERS += texteditorplugin.h \
textfilewizard.h \ textfilewizard.h \
@@ -71,7 +72,8 @@ HEADERS += texteditorplugin.h \
colorschemeedit.h \ colorschemeedit.h \
texteditoroverlay.h \ texteditoroverlay.h \
texteditoroptionspage.h \ texteditoroptionspage.h \
basetextdocumentlayout.h basetextdocumentlayout.h \
completionsettings.h
FORMS += behaviorsettingspage.ui \ FORMS += behaviorsettingspage.ui \

View File

@@ -91,7 +91,8 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
return false; return false;
Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard); Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
wizardParameters.setDescription(tr("Creates a text file (.txt).")); wizardParameters.setDescription(tr("Creates a text file. The default file extension is <tt>.txt</tt>. "
"You can specify a different extension as part of the filename."));
wizardParameters.setDisplayName(tr("Text File")); wizardParameters.setDisplayName(tr("Text File"));
wizardParameters.setCategory(QLatin1String("U.General")); wizardParameters.setCategory(QLatin1String("U.General"));
wizardParameters.setDisplayCategory(tr("General")); wizardParameters.setDisplayCategory(tr("General"));

View File

@@ -33,6 +33,7 @@
#include "basetexteditor.h" #include "basetexteditor.h"
#include "behaviorsettings.h" #include "behaviorsettings.h"
#include "behaviorsettingspage.h" #include "behaviorsettingspage.h"
#include "completionsettings.h"
#include "displaysettings.h" #include "displaysettings.h"
#include "displaysettingspage.h" #include "displaysettingspage.h"
#include "fontsettingspage.h" #include "fontsettingspage.h"
@@ -41,17 +42,54 @@
#include "texteditorplugin.h" #include "texteditorplugin.h"
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QtGui/QApplication> #include <QtGui/QApplication>
using namespace TextEditor; using namespace TextEditor;
using namespace TextEditor::Constants; using namespace TextEditor::Constants;
using namespace TextEditor::Internal;
namespace TextEditor {
namespace Internal {
class TextEditorSettingsPrivate
{
public:
FontSettingsPage *m_fontSettingsPage;
BehaviorSettingsPage *m_behaviorSettingsPage;
DisplaySettingsPage *m_displaySettingsPage;
CompletionSettings m_completionSettings;
void fontZoomRequested(int pointSize);
void zoomResetRequested();
};
void TextEditorSettingsPrivate::fontZoomRequested(int zoom)
{
FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
fs.setFontZoom(qMax(10, fs.fontZoom() + zoom));
m_fontSettingsPage->saveSettings();
}
void TextEditorSettingsPrivate::zoomResetRequested()
{
FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
fs.setFontZoom(100);
m_fontSettingsPage->saveSettings();
}
} // namespace Internal
} // namespace TextEditor
TextEditorSettings *TextEditorSettings::m_instance = 0; TextEditorSettings *TextEditorSettings::m_instance = 0;
TextEditorSettings::TextEditorSettings(QObject *parent) TextEditorSettings::TextEditorSettings(QObject *parent)
: QObject(parent) : QObject(parent)
, m_d(new Internal::TextEditorSettingsPrivate)
{ {
QTC_ASSERT(!m_instance, return); QTC_ASSERT(!m_instance, return);
m_instance = this; m_instance = this;
@@ -102,44 +140,50 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_FILE), tr("Diff File"), Qt::darkBlue)); formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_FILE), tr("Diff File"), Qt::darkBlue));
formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_LOCATION), tr("Diff Location"), Qt::blue)); formatDescriptions.append(FormatDescription(QLatin1String(C_DIFF_LOCATION), tr("Diff Location"), Qt::blue));
m_fontSettingsPage = new FontSettingsPage(formatDescriptions, m_d->m_fontSettingsPage = new FontSettingsPage(formatDescriptions,
QLatin1String("A.FontSettings"), QLatin1String("A.FontSettings"),
this); this);
pm->addObject(m_fontSettingsPage); pm->addObject(m_d->m_fontSettingsPage);
// Add the GUI used to configure the tab, storage and interaction settings // Add the GUI used to configure the tab, storage and interaction settings
TextEditor::BehaviorSettingsPageParameters behaviorSettingsPageParameters; TextEditor::BehaviorSettingsPageParameters behaviorSettingsPageParameters;
behaviorSettingsPageParameters.id = QLatin1String("B.BehaviourSettings"); behaviorSettingsPageParameters.id = QLatin1String("B.BehaviourSettings");
behaviorSettingsPageParameters.displayName = tr("Behavior"); behaviorSettingsPageParameters.displayName = tr("Behavior");
behaviorSettingsPageParameters.settingsPrefix = QLatin1String("text"); behaviorSettingsPageParameters.settingsPrefix = QLatin1String("text");
m_behaviorSettingsPage = new BehaviorSettingsPage(behaviorSettingsPageParameters, this); m_d->m_behaviorSettingsPage = new BehaviorSettingsPage(behaviorSettingsPageParameters, this);
pm->addObject(m_behaviorSettingsPage); pm->addObject(m_d->m_behaviorSettingsPage);
TextEditor::DisplaySettingsPageParameters displaySettingsPageParameters; TextEditor::DisplaySettingsPageParameters displaySettingsPageParameters;
displaySettingsPageParameters.id = QLatin1String("D.DisplaySettings"), displaySettingsPageParameters.id = QLatin1String("D.DisplaySettings"),
displaySettingsPageParameters.displayName = tr("Display"); displaySettingsPageParameters.displayName = tr("Display");
displaySettingsPageParameters.settingsPrefix = QLatin1String("text"); displaySettingsPageParameters.settingsPrefix = QLatin1String("text");
m_displaySettingsPage = new DisplaySettingsPage(displaySettingsPageParameters, this); m_d->m_displaySettingsPage = new DisplaySettingsPage(displaySettingsPageParameters, this);
pm->addObject(m_displaySettingsPage); pm->addObject(m_d->m_displaySettingsPage);
connect(m_fontSettingsPage, SIGNAL(changed(TextEditor::FontSettings)), connect(m_d->m_fontSettingsPage, SIGNAL(changed(TextEditor::FontSettings)),
this, SIGNAL(fontSettingsChanged(TextEditor::FontSettings))); this, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)));
connect(m_behaviorSettingsPage, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)), connect(m_d->m_behaviorSettingsPage, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)),
this, SIGNAL(tabSettingsChanged(TextEditor::TabSettings))); this, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)));
connect(m_behaviorSettingsPage, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)), connect(m_d->m_behaviorSettingsPage, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)),
this, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings))); this, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)));
connect(m_behaviorSettingsPage, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)), connect(m_d->m_behaviorSettingsPage, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)),
this, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings))); this, SIGNAL(behaviorSettingsChanged(TextEditor::BehaviorSettings)));
connect(m_displaySettingsPage, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)), connect(m_d->m_displaySettingsPage, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)),
this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings))); this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)));
// TODO: Move these settings to TextEditor category
if (QSettings *s = Core::ICore::instance()->settings())
m_d->m_completionSettings.fromSettings(QLatin1String("CppTools/"), s);
} }
TextEditorSettings::~TextEditorSettings() TextEditorSettings::~TextEditorSettings()
{ {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
pm->removeObject(m_fontSettingsPage); pm->removeObject(m_d->m_fontSettingsPage);
pm->removeObject(m_behaviorSettingsPage); pm->removeObject(m_d->m_behaviorSettingsPage);
pm->removeObject(m_displaySettingsPage); pm->removeObject(m_d->m_displaySettingsPage);
delete m_d;
m_instance = 0; m_instance = 0;
} }
@@ -166,6 +210,8 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
editor, SLOT(setBehaviorSettings(TextEditor::BehaviorSettings))); editor, SLOT(setBehaviorSettings(TextEditor::BehaviorSettings)));
connect(this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)), connect(this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)),
editor, SLOT(setDisplaySettings(TextEditor::DisplaySettings))); editor, SLOT(setDisplaySettings(TextEditor::DisplaySettings)));
connect(this, SIGNAL(completionSettingsChanged(TextEditor::CompletionSettings)),
editor, SLOT(setCompletionSettings(TextEditor::CompletionSettings)));
connect(editor, SIGNAL(requestFontZoom(int)), connect(editor, SIGNAL(requestFontZoom(int)),
this, SLOT(fontZoomRequested(int))); this, SLOT(fontZoomRequested(int)));
@@ -178,44 +224,50 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
editor->setStorageSettings(storageSettings()); editor->setStorageSettings(storageSettings());
editor->setBehaviorSettings(behaviorSettings()); editor->setBehaviorSettings(behaviorSettings());
editor->setDisplaySettings(displaySettings()); editor->setDisplaySettings(displaySettings());
editor->setCompletionSettings(completionSettings());
} }
void TextEditorSettings::fontZoomRequested(int zoom)
{
FontSettings &fs = const_cast<FontSettings&>(fontSettings());
fs.setFontZoom(qMax(10, fs.fontZoom() + zoom));
m_fontSettingsPage->saveSettings();
}
void TextEditorSettings::zoomResetRequested()
{
FontSettings &fs = const_cast<FontSettings&>(fontSettings());
fs.setFontZoom(100);
m_fontSettingsPage->saveSettings();
}
const FontSettings &TextEditorSettings::fontSettings() const const FontSettings &TextEditorSettings::fontSettings() const
{ {
return m_fontSettingsPage->fontSettings(); return m_d->m_fontSettingsPage->fontSettings();
} }
const TabSettings &TextEditorSettings::tabSettings() const const TabSettings &TextEditorSettings::tabSettings() const
{ {
return m_behaviorSettingsPage->tabSettings(); return m_d->m_behaviorSettingsPage->tabSettings();
} }
const StorageSettings &TextEditorSettings::storageSettings() const const StorageSettings &TextEditorSettings::storageSettings() const
{ {
return m_behaviorSettingsPage->storageSettings(); return m_d->m_behaviorSettingsPage->storageSettings();
} }
const BehaviorSettings &TextEditorSettings::behaviorSettings() const const BehaviorSettings &TextEditorSettings::behaviorSettings() const
{ {
return m_behaviorSettingsPage->behaviorSettings(); return m_d->m_behaviorSettingsPage->behaviorSettings();
} }
const DisplaySettings &TextEditorSettings::displaySettings() const const DisplaySettings &TextEditorSettings::displaySettings() const
{ {
return m_displaySettingsPage->displaySettings(); return m_d->m_displaySettingsPage->displaySettings();
} }
const CompletionSettings &TextEditorSettings::completionSettings() const
{
return m_d->m_completionSettings;
}
void TextEditorSettings::setCompletionSettings(const TextEditor::CompletionSettings &settings)
{
if (m_d->m_completionSettings == settings)
return;
m_d->m_completionSettings = settings;
if (QSettings *s = Core::ICore::instance()->settings())
m_d->m_completionSettings.toSettings(QLatin1String("CppTools/"), s);
emit completionSettingsChanged(m_d->m_completionSettings);
}
#include "moc_texteditorsettings.cpp"

View File

@@ -45,11 +45,16 @@ struct TabSettings;
struct StorageSettings; struct StorageSettings;
struct BehaviorSettings; struct BehaviorSettings;
struct DisplaySettings; struct DisplaySettings;
struct CompletionSettings;
namespace Internal {
class TextEditorSettingsPrivate;
}
/** /**
* This class provides a central place for basic text editor settings. These * This class provides a central place for basic text editor settings. These
* settings include font settings, tab settings, storage settings, behavior * settings include font settings, tab settings, storage settings, behavior
* settings and display settings. * settings, display settings and completion settings.
*/ */
class TEXTEDITOR_EXPORT TextEditorSettings : public QObject class TEXTEDITOR_EXPORT TextEditorSettings : public QObject
{ {
@@ -68,6 +73,9 @@ public:
const StorageSettings &storageSettings() const; const StorageSettings &storageSettings() const;
const BehaviorSettings &behaviorSettings() const; const BehaviorSettings &behaviorSettings() const;
const DisplaySettings &displaySettings() const; const DisplaySettings &displaySettings() const;
const CompletionSettings &completionSettings() const;
void setCompletionSettings(const TextEditor::CompletionSettings &);
signals: signals:
void fontSettingsChanged(const TextEditor::FontSettings &); void fontSettingsChanged(const TextEditor::FontSettings &);
@@ -75,15 +83,12 @@ signals:
void storageSettingsChanged(const TextEditor::StorageSettings &); void storageSettingsChanged(const TextEditor::StorageSettings &);
void behaviorSettingsChanged(const TextEditor::BehaviorSettings &); void behaviorSettingsChanged(const TextEditor::BehaviorSettings &);
void displaySettingsChanged(const TextEditor::DisplaySettings &); void displaySettingsChanged(const TextEditor::DisplaySettings &);
void completionSettingsChanged(const TextEditor::CompletionSettings &);
private slots:
void fontZoomRequested(int pointSize);
void zoomResetRequested();
private: private:
FontSettingsPage *m_fontSettingsPage; Internal::TextEditorSettingsPrivate *m_d;
BehaviorSettingsPage *m_behaviorSettingsPage; Q_PRIVATE_SLOT(m_d, void fontZoomRequested(int pointSize));
DisplaySettingsPage *m_displaySettingsPage; Q_PRIVATE_SLOT(m_d, void zoomResetRequested());
static TextEditorSettings *m_instance; static TextEditorSettings *m_instance;
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -76,12 +76,7 @@ QToolButton:pressed, QPushButton:pressed{
<item> <item>
<widget class="QWidget" name="gradientWidget" native="true"> <widget class="QWidget" name="gradientWidget" native="true">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">/* <string notr="true">#gradientWidget {
#gradientWidget {
background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:1.0, y2:1, stop:0 rgba(240, 240, 240, 255), stop:1 rgba(200, 200, 200, 255));
}
*/
#gradientWidget {
border-image: url(:/welcome/images/welcomebg.png) 0; border-image: url(:/welcome/images/welcomebg.png) 0;
} }
</string> </string>

View File

@@ -33,6 +33,9 @@
#include "helpmanager.h" #include "helpmanager.h"
#include "openpagesmanager.h" #include "openpagesmanager.h"
#include <utils/filterlineedit.h>
#include <utils/styledbar.h>
#include <QtGui/QMenu> #include <QtGui/QMenu>
#include <QtGui/QIcon> #include <QtGui/QIcon>
#include <QtGui/QStyle> #include <QtGui/QStyle>
@@ -423,19 +426,27 @@ void BookmarkWidget::setup(bool showButtons)
regExp.setCaseSensitivity(Qt::CaseInsensitive); regExp.setCaseSensitivity(Qt::CaseInsensitive);
QLayout *vlayout = new QVBoxLayout(this); QLayout *vlayout = new QVBoxLayout(this);
vlayout->setMargin(4); vlayout->setMargin(0);
vlayout->setSpacing(0);
QLabel *label = new QLabel(tr("Filter:"), this); searchField = new Utils::FilterLineEdit(this);
vlayout->addWidget(label);
searchField = new QLineEdit(this);
setFocusProxy(searchField); setFocusProxy(searchField);
Utils::StyledBar *toolbar = new Utils::StyledBar(this);
toolbar->setSingleRow(false);
QLayout *tbLayout = new QHBoxLayout();
tbLayout->setMargin(4);
tbLayout->addWidget(searchField);
toolbar->setLayout(tbLayout);
vlayout->addWidget(toolbar);
searchField->installEventFilter(this); searchField->installEventFilter(this);
vlayout->addWidget(searchField);
connect(searchField, SIGNAL(textChanged(const QString &)), this, connect(searchField, SIGNAL(textChanged(const QString &)), this,
SLOT(filterChanged())); SLOT(filterChanged()));
treeView = new TreeView(this); treeView = new TreeView(this);
treeView->setFrameStyle(QFrame::NoFrame);
vlayout->addWidget(treeView); vlayout->addWidget(treeView);
#ifdef Q_OS_MAC #ifdef Q_OS_MAC

View File

@@ -52,7 +52,7 @@ ContentWindow::ContentWindow()
setFocusProxy(m_contentWidget); setFocusProxy(m_contentWidget);
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(4); layout->setMargin(0);
layout->addWidget(m_contentWidget); layout->addWidget(m_contentWidget);
connect(m_contentWidget, SIGNAL(customContextMenuRequested(QPoint)), this, connect(m_contentWidget, SIGNAL(customContextMenuRequested(QPoint)), this,
@@ -63,6 +63,8 @@ ContentWindow::ContentWindow()
QHelpContentModel *contentModel = QHelpContentModel *contentModel =
qobject_cast<QHelpContentModel*>(m_contentWidget->model()); qobject_cast<QHelpContentModel*>(m_contentWidget->model());
connect(contentModel, SIGNAL(contentsCreated()), this, SLOT(expandTOC())); connect(contentModel, SIGNAL(contentsCreated()), this, SLOT(expandTOC()));
m_contentWidget->setFrameStyle(QFrame::NoFrame);
} }
ContentWindow::~ContentWindow() ContentWindow::~ContentWindow()

View File

@@ -34,6 +34,9 @@
#include "openpagesmanager.h" #include "openpagesmanager.h"
#include "topicchooser.h" #include "topicchooser.h"
#include <utils/filterlineedit.h>
#include <utils/styledbar.h>
#include <QtGui/QLayout> #include <QtGui/QLayout>
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
@@ -41,6 +44,7 @@
#include <QtGui/QMenu> #include <QtGui/QMenu>
#include <QtGui/QContextMenuEvent> #include <QtGui/QContextMenuEvent>
#include <QtGui/QListWidgetItem> #include <QtGui/QListWidgetItem>
#include <QtGui/QToolBar>
#include <QtHelp/QHelpEngine> #include <QtHelp/QHelpEngine>
#include <QtHelp/QHelpIndexWidget> #include <QtHelp/QHelpIndexWidget>
@@ -52,17 +56,29 @@ IndexWindow::IndexWindow()
, m_indexWidget(0) , m_indexWidget(0)
{ {
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
QLabel *l = new QLabel(tr("&Look for:"));
layout->addWidget(l);
m_searchLineEdit = new QLineEdit(); m_searchLineEdit = new Utils::FilterLineEdit();
l->setBuddy(m_searchLineEdit); m_searchLineEdit->setPlaceholderText(QString());
setFocusProxy(m_searchLineEdit); setFocusProxy(m_searchLineEdit);
connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this,
SLOT(filterIndices(QString))); SLOT(filterIndices(QString)));
m_searchLineEdit->installEventFilter(this); m_searchLineEdit->installEventFilter(this);
layout->setMargin(4);
layout->addWidget(m_searchLineEdit); QLabel *l = new QLabel(tr("&Look for:"));
l->setBuddy(m_searchLineEdit);
layout->addWidget(l);
layout->setMargin(0);
layout->setSpacing(0);
Utils::StyledBar *toolbar = new Utils::StyledBar(this);
toolbar->setSingleRow(false);
QLayout *tbLayout = new QHBoxLayout();
tbLayout->setSpacing(6);
tbLayout->setMargin(4);
tbLayout->addWidget(l);
tbLayout->addWidget(m_searchLineEdit);
toolbar->setLayout(tbLayout);
layout->addWidget(toolbar);
QHelpEngine *engine = &Help::HelpManager::helpEngine(); QHelpEngine *engine = &Help::HelpManager::helpEngine();
m_indexWidget = engine->indexWidget(); m_indexWidget = engine->indexWidget();
@@ -77,6 +93,7 @@ IndexWindow::IndexWindow()
this, SIGNAL(linksActivated(QMap<QString, QUrl>, QString))); this, SIGNAL(linksActivated(QMap<QString, QUrl>, QString)));
connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget, connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget,
SLOT(activateCurrentItem())); SLOT(activateCurrentItem()));
m_indexWidget->setFrameStyle(QFrame::NoFrame);
layout->addWidget(m_indexWidget); layout->addWidget(m_indexWidget);
m_indexWidget->viewport()->installEventFilter(this); m_indexWidget->viewport()->installEventFilter(this);

View File

@@ -61,7 +61,8 @@ QrcEditor::QrcEditor(QWidget *parent)
connect(m_treeview, SIGNAL(addPrefixTriggered()), this, SLOT(onAddPrefix())); connect(m_treeview, SIGNAL(addPrefixTriggered()), this, SLOT(onAddPrefix()));
connect(m_treeview, SIGNAL(addFilesTriggered(QString)), this, SLOT(onAddFiles())); connect(m_treeview, SIGNAL(addFilesTriggered(QString)), this, SLOT(onAddFiles()));
connect(m_treeview, SIGNAL(removeItem()), this, SLOT(onRemove())); connect(m_treeview, SIGNAL(removeItem()), this, SLOT(onRemove()));
connect(m_treeview, SIGNAL(currentIndexChanged()), this, SLOT(updateCurrent())); connect(m_treeview->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
this, SLOT(updateCurrent()));
connect(m_treeview, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool))); connect(m_treeview, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool)));
m_treeview->setFocus(); m_treeview->setFocus();

View File

@@ -203,13 +203,6 @@ ResourceView::~ResourceView()
{ {
} }
void ResourceView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
Q_UNUSED(current)
Q_UNUSED(previous)
emit currentIndexChanged();
}
bool ResourceView::isDirty() const bool ResourceView::isDirty() const
{ {
return m_qrcModel->dirty(); return m_qrcModel->dirty();

View File

@@ -139,14 +139,10 @@ protected:
signals: signals:
void removeItem(); void removeItem();
void dirtyChanged(bool b); void dirtyChanged(bool b);
void currentIndexChanged();
void addFilesTriggered(const QString &prefix); void addFilesTriggered(const QString &prefix);
void addPrefixTriggered(); void addPrefixTriggered();
protected slots:
void currentChanged(const QModelIndex &current, const QModelIndex &previous);
private slots: private slots:
void onEditAlias(); void onEditAlias();
void onEditPrefix(); void onEditPrefix();

View File

@@ -353,8 +353,22 @@ void Launcher::handleResult(const TrkResult &result)
QByteArray prefix = "READ BUF: "; QByteArray prefix = "READ BUF: ";
QByteArray str = result.toString().toUtf8(); QByteArray str = result.toString().toUtf8();
if (result.isDebugOutput) { // handle application output if (result.isDebugOutput) { // handle application output
QString msg;
if (result.multiplex == MuxTextTrace) {
if (result.data.length() > 8) {
quint64 timestamp = extractInt64(result.data) & 0x0FFFFFFFFFFFFFFFULL;
quint64 secs = timestamp / 1000000000;
quint64 ns = timestamp % 1000000000;
msg = QString("[%1.%2] %3").arg(secs).arg(ns).arg(QString(result.data.mid(8)));
logMessage("TEXT TRACE: " + msg);
}
} else {
logMessage("APPLICATION OUTPUT: " + result.data); logMessage("APPLICATION OUTPUT: " + result.data);
emit applicationOutputReceived(result.data); msg = result.data;
}
msg.replace("\r\n", "\n");
if(!msg.endsWith('\n')) msg.append('\n');
emit applicationOutputReceived(msg);
return; return;
} }
switch (result.code) { switch (result.code) {

View File

@@ -264,14 +264,13 @@ QByteArray frameMessage(byte command, byte token, const QByteArray &data, bool s
/* returns 0 if array doesn't represent a result, /* returns 0 if array doesn't represent a result,
otherwise returns the length of the result data */ otherwise returns the length of the result data */
ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame) ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame, ushort& mux)
{ {
if (serialFrame) { if (serialFrame) {
// Serial protocol with length info // Serial protocol with length info
if (buffer.length() < 4) if (buffer.length() < 4)
return 0; return 0;
if (buffer.at(0) != 0x01 || byte(buffer.at(1)) != 0x90) mux = extractShort(buffer.data());
return 0;
const ushort len = extractShort(buffer.data() + 2); const ushort len = extractShort(buffer.data() + 2);
return (buffer.size() >= len + 4) ? len : ushort(0); return (buffer.size() >= len + 4) ? len : ushort(0);
} }
@@ -280,6 +279,7 @@ ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame)
const int firstDelimiterPos = buffer.indexOf(delimiter); const int firstDelimiterPos = buffer.indexOf(delimiter);
// Regular message delimited by 0x7e..0x7e // Regular message delimited by 0x7e..0x7e
if (firstDelimiterPos == 0) { if (firstDelimiterPos == 0) {
mux = MuxTrk;
const int endPos = buffer.indexOf(delimiter, firstDelimiterPos + 1); const int endPos = buffer.indexOf(delimiter, firstDelimiterPos + 1);
return endPos != -1 ? endPos + 1 - firstDelimiterPos : 0; return endPos != -1 ? endPos + 1 - firstDelimiterPos : 0;
} }
@@ -292,7 +292,7 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt
result->clear(); result->clear();
if(rawData) if(rawData)
rawData->clear(); rawData->clear();
const ushort len = isValidTrkResult(*buffer, serialFrame); const ushort len = isValidTrkResult(*buffer, serialFrame, result->multiplex);
if (!len) if (!len)
return false; return false;
// handle receiving application output, which is not a regular command // handle receiving application output, which is not a regular command
@@ -300,7 +300,6 @@ bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *result, QByt
if (buffer->at(delimiterPos) != 0x7e) { if (buffer->at(delimiterPos) != 0x7e) {
result->isDebugOutput = true; result->isDebugOutput = true;
result->data = buffer->mid(delimiterPos, len); result->data = buffer->mid(delimiterPos, len);
result->data.replace("\r\n", "\n");
*buffer->remove(0, delimiterPos + len); *buffer->remove(0, delimiterPos + len);
return true; return true;
} }
@@ -341,6 +340,19 @@ SYMBIANUTILS_EXPORT uint extractInt(const char *data)
return res; return res;
} }
SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data)
{
quint64 res = byte(data[0]);
res <<= 8; res += byte(data[1]);
res <<= 8; res += byte(data[2]);
res <<= 8; res += byte(data[3]);
res <<= 8; res += byte(data[4]);
res <<= 8; res += byte(data[5]);
res <<= 8; res += byte(data[6]);
res <<= 8; res += byte(data[7]);
return res;
}
SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba) SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba)
{ {
QString res; QString res;

View File

@@ -123,9 +123,16 @@ enum Command {
TrkDSPositionFile = 0xd4 TrkDSPositionFile = 0xd4
}; };
enum SerialMultiplexor {
MuxRaw = 0,
MuxTextTrace = 0x0102,
MuxTrk = 0x0190
};
inline byte extractByte(const char *data) { return *data; } inline byte extractByte(const char *data) { return *data; }
SYMBIANUTILS_EXPORT ushort extractShort(const char *data); SYMBIANUTILS_EXPORT ushort extractShort(const char *data);
SYMBIANUTILS_EXPORT uint extractInt(const char *data); SYMBIANUTILS_EXPORT uint extractInt(const char *data);
SYMBIANUTILS_EXPORT quint64 extractInt64(const char *data);
SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba); SYMBIANUTILS_EXPORT QString quoteUnprintableLatin1(const QByteArray &ba);
@@ -205,6 +212,7 @@ struct SYMBIANUTILS_EXPORT TrkResult
int errorCode() const; int errorCode() const;
QString errorString() const; QString errorString() const;
ushort multiplex;
byte code; byte code;
byte token; byte token;
QByteArray data; QByteArray data;