diff --git a/dist/changes-2.0.0 b/dist/changes-2.0.0 index 81e4b826674..1a9ab1cbbc9 100644 --- a/dist/changes-2.0.0 +++ b/dist/changes-2.0.0 @@ -57,9 +57,21 @@ Project support directory Debugging - * CDB: Fixed bug in location marker - * CDB: Fixed handling of mixed-case file names correctly by normalizing file + * Add on-device debugging for the Symbian platform using gdb + * Add on-device debugging for the Maemo platform using gdb + * gdb: Replace compiled "debugging helpers" by Python based ones + (except on Mac) + * New debugging helpers for QUrl, QAtomicInt, __gnu_ext::hash_map and more + * Additional features for breakpoint, disassembler output, stack, + registers and watchers views + * Improve variable tooltip handling + * gdb: Support reverse execution where available + * gdb: Added mixed disassembler/source output whenever possible + * cdb: Fixed bug in location marker + * cdb: Fixed handling of mixed-case file names correctly by normalizing file names + * pdb: Added some basic debugging for Python scripts based on pdb + * Improvements in the dialogs, status messages, and general appearance Help diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 10e85dfe246..046c1c1a305 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -51,7 +51,7 @@ - Attach to Process ID: + Attach to process ID: Prozess-Id: @@ -96,7 +96,7 @@ Neuer Ordner - + @@ -118,7 +118,7 @@ BookmarkManager - + Bookmarks Lesezeichen @@ -142,7 +142,7 @@ BookmarkWidget - + Delete Folder Ordner löschen @@ -172,12 +172,7 @@ Lesezeichen umbenennen - - Filter: - Filter: - - - + Add Hinzufügen @@ -271,12 +266,12 @@ - Previous Bookmark In Document + Previous Bookmark in Document Vorhergehendes Lesezeichen im Dokument - Next Bookmark In Document + Next Bookmark in Document Nächstes Lesezeichen im Dokument @@ -349,7 +344,7 @@ - Select the working directory + Select Working Directory Wählen Sie das Arbeitsverzeichnis aus @@ -862,10 +857,14 @@ CVS::Internal::CheckoutWizard + + Checks out a project from a CVS repository and tries to load the contained project. + Holt ein Projekt aus einem CVS-Repository und versucht, das darin enthaltene Projekt zu laden. + - Checks out a project from a CVS repository. - Holt ein Projekt aus einem CVS-Repository. + Checks out a CVS repository and tries to load the contained project. + Erstellt einen Checkout eines CVS-Repositories und versucht, das darin enthaltene Projekt zu laden. @@ -893,11 +892,6 @@ CVS::Internal::SettingsPage - - - When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed. - Wenn die Option aktiviert ist, werden beim Klick auf die Revisionsnummer in der Annotationsansicht alle Dateien angezeigt, die zu einer Abgabe gehören (mittels Commit-Id bestimmt). Ansonsten wird nur die betreffende Datei angezeigt. - CVS @@ -948,6 +942,11 @@ Diff options: Optionen für Diff: + + + When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. + Wenn die Option aktiviert ist, werden beim Klick auf die Revisionsnummer in der Annotationsansicht alle Dateien angezeigt, die zu einer Abgabe gehören (mittels Commit-Id bestimmt). Ansonsten wird nur die betreffende Datei angezeigt. + CVS::Internal::SettingsPageWidget @@ -972,12 +971,6 @@ These options take effect at the next start of Qt Creator. Die Einstellungen werden beim nächsten Start von Qt Creator wirksam. - - - Cdb - Placeholder - Cdb - Debugger Paths @@ -1016,12 +1009,18 @@ - Other options - Weiter Optionen: + CDB + Placeholder + CDB - Verbose Symbol Loading + Other Options + Weiter Optionen + + + + Verbose symbol loading Ausführliche Meldungen beim Laden der Symbole @@ -1047,11 +1046,6 @@ ChangeSelectionDialog - Repository Location: - Repository: - - - Select Auswählen @@ -1060,6 +1054,11 @@ Change: Änderung: + + + Repository location: + Repository: + CodePaster::CodePasterProtocol @@ -1170,16 +1169,6 @@ Username: Nutzername: - - - Copy Paste URL to clipboard - Kopiere den URL in die Zwischenablage - - - - Display Output Pane after sending a post - Ausgabepanel nach Senden anzeigen - General @@ -1190,6 +1179,16 @@ Default protocol: Vorgabeprotokoll: + + + Display Output pane after sending a post + Ausgabepanel nach Senden anzeigen + + + + Copy-paste URL to clipboard + Kopiere den URL in die Zwischenablage + CommonOptionsPage @@ -1245,13 +1244,13 @@ - Use Creator for post-mortem debugging - Qt Creator als Post-Mortem-Debugger verwenden + GUI Behavior + Verhalten - Gui behavior - Verhalten + Use Qt Creator for post-mortem debugging + Qt Creator als Post-Mortem-Debugger verwenden @@ -1298,19 +1297,19 @@ - First letter - Erster Buchstabe + Insert &space after function name + Leerzeichen nach &Funktionsname einfügen - Insert &space after function name - Leerzeichen nach &Funktionsname einfügen + First Letter + Erster Buchstabe ContentWindow - + Open Link Adresse öffnen @@ -1391,30 +1390,31 @@ Sollen sie überschrieben werden? Core::EditorManager - - + + Revert to Saved Wiederherstellen - + + Close Schließen - + Close All Alle schließen - + Close Others Andere schließen - + Open in External Editor Öffne in externem Editor @@ -1424,17 +1424,17 @@ Sollen sie überschrieben werden? Gespeicherten Stand wiederherstellen - + Ctrl+F4 Ctrl+F4 - + Ctrl+W Ctrl+W - + Ctrl+Shift+W Ctrl+Shift+W @@ -1509,12 +1509,12 @@ Sollen sie überschrieben werden? Alle Teilungen aufheben - + Save %1 &As... Speichere '%1' &unter... - + &Advanced &Weitere @@ -1524,7 +1524,7 @@ Sollen sie überschrieben werden? Alt+V,Alt+I - + All Files (*) Alle Dateien (*) @@ -1587,7 +1587,7 @@ Sollen sie überschrieben werden? Schreibbar machen - + Next Open Document in History Nächstes geöffnetes Dokument im Verlauf @@ -1609,7 +1609,7 @@ Sollen sie überschrieben werden? Nächstes - + %1,2 %1,2 @@ -1639,7 +1639,7 @@ Sollen sie überschrieben werden? %1,o - + &Save %1 &Speichere %1 @@ -1715,7 +1715,7 @@ Sollen sie überschrieben werden? Core::Internal::ComboBox - + Activate %1 Aktiviere %1 @@ -1872,16 +1872,6 @@ Sollen sie überschrieben werden? When files are externally modified: Wenn externe Änderungen an Dateien festgestellt werden: - - - Always ask - Stets fragen - - - - Ignore modifications - Änderungen ignorieren - External file browser: @@ -1909,13 +1899,23 @@ Sollen sie überschrieben werden? - Reload all unchanged editors + Default file encoding: + Vorgabe-Encoding: + + + + Always Ask + Stets fragen + + + + Reload All Unchanged Editors Alle Dateien in ungeänderten Editoren neu laden - Default file encoding: - Vorgabe-Encoding: + Ignore Modifications + Änderungen ignorieren @@ -2402,7 +2402,7 @@ Sollen sie überschrieben werden? Core::Internal::SideBarWidget - + Split Teilen @@ -2420,23 +2420,24 @@ Sollen sie überschrieben werden? Über Qt Creator - + + (%1) + (%1) + + + From revision %1<br/> This gets conditionally inserted as argument %8 into the description string. Revision %1<br/> - <h3>Qt Creator %1</h3>Based on Qt %2 (%3 bit)<br/><br/>Built on %4 at %5<br /><br/>%8<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> + <h3>Qt Creator %1 %8</h3>Based on Qt %2 (%3 bit)<br/><br/>Built on %4 at %5<br /><br/>%9<br/>Copyright 2008-%6 %7. All rights reserved.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> <h3>Qt Creator %1</h3>Basierend auf Qt %2 (%3 bit)<br/><br/>Erstellt am %4 um %5<br /><br/>%8<br/>Copyright 2008-%6 %7. Alle Rechte vorbehalten.<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> Core::ModeManager - - Switch to %1 mode - Gehe zu Mode '%1' - Switch to <b>%1</b> mode @@ -2545,14 +2546,14 @@ Sollen sie überschrieben werden? C++ Header-Datei - - Creates a C++ header file. - Erzeugt eine neue C++-Header-Datei. + + Creates a C++ header and a source file for a new class that you can add to a C++ project. + Erstellt C++-Header- und Quelldateien für eine neue Klasse eines C++-Projekts. - - Creates a C++ source file. - Erzeugt eine neue C++-Quelldatei + + Creates a C++ source file that you can add to a C++ project. + Erstellt eine C++-Quelldatei für ein C++-Projekt. @@ -2560,7 +2561,12 @@ Sollen sie überschrieben werden? C++-Quelldatei - + + Creates a C++ header file that you can add to a C++ project. + Erstellt eine C++-Header-Datei für ein C++-Projekt. + + + Follow Symbol Under Cursor Symbol unter Einfügemarke verfolgen @@ -2575,17 +2581,17 @@ Sollen sie überschrieben werden? Symbol unter Einfügemarke umbenennen - + + Update Code Model + Code-Modell aktualisieren + + + C++ Class C++-Klasse - - Creates a header and a source file for a new class. - Erzeugt C++-Header- und Quelldatei für eine neue Klasse - - - + Find Usages Verwendung suchen @@ -2594,11 +2600,6 @@ Sollen sie überschrieben werden? Ctrl+Shift+U Ctrl+Shift+U - - - Update code model - Code-Modell aktualisieren - CppFileSettingsPage @@ -2694,7 +2695,7 @@ Sollen sie überschrieben werden? - Choose a location for the new license template file + Choose Location for New License Template File Dateiname für eine neue Lizenzvorlage @@ -2749,7 +2750,7 @@ Sollen sie überschrieben werden? CppTools::Internal::CppToolsPlugin - + &C++ &C++ @@ -2762,7 +2763,7 @@ Sollen sie überschrieben werden? CppTools::Internal::FunctionArgumentWidget - + %1 of %2 %1 von %2 @@ -5334,11 +5335,6 @@ Möchten Sie den zu debuggenden Prozess anhalten und den gewählten Snapshot lad Use code model Code-Modell verwenden - - - Use debugging helper - Ausgabe-Hilfsbibliothek benutzen - <html><head/><body> @@ -5348,6 +5344,11 @@ Möchten Sie den zu debuggenden Prozess anhalten und den gewählten Snapshot lad Die Ausgabe-Hilfsbibliothek dient lediglich zur formatierten Ausgabe von Objekten bestimmten Typs wie QString oder std::map im Fenster "Lokale Variablen und überwachte Ausdrücke".</p> <p>Zum Debuggen mit Qt Creator ist sie jedoch nicht unbedingt erforderlich. </p></body></html> + + + Use Debugging Helper + Ausgabe-Hilfsbibliothek benutzen + DependenciesModel @@ -5444,11 +5445,6 @@ Versuchen Sie, das Projekt neu zu erstellen. Aggregation Aggregation - - - Multiple Inheritance - Mehrfachvererbung - Code Generation @@ -5464,6 +5460,11 @@ Versuchen Sie, das Projekt neu zu erstellen. Use Qt module name in #include-directive Qt-Modulnamen in #include-Direktive verwenden + + + Multiple inheritance + Mehrfachvererbung + Designer::Internal::FormClassWizardDialog @@ -5515,13 +5516,13 @@ Versuchen Sie, das Projekt neu zu erstellen. - Creates a Qt Designer form file (.ui). - Erstellt eine Qt Designer-Formular-Datei (.ui). + 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. + Erstellt eine Qt Designer-Formular-Datei mit zugehörigem Klassenrumpf (bestehend aus C++-Header- und Quelldatei) für ein existierendes C++-Projekt. - - Creates a Qt Designer form file (.ui) with a matching class. - Erstellt eine Qt Designer-Formular-Datei (.ui) mit zugehörigem Klassenrumpf. + + 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. + Erstellt eine Qt Designer-Formular-Datei für ein C++-Projekt. Verwenden Sie diese Vorlage, wenn bereits Geschäftslogik existiert. @@ -5560,37 +5561,17 @@ Versuchen Sie, das Projekt neu zu erstellen. For&mulareditor - - Edit widgets - Widgets bearbeiten - - - + F3 F3 - - Edit signals/slots - Signale und Slots bearbeiten - - - + F4 F4 - - Edit buddies - Buddies bearbeiten - - - - Edit tab order - Tabulatorreihenfolge bearbeiten - - - + Meta+H Meta+H @@ -5641,7 +5622,27 @@ Versuchen Sie, das Projekt neu zu erstellen. Widget-Box - + + Edit Widgets + Widgets bearbeiten + + + + Edit Signals/Slots + Signale und Slots bearbeiten + + + + Edit Buddies + Buddies bearbeiten + + + + Edit Tab Order + Tabulatorreihenfolge bearbeiten + + + Ctrl+Alt+R Ctrl+Alt+R @@ -5837,7 +5838,7 @@ Versuchen Sie, das Projekt neu zu erstellen. ExtensionSystem::Internal::PluginSpecPrivate - + File does not exist: %1 Die Datei '%1' existiert nicht. @@ -5961,7 +5962,7 @@ Versuchen Sie, das Projekt neu zu erstellen. ExtensionSystem::PluginManager - + Circular dependency detected: Zirkuläre Abhängigkeit festgestellt: @@ -5997,7 +5998,7 @@ Grund: %3 FakeVim::Internal - Use vim-style editing + Use Vim-style Editing Vim benutzen @@ -6189,21 +6190,6 @@ Grund: %3 Backspace: Rücktaste: - - - Copy text editor settings - Texteditor-Einstellungen - - - - Set Qt style - Qt-Stil setzen - - - - Set plain style - Einfachen Stil setzen - Use FakeVim @@ -6264,6 +6250,21 @@ Grund: %3 Keyword characters: + + + Copy Text Editor Settings + Texteditor-Einstellungen übernehmen + + + + Set Qt Style + Qt-Stil setzen + + + + Set Plain Style + Einfachen Stil setzen + FilterNameDialogClass @@ -6498,11 +6499,6 @@ Add, modify, and remove document filters, which determine the documentation set Gdb startup script: Gdb-Startskript: - - - Behaviour of breakpoint setting in plugins - Setzen von Haltepunkten in Plugins - This is the slowest but safest option. @@ -6581,6 +6577,11 @@ on slow machines. In this case, the value should be increased. Show a message box when receiving a signal Empfang eines Signals durch Dialogbox anzeigen + + + Behavior of Breakpoint Setting in Plugins + Setzen von Haltepunkten in Plugins + GeneralSettingsPage @@ -6619,41 +6620,11 @@ on slow machines. In this case, the value should be increased. On context help: Kontexthilfe: - - - Show side-by-side if possible - Möglichst nebeneinander zeigen - - - - Always show side-by-side - Immer nebeneinander zeigen - - - - Always start full help - Stets Vollbild - On help start: Zu Beginn: - - - Show my home page - Startseite zeigen - - - - Show a blank page - Leere Seite zeigen - - - - Show my tabs from last session - Reiter aus letzter Sitzung zeigen - Use &Current Page @@ -6689,6 +6660,36 @@ on slow machines. In this case, the value should be increased. Home page: Startseite: + + + Show Side-by-Side if Possible + Möglichst nebeneinander zeigen + + + + Always Show Side-by-Side + Immer nebeneinander zeigen + + + + Always Start Full Help + Stets Vollbild + + + + Show My Home Page + Startseite zeigen + + + + Show a Blank Page + Leere Seite zeigen + + + + Show My Tabs from Last Session + Reiter aus letzter Sitzung zeigen + GenericMakeStep @@ -6777,8 +6778,8 @@ on slow machines. In this case, the value should be increased. - Creates a generic project, supporting any build system. - Erstellt ein generisches Projekt, was ein beliebiges Build-System unterstützt. + Imports existing projects that do not use qmake or CMake. This allows you to use Qt Creator as a code editor. + Importiert bereits existierende Projekte, die weder qmake noch CMake verwenden. Dadurch kann Qt Creator als Code-Editor benutzt werden. @@ -6901,7 +6902,7 @@ on slow machines. In this case, the value should be increased. - Remote branches + Remote Branches Nichtlokale Branches @@ -6909,12 +6910,12 @@ on slow machines. In this case, the value should be increased. Git::Internal::ChangeSelectionDialog - Select a Git commit + Select a Git Commit Wählen Sie einen Commit aus - Select Git repository + Select Git Repository Wählen ein Git-Repository aus @@ -6930,10 +6931,14 @@ on slow machines. In this case, the value should be increased. Git::Internal::CloneWizard + + Clones a project from a Git repository and tries to load the contained project. + Holt ein Projekt aus einem Git-Repository und versucht, es zu laden. + - Clones a project from a git repository. - Erstellt einen Clone eines Projektes aus einem Git-Repository. + Clones a Git repository and tries to load the contained project. + Erstellt einen Clone eines Git-Repositories und versucht, das darin enthaltene Projekt zu laden. @@ -7076,13 +7081,13 @@ on slow machines. In this case, the value should be increased. - Stash description - Beschreibung + Description: + Beschreibung: - Description: - Beschreibung: + Stash Description + Beschreibung @@ -7331,7 +7336,12 @@ on slow machines. In this case, the value should be increased. Diff für Projekt "%1" - + + Stash Snapshot... + Snapshot als Stash speichern... + + + Stashes... Stashes... @@ -7422,12 +7432,7 @@ on slow machines. In this case, the value should be increased. Repository bereinigen... - - Stash snapshot... - Snapshot als Stash speichern... - - - + Saves the current state of your work and resets the repository. Speichert den gegenwärtigen Stand der Arbeit und setzt das Repository zurück. @@ -7653,19 +7658,9 @@ on slow machines. In this case, the value should be increased. - Environment variables - Umgebungsvariablen - - - PATH: Pfad-Variable: - - - From system - Vom System - <b>Note:</b> @@ -7726,6 +7721,16 @@ on slow machines. In this case, the value should be increased. Pull with rebase pull mit rebase + + + Environment Variables + Umgebungsvariablen + + + + From System + Vom System + GitCommand @@ -7768,10 +7773,14 @@ on slow machines. In this case, the value should be increased. Gitorious::Internal::GitoriousCloneWizard + + Clones a project from a Gitorious repository and tries to load the contained project. + Holt ein Projekt aus einem Gitorious-Repository und versucht, das darin enthaltene Projekt zu laden. + - Clones a project from a Gitorious repository. - Erstellt einen Clone eines Projektes aus einem Gitorious-Repository. + Clones a Gitorious repository and tries to load the contained project. + Erstellt einen Clone eines Gitorious-Repositories und versucht, das darin enthaltene Projekt zu laden. @@ -8003,7 +8012,7 @@ on slow machines. In this case, the value should be increased. Help::Internal::GeneralSettingsPage - General settings + General Settings Allgemeine Einstellungen @@ -8266,12 +8275,12 @@ on slow machines. In this case, the value should be increased. IndexWindow - + &Look for: &Suche nach: - + Open Link Adresse öffnen @@ -8895,7 +8904,7 @@ on slow machines. In this case, the value should be increased. OpenWith::Editors - + Plain Text Editor Texteditor @@ -8967,17 +8976,17 @@ on slow machines. In this case, the value should be increased. - <html><head/><body> -<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.</p> -<p>Note that the plugin will use this for posting as well as fetching.</p></body></html> - <html><head/><body> -<p><a href="http://pastebin.com">pastebin.com</a> erlaubt das Senden an benutzerdefinierte Subdomänen (zum Beispiel qtcreator.pastebin.com). Geben Sie den gewünschten Präfix an.</p> -<p>Hinweis: Es wird sowohl zum Senden als auch zum Abholen verwendet.</p></body></html> + Server prefix: + Server-Präfix: - Server prefix: - Server-Präfix: + <html><head/><body> +<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix.</p> +<p>Note that the plugin will use this for posting as well as fetching.</p></body></html> + <html><head/><body> +<p><a href="http://pastebin.com">pastebin.com</a> erlaubt das Senden an benutzerdefinierte Subdomänen (zum Beispiel creator.pastebin.com). Geben Sie den gewünschten Präfix an.</p> +<p>Hinweis: Es wird sowohl zum Senden als auch zum Abholen verwendet.</p></body></html> @@ -9450,11 +9459,6 @@ on slow machines. In this case, the value should be increased. Perforce::Internal::SettingsPage - - - Environment variables - Umgebungsvariablen - Perforce @@ -9515,6 +9519,11 @@ on slow machines. In this case, the value should be increased. P4 port: P4 Port-Nummer: + + + Environment Variables + Umgebungsvariablen + Perforce::Internal::SettingsPageWidget @@ -10004,17 +10013,17 @@ Fehler: %2 Erstellungsschritte - - Edit Build Configuration: - Build-Konfiguration bearbeiten: - - - - No Build Settings available + + No build settings available Es sind keine Build-Einstellungen verfügbar - + + Edit build configuration: + Build-Konfiguration bearbeiten: + + + Add Hinzufügen @@ -10073,13 +10082,13 @@ Fehler: %2 - Add build step - Build-Schritt hinzufügen + Add Clean Step + Schritt zur Bereinigung hinzufügen - Add clean step - Schritt zur Bereinigung hinzufügen + Add Build Step + Build-Schritt hinzufügen @@ -10340,19 +10349,19 @@ Fehler: %2 - Working Directory: + Enable custom process step + Benutzerdefinierten Verarbeitungsschritt aktivieren + + + + Working directory: Arbeitsverzeichnis: - Command Arguments: + Command arguments: Kommandozeilenargumente: - - - Enable Custom Process Step - Benutzerdefinierten Verarbeitungsschritt aktivieren - ProjectExplorer::Internal::ProjectExplorerSettingsPage @@ -10523,10 +10532,6 @@ No project selected %1 (current session) %1 (aktuelle Sitzung) - - Open Project - Projekt öffnen - New Project @@ -11150,16 +11155,6 @@ unter Versionsverwaltung (%2) gestellt werden? QMakeStep - debug - debug - - - - release - release - - - Additional arguments: Zusätzliche Argumente: @@ -11170,8 +11165,18 @@ unter Versionsverwaltung (%2) gestellt werden? - qmake Build Configuration: - qmake Build-Konfiguration:' + qmake build configuration: + qmake Build-Konfiguration: + + + + Debug + Debug + + + + Release + Release @@ -11464,8 +11469,12 @@ unter Versionsverwaltung (%2) gestellt werden? - Creates a Qt console application. - Erstellt eine Qt Konsolenanwendung. + Creates a project containing a single main.cpp file with a stub implementation. + +Preselects a desktop Qt for building the application if available. + Erstellt ein Projekt welches aus einer main.cpp-Datei mit einem Implementationsrumpf besteht. + +Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist. @@ -11605,8 +11614,8 @@ unter Versionsverwaltung (%2) gestellt werden? - Creates an empty Qt project. - Erstellt ein leeres Qt-Projekt. + Creates a qmake-based project without any files. This allows you to create an application without any default classes. + Erstellt ein auf qmake basierendes Qt-Projekt ohne Dateien und vorgegebene Klassen. @@ -11858,11 +11867,15 @@ unter Versionsverwaltung (%2) gestellt werden? - Creates a Qt Gui Application with one form. - Erstellt eine Qt-Gui-Anwendung mit einem Formular. + Creates a Qt application for the desktop. Includes a Qt Designer-based main window. + +Preselects a desktop Qt for building the application if available. + Erstellt eine Qt-Anwendung für den Desktop mit einem Qt Designer-basierten Hauptfenster. + +Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist. - + The template file '%1' could not be opened for reading: %2 Die Vorgabendatei '%1' konnte nicht zum Lesen geöffnet werden: %2 @@ -11889,8 +11902,8 @@ unter Versionsverwaltung (%2) gestellt werden? - Creates a Qt based C++ Library. - Erstellt eine Qt-basierte C++-Bibliothek. + 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>. + Erstellt qmake-basierte C++-Bibliotheken:<ul><li>Dynamisch linkbare C++-Bibliothek zur Verwendung mit <tt>QPluginLoader</tt> zur Laufzeit (Plugin)</li><li>Statisch oder dynamisch linkbare C++-Bibliothek zur Verwendung in einem anderen Projekt zur Linkzeit</li></ul>. @@ -12053,31 +12066,6 @@ unter Versionsverwaltung (%2) gestellt werden? Qt4ProjectManager::Internal::Qt4ProjectConfigWidget - Configuration Name: - Name der Konfiguration: - - - - Qt Version: - Qt-Version: - - - - This Qt-Version is invalid. - Diese Qt-Version ist ungültig. - - - - Shadow Build: - Shadow-Build: - - - - Build Directory: - Build-Verzeichnis: - - - <a href="import">Import existing build</a> <a href="import">Existierenden Build importieren</a> @@ -12124,13 +12112,38 @@ unter Versionsverwaltung (%2) gestellt werden? - Tool Chain: + problemLabel + problemLabel + + + + Configuration name: + Name der Konfiguration: + + + + Qt version: + Qt-Version: + + + + This Qt version is invalid. + Diese Qt-Version ist ungültig. + + + + Tool chain: Toolchain: - problemLabel - problemLabel + Shadow build: + Shadow-Build: + + + + Build directory: + Build-Verzeichnis: @@ -12188,8 +12201,18 @@ unter Versionsverwaltung (%2) gestellt werden? Argumente: - - Run in Terminal + + Select Working Directory + Wählen Sie das Arbeitsverzeichnis aus + + + + Working directory: + Arbeitsverzeichnis: + + + + Run in terminal In Terminal ausführen @@ -12228,22 +12251,12 @@ unter Versionsverwaltung (%2) gestellt werden? Ausführbare Datei: - - Select the working directory - Wählen Sie das Arbeitsverzeichnis aus - - - + Reset to default Zurücksetzen - - Working Directory: - Arbeitsverzeichnis: - - - + Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug) Debug-Version von Frameworks verwenden (DYLD_IMAGE_SUFFIX=_debug) @@ -12496,12 +12509,12 @@ p, li { white-space: pre-wrap; } - Install File: + Installation file: Installationspaket: - Device on Serial Port: + Device on serial port: Gerät auf serieller Schnittstelle: @@ -12630,12 +12643,7 @@ Installiere Anwendung auf '%2'... Es konnte keine Verbindung zu App TRK über den Port '%1' hergestellt werden. Bitte versuchen Sie, App TRK neu zu starten. - - Copying install file... - Kopiere Installationspaket... - - - + The device '%1' has been disconnected Das Gerät '%1' wurde entfernt @@ -12645,7 +12653,12 @@ Installiere Anwendung auf '%2'... Installiere Anwendung... - + + Copying installation file... + Kopiere Installationspaket... + + + Waiting for App TRK Warte auf App TRK @@ -13010,8 +13023,8 @@ Installiere Anwendung auf '%2'... - Choose a directory to add - Bitte wählen Sie das hinzuzufügende Verzeichnis + Select Directory + Arbeitsordner @@ -13039,11 +13052,6 @@ Installiere Anwendung auf '%2'... Name: Name: - - - File Types: - Dateitypen: - Specify file name filters, separated by comma. Filters may contain wildcards. @@ -13086,6 +13094,11 @@ To do this, you type this shortcut and a space in the Locator entry field, and t Geben Sie ein Kürzel oder eine Abkürzung ein, die die Funde auf Dateien von diesem Verzeichnis beschränkt. Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeichen und dem Suchbegriff. + + + File types: + Dateitypen: + Locator::Internal::FileSystemFilter @@ -13184,7 +13197,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Locator::Internal::SettingsPage - %1 (Prefix: %2) + %1 (prefix: %2) %1 (Präfix: %2) @@ -13328,8 +13341,8 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich ResourceEditor::Internal::ResourceEditorPlugin - Creates a Qt Resource file (.qrc). - Erzeugt eine neue Qt-Ressource-Datei (.qrc). + Creates a Qt Resource file (.qrc) that you can add to a Qt C++ project. + Erstellt eine C++-Quelldatei für ein C++-Projekt. @@ -13386,7 +13399,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Präfix hinzufügen - + Copy Kopieren @@ -13439,7 +13452,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich SharedTools::ResourceView - + Add Files... Dateien hinzufügen... @@ -13601,10 +13614,14 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Subversion::Internal::CheckoutWizard + + Checks out a project from a Subversion repository and tries to load the contained project. + Holt ein Projekt aus einem Subversion-Repository und versucht, das darin enthaltene Projekt zu laden. + - Checks out a project from a Subversion repository. - Holt ein Projekt aus einem Subversion-Repository. + Checks out a Subversion repository and tries to load the contained project. + Erstellt einen Checkout eines Subversion-Repositories und versucht, das darin enthaltene Projekt zu laden. @@ -13637,11 +13654,6 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Authentication Authentifizierung - - - User name: - Nutzername: - Password: @@ -13692,6 +13704,11 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Subversion command: Subversion-Kommando: + + + Username: + Nutzername: + Subversion::Internal::SettingsPageWidget @@ -14030,7 +14047,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich - Use Regular E&xpressions + Use regular e&xpressions Benutze reguläre Ausdrücke @@ -14050,7 +14067,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich TextEditor::BaseTextEditor - + Print Document Dokument drucken @@ -14068,7 +14085,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich TextEditor::BaseTextEditorEditable - + Line: %1, Col: %2 Zeile: %1, Spalte: %2 @@ -14170,11 +14187,6 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich Always Immer - - - In leading white space - Nur in Leerzeichen am Zeilenanfang - Automatically determine based on the nearest indented line (previous line preferred over next line) @@ -14220,6 +14232,11 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich GNU Style GNU-Stil + + + In Leading White Space + Nur in Leerzeichen am Zeilenanfang + TextEditor::DisplaySettingsPage @@ -14308,7 +14325,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich - Color Scheme name: + Color scheme name: Name des Farbschemas: @@ -14869,7 +14886,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen: TextEditor::TextEditorSettings - + Text Text @@ -15379,13 +15396,13 @@ Die folgenden Encodings scheinen der Datei zu entsprechen: - Choose a directory - Wählen Sie ein Verzeichnis + Choose Directory + Ordner wählen - Choose a file - Wählen Sie eine Datei + Choose File + Datei wählen @@ -15427,7 +15444,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen: - Delete line + Delete Line Zeile löschen @@ -15853,11 +15870,6 @@ Hinweis: Unter Umständen wird die Datei gelöscht. Protocol: Protokoll: - - - Parts to send to server - Zu versendende Ausschnitte - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -15871,6 +15883,11 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">&lt;Kommentar&gt;</span></p></body></html> + + + Parts to Send to Server + Zu versendende Ausschnitte + Welcome::Internal::CommunityWelcomePage @@ -16472,11 +16489,6 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.Email to use by default on commit. Email-Addresse für Abgabe. - - - Default Email: - Vorgabe-Email: - Miscellaneous @@ -16512,6 +16524,11 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.Log count: Log-Anzeige beschränken auf: + + + Default email: + Vorgabe-Email: + Mercurial::Internal::RevertDialog @@ -16591,7 +16608,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. QmlDesigner::ItemLibrary - + Library Title of library view Bibliothek @@ -17531,7 +17548,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. Core - + Qt Qt @@ -17875,8 +17892,8 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.Mercurial::Internal::CloneWizard - Clone a Mercurial repository - Clone eines Mercurial-Repository erstellen + Clones a Mercurial repository and tries to load the contained project. + Erstellt einen Clone eines Mercurial-Repositories und versucht, das darin enthaltene Projekt zu laden. @@ -18642,7 +18659,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. QmlDesigner::NavigatorTreeModel - + Invalid Id Ungültige Id @@ -19003,9 +19020,9 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. QmlJSEditor::Internal::QmlJSEditorPlugin - + Creates a Qt QML file. - Erzeugt eine Qt-QML-Datei. + Erstellt eine Qt-QML-Datei. @@ -19118,7 +19135,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. - Device Configuration: + Device configuration: Geräte-Konfiguration: @@ -19218,12 +19235,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. Qt4ProjectManager::Internal::MaemoSettingsWidget - - Choose public key file - Datei mit öffentlichem Schlüssel - - - + Public Key Files(*.pub);;All Files (*) Öffentliche Schlüssel (*.pub);;Alle Dateien (*) @@ -19233,12 +19245,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.Die öffentliche Schlüsseldatei '%1' konnte nicht gelesen werden. - - Stop deploying - Deployement beenden - - - + Key deployment failed: %1 Das Versenden des Schlüssels schlug fehl: %1 @@ -19260,7 +19267,17 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.New Device Configuration %1 - + + Choose Public Key File + Datei mit öffentlichem Schlüssel + + + + Stop Deploying + Deployement beenden + + + Key was successfully deployed. Der Schlüssel wurde erfolgreich versandt. @@ -19319,7 +19336,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. QtVersion - + No qmake path set Es ist keine qmake-Pfad gesetzt @@ -19353,8 +19370,8 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. - Creates a Qt Unit Test. - Erstellt einen Qt-Unit-Test. + 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. + Erstellt einen auf QTestLib basierenden Unit-Test für eine Funktion oder eine Klasse. Unit-Tests dienen zur Überprüfung der Verwendbarkeit des Codes und der Feststellung von Regressionen. @@ -19400,7 +19417,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen. - Choose repository directory + Choose Repository Directory Ordner für Repository wählen @@ -19879,11 +19896,15 @@ Please check your project settings. - Creates a Qt QML application. - Erstellt eine Qt-QML-Anwendung. + Creates a Qt QML application project with a single QML file containing the main view. + +QML application projects are executed through the QML runtime and do not need to be built. + Erstellt eine Qt-QML-Anwendung aus einer einzelnen QML-Datei, die die Hauptansicht enthält. + +QML-Anwendungen werden durch die QML-Laufzeitumgebung direkt ausgeführt und benötigen keine Compilierung. - + File generated by QtCreator qmlproject Template Comment added to generated .qmlproject file @@ -20178,16 +20199,6 @@ Please check your project settings. Device type: Gerätetyp: - - - Remote Device - Gerät - - - - Local Simulator - Lokaler Simulator - Authentication type: @@ -20203,21 +20214,6 @@ Please check your project settings. Key Schlüssel - - - Host Name: - Hostname: - - - - Connection Timeout: - Zeitlimit der Verbindung: - - - - User Name: - Nutzername: - Password: @@ -20288,6 +20284,31 @@ Please check your project settings. Deploy Public Key ... Öffentlichen Schlüssel senden... + + + Remote device + Gerät + + + + Maemo emulator + Maemo-Emulator + + + + Host name: + Hostname: + + + + Connection timeout: + Zeitlimit der Verbindung: + + + + Username: + Nutzername: + Qt4ProjectManager::Internal::S60CreatePackageStepWidget @@ -20319,11 +20340,6 @@ Please check your project settings. VCSBase::CleanDialog - - - Clean repository - Repository bereinigen - The directory %1 could not be deleted. @@ -20377,6 +20393,11 @@ Please check your project settings. Cleaning %1 Bereinige %1 + + + Clean Repository + Repository bereinigen + ExtensionSystem::PluginDetailsView @@ -20553,7 +20574,7 @@ Please check your project settings. QmlDesigner::Internal::SubComponentManagerPrivate - + QML Components QML-Komponenten @@ -20838,17 +20859,17 @@ Haben Sie Qemu gestartet? Qt4ProjectManager::Internal::S60CreatePackageStep - Create sis Package - Create sis package build step name - sis-Paketdatei erzeugen + Create SIS Package + Create SIS package build step name + SIS-Paketdatei erzeugen Qt4ProjectManager::Internal::S60CreatePackageStepFactory - Create sis Package - Erzeuge sis-Paketdatei + Create SIS Package + SIS-Paketdatei erzeugen @@ -20865,8 +20886,8 @@ Haben Sie Qemu gestartet? - <b>Create sis Package:</b> %1 - <b>Erzeuge sis-Paketdatei:</b> %1 + <b>Create SIS Package:</b> %1 + <b>Erzeuge SIS-Paketdatei:</b> %1 @@ -20900,7 +20921,7 @@ Haben Sie Qemu gestartet? <%1> hat kein gültiges Attribut %2 - + %1: %2 %1: %2 @@ -21437,14 +21458,6 @@ Haben Sie Qemu gestartet? Designer::Internal::FormEditorFactory - - This file can only be edited in Design Mode. - Datei kann nur im Entwurfsmodus bearbeitet werden. - - - Open Designer - Designer öffnen - This file can only be edited in <b>Design</b> mode. @@ -21515,8 +21528,12 @@ Haben Sie Qemu gestartet? - Creates a mobile Qt Gui Application with one form. - Erstellt eine mobile Qt-Gui-Anwendung mit einem Formular. + Creates a Qt application optimized for mobile devices with a Qt Designer-based main window. + +Preselects Qt for Simulator and mobile targets if available + Erstellt eine Qt-Anwendung für mobile Geräte mit einem Qt Designer-basierten Hauptfenster. + +Wählt Qt-Versionen für Simulator und mobile Ziele aus, sofern sie verfügbar sind. @@ -21594,7 +21611,7 @@ Haben Sie Qemu gestartet? - Import existing shadow build... + Import Existing Shadow Build... Importiere existierenden Shadow-Build... @@ -21673,8 +21690,9 @@ Haben Sie Qemu gestartet? - Creates a plug-in for the QML runtime. - Erzeugt ein Plugin für die QML-Laufzeitumgebung. + Creates a C++ plugin to extend the funtionality of the QML runtime. + Creates a plug-in for the QML runtime. + Erstellt ein C++-Plugin zur Erweiterung der Funktionalität der QML-Laufzeitumgebung. @@ -21799,19 +21817,19 @@ Haben Sie Qemu gestartet? - Save public Key... + Close + Schließen + + + + Save Public Key... Öffentlichen Schlüssel speichern... - Save private Key... + Save Private Key... Privaten Schlüssel speichern... - - - Close - Schließen - CommonSettingsPage @@ -22183,12 +22201,12 @@ Namen <E-Mail> Alias <E-Mail? Qt4ProjectManager::Internal::MaemoSshConfigDialog - Save public key file + Save Public Key File Öffentlichen Schlüssel speichern - Save private key file + Save Private Key File Privaten Schlüssel speichern @@ -22432,7 +22450,7 @@ Namen <E-Mail> Alias <E-Mail? CodePaster::FileShareProtocolSettingsPage - + Fileshare Dateibasiert @@ -22490,11 +22508,11 @@ Namen <E-Mail> Alias <E-Mail? TextEditor::Internal::TextEditorPlugin - Creates a text file (.txt). - Erzeugt eine Textdatei (.txt) + Creates a text file. The default file extension is <tt>.txt</tt>. You can specify a different extension as part of the filename. + Erstellt eine Textdatei mit der Erweiterung <tt>.txt</tt>. Sie können eine andere Erweiterung als Teil des Dateinamens angeben. - + Text File Textdatei @@ -22711,4 +22729,12 @@ Ids müssen mit einem Kleinbuchstaben beginnen und dürfen nur alphanumerische Z Es konnte kein Element des Typs %1 erzeugt werden + + QmlDesigner::QmlModelView + + + Invalid Id + Ungültige Id + + diff --git a/src/libs/qmljs/qmljsdocument.cpp b/src/libs/qmljs/qmljsdocument.cpp index 216fd7a738e..3cb6162d4fc 100644 --- a/src/libs/qmljs/qmljsdocument.cpp +++ b/src/libs/qmljs/qmljsdocument.cpp @@ -251,8 +251,14 @@ Snapshot::~Snapshot() void Snapshot::insert(const Document::Ptr &document) { if (document && (document->qmlProgram() || document->jsProgram())) { - _documents.insert(document->fileName(), document); - _documentsByPath.insert(document->path(), document); + const QString fileName = document->fileName(); + const QString path = document->path(); + + Document::Ptr old = _documents.value(fileName); + if (old) + _documentsByPath.remove(path, old); + _documentsByPath.insert(path, document); + _documents.insert(fileName, document); } } diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 75bbafa2a4f..06dadcd4b35 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -171,13 +171,13 @@ void PathChooser::slotBrowse() switch (m_d->m_acceptingKind) { case PathChooser::Directory: newPath = QFileDialog::getExistingDirectory(this, - makeDialogTitle(tr("Choose a directory")), predefined); + makeDialogTitle(tr("Choose Directory")), predefined); break; case PathChooser::File: // fall through case PathChooser::Command: newPath = QFileDialog::getOpenFileName(this, - makeDialogTitle(tr("Choose a file")), predefined, + makeDialogTitle(tr("Choose File")), predefined, m_d->m_dialogFilter); break; diff --git a/src/libs/utils/pathlisteditor.cpp b/src/libs/utils/pathlisteditor.cpp index 9525f209db9..b76721e72ac 100644 --- a/src/libs/utils/pathlisteditor.cpp +++ b/src/libs/utils/pathlisteditor.cpp @@ -121,7 +121,7 @@ PathListEditor::PathListEditor(QWidget *parent) : connect(m_d->toolButton, SIGNAL(clicked()), this, SLOT(slotInsert())); addAction(tr("Add..."), this, SLOT(slotAdd())); - addAction(tr("Delete line"), this, SLOT(deletePathAtCursor())); + addAction(tr("Delete Line"), this, SLOT(deletePathAtCursor())); addAction(tr("Clear"), this, SLOT(clear())); } diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index 15eb13a8c1a..3f5ef3f6c01 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -126,12 +126,12 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) mbm->addAction(cmd); //Previous Doc - m_docPrevAction = new QAction(tr("Previous Bookmark In Document"), this); + m_docPrevAction = new QAction(tr("Previous Bookmark in Document"), this); cmd = am->registerAction(m_docPrevAction, BOOKMARKS_PREVDOC_ACTION, globalcontext); mbm->addAction(cmd); //Next Doc - m_docNextAction = new QAction(tr("Next Bookmark In Document"), this); + m_docNextAction = new QAction(tr("Next Bookmark in Document"), this); cmd = am->registerAction(m_docNextAction, BOOKMARKS_NEXTDOC_ACTION, globalcontext); mbm->addAction(cmd); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index dcc25e3c3f3..f45a479008c 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -312,7 +312,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * m_workingDirectoryEdit = new Utils::PathChooser(); m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->workingDirectory()); m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory); - m_workingDirectoryEdit->setPromptDialogTitle(tr("Select the working directory")); + m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory")); QToolButton *resetButton = new QToolButton(); resetButton->setToolTip(tr("Reset to default")); diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index c976cbef925..9bce32adc12 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -141,6 +141,7 @@ const char * const GOTO_OTHER_SPLIT = "QtCreator.GotoOtherSplit"; const char * const SAVEASDEFAULT = "QtCreator.SaveAsDefaultLayout"; const char * const RESTOREDEFAULT = "QtCreator.RestoreDefaultLayout"; const char * const CLOSE = "QtCreator.Close"; +const char * const CLOSE_ALTERNATIVE = "QtCreator.Close_Alternative"; // temporary, see QTCREATORBUG-72 const char * const CLOSEALL = "QtCreator.CloseAll"; const char * const CLOSEOTHERS = "QtCreator.CloseOthers"; const char * const GOTONEXT = "QtCreator.GotoNext"; diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index d596348202b..0c14e43a319 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -382,6 +382,7 @@ void SettingsDialog::updateEnabledTabs(Category *category, const QString &search for (int i = 0; i < category->pages.size(); ++i) { const IOptionsPage *page = category->pages.at(i); const bool enabled = searchText.isEmpty() + || page->category().contains(searchText, Qt::CaseInsensitive) || page->displayName().contains(searchText, Qt::CaseInsensitive) || page->matches(searchText); category->tabWidget->setTabEnabled(i, enabled); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index da4bca7efd9..a296741aa05 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -311,16 +312,21 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) : // Close Action cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext); -#ifdef Q_WS_WIN - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F4"))); -#else cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+W"))); -#endif cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setDefaultText(m_d->m_closeCurrentEditorAction->text()); mfile->addAction(cmd, Constants::G_FILE_CLOSE); connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor())); +#ifdef Q_WS_WIN + // workaround for QTCREATORBUG-72 + QShortcut *sc = new QShortcut(parent); + cmd = am->registerShortcut(sc, Constants::CLOSE_ALTERNATIVE, editManagerContext); + cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F4"))); + cmd->setDefaultText(EditorManager::tr("Close")); + connect(sc, SIGNAL(activated()), this, SLOT(closeEditor())); +#endif + // Close All Action cmd = am->registerAction(m_d->m_closeAllEditorsAction, Constants::CLOSEALL, editManagerContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+W"))); @@ -733,6 +739,8 @@ void EditorManager::closeOtherEditors() // SLOT connected to action void EditorManager::closeEditor() { + if (!m_d->m_currentEditor) + return; addCurrentPositionToNavigationHistory(); closeEditor(m_d->m_currentEditor); } diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui index 73fb6764fb1..a44dfdef5a3 100644 --- a/src/plugins/coreplugin/generalsettings.ui +++ b/src/plugins/coreplugin/generalsettings.ui @@ -270,17 +270,17 @@ - Always ask + Always Ask - Reload all unchanged editors + Reload All Unchanged Editors - Ignore modifications + Ignore Modifications diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index f678e7a0153..ea19de63e27 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -72,6 +72,11 @@ FileShareProtocolSettingsWidget::FileShareProtocolSettingsWidget(QWidget *parent QWidget(parent) { m_ui.setupUi(this); + + // Add a space in front of the suffix + QString suffix = m_ui.displayCountSpinBox->suffix(); + suffix.prepend(QLatin1Char(' ')); + m_ui.displayCountSpinBox->setSuffix(suffix); } void FileShareProtocolSettingsWidget::setSettings(const FileShareProtocolSettings &s) diff --git a/src/plugins/cpaster/pastebindotcomsettings.ui b/src/plugins/cpaster/pastebindotcomsettings.ui index 3f2fd6c773c..73844e4d5ee 100644 --- a/src/plugins/cpaster/pastebindotcomsettings.ui +++ b/src/plugins/cpaster/pastebindotcomsettings.ui @@ -51,15 +51,18 @@ <html><head/><body> -<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. qtcreator.pastebin.com). Fill in the desired prefix.</p> +<p><a href="http://pastebin.com">pastebin.com</a> allows to send posts to custom subdomains (eg. creator.pastebin.com). Fill in the desired prefix.</p> <p>Note that the plugin will use this for posting as well as fetching.</p></body></html> - Qt::RichText + Qt::AutoText true + + true + diff --git a/src/plugins/cpaster/pasteview.ui b/src/plugins/cpaster/pasteview.ui index b7764d29d24..80dc5560233 100644 --- a/src/plugins/cpaster/pasteview.ui +++ b/src/plugins/cpaster/pasteview.ui @@ -97,7 +97,7 @@ p, li { white-space: pre-wrap; } - Parts to send to server + Parts to Send to Server true diff --git a/src/plugins/cpaster/settingspage.ui b/src/plugins/cpaster/settingspage.ui index e4566d219e9..043f046d9b5 100644 --- a/src/plugins/cpaster/settingspage.ui +++ b/src/plugins/cpaster/settingspage.ui @@ -27,14 +27,14 @@ - Display Output Pane after sending a post + Display Output pane after sending a post - Copy Paste URL to clipboard + Copy-paste URL to clipboard diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index 57528bf6f71..c7a1398b256 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -275,7 +275,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess QList globalContext; globalContext.append(Core::Constants::C_GLOBAL_ID); cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2)); - m_updateCodeModelAction = new QAction(tr("Update code model"), this); + m_updateCodeModelAction = new QAction(tr("Update Code Model"), this); cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext); CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance(); connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles())); diff --git a/src/plugins/cppeditor/cppquickfix.cpp b/src/plugins/cppeditor/cppquickfix.cpp index 5a7b97e8725..def7d89d251 100644 --- a/src/plugins/cppeditor/cppquickfix.cpp +++ b/src/plugins/cppeditor/cppquickfix.cpp @@ -49,6 +49,7 @@ #include #include +#include #include using namespace CppEditor::Internal; @@ -129,7 +130,7 @@ public: virtual QString description() const { - return QLatin1String("Rewrite using ") + replacement; // ### tr? + return QApplication::translate("CppTools::QuickFix", "Rewrite Using %1").arg(replacement); } virtual int match(const QList &path) @@ -223,9 +224,9 @@ public: virtual QString description() const { if (replacement.isEmpty()) - return QLatin1String("Flip"); + return QApplication::translate("CppTools::QuickFix", "Swap Operands"); else - return QLatin1String("Flip to use ") + replacement; // ### tr? + return QApplication::translate("CppTools::QuickFix", "Rewrite Using %1").arg(replacement); } virtual int match(const QList &path) @@ -297,7 +298,7 @@ public: virtual QString description() const { - return QLatin1String("Rewrite condition using ||"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Rewrite Condition Using ||"); } virtual int match(const QList &path) @@ -358,7 +359,7 @@ public: virtual QString description() const { - return QLatin1String("Split declaration"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Split Declaration"); } bool checkDeclaration(SimpleDeclarationAST *declaration) const @@ -464,7 +465,7 @@ public: virtual QString description() const { - return QLatin1String("Add curly braces"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Add Curly Braces"); } virtual int match(const QList &path) @@ -524,7 +525,7 @@ public: virtual QString description() const { - return QLatin1String("Move declaration out of condition"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Move Declaration out of Condition"); } virtual int match(const QList &path) @@ -587,7 +588,7 @@ public: virtual QString description() const { - return QLatin1String("Move declaration out of condition"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Move Declaration out of Condition"); } virtual int match(const QList &path) @@ -672,7 +673,7 @@ public: virtual QString description() const { - return QLatin1String("Split if statement"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Split if Statement"); } virtual int match(const QList &path) @@ -782,7 +783,7 @@ public: virtual QString description() const { - return QLatin1String("Enclose in QLatin1String(...)"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Enclose in QLatin1String(...)"); } virtual int match(const QList &path) @@ -849,7 +850,9 @@ public: {} virtual QString description() const - { return QLatin1String("Convert to Objective-C string literal"); }// ### tr? + { + return QApplication::translate("CppTools::QuickFix", "Convert to Objective-C String Literal"); + } virtual int match(const QList &path) { @@ -922,7 +925,7 @@ public: virtual QString description() const { - return QLatin1String("Use fast string concatenation with %"); // ### tr? + return QApplication::translate("CppTools::QuickFix", "Use Fast String Concatenation with %"); } virtual int match(const QList &path) diff --git a/src/plugins/cpptools/completionsettingspage.ui b/src/plugins/cpptools/completionsettingspage.ui index 4167db7c3d5..98e0da2bc60 100644 --- a/src/plugins/cpptools/completionsettingspage.ui +++ b/src/plugins/cpptools/completionsettingspage.ui @@ -65,7 +65,7 @@ - First letter + First Letter diff --git a/src/plugins/cpptools/cppfilesettingspage.cpp b/src/plugins/cpptools/cppfilesettingspage.cpp index db982c6ee81..2a10677cb31 100644 --- a/src/plugins/cpptools/cppfilesettingspage.cpp +++ b/src/plugins/cpptools/cppfilesettingspage.cpp @@ -272,7 +272,7 @@ void CppFileSettingsWidget::slotEdit() return; } // Pick a file name and write new template, edit with C++ - path = QFileDialog::getSaveFileName(this, tr("Choose a location for the new license template file")); + path = QFileDialog::getSaveFileName(this, tr("Choose Location for New License Template File")); if (path.isEmpty()) return; QFile file(path); diff --git a/src/plugins/cvs/checkoutwizard.cpp b/src/plugins/cvs/checkoutwizard.cpp index ed70c63c668..b7e81e711c1 100644 --- a/src/plugins/cvs/checkoutwizard.cpp +++ b/src/plugins/cvs/checkoutwizard.cpp @@ -53,7 +53,7 @@ QIcon CheckoutWizard::icon() const QString CheckoutWizard::description() const { - return tr("Checks out a project from a CVS repository and tries to load the contained project."); + return tr("Checks out a CVS repository and tries to load the contained project."); } QString CheckoutWizard::displayName() const diff --git a/src/plugins/cvs/settingspage.ui b/src/plugins/cvs/settingspage.ui index 17edd2a71f4..4f1ebfd394d 100644 --- a/src/plugins/cvs/settingspage.ui +++ b/src/plugins/cvs/settingspage.ui @@ -66,7 +66,7 @@ - When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit id). Otherwise, only the respective file will be displayed. + When checked, all files touched by a commit will be displayed when clicking on a revision number in the annotation view (retrieved via commit ID). Otherwise, only the respective file will be displayed. Describe all files matching commit id diff --git a/src/plugins/debugger/attachexternaldialog.ui b/src/plugins/debugger/attachexternaldialog.ui index 143ebb2a572..5e157a2f3ce 100644 --- a/src/plugins/debugger/attachexternaldialog.ui +++ b/src/plugins/debugger/attachexternaldialog.ui @@ -28,7 +28,7 @@ - Attach to Process ID: + Attach to process ID: diff --git a/src/plugins/debugger/cdb/cdboptionspagewidget.ui b/src/plugins/debugger/cdb/cdboptionspagewidget.ui index 5ff8605d080..c84109e3a7e 100644 --- a/src/plugins/debugger/cdb/cdboptionspagewidget.ui +++ b/src/plugins/debugger/cdb/cdboptionspagewidget.ui @@ -19,7 +19,7 @@ These options take effect at the next start of Qt Creator. - Cdb + CDB true @@ -82,13 +82,13 @@ - Other options + Other Options - Verbose Symbol Loading + Verbose symbol loading diff --git a/src/plugins/debugger/commonoptionspage.ui b/src/plugins/debugger/commonoptionspage.ui index fc67708b4ef..973885cc10c 100644 --- a/src/plugins/debugger/commonoptionspage.ui +++ b/src/plugins/debugger/commonoptionspage.ui @@ -33,7 +33,7 @@ - Gui behavior + GUI Behavior @@ -66,7 +66,7 @@ Register Qt Creator for debugging crashed applications. - Use Creator for post-mortem debugging + Use Qt Creator for post-mortem debugging diff --git a/src/plugins/debugger/dumperoptionpage.ui b/src/plugins/debugger/dumperoptionpage.ui index 7fd962fd41b..797601b656a 100644 --- a/src/plugins/debugger/dumperoptionpage.ui +++ b/src/plugins/debugger/dumperoptionpage.ui @@ -21,7 +21,7 @@ - Use debugging helper + Use Debugging Helper true diff --git a/src/plugins/debugger/gdb/gdboptionspage.ui b/src/plugins/debugger/gdb/gdboptionspage.ui index 90deb6b6dd2..43ba556c0cf 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.ui +++ b/src/plugins/debugger/gdb/gdboptionspage.ui @@ -135,7 +135,7 @@ name in different directories. - Behaviour of breakpoint setting in plugins + Behavior of Breakpoint Setting in Plugins diff --git a/src/plugins/designer/cpp/cppsettingspagewidget.ui b/src/plugins/designer/cpp/cppsettingspagewidget.ui index 1e2b089d0a8..d34a4f86f44 100644 --- a/src/plugins/designer/cpp/cppsettingspagewidget.ui +++ b/src/plugins/designer/cpp/cppsettingspagewidget.ui @@ -32,7 +32,7 @@ - Multiple Inheritance + Multiple inheritance diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 177e44af487..51e45335f0a 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -445,22 +445,22 @@ void FormEditorW::setupActions() m_toolActionIds.push_back(QLatin1String("FormEditor.WidgetEditor")); createEditModeAction(m_actionGroupEditMode, m_contexts, am, medit, - tr("Edit widgets"), m_toolActionIds.back(), + tr("Edit Widgets"), m_toolActionIds.back(), EditModeWidgetEditor, QLatin1String("widgettool.png"), tr("F3")); m_toolActionIds.push_back(QLatin1String("FormEditor.SignalsSlotsEditor")); createEditModeAction(m_actionGroupEditMode, m_contexts, am, medit, - tr("Edit signals/slots"), m_toolActionIds.back(), + tr("Edit Signals/Slots"), m_toolActionIds.back(), EditModeSignalsSlotEditor, QLatin1String("signalslottool.png"), tr("F4")); m_toolActionIds.push_back(QLatin1String("FormEditor.BuddyEditor")); createEditModeAction(m_actionGroupEditMode, m_contexts, am, medit, - tr("Edit buddies"), m_toolActionIds.back(), + tr("Edit Buddies"), m_toolActionIds.back(), EditModeBuddyEditor, QLatin1String("buddytool.png")); m_toolActionIds.push_back(QLatin1String("FormEditor.TabOrderEditor")); createEditModeAction(m_actionGroupEditMode, m_contexts, am, medit, - tr("Edit tab order"), m_toolActionIds.back(), + tr("Edit Tab Order"), m_toolActionIds.back(), EditModeTabOrderEditor, QLatin1String("tabordertool.png")); //tool actions diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp index 9e63d548ca9..8f9aeba53af 100644 --- a/src/plugins/fakevim/fakevimactions.cpp +++ b/src/plugins/fakevim/fakevimactions.cpp @@ -118,7 +118,7 @@ FakeVimSettings *theFakeVimSettings() const QString group = _("FakeVim"); item = new SavedAction(instance); item->setText(QCoreApplication::translate("FakeVim::Internal", - "Use vim-style editing")); + "Use Vim-style Editing")); item->setSettingsKey(group, _("UseFakeVim")); item->setCheckable(true); item->setValue(false); diff --git a/src/plugins/fakevim/fakevimoptions.ui b/src/plugins/fakevim/fakevimoptions.ui index a5355f7ea89..450a8629065 100644 --- a/src/plugins/fakevim/fakevimoptions.ui +++ b/src/plugins/fakevim/fakevimoptions.ui @@ -200,21 +200,21 @@ - Copy text editor settings + Copy Text Editor Settings - Set Qt style + Set Qt Style - Set plain style + Set Plain Style diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.cpp b/src/plugins/genericprojectmanager/genericprojectmanager.cpp index 0ad966a7306..5f5737bf65e 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.cpp +++ b/src/plugins/genericprojectmanager/genericprojectmanager.cpp @@ -32,8 +32,11 @@ #include "genericproject.h" #include +#include #include +#include #include +#include #include @@ -60,14 +63,21 @@ QString Manager::mimeType() const ProjectExplorer::Project *Manager::openProject(const QString &fileName) { - QFileInfo fileInfo(fileName); + if (!QFileInfo(fileName).isFile()) + return 0; - if (fileInfo.isFile()) { - GenericProject *project = new GenericProject(this, fileName); - return project; + ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance(); + foreach (ProjectExplorer::Project *pi, projectExplorer->session()->projects()) { + if (fileName == pi->file()->fileName()) { + Core::MessageManager *messageManager = Core::ICore::instance()->messageManager(); + messageManager->printToOutputPanePopup(tr("Failed opening project '%1': Project already open") + .arg(QDir::toNativeSeparators(fileName))); + return 0; + } } - return 0; + GenericProject *project = new GenericProject(this, fileName); + return project; } void Manager::registerProject(GenericProject *project) diff --git a/src/plugins/genericprojectmanager/genericprojectmanager.h b/src/plugins/genericprojectmanager/genericprojectmanager.h index 6e213afc77d..1b99f008d17 100644 --- a/src/plugins/genericprojectmanager/genericprojectmanager.h +++ b/src/plugins/genericprojectmanager/genericprojectmanager.h @@ -37,7 +37,7 @@ namespace Internal { class GenericProject; -class Manager: public ProjectExplorer::IProjectManager +class Manager : public ProjectExplorer::IProjectManager { Q_OBJECT diff --git a/src/plugins/git/branchdialog.ui b/src/plugins/git/branchdialog.ui index 45e6c65c7c9..872f7b19fa0 100644 --- a/src/plugins/git/branchdialog.ui +++ b/src/plugins/git/branchdialog.ui @@ -42,7 +42,7 @@ - Remote branches + Remote Branches diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index 84130ee7989..b762369b4fd 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -40,7 +40,7 @@ ChangeSelectionDialog::ChangeSelectionDialog(QWidget *parent) { m_ui.setupUi(this); connect(m_ui.repositoryButton, SIGNAL(clicked()), this, SLOT(selectWorkingDirectory())); - setWindowTitle(tr("Select a Git commit")); + setWindowTitle(tr("Select a Git Commit")); } QString ChangeSelectionDialog::change() const @@ -62,7 +62,7 @@ void ChangeSelectionDialog::selectWorkingDirectory() { static QString location; location = QFileDialog::getExistingDirectory(this, - tr("Select Git repository"), + tr("Select Git Repository"), location); if (location.isEmpty()) return; diff --git a/src/plugins/git/changeselectiondialog.ui b/src/plugins/git/changeselectiondialog.ui index 26ac65cb861..b2f368e6869 100644 --- a/src/plugins/git/changeselectiondialog.ui +++ b/src/plugins/git/changeselectiondialog.ui @@ -17,7 +17,7 @@ - Repository Location: + Repository location: diff --git a/src/plugins/git/clonewizard.cpp b/src/plugins/git/clonewizard.cpp index 60c9c13289b..e633da5cfc3 100644 --- a/src/plugins/git/clonewizard.cpp +++ b/src/plugins/git/clonewizard.cpp @@ -52,7 +52,7 @@ QIcon CloneWizard::icon() const QString CloneWizard::description() const { - return tr("Clones a project from a Git repository and tries to load the contained project."); + return tr("Clones a Git repository and tries to load the contained project."); } QString CloneWizard::displayName() const diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 8984813632c..8248d18d0d6 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -862,7 +862,7 @@ QString GitClient::synchronousStash(const QString &workingDirectory, do { if ((flags & StashPromptDescription)) { if (!inputText(Core::ICore::instance()->mainWindow(), - tr("Stash description"), tr("Description:"), &message)) + tr("Stash Description"), tr("Description:"), &message)) break; } if (!executeSynchronousStash(workingDirectory, message)) diff --git a/src/plugins/git/gitorious/gitoriousclonewizard.cpp b/src/plugins/git/gitorious/gitoriousclonewizard.cpp index 46a7efab9b8..8c37d80e532 100644 --- a/src/plugins/git/gitorious/gitoriousclonewizard.cpp +++ b/src/plugins/git/gitorious/gitoriousclonewizard.cpp @@ -80,7 +80,7 @@ QIcon GitoriousCloneWizard::icon() const QString GitoriousCloneWizard::description() const { - return tr("Clones a project from a Gitorious repository and tries to load the contained project."); + return tr("Clones a Gitorious repository and tries to load the contained project."); } QString GitoriousCloneWizard::displayName() const diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index c7fc2465fa9..b54607b4479 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -420,7 +420,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) ActionCommandPair actionCommand = createRepositoryAction(actionManager, gitContainer, - tr("Stash snapshot..."), QLatin1String("Git.StashSnapshot"), + tr("Stash Snapshot..."), QLatin1String("Git.StashSnapshot"), globalcontext, true, SLOT(stashSnapshot())); actionCommand.first->setToolTip(tr("Saves the current state of your work.")); diff --git a/src/plugins/git/settingspage.ui b/src/plugins/git/settingspage.ui index 159c3774f3a..072bb6f39d2 100644 --- a/src/plugins/git/settingspage.ui +++ b/src/plugins/git/settingspage.ui @@ -17,7 +17,7 @@ true - Environment variables + Environment Variables true @@ -38,7 +38,7 @@ - From system + From System diff --git a/src/plugins/help/generalsettingspage.cpp b/src/plugins/help/generalsettingspage.cpp index 50709e8c37b..79707b977a5 100644 --- a/src/plugins/help/generalsettingspage.cpp +++ b/src/plugins/help/generalsettingspage.cpp @@ -68,7 +68,7 @@ QString GeneralSettingsPage::id() const QString GeneralSettingsPage::displayName() const { - return tr("General settings"); + return tr("General Settings"); } QString GeneralSettingsPage::category() const diff --git a/src/plugins/help/generalsettingspage.ui b/src/plugins/help/generalsettingspage.ui index d70d419fe65..7a99e243453 100644 --- a/src/plugins/help/generalsettingspage.ui +++ b/src/plugins/help/generalsettingspage.ui @@ -156,17 +156,17 @@ - Show side-by-side if possible + Show Side-by-Side if Possible - Always show side-by-side + Always Show Side-by-Side - Always start full help + Always Start Full Help @@ -194,17 +194,17 @@ - Show my home page + Show My Home Page - Show a blank page + Show a Blank Page - Show my tabs from last session + Show My Tabs from Last Session diff --git a/src/plugins/locator/directoryfilter.cpp b/src/plugins/locator/directoryfilter.cpp index aa2dc8afc32..8f927d752b3 100644 --- a/src/plugins/locator/directoryfilter.cpp +++ b/src/plugins/locator/directoryfilter.cpp @@ -145,7 +145,7 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) void DirectoryFilter::addDirectory() { - QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Choose a directory to add")); + QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Select Directory")); if (!dir.isEmpty()) { m_ui.directoryList->addItem(dir); } @@ -156,7 +156,7 @@ void DirectoryFilter::editDirectory() if (m_ui.directoryList->selectedItems().count() < 1) return; QListWidgetItem *currentItem = m_ui.directoryList->selectedItems().at(0); - QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Choose a directory to add"), + QString dir = QFileDialog::getExistingDirectory(m_dialog, tr("Select Directory"), currentItem->text()); if (!dir.isEmpty()) { currentItem->setText(dir); diff --git a/src/plugins/locator/directoryfilter.ui b/src/plugins/locator/directoryfilter.ui index 8b8ddfe59a8..2786e0515dc 100644 --- a/src/plugins/locator/directoryfilter.ui +++ b/src/plugins/locator/directoryfilter.ui @@ -26,7 +26,7 @@ - File Types: + File types: diff --git a/src/plugins/locator/settingspage.cpp b/src/plugins/locator/settingspage.cpp index 0dcfdb5cf9c..1f913c144bc 100644 --- a/src/plugins/locator/settingspage.cpp +++ b/src/plugins/locator/settingspage.cpp @@ -165,7 +165,7 @@ void SettingsPage::updateFilterList() if (filter->isIncludedByDefault()) title = filter->displayName(); else - title = tr("%1 (Prefix: %2)").arg(filter->displayName()).arg(filter->shortcutString()); + title = tr("%1 (prefix: %2)").arg(filter->displayName()).arg(filter->shortcutString()); QListWidgetItem *item = new QListWidgetItem(title); item->setData(Qt::UserRole, qVariantFromValue(filter)); m_ui.filterList->addItem(item); diff --git a/src/plugins/mercurial/optionspage.ui b/src/plugins/mercurial/optionspage.ui index 2afd9fe65a7..248dbeeeb51 100644 --- a/src/plugins/mercurial/optionspage.ui +++ b/src/plugins/mercurial/optionspage.ui @@ -62,7 +62,7 @@ Email to use by default on commit. - Default Email: + Default email: diff --git a/src/plugins/perforce/settingspage.ui b/src/plugins/perforce/settingspage.ui index 40fb16b72c5..6f270415089 100644 --- a/src/plugins/perforce/settingspage.ui +++ b/src/plugins/perforce/settingspage.ui @@ -36,7 +36,7 @@ true - Environment variables + Environment Variables true diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index 9fc730de216..cc8f99c4ce9 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -133,7 +133,7 @@ void BuildSettingsWidget::setupUi() if (!m_target->buildConfigurationFactory()) { QLabel * noSettingsLabel(new QLabel(this)); - noSettingsLabel->setText(tr("No Build Settings available")); + noSettingsLabel->setText(tr("No build settings available")); { QFont f(noSettingsLabel->font()); f.setPointSizeF(f.pointSizeF() * 1.2); @@ -146,7 +146,7 @@ void BuildSettingsWidget::setupUi() { // Edit Build Configuration row QHBoxLayout *hbox = new QHBoxLayout(); hbox->setContentsMargins(m_leftMargin, 0, 0, 0); - hbox->addWidget(new QLabel(tr("Edit Build Configuration:"), this)); + hbox->addWidget(new QLabel(tr("Edit build configuration:"), this)); m_buildConfigurationComboBox = new QComboBox(this); m_buildConfigurationComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); m_buildConfigurationComboBox->setModel(new BuildConfigurationModel(m_target, this)); diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 744b8549009..ffb06bc9eb6 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -302,7 +302,7 @@ void BuildStepsPage::setupUi() QHBoxLayout *hboxLayout = new QHBoxLayout(); hboxLayout->setContentsMargins(m_leftMargin, 4, 0, 0); m_addButton = new QPushButton(this); - m_addButton->setText(m_type == Clean ? tr("Add clean step") : tr("Add build step")); + m_addButton->setText(m_type == Clean ? tr("Add Clean Step") : tr("Add Build Step")); m_addButton->setMenu(new QMenu(this)); hboxLayout->addWidget(m_addButton); diff --git a/src/plugins/projectexplorer/processstep.ui b/src/plugins/projectexplorer/processstep.ui index 8d049ed3635..fc2e943ab11 100644 --- a/src/plugins/projectexplorer/processstep.ui +++ b/src/plugins/projectexplorer/processstep.ui @@ -14,7 +14,7 @@ - Enable Custom Process Step + Enable custom process step @@ -48,7 +48,7 @@ - Working Directory: + Working directory: @@ -58,7 +58,7 @@ - Command Arguments: + Command arguments: diff --git a/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp b/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp index b9da6c86f19..0237c40ded1 100644 --- a/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp @@ -170,7 +170,7 @@ void ItemCreatorTool::createAtItem(const QRectF &rect) return; if (list.first() == "item") { RewriterTransaction transaction = view()->beginRewriterTransaction(); - ItemLibraryEntry itemLibraryEntry = view()->model()->metaInfo().itemLibraryInfo().entry(list.at(1)); + ItemLibraryEntry itemLibraryEntry = view()->model()->metaInfo().itemLibraryInfo()->entry(list.at(1)); QmlItemNode newNode = view()->createQmlItemNode(itemLibraryEntry, pos, parentNode); newNode.modelNode().variantProperty("width") = rect.width(); newNode.modelNode().variantProperty("height") = rect.height(); diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp index d56c1bce82f..3c693197693 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp @@ -344,7 +344,7 @@ void DesignDocumentController::loadCurrentModel() m_d->model->setMasterModel(m_d->masterModel.data()); m_d->model->attachView(m_d->navigator.data()); - m_d->itemLibrary->setMetaInfo(m_d->model->metaInfo()); + m_d->itemLibrary->setItemLibraryInfo(m_d->model->metaInfo().itemLibraryInfo()); m_d->itemLibrary->setResourcePath(QFileInfo(m_d->fileName).absolutePath()); if (!m_d->componentAction) { diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.cpp index 0df2950211e..a812f298680 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.cpp @@ -101,6 +101,7 @@ public: Utils::FilterLineEdit *m_lineEdit; QDeclarativeView *m_itemsView; Internal::ItemLibraryTreeView *m_resourcesView; + QWeakPointer m_itemLibraryInfo; QSize m_itemIconSize, m_resIconSize; MyFileIconProvider m_iconProvider; @@ -233,9 +234,20 @@ ItemLibrary::~ItemLibrary() delete m_d; } -void ItemLibrary::setMetaInfo(const MetaInfo &metaInfo) +void ItemLibrary::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo) { - m_d->m_itemLibraryModel->update(metaInfo); + if (m_d->m_itemLibraryInfo.data() == itemLibraryInfo) + return; + + if (m_d->m_itemLibraryInfo) + disconnect(m_d->m_itemLibraryInfo.data(), SIGNAL(entriesChanged()), + this, SLOT(updateModel())); + m_d->m_itemLibraryInfo = itemLibraryInfo; + if (itemLibraryInfo) + connect(m_d->m_itemLibraryInfo.data(), SIGNAL(entriesChanged()), + this, SLOT(updateModel())); + + updateModel(); updateSearch(); } @@ -262,6 +274,12 @@ void ItemLibrary::setSearchFilter(const QString &searchFilter) } } +void ItemLibrary::updateModel() +{ + m_d->m_itemLibraryModel->update(m_d->m_itemLibraryInfo.data()); + updateSearch(); +} + void ItemLibrary::updateSearch() { setSearchFilter(m_d->m_lineEdit->text()); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.h index 71f4fb6fb2b..26637e5a400 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrary.h @@ -30,6 +30,7 @@ #ifndef ITEMLIBRARY_H #define ITEMLIBRARY_H +#include "itemlibraryinfo.h" #include namespace QmlDesigner { @@ -47,10 +48,11 @@ public: ItemLibrary(QWidget *parent = 0); virtual ~ItemLibrary(); - void setMetaInfo(const MetaInfo &metaInfo); + void setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo); public Q_SLOTS: void setSearchFilter(const QString &searchFilter); + void updateModel(); void updateSearch(); void clearLineEditFocus(); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp index 0ac8a3d4d6b..28764e0ad94 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp @@ -28,7 +28,7 @@ **************************************************************************/ #include "itemlibrarymodel.h" -#include "metainfo.h" +#include "itemlibraryinfo.h" #include #include @@ -317,7 +317,6 @@ bool ItemLibrarySectionModel::operator<(const ItemLibrarySectionModel &other) co ItemLibraryModel::ItemLibraryModel(QScriptEngine *scriptEngine, QObject *parent) : ItemLibrarySortedModel(parent), m_scriptEngine(scriptEngine), - m_metaInfo(0), m_searchText(""), m_itemIconSize(64, 64), m_nextLibId(0) @@ -327,8 +326,6 @@ ItemLibraryModel::ItemLibraryModel(QScriptEngine *scriptEngine, QObject *parent) ItemLibraryModel::~ItemLibraryModel() { - if (m_metaInfo) - delete m_metaInfo; } @@ -387,7 +384,7 @@ bool ItemLibraryModel::isItemVisible(int itemLibId) return elementModel(sectionLibId)->isItemVisible(itemLibId); } -void ItemLibraryModel::update(const MetaInfo &metaInfo) +void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo) { QMap sections; @@ -396,13 +393,7 @@ void ItemLibraryModel::update(const MetaInfo &metaInfo) m_sections.clear(); m_nextLibId = 0; - if (!m_metaInfo) { - m_metaInfo = new MetaInfo(metaInfo); - } else { - *m_metaInfo = metaInfo; - } - - foreach (ItemLibraryEntry entry, metaInfo.itemLibraryInfo().entries()) { + foreach (ItemLibraryEntry entry, itemLibraryInfo->entries()) { QString itemSectionName = entry.category(); ItemLibrarySectionModel *sectionModel; ItemLibraryItemModel *itemModel; diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h index 693680d2b8e..896710f4118 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.h @@ -40,7 +40,7 @@ QT_FORWARD_DECLARE_CLASS(QMimeData); namespace QmlDesigner { -class MetaInfo; +class ItemLibraryInfo; class ItemLibraryEntry; namespace Internal { @@ -131,7 +131,7 @@ public: QString searchText() const; - void update(const MetaInfo &metaInfo); + void update(ItemLibraryInfo *itemLibraryInfo); QString getTypeName(int libId); QMimeData *getMimeData(int libId); @@ -159,7 +159,6 @@ private: QPixmap createDragPixmap(int width, int height); QWeakPointer m_scriptEngine; - MetaInfo *m_metaInfo; QMap m_itemInfos; QMap m_sections; diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 25908d605c1..94ab253a99a 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -186,23 +186,25 @@ NavigatorTreeModel::ItemRow NavigatorTreeModel::createItemRow(const ModelNode &n uint hash = qHash(node); + const bool dropEnabled = node.metaInfo().isValid(); + QStandardItem *idItem = new QStandardItem; idItem->setDragEnabled(true); - idItem->setDropEnabled(node.metaInfo().isValid() && node.metaInfo().isContainer()); + idItem->setDropEnabled(dropEnabled); idItem->setEditable(true); idItem->setData(hash, Qt::UserRole); #ifdef _LOCK_ITEMS_ QStandardItem *lockItem = new QStandardItem; lockItem->setDragEnabled(true); - lockItem->setDropEnabled(node.metaInfo().isContainer()); + lockItem->setDropEnabled(dropEnabled); lockItem->setEditable(false); lockItem->setCheckable(true); lockItem->setData(hash, Qt::UserRole); #endif QStandardItem *visibilityItem = new QStandardItem; - visibilityItem->setDropEnabled(node.metaInfo().isValid() && node.metaInfo().isContainer()); + visibilityItem->setDropEnabled(dropEnabled); visibilityItem->setCheckable(true); visibilityItem->setEditable(false); visibilityItem->setData(hash, Qt::UserRole); diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp index c24395efaab..13e61c24b00 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp @@ -171,24 +171,24 @@ void IdItemDelegate::paint(QPainter *painter, if (icon.isNull()) { // if node has no own icon, search for it in the itemlibrary - const ItemLibraryInfo libraryInfo = node.metaInfo().metaInfo().itemLibraryInfo(); - QList infoList = libraryInfo.entriesForNodeMetaInfo(node.metaInfo()); - foreach (const ItemLibraryEntry &entry, infoList) - { - if (entry.typeName()==node.metaInfo().typeName()) { + const NodeMetaInfo typeInfo = node.metaInfo(); + const ItemLibraryInfo *libraryInfo = node.metaInfo().metaInfo().itemLibraryInfo(); + QList infoList = libraryInfo->entriesForType(typeInfo.typeName(), + typeInfo.majorVersion(), + typeInfo.minorVersion()); + foreach (const ItemLibraryEntry &entry, infoList) { + if (!icon.isNull()) { icon = entry.icon(); break; } } - - // if the library was also empty, use the default icon } } + // if the library was also empty, use the default icon if (icon.isNull()) icon = QIcon(":/ItemLibrary/images/item-default-icon.png"); - // If no icon is present, leave an empty space of 24 pixels anyway int pixmapSide = 16; QPixmap pixmap = icon.pixmap(pixmapSide, pixmapSide); diff --git a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp index 58f0b89ace6..5c53e588720 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp @@ -403,9 +403,16 @@ static inline QColor invertColor(const QColor color) return c; } -GradientLine::GradientLine(QWidget *parent) : QWidget(parent), m_activeColor(Qt::black), m_gradientName("gradient"), - m_dragActive(false), m_yOffset(0), m_create(false), - m_active(false), m_colorIndex(0), m_dragOff(false) +GradientLine::GradientLine(QWidget *parent) : + QWidget(parent), + m_activeColor(Qt::black), + m_gradientName("gradient"), + m_colorIndex(0), + m_dragActive(false), + m_yOffset(0), + m_create(false), + m_active(false), + m_dragOff(false) { setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); setFocusPolicy(Qt::StrongFocus); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index 70f285ed444..0c76cd254fe 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -461,6 +461,9 @@ void StatesEditorView::sceneChanged() } void StatesEditorView::startUpdateTimer(int i, int offset) { + if (debug) + qDebug() << __FUNCTION__ << i << offset; + if (i < 0 || i > m_modelStates.count()) return; diff --git a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp index 976e1bf2049..8212afcfad0 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/exception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/exception.cpp @@ -71,7 +71,7 @@ const char* demangle(const char* name) #endif -bool Exception::s_shouldAssert = true; +bool Exception::s_shouldAssert = false; void Exception::setShouldAssert(bool assert) { diff --git a/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp b/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp index b64c7f70648..f0058c8f3e4 100644 --- a/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp +++ b/src/plugins/qmldesigner/designercore/exceptions/rewritingexception.cpp @@ -4,8 +4,10 @@ using namespace QmlDesigner; RewritingException::RewritingException(int line, const QString &function, - const QString &file, const QString &description): - Exception(line, function, file), m_description(description) + const QString &file, + const QString &description, + const QString &documentTextContent): + Exception(line, function, file), m_description(description), m_documentTextContent(documentTextContent) { } @@ -18,3 +20,8 @@ QString RewritingException::description() const { return m_description; } + +QString RewritingException::documentTextContent() const +{ + return m_documentTextContent; +} diff --git a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h index 2aa7042d5ea..35286f2f0b8 100644 --- a/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h +++ b/src/plugins/qmldesigner/designercore/include/itemlibraryinfo.h @@ -32,20 +32,13 @@ #include "corelib_global.h" -#include -#include -#include -#include #include "propertycontainer.h" -#include +#include namespace QmlDesigner { -class NodeMetaInfo; - namespace Internal { -class MetaInfoPrivate; class ItemLibraryEntryData; class ItemLibraryInfoPrivate; @@ -58,8 +51,8 @@ CORESHARED_EXPORT QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry class CORESHARED_EXPORT ItemLibraryEntry { - friend class QmlDesigner::MetaInfo; - friend class QmlDesigner::Internal::MetaInfoParser; + //friend class QmlDesigner::MetaInfo; + //friend class QmlDesigner::Internal::MetaInfoParser; friend CORESHARED_EXPORT QDataStream& QmlDesigner::operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibraryEntry); friend CORESHARED_EXPORT QDataStream& QmlDesigner::operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry); public: @@ -82,9 +75,7 @@ public: QList properties() const; - void setTypeName(const QString &typeName); - void setMajorVersion(int majorNumber); - void setMinorVersion(int minorNumber); + void setType(const QString &typeName, int majorVersion, int minorVersion); void setName(const QString &name); void setIcon(const QIcon &icon); void addProperty(const Property &p); @@ -96,30 +87,29 @@ private: QExplicitlySharedDataPointer m_data; }; - -class CORESHARED_EXPORT ItemLibraryInfo +class CORESHARED_EXPORT ItemLibraryInfo : public QObject { + Q_OBJECT + Q_DISABLE_COPY(ItemLibraryInfo) friend class Internal::MetaInfoPrivate; public: - ItemLibraryInfo(); - ItemLibraryInfo(const ItemLibraryInfo &other); ~ItemLibraryInfo(); - ItemLibraryInfo& operator=(const ItemLibraryInfo &other); - - bool isValid(); - QList entries() const; - QList entriesForNodeMetaInfo(const NodeMetaInfo &nodeMetaInfo) const; + QList entriesForType(const QString &typeName, int majorVersion, int minorVersion) const; ItemLibraryEntry entry(const QString &name) const; - ItemLibraryEntry addItemLibraryEntry(const NodeMetaInfo &nodeMetaInfo, const QString &itemLibraryRepresentationName); - void remove(const NodeMetaInfo &nodeMetaInfo); - void clear(); + void addEntry(const ItemLibraryEntry &entry); + bool removeEntry(const QString &name); + void clearEntries(); + +signals: + void entriesChanged(); private: - static ItemLibraryInfo createItemLibraryInfo(const ItemLibraryInfo &parentInfo); - QSharedPointer m_data; + ItemLibraryInfo(QObject *parent = 0); + void setBaseInfo(ItemLibraryInfo *baseInfo); + QScopedPointer m_d; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/include/metainfo.h b/src/plugins/qmldesigner/designercore/include/metainfo.h index e6b0ead5bd3..2d4af4dbd0d 100644 --- a/src/plugins/qmldesigner/designercore/include/metainfo.h +++ b/src/plugins/qmldesigner/designercore/include/metainfo.h @@ -74,17 +74,13 @@ public: ~MetaInfo(); MetaInfo& operator=(const MetaInfo &other); - bool hasNodeMetaInfo(const QString &typeName, int majorVersion = 4, int minorVersion = 6) const; - NodeMetaInfo nodeMetaInfo(const QString &typeName, int majorVersion = 4, int minorVersion = 6) const; - - // TODO: Move these to private - bool isSubclassOf(const QString &className, const QString &superClassName) const; - bool isSubclassOf(const ModelNode &modelNode, const QString &superClassName) const; + bool hasNodeMetaInfo(const QString &typeName, int majorVersion = -1, int minorVersion = -1) const; + NodeMetaInfo nodeMetaInfo(const QString &typeName, int majorVersion = -1, int minorVersion = -1) const; bool hasEnumerator(const QString &enumeratorName) const; EnumeratorMetaInfo enumerator(const QString &enumeratorName) const; - ItemLibraryInfo itemLibraryInfo() const; + ItemLibraryInfo *itemLibraryInfo() const; QString fromQtTypes(const QString &type) const; @@ -96,16 +92,8 @@ public: static void setPluginPaths(const QStringList &paths); private: - QStringList superClasses(const QString &className) const; - QStringList directSuperClasses(const QString &className) const; - QList superClasses(const NodeMetaInfo &nodeMetaInfo) const; - QList directSuperClasses(const NodeMetaInfo &nodeMetaInfo) const; - - void addSuperClassRelationship(const QString &superClassName, const QString &className); - - void addNodeInfo(NodeMetaInfo &info, const QString &baseType); + void addNodeInfo(NodeMetaInfo &info); void removeNodeInfo(NodeMetaInfo &info); - void replaceNodeInfo(NodeMetaInfo &oldInfo, NodeMetaInfo &newInfo, const QString &baseType); EnumeratorMetaInfo addEnumerator(const QString &enumeratorScope, const QString &enumeratorName); EnumeratorMetaInfo addFlag(const QString &enumeratorScope, const QString &enumeratorName); diff --git a/src/plugins/qmldesigner/designercore/include/metainfoparser.h b/src/plugins/qmldesigner/designercore/include/metainfoparser.h index 1a087771307..1b83d393e97 100644 --- a/src/plugins/qmldesigner/designercore/include/metainfoparser.h +++ b/src/plugins/qmldesigner/designercore/include/metainfoparser.h @@ -62,7 +62,6 @@ protected: void handleFlagElement(QXmlStreamReader &reader); void handleFlagElementElement(QXmlStreamReader &reader, EnumeratorMetaInfo &enumeratorMetaInfo); void handleNodeElement(QXmlStreamReader &reader); - void handleNodeInheritElement(QXmlStreamReader &reader, const QString &className); void handleNodeItemLibraryEntryElement(QXmlStreamReader &reader, const QString &className); void handleAbstractPropertyElement(QXmlStreamReader &reader, NodeMetaInfo &nodeMetaInfo); void handleAbstractPropertyDefaultValueElement(QXmlStreamReader &reader, NodeMetaInfo &nodeMetaInfo); diff --git a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h index 3dfaa585529..b5a0ab6dce0 100644 --- a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h +++ b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h @@ -82,26 +82,22 @@ public: PropertyMetaInfo property(const QString &propertyName, bool resolveDotSyntax = false) const; QList superClasses() const; - QList directSuperClasses() const; + NodeMetaInfo directSuperClass() const; QHash properties(bool resolveDotSyntax = false) const; - QString typeName() const; int majorVersion() const; int minorVersion() const; + bool availableInVersion(int majorVersion, int minorVersion) const; + bool hasDefaultProperty() const; QString defaultProperty() const; bool hasProperty(const QString &propertyName, bool resolveDotSyntax = false) const; bool isContainer() const; - - bool isWidget() const; - bool isGraphicsWidget() const; - bool isGraphicsObject() const; - bool isQmlGraphicsItem() const; bool isComponent() const; - bool isSubclassOf(const QString& type, int majorVersion = 4, int minorVersion = 6) const; + bool isSubclassOf(const QString& type, int majorVersion, int minorVersio) const; QIcon icon() const; @@ -110,14 +106,13 @@ private: NodeMetaInfo(const MetaInfo &metaInfo); void setInvalid(); - void setTypeName(const QString &typeName); + void setType(const QString &typeName, int majorVersion, int minorVersion); void addProperty(const PropertyMetaInfo &property); void setIsContainer(bool isContainer); void setIcon(const QIcon &icon); void setQmlFile(const QString &filePath); void setDefaultProperty(const QString &defaultProperty); - void setMajorVersion(int version); - void setMinorVersion(int version); + void setSuperClass(const QString &typeName, int majorVersion = -1, int minorVersion = -1); bool hasLocalProperty(const QString &propertyName, bool resolveDotSyntax = false) const; QHash dotProperties() const; diff --git a/src/plugins/qmldesigner/designercore/include/rewriterview.h b/src/plugins/qmldesigner/designercore/include/rewriterview.h index 570dd1f649b..2e4cd1e0257 100644 --- a/src/plugins/qmldesigner/designercore/include/rewriterview.h +++ b/src/plugins/qmldesigner/designercore/include/rewriterview.h @@ -134,6 +134,7 @@ public: TextModifier *textModifier() const; void setTextModifier(TextModifier *textModifier); + QString textModifierContent() const; Internal::ModelNodePositionStorage *positionStorage() const { return m_positionStorage; } diff --git a/src/plugins/qmldesigner/designercore/include/rewritingexception.h b/src/plugins/qmldesigner/designercore/include/rewritingexception.h index dc20adc713c..b20e16f1cb9 100644 --- a/src/plugins/qmldesigner/designercore/include/rewritingexception.h +++ b/src/plugins/qmldesigner/designercore/include/rewritingexception.h @@ -10,12 +10,16 @@ class RewritingException: public Exception public: RewritingException(int line, const QString &function, - const QString &file, const QString &description); + const QString &file, + const QString &description, + const QString &documentTextContent); virtual QString type() const; virtual QString description() const; + QString documentTextContent() const; private: QString m_description; + QString m_documentTextContent; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 3ef92bfa1b7..39876a08a78 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -616,6 +616,7 @@ NodeInstance NodeInstanceView::loadNode(const ModelNode &node, QObject *objectTo void NodeInstanceView::activateState(const NodeInstance &instance) { + activateBaseState(); NodeInstance stateInstance(instance); stateInstance.activateState(); } diff --git a/src/plugins/qmldesigner/designercore/instances/objectnodeinstance.cpp b/src/plugins/qmldesigner/designercore/instances/objectnodeinstance.cpp index f0df1560c10..e52ca995d7c 100644 --- a/src/plugins/qmldesigner/designercore/instances/objectnodeinstance.cpp +++ b/src/plugins/qmldesigner/designercore/instances/objectnodeinstance.cpp @@ -123,13 +123,15 @@ void ObjectNodeInstance::destroy() { if (deleteHeldInstance()) { // Remove from old property - if (object() && modelNode().isValid() && modelNode().parentProperty().isValid()) { + if (object()) { setId(QString()); - NodeAbstractProperty parentProperty = modelNode().parentProperty(); - ModelNode parentNode = parentProperty.parentModelNode(); - if (parentNode.isValid() && nodeInstanceView()->hasInstanceForNode(parentNode)) { - NodeInstance parentInstance = nodeInstanceView()->instanceForNode(parentNode); - reparent(parentInstance, parentProperty.name(), NodeInstance() , QString()); + if (modelNode().isValid() && modelNode().parentProperty().isValid()) { + NodeAbstractProperty parentProperty = modelNode().parentProperty(); + ModelNode parentNode = parentProperty.parentModelNode(); + if (parentNode.isValid() && nodeInstanceView()->hasInstanceForNode(parentNode)) { + NodeInstance parentInstance = nodeInstanceView()->instanceForNode(parentNode); + reparent(parentInstance, parentProperty.name(), NodeInstance() , QString()); + } } } diff --git a/src/plugins/qmldesigner/designercore/instances/qmlgraphicsitemnodeinstance.cpp b/src/plugins/qmldesigner/designercore/instances/qmlgraphicsitemnodeinstance.cpp index aa01e830caa..4f7c39d9db4 100644 --- a/src/plugins/qmldesigner/designercore/instances/qmlgraphicsitemnodeinstance.cpp +++ b/src/plugins/qmldesigner/designercore/instances/qmlgraphicsitemnodeinstance.cpp @@ -150,7 +150,7 @@ QRectF QmlGraphicsItemNodeInstance::boundingRect() const double implicitHeight = qmlGraphicsItem()->implicitHeight(); if (!m_hasHeight - && implicitWidth // WORKAROUND + && implicitHeight // WORKAROUND && implicitHeight != qmlGraphicsItem()->height() && !modelNode().hasBindingProperty("height")) { qmlGraphicsItem()->blockSignals(true); diff --git a/src/plugins/qmldesigner/designercore/instances/qmlpropertychangesnodeinstance.cpp b/src/plugins/qmldesigner/designercore/instances/qmlpropertychangesnodeinstance.cpp index ea2ea618217..6b301754c77 100644 --- a/src/plugins/qmldesigner/designercore/instances/qmlpropertychangesnodeinstance.cpp +++ b/src/plugins/qmldesigner/designercore/instances/qmlpropertychangesnodeinstance.cpp @@ -60,12 +60,16 @@ QDeclarativeStateOperation::ActionList QmlPropertyChangesObject::actions() action.fromValue = action.property.read(); if (m_expressionHash.contains(action.specifiedProperty)) { if(m_expressionHash[action.specifiedProperty].second.isNull()) { - QDeclarativeBinding *binding = new QDeclarativeBinding(m_expressionHash[action.specifiedProperty].first, targetObject(), QDeclarativeEngine::contextForObject(targetObject()), this); - binding->setTarget(action.property); - binding->setNotifyOnValueChanged(true); - action.toBinding = binding; - action.toValue = binding->evaluate(); - m_expressionHash.insert(action.specifiedProperty, ExpressionPair(m_expressionHash[action.specifiedProperty].first, binding)); + if (targetObject()) { + QDeclarativeBinding *binding = new QDeclarativeBinding(m_expressionHash[action.specifiedProperty].first, targetObject(), QDeclarativeEngine::contextForObject(targetObject()), this); + binding->setTarget(action.property); + binding->setNotifyOnValueChanged(true); + action.toBinding = binding; + action.toValue = binding->evaluate(); + m_expressionHash.insert(action.specifiedProperty, ExpressionPair(m_expressionHash[action.specifiedProperty].first, binding)); + } else { + action.toBinding = 0; + } } else { action.toBinding = m_expressionHash[action.specifiedProperty].second.data(); action.toValue = m_expressionHash[action.specifiedProperty].second->evaluate(); @@ -85,6 +89,9 @@ QObject *QmlPropertyChangesObject::targetObject() const void QmlPropertyChangesObject::setTargetObject(QObject *object) { + if (m_targetObject.data() == object) + return; + QMutableListIterator actionIterator(m_qmlActionList); while (actionIterator.hasNext()) { QDeclarativeAction &qmlAction = actionIterator.next(); @@ -92,9 +99,10 @@ void QmlPropertyChangesObject::setTargetObject(QObject *object) if (isActive()) { QDeclarativePropertyPrivate::setBinding(qmlAction.property, 0, QDeclarativePropertyPrivate::DontRemoveBinding| QDeclarativePropertyPrivate::BypassInterceptor); qmlAction.property.write(qmlAction.fromValue); + m_expressionHash[qmlAction.specifiedProperty].second.data()->destroy(); } - m_expressionHash[qmlAction.specifiedProperty].second.data()->destroy(); + qmlAction.toBinding = 0; } diff --git a/src/plugins/qmldesigner/designercore/instances/qmlstatenodeinstance.cpp b/src/plugins/qmldesigner/designercore/instances/qmlstatenodeinstance.cpp index 9713fc85409..bf7103c467d 100644 --- a/src/plugins/qmldesigner/designercore/instances/qmlstatenodeinstance.cpp +++ b/src/plugins/qmldesigner/designercore/instances/qmlstatenodeinstance.cpp @@ -69,9 +69,10 @@ QmlStateNodeInstance::Pointer void QmlStateNodeInstance::activateState() { if (stateGroup()) { - if (!isStateActive()) + if (!isStateActive()) { nodeInstanceView()->setStateInstance(nodeInstanceView()->instanceForNode(modelNode())); stateGroup()->setState(property("name").toString()); + } } } diff --git a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp index 15f681ea749..c640c77b769 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp @@ -55,13 +55,9 @@ public: class ItemLibraryInfoPrivate { public: - typedef QSharedPointer Pointer; - typedef QSharedPointer WeakPointer; + QHash nameToEntryHash; - QMultiHash itemLibraryInfoHash; - QHash itemLibraryInfoHashAll; - - Pointer parentData; + QWeakPointer baseInfo; }; } // namespace Internal @@ -157,9 +153,11 @@ void ItemLibraryEntry::setName(const QString &name) m_data->name = name; } -void ItemLibraryEntry::setTypeName(const QString &typeName) +void ItemLibraryEntry::setType(const QString &typeName, int majorVersion, int minorVersion) { m_data->typeName = typeName; + m_data->majorVersion = majorVersion; + m_data->minorVersion = minorVersion; } void ItemLibraryEntry::setIcon(const QIcon &icon) @@ -167,16 +165,6 @@ void ItemLibraryEntry::setIcon(const QIcon &icon) m_data->icon = icon; } -void ItemLibraryEntry::setMajorVersion(int majorVersion) -{ - m_data->majorVersion = majorVersion; -} - -void ItemLibraryEntry::setMinorVersion(int minorVersion) -{ - m_data->minorVersion = minorVersion; -} - void ItemLibraryEntry::setQml(const QString &qml) { m_data->qml = qml; @@ -221,13 +209,9 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry) // ItemLibraryInfo // -ItemLibraryInfo::ItemLibraryInfo(const ItemLibraryInfo &other) : - m_data(other.m_data) -{ -} - -ItemLibraryInfo::ItemLibraryInfo() : - m_data(new Internal::ItemLibraryInfoPrivate()) +ItemLibraryInfo::ItemLibraryInfo(QObject *parent) : + QObject(parent), + m_d(new Internal::ItemLibraryInfoPrivate()) { } @@ -235,85 +219,72 @@ ItemLibraryInfo::~ItemLibraryInfo() { } -ItemLibraryInfo& ItemLibraryInfo::operator=(const ItemLibraryInfo &other) +QList ItemLibraryInfo::entriesForType(const QString &typeName, int majorVersion, int minorVersion) const { - m_data = other.m_data; - return *this; -} + QList entries; -bool ItemLibraryInfo::isValid() -{ - return m_data; -} - -ItemLibraryInfo ItemLibraryInfo::createItemLibraryInfo(const ItemLibraryInfo &parentInfo) -{ - ItemLibraryInfo info; - Q_ASSERT(parentInfo.m_data); - info.m_data->parentData = parentInfo.m_data; - return info; -} - -QList ItemLibraryInfo::entriesForNodeMetaInfo(const NodeMetaInfo &nodeMetaInfo) const -{ - QList itemLibraryItems; - - Internal::ItemLibraryInfoPrivate::WeakPointer pointer(m_data); - while (pointer) { - itemLibraryItems += pointer->itemLibraryInfoHash.values(nodeMetaInfo); - pointer = pointer->parentData; + foreach (const ItemLibraryEntry &entry, m_d->nameToEntryHash.values()) { + if (entry.typeName() == typeName + && entry.majorVersion() == majorVersion + && entry.minorVersion() == minorVersion) + entries += entry; } - return itemLibraryItems; + + if (m_d->baseInfo) + entries += m_d->baseInfo->entriesForType(typeName, majorVersion, minorVersion); + + return entries; } ItemLibraryEntry ItemLibraryInfo::entry(const QString &name) const { - Internal::ItemLibraryInfoPrivate::WeakPointer pointer(m_data); - while (pointer) { - if (pointer->itemLibraryInfoHashAll.contains(name)) - return pointer->itemLibraryInfoHashAll.value(name); - pointer = pointer->parentData; - } + if (m_d->nameToEntryHash.contains(name)) + return m_d->nameToEntryHash.value(name); + + if (m_d->baseInfo) + return m_d->baseInfo->entry(name); return ItemLibraryEntry(); } - QList ItemLibraryInfo::entries() const { - QList list; - - Internal::ItemLibraryInfoPrivate::WeakPointer pointer(m_data); - while (pointer) { - list += pointer->itemLibraryInfoHashAll.values(); - pointer = pointer->parentData; - } + QList list = m_d->nameToEntryHash.values(); + if (m_d->baseInfo) + list += m_d->baseInfo->entries(); return list; } -ItemLibraryEntry ItemLibraryInfo::addItemLibraryEntry(const NodeMetaInfo &nodeMetaInfo, - const QString &itemLibraryRepresentationName) +void ItemLibraryInfo::addEntry(const ItemLibraryEntry &entry) { - ItemLibraryEntry itemLibraryType; - itemLibraryType.setName(itemLibraryRepresentationName); - itemLibraryType.setTypeName(nodeMetaInfo.typeName()); - itemLibraryType.setMajorVersion(nodeMetaInfo.majorVersion()); - itemLibraryType.setMinorVersion(nodeMetaInfo.minorVersion()); - m_data->itemLibraryInfoHash.insert(nodeMetaInfo, itemLibraryType); - m_data->itemLibraryInfoHashAll.insert(itemLibraryRepresentationName, itemLibraryType); - return itemLibraryType; + if (m_d->nameToEntryHash.contains(entry.name())) + throw InvalidMetaInfoException(__LINE__, __FUNCTION__, __FILE__); + m_d->nameToEntryHash.insert(entry.name(), entry); + + emit entriesChanged(); } -void ItemLibraryInfo::remove(const NodeMetaInfo &info) +bool ItemLibraryInfo::removeEntry(const QString &name) { - m_data->itemLibraryInfoHash.remove(info); - m_data->itemLibraryInfoHashAll.remove(info.typeName()); + if (m_d->nameToEntryHash.remove(name)) { + emit entriesChanged(); + return true; + } + if (m_d->baseInfo) + return m_d->baseInfo->removeEntry(name); + + return false; } -void ItemLibraryInfo::clear() +void ItemLibraryInfo::clearEntries() { - m_data->itemLibraryInfoHash.clear(); - m_data->itemLibraryInfoHashAll.clear(); + m_d->nameToEntryHash.clear(); + emit entriesChanged(); +} + +void ItemLibraryInfo::setBaseInfo(ItemLibraryInfo *baseInfo) +{ + m_d->baseInfo = baseInfo; } } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp index 1c79dca045e..724f3780daf 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp @@ -71,7 +71,7 @@ public: void parseQmlTypes(); void parseNonQmlTypes(); void parseValueTypes(); - void parseNonQmlClassRecursively(const QMetaObject *qMetaObject); + void parseNonQmlClassRecursively(const QMetaObject *qMetaObject, int majorVersion, int minorVersion); void parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const; void parseClassInfo(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const; @@ -79,30 +79,29 @@ public: void parseXmlFiles(); - QMultiHash m_superClassHash; // the list of direct superclasses - QHash m_nodeMetaInfoHash; + QMultiHash m_nodeMetaInfoHash; QHash m_enumeratorMetaInfoHash; QHash m_QtTypesToQmlTypes; - ItemLibraryInfo m_itemLibraryInfo; + QScopedPointer m_itemLibraryInfo; MetaInfo *m_q; bool m_isInitialized; }; MetaInfoPrivate::MetaInfoPrivate(MetaInfo *q) : + m_itemLibraryInfo(new ItemLibraryInfo()), m_q(q), m_isInitialized(false) { if (!m_q->isGlobal()) - m_itemLibraryInfo = ItemLibraryInfo::createItemLibraryInfo(m_q->global().itemLibraryInfo()); + m_itemLibraryInfo->setBaseInfo(MetaInfo::global().itemLibraryInfo()); } void MetaInfoPrivate::clear() { - m_superClassHash.clear(); m_nodeMetaInfoHash.clear(); m_enumeratorMetaInfoHash.clear(); - m_itemLibraryInfo.clear(); + m_itemLibraryInfo->clearEntries(); m_isInitialized = false; } @@ -188,7 +187,7 @@ void MetaInfoPrivate::parseClassInfo(NodeMetaInfo &nodeMetaInfo, const QMetaObje } } -void MetaInfoPrivate::parseNonQmlClassRecursively(const QMetaObject *qMetaObject) +void MetaInfoPrivate::parseNonQmlClassRecursively(const QMetaObject *qMetaObject, int majorVersion, int minorVersion) { Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject"); const QString className = qMetaObject->className(); @@ -198,20 +197,22 @@ void MetaInfoPrivate::parseNonQmlClassRecursively(const QMetaObject *qMetaObject return; } - if ( !m_q->hasNodeMetaInfo(className) - && !QDeclarativeMetaType::qmlTypeNames().contains(typeName(qMetaObject).toAscii()) ) { + if (!m_q->hasNodeMetaInfo(typeName(qMetaObject), majorVersion, minorVersion)) { NodeMetaInfo nodeMetaInfo(*m_q); - nodeMetaInfo.setTypeName(typeName(qMetaObject)); + nodeMetaInfo.setType(typeName(qMetaObject), majorVersion, minorVersion); parseProperties(nodeMetaInfo, qMetaObject); parseClassInfo(nodeMetaInfo, qMetaObject); if (debug) - qDebug() << "adding non qml type" << className << typeName(qMetaObject) << ", parent type" << typeName(qMetaObject->superClass()); - m_q->addNodeInfo(nodeMetaInfo, typeName(qMetaObject->superClass())); + qDebug() << "adding non qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion() << ", parent type" << typeName(qMetaObject->superClass()); + if (qMetaObject->superClass()) + nodeMetaInfo.setSuperClass(typeName(qMetaObject->superClass())); + + m_q->addNodeInfo(nodeMetaInfo); } if (const QMetaObject *superClass = qMetaObject->superClass()) { - parseNonQmlClassRecursively(superClass); + parseNonQmlClassRecursively(superClass, majorVersion, minorVersion); } } @@ -246,7 +247,7 @@ void MetaInfoPrivate::parseValueTypes() foreach (const QString &type, valueTypes) { NodeMetaInfo nodeMetaInfo(*m_q); - nodeMetaInfo.setTypeName(type); + nodeMetaInfo.setType(type, -1, -1); foreach (const QString &propertyName, VariantParser::create(type).properties()) { PropertyMetaInfo propertyInfo; propertyInfo.setName(propertyName); @@ -284,7 +285,7 @@ void MetaInfoPrivate::parseValueTypes() } if (debug) qDebug() << "adding value type" << nodeMetaInfo.typeName(); - m_q->addNodeInfo(nodeMetaInfo, QString()); + m_q->addNodeInfo(nodeMetaInfo); } } @@ -303,9 +304,7 @@ void MetaInfoPrivate::parseQmlTypes() continue; NodeMetaInfo nodeMetaInfo(*m_q); - nodeMetaInfo.setTypeName(qmlType->qmlTypeName()); - nodeMetaInfo.setMajorVersion(qmlType->majorVersion()); - nodeMetaInfo.setMinorVersion(qmlType->minorVersion()); + nodeMetaInfo.setType(qmlType->qmlTypeName(), qmlType->majorVersion(), qmlType->minorVersion()); parseProperties(nodeMetaInfo, qMetaObject); parseClassInfo(nodeMetaInfo, qMetaObject); @@ -318,7 +317,11 @@ void MetaInfoPrivate::parseQmlTypes() superTypeName = typeName(qmlType->baseMetaObject()->superClass()); } - m_q->addNodeInfo(nodeMetaInfo, superTypeName); + nodeMetaInfo.setSuperClass(superTypeName); + + if (debug) + qDebug() << "adding qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion() << "super class" << superTypeName; + m_q->addNodeInfo(nodeMetaInfo); } } @@ -326,10 +329,10 @@ void MetaInfoPrivate::parseNonQmlTypes() { foreach (QDeclarativeType *qmlType, QDeclarativeMetaType::qmlTypes()) { if (!qmlType->qmlTypeName().contains("Bauhaus")) - parseNonQmlClassRecursively(qmlType->metaObject()); + parseNonQmlClassRecursively(qmlType->metaObject(), qmlType->majorVersion(), qmlType->minorVersion()); } - parseNonQmlClassRecursively(&QDeclarativeAnchors::staticMetaObject); + parseNonQmlClassRecursively(&QDeclarativeAnchors::staticMetaObject, -1, -1); } @@ -411,10 +414,13 @@ MetaInfo& MetaInfo::operator=(const MetaInfo &other) /*! \brief Returns whether a type with the given name is registered in the meta system. */ -bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int /*majorVersion*/, int /*minorVersion*/) const +bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const { - if (m_p->m_nodeMetaInfoHash.contains(typeName)) - return true; + foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) { + if (info.availableInVersion(majorVersion, minorVersion)) { + return true; + } + } if (!isGlobal()) return global().hasNodeMetaInfo(typeName); return false; @@ -423,75 +429,20 @@ bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int /*majorVersion*/, in /*! \brief Returns meta information for a qml type. An invalid NodeMetaInfo object if the type is unknown. */ -NodeMetaInfo MetaInfo::nodeMetaInfo(const QString &typeName, int /*majorVersion*/, int /*minorVersion*/) const +NodeMetaInfo MetaInfo::nodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const { - if (m_p->m_nodeMetaInfoHash.contains(typeName)) - return m_p->m_nodeMetaInfoHash.value(typeName, NodeMetaInfo()); + foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) { + // todo: The order for different types for different versions is random here. + if (info.availableInVersion(majorVersion, minorVersion)) { + return info; + } + } if (!isGlobal()) return global().nodeMetaInfo(typeName); return NodeMetaInfo(); } -QStringList MetaInfo::superClasses(const QString &className) const -{ - QStringList ancestorList = m_p->m_superClassHash.values(className); - foreach (const QString &ancestor, ancestorList) { - QStringList superClassList = superClasses(ancestor); - if (!superClassList.isEmpty()) - ancestorList += superClassList; - } - if (!isGlobal()) - ancestorList += global().superClasses(className); - return ancestorList; -} - -QStringList MetaInfo::directSuperClasses(const QString &className) const -{ - QStringList directAncestorList = m_p->m_superClassHash.values(className); - if (!isGlobal()) - directAncestorList += global().directSuperClasses(className); - return directAncestorList; -} - -QList MetaInfo::superClasses(const NodeMetaInfo &nodeInfo) const -{ - if (!nodeInfo.isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return QList(); - } - - QList superClassList; - - foreach (const QString &typeName, superClasses(nodeInfo.typeName())) { - if (!hasNodeMetaInfo(typeName)) - continue; - const NodeMetaInfo superClass = nodeMetaInfo(typeName); - if (!superClassList.contains(superClass)) - superClassList.append(superClass); - } - return superClassList; -} - -QList MetaInfo::directSuperClasses(const NodeMetaInfo &nodeInfo) const -{ - if (!nodeInfo.isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return QList(); - } - - QList superClassList; - - foreach (const QString &typeName, directSuperClasses(nodeInfo.typeName())) { - if (!hasNodeMetaInfo(typeName)) - continue; - const NodeMetaInfo superClass = nodeMetaInfo(typeName); - if (!superClassList.contains(superClass)) - superClassList.append(superClass); - } - return superClassList; -} - QString MetaInfo::fromQtTypes(const QString &type) const { if (m_p->m_QtTypesToQmlTypes.contains(type)) @@ -500,27 +451,6 @@ QString MetaInfo::fromQtTypes(const QString &type) const return type; } -/*! - \brief Returns whether className is the same type or a type derived from superClassName. - */ -bool MetaInfo::isSubclassOf(const QString &className, const QString &superClassName) const -{ - return (className == superClassName) || superClasses(className).contains(superClassName); -} - -/*! - \brief Returns whether the type of modelNode is the same type or a type derived from superClassName. - \throws InvalidModelNode if !modelNode.isValid() - */ -bool MetaInfo::isSubclassOf(const ModelNode &modelNode, const QString &superClassName) const -{ - if (!modelNode.isValid()) { - Q_ASSERT_X(modelNode.isValid(), Q_FUNC_INFO, "Invalid modelNode argument"); - throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); - } - return (modelNode.type() == superClassName) || isSubclassOf(modelNode.type(), superClassName); -} - /*! \brief Returns whether an enumerator is registered in the meta type system. */ @@ -542,9 +472,9 @@ EnumeratorMetaInfo MetaInfo::enumerator(const QString &enumeratorName) const return EnumeratorMetaInfo(); } -ItemLibraryInfo MetaInfo::itemLibraryInfo() const +ItemLibraryInfo *MetaInfo::itemLibraryInfo() const { - return m_p->m_itemLibraryInfo; + return m_p->m_itemLibraryInfo.data(); } /*! @@ -580,28 +510,13 @@ void MetaInfo::setPluginPaths(const QStringList &paths) s_pluginDirs = paths; } -/*! - This bypasses the notifications to the model that the metatype has changed. - Use MetaInfo::addNodeInfo() instead - */ -void MetaInfo::addSuperClassRelationship(const QString &superClassName, const QString &className) -{ - m_p->m_superClassHash.insert(className, superClassName); -} - -void MetaInfo::addNodeInfo(NodeMetaInfo &nodeInfo, const QString &baseType) +void MetaInfo::addNodeInfo(NodeMetaInfo &nodeInfo) { if (nodeInfo.typeName().isEmpty() || nodeInfo.metaInfo() != *this) throw new InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, QLatin1String("nodeInfo")); - if (nodeInfo.typeName() == baseType) // prevent simple recursion - throw new InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, QLatin1String("baseType")); - m_p->m_nodeMetaInfoHash.insert(nodeInfo.typeName(), nodeInfo); - - if (!baseType.isEmpty()) { - m_p->m_superClassHash.insert(nodeInfo.typeName(), baseType); - } + m_p->m_nodeMetaInfoHash.insertMulti(nodeInfo.typeName(), nodeInfo); } void MetaInfo::removeNodeInfo(NodeMetaInfo &info) @@ -611,12 +526,13 @@ void MetaInfo::removeNodeInfo(NodeMetaInfo &info) return; } - if (m_p->m_nodeMetaInfoHash.contains(info.typeName())) { - m_p->m_nodeMetaInfoHash.remove(info.typeName()); + if (m_p->m_nodeMetaInfoHash.contains(info.typeName()) + && m_p->m_nodeMetaInfoHash.remove(info.typeName(), info)) { - m_p->m_superClassHash.remove(info.typeName()); - // TODO: Other types might specify type as parent type - m_p->m_itemLibraryInfo.remove(info); + foreach (const ItemLibraryEntry &entry, + m_p->m_itemLibraryInfo->entriesForType(info.typeName(), info.majorVersion(), info.minorVersion())) { + m_p->m_itemLibraryInfo->removeEntry(entry.name()); + } } else if (!isGlobal()) { global().removeNodeInfo(info); @@ -627,11 +543,6 @@ void MetaInfo::removeNodeInfo(NodeMetaInfo &info) info.setInvalid(); } -void MetaInfo::replaceNodeInfo(NodeMetaInfo & /*oldInfo*/, NodeMetaInfo & /*newInfo*/, const QString & /*baseType*/) -{ - // TODO -} - EnumeratorMetaInfo MetaInfo::addEnumerator(const QString &enumeratorScope, const QString &enumeratorName) { Q_ASSERT(!enumeratorName.isEmpty()); diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp index 6b899b73eb3..216ba28dd37 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp @@ -187,7 +187,6 @@ void MetaInfoParser::handleNodeElement(QXmlStreamReader &reader) while (!reader.atEnd() && !(reader.isEndElement() && reader.name() == "node")) { reader.readNext(); - handleNodeInheritElement(reader, className); handleAbstractPropertyElement(reader, nodeMetaInfo); handleAbstractPropertyDefaultValueElement(reader, nodeMetaInfo); handleNodeItemLibraryEntryElement(reader, className); @@ -198,32 +197,27 @@ void MetaInfoParser::handleNodeItemLibraryEntryElement(QXmlStreamReader &reader, { if (reader.isStartElement() && reader.name() == "itemlibraryentry") { - QString name = reader.attributes().value("name").toString(); - ItemLibraryEntry itemLibraryEntry = m_metaInfo.itemLibraryInfo().addItemLibraryEntry(m_metaInfo.nodeMetaInfo(className), name); + const QString name = reader.attributes().value("name").toString(); + const NodeMetaInfo typeInfo = m_metaInfo.nodeMetaInfo(className); + + ItemLibraryEntry entry; + entry.setType(typeInfo.typeName(), typeInfo.majorVersion(), typeInfo.minorVersion()); + entry.setName(name); QString iconPath = reader.attributes().value("icon").toString(); if (!iconPath.isEmpty()) - itemLibraryEntry.setIcon(QIcon(iconPath)); + entry.setIcon(QIcon(iconPath)); QString category = reader.attributes().value("category").toString(); if (!category.isEmpty()) - itemLibraryEntry.setCategory(category); + entry.setCategory(category); while (!reader.atEnd() && !(reader.isEndElement() && reader.name() == "itemlibraryentry")) { reader.readNext(); - handleItemLibraryEntryPropertyElement(reader, itemLibraryEntry); + handleItemLibraryEntryPropertyElement(reader, entry); } - } -} -void MetaInfoParser::handleNodeInheritElement(QXmlStreamReader &reader, const QString &className) -{ - if (reader.isStartElement() && reader.name() == "inherits") - { - QString superClassName = reader.attributes().value("name").toString(); - Q_ASSERT(!superClassName.isEmpty()); - m_metaInfo.addSuperClassRelationship(superClassName, className); - reader.readNext(); + m_metaInfo.itemLibraryInfo()->addEntry(entry); } } diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index d4f60bee8cc..a7891745f67 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -76,6 +76,11 @@ public: QString category; QString qmlFile; QString defaultProperty; + + QString superClassType; + int superClassMajorVersion; + int superClassMinorVersion; + int majorVersion; int minorVersion; }; @@ -179,7 +184,7 @@ QObject *NodeMetaInfo::createInstance(QDeclarativeContext *context) const newContext->setParent(object); } else { // primitive - object = QDeclarativeMetaType::qmlType(typeName().toAscii(), minorVersion(), majorVersion())->create(); + object = QDeclarativeMetaType::qmlType(typeName().toAscii(), majorVersion(), minorVersion())->create(); if (object && context) QDeclarativeEngine::setContextForObject(object, context); } @@ -198,22 +203,39 @@ QList NodeMetaInfo::superClasses() const return QList(); } - return m_data->metaInfo.superClasses(*this); + QList types; + + NodeMetaInfo superType = directSuperClass(); + if (superType.isValid()) { + types += superType; + types += superType.superClasses(); + } + + return types; } /*! - \brief Returns direct ancestor types. - - \throws InvalidMetaInfoException if the object is not valid + \brief Returns direct ancestor type. An invalid type if there is none. */ -QList NodeMetaInfo::directSuperClasses() const +NodeMetaInfo NodeMetaInfo::directSuperClass() const { if (!isValid()) { qWarning() << "NodeMetaInfo is invalid"; - return QList(); + return NodeMetaInfo(); } - return m_data->metaInfo.directSuperClasses(*this); + if (!m_data->superClassType.isEmpty()) { + int superClassMajorVersion = m_data->superClassMajorVersion; + int superClassMinorVersion = m_data->superClassMinorVersion; + if (superClassMajorVersion == -1) { + // If we don't know the version of the super type, assume that it's the same like our version. + superClassMajorVersion = majorVersion(); + superClassMinorVersion = minorVersion(); + } + return m_data->metaInfo.nodeMetaInfo(m_data->superClassType, + superClassMajorVersion, superClassMinorVersion); + } + return NodeMetaInfo(); } /*! @@ -225,7 +247,7 @@ QList NodeMetaInfo::directSuperClasses() const \throws InvalidMetaInfoException if the object is not valid */ -QHash NodeMetaInfo::properties(bool resolveDotSyntax ) const +QHash NodeMetaInfo::properties(bool resolveDotSyntax) const { if (!isValid()) { qWarning() << "NodeMetaInfo is invalid"; @@ -234,7 +256,8 @@ QHash NodeMetaInfo::properties(bool resolveDotSyntax ) QHash propertiesInfo; propertiesInfo = m_data->propertyMetaInfoHash; - foreach (const NodeMetaInfo &nodeInfo, directSuperClasses()) { + + foreach (const NodeMetaInfo &nodeInfo, superClasses()) { QHash superClassProperties = nodeInfo.properties(); QHashIterator iter(superClassProperties); while (iter.hasNext()) { @@ -318,7 +341,7 @@ PropertyMetaInfo NodeMetaInfo::property(const QString &propertyName, bool resolv propertyType = propertyType.left(propertyType.size() - 1).trimmed(); nodeInfo = m_data->metaInfo.nodeMetaInfo(m_data->metaInfo.fromQtTypes(propertyType), majorVersion(), minorVersion()); if (!nodeInfo.isValid()) { - qDebug() << "no type info available for" << propertyType; + qWarning() << "no type info available for" << propertyType; break; } } @@ -330,7 +353,7 @@ PropertyMetaInfo NodeMetaInfo::property(const QString &propertyName, bool resolv if (hasLocalProperty(propertyName)) { propertyMetaInfo = m_data->propertyMetaInfoHash.value(propertyName, PropertyMetaInfo()); } else { - foreach (const NodeMetaInfo &superTypeMetaInfo, directSuperClasses()) { + foreach (const NodeMetaInfo &superTypeMetaInfo, superClasses()) { Q_ASSERT(superTypeMetaInfo.isValid()); propertyMetaInfo = superTypeMetaInfo.property(propertyName); if (propertyMetaInfo.isValid()) @@ -373,7 +396,7 @@ bool NodeMetaInfo::hasLocalProperty(const QString &propertyName, bool resolveDot propertyType = propertyType.left(propertyType.size() - 1).trimmed(); nodeInfo = m_data->metaInfo.nodeMetaInfo(m_data->metaInfo.fromQtTypes(propertyType), majorVersion(), minorVersion()); if (!nodeInfo.isValid()) { - qDebug() << "no type info available for" << propertyType; + qWarning() << "no type info available for" << propertyType; break; } } @@ -399,10 +422,8 @@ bool NodeMetaInfo::hasProperty(const QString &propertyName, bool resolveDotSynta if (hasLocalProperty(propertyName, resolveDotSyntax)) return true; - foreach (const NodeMetaInfo &nodeMetaInfo, directSuperClasses()) { - if (nodeMetaInfo.hasProperty(propertyName, resolveDotSyntax)) - return true; - } + if (directSuperClass().hasProperty(propertyName, resolveDotSyntax)) + return true; return false; } @@ -443,7 +464,7 @@ int NodeMetaInfo::majorVersion() const return -1; } - return 4; + return m_data->majorVersion; } @@ -461,6 +482,13 @@ int NodeMetaInfo::minorVersion() const return m_data->minorVersion; } +bool NodeMetaInfo::availableInVersion(int majorVersion, int minorVersion) const +{ + return ((majorVersion > m_data->majorVersion) + || (majorVersion == m_data->majorVersion && minorVersion >= m_data->minorVersion)) + || (majorVersion == -1 && minorVersion == -1); +} + bool NodeMetaInfo::hasDefaultProperty() const { if (!isValid()) { @@ -488,14 +516,14 @@ void NodeMetaInfo::setDefaultProperty(const QString &defaultProperty) m_data->defaultProperty = defaultProperty; } -void NodeMetaInfo::setMajorVersion(int version) +void NodeMetaInfo::setSuperClass(const QString &typeName, int majorVersion, int minorVersion) { - m_data->majorVersion = version; -} - -void NodeMetaInfo::setMinorVersion(int version) -{ - m_data->minorVersion = version; + if (!isValid()) { + return; + } + m_data->superClassType = typeName; + m_data->superClassMajorVersion = majorVersion; + m_data->superClassMinorVersion = minorVersion; } void NodeMetaInfo::setInvalid() @@ -506,13 +534,15 @@ void NodeMetaInfo::setInvalid() m_data = 0; } -void NodeMetaInfo::setTypeName(const QString &typeName) +void NodeMetaInfo::setType(const QString &typeName, int majorVersion, int minorVersion) { if (!isValid()) { qWarning() << "NodeMetaInfo is invalid"; return; } m_data->typeName = typeName; + m_data->majorVersion = majorVersion; + m_data->minorVersion = minorVersion; } uint qHash(const NodeMetaInfo &nodeMetaInfo) @@ -572,67 +602,6 @@ void NodeMetaInfo::setIcon(const QIcon &icon) m_data->icon = icon; } -/*! - \brief Returns whether the type inherits from "QWidget". - - \throws InvalidMetaInfoException if the object is not valid - */ -bool NodeMetaInfo::isWidget() const -{ - if (!isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return false; - } - return m_data->metaInfo.isSubclassOf(m_data->typeName, "Qt/QWidget"); -} - -/*! - \brief Returns whether the type inherits from "QGraphicsWidget". - - \throws InvalidMetaInfoException if the object is not valid - */ -bool NodeMetaInfo::isGraphicsWidget() const -{ - if (!isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return false; - } - return m_data->metaInfo.isSubclassOf(m_data->typeName, "Qt/QGraphicsWidget"); -} - -/*! - \brief Returns whether the type inherits from "QGraphicsObject". - - \throws InvalidMetaInfoException if the object is not valid - */ -bool NodeMetaInfo::isGraphicsObject() const -{ - if (!isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return false; - } - return m_data->metaInfo.isSubclassOf(m_data->typeName, "QGraphicsObject"); -} - -/*! - \brief Returns whether the type inherits from "Item/QDeclarativeItem". - - \throws InvalidMetaInfoException if the object is not valid - */ -bool NodeMetaInfo::isQmlGraphicsItem() const -{ - if (!isValid()) { - qWarning() << "NodeMetaInfo is invalid"; - return false; - } - - if (m_data->isFXItem == Internal::NodeMetaInfoData::Unknown) { - m_data->isFXItem = m_data->metaInfo.isSubclassOf(m_data->typeName, "Qt/Item") ? Internal::NodeMetaInfoData::Yes : Internal::NodeMetaInfoData::No; - } - - return m_data->isFXItem == Internal::NodeMetaInfoData::Yes; -} - bool NodeMetaInfo::isComponent() const { if (!isValid()) { @@ -648,13 +617,23 @@ bool NodeMetaInfo::isComponent() const \throws InvalidMetaInfoException if the object is not valid */ -bool NodeMetaInfo::isSubclassOf(const QString &type, int /*majorVersion*/, int /*minorVersion*/) const +bool NodeMetaInfo::isSubclassOf(const QString &type, int majorVersion, int minorVersion) const { if (!isValid()) { qWarning() << "NodeMetaInfo is invalid"; return false; } - return m_data->metaInfo.isSubclassOf(m_data->typeName, type); + + if (typeName() == type + && availableInVersion(majorVersion, minorVersion)) + return true; + + foreach (const NodeMetaInfo &superClass, superClasses()) { + if (superClass.typeName() == type + && superClass.availableInVersion(majorVersion, minorVersion)) + return true; + } + return false; } void NodeMetaInfo::setQmlFile(const QString &filePath) diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index 8bae3ebba17..3f6330f4122 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -295,18 +295,21 @@ void SubComponentManagerPrivate::registerQmlFile(const QFileInfo &fileInfo, cons const QDeclarativeDomObject rootObject = document.rootObject(); - const QString baseType = document.rootObject().objectType(); - Q_ASSERT_X(!baseType.isEmpty(), Q_FUNC_INFO, "Type of root object cannot be empty"); - NodeMetaInfo nodeInfo(m_metaInfo); - nodeInfo.setTypeName(componentName); + nodeInfo.setType(componentName, -1, -1); nodeInfo.setQmlFile(fileInfo.filePath()); + nodeInfo.setSuperClass(rootObject.objectType(), + rootObject.objectTypeMajorVersion(), + rootObject.objectTypeMinorVersion()); // Add file components to the library - ItemLibraryEntry itemLibType = m_metaInfo.itemLibraryInfo().addItemLibraryEntry(nodeInfo, componentName); - itemLibType.setCategory(tr("QML Components")); + ItemLibraryEntry itemLibraryEntry; + itemLibraryEntry.setType(nodeInfo.typeName(), nodeInfo.majorVersion(), nodeInfo.minorVersion()); + itemLibraryEntry.setName(componentName); + itemLibraryEntry.setCategory(tr("QML Components")); + m_metaInfo.itemLibraryInfo()->addEntry(itemLibraryEntry); - m_metaInfo.addNodeInfo(nodeInfo, baseType); + m_metaInfo.addNodeInfo(nodeInfo); foreach (const QDeclarativeDomDynamicProperty &dynamicProperty, document.rootObject().dynamicProperties()) { Q_ASSERT(!dynamicProperty.propertyName().isEmpty()); diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp index c629541cf17..3cfafe5008c 100644 --- a/src/plugins/qmldesigner/designercore/model/model.cpp +++ b/src/plugins/qmldesigner/designercore/model/model.cpp @@ -403,7 +403,7 @@ void ModelPrivate::resetModelByRewriter(const QString &description) } Q_ASSERT(rewriterView); rewriterView->resetToLastCorrectQml(); - throw RewritingException(__LINE__, __FUNCTION__, __FILE__, description); + throw RewritingException(__LINE__, __FUNCTION__, __FILE__, description, rewriterView->textModifierContent()); } diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp index 01c6d2eec17..ae081e94d41 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp @@ -33,9 +33,15 @@ #include "itemlibraryinfo.h" #include "modelutilities.h" #include "mathutils.h" +#include "invalididexception.h" #include #include #include +#include + +enum { + debug = false +}; namespace QmlDesigner { @@ -159,13 +165,20 @@ QmlItemNode QmlModelView::createQmlItemNode(const ItemLibraryEntry &itemLibraryE QString id; int i = 1; QString name(itemLibraryEntry.name().toLower()); - name.remove(QLatin1Char(' ')); + //remove forbidden characters + name.replace(QRegExp(QLatin1String("[^a-zA-Z0-9_]")), QLatin1String("_")); do { id = name + QString::number(i); i++; } while (hasId(id)); //If the name already exists count upwards - newNode.setId(id); + try { + newNode.setId(id); + } catch (InvalidIdException &e) { + // should never happen + QMessageBox::warning(0, tr("Invalid Id"), e.description()); + } + if (!currentState().isBaseState()) { newNode.modelNode().variantProperty("visible") = false; newNode.setVariantProperty("visible", true); @@ -226,12 +239,16 @@ QmlObjectNode QmlModelView::fxObjectNodeForId(const QString &id) void QmlModelView::customNotification(const AbstractView * /* view */, const QString &identifier, const QList &nodeList, const QList & /* data */) { + if (debug) + qDebug() << this << __FUNCTION__ << identifier << nodeList; + if (identifier == "__state changed__") { QmlModelState state(nodeList.first()); - if (state.isValid()) + if (state.isValid()) { activateState(state); - else + } else { activateState(baseState()); + } } } @@ -280,6 +297,8 @@ static bool isTransformProperty(const QString &name) void QmlModelView::nodeInstancePropertyChanged(const ModelNode &node, const QString &propertyName) { + if (debug) + qDebug() << this << __FUNCTION__ << node << propertyName; QmlObjectNode qmlObjectNode(node); @@ -298,6 +317,9 @@ void QmlModelView::nodeInstancePropertyChanged(const ModelNode &node, const QStr void QmlModelView::activateState(const QmlModelState &state) { + if (debug) + qDebug() << this << __FUNCTION__ << state; + if (!state.isValid()) return; @@ -317,6 +339,9 @@ void QmlModelView::activateState(const QmlModelState &state) void QmlModelView::changeToState(const ModelNode &node, const QString &stateName) { + if (debug) + qDebug() << this << __FUNCTION__ << node << stateName; + QmlItemNode itemNode(node); QmlModelState newState; @@ -346,8 +371,10 @@ void QmlModelView::otherPropertyChanged(const QmlObjectNode &/*qmlObjectNode*/, { } -void QmlModelView::stateChanged(const QmlModelState &/*newQmlModelState*/, const QmlModelState &/*oldQmlModelState*/) +void QmlModelView::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState) { + if (debug) + qDebug() << this << __FUNCTION__ << oldQmlModelState << "to" << newQmlModelState; } } //QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp index ba98c801c12..71746b7f062 100644 --- a/src/plugins/qmldesigner/designercore/model/rewriterview.cpp +++ b/src/plugins/qmldesigner/designercore/model/rewriterview.cpp @@ -382,6 +382,14 @@ void RewriterView::setTextModifier(TextModifier *textModifier) connect(m_textModifier, SIGNAL(textChanged()), this, SLOT(qmlTextChanged())); } +QString RewriterView::textModifierContent() const +{ + if (textModifier()) + return textModifier()->text(); + + return QString(); +} + void RewriterView::applyModificationGroupChanges() { Q_ASSERT(transactionLevel == 0); @@ -397,7 +405,7 @@ void RewriterView::applyChanges() if (inErrorState()) { qDebug() << "RewriterView::applyChanges() got called while in error state. Will do a quick-exit now."; - throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state"); + throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state", textModifierContent()); } try { @@ -410,7 +418,7 @@ void RewriterView::applyChanges() } if (inErrorState()) { - throw RewritingException(__LINE__, __FUNCTION__, __FILE__, m_rewritingErrorMessage); + throw RewritingException(__LINE__, __FUNCTION__, __FILE__, m_rewritingErrorMessage, textModifierContent()); } } diff --git a/src/plugins/qmldesigner/fxplugin/fx.metainfo b/src/plugins/qmldesigner/fxplugin/fx.metainfo index 0520af0d2db..a72bc012dcf 100644 --- a/src/plugins/qmldesigner/fxplugin/fx.metainfo +++ b/src/plugins/qmldesigner/fxplugin/fx.metainfo @@ -42,7 +42,6 @@ - diff --git a/src/plugins/qt4projectmanager/qmakestep.ui b/src/plugins/qt4projectmanager/qmakestep.ui index 801f839f010..16618e9ae7b 100644 --- a/src/plugins/qt4projectmanager/qmakestep.ui +++ b/src/plugins/qt4projectmanager/qmakestep.ui @@ -17,7 +17,7 @@ - qmake Build Configuration: + qmake build configuration: @@ -31,12 +31,12 @@ - debug + Debug - release + Release diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp index 4d254aa768c..8e9dff6f87f 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp @@ -82,7 +82,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget( debuggerConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); devConfLayout->addWidget(debuggerConfLabel); - mainLayout->addRow(new QLabel(tr("Device Configuration:")), devConfWidget); + mainLayout->addRow(new QLabel(tr("Device configuration:")), devConfWidget); m_executableLabel = new QLabel(m_runConfiguration->executable()); mainLayout->addRow(tr("Executable:"), m_executableLabel); m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" ")); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp index a2539501132..e56ef654653 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.cpp @@ -340,7 +340,7 @@ void MaemoSettingsWidget::deployKey() const QString &dir = QFileInfo(currentConfig().server.privateKeyFile).path(); QString publicKeyFileName = QFileDialog::getOpenFileName(this, - tr("Choose public key file"), dir, + tr("Choose Public Key File"), dir, tr("Public Key Files(*.pub);;All Files (*)")); if (publicKeyFileName.isEmpty()) return; @@ -362,7 +362,7 @@ void MaemoSettingsWidget::deployKey() m_keyDeployer = new MaemoSshRunner(currentConfig().server, command); connect(m_keyDeployer, SIGNAL(finished()), this, SLOT(handleDeployThreadFinished())); - m_ui->deployKeyButton->setText(tr("Stop deploying")); + m_ui->deployKeyButton->setText(tr("Stop Deploying")); connect(m_ui->deployKeyButton, SIGNAL(clicked()), this, SLOT(stopDeploying())); m_keyDeployer->start(); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui index ff70b437e90..00eac92c3dd 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosettingswidget.ui @@ -90,14 +90,14 @@ - Remote Device + Remote device - Local Simulator + Maemo emulator @@ -137,7 +137,7 @@ - Host Name: + Host name: @@ -211,7 +211,7 @@ - Connection Timeout: + Connection timeout: @@ -251,7 +251,7 @@ - User Name: + Username: diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.cpp index 19c86ba7f11..6052b702a24 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.cpp @@ -121,7 +121,7 @@ void MaemoSshConfigDialog::saveKey(bool publicKey) const QString suggestedName = home + QString::fromLatin1("/.ssh/id_%1%2") .arg(suggestedTypeSuffix).arg(publicKey ? ".pub" : ""); const QString dlgTitle - = publicKey ? tr("Save public key file") : tr("Save private key file"); + = publicKey ? tr("Save Public Key File") : tr("Save Private Key File"); const QString fileName = QFileDialog::getSaveFileName(this, dlgTitle, suggestedName); if (fileName.isEmpty()) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.ui b/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.ui index 85d5152e24c..d85c4764d04 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.ui +++ b/src/plugins/qt4projectmanager/qt-maemo/maemosshconfigdialog.ui @@ -198,7 +198,7 @@ false - Save public Key... + Save Public Key... @@ -208,7 +208,7 @@ false - Save private Key... + Save Private Key... diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index e3deb4d1eee..51f129b19b4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -75,7 +75,7 @@ S60CreatePackageStep::S60CreatePackageStep(ProjectExplorer::BuildConfiguration * void S60CreatePackageStep::ctor_package() { - setDisplayName(tr("Create sis Package", "Create sis package build step name")); + setDisplayName(tr("Create SIS Package", "Create SIS package build step name")); } S60CreatePackageStep::~S60CreatePackageStep() @@ -239,7 +239,7 @@ QStringList S60CreatePackageStepFactory::availableCreationIds(ProjectExplorer::B QString S60CreatePackageStepFactory::displayNameForId(const QString &id) const { if (id == QLatin1String(SIGN_BS_ID)) - return tr("Create sis Package"); + return tr("Create SIS Package"); return QString(); } @@ -299,8 +299,8 @@ QString S60CreatePackageStepConfigWidget::summaryText() const .arg(m_signStep->customKeyPath()); } if (m_signStep->createSmartInstaller()) - return tr("Create sis Package: %1, using Smart Installer").arg(text); - return tr("Create sis Package: %1").arg(text); + return tr("Create SIS Package: %1, using Smart Installer").arg(text); + return tr("Create SIS Package: %1").arg(text); } QString S60CreatePackageStepConfigWidget::displayName() const diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index ffeb87f1533..ea94183e251 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -698,7 +698,7 @@ void S60DeviceRunControlBase::printConnectFailed(const QString &errorMessage) void S60DeviceRunControlBase::printCopyingNotice() { - emit appendMessage(this, tr("Copying install file..."), false); + emit appendMessage(this, tr("Copying installation file..."), false); } void S60DeviceRunControlBase::printCopyProgress(int progress) diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp index 1a02ca2e7af..5278d21299c 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp @@ -103,7 +103,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget( nameLabel->setBuddy(m_nameLineEdit); formLayout->addRow(nameLabel, m_nameLineEdit); formLayout->addRow(tr("Arguments:"), m_argumentsLineEdit); - formLayout->addRow(tr("Install File:"), m_sisFileLabel); + formLayout->addRow(tr("Installation file:"), m_sisFileLabel); updateSerialDevices(); connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(updated()), @@ -122,7 +122,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget( serialPortHBoxLayout->addWidget(updateSerialDevicesButton); } - formLayout->addRow(tr("Device on Serial Port:"), serialPortHBoxLayout); + formLayout->addRow(tr("Device on serial port:"), serialPortHBoxLayout); // Device Info with button. Widgets are enabled in above call to updateSerialDevices() QHBoxLayout *infoHBoxLayout = new QHBoxLayout; diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.ui b/src/plugins/qt4projectmanager/qt4projectconfigwidget.ui index bb0acd3a161..4188ffbfc4b 100644 --- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.ui +++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.ui @@ -14,7 +14,7 @@ - Configuration Name: + Configuration name: @@ -37,7 +37,7 @@ - Qt Version: + Qt version: @@ -65,7 +65,7 @@ - This Qt-Version is invalid. + This Qt version is invalid. @@ -81,7 +81,7 @@ - Tool Chain: + Tool chain: @@ -91,7 +91,7 @@ - Shadow Build: + Shadow build: @@ -111,7 +111,7 @@ - Build Directory: + Build directory: diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index ce837124b7e..443923c4c7b 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -181,7 +181,7 @@ QString Qt4Manager::mimeType() const return QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE); } -ProjectExplorer::Project* Qt4Manager::openProject(const QString &fileName) +ProjectExplorer::Project *Qt4Manager::openProject(const QString &fileName) { Core::MessageManager *messageManager = Core::ICore::instance()->messageManager(); diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.h b/src/plugins/qt4projectmanager/qt4projectmanager.h index 21c316d87e6..822383751a7 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.h +++ b/src/plugins/qt4projectmanager/qt4projectmanager.h @@ -79,7 +79,7 @@ public: int projectLanguage() const; virtual QString mimeType() const; - ProjectExplorer::Project* openProject(const QString &fileName); + ProjectExplorer::Project *openProject(const QString &fileName); // Context information used in the slot implementations ProjectExplorer::Node *contextNode() const; diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 052a8146206..e3ca670490f 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -210,7 +210,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run m_workingDirectoryEdit = new Utils::PathChooser(this); m_workingDirectoryEdit->setPath(m_qt4RunConfiguration->workingDirectory()); m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory); - m_workingDirectoryEdit->setPromptDialogTitle(tr("Select the working directory")); + m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory")); QToolButton *resetButton = new QToolButton(this); resetButton->setToolTip(tr("Reset to default")); @@ -220,9 +220,9 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run boxlayout->setMargin(0); boxlayout->addWidget(m_workingDirectoryEdit); boxlayout->addWidget(resetButton); - toplayout->addRow(tr("Working Directory:"), boxlayout); + toplayout->addRow(tr("Working directory:"), boxlayout); - m_useTerminalCheck = new QCheckBox(tr("Run in Terminal"), this); + m_useTerminalCheck = new QCheckBox(tr("Run in terminal"), this); m_useTerminalCheck->setChecked(m_qt4RunConfiguration->runMode() == ProjectExplorer::LocalApplicationRunConfiguration::Console); toplayout->addRow(QString(), m_useTerminalCheck); diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui b/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui index 6ecdf59fd62..42e73387d10 100644 --- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui +++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.ui @@ -54,7 +54,7 @@ - Import existing shadow build... + Import Existing Shadow Build... false diff --git a/src/plugins/subversion/checkoutwizard.cpp b/src/plugins/subversion/checkoutwizard.cpp index dbe355b813b..1175408a93b 100644 --- a/src/plugins/subversion/checkoutwizard.cpp +++ b/src/plugins/subversion/checkoutwizard.cpp @@ -53,7 +53,7 @@ QIcon CheckoutWizard::icon() const QString CheckoutWizard::description() const { - return tr("Checks out a project from a Subversion repository and tries to load the contained project."); + return tr("Checks out a Subversion repository and tries to load the contained project."); } QString CheckoutWizard::displayName() const diff --git a/src/plugins/subversion/settingspage.ui b/src/plugins/subversion/settingspage.ui index 249ad3fef2f..4b659929aa2 100644 --- a/src/plugins/subversion/settingspage.ui +++ b/src/plugins/subversion/settingspage.ui @@ -34,7 +34,7 @@ - User name: + Username: diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 0210aa7b8cb..04bcd16deaa 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -212,7 +212,7 @@ QWidget *BaseFileFind::createPatternWidget() QWidget *BaseFileFind::createRegExpWidget() { - m_useRegExpCheckBox = new QCheckBox(tr("Use Regular E&xpressions")); + m_useRegExpCheckBox = new QCheckBox(tr("Use regular e&xpressions")); m_useRegExpCheckBox->setChecked(m_useRegExp); connect(m_useRegExpCheckBox, SIGNAL(toggled(bool)), this, SLOT(syncRegExpSetting(bool))); return m_useRegExpCheckBox; diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 413011f9c34..046bafef277 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -3674,19 +3674,7 @@ void BaseTextEditor::indentOrUnindent(bool doIndent) QTextDocument *doc = document(); - if (!cursor.hasSelection() && doIndent) { - // Insert tab if there is no selection and indent is requested - QTextBlock block = cursor.block(); - QString text = block.text(); - int indentPosition = (cursor.position() - block.position());; - int spaces = tabSettings.spacesLeftFromPosition(text, indentPosition); - int startColumn = tabSettings.columnAt(text, indentPosition - spaces); - int targetColumn = tabSettings.indentedColumn(tabSettings.columnAt(text, indentPosition), doIndent); - cursor.setPosition(block.position() + indentPosition); - cursor.setPosition(block.position() + indentPosition - spaces, QTextCursor::KeepAnchor); - cursor.removeSelectedText(); - cursor.insertText(tabSettings.indentationString(startColumn, targetColumn, block)); - } else { + if (cursor.hasSelection()) { // Indent or unindent the selected lines int anchor = cursor.anchor(); int start = qMin(anchor, pos); @@ -3707,6 +3695,18 @@ void BaseTextEditor::indentOrUnindent(bool doIndent) cursor.setPosition(block.position() + indentPosition, QTextCursor::KeepAnchor); cursor.removeSelectedText(); } + } else { + // Indent or unindent at cursor position + QTextBlock block = cursor.block(); + QString text = block.text(); + int indentPosition = cursor.positionInBlock(); + int spaces = tabSettings.spacesLeftFromPosition(text, indentPosition); + int startColumn = tabSettings.columnAt(text, indentPosition - spaces); + int targetColumn = tabSettings.indentedColumn(tabSettings.columnAt(text, indentPosition), doIndent); + cursor.setPosition(block.position() + indentPosition); + cursor.setPosition(block.position() + indentPosition - spaces, QTextCursor::KeepAnchor); + cursor.removeSelectedText(); + cursor.insertText(tabSettings.indentationString(startColumn, targetColumn, block)); } cursor.endEditBlock(); diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index 7e814a252f2..8ccf21d5070 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -200,7 +200,7 @@ - In leading white space + In Leading White Space diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 0f9f8c9e221..e30c00f12ed 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -450,7 +450,7 @@ void FontSettingsPage::copyColorScheme() dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setInputMode(QInputDialog::TextInput); dialog->setWindowTitle(tr("Copy Color Scheme")); - dialog->setLabelText(tr("Color Scheme name:")); + dialog->setLabelText(tr("Color scheme name:")); dialog->setTextValue(tr("%1 (copy)").arg(d_ptr->m_value.colorScheme().displayName())); connect(dialog, SIGNAL(textValueSelected(QString)), this, SLOT(copyColorScheme(QString))); diff --git a/src/plugins/vcsbase/cleandialog.ui b/src/plugins/vcsbase/cleandialog.ui index 2888100a3f6..a24f047a59d 100644 --- a/src/plugins/vcsbase/cleandialog.ui +++ b/src/plugins/vcsbase/cleandialog.ui @@ -11,7 +11,7 @@ - Clean repository + Clean Repository diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 3c437fadd9d..8cc60f0cfeb 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -557,7 +557,7 @@ void VCSBasePlugin::createRepository() // Prompt for a directory that is not under version control yet QMainWindow *mw = Core::ICore::instance()->mainWindow(); do { - directory = QFileDialog::getExistingDirectory(mw, tr("Choose repository directory"), directory); + directory = QFileDialog::getExistingDirectory(mw, tr("Choose Repository Directory"), directory); if (directory.isEmpty()) return; const Core::IVersionControl *managingControl = Core::ICore::instance()->vcsManager()->findVersionControlForDirectory(directory); diff --git a/tests/auto/qml/qmldesigner/coretests/testcore.cpp b/tests/auto/qml/qmldesigner/coretests/testcore.cpp index 40d16af965d..3bf3a68cd10 100644 --- a/tests/auto/qml/qmldesigner/coretests/testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/testcore.cpp @@ -3284,53 +3284,136 @@ void TestCore::testMetaInfo() { QScopedPointer model(Model::create("Qt/Item")); QVERIFY(model.data()); +} - QScopedPointer view(new TestView); - QVERIFY(view.data()); - model->attachView(view.data()); +void TestCore::testMetaInfoSimpleType() +{ + // + // Test type registered with qmlRegisterType: + // + // qmlRegisterType("Qt",4,7,"Item") + // + + QScopedPointer model(Model::create("Qt/Item")); + QVERIFY(model.data()); QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item")); - QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/QtObject")); - QVERIFY(model->metaInfo().isSubclassOf("Qt/Text", "Qt/QtObject")); - QVERIFY(model->metaInfo().isSubclassOf("Qt/Text", "Qt/Item")); - QVERIFY(model->metaInfo().isSubclassOf("Qt/Rectangle", "Qt/QtObject")); + QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7)); - QVERIFY(!model->metaInfo().isSubclassOf("Fooo", "Qt/QtObject")); + NodeMetaInfo itemMetaInfo = model->metaInfo().nodeMetaInfo("Qt/Item", 4, 7); + NodeMetaInfo itemMetaInfo2 = model->metaInfo().nodeMetaInfo("Qt/Item"); + QCOMPARE(itemMetaInfo, itemMetaInfo2); - QCOMPARE(view->rootModelNode().metaInfo().typeName(), QString("Qt/Item")); - QVERIFY(view->rootModelNode().metaInfo().hasProperty("x")); - QVERIFY(!view->rootModelNode().metaInfo().hasProperty("blah")); - QVERIFY(!view->rootModelNode().metaInfo().property("blah").isValid()); + QVERIFY(itemMetaInfo.isValid()); + QCOMPARE(itemMetaInfo.typeName(), QLatin1String("Qt/Item")); + QCOMPARE(itemMetaInfo.majorVersion(), 4); + QCOMPARE(itemMetaInfo.minorVersion(), 7); - ModelNode rectNode = addNodeListChild(view->rootModelNode(), "Qt/Rectangle", 4, 7, "data"); + // super classes + NodeMetaInfo graphicsObjectInfo = itemMetaInfo.directSuperClass(); + QVERIFY(graphicsObjectInfo.isValid()); + QCOMPARE(graphicsObjectInfo.typeName(), QLatin1String("QGraphicsObject")); + QCOMPARE(graphicsObjectInfo.majorVersion(), 4); + QCOMPARE(graphicsObjectInfo.minorVersion(), 7); - QVERIFY(rectNode.metaInfo().isSubclassOf("Qt/QtObject")); - QVERIFY(rectNode.metaInfo().isSubclassOf("Qt/Item")); - QVERIFY(!rectNode.metaInfo().isSubclassOf("Qt/Text")); - QVERIFY(rectNode.metaInfo().hasProperty("color")); - QVERIFY(rectNode.metaInfo().hasProperty("x")); - QVERIFY(!rectNode.metaInfo().hasProperty("blah")); + QCOMPARE(itemMetaInfo.superClasses().size(), 2); // QGraphicsObject, Qt/QtObject + QVERIFY(itemMetaInfo.isSubclassOf("QGraphicsObject", 4, 7)); + QVERIFY(itemMetaInfo.isSubclassOf("Qt/QtObject", -1, -1)); - ModelNode textNode = addNodeListChild(view->rootModelNode(), "Qt/TextEdit", 4, 7, "data"); - NodeMetaInfo textNodeMetaInfo = textNode.metaInfo(); - QVERIFY(textNodeMetaInfo.hasProperty("text")); - QVERIFY(textNodeMetaInfo.property("text").isValid()); - QVERIFY(textNodeMetaInfo.property("text").isReadable()); - QVERIFY(textNodeMetaInfo.property("text").isWriteable()); - QVERIFY(textNodeMetaInfo.property("x").isReadable()); - QVERIFY(textNodeMetaInfo.property("x").isWriteable()); - QVERIFY(textNodeMetaInfo.isSubclassOf("Qt/Item", 4, 7)); - QVERIFY(!textNodeMetaInfo.isSubclassOf("Blah")); - QVERIFY(textNodeMetaInfo.isQmlGraphicsItem()); - QVERIFY(textNodeMetaInfo.isGraphicsObject()); - QVERIFY(!textNodeMetaInfo.isGraphicsWidget()); + // availableInVersion + QVERIFY(itemMetaInfo.availableInVersion(4, 7)); + QVERIFY(itemMetaInfo.availableInVersion(4, 8)); + QVERIFY(itemMetaInfo.availableInVersion(5, 0)); + QVERIFY(itemMetaInfo.availableInVersion(-1, -1)); + QVERIFY(!itemMetaInfo.availableInVersion(4, 6)); + QVERIFY(!itemMetaInfo.availableInVersion(3, 7)); +} - // test types declared with EXTENDED_OBJECT -// NodeMetaInfo graphicsWidgetInfo = model->metaInfo().nodeMetaInfo("Qt/QGraphicsWidget", 4, 7); -// QVERIFY(graphicsWidgetInfo.isValid()); -// QVERIFY(graphicsWidgetInfo.hasProperty("layout")); // from QGraphicsWidgetDeclarativeUI -// QVERIFY(graphicsWidgetInfo.hasProperty("font")); // from QGraphicsWidget -// QVERIFY(graphicsWidgetInfo.hasProperty("enabled")); // from QGraphicsItem +void TestCore::testMetaInfoUncreatableType() +{ + // Test type registered with qmlRegisterUncreatableType or qmlRegisterTypeNotAvailable: + // + // qmlRegisterUncreatableType("Qt",4,7,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class")); + // + + QScopedPointer model(Model::create("Qt/Item")); + QVERIFY(model.data()); + + QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Animation")); + NodeMetaInfo animationTypeInfo = model->metaInfo().nodeMetaInfo("Qt/Animation", 4, 7); + QVERIFY(animationTypeInfo.isValid()); + + QVERIFY(animationTypeInfo.isValid()); + QCOMPARE(animationTypeInfo.typeName(), QLatin1String("Qt/Animation")); + QCOMPARE(animationTypeInfo.majorVersion(), 4); + QCOMPARE(animationTypeInfo.minorVersion(), 7); + + NodeMetaInfo qObjectTypeInfo = animationTypeInfo.directSuperClass(); + QVERIFY(qObjectTypeInfo.isValid()); + QCOMPARE(qObjectTypeInfo.typeName(), QLatin1String("Qt/QtObject")); + QCOMPARE(qObjectTypeInfo.majorVersion(), 4); + QCOMPARE(qObjectTypeInfo.minorVersion(), 7); + QCOMPARE(animationTypeInfo.superClasses().size(), 1); +} + +void TestCore::testMetaInfoExtendedType() +{ + // Test type registered with qmlRegisterExtendedType + // + // qmlRegisterExtendedType("Qt",4,7,"QGraphicsWidget"); + // + + QScopedPointer model(Model::create("Qt/Item")); + QVERIFY(model.data()); + + QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/QGraphicsWidget")); + NodeMetaInfo graphicsWidgetTypeInfo = model->metaInfo().nodeMetaInfo("Qt/QGraphicsWidget", 4, 7); + QVERIFY(graphicsWidgetTypeInfo.isValid()); + QVERIFY(graphicsWidgetTypeInfo.hasProperty("layout")); // from QGraphicsWidgetDeclarativeUI + QVERIFY(graphicsWidgetTypeInfo.hasProperty("font")); // from QGraphicsWidget + QVERIFY(graphicsWidgetTypeInfo.hasProperty("enabled")); // from QGraphicsItem + + NodeMetaInfo graphicsObjectTypeInfo = graphicsWidgetTypeInfo.directSuperClass(); + QVERIFY(graphicsObjectTypeInfo.isValid()); + QCOMPARE(graphicsObjectTypeInfo.typeName(), QLatin1String("QGraphicsObject")); + QCOMPARE(graphicsObjectTypeInfo.majorVersion(), 4); + QCOMPARE(graphicsObjectTypeInfo.minorVersion(), 7); + QCOMPARE(graphicsWidgetTypeInfo.superClasses().size(), 2); +} + +void TestCore::testMetaInfoInterface() +{ + // Test type registered with qmlRegisterInterface + // + + QSKIP("TODO: Test not implemented yet", SkipAll); +} + +void TestCore::testMetaInfoCustomType() +{ + // Test type registered with qmlRegisterCustomType: + // + // qmlRegisterCustomType("Qt", 4, 7, "PropertyChanges", new QDeclarativePropertyChangesParser); + + QScopedPointer model(Model::create("Qt/Item")); + QVERIFY(model.data()); + + QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/PropertyChanges")); + NodeMetaInfo propertyChangesInfo = model->metaInfo().nodeMetaInfo("Qt/PropertyChanges", 4, 7); + QVERIFY(propertyChangesInfo.isValid()); + QVERIFY(propertyChangesInfo.hasProperty("target")); // from QDeclarativePropertyChanges + QVERIFY(propertyChangesInfo.hasProperty("restoreEntryValues")); // from QDeclarativePropertyChanges + QVERIFY(propertyChangesInfo.hasProperty("explicit")); // from QDeclarativePropertyChanges + + NodeMetaInfo stateOperationInfo = propertyChangesInfo.directSuperClass(); + QVERIFY(stateOperationInfo.isValid()); + QCOMPARE(stateOperationInfo.typeName(), QLatin1String("QDeclarativeStateOperation")); + QCOMPARE(stateOperationInfo.majorVersion(), 4); + QCOMPARE(stateOperationInfo.minorVersion(), 7); + QCOMPARE(propertyChangesInfo.superClasses().size(), 2); + + // DeclarativePropertyChanges just has 3 properties + QCOMPARE(propertyChangesInfo.properties().size() - stateOperationInfo.properties().size(), 3); } void TestCore::testMetaInfoEnums() @@ -3357,6 +3440,26 @@ void TestCore::testMetaInfoEnums() QVERIFY(view->rootModelNode().metaInfo().property("horizontalAlignment").enumerator().elementNames().contains(QLatin1String("AlignRight"))); } +void TestCore::testMetaInfoProperties() +{ + QScopedPointer model(Model::create("Qt/Text")); + QVERIFY(model.data()); + + NodeMetaInfo textNodeMetaInfo = model->metaInfo().nodeMetaInfo("Qt/TextEdit", 4, 7); + QVERIFY(textNodeMetaInfo.hasProperty("text")); // QDeclarativeTextEdit + QVERIFY(textNodeMetaInfo.hasProperty("parent")); // QDeclarativeItem + QVERIFY(textNodeMetaInfo.hasProperty("x")); // QGraphicsObject + QVERIFY(textNodeMetaInfo.hasProperty("objectName")); // Qt/QObject + QVERIFY(!textNodeMetaInfo.hasProperty("bla")); + + QVERIFY(textNodeMetaInfo.property("text").isValid()); + QVERIFY(textNodeMetaInfo.property("text").isReadable()); + QVERIFY(textNodeMetaInfo.property("text").isWriteable()); + QVERIFY(textNodeMetaInfo.property("x").isValid()); + QVERIFY(textNodeMetaInfo.property("x").isReadable()); + QVERIFY(textNodeMetaInfo.property("x").isWriteable()); +} + void TestCore::testMetaInfoDotProperties() { QScopedPointer model(Model::create("Qt/Text")); @@ -6291,7 +6394,7 @@ void TestCore::loadGradient() { ModelNode gradientNode = rootModelNode.allDirectSubModelNodes().last(); QVERIFY(gradientNode.isValid()); - QVERIFY(!gradientNode.metaInfo().isQmlGraphicsItem()); + QVERIFY(!gradientNode.metaInfo().isSubclassOf("Qt/Item", -1, -1)); QCOMPARE(gradientNode.type(), QString("Qt/Gradient")); QCOMPARE(gradientNode.id(), QString("secondGradient")); QCOMPARE(gradientNode.allDirectSubModelNodes().size(), 2); diff --git a/tests/auto/qml/qmldesigner/coretests/testcore.h b/tests/auto/qml/qmldesigner/coretests/testcore.h index 525d555ea7d..fbd683f88bd 100644 --- a/tests/auto/qml/qmldesigner/coretests/testcore.h +++ b/tests/auto/qml/qmldesigner/coretests/testcore.h @@ -71,7 +71,13 @@ private slots: // unit tests MetaInfo, NodeMetaInfo, PropertyMetaInfo // void testMetaInfo(); + void testMetaInfoSimpleType(); + void testMetaInfoUncreatableType(); + void testMetaInfoExtendedType(); + void testMetaInfoInterface(); + void testMetaInfoCustomType(); void testMetaInfoEnums(); + void testMetaInfoProperties(); void testMetaInfoDotProperties(); void testMetaInfoListProperties();