diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 8b1b240cf17127e34d6f00572b1c546542200057..03840ac854d17ea9dba189b50a5d8bf984e816b4 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -62,9 +62,10 @@ int qtGhVersion = QT_VERSION; #endif #if USE_QT_GUI -# include <QtGui/QWidget> -# include <QtGui/QPixmap> +# include <QtGui/QApplication> # include <QtGui/QImage> +# include <QtGui/QPixmap> +# include <QtGui/QWidget> #endif #ifdef Q_OS_WIN @@ -1457,7 +1458,9 @@ static void qDumpQHashNode(QDumper &d) static void qDumpQImage(QDumper &d) { const QImage &im = *reinterpret_cast<const QImage *>(d.data); - d.putItem("value", "(").put(im.width()).put("x").put(im.height()).put(")"); + d.beginItem("value"); + d.put("(").put(im.width()).put("x").put(im.height()).put(")"); + d.endItem(); d.putItem("type", NS"QImage"); d.putItem("numchild", "1"); if (d.dumpChildren) { @@ -2234,7 +2237,9 @@ static void qDumpQObjectSlotList(QDumper &d) static void qDumpQPixmap(QDumper &d) { const QPixmap &im = *reinterpret_cast<const QPixmap *>(d.data); - d.putItem("value", "(").put(im.width()).put("x").put(im.height()).put(")"); + d.beginItem("value"); + d.put("(").put(im.width()).put("x").put(im.height()).put(")"); + d.endItem(); d.putItem("type", NS"QPixmap"); d.putItem("numchild", "0"); d.disarm(); @@ -2455,7 +2460,7 @@ static void qDumpQVariant(QDumper &d) d.putItem("value", "(invalid)"); } else if (value.isEmpty()) { d.beginItem("value"); - d.put("(").put(v.typeName()).put(") ").put(qPrintable(value)); + d.put("(").put(v.typeName()).put(") "); d.endItem(); } else { QByteArray ba; @@ -2464,7 +2469,7 @@ static void qDumpQVariant(QDumper &d) ba += ") "; ba += qPrintable(value); d.putItem("value", ba); - d.putItem("valueencoded", "4"); + d.putItem("valueencoded", "5"); } d.putItem("type", NS"QVariant"); d.putItem("numchild", (isInvalid ? "0" : "1")); @@ -3023,6 +3028,14 @@ static void handleProtocolVersion2and3(QDumper & d) } // anonymous namespace +#if USE_QT_GUI +extern "C" Q_DECL_EXPORT +void *watchPoint(int x, int y) +{ + return QApplication::widgetAt(x, y); +} +#endif + extern "C" Q_DECL_EXPORT void *qDumpObjectData440( int protocolVersion, @@ -3115,7 +3128,7 @@ void *qDumpObjectData440( .put(""NS"QStringList=\"").put(sizeof(QStringList)).put("\",") .put(""NS"QObject=\"").put(sizeof(QObject)).put("\",") #if USE_QT_GUI - .put(""NS"QWidget=\"").put(sizeof(QWidget)<< "\",") + .put(""NS"QWidget=\"").put(sizeof(QWidget)).put("\",") #endif #ifdef Q_OS_WIN .put("string=\"").put(sizeof(std::string)).put("\",") diff --git a/share/qtcreator/gdbmacros/gdbmacros.pro b/share/qtcreator/gdbmacros/gdbmacros.pro index 67133e732e88e30dd557d051c5270f24641f39a5..d876af9387fa8f22dcd80f629cc0a2cf7d894025 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.pro +++ b/share/qtcreator/gdbmacros/gdbmacros.pro @@ -1,13 +1,12 @@ TEMPLATE = lib CONFIG += shared -QT = core linux-* { CONFIG -= release CONFIG += debug } SOURCES=gdbmacros.cpp -true { +false { DEFINES += USE_QT_GUI=0 QT = core } else { diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_collection.cpp b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_collection.cpp similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_collection.cpp rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_collection.cpp diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_collection.h b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_collection.h similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_collection.h rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_collection.h diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_plugin.pro b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_plugin.pro similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_plugin.pro rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_plugin.pro diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_resources.qrc b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_resources.qrc similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_resources.qrc rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_resources.qrc diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_single.cpp b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_single.cpp rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.cpp diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_single.h b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.h similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_single.h rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_single.h diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget.cpp b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget.cpp similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget.cpp rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget.cpp diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget.h b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget.h similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget.h rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget.h diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget_include.pri b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget_include.pri similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget_include.pri rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget_include.pri diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget_lib.pro b/share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget_lib.pro similarity index 100% rename from src/plugins/qt4projectmanager/customwidgetwizard/templates/tpl_widget_lib.pro rename to share/qtcreator/templates/qt4project/customwidgetwizard/tpl_widget_lib.pro diff --git a/share/qtcreator/translations/phrasebook_fr.qph b/share/qtcreator/translations/phrasebook_fr.qph new file mode 100644 index 0000000000000000000000000000000000000000..8b7636ae70f853e4565e4b0aad8ef2b6c88eba41 --- /dev/null +++ b/share/qtcreator/translations/phrasebook_fr.qph @@ -0,0 +1,291 @@ +<!DOCTYPE QPH> +<QPH language="fr"> +<phrase> + <source>debugger</source> + <target>débogueur</target> +</phrase> +<phrase> + <source>Start Debugger</source> + <target>Lancer le débogueur</target> +</phrase> +<phrase> + <source>Executable:</source> + <target>Exécutable:</target> +</phrase> +<phrase> + <source>Filter:</source> + <target>Filtre:</target> +</phrase> +<phrase> + <source>Clear</source> + <target>Effacer</target> +</phrase> +<phrase> + <source>Host and port:</source> + <target>Hôte et port:</target> +</phrase> +<phrase> + <source>Architecture:</source> + <target>Architecture:</target> +</phrase> +<phrase> + <source>Server start script:</source> + <target>Script de démarrage du serveur:</target> +</phrase> +<phrase> + <source>&Undo</source> + <target>Annu&ler</target> +</phrase> +<phrase> + <source>Add Bookmark</source> + <target>Ajouter un signet</target> +</phrase> +<phrase> + <source>Bookmark:</source> + <target>Signet:</target> +</phrase> +<phrase> + <source>Add in Folder:</source> + <target>Ajouter dans le dossier:</target> +</phrase> +<phrase> + <source>+</source> + <target>+</target> +</phrase> +<phrase> + <source>New Folder</source> + <target>Nouveau Dossier</target> +</phrase> +<phrase> + <source>Bookmarks</source> + <target>Signets</target> +</phrase> +<phrase> + <source>Rename Folder</source> + <target>Renommer le Dossier</target> +</phrase> +<phrase> + <source>Bookmark</source> + <target>Signet</target> +</phrase> +<phrase> + <source>Remove</source> + <target>Retirer</target> +</phrase> +<phrase> + <source>Delete Folder</source> + <target>Supprimer le Dossier</target> +</phrase> +<phrase> + <source>Show Bookmark</source> + <target>Afficher le Signet</target> +</phrase> +<phrase> + <source>Show Bookmark in New Tab</source> + <target>Afficher le Signet dans un Nouvel Onglet</target> +</phrase> +<phrase> + <source>Delete Bookmark</source> + <target>Supprimer le Signet</target> +</phrase> +<phrase> + <source>Rename Bookmark</source> + <target>Renommer le Signet</target> +</phrase> +<phrase> + <source>Add</source> + <target>Ajouter</target> +</phrase> +<phrase> + <source>Move Up</source> + <target>Vers le Haut</target> +</phrase> +<phrase> + <source>Move Down</source> + <target>Vers le Bas</target> +</phrase> +<phrase> + <source>Previous Bookmark</source> + <target>Signet Précédent</target> +</phrase> +<phrase> + <source>Next Bookmark</source> + <target>Signet Suivant</target> +</phrase> +<phrase> + <source>Condition:</source> + <target>Condition:</target> +</phrase> +<phrase> + <source>Working Directory:</source> + <target>Répertoire de Travail:</target> +</phrase> +<phrase> + <source>Environment</source> + <target>Environnement</target> +</phrase> +<phrase> + <source>Arguments</source> + <target>Arguments</target> +</phrase> +<phrase> + <source>Build directory:</source> + <target>Répertoire de compilation:</target> +</phrase> +<phrase> + <source>Path:</source> + <target>Chemin:</target> +</phrase> +<phrase> + <source>CodePaster Error</source> + <target>Erreur dans CodePaster</target> +</phrase> +<phrase> + <source>General</source> + <target>Général</target> +</phrase> +<phrase> + <source>Username:</source> + <target>Nom d'utilisateur:</target> +</phrase> +<phrase> + <source>CodePaster</source> + <target>CodePaster</target> +</phrase> +<phrase> + <source>User interface</source> + <target>Interface utilisateur</target> +</phrase> +<phrase> + <source><unlimited></source> + <target><illimitée></target> +</phrase> +<phrase> + <source>Open Link</source> + <target>Ouvrir le Lien</target> +</phrase> +<phrase> + <source> [read only]</source> + <target> [lecture seule]</target> +</phrase> +<phrase> + <source> [directory]</source> + <target> [répertoire]</target> +</phrase> +<phrase> + <source>Close</source> + <target>Fermer</target> +</phrase> +<phrase> + <source>Close All</source> + <target>Fermer Tout</target> +</phrase> +<phrase> + <source>Failed!</source> + <target>Échec!</target> +</phrase> +<phrase> + <source>Proceed</source> + <target>Continuer</target> +</phrase> +<phrase> + <source>Cancel</source> + <target>Annuler</target> +</phrase> +<phrase> + <source>Make writable</source> + <target>Rendre Inscriptible</target> +</phrase> +<phrase> + <source>Qt Creator</source> + <target>Qt Creator</target> +</phrase> +<phrase> + <source>&File</source> + <target>&Fichier</target> +</phrase> +<phrase> + <source>&Edit</source> + <target>&Édition</target> +</phrase> +<phrase> + <source>&Redo</source> + <target>Re&faire</target> +</phrase> +<phrase> + <source>Activate %1</source> + <target>Activer %1</target> +</phrase> +<phrase> + <source>Split</source> + <target>Scinder</target> +</phrase> +<phrase> + <source>New Project</source> + <target>Nouveau Projet</target> +</phrase> +<phrase> + <source>Close %1</source> + <target>Fermer %1</target> +</phrase> +<phrase> + <source>*</source> + <target>*</target> +</phrase> +<phrase> + <source>&Undo</source> + <target>Annu&ler</target> +</phrase> +<phrase> + <source>Bookmarks</source> + <target>Signets</target> +</phrase> +<phrase> + <source>New Folder</source> + <target>Nouveau dossier</target> +</phrase> +<phrase> + <source>Bookmark</source> + <target>Signet</target> +</phrase> +<phrase> + <source>Bookmarks</source> + <target>Signets</target> +</phrase> +<phrase> + <source>New Folder</source> + <target>Nouveau dossier</target> +</phrase> +<phrase> + <source>Add</source> + <target>Ajouter</target> +</phrase> +<phrase> + <source>&Change</source> + <target>&Modifier</target> +</phrase> +<phrase> + <source>Close</source> + <target>Fermer</target> +</phrase> +<phrase> + <source>General</source> + <target>Général</target> +</phrase> +<phrase> + <source>Close %1</source> + <target>Fermer %1</target> +</phrase> +<phrase> + <source>Close Other Editors</source> + <target>Fermer les autres éditeurs</target> +</phrase> +<phrase> + <source>Close All Except %1</source> + <target>Fermer tout sauf %1</target> +</phrase> +<phrase> + <source>C++</source> + <target></target> +</phrase> +</QPH> diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 6e6a8568eddb9089b54429a5d75ce45fd836f200..a801c67c27ac8b4610af10a2f5ea3027e4bc4c92 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -17,7 +17,7 @@ <message> <location line="+134"/> <source>Couldn't find 'Core.pluginspec' in %1</source> - <translation type="unfinished">'Core.pluginspec' introuvable dans %1</translation> + <translation>'Core.pluginspec' introuvable dans %1</translation> </message> </context> <context> @@ -43,7 +43,7 @@ <message> <location filename="../../../src/plugins/debugger/attachexternaldialog.ui"/> <source>Start Debugger</source> - <translation type="unfinished">Lancer le débogueur</translation> + <translation>Lancer le débogueur</translation> </message> <message> <location/> @@ -72,12 +72,12 @@ <message> <location/> <source>Host and port:</source> - <translation type="unfinished">Hôte et port:</translation> + <translation>Hôte et port :</translation> </message> <message> <location/> <source>Architecture:</source> - <translation>Architecture:</translation> + <translation>Architecture :</translation> </message> <message> <location/> @@ -95,12 +95,12 @@ <message> <location filename="../../../src/plugins/bineditor/bineditorplugin.cpp" line="+379"/> <source>&Undo</source> - <translation type="unfinished">Annu&ler</translation> + <translation>Annu&ler</translation> </message> <message> <location line="+3"/> <source>&Redo</source> - <translation type="unfinished">&Refaire</translation> + <translation>&Refaire</translation> </message> </context> <context> @@ -108,7 +108,7 @@ <message> <location filename="../../../src/shared/help/bookmarkdialog.ui"/> <source>Add Bookmark</source> - <translation type="unfinished">Ajouter un signet</translation> + <translation>Ajouter un signet</translation> </message> <message> <location/> @@ -123,12 +123,12 @@ <message> <location/> <source>+</source> - <translation type="unfinished">+</translation> + <translation></translation> </message> <message> <location/> <source>New Folder</source> - <translation type="unfinished">Nouveau Dossier</translation> + <translation>Nouveau dossier</translation> </message> <message> <location filename="../../../src/shared/help/bookmarkmanager.cpp" line="+172"/> @@ -137,17 +137,17 @@ <location line="+24"/> <location line="+32"/> <source>Bookmarks</source> - <translation type="unfinished">Signets</translation> + <translation>Signets</translation> </message> <message> <location line="-69"/> <source>Delete Folder</source> - <translation type="unfinished">Supprimer le dossier</translation> + <translation>Supprimer le dossier</translation> </message> <message> <location line="+1"/> <source>Rename Folder</source> - <translation type="unfinished">Renommer le Dossier</translation> + <translation>Renommer le dossier</translation> </message> </context> <context> @@ -156,12 +156,12 @@ <location line="+402"/> <location line="+1"/> <source>Bookmark</source> - <translation type="unfinished">Signet</translation> + <translation>Signet</translation> </message> <message> <location line="+45"/> <source>Bookmarks</source> - <translation type="unfinished">Signets</translation> + <translation>Signets</translation> </message> <message> <location line="+36"/> @@ -177,7 +177,7 @@ <location line="+109"/> <location line="+9"/> <source>New Folder</source> - <translation type="unfinished">Nouveau Dossier</translation> + <translation>Nouveau dossier</translation> </message> </context> <context> @@ -220,7 +220,7 @@ <message> <location line="+26"/> <source>Add</source> - <translation type="unfinished">Ajouter</translation> + <translation>Ajouter</translation> </message> <message> <location line="+9"/> @@ -233,7 +233,7 @@ <message> <location filename="../../../src/plugins/bookmarks/bookmarkmanager.cpp" line="+206"/> <source>Bookmarks</source> - <translation type="unfinished">Signets</translation> + <translation>Signets</translation> </message> <message> <location line="+23"/> @@ -351,7 +351,7 @@ <message> <location filename="../../../src/plugins/cmakeprojectmanager/cmakebuildenvironmentwidget.cpp" line="+61"/> <source>Build Environment</source> - <translation type="unfinished">Environnement de compilation</translation> + <translation>Environnement de compilation</translation> </message> </context> <context> @@ -359,7 +359,7 @@ <message> <location filename="../../../src/plugins/cmakeprojectmanager/cmakeproject.cpp" line="+696"/> <source>&Change</source> - <translation type="unfinished">&Changer</translation> + <translation>&Modifier</translation> </message> </context> <context> @@ -367,7 +367,7 @@ <message> <location filename="../../../src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp" line="+116"/> <source>CMake Wizard</source> - <translation type="unfinished">Assistant CMake</translation> + <translation>Assistant CMake</translation> </message> </context> <context> @@ -385,7 +385,7 @@ <message> <location line="+3"/> <source>Reset to default</source> - <translation type="unfinished">Restaurer les paramètres par défaut</translation> + <translation>Restaurer les paramètres par défaut</translation> </message> <message> <location line="+7"/> @@ -395,7 +395,7 @@ <message> <location line="+2"/> <source>Environment</source> - <translation type="unfinished">Environnement</translation> + <translation>Environnement</translation> </message> <message> <location line="+5"/> @@ -476,7 +476,7 @@ <message> <location filename="../../../src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp" line="+28"/> <source>Please enter the directory in which you want to build your project. </source> - <translation type="unfinished">Veuillez spécifier le répertoire où vous voulez compiler votre projet.</translation> + <translation>Veuillez spécifier le répertoire où vous voulez compiler votre projet. </translation> </message> <message> <location line="+2"/> @@ -494,7 +494,7 @@ <message> <location line="-25"/> <source>Qt Creator has found a recent cbp file, which Qt Creator will parse to gather information about the project. You can change the command line arguments used to create this file in the project mode. Click finish to load the project.</source> - <translation type="unfinished">Qt Creator a trouvé un fichier cbp récent, Qt Creator va maintenant l'analyser pour rassembler des informations sur le projet. Vous pouvez changer les arguments de ligne de commande utilisés pour la création de ce fichier depuis le mode "projet". Cliquer sur Terminer pour charger le projet.</translation> + <translation>Qt Creator a trouvé un fichier cbp récent, Qt Creator va maintenant l'analyser pour rassembler des informations sur le projet. Vous pouvez changer les arguments de ligne de commande utilisés pour la création de ce fichier depuis le mode "projet". Cliquer sur Terminer pour charger le projet.</translation> </message> </context> <context> @@ -502,12 +502,12 @@ <message> <location filename="../../../src/libs/cplusplus/OverviewModel.cpp" line="+153"/> <source><Select Symbol></source> - <translation type="unfinished"><Selectionner un Symbole></translation> + <translation><Selectionner un symbole></translation> </message> <message> <location line="+2"/> <source><No Symbols></source> - <translation type="unfinished"><Aucun Symbole>></translation> + <translation><Aucun symbole></translation> </message> </context> <context> @@ -864,53 +864,53 @@ Voulez vous les écraser?</translation> <location filename="../../../src/plugins/coreplugin/editormanager/editormanager.cpp" line="+192"/> <location line="+1565"/> <source>Revert to Saved</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Revenir à la version sauvegardée</translation> </message> <message> <location line="-1562"/> <source>Close</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer</translation> </message> <message> <location line="+1"/> <source>Close All</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer Tout</translation> </message> <message> <location line="+1"/> <location line="+1282"/> <source>Close Others</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer les Autres Éditeurs</translation> </message> <message> <location line="-1281"/> <source>Next Document in History</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Document Suivant dans l'Historique</translation> </message> <message> <location line="+1"/> <source>Previous Document in History</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Document Précédent dans l'Historique</translation> </message> <message> <location line="+1"/> <source>Go Back</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Précédent</translation> </message> <message> <location line="+1"/> <source>Go Forward</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Suivant</translation> </message> <message> <location line="+1"/> <source>Open in External Editor</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ouvrir dans l'Éditeur Externe</translation> </message> <message> <location line="+45"/> <source>Revert File to Saved</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Restaurer le fichier sauvegardé</translation> </message> <message> <location line="+43"/> @@ -965,7 +965,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Split</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Scinder</translation> </message> <message> <location line="+3"/> @@ -975,7 +975,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Split Side by Side</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Scinder Verticalement</translation> </message> <message> <location line="+3"/> @@ -985,7 +985,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Remove Current Split</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer la Vue Courante</translation> </message> <message> <location line="+3"/> @@ -995,7 +995,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Remove All Splits</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer toutes les vues</translation> </message> <message> <location line="+3"/> @@ -1005,7 +1005,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Goto Other Split</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Changer de vue</translation> </message> <message> <location line="+3"/> @@ -1015,7 +1015,7 @@ Voulez vous les écraser?</translation> <message> <location line="+9"/> <source>&Advanced</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Avancé</translation> </message> <message> <location line="+15"/> @@ -1026,104 +1026,104 @@ Voulez vous les écraser?</translation> <location line="+732"/> <location line="+23"/> <source>Opening File</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ouverture du Fichier</translation> </message> <message> <location line="-23"/> <source>Cannot open file %1!</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Impossible d'ouvrir le fichier %1!</translation> </message> <message> <location line="+39"/> <source>Open File</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ouvrir le Fichier</translation> </message> <message> <location line="+140"/> <source>File is Read Only</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Le Fichier est en Lecture Seule</translation> </message> <message> <location line="+1"/> <source>The file %1 is read only.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Le fichier %1 est en lecture seule.</translation> </message> <message> <location line="+5"/> <source>Open with VCS (%1)</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ouvrir avec VCS (%1)</translation> </message> <message> <location line="+2"/> <location line="+130"/> <source>Make writable</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Rendre Inscriptible</translation> </message> <message> <location line="-126"/> <source>Save as ...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Enregistrer sous...</translation> </message> <message> <location line="+27"/> <location line="+8"/> <source>Failed!</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Échec!</translation> </message> <message> <location line="-8"/> <source>Could not open the file for editing with SCC.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Impossible d'ouvrir le fichier pour écrire avec SCC.</translation> </message> <message> <location line="+8"/> <source>Could not set permissions to writable.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Impossible d'attribuer les droits en écriture.</translation> </message> <message> <location line="+90"/> <source><b>Warning:</b> You are changing a read-only file.</source> - <translation type="unfinished"></translation> + <translation type="unfinished"><b>Attention:</b> Vous apportez des modifications à un fichier en lecture seule.</translation> </message> <message> <location line="+15"/> <source>Save %1 As...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Enregistrer %1 sous...</translation> </message> <message> <location line="+1"/> <source>&Save %1</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Enregi&strer %1</translation> </message> <message> <location line="+1"/> <source>Revert %1 to Saved</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Restaurer %1</translation> </message> <message> <location line="+4"/> <source>Close %1</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer %1</translation> </message> <message> <location line="+3"/> <source>Close All Except %1</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer tout sauf %1</translation> </message> <message> <location line="+279"/> <source>You will lose your current changes if you proceed reverting %1.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Vous perdrez tous les changements en cours si vous restaurez %1.</translation> </message> <message> <location line="+2"/> <source>Proceed</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Continuer</translation> </message> <message> <location line="+1"/> <source>Cancel</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Annuler</translation> </message> <message> <location line="+54"/> @@ -1136,27 +1136,27 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/filemanager.cpp" line="+305"/> <source>Can't save file</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Impossible de sauver le fichier</translation> </message> <message> <location line="+1"/> <source>Can't save changes to '%1'. Do you want to continue and loose your changes?</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Impossible de sauvegarder les modifications dans '%1'. Voulez vous continuer et perdre vos modifications?</translation> </message> <message> <location line="+113"/> <source>Overwrite?</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Écraser?</translation> </message> <message> <location line="+1"/> <source>An item named '%1' already exists at this location. Do you want to overwrite it?</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Un élément nommé '%1' existe déjà . Voulez-vous l'écraser?</translation> </message> <message> <location line="+35"/> <source>Save File As</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Enregistrer sous</translation> </message> </context> <context> @@ -1164,7 +1164,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/sidebar.cpp" line="+362"/> <source>Activate %1</source> - <translation type="unfinished"></translation> + <translation>Activer %1</translation> </message> </context> <context> @@ -1172,7 +1172,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/editmode.cpp" line="+94"/> <source>Edit</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Modifier</translation> </message> </context> <context> @@ -1180,32 +1180,32 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/editormanager/editorsplitter.cpp" line="+75"/> <source>Split Left/Right</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Scinder Gauche/Droite</translation> </message> <message> <location line="+7"/> <source>Split Top/Bottom</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Scinder Haut/Bas</translation> </message> <message> <location line="+7"/> <source>Unsplit</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fermer la vue courante</translation> </message> <message> <location line="+11"/> <source>Default Splitter Layout</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Arrangement par Défaut</translation> </message> <message> <location line="+3"/> <source>Save Current as Default</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Sauvegarder comme Arrangement par Défaut</translation> </message> <message> <location line="+7"/> <source>Restore Default Layout</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Restaurer l'Arrangement par Défaut</translation> </message> <message> <location line="+11"/> @@ -1220,7 +1220,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>Next Document</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Document Suivant</translation> </message> <message> <location line="+2"/> @@ -1230,22 +1230,22 @@ Voulez vous les écraser?</translation> <message> <location line="+6"/> <source>Previous Group</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Groupe Précédent</translation> </message> <message> <location line="+6"/> <source>Next Group</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Groupe Suivant</translation> </message> <message> <location line="+6"/> <source>Move Document to Previous Group</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Déplacer le Document vers le Groupe Précédent</translation> </message> <message> <location line="+6"/> <source>Move Document to Next Group</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Déplacer le Document vers le Groupe Suivant</translation> </message> </context> <context> @@ -1259,22 +1259,22 @@ Voulez vous les écraser?</translation> <message> <location line="-29"/> <source>Close</source> - <translation type="unfinished"></translation> + <translation>Fermer</translation> </message> <message> <location line="+198"/> <source>Make writable</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Rendre Inscriptible</translation> </message> <message> <location line="+4"/> <source>File is writable</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Le Fichier est Inscriptible</translation> </message> <message> <location line="+57"/> <source>Copy full path to clipboard</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Copier le chemin complet vers le presse-papier</translation> </message> </context> <context> @@ -1335,7 +1335,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/mainwindow.cpp" line="+155"/> <source>Qt Creator</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Qt Creator</translation> </message> <message> <location line="+144"/> @@ -1345,59 +1345,59 @@ Voulez vous les écraser?</translation> <message> <location line="+162"/> <source>&File</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Fichier</translation> </message> <message> <location line="+14"/> <source>&Edit</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Édition</translation> </message> <message> <location line="+11"/> <source>&Tools</source> - <translation type="unfinished"></translation> + <translation type="unfinished">O&utils</translation> </message> <message> <location line="+5"/> <source>&Window</source> - <translation type="unfinished"></translation> + <translation type="unfinished">F&enêtre</translation> </message> <message> <location line="+13"/> <source>&Help</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Aide</translation> </message> <message> <location line="+62"/> <source>&New...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Nouveau...</translation> </message> <message> <location line="+7"/> <source>&Open...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Ouvrir...</translation> </message> <message> <location line="+7"/> <source>&Open With...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ou&vrir avec...</translation> </message> <message> <location line="+8"/> <source>Recent Files</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fichiers récents</translation> </message> <message> <location line="+3"/> <location line="+4"/> <source>&Save</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Enregistrer</translation> </message> <message> <location line="+4"/> <location line="+6"/> <source>Save &As...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Enregistrer &sous...</translation> </message> <message> <location line="-3"/> @@ -1408,17 +1408,17 @@ Voulez vous les écraser?</translation> <message> <location line="-3"/> <source>Save A&ll</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Tout enregistrer</translation> </message> <message> <location line="+9"/> <source>&Print...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Im&primer...</translation> </message> <message> <location line="+5"/> <source>E&xit</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Quitter</translation> </message> <message> <location line="+2"/> @@ -1429,38 +1429,38 @@ Voulez vous les écraser?</translation> <location line="+5"/> <location line="+4"/> <source>&Undo</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Annu&ler</translation> </message> <message> <location line="+5"/> <location line="+4"/> <source>&Redo</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Re&faire</translation> </message> <message> <location line="+5"/> <source>Cu&t</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Co&uper</translation> </message> <message> <location line="+7"/> <source>&Copy</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Cop&ier</translation> </message> <message> <location line="+7"/> <source>&Paste</source> - <translation type="unfinished"></translation> + <translation type="unfinished">C&oller</translation> </message> <message> <location line="+7"/> <source>&Select All</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Tout &sélectionner</translation> </message> <message> <location line="+7"/> <source>&Go To Line...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Aller à la ligne...</translation> </message> <message> <location line="+2"/> @@ -1470,7 +1470,7 @@ Voulez vous les écraser?</translation> <message> <location line="+5"/> <source>&Options...</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Options...</translation> </message> <message> <location line="+10"/> @@ -1519,7 +1519,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/messageoutputwindow.cpp" line="+76"/> <source>General</source> - <translation type="unfinished"></translation> + <translation>Général</translation> </message> </context> <context> @@ -1527,7 +1527,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/navigationwidget.cpp" line="+525"/> <source>Activate %1</source> - <translation type="unfinished"></translation> + <translation>Activer %1</translation> </message> </context> <context> @@ -1535,12 +1535,12 @@ Voulez vous les écraser?</translation> <message> <location line="-149"/> <source>Split</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Scinder</translation> </message> <message> <location line="+1"/> <source>Close</source> - <translation type="unfinished"></translation> + <translation>Fermer</translation> </message> </context> <context> @@ -1548,7 +1548,7 @@ Voulez vous les écraser?</translation> <message> <location line="-35"/> <source>Activate %1 Pane</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Activer le Panneau %1</translation> </message> </context> <context> @@ -1556,12 +1556,12 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/dialogs/newdialog.ui"/> <source>New Project</source> - <translation type="unfinished"></translation> + <translation>Nouveau projet</translation> </message> <message> <location/> <source>1</source> - <translation type="unfinished"></translation> + <translation></translation> </message> </context> <context> @@ -1569,32 +1569,33 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/editormanager/openeditorsview.cpp" line="+99"/> <source>Open Documents</source> - <translation type="unfinished"></translation> + <translatorcomment>NB:il ne s'agit pas ici d'une action mais du panneau affichant les documents ouverts</translatorcomment> + <translation>Documents ouverts</translation> </message> <message> <location line="+77"/> <source>Close %1</source> - <translation type="unfinished"></translation> + <translation>Fermer %1</translation> </message> <message> <location line="+1"/> <source>Close Editor</source> - <translation type="unfinished"></translation> + <translation>Fermer l'éditeur</translation> </message> <message> <location line="+2"/> <source>Close All Except %1</source> - <translation type="unfinished"></translation> + <translation>Fermer tout sauf %1</translation> </message> <message> <location line="+1"/> <source>Close Other Editors</source> - <translation type="unfinished"></translation> + <translation>Fermer les autres éditeurs</translation> </message> <message> <location line="+1"/> <source>Close All Editors</source> - <translation type="unfinished"></translation> + <translation>Fermer tous les éditeurs</translation> </message> </context> <context> @@ -1602,7 +1603,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/editormanager/openeditorswindow.cpp" line="+211"/> <source>*</source> - <translation type="unfinished"></translation> + <translation></translation> </message> </context> <context> @@ -1610,7 +1611,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/coreplugin/dialogs/openwithdialog.cpp" line="+43"/> <source>Open file '%1' with:</source> - <translation type="unfinished"></translation> + <translation>Ouvrir le fichier %1 avec :</translation> </message> </context> <context> @@ -2501,12 +2502,12 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/cppeditor/cppplugin.cpp" line="+172"/> <source>C++</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <location line="+1"/> <source>Creates a C++ header file.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Créer un fichier header C++.</translation> </message> <message> <location line="+1"/> @@ -2549,22 +2550,22 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/cpptools/cppfilesettingspage.ui"/> <source>File Naming Conventions</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Convention de nommage des fichiers</translation> </message> <message> <location/> <source>Header suffix:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Suffixe des header :</translation> </message> <message> <location/> <source>Source suffix:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Suffixe des fichiers source</translation> </message> <message> <location/> <source>Lower case file names</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Nom des fichiers en minuscule</translation> </message> <message> <location/> @@ -2577,7 +2578,7 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/cpptools/cppmodelmanager.cpp" line="+842"/> <source>%1: No such file or directory</source> - <translation type="unfinished"></translation> + <translation type="unfinished">%1 : Aucun fichier ou répertoire de ce type</translation> </message> </context> <context> @@ -2585,12 +2586,12 @@ Voulez vous les écraser?</translation> <message> <location filename="../../../src/plugins/cpptools/cpptoolsconstants.h" line="+52"/> <source>File Naming Conventions</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Conventions de nommage des fichiers</translation> </message> <message> <location line="+1"/> <source>C++</source> - <translation type="unfinished"></translation> + <translation></translation> </message> </context> <context> @@ -11261,17 +11262,17 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <location filename="../../../src/plugins/texteditor/basefilefind.cpp" line="+114"/> <location line="+20"/> <source>%1 found</source> - <translation type="unfinished"></translation> + <translation type="unfinished">%1 éléments trouvés</translation> </message> <message> <location line="+12"/> <source>List of comma separated wildcard filters</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Liste de filtres séparée par des virgules</translation> </message> <message> <location line="+27"/> <source>Use Regular E&xpressions</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Utiliser des e&xpressions régulières</translation> </message> </context> <context> @@ -11279,12 +11280,12 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/basetextdocument.cpp" line="+158"/> <source>untitled</source> - <translation type="unfinished"></translation> + <translation type="unfinished">document sans titre</translation> </message> <message> <location line="+68"/> <source><em>Binary data</em></source> - <translation type="unfinished"></translation> + <translation type="unfinished"><em>Données binaire</em></translation> </message> </context> <context> @@ -11292,17 +11293,17 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/basetexteditor.cpp" line="+229"/> <source>Print Document</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Imprimer le document</translation> </message> <message> <location line="+290"/> <source><b>Error:</b> Could not decode "%1" with "%2"-encoding. Editing not possible.</source> - <translation type="unfinished"></translation> + <translation type="unfinished"><b>Error :</b> Impossible de décoder "%1" avec l'encodage "%2". L'édition est impossible.</translation> </message> <message> <location line="+2"/> <source>Select Encoding</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Choisir l'encodage</translation> </message> </context> <context> @@ -11310,12 +11311,12 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location line="+3718"/> <source>Line: %1, Col: %2</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ligne : %1, Col : %2</translation> </message> <message> <location line="+1"/> <source>Line: %1, Col: 999</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ligne : %1, Col: 999</translation> </message> </context> <context> @@ -11323,52 +11324,52 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/behaviorsettingspage.ui"/> <source>Tabs and Indentation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Tabulation et indentation</translation> </message> <message> <location/> <source>Insert &spaces instead of tabs</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Insérer des e&spaces au lieu de tabulations</translation> </message> <message> <location/> <source>Enable automatic &indentation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Activer l'&indentation automatique</translation> </message> <message> <location/> <source>Backspace will go back one indentation level instead of one space.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">La touche retour reviendra un niveau d'indentation en arrière au lieux d'un caractère espace.</translation> </message> <message> <location/> <source>&Backspace follows indentation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">La touche &retour arrière suit l'indentation</translation> </message> <message> <location/> <source>Ta&b size:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Taille de &tabulation :</translation> </message> <message> <location/> <source>&Indent size:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Taille de l'in&dentation :</translation> </message> <message> <location/> <source>Tab key performs auto-indent:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">La touche tabulation active l'identation automatique :</translation> </message> <message> <location/> <source>Never</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Jamais</translation> </message> <message> <location/> <source>Always</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Toujours</translation> </message> <message> <location/> @@ -11378,42 +11379,42 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location/> <source>Storage</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Sauvegarde</translation> </message> <message> <location/> <source>Removes trailing whitespace on saving.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Supprime les charactères d'espacement à la fin des lignes lors de la sauvegarde.</translation> </message> <message> <location/> <source>&Clean whitespace</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Nettoyer les espaces</translation> </message> <message> <location/> <source>Clean whitespace in entire document instead of only for changed parts.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Nettoyer les espaces dans tout le document au lieu de limiter le nettoyage aux parties modifiées.</translation> </message> <message> <location/> <source>In entire &document</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Dans tout le &document</translation> </message> <message> <location/> <source>Correct leading whitespace according to tab settings.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Corriger les espaces à l'avant des lignes pour respecter la configuration des tabulations.</translation> </message> <message> <location/> <source>Clean indentation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Nettoyer l'indentation</translation> </message> <message> <location/> <source>&Ensure newline at end of file</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Forcer un retour de ligne à la fin du fichier</translation> </message> </context> <context> @@ -11421,12 +11422,12 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/displaysettingspage.ui"/> <source>Display</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Affichage</translation> </message> <message> <location/> <source>Display line &numbers</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Afficher les &numéros de ligne</translation> </message> <message> <location/> @@ -11436,52 +11437,52 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location/> <source>Show tabs and spaces.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Afficher les tabulations et espaces.</translation> </message> <message> <location/> <source>&Visualize whitespace</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Visualiser les espaces</translation> </message> <message> <location/> <source>Highlight current &line</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Surligner la &ligne courante</translation> </message> <message> <location/> <source>Highlight &blocks</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Surligner les &blocs</translation> </message> <message> <location/> <source>Animate matching parentheses</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Animer les parenthèses correspondantes</translation> </message> <message> <location/> <source>Text Wrapping</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Retour à la ligne dynamique</translation> </message> <message> <location/> <source>Enable text &wrapping</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Activer le &retour à la ligne automatique</translation> </message> <message> <location/> <source>Display right &margin at column:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Afficher une &marge à la colonne :</translation> </message> <message> <location/> <source>Navigation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Navigation</translation> </message> <message> <location/> <source>Enable &mouse navigation</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Activer la navigation à la &souris</translation> </message> </context> <context> @@ -11489,13 +11490,13 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/fontsettingspage.cpp" line="+210"/> <source>Font & Colors</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Polices et couleurs</translation> </message> <message> <location line="+209"/> <source> This is only an example.</source> - <translation type="unfinished"></translation> + <translation type="unfinished">\n\tCeci est seulement un exemple.</translation> </message> </context> <context> @@ -11503,28 +11504,28 @@ To do this, you type this shortcut and a space in the Locator entry field, and t <message> <location filename="../../../src/plugins/texteditor/codecselector.cpp" line="+72"/> <source>Text Encoding</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Encodage du texte</translation> </message> <message> <location line="+4"/> <source> The following encodings are likely to fit:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">\nLes encodages suivant pourrait fonctionner:</translation> </message> <message> <location line="+1"/> <source>Select encoding for "%1".%2</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Selectionner l'encodage pour "%1".%2</translation> </message> <message> <location line="+44"/> <source>Reload with Encoding</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Recharger avec l'encodage</translation> </message> <message> <location line="+1"/> <source>Save with Encoding</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Sauver avec l'encodage</translation> </message> </context> <context> @@ -11532,7 +11533,7 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/findincurrentfile.cpp" line="+57"/> <source>Current File</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fichier courrant</translation> </message> </context> <context> @@ -11540,27 +11541,27 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/findinfiles.cpp" line="+55"/> <source>Files on Disk</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fichiers sur le disque</translation> </message> <message> <location line="+37"/> <source>&Directory:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Dossier :</translation> </message> <message> <location line="+13"/> <source>&Browse</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Parcourir</translation> </message> <message> <location line="+4"/> <source>File &pattern:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">&Motif de fichier :</translation> </message> <message> <location line="+18"/> <source>Directory to search</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Dossier sur lequel effectuer la recherche</translation> </message> </context> <context> @@ -11568,22 +11569,22 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/fontsettingspage.ui"/> <source>Font</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Police</translation> </message> <message> <location/> <source>Family:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Famille :</translation> </message> <message> <location/> <source>Size:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Taille :</translation> </message> <message> <location/> <source>Antialias</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Anticrénelage</translation> </message> <message> <location/> @@ -11593,37 +11594,37 @@ The following encodings are likely to fit:</source> <message> <location/> <source>Bold</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Gras</translation> </message> <message> <location/> <source>Italic</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Italique</translation> </message> <message> <location/> <source>Background:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Arrière plan :</translation> </message> <message> <location/> <source>Foreground:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Premier plan :</translation> </message> <message> <location/> <source>Erase background</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Effacer l'arrière plan</translation> </message> <message> <location/> <source>x</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <location/> <source>Preview:</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Aperçu :</translation> </message> </context> <context> @@ -11631,12 +11632,12 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/linenumberfilter.cpp" line="+55"/> <source>Line %1</source> - <translation type="unfinished"></translation> + <translation>Ligne %1</translation> </message> <message> <location filename="../../../src/plugins/texteditor/linenumberfilter.h" line="+52"/> <source>Line in current document</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ligne du document courrant</translation> </message> </context> <context> @@ -11644,17 +11645,17 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/texteditorplugin.cpp" line="+94"/> <source>Creates a text file (.txt).</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Créer un fichier texte (.txt).</translation> </message> <message> <location line="+1"/> <source>Text File</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Fichier texte</translation> </message> <message> <location line="+2"/> <source>General</source> - <translation type="unfinished"></translation> + <translation>Général</translation> </message> <message> <location line="+26"/> @@ -11664,12 +11665,12 @@ The following encodings are likely to fit:</source> <message> <location line="+5"/> <source>Ctrl+Space</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Ctrl+Espace</translation> </message> <message> <location line="+2"/> <source>Meta+Space</source> - <translation type="unfinished"></translation> + <translation type="unfinished">Meta+Espace</translation> </message> <message> <location line="+6"/> @@ -11712,12 +11713,12 @@ The following encodings are likely to fit:</source> <message> <location line="+5"/> <source>&Visualize Whitespace</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <location line="+5"/> <source>Ctrl+E, Ctrl+V</source> - <translation type="unfinished"></translation> + <translation></translation> </message> <message> <location line="+5"/> @@ -11915,17 +11916,17 @@ The following encodings are likely to fit:</source> <message> <location filename="../../../src/plugins/texteditor/texteditorsettings.cpp" line="+64"/> <source>Text</source> - <translation type="unfinished"></translation> + <translation>Texte</translation> </message> <message> <location line="+4"/> <source>Link</source> - <translation type="unfinished"></translation> + <translation>Lien</translation> </message> <message> <location line="+1"/> <source>Selection</source> - <translation type="unfinished"></translation> + <translation>Sélection</translation> </message> <message> <location line="+1"/> diff --git a/src/libs/cplusplus/FastPreprocessor.cpp b/src/libs/cplusplus/FastPreprocessor.cpp index e1e0bd8c50923a318b4f18568f4f26fc7bd962bd..00b6f8eedabbba680f0dba4900d9d0fe004a7e77 100644 --- a/src/libs/cplusplus/FastPreprocessor.cpp +++ b/src/libs/cplusplus/FastPreprocessor.cpp @@ -38,10 +38,22 @@ FastPreprocessor::FastPreprocessor(const Snapshot &snapshot) QByteArray FastPreprocessor::run(QString fileName, const QString &source) { +#ifdef QTCREATOR_WITH_MERGED_ENVIRONMENT + if (Document::Ptr doc = _snapshot.value(fileName)) { + _merged.insert(fileName); + + foreach (const Document::Include &i, doc->includes()) + mergeEnvironment(i.fileName()); + } +#endif + const QByteArray preprocessed = _preproc(fileName, source); return preprocessed; } +void FastPreprocessor::sourceNeeded(QString &fileName, IncludeType, unsigned) +{ mergeEnvironment(fileName); } + void FastPreprocessor::mergeEnvironment(const QString &fileName) { if (! _merged.contains(fileName)) { diff --git a/src/libs/cplusplus/FastPreprocessor.h b/src/libs/cplusplus/FastPreprocessor.h index bbdbd535ba010ca5834c4a3494ba7b31df99a614..c7e6e2f8b1c8c2032c31174dfe3d4a44b0b73d19 100644 --- a/src/libs/cplusplus/FastPreprocessor.h +++ b/src/libs/cplusplus/FastPreprocessor.h @@ -54,8 +54,7 @@ public: QByteArray run(QString fileName, const QString &source); // CPlusPlus::Client - virtual void sourceNeeded(QString &fileName, IncludeType, unsigned) - { mergeEnvironment(fileName); } + virtual void sourceNeeded(QString &fileName, IncludeType, unsigned); virtual void macroAdded(const Macro &) {} diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 80832275804719a750f472fa9564e4380f319654..372926f59755cb51d82c8bca939498362830d22a 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -771,7 +771,11 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source, } else { if (_dot->whitespace) { - const unsigned endOfPreviousToken = (_dot - 1)->end(); + unsigned endOfPreviousToken = 0; + + if (_dot != _tokens.constBegin()) + endOfPreviousToken = (_dot - 1)->end(); + const unsigned beginOfToken = _dot->begin(); const char *start = _source.constBegin() + endOfPreviousToken; diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index a72f637e1d4f245adcbc8e4322457a346228b407..7e580484b4736a447263b32ca92bae7fad03a357 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -107,6 +107,14 @@ SideBarWidget *SideBar::insertSideBarWidget(int position, const QString &title) return item; } +void SideBar::removeSideBarWidget(SideBarWidget *widget) +{ + widget->removeCurrentItem(); + m_widgets.removeOne(widget); + widget->hide(); + widget->deleteLater(); +} + void SideBar::split() { SideBarWidget *original = qobject_cast<SideBarWidget*>(sender()); @@ -121,10 +129,7 @@ void SideBar::close() SideBarWidget *widget = qobject_cast<SideBarWidget*>(sender()); if (!widget) return; - widget->removeCurrentItem(); - m_widgets.removeOne(widget); - widget->hide(); - widget->deleteLater(); + removeSideBarWidget(widget); updateWidgets(); } } @@ -148,6 +153,9 @@ void SideBar::saveSettings(QSettings *settings) void SideBar::readSettings(QSettings *settings) { + foreach (SideBarWidget *widget, m_widgets) + removeSideBarWidget(widget); + if (settings->contains("HelpSideBar/Views")) { QStringList views = settings->value("HelpSideBar/Views").toStringList(); if (views.count()) { diff --git a/src/plugins/coreplugin/sidebar.h b/src/plugins/coreplugin/sidebar.h index 0a023be100f12d68d423a20e16b7777df2419842..bd6f1e1c260d9325c0f9671524ebd784d8c9f491 100644 --- a/src/plugins/coreplugin/sidebar.h +++ b/src/plugins/coreplugin/sidebar.h @@ -31,6 +31,7 @@ #define SIDEBAR_H #include <QtCore/QMap> +#include <QtCore/QPointer> #include <QtGui/QWidget> #include <QtGui/QComboBox> @@ -117,6 +118,8 @@ private slots: private: Internal::SideBarWidget *insertSideBarWidget(int position, const QString &title = QString()); + void removeSideBarWidget(Internal::SideBarWidget *widget); + QList<Internal::SideBarWidget*> m_widgets; QMap<QString, SideBarItem*> m_itemMap; diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 5d4f0a5990d642d264ac44e395f604713a0136f9..693dcf4e6617ddf524d1acb4ffea165478b9a89c 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -165,6 +165,9 @@ DebuggerSettings *DebuggerSettings::instance() item = new SavedAction(instance); instance->insertItem(AssignType, item); + item = new SavedAction(instance); + instance->insertItem(WatchPoint, item); + // // DebuggingHelper // @@ -173,18 +176,21 @@ DebuggerSettings *DebuggerSettings::instance() item->setText(tr("Use debugging helper")); item->setCheckable(true); item->setDefaultValue(true); + item->setValue(true); instance->insertItem(UseDebuggingHelpers, item); item = new SavedAction(instance); item->setSettingsKey(debugModeGroup, QLatin1String("UseCustomDebuggingHelperLocation")); item->setCheckable(true); item->setDefaultValue(false); + item->setValue(false); instance->insertItem(UseCustomDebuggingHelperLocation, item); item = new SavedAction(instance); item->setSettingsKey(debugModeGroup, QLatin1String("CustomDebuggingHelperLocation")); item->setCheckable(true); item->setDefaultValue(QString()); + item->setValue(QString()); instance->insertItem(CustomDebuggingHelperLocation, item); item = new SavedAction(instance); @@ -192,6 +198,7 @@ DebuggerSettings *DebuggerSettings::instance() item->setText(tr("Debug debugging helper")); item->setCheckable(true); item->setDefaultValue(false); + item->setValue(false); instance->insertItem(DebugDebuggingHelpers, item); diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h index d466a78df3dd40b3adacc6a7090dbe40911be710..5f953b6d10e53dfdd5f6d251d33f27c119439b66 100644 --- a/src/plugins/debugger/debuggeractions.h +++ b/src/plugins/debugger/debuggeractions.h @@ -94,7 +94,7 @@ enum DebuggerActionCode WatchExpression, WatchExpressionInWindow, RemoveWatchExpression, - WatchModelUpdate, + WatchPoint, UseToolTips, AssignValue, AssignType, diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index e9226a7c42277767ba5aca980ea46e46f40e0c25..15c586b5bba226397c49f1cf81c3a15ef912e571 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -434,7 +434,8 @@ void DebuggerManager::init() connect(theDebuggerAction(ExecuteCommand), SIGNAL(triggered()), this, SLOT(executeDebuggerCommand())); - + connect(theDebuggerAction(WatchPoint), SIGNAL(triggered()), + this, SLOT(watchPoint())); m_breakDock = createDockForWidget(m_breakWindow); @@ -1089,6 +1090,13 @@ void DebuggerManager::nextIExec() m_engine->nextIExec(); } +void DebuggerManager::watchPoint() +{ + if (QAction *action = qobject_cast<QAction *>(sender())) + if (m_engine) + m_engine->watchPoint(action->data().toPoint()); +} + void DebuggerManager::executeDebuggerCommand() { if (QAction *action = qobject_cast<QAction *>(sender())) diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 23624c7d601ee2af1ebca6dfdab0ce955fa58f69..bfbfc10e93c1db79bbd7ca815595dc0318273016 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -318,6 +318,8 @@ public slots: void executeDebuggerCommand(); void executeDebuggerCommand(const QString &command); + void watchPoint(); + void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever private slots: diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index c9f4a27fa396c12604cf4775730f06b3b83309b9..21d809e901850087cabfa59d075873da23058bfc 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -58,8 +58,8 @@ using ProjectExplorer::ApplicationRunConfiguration; //////////////////////////////////////////////////////////////////////// // A factory to create DebuggerRunControls -DebuggerRunner::DebuggerRunner(DebuggerManager *manager) : - m_manager(manager) +DebuggerRunner::DebuggerRunner(DebuggerManager *manager) + : m_manager(manager) {} bool DebuggerRunner::canRun(RunConfigurationPtr runConfiguration, const QString &mode) @@ -73,7 +73,7 @@ QString DebuggerRunner::displayName() const return tr("Debug"); } -RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, +RunControl *DebuggerRunner::run(RunConfigurationPtr runConfiguration, const QString &mode, const QSharedPointer<DebuggerStartParameters> &sp, DebuggerStartMode startMode) @@ -81,13 +81,13 @@ RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0); ApplicationRunConfigurationPtr rc = runConfiguration.dynamicCast<ApplicationRunConfiguration>(); - Q_ASSERT(!rc.isNull()); + QTC_ASSERT(!rc.isNull(), return 0); //qDebug() << "***** Debugging" << rc->name() << rc->executable(); DebuggerRunControl *runControl = new DebuggerRunControl(m_manager, startMode, sp, rc); return runControl; } -RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, +RunControl *DebuggerRunner::run(RunConfigurationPtr runConfiguration, const QString &mode) { const QSharedPointer<DebuggerStartParameters> sp(new DebuggerStartParameters); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 9ecdd0fece2b055cd675c42f166a8bbca87487e7..b564a5468a7c4149079bcb3e0304c3639a3e3e7d 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -103,6 +103,42 @@ static int ¤tToken() return token; } +// reads a MI-encoded item frome the consolestream +static bool parseConsoleStream(const GdbResultRecord &record, GdbMi *contents) +{ + GdbMi output = record.data.findChild("consolestreamoutput"); + QByteArray out = output.data(); + + int markerPos = out.indexOf('"') + 1; // position of 'success marker' + if (markerPos == 0 || out.at(markerPos) == 'f') { // 't' or 'f' + // custom dumper produced no output + return false; + } + + out = out.mid(markerPos + 1); + out = out.left(out.lastIndexOf('"')); + // optimization: dumper output never needs real C unquoting + out.replace('\\', ""); + out = "dummy={" + out + "}"; + + contents->fromString(out); + //qDebug() << "CONTENTS" << contents->toString(true); + return contents->isValid(); +} + +static QByteArray parsePlainConsoleStream(const GdbResultRecord &record) +{ + GdbMi output = record.data.findChild("consolestreamoutput"); + QByteArray out = output.data(); + // FIXME: proper decoding needed + if (out.endsWith("\\n")) + out.chop(2); + while (out.endsWith('\n') || out.endsWith(' ')) + out.chop(1); + int pos = out.indexOf(" = "); + return out.mid(pos + 3); +} + /////////////////////////////////////////////////////////////////////// // // GdbEngine @@ -2820,9 +2856,10 @@ static void setWatchDataSAddress(WatchData &data, const GdbMi &mi) void GdbEngine::setUseDebuggingHelpers(const QVariant &on) { - qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on; + //qDebug() << "SWITCHING ON/OFF DUMPER DEBUGGING:" << on; // FIXME: a bit too harsh, but otherwise the treeview sometimes look funny //m_expandedINames.clear(); + Q_UNUSED(on); setTokenBarrier(); updateLocals(); } @@ -3111,16 +3148,9 @@ void GdbEngine::handleQueryDebuggingHelper(const GdbResultRecord &record, const { m_dumperHelper.clear(); //qDebug() << "DATA DUMPER TRIAL:" << record.toString(); - GdbMi output = record.data.findChild("consolestreamoutput"); - QByteArray out = output.data(); - out = out.mid(out.indexOf('"') + 2); // + 1 is success marker - out = out.left(out.lastIndexOf('"')); - out.replace('\\', ""); // optimization: dumper output never needs real C unquoting - out = "dummy={" + out + "}"; - //qDebug() << "OUTPUT:" << out; GdbMi contents; - contents.fromString(out); + QTC_ASSERT(parseConsoleStream(record, &contents), /**/); GdbMi simple = contents.findChild("dumpers"); m_dumperHelper.setQtNamespace(_(contents.findChild("namespace").data())); @@ -3281,11 +3311,7 @@ void GdbEngine::handleDebuggingHelperValue1(const GdbResultRecord &record, if (record.resultClass == GdbResultDone) { // ignore this case, data will follow } else if (record.resultClass == GdbResultError) { - // Record an extra result, as the socket result will be lost - // in transmission - //--m_pendingRequests; QString msg = QString::fromLocal8Bit(record.data.findChild("msg").data()); - //qDebug() << "CUSTOM DUMPER ERROR MESSAGE:" << msg; #ifdef QT_DEBUG // Make debugging of dumpers easier if (theDebuggerBoolSetting(DebugDebuggingHelpers) @@ -3296,12 +3322,6 @@ void GdbEngine::handleDebuggingHelperValue1(const GdbResultRecord &record, return; } #endif - //if (msg.startsWith("The program being debugged was sig")) - // msg = strNotInScope; - //if (msg.startsWith("The program being debugged stopped while")) - // msg = strNotInScope; - //data.setError(msg); - //insertData(data); } } @@ -3310,6 +3330,7 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record, { WatchData data = cookie.value<WatchData>(); QTC_ASSERT(data.isValid(), return); + //qDebug() << "CUSTOM VALUE RESULT:" << record.toString(); //qDebug() << "FOR DATA:" << data.toString() << record.resultClass; if (record.resultClass != GdbResultDone) { @@ -3317,26 +3338,8 @@ void GdbEngine::handleDebuggingHelperValue2(const GdbResultRecord &record, return; } - GdbMi output = record.data.findChild("consolestreamoutput"); - QByteArray out = output.data(); - - int markerPos = out.indexOf('"') + 1; // position of 'success marker' - if (markerPos == 0 || out.at(markerPos) == 'f') { // 't' or 'f' - // custom dumper produced no output - data.setError(strNotInScope); - insertData(data); - return; - } - - out = out.mid(markerPos + 1); - out = out.left(out.lastIndexOf('"')); - out.replace('\\', ""); // optimization: dumper output never needs real C unquoting - out = "dummy={" + out + "}"; - GdbMi contents; - contents.fromString(out); - //qDebug() << "CONTENTS" << contents.toString(true); - if (!contents.isValid()) { + if (!parseConsoleStream(record, &contents)) { data.setError(strNotInScope); insertData(data); return; @@ -3759,60 +3762,6 @@ void GdbEngine::handleVarListChildren(const GdbResultRecord &record, } } -/* -void GdbEngine::handleToolTip(const GdbResultRecord &record, - const QVariant &cookie) -{ - const QByteArray &what = cookie.toByteArray(); - //qDebug() << "HANDLE TOOLTIP:" << what << m_toolTip.toString(); - // << "record: " << record.toString(); - if (record.resultClass == GdbResultError) { - if (what == "create") { - postCommand(_("ptype ") + m_toolTip.exp, - Discardable, CB(handleToolTip), QByteArray("ptype")); - return; - } - if (what == "evaluate") { - QByteArray msg = record.data.findChild("msg").data(); - if (msg.startsWith("Cannot look up value of a typedef")) { - m_toolTip.value = tr("%1 is a typedef.").arg(m_toolTip.exp); - //return; - } - } - } else if (record.resultClass == GdbResultDone) { - if (what == "create") { - setWatchDataType(m_toolTip, record.data.findChild("type")); - setWatchDataChildCount(m_toolTip, record.data.findChild("numchild")); - if (hasDebuggingHelperForType(m_toolTip.type)) - runDebuggingHelper(m_toolTip, false); - else - q->showStatusMessage(tr("Retrieving data for tooltip..."), 10000); - postCommand(_("-data-evaluate-expression ") + m_toolTip.exp, - Discardable, CB(handleToolTip), QByteArray("evaluate")); - return; - } - if (what == "evaluate") { - m_toolTip.value = m_toolTip.type + _c(' ') + m_toolTip.exp - + _(" = " + record.data.findChild("value").data()); - //return; - } - if (what == "ptype") { - GdbMi mi = record.data.findChild("consolestreamoutput"); - m_toolTip.value = extractTypeFromPTypeOutput(_(mi.data())); - //return; - } - } - - m_toolTip.iname = tooltipIName; - m_toolTip.setChildrenUnneeded(); - m_toolTip.setHasChildrenUnneeded(); - insertData(m_toolTip); - qDebug() << "DATA INSERTED"; - QTimer::singleShot(0, this, SLOT(updateWatchModel2())); - qDebug() << "HANDLE TOOLTIP END"; -} -*/ - #if 0 void GdbEngine::handleChangedItem(QStandardItem *item) { @@ -3933,6 +3882,29 @@ bool GdbEngine::startModeAllowsDumpers() const || q->startMode() == AttachExternal; } +void GdbEngine::watchPoint(const QPoint &pnt) +{ + //qDebug() << "WATCH " << pnt; + postCommand(_("call (void*)watchPoint(%1,%2)").arg(pnt.x()).arg(pnt.y()), + NeedsStop, CB(handleWatchPoint)); +} + +void GdbEngine::handleWatchPoint(const GdbResultRecord &record, const QVariant &) +{ + //qDebug() << "HANDLE WATCH POINT:" << record.toString(); + if (record.resultClass == GdbResultDone) { + GdbMi contents = record.data.findChild("consolestreamoutput"); + // "$5 = (void *) 0xbfa7ebfc\n" + QString str = _(parsePlainConsoleStream(record)); + // "(void *) 0xbfa7ebfc" + QString addr = str.mid(9); + QString ns = m_dumperHelper.qtNamespace(); + QString type = ns.isEmpty() ? _("QWidget*") : _("'%1QWidget'*").arg(ns); + QString exp = _("(*(%1)%2)").arg(type).arg(addr); + theDebuggerAction(WatchExpression)->trigger(exp); + } +} + IDebuggerEngine *createGdbEngine(DebuggerManager *parent, QList<Core::IOptionsPage*> *opts) { opts->push_back(new GdbOptionsPage); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 47dbd655cfd8676a66c618be15c4a760bb3e36b9..84f8ab32f82a1af820a8f01c93291583686a7440 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -115,6 +115,7 @@ private: void assignValueInDebugger(const QString &expr, const QString &value); void executeDebuggerCommand(const QString & command); + void watchPoint(const QPoint &); void loadSymbols(const QString &moduleName); void loadAllSymbols(); @@ -220,6 +221,7 @@ private: void handleExit(const GdbResultRecord &, const QVariant &); void handleSetTargetAsync(const GdbResultRecord &, const QVariant &); void handleTargetRemote(const GdbResultRecord &, const QVariant &); + void handleWatchPoint(const GdbResultRecord &, const QVariant &); void debugMessage(const QString &msg); bool showToolTip(); diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h index 8a7187b77f281181092fb48d11c535e41f791bbf..dbbdb14314385c5baa7da767c8423468aec055ee 100644 --- a/src/plugins/debugger/idebuggerengine.h +++ b/src/plugins/debugger/idebuggerengine.h @@ -93,6 +93,8 @@ public: virtual void reloadSourceFiles() = 0; virtual void reloadFullStack() = 0; + + virtual void watchPoint(const QPoint &) {} }; } // namespace Internal diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index c482a5f668eb5744df566fc45041f7a07f3e77fa..abe3b3cb8c01c878c3e86ab0fa40f0968ce586f1 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -82,16 +82,16 @@ static int generationCounter = 0; class WatchItem : public WatchData { public: - WatchItem() { parent = 0; fetchedTriggered = 0; } + WatchItem() { parent = 0; fetchTriggered = false; } WatchItem(const WatchData &data) : WatchData(data) - { parent = 0; fetchedTriggered = 0; } + { parent = 0; fetchTriggered = false; } void setData(const WatchData &data) { static_cast<WatchData &>(*this) = data; } WatchItem *parent; - bool fetchedTriggered; // children fetch has been triggered + bool fetchTriggered; // children fetch has been triggered QList<WatchItem *> children; // fetched children }; @@ -303,7 +303,7 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type) item->hasChildren = true; item->state = 0; item->parent = m_root; - item->fetchedTriggered = true; + item->fetchTriggered = true; m_root->children.append(item); } @@ -346,9 +346,11 @@ void WatchModel::removeOutdatedHelper(WatchItem *item) { if (item->generation < generationCounter) removeItem(item); - else + else { foreach (WatchItem *child, item->children) removeOutdatedHelper(child); + item->fetchTriggered = false; + } } void WatchModel::removeItem(WatchItem *item) @@ -479,15 +481,15 @@ QString niceType(QString type) bool WatchModel::canFetchMore(const QModelIndex &index) const { - return index.isValid() && !watchItem(index)->fetchedTriggered; + return index.isValid() && !watchItem(index)->fetchTriggered; } void WatchModel::fetchMore(const QModelIndex &index) { QTC_ASSERT(index.isValid(), return); - QTC_ASSERT(!watchItem(index)->fetchedTriggered, return); + QTC_ASSERT(!watchItem(index)->fetchTriggered, return); if (WatchItem *item = watchItem(index)) { - item->fetchedTriggered = true; + item->fetchTriggered = true; WatchData data = *item; data.setChildrenNeeded(); emit m_handler->watchDataUpdateNeeded(data); diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index 883d6cba1f736c976f89a42229939476fa35ebbe..60b75fdc76136b6069db7a84d076f286bbd1ca05 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -376,6 +376,9 @@ QString decodeData(const QByteArray &ba, int encoding) const QByteArray decodedBa = QByteArray::fromBase64(ba); return QString::fromUtf16(reinterpret_cast<const ushort *>(decodedBa.data()), decodedBa.size() / 2); } + case 5: { // base64 encoded 8 bit data, without quotes (see 1) + return quoteUnprintableLatin1(QByteArray::fromBase64(ba)); + } } return QCoreApplication::translate("Debugger", "<Encoding error>"); } diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 7fedf1520bfe0e27ec8c3a24df76020595e4c18e..feab5a2989cb9350b886587d8836978f5116cc01 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -114,6 +114,8 @@ public: WatchWindow::WatchWindow(Type type, QWidget *parent) : QTreeView(parent), m_alwaysResizeColumnsToContents(true), m_type(type) { + m_grabbing = false; + QAction *act = theDebuggerAction(UseAlternatingRowColors); setWindowTitle(tr("Locals and Watchers")); setAlternatingRowColors(act->isChecked()); @@ -219,6 +221,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) QAction *act3 = new QAction(tr("Insert new watch item"), &menu); menu.addAction(act3); + QAction *act4 = new QAction(tr("Select widget to watch"), &menu); + menu.addAction(act4); menu.addSeparator(); menu.addAction(theDebuggerAction(RecheckDebuggingHelpers)); @@ -233,7 +237,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) else if (act == act2) setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents); else if (act == act3) - theDebuggerAction(WatchExpression)->trigger(WatchHandler::watcherEditPlaceHolder()); + theDebuggerAction(WatchExpression) + ->trigger(WatchHandler::watcherEditPlaceHolder()); + else if (act == act4) { + grabMouse(Qt::CrossCursor); + m_grabbing = true; + } } void WatchWindow::resizeColumnsToContents() @@ -253,6 +262,17 @@ void WatchWindow::setAlwaysResizeColumnsToContents(bool on) header()->setResizeMode(1, mode); } +bool WatchWindow::event(QEvent *ev) +{ + if (m_grabbing && ev->type() == QEvent::MouseButtonPress) { + QMouseEvent *mev = static_cast<QMouseEvent *>(ev); + m_grabbing = false; + releaseMouse(); + theDebuggerAction(WatchPoint)->trigger(mapToGlobal(mev->pos())); + } + return QTreeView::event(ev); +} + void WatchWindow::editItem(const QModelIndex &idx) { Q_UNUSED(idx); // FIXME diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index af8cf163f6a15fc6c8fbd94dda447f3c7edfa240..b32319b64539e7e3cf27a5a0ae175cf2e9961308 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -69,13 +69,14 @@ private: void dragEnterEvent(QDragEnterEvent *ev); void dropEvent(QDropEvent *ev); void dragMoveEvent(QDragMoveEvent *ev); + bool event(QEvent *ev); void editItem(const QModelIndex &idx); - void resetHelper(const QModelIndex &idx); bool m_alwaysResizeColumnsToContents; Type m_type; + bool m_grabbing; }; diff --git a/src/plugins/designer/cpp/cpp.pri b/src/plugins/designer/cpp/cpp.pri index 3827bc836f818792f6a28b3b810ea6fcf5fe0d7e..a30a79402287dc3ed2584fe1b080e0d9811d073c 100644 --- a/src/plugins/designer/cpp/cpp.pri +++ b/src/plugins/designer/cpp/cpp.pri @@ -5,11 +5,14 @@ DEFINES+=CPP_ENABLED HEADERS+=$$PWD/formclasswizardpage.h \ $$PWD/formclasswizarddialog.h \ $$PWD/formclasswizard.h \ - $$PWD/formclasswizardparameters.h + $$PWD/formclasswizardparameters.h \ + $$PWD/cppsettingspage.h SOURCES+=$$PWD/formclasswizardpage.cpp \ $$PWD/formclasswizarddialog.cpp \ $$PWD/formclasswizard.cpp \ - $$PWD/formclasswizardparameters.cpp + $$PWD/formclasswizardparameters.cpp \ + $$PWD/cppsettingspage.cpp -FORMS+=$$PWD/formclasswizardpage.ui +FORMS+=$$PWD/formclasswizardpage.ui \ +$$PWD/cppsettingspagewidget.ui diff --git a/src/plugins/designer/cpp/cppsettingspage.cpp b/src/plugins/designer/cpp/cppsettingspage.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1486bd0ad207680e3c6e2732bef09a28dafdf54c --- /dev/null +++ b/src/plugins/designer/cpp/cppsettingspage.cpp @@ -0,0 +1,136 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** +**************************************************************************/ + +#include "cppsettingspage.h" +#include "designerconstants.h" + +#include <QtCore/QCoreApplication> +#include <coreplugin/icore.h> + +namespace Designer { +namespace Internal { + +// ---------- CppSettingsPageWidget + +CppSettingsPageWidget::CppSettingsPageWidget(QWidget *parent) : + QWidget(parent) +{ + m_ui.setupUi(this); +} + +FormClassWizardGenerationParameters CppSettingsPageWidget::parameters() const +{ + FormClassWizardGenerationParameters rc; + rc.setEmbedding(static_cast<FormClassWizardGenerationParameters::UiClassEmbedding>(uiEmbedding())); + rc.setRetranslationSupport(m_ui.retranslateCheckBox->isChecked()); + rc.setIncludeQtModule(m_ui.includeQtModuleCheckBox->isChecked()); + return rc; +} + +void CppSettingsPageWidget::setParameters(const FormClassWizardGenerationParameters &p) +{ + m_ui.retranslateCheckBox->setChecked(p.retranslationSupport()); + m_ui.includeQtModuleCheckBox->setChecked(p.includeQtModule()); + setUiEmbedding(p.embedding()); +} + +int CppSettingsPageWidget::uiEmbedding() const +{ + if (m_ui.ptrAggregationRadioButton->isChecked()) + return FormClassWizardGenerationParameters::PointerAggregatedUiClass; + if (m_ui.aggregationButton->isChecked()) + return FormClassWizardGenerationParameters::AggregatedUiClass; + return FormClassWizardGenerationParameters::InheritedUiClass; +} + +void CppSettingsPageWidget::setUiEmbedding(int v) +{ + switch (v) { + case FormClassWizardGenerationParameters::PointerAggregatedUiClass: + m_ui.ptrAggregationRadioButton->setChecked(true); + break; + case FormClassWizardGenerationParameters::AggregatedUiClass: + m_ui.aggregationButton->setChecked(true); + break; + case FormClassWizardGenerationParameters::InheritedUiClass: + m_ui.multipleInheritanceButton->setChecked(true); + break; + } +} + +// ---------- CppSettingsPage +CppSettingsPage::CppSettingsPage(QObject *parent) : Core::IOptionsPage(parent) +{ + m_parameters.fromSettings(Core::ICore::instance()->settings()); +} + +QString CppSettingsPage::id() const +{ + return QLatin1String(Designer::Constants::SETTINGS_CPP_SETTINGS); +} + +QString CppSettingsPage::trName() const +{ + return QCoreApplication::translate("Designer", Designer::Constants::SETTINGS_CPP_SETTINGS); +} + +QString CppSettingsPage::category() const +{ + return QLatin1String(Designer::Constants::SETTINGS_CATEGORY); +} + +QString CppSettingsPage::trCategory() const +{ + return QCoreApplication::translate("Designer", Designer::Constants::SETTINGS_CATEGORY); +} + +QWidget *CppSettingsPage::createPage(QWidget *parent) +{ + m_widget = new CppSettingsPageWidget(parent); + m_widget->setParameters(m_parameters); + return m_widget; +} + +void CppSettingsPage::apply() +{ + if (m_widget) { + const FormClassWizardGenerationParameters newParameters = m_widget->parameters(); + if (newParameters != m_parameters) { + m_parameters = newParameters; + m_parameters.toSettings(Core::ICore::instance()->settings()); + } + } +} + +void CppSettingsPage::finish() +{ +} + +} // namespace Internal +} // namespace Designer diff --git a/src/plugins/designer/cpp/cppsettingspage.h b/src/plugins/designer/cpp/cppsettingspage.h new file mode 100644 index 0000000000000000000000000000000000000000..bb52a8336340ef5e0211d22c500e24936a0a3a95 --- /dev/null +++ b/src/plugins/designer/cpp/cppsettingspage.h @@ -0,0 +1,81 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** +**************************************************************************/ + +#ifndef CPPSETTINGSPAGE_H +#define CPPSETTINGSPAGE_H + +#include "formclasswizardparameters.h" +#include "ui_cppsettingspagewidget.h" + +#include <coreplugin/dialogs/ioptionspage.h> + +#include <QtCore/QPointer> + +namespace Designer { +namespace Internal { + +class CppSettingsPageWidget : public QWidget +{ + Q_OBJECT +public: + explicit CppSettingsPageWidget(QWidget *parent = 0); + + FormClassWizardGenerationParameters parameters() const; + void setParameters(const FormClassWizardGenerationParameters &p); + +private: + int uiEmbedding() const; + void setUiEmbedding(int); + + Ui::CppSettingsPageWidget m_ui; +}; + +class CppSettingsPage : public Core::IOptionsPage +{ +public: + explicit CppSettingsPage(QObject *parent = 0); + + virtual QString id() const; + virtual QString trName() const; + virtual QString category() const; + virtual QString trCategory() const; + + virtual QWidget *createPage(QWidget *parent); + virtual void apply(); + virtual void finish(); + +private: + QPointer<CppSettingsPageWidget> m_widget; + FormClassWizardGenerationParameters m_parameters; +}; + +} // namespace Internal +} // namespace Designer + +#endif // CPPSETTINGSPAGE_H diff --git a/src/plugins/designer/cpp/cppsettingspagewidget.ui b/src/plugins/designer/cpp/cppsettingspagewidget.ui new file mode 100644 index 0000000000000000000000000000000000000000..8a34601df91bb7b3097e3f98c59bfce4cf8a6d05 --- /dev/null +++ b/src/plugins/designer/cpp/cppsettingspagewidget.ui @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Designer::Internal::CppSettingsPageWidget</class> + <widget class="QWidget" name="Designer::Internal::CppSettingsPageWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>526</width> + <height>369</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QGroupBox" name="uiclassGroupBox"> + <property name="title"> + <string>Embedding of the UI Class</string> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QRadioButton" name="ptrAggregationRadioButton"> + <property name="text"> + <string>Aggregation as a pointer member</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="aggregationButton"> + <property name="text"> + <string>Aggregation</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="multipleInheritanceButton"> + <property name="text"> + <string>Multiple Inheritance</string> + </property> + </widget> + </item> + </layout> + <zorder>aggregationButton</zorder> + <zorder>multipleInheritanceButton</zorder> + <zorder>ptrAggregationRadioButton</zorder> + </widget> + </item> + <item> + <widget class="QGroupBox" name="codeGenerationGroupBox"> + <property name="title"> + <string>Code Generation</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QCheckBox" name="retranslateCheckBox"> + <property name="text"> + <string>Support for changing languages at runtime</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="includeQtModuleCheckBox"> + <property name="text"> + <string>Include Qt module name</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>169</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp index 28e767ee9bde3136281bc5ef1489e96237816ff3..3cbb42f5ae1063d3829eb1239315187d8d0b5d50 100644 --- a/src/plugins/designer/cpp/formclasswizard.cpp +++ b/src/plugins/designer/cpp/formclasswizard.cpp @@ -87,17 +87,17 @@ QWizard *FormClassWizard::createWizardDialog(QWidget *parent, Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *errorMessage) const { const FormClassWizardDialog *wizardDialog = qobject_cast<const FormClassWizardDialog *>(w); - const FormClassWizardParameters params = wizardDialog->parameters(); + const Designer::FormClassWizardParameters params = wizardDialog->parameters(); - if (params.uiTemplate.isEmpty()) { + if (params.uiTemplate().isEmpty()) { *errorMessage = QLatin1String("Internal error: FormClassWizard::generateFiles: empty template contents"); return Core::GeneratedFiles(); } // header - const QString formFileName = buildFileName(params.path, params.uiFile, formSuffix()); - const QString headerFileName = buildFileName(params.path, params.headerFile, headerSuffix()); - const QString sourceFileName = buildFileName(params.path, params.sourceFile, sourceSuffix()); + const QString formFileName = buildFileName(params.path(), params.uiFile(), formSuffix()); + const QString headerFileName = buildFileName(params.path(), params.headerFile(), headerSuffix()); + const QString sourceFileName = buildFileName(params.path(), params.sourceFile(), sourceSuffix()); Core::GeneratedFile headerFile(headerFileName); headerFile.setEditorKind(QLatin1String(CppEditor::Constants::CPPEDITOR_KIND)); @@ -108,11 +108,13 @@ Core::GeneratedFiles FormClassWizard::generateFiles(const QWizard *w, QString *e // UI Core::GeneratedFile uiFile(formFileName); - uiFile.setContents(params.uiTemplate); + uiFile.setContents(params.uiTemplate()); uiFile.setEditorKind(QLatin1String(Constants::C_FORMEDITOR)); QString source, header; - params.generateCpp(&header, &source); + Designer::FormClassWizardGenerationParameters generationParameters; + generationParameters.fromSettings(Core::ICore::instance()->settings()); + params.generateCpp(generationParameters, &header, &source); sourceFile.setContents(source); headerFile.setContents(header); diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index f1b95e172975c2eed988cb13d1819663179a2f19..191200b9e3f654c4380fc2f419c3c085e2c3fe2c 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -98,7 +98,7 @@ FormClassWizardParameters FormClassWizardDialog::parameters() const FormClassWizardParameters rc; m_classPage->getParameters(&rc); // Name the ui class in the Ui namespace after the class specified - rc.uiTemplate = FormTemplateWizardPage::changeUiClassName(m_rawFormTemplate, rc.className); + rc.setUiTemplate(FormTemplateWizardPage::changeUiClassName(m_rawFormTemplate, rc.className())); return rc; } diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index bcbe8e9885fe49bbea22f91d26b2e1ec56f1f911..c6522de3abb1d56556253779b43ba5efe2490bfb 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -37,9 +37,12 @@ namespace Core { } namespace Designer { -namespace Internal { struct FormClassWizardParameters; + +namespace Internal { + + class FormClassWizardPage; class FormTemplateWizardPage; @@ -56,7 +59,7 @@ public: QString path() const; - FormClassWizardParameters parameters() const; + Designer::FormClassWizardParameters parameters() const; bool validateCurrentPage(); diff --git a/src/plugins/designer/cpp/formclasswizardpage.cpp b/src/plugins/designer/cpp/formclasswizardpage.cpp index 9697ed33a0e7fd1d90cec6ae1e901677c1f902d6..86284a6ee8669be996f1fdc500f40b25ac0f8d67 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.cpp +++ b/src/plugins/designer/cpp/formclasswizardpage.cpp @@ -43,10 +43,6 @@ #include <QtGui/QAbstractButton> #include <QtGui/QMessageBox> -static const char *formClassWizardPageGroupC = "FormClassWizardPage"; -static const char *translationKeyC = "RetranslationSupport"; -static const char *embeddingModeKeyC = "Embedding"; - namespace Designer { namespace Internal { @@ -64,13 +60,7 @@ FormClassWizardPage::FormClassWizardPage(QWidget * parent) : m_ui->newClassWidget->setAllowDirectories(true); connect(m_ui->newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged())); - - m_ui->extensionWidget->setVisible(false); - connect(m_ui->moreButton, SIGNAL(clicked(bool)), m_ui->extensionWidget, SLOT(setVisible(bool))); - connect(m_ui->settingsToolButton, SIGNAL(clicked()), this, SLOT(slotSettings())); - - restoreSettings(); } FormClassWizardPage::~FormClassWizardPage() @@ -79,13 +69,13 @@ FormClassWizardPage::~FormClassWizardPage() } // Retrieve settings of CppTools plugin. -static inline bool lowerCaseFiles(const Core::ICore *core) +static bool inline lowerCaseFiles(const Core::ICore *core) { - QString camelCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP); - camelCaseSettingsKey += QLatin1Char('/'); - camelCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY); + QString lowerCaseSettingsKey = QLatin1String(CppTools::Constants::CPPTOOLS_SETTINGSGROUP); + lowerCaseSettingsKey += QLatin1Char('/'); + lowerCaseSettingsKey += QLatin1String(CppTools::Constants::LOWERCASE_CPPFILES_KEY); - return core->settings()->value(camelCaseSettingsKey, QVariant(false)).toBool(); + return core->settings()->value(lowerCaseSettingsKey, QVariant(false)).toBool(); } // Set up new class widget from settings @@ -115,40 +105,6 @@ void FormClassWizardPage::setClassName(const QString &suggestedClassName) slotValidChanged(); } -int FormClassWizardPage::uiClassEmbedding() const -{ - if (m_ui->ptrAggregationRadioButton->isChecked()) - return PointerAggregatedUiClass; - if (m_ui->aggregationButton->isChecked()) - return AggregatedUiClass; - return InheritedUiClass; -} - -void FormClassWizardPage::setUiClassEmbedding(int v) -{ - switch (v) { - case PointerAggregatedUiClass: - m_ui->ptrAggregationRadioButton->setChecked(true); - break; - case AggregatedUiClass: - m_ui->aggregationButton->setChecked(true); - break; - case InheritedUiClass: - m_ui->multipleInheritanceButton->setChecked(true); - break; - } -} - -bool FormClassWizardPage::hasRetranslationSupport() const -{ - return m_ui->retranslateCheckBox->isChecked(); -} - -void FormClassWizardPage::setRetranslationSupport(bool v) -{ - m_ui->retranslateCheckBox->setChecked(v); -} - QString FormClassWizardPage::path() const { return m_ui->newClassWidget->path(); @@ -161,13 +117,11 @@ void FormClassWizardPage::setPath(const QString &p) void FormClassWizardPage::getParameters(FormClassWizardParameters *p) const { - p->embedding = static_cast<UiClassEmbedding>(uiClassEmbedding()); - p->languageChange = m_ui->retranslateCheckBox->isChecked(); - p->className = m_ui->newClassWidget->className(); - p->path = path(); - p->sourceFile = m_ui->newClassWidget->sourceFileName(); - p->headerFile = m_ui->newClassWidget->headerFileName(); - p->uiFile = m_ui->newClassWidget-> formFileName(); + p->setClassName(m_ui->newClassWidget->className()); + p->setPath(path()); + p->setSourceFile(m_ui->newClassWidget->sourceFileName()); + p->setHeaderFile(m_ui->newClassWidget->headerFileName()); + p->setUiFile(m_ui->newClassWidget-> formFileName()); } void FormClassWizardPage::slotValidChanged() @@ -188,47 +142,11 @@ bool FormClassWizardPage::validatePage() { QString errorMessage; const bool rc = m_ui->newClassWidget->isValid(&errorMessage); - if (rc) { - saveSettings(); - } else { + if (!rc) { QMessageBox::critical(this, tr("%1 - Error").arg(title()), errorMessage); } return rc; } -void FormClassWizardPage::saveSettings() -{ - Core::ICore *core = Core::ICore::instance(); - if (QSettings *settings = core->settings()) { - settings->beginGroup(QLatin1String(formClassWizardPageGroupC)); - settings->setValue(QLatin1String(translationKeyC), hasRetranslationSupport()); - settings->setValue(QLatin1String(embeddingModeKeyC), uiClassEmbedding()); - settings->endGroup(); - } -} - -void FormClassWizardPage::restoreSettings() -{ - bool retranslationSupport = true; - int embedding = PointerAggregatedUiClass; - - Core::ICore *core = Core::ICore::instance(); - if (QSettings *settings = core->settings()) { - - QString key = QLatin1String(formClassWizardPageGroupC); - key += QLatin1Char('/'); - const int groupLength = key.size(); - - key += QLatin1String(translationKeyC); - retranslationSupport = settings->value(key, retranslationSupport).toBool(); - - key.truncate(groupLength); - key += QLatin1String(embeddingModeKeyC); - embedding = settings->value(key, embedding).toInt(); - } - setUiClassEmbedding(embedding); - setRetranslationSupport(retranslationSupport); -} - } // namespace Internal } // namespace Designer diff --git a/src/plugins/designer/cpp/formclasswizardpage.h b/src/plugins/designer/cpp/formclasswizardpage.h index 72214604275bec893a2643f6af67b8723b0625f1..d335d953665ce3eeccd0fdb0751b6ffae0a3e927 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.h +++ b/src/plugins/designer/cpp/formclasswizardpage.h @@ -33,13 +33,16 @@ #include <QtGui/QWizardPage> namespace Designer { + +struct FormClassWizardParameters; +struct FormClassWizardGenerationParameters; + namespace Internal { namespace Ui { class FormClassWizardPage; } -struct FormClassWizardParameters; class FormClassWizardPage : public QWizardPage { @@ -52,18 +55,17 @@ public: virtual bool isComplete () const; virtual bool validatePage(); - int uiClassEmbedding() const; - bool hasRetranslationSupport() const; QString path() const; // Fill out applicable parameters - void getParameters(FormClassWizardParameters *) const; + void getParameters(FormClassWizardParameters *) const; + + FormClassWizardGenerationParameters generationParameters() const; + void setGenerationParameters(const FormClassWizardGenerationParameters &gp); public slots: void setClassName(const QString &suggestedClassName); void setPath(const QString &); - void setRetranslationSupport(bool); - void setUiClassEmbedding(int v); void slotSettings(); private slots: @@ -71,8 +73,6 @@ private slots: private: void initParameters(); - void saveSettings(); - void restoreSettings(); Ui::FormClassWizardPage *m_ui; bool m_isValid; diff --git a/src/plugins/designer/cpp/formclasswizardpage.ui b/src/plugins/designer/cpp/formclasswizardpage.ui index 9a2849ad0a0097f870a0d24ae9d7199e0dcf3242..6381b45fd0b62cc4703b592ccce43eee7925bd96 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.ui +++ b/src/plugins/designer/cpp/formclasswizardpage.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>552</width> - <height>498</height> + <width>542</width> + <height>267</height> </rect> </property> <property name="title"> @@ -21,7 +21,7 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="Core::Utils::NewClassWidget" name="newClassWidget" native="true"/> + <widget class="Core::Utils::NewClassWidget" name="newClassWidget"/> </item> </layout> </widget> @@ -48,114 +48,8 @@ </property> </widget> </item> - <item> - <widget class="QToolButton" name="moreButton"> - <property name="text"> - <string>More</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </item> - <item row="1" column="0"> - <widget class="QWidget" name="extensionWidget" native="true"> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QGroupBox" name="uiclassGroupBox"> - <property name="title"> - <string>Embedding of the UI class</string> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QRadioButton" name="ptrAggregationRadioButton"> - <property name="text"> - <string>Aggregation as a pointer member</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="aggregationButton"> - <property name="text"> - <string>Aggregation</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="multipleInheritanceButton"> - <property name="text"> - <string>Multiple Inheritance</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">buttonGroup</string> - </attribute> - </widget> - </item> - </layout> - <zorder>aggregationButton</zorder> - <zorder>multipleInheritanceButton</zorder> - <zorder>ptrAggregationRadioButton</zorder> - </widget> - </item> - <item> - <widget class="QGroupBox" name="variousGroupBox"> - <property name="title"> - <string/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QCheckBox" name="retranslateCheckBox"> - <property name="text"> - <string>Support for changing languages at runtime</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>57</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item row="1" column="1"> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> </layout> </widget> <customwidgets> diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp index b9a88e4a2c90a27a532b82e5ef032a2ae32de188..4f0881d9481f51bf7374f16de55356a55dcb0bab 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.cpp +++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp @@ -34,32 +34,298 @@ #include <cpptools/cppmodelmanagerinterface.h> #include <QtCore/QTextStream> +#include <QtCore/QSettings> #include <QtCore/QFileInfo> #include <QtCore/QDebug> +#include <QtCore/QSharedData> static const char *uiMemberC = "m_ui"; static const char *uiNamespaceC = "Ui"; +static const char *formClassWizardPageGroupC = "FormClassWizardPage"; +static const char *translationKeyC = "RetranslationSupport"; +static const char *embeddingModeKeyC = "Embedding"; + +// TODO: These 2 are general coding convention settings and +// should go to CppTools... +static const char *includeQtModuleKeyC = "IncludeQtModule"; +static const char *indentNamespaceKeyC = "IndentNamespace"; + namespace Designer { -namespace Internal { + +class FormClassWizardGenerationParametersPrivate : public QSharedData +{ +public: + FormClassWizardGenerationParametersPrivate(); + void fromSettings(const QSettings *); + void toSettings(QSettings *) const; + bool equals(const FormClassWizardGenerationParametersPrivate &rhs) const; + + FormClassWizardGenerationParameters::UiClassEmbedding embedding; + bool retranslationSupport; // Add handling for language change events + bool includeQtModule; // Include "<QtGui/[Class]>" or just "<[Class]>" + bool indentNamespace; +}; + +FormClassWizardGenerationParametersPrivate::FormClassWizardGenerationParametersPrivate() : + embedding(FormClassWizardGenerationParameters::PointerAggregatedUiClass), + retranslationSupport(true), + includeQtModule(false), + indentNamespace(false) +{ +} + +void FormClassWizardGenerationParametersPrivate::fromSettings(const QSettings *settings) +{ + QString key = QLatin1String(formClassWizardPageGroupC); + key += QLatin1Char('/'); + const int groupLength = key.size(); + + key += QLatin1String(translationKeyC); + retranslationSupport = settings->value(key, true).toBool(); + + key.truncate(groupLength); + key += QLatin1String(embeddingModeKeyC); + embedding = static_cast<FormClassWizardGenerationParameters::UiClassEmbedding>(settings->value(key, int(FormClassWizardGenerationParameters::PointerAggregatedUiClass)).toInt()); + + key.truncate(groupLength); + key += QLatin1String(includeQtModuleKeyC); + includeQtModule = settings->value(key, false).toBool(); + + key.truncate(groupLength); + key += QLatin1String(indentNamespaceKeyC); + indentNamespace = settings->value(key, false).toBool(); +} + +void FormClassWizardGenerationParametersPrivate::toSettings(QSettings *settings) const +{ + settings->beginGroup(QLatin1String(formClassWizardPageGroupC)); + settings->setValue(QLatin1String(translationKeyC), retranslationSupport); + settings->setValue(QLatin1String(embeddingModeKeyC), embedding); + settings->setValue(QLatin1String(includeQtModuleKeyC), includeQtModule); + settings->setValue(QLatin1String(indentNamespaceKeyC), indentNamespace); + settings->endGroup(); +} + +bool FormClassWizardGenerationParametersPrivate::equals(const FormClassWizardGenerationParametersPrivate &rhs) const +{ + return embedding == rhs.embedding && retranslationSupport == rhs.retranslationSupport + && includeQtModule == rhs.includeQtModule && indentNamespace == rhs.indentNamespace; +} + +FormClassWizardGenerationParameters::FormClassWizardGenerationParameters() : + m_d(new FormClassWizardGenerationParametersPrivate) +{ +} + +FormClassWizardGenerationParameters::~FormClassWizardGenerationParameters() +{ +} + +FormClassWizardGenerationParameters::FormClassWizardGenerationParameters(const FormClassWizardGenerationParameters &rhs) : + m_d(rhs.m_d) +{ +} + +FormClassWizardGenerationParameters &FormClassWizardGenerationParameters::operator=(const FormClassWizardGenerationParameters &rhs) +{ + if (this != &rhs) + m_d.operator=(rhs.m_d); + return *this; +} + +bool FormClassWizardGenerationParameters::equals(const FormClassWizardGenerationParameters &rhs) const +{ + return m_d->equals(*rhs.m_d.constData()); +} + +FormClassWizardGenerationParameters::UiClassEmbedding FormClassWizardGenerationParameters::embedding() const +{ + return m_d->embedding; +} + +void FormClassWizardGenerationParameters::setEmbedding(UiClassEmbedding e) +{ + m_d->embedding = e; +} + +bool FormClassWizardGenerationParameters::retranslationSupport() const +{ + return m_d->retranslationSupport; +} + +void FormClassWizardGenerationParameters::setRetranslationSupport(bool v) +{ + m_d->retranslationSupport = v; +} + +bool FormClassWizardGenerationParameters::includeQtModule() const +{ + return m_d->includeQtModule; +} + +void FormClassWizardGenerationParameters::setIncludeQtModule(bool v) +{ + m_d->includeQtModule = v; +} + +bool FormClassWizardGenerationParameters::indentNamespace() const +{ + return m_d->indentNamespace; +} + +void FormClassWizardGenerationParameters::setIndentNamespace(bool v) +{ + m_d->indentNamespace = v; +} + +void FormClassWizardGenerationParameters::fromSettings(const QSettings *settings) +{ + m_d->fromSettings(settings); +} + +void FormClassWizardGenerationParameters::toSettings(QSettings *settings) const +{ + m_d->toSettings(settings); +} + +// ----------- + +class FormClassWizardParametersPrivate : public QSharedData { +public: + bool generateCpp(const FormClassWizardGenerationParameters &fgp, + QString *header, QString *source, int indentation) const; + + QString uiTemplate; + QString className; + + QString path; + QString sourceFile; + QString headerFile; + QString uiFile; +}; FormClassWizardParameters::FormClassWizardParameters() : - embedding(PointerAggregatedUiClass), - languageChange(true) + m_d(new FormClassWizardParametersPrivate) { } -bool FormClassWizardParameters::generateCpp(QString *header, QString *source, int indentation) const +FormClassWizardParameters::~FormClassWizardParameters() { - const QString indent = QString(indentation, QLatin1Char(' ')); +} + +FormClassWizardParameters::FormClassWizardParameters(const FormClassWizardParameters &rhs) : + m_d(rhs.m_d) +{ +} + +FormClassWizardParameters &FormClassWizardParameters::operator=(const FormClassWizardParameters &rhs) +{ + if (this != &rhs) + m_d.operator =(rhs.m_d); + return *this; +} + +QString FormClassWizardParameters::uiTemplate() const +{ + return m_d->uiTemplate; +} + +void FormClassWizardParameters::setUiTemplate(const QString &s) +{ + m_d->uiTemplate = s; +} + +QString FormClassWizardParameters::className() const +{ + return m_d->className; +} + +void FormClassWizardParameters::setClassName(const QString &s) +{ + m_d->className = s; +} + +QString FormClassWizardParameters::path() const +{ + return m_d->path; +} + +void FormClassWizardParameters::setPath(const QString &s) +{ + m_d->path = s; +} + + +QString FormClassWizardParameters::sourceFile() const +{ + return m_d->sourceFile; +} + +void FormClassWizardParameters::setSourceFile(const QString &s) +{ + m_d->sourceFile = s; +} + +QString FormClassWizardParameters::headerFile() const +{ + return m_d->headerFile; +} + +void FormClassWizardParameters::setHeaderFile(const QString &s) +{ + m_d->headerFile = s; +} + + +QString FormClassWizardParameters::uiFile() const +{ + return m_d->uiFile; +} + +void FormClassWizardParameters::setUiFile(const QString &s) +{ + m_d->uiFile = s; +} + +bool FormClassWizardParameters::getUIXmlData(const QString &uiXml, QString *formBaseClass, QString *uiClassName) +{ + return Designer::Internal::FormTemplateWizardPage::getUIXmlData(uiXml, formBaseClass, uiClassName); +} + +QString FormClassWizardParameters::changeUiClassName(const QString &uiXml, const QString &newUiClassName) +{ + return Designer::Internal::FormTemplateWizardPage::changeUiClassName(uiXml, newUiClassName); +} + +// Write out how to access the Ui class in the source code. +static inline void writeUiMemberAccess(const FormClassWizardGenerationParameters &fp, QTextStream &str) +{ + switch(fp.embedding()) { + case FormClassWizardGenerationParameters::PointerAggregatedUiClass: + str << uiMemberC << "->"; + break; + case FormClassWizardGenerationParameters::AggregatedUiClass: + str << uiMemberC << '.'; + break; + case FormClassWizardGenerationParameters::InheritedUiClass: + break; + } +} + +bool FormClassWizardParametersPrivate::generateCpp(const FormClassWizardGenerationParameters &generationParameters, + QString *header, QString *source, int indentation) const +{ + const QString indent = QString(indentation, QLatin1Char(' ')); QString formBaseClass; QString uiClassName; - if (!FormTemplateWizardPage::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) { + if (!FormClassWizardParameters::getUIXmlData(uiTemplate, &formBaseClass, &uiClassName)) { qWarning("Unable to determine the form base class from %s.", uiTemplate.toUtf8().constData()); return false; } // Build the ui class (Ui::Foo) name relative to the namespace (which is the same): + const FormClassWizardGenerationParameters::UiClassEmbedding embedding = generationParameters.embedding(); const QString colonColon = QLatin1String("::"); const int lastSeparator = uiClassName.lastIndexOf(colonColon); if (lastSeparator != -1) @@ -87,88 +353,89 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in << "\n#define " << guard << '\n' << '\n'; // Include 'ui_' - if (embedding != PointerAggregatedUiClass) { + if (embedding != FormClassWizardGenerationParameters::PointerAggregatedUiClass) { Core::Utils::writeIncludeFileDirective(uiInclude, false, headerStr); } else { // Todo: Can we obtain the header from the code model for custom widgets? // Alternatively, from Designer. if (formBaseClass.startsWith(QLatin1Char('Q'))) { - QString baseInclude = QLatin1String("QtGui/"); - baseInclude += formBaseClass; + QString baseInclude = formBaseClass; + if (generationParameters.includeQtModule()) + baseInclude.insert(0, QLatin1String("QtGui/")); Core::Utils::writeIncludeFileDirective(baseInclude, true, headerStr); } } - const QString namespaceIndent = Core::Utils::writeOpeningNameSpaces(namespaceList, indent, headerStr); + const QString namespaceIndent = Core::Utils::writeOpeningNameSpaces(namespaceList, + generationParameters.indentNamespace() ? indent : QString(), + headerStr); // Forward-declare the UI class - if (embedding == PointerAggregatedUiClass) { + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) { headerStr << '\n' << namespaceIndent << "namespace " << uiNamespaceC << " {\n" - << namespaceIndent << indent << "class " << FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n" + << namespaceIndent << indent << "class " << Internal::FormTemplateWizardPage::stripNamespaces(uiClassName) << ";\n" << namespaceIndent << "}\n"; } // Class declaration headerStr << '\n' << namespaceIndent << "class " << unqualifiedClassName << " : public " << formBaseClass; - if (embedding == InheritedUiClass) { + if (embedding == FormClassWizardGenerationParameters::InheritedUiClass) { headerStr << ", private " << uiClassName; } headerStr << " {\n" << namespaceIndent << indent << "Q_OBJECT\n" << namespaceIndent << "public:\n" << namespaceIndent << indent << unqualifiedClassName << "(QWidget *parent = 0);\n"; - if (embedding == PointerAggregatedUiClass) + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) headerStr << namespaceIndent << indent << "~" << unqualifiedClassName << "();\n"; // retranslation - if (languageChange) + if (generationParameters.retranslationSupport()) headerStr << '\n' << namespaceIndent << "protected:\n" << namespaceIndent << indent << "void changeEvent(QEvent *e);\n"; // Member variable - if (embedding != InheritedUiClass) { + if (embedding != FormClassWizardGenerationParameters::InheritedUiClass) { headerStr << '\n' << namespaceIndent << "private:\n" << namespaceIndent << indent << uiClassName << ' '; - if (embedding == PointerAggregatedUiClass) + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) headerStr << '*'; headerStr << uiMemberC << ";\n"; } headerStr << namespaceIndent << "};\n\n"; - Core::Utils::writeClosingNameSpaces(namespaceList, indent, headerStr); + Core::Utils::writeClosingNameSpaces(namespaceList, generationParameters.indentNamespace() ? indent : QString(), headerStr); headerStr << "#endif // "<< guard << '\n'; // 2) Source file QTextStream sourceStr(source); sourceStr << license; Core::Utils::writeIncludeFileDirective(headerFile, false, sourceStr); - if (embedding == PointerAggregatedUiClass) + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) Core::Utils::writeIncludeFileDirective(uiInclude, false, sourceStr); // NameSpaces( - Core::Utils::writeOpeningNameSpaces(namespaceList, indent, sourceStr); + Core::Utils::writeOpeningNameSpaces(namespaceList, generationParameters.indentNamespace() ? indent : QString(), sourceStr); // Constructor with setupUi sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n" << namespaceIndent << indent << formBaseClass << "(parent)"; - if (embedding == PointerAggregatedUiClass) + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")\n"; sourceStr << namespaceIndent << "{\n" << namespaceIndent << indent; - if (embedding != InheritedUiClass) - sourceStr << uiMemberC << (embedding == PointerAggregatedUiClass ? "->" : "."); - sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n"; + writeUiMemberAccess(generationParameters, sourceStr); + sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n"; // Deleting destructor for ptr - if (embedding == PointerAggregatedUiClass) { + if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass) { sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::~" << unqualifiedClassName << "()\n" << namespaceIndent << "{\n" << namespaceIndent << indent << "delete " << uiMemberC << ";\n" << namespaceIndent << "}\n"; } // retranslation - if (languageChange) { + if (generationParameters.retranslationSupport()) { sourceStr << '\n' << namespaceIndent << "void " << unqualifiedClassName << "::" << "changeEvent(QEvent *e)\n" << namespaceIndent << "{\n" << namespaceIndent << indent << formBaseClass << "::changeEvent(e);\n" << namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n" << namespaceIndent << indent << indent; - if (embedding != InheritedUiClass) - sourceStr << uiMemberC << (embedding == PointerAggregatedUiClass ? "->" : "."); + writeUiMemberAccess(generationParameters, sourceStr); sourceStr << "retranslateUi(this);\n" << namespaceIndent << indent << indent << "break;\n" << namespaceIndent << indent << "default:\n" @@ -176,9 +443,15 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in << namespaceIndent << indent << "}\n" << namespaceIndent << "}\n"; } - Core::Utils::writeClosingNameSpaces(namespaceList, indent, sourceStr); + Core::Utils::writeClosingNameSpaces(namespaceList, generationParameters.indentNamespace() ? indent : QString(), sourceStr); return true; } -} // namespace Internal +bool FormClassWizardParameters::generateCpp(const FormClassWizardGenerationParameters &fgp, + QString *header, QString *source, int indentation) const +{ + return m_d->generateCpp(fgp, header, source, indentation); +} + + } // namespace Designer diff --git a/src/plugins/designer/cpp/formclasswizardparameters.h b/src/plugins/designer/cpp/formclasswizardparameters.h index 15c95253272174781ece9ee10f9bb3a696c738a8..6a5c65ac06038f141c3504d9dbb5a3e43b3fb254 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.h +++ b/src/plugins/designer/cpp/formclasswizardparameters.h @@ -30,35 +30,99 @@ #ifndef FORMCLASSWIZARDPARAMETERS_H #define FORMCLASSWIZARDPARAMETERS_H +#include "../designer_export.h" #include <QtCore/QString> +#include <QtCore/QSharedDataPointer> + +QT_BEGIN_NAMESPACE +class QSettings; +QT_END_NAMESPACE namespace Designer { -namespace Internal { +class FormClassWizardGenerationParametersPrivate; +class FormClassWizardParametersPrivate; + +// Parameters influencing the code generation. +class DESIGNER_EXPORT FormClassWizardGenerationParameters { +public: + // How to embed the Ui::Form class. + enum UiClassEmbedding { + PointerAggregatedUiClass, // "Ui::Form *m_ui"; + AggregatedUiClass, // "Ui::Form m_ui"; + InheritedUiClass // "...private Ui::Form..." + }; + + FormClassWizardGenerationParameters(); + ~FormClassWizardGenerationParameters(); + FormClassWizardGenerationParameters(const FormClassWizardGenerationParameters&); + FormClassWizardGenerationParameters &operator=(const FormClassWizardGenerationParameters &); + + void fromSettings(const QSettings *); + void toSettings(QSettings *) const; + + UiClassEmbedding embedding() const; + void setEmbedding(UiClassEmbedding e); + + bool retranslationSupport() const; // Add handling for language change events + void setRetranslationSupport(bool v); + + bool includeQtModule() const; // Include "<QtGui/[Class]>" or just "<[Class]>" + void setIncludeQtModule(bool v); + + bool indentNamespace() const; + void setIndentNamespace(bool v); -enum UiClassEmbedding { - PointerAggregatedUiClass, - AggregatedUiClass, - InheritedUiClass + bool equals(const FormClassWizardGenerationParameters &rhs) const; + +private: + QSharedDataPointer<FormClassWizardGenerationParametersPrivate> m_d; }; -struct FormClassWizardParameters { - explicit FormClassWizardParameters(); +inline bool operator==(const FormClassWizardGenerationParameters &p1, const FormClassWizardGenerationParameters &p2) { return p1.equals(p2); } +inline bool operator!=(const FormClassWizardGenerationParameters &p1, const FormClassWizardGenerationParameters &p2) { return !p1.equals(p2); } + +// Parameters required to generate the code part of a form class with +// helpers for XML-processing ui templates. +class DESIGNER_EXPORT FormClassWizardParameters { +public: + FormClassWizardParameters(); + ~FormClassWizardParameters(); + FormClassWizardParameters(const FormClassWizardParameters &); + FormClassWizardParameters &operator=(const FormClassWizardParameters &); + + bool generateCpp(const FormClassWizardGenerationParameters &fgp, + QString *header, QString *source, int indentation = 4) const; + + // Helper to parse UI XML forms to determine: + // 1) The ui class name from "<class>Designer::Internal::FormClassWizardPage</class>" + // 2) the base class from: widget class="QWizardPage"... + static bool getUIXmlData(const QString &uiXml, QString *formBaseClass, QString *uiClassName); + // Helper to change the class name in a UI XML form + static QString changeUiClassName(const QString &uiXml, const QString &newUiClassName); + + QString uiTemplate() const; + void setUiTemplate(const QString &); + + QString className() const; + void setClassName(const QString &); + + QString path() const; + void setPath(const QString &); + + QString sourceFile() const; + void setSourceFile(const QString &); - bool generateCpp(QString *header, QString *source, int indentation = 4) const; + QString headerFile() const; + void setHeaderFile(const QString &); - UiClassEmbedding embedding; - bool languageChange; // Add handling for language change events - QString uiTemplate; - QString className; + QString uiFile() const; + void setUiFile(const QString &); - QString path; - QString sourceFile; - QString headerFile; - QString uiFile; +private: + QSharedDataPointer<FormClassWizardParametersPrivate> m_d; }; -} // namespace Internal } // namespace Designer #endif // FORMCLASSWIZARDPARAMETERS_H diff --git a/src/plugins/designer/designerconstants.h b/src/plugins/designer/designerconstants.h index a6c53e0a3638ef1ffea2905d77f0a8f6719ca9d2..6896c67a4e84f6c3ac743142a900425986b2242c 100644 --- a/src/plugins/designer/designerconstants.h +++ b/src/plugins/designer/designerconstants.h @@ -30,9 +30,14 @@ #ifndef DESIGNERPLUGIN_CONSTANTS_H #define DESIGNERPLUGIN_CONSTANTS_H +#include <QtCore/QtGlobal> + namespace Designer { namespace Constants { +const char * const SETTINGS_CATEGORY = QT_TRANSLATE_NOOP("Designer", "Designer"); +const char * const SETTINGS_CPP_SETTINGS = QT_TRANSLATE_NOOP("Designer", "Class Generation"); + // context const char * const C_FORMEDITOR = "FormEditor"; const char * const T_FORMEDITOR = "FormEditor.Toolbar"; diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 40a6276133eed9534582e6d85438951295ef02df..3508626fb801e69e1c5e31e14b510233a2769108 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -35,6 +35,7 @@ #ifdef CPP_ENABLED # include "formclasswizard.h" # include <cppeditor/cppeditorconstants.h> +# include "cppsettingspage.h" #endif #include "designerconstants.h" @@ -60,24 +61,12 @@ using namespace Designer::Internal; using namespace Designer::Constants; -FormEditorPlugin::FormEditorPlugin() : - m_factory(0), - m_formWizard(0), - m_formClassWizard(0) +FormEditorPlugin::FormEditorPlugin() { } FormEditorPlugin::~FormEditorPlugin() { - if (m_factory) - removeObject(m_factory); - if (m_formWizard) - removeObject(m_formWizard); - if (m_formClassWizard) - removeObject(m_formClassWizard); - delete m_factory; - delete m_formWizard; - delete m_formClassWizard; FormEditorW::deleteInstance(); } @@ -95,30 +84,28 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error) if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/formeditor/Designer.mimetypes.xml"), error)) return false; - if (!initializeTemplates(error)) - return false; + initializeTemplates(); const int uid = core->uniqueIDManager()->uniqueIdentifier(QLatin1String(C_FORMEDITOR)); const QList<int> context = QList<int>() << uid; - m_factory = new FormEditorFactory; - addObject(m_factory); + addAutoReleasedObject(new FormEditorFactory); if (qgetenv("KDE_SESSION_VERSION") == QByteArray("4")) { // KDE 4, possibly dangerous... // KDE 4.2.0 had a nasty bug, which resulted in the File/Open Dialog crashing // so check for that an fully load the plugins QProcess proc; - proc.start("kde4-config", QStringList() << "--version"); + proc.start(QLatin1String("kde4-config"), QStringList(QLatin1String("--version"))); proc.waitForFinished(); - QString output = proc.readAll(); + const QByteArray output = proc.readAll(); if (output.contains("KDE: 4.2.0")) FormEditorW::ensureInitStage(FormEditorW::FullyInitialized); } else { FormEditorW::ensureInitStage(FormEditorW::RegisterPlugins); } - QString locale = qApp->property("qtc_locale").toString(); + const QString locale = qApp->property("qtc_locale").toString(); if (!locale.isEmpty()) { QTranslator *qtr = new QTranslator(this); const QString &creatorTrPath = @@ -143,26 +130,23 @@ void FormEditorPlugin::extensionsInitialized() // //////////////////////////////////////////////////// -bool FormEditorPlugin::initializeTemplates(QString *error) +void FormEditorPlugin::initializeTemplates() { - Q_UNUSED(error); FormWizard::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard); wizardParameters.setCategory(QLatin1String("Qt")); wizardParameters.setTrCategory(tr("Qt")); const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE); wizardParameters.setName(tr("Qt Designer Form")); wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui).")); - m_formWizard = new FormWizard(wizardParameters, this); - addObject(m_formWizard); + addAutoReleasedObject(new FormWizard(wizardParameters, this)); #ifdef CPP_ENABLED wizardParameters.setKind(Core::IWizard::ClassWizard); wizardParameters.setName(tr("Qt Designer Form Class")); wizardParameters.setDescription(tr("Creates a Qt Designer form file (.ui) with a matching class.")); - m_formClassWizard = new FormClassWizard(wizardParameters, this); - addObject(m_formClassWizard); + addAutoReleasedObject(new FormClassWizard(wizardParameters, this)); + addAutoReleasedObject(new CppSettingsPage); #endif - return true; } Q_EXPORT_PLUGIN(FormEditorPlugin) diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h index 60fdbee7d42a15b12b1469003e565ef20cbafd8a..d9d1fe50962f5c0b68e9cc7d66128762817f65f9 100644 --- a/src/plugins/designer/formeditorplugin.h +++ b/src/plugins/designer/formeditorplugin.h @@ -32,18 +32,9 @@ #include <extensionsystem/iplugin.h> -namespace Core { - class IWizard; - class ICore; -} - namespace Designer { namespace Internal { -class FormEditorFactory; -class FormWizard; -class FormEditorW; - class FormEditorPlugin : public ExtensionSystem::IPlugin { Q_OBJECT @@ -57,12 +48,7 @@ public: void extensionsInitialized(); private: - bool initializeTemplates(QString *error_message); - - FormEditorFactory *m_factory; - - Core::IWizard *m_formWizard; - Core::IWizard *m_formClassWizard; + void initializeTemplates(); }; } // namespace Internal diff --git a/src/plugins/designer/formtemplatewizardpage.h b/src/plugins/designer/formtemplatewizardpage.h index 2c52abd0a615d1f3edfa57af2c5ca20487b678f5..7ab9c036126860825895609bfb1c2759f34afeb3 100644 --- a/src/plugins/designer/formtemplatewizardpage.h +++ b/src/plugins/designer/formtemplatewizardpage.h @@ -54,7 +54,11 @@ public: QString templateContents() const { return m_templateContents; } + // Parse UI XML forms to determine: + // 1) The ui class name from "<class>Designer::Internal::FormClassWizardPage</class>" + // 2) the base class from: widget class="QWizardPage"... static bool getUIXmlData(const QString &uiXml, QString *formBaseClass, QString *uiClassName); + // Change the class name in a UI XML form static QString changeUiClassName(const QString &uiXml, const QString &newUiClassName); static QString stripNamespaces(const QString &className); diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp index 2fdee80d8f2c9a8156183f0b22440dae04952687..618c3e20788e2c2399efa679466938b0e7560dee 100644 --- a/src/plugins/designer/settingspage.cpp +++ b/src/plugins/designer/settingspage.cpp @@ -28,9 +28,11 @@ **************************************************************************/ #include "settingspage.h" +#include "designerconstants.h" #include <extensionsystem/pluginmanager.h> #include <qt_private/abstractoptionspage_p.h> +#include <QtCore/QCoreApplication> using namespace Designer::Internal; @@ -55,12 +57,12 @@ QString SettingsPage::trName() const QString SettingsPage::category() const { - return QLatin1String("Designer"); + return QLatin1String(Designer::Constants::SETTINGS_CATEGORY); } QString SettingsPage::trCategory() const { - return tr("Designer"); + return QCoreApplication::translate("Designer", Designer::Constants::SETTINGS_CATEGORY); } QWidget *SettingsPage::createPage(QWidget *parent) diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index bd7c2f12629f3652cf2ce2bf8a8224a62ebb30f2..ff4d2b6060a1b9a2bda7302b16d87fb9596b6e2f 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -53,8 +53,11 @@ ProjectWizardPage::~ProjectWizardPage() void ProjectWizardPage::setProjects(const QStringList &l) { + QStringList list = l; + list.removeDuplicates(); + list.sort(); m_ui->projectComboBox->clear(); - m_ui->projectComboBox->addItems(l); + m_ui->projectComboBox->addItems(list); } void ProjectWizardPage::setAddToProjectEnabled(bool b) diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.cpp b/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.cpp index 0617d1451238d2ff3aa6832b658163ad04c68eae..83042b443b5f9f0920fa6a1e3ff4be6534b81e8d 100644 --- a/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.cpp +++ b/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.cpp @@ -65,6 +65,8 @@ Core::GeneratedFiles CustomWidgetWizard::generateFiles(const QWizard *w, p.name = cw->name(); p.path = cw->path(); p.license = CppTools::AbstractEditorSupport::licenseTemplate(); + p.templatePath = QtWizard::templateDir(); + p.templatePath += QLatin1String("/customwidgetwizard"); return PluginGenerator::generatePlugin(p, *(cw->pluginOptions()), errorMessage); } diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.pri b/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.pri index a52a62848a3644f11c3f2eb12a1877ac795172ea..4547080e9611cba10199ee844f038c50e64f5e16 100644 --- a/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.pri +++ b/src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.pri @@ -22,4 +22,4 @@ FORMS += \ $$PWD/classdefinition.ui \ $$PWD/customwidgetwidgetswizardpage.ui \ $$PWD/customwidgetpluginwizardpage.ui -RESOURCES += $$PWD/templates/templates.qrc + diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.cpp index b2b67808921f511f56558839cac8b0cfc394b6b7..fdb712892e4506f0cbdae6f51761fbfb660ae2af 100644 --- a/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.cpp +++ b/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.cpp @@ -97,7 +97,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.clear(); sm.insert(QLatin1String("SINGLE_INCLUDE_GUARD"), headerGuard(wo.pluginHeaderFile)); sm.insert(QLatin1String("PLUGIN_CLASS"), wo.pluginClassName); - const QString pluginHeaderContents = processTemplate(QLatin1String(":/tpl_single.h"), sm, errorMessage); + const QString pluginHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_single.h"), sm, errorMessage); if (pluginHeaderContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile pluginHeader(baseDir + wo.pluginHeaderFile); @@ -128,7 +128,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara wo.pluginClassName + QLatin1Char(')') : QLatin1String("")); - const QString pluginSourceContents = processTemplate(QLatin1String(":/tpl_single.cpp"), sm, errorMessage); + const QString pluginSourceContents = processTemplate(p.templatePath + QLatin1String("/tpl_single.cpp"), sm, errorMessage); if (pluginSourceContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile pluginSource(baseDir + wo.pluginSourceFile); @@ -152,9 +152,9 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara if (pc.headers.isEmpty()) { if (wo.sourceType == PluginOptions::WidgetOptions::LinkLibrary) { pc.library = wo.widgetLibrary; - pc.tmpl = QLatin1String(":/tpl_widget_lib.pro"); + pc.tmpl = p.templatePath + QLatin1String("/tpl_widget_lib.pro"); } else { - pc.tmpl = QLatin1String(":/tpl_widget_include.pri"); + pc.tmpl = p.templatePath + QLatin1String("/tpl_widget_include.pri"); } widgetProjectContents.insert(wo.widgetProjectFile, pc); } else { @@ -171,7 +171,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("WIDGET_INCLUDE_GUARD"), headerGuard(wo.widgetHeaderFile)); sm.insert(QLatin1String("WIDGET_BASE_CLASS"), wo.widgetBaseClassName); sm.insert(QLatin1String("WIDGET_CLASS"), wo.widgetClassName); - const QString widgetHeaderContents = processTemplate(QLatin1String(":/tpl_widget.h"), sm, errorMessage); + const QString widgetHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_widget.h"), sm, errorMessage); if (widgetHeaderContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile widgetHeader(baseDir + wo.widgetHeaderFile); @@ -180,7 +180,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.remove(QLatin1String("WIDGET_INCLUDE_GUARD")); sm.insert(QLatin1String("WIDGET_HEADER"), wo.widgetHeaderFile); - const QString widgetSourceContents = processTemplate(QLatin1String(":/tpl_widget.cpp"), sm, errorMessage); + const QString widgetSourceContents = processTemplate(p.templatePath + QLatin1String("/tpl_widget.cpp"), sm, errorMessage); if (widgetSourceContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile widgetSource(baseDir + wo.widgetSourceFile); @@ -213,7 +213,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.clear(); sm.insert(QLatin1String("COLLECTION_INCLUDE_GUARD"), headerGuard(options.collectionHeaderFile)); sm.insert(QLatin1String("COLLECTION_PLUGIN_CLASS"), options.collectionClassName); - const QString collectionHeaderContents = processTemplate(QLatin1String(":/tpl_collection.h"), sm, errorMessage); + const QString collectionHeaderContents = processTemplate(p.templatePath + QLatin1String("/tpl_collection.h"), sm, errorMessage); if (collectionHeaderContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile collectionHeader(baseDir + options.collectionHeaderFile); @@ -233,7 +233,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara QLatin1String(", ") + options.collectionClassName + QLatin1Char(')')); - const QString collectionSourceFileContents = processTemplate(QLatin1String(":/tpl_collection.cpp"), sm, errorMessage); + const QString collectionSourceFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_collection.cpp"), sm, errorMessage); if (collectionSourceFileContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile collectionSource(baseDir + options.collectionSourceFile); @@ -262,7 +262,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara // Create the resource file with the icons. sm.clear(); sm.insert(QLatin1String("ICON_FILES"), iconFiles); - const QString resourceFileContents = processTemplate(QLatin1String(":/tpl_resources.qrc"), sm, errorMessage); + const QString resourceFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_resources.qrc"), sm, errorMessage); if (resourceFileContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile resourceFile(baseDir + options.resourceFile); @@ -277,7 +277,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara sm.insert(QLatin1String("PLUGIN_RESOURCES"), options.resourceFile); sm.insert(QLatin1String("WIDGET_LIBS"), QStringList(widgetLibraries.toList()).join(QString(blank))); sm.insert(QLatin1String("INCLUSIONS"), QStringList(widgetProjects.toList()).join(QLatin1String("\n"))); - const QString proFileContents = processTemplate(QLatin1String(":/tpl_plugin.pro"), sm, errorMessage); + const QString proFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_plugin.pro"), sm, errorMessage); if (proFileContents.isEmpty()) return QList<Core::GeneratedFile>(); Core::GeneratedFile proFile(baseDir + p.name + QLatin1String(".pro")); diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.h b/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.h index 5d89ca648b7b1d878b3bb5d3790a84ad4e22f5cf..6bc653143b0fb675600362188742d98a44c17e14 100644 --- a/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.h +++ b/src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.h @@ -52,6 +52,7 @@ struct GenerationParameters { QString path; QString name; QString license; + QString templatePath; }; class PluginGenerator : public QObject diff --git a/src/plugins/qt4projectmanager/customwidgetwizard/templates/templates.qrc b/src/plugins/qt4projectmanager/customwidgetwizard/templates/templates.qrc deleted file mode 100644 index 804d271dae41eb97653df93939ab3ca4f21e3bc3..0000000000000000000000000000000000000000 --- a/src/plugins/qt4projectmanager/customwidgetwizard/templates/templates.qrc +++ /dev/null @@ -1,14 +0,0 @@ -<RCC> - <qresource prefix="/" > - <file>tpl_widget.h</file> - <file>tpl_widget.cpp</file> - <file>tpl_widget_include.pri</file> - <file>tpl_widget_lib.pro</file> - <file>tpl_single.h</file> - <file>tpl_single.cpp</file> - <file>tpl_collection.h</file> - <file>tpl_collection.cpp</file> - <file>tpl_plugin.pro</file> - <file>tpl_resources.qrc</file> - </qresource> -</RCC> diff --git a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp index 8dcaeca88399312357fc281e885c881654d22111..108fd4cb4c3b14e56f3282670d900d9008ac10c9 100644 --- a/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp +++ b/src/plugins/qt4projectmanager/wizards/guiappwizard.cpp @@ -37,9 +37,12 @@ #include <utils/pathchooser.h> #include <projectexplorer/projectnodes.h> #include <cpptools/cppmodelmanagerinterface.h> +#include <designer/cpp/formclasswizardparameters.h> +#include <coreplugin/icore.h> #include <QtCore/QDir> #include <QtCore/QFile> +#include <QtCore/QSettings> #include <QtCore/QByteArray> #include <QtCore/QDebug> #include <QtCore/QTextStream> @@ -89,6 +92,33 @@ QWizard *GuiAppWizard::createWizardDialog(QWidget *parent, return dialog; } +// Use the class generation utils provided by the designer plugin +static inline bool generateFormClass(const GuiAppParameters ¶ms, + const Core::GeneratedFile &uiFile, + Core::GeneratedFile *formSource, + Core::GeneratedFile *formHeader, + QString *errorMessage) +{ + // Retrieve parameters from settings + Designer::FormClassWizardGenerationParameters fgp; + fgp.fromSettings(Core::ICore::instance()->settings()); + Designer::FormClassWizardParameters fp; + fp.setUiTemplate(uiFile.contents()); + fp.setUiFile(uiFile.path()); + fp.setClassName(params.className); + fp.setSourceFile(params.sourceFileName); + fp.setHeaderFile(params.headerFileName); + QString headerContents; + QString sourceContents; + if (!fp.generateCpp(fgp, &headerContents, &sourceContents, 4)) { + *errorMessage = QLatin1String("Internal error: Unable to generate the form classes."); + return false; + } + formHeader->setContents(headerContents); + formSource->setContents(sourceContents); + return true; +} + Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w, QString *errorMessage) const { @@ -108,28 +138,32 @@ Core::GeneratedFiles GuiAppWizard::generateFiles(const QWizard *w, if (!parametrizeTemplate(templatePath, QLatin1String("main.cpp"), params, &contents, errorMessage)) return Core::GeneratedFiles(); mainSource.setContents(license + contents); - // Create files: form source - const QString formSourceTemplate = params.designerForm ? QLatin1String("mywidget_form.cpp") : QLatin1String("mywidget.cpp"); + // Create files: form source with or without form const QString formSourceFileName = buildFileName(projectPath, params.sourceFileName, sourceSuffix()); - Core::GeneratedFile formSource(formSourceFileName); - if (!parametrizeTemplate(templatePath, formSourceTemplate, params, &contents, errorMessage)) - return Core::GeneratedFiles(); - formSource.setContents(license + contents); - // Create files: form header const QString formHeaderName = buildFileName(projectPath, params.headerFileName, headerSuffix()); - const QString formHeaderTemplate = params.designerForm ? QLatin1String("mywidget_form.h") : QLatin1String("mywidget.h"); + Core::GeneratedFile formSource(formSourceFileName); Core::GeneratedFile formHeader(formHeaderName); - if (!parametrizeTemplate(templatePath, formHeaderTemplate, params, &contents, errorMessage)) - return Core::GeneratedFiles(); - formHeader.setContents(license + contents); - // Create files: form + QSharedPointer<Core::GeneratedFile> form; if (params.designerForm) { + // Create files: form const QString formName = buildFileName(projectPath, params.formFileName, formSuffix()); form = QSharedPointer<Core::GeneratedFile>(new Core::GeneratedFile(formName)); if (!parametrizeTemplate(templatePath, QLatin1String("widget.ui"), params, &contents, errorMessage)) return Core::GeneratedFiles(); - form->setContents(contents); + form->setContents(contents); + if (!generateFormClass(params, *form, &formSource, &formHeader, errorMessage)) + return Core::GeneratedFiles(); + } else { + const QString formSourceTemplate = QLatin1String("mywidget.cpp"); + if (!parametrizeTemplate(templatePath, formSourceTemplate, params, &contents, errorMessage)) + return Core::GeneratedFiles(); + formSource.setContents(license + contents); + // Create files: form header + const QString formHeaderTemplate = QLatin1String("mywidget.h"); + if (!parametrizeTemplate(templatePath, formHeaderTemplate, params, &contents, errorMessage)) + return Core::GeneratedFiles(); + formHeader.setContents(license + contents); } // Create files: profile const QString profileName = buildFileName(projectPath, projectParams.name, profileSuffix()); diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index d4cd03b4bc07e320b44877973ce415be3a36c537..b8b327af50ecd77041b23f7397998b6b7a3fedcb 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -468,6 +468,7 @@ void testQObject(int &argc, char *argv[]) #endif QString str = QString::fromUtf8("XXXXXXXXXXXXXXyyXXX ö"); QLabel l(str); + l.setObjectName("Some Label"); l.show(); app.exec(); } @@ -915,7 +916,13 @@ void testQVariant1() void testQVariant2() { + QVariant value; + QVariant::Type t = QVariant::String; + value = QVariant(t, (void*)0); + *(QString*)value.data() = QString("XXX"); + int i = 1; +#if 0 QVariant var; var.setValue(1); var.setValue(2); @@ -927,6 +934,7 @@ void testQVariant2() var.setValue(QStringList() << "World" << "Hello"); var.setValue(QStringList() << "Hello" << "Hello"); var.setValue(QStringList() << "World" << "Hello" << "Hello"); +#endif #if 0 QVariant var3; QHostAddress ha("127.0.0.1");