From dd6f9b066b8c1b1f10d286489f855cc7dba36139 Mon Sep 17 00:00:00 2001
From: con <qtc-committer@nokia.com>
Date: Tue, 9 Nov 2010 17:32:19 +0100
Subject: [PATCH] Ship some example external tools.

---
 share/qtcreator/externaltools/lrelease.xml | 46 ++++++++++++++++++++++
 share/qtcreator/externaltools/lupdate.xml  | 46 ++++++++++++++++++++++
 share/qtcreator/externaltools/sort.xml     | 44 +++++++++++++++++++++
 share/qtcreator/externaltools/vi.xml       | 44 +++++++++++++++++++++
 share/qtcreator/static.pro                 | 23 ++++++-----
 5 files changed, 194 insertions(+), 9 deletions(-)
 create mode 100644 share/qtcreator/externaltools/lrelease.xml
 create mode 100644 share/qtcreator/externaltools/lupdate.xml
 create mode 100644 share/qtcreator/externaltools/sort.xml
 create mode 100644 share/qtcreator/externaltools/vi.xml

diff --git a/share/qtcreator/externaltools/lrelease.xml b/share/qtcreator/externaltools/lrelease.xml
new file mode 100644
index 00000000000..5629ca39508
--- /dev/null
+++ b/share/qtcreator/externaltools/lrelease.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+-->
+<externaltool>
+    <description>Creates qm translation files that can be used by an application from the translator's ts files</description>
+    <description xml:lang="de">Erstellt die von Anwendungen nutzbaren qm-Dateien aus ts-Dateien von Ãœbersetzern</description>
+    <displayname>Release translations (lrelease)</displayname>
+    <displayname xml:lang="de">Übersetzungen veröffentlichen (lrelease)</displayname>
+    <category>Linguist</category>
+    <category xml:lang="de">Linguist</category>
+    <order>2</order>
+    <executable>
+        <path>%{QT_INSTALL_BINS}/lrelease</path>
+        <path>lrelease</path>
+        <arguments>%{CurrentProjectFilePath}</arguments>
+        <workingdirectory>%{CurrentProjectPath}</workingdirectory>
+    </executable>
+</externaltool>
diff --git a/share/qtcreator/externaltools/lupdate.xml b/share/qtcreator/externaltools/lupdate.xml
new file mode 100644
index 00000000000..1ee57cd71e4
--- /dev/null
+++ b/share/qtcreator/externaltools/lupdate.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+-->
+<externaltool>
+    <description>Synchronizes translator's ts files with the program code</description>
+    <description xml:lang="de">Synchronisiert die ts-Ãœbersetzungsdateien mit dem Programmcode</description>
+    <displayname>Update translations (lupdate)</displayname>
+    <displayname xml:lang="de">Ãœbersetzungen aktualisieren (lupdate)</displayname>
+    <category>Linguist</category>
+    <category xml:lang="de">Linguist</category>
+    <order>1</order>
+    <executable>
+        <path>%{QT_INSTALL_BINS}/lupdate</path>
+        <path>lupdate</path>
+        <arguments>%{CurrentProjectFilePath}</arguments>
+        <workingdirectory>%{CurrentProjectPath}</workingdirectory>
+    </executable>
+</externaltool>
diff --git a/share/qtcreator/externaltools/sort.xml b/share/qtcreator/externaltools/sort.xml
new file mode 100644
index 00000000000..c7c5a826ae2
--- /dev/null
+++ b/share/qtcreator/externaltools/sort.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+-->
+<externaltool>
+    <description>Sorts the selected text</description>
+    <description xml:lang="de">Sortiert den ausgewählten Text</description>
+    <displayname>Sort</displayname>
+    <displayname xml:lang="de">Sortieren</displayname>
+    <category>Text</category>
+    <category xml:lang="de">Text</category>
+    <executable output="replaceselection">
+        <path>sort</path>
+        <arguments>%{CurrentSelectionFilePath}</arguments>
+        <workingdirectory>%{CurrentPath}</workingdirectory>
+    </executable>
+</externaltool>
diff --git a/share/qtcreator/externaltools/vi.xml b/share/qtcreator/externaltools/vi.xml
new file mode 100644
index 00000000000..b76ba327e9a
--- /dev/null
+++ b/share/qtcreator/externaltools/vi.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+-->
+<externaltool>
+    <description>Opens the current file in vi</description>
+    <description xml:lang="de">Öffnet die aktuelle Datei in vi</description>
+    <displayname>Edit with vi</displayname>
+    <displayname xml:lang="de">In vi öffnen</displayname>
+    <category>Text</category>
+    <category xml:lang="de">Text</category>
+    <executable output="reloaddocument">
+        <path>xterm</path>
+        <arguments>-geom %{EditorCharWidth}x%{EditorCharHeight}+%{EditorXPos}+%{EditorYPos} -e vi %{CurrentFilePath} +%{EditorLine} +"normal %{EditorColumn}|"</arguments>
+        <workingdirectory>%{CurrentPath}</workingdirectory>
+    </executable>
+</externaltool>
diff --git a/share/qtcreator/static.pro b/share/qtcreator/static.pro
index 259dc37f688..161b7a81c8b 100644
--- a/share/qtcreator/static.pro
+++ b/share/qtcreator/static.pro
@@ -39,6 +39,16 @@ DATA_DIRS = \
     generic-highlighter \
     glsl
 
+DATA_FILES = \
+    externaltools/lrelease.xml \
+    externaltools/lupdate.xml
+unix:DATA_FILES += externaltools/sort.xml
+linux-*:DATA_FILES += externaltools/vi.xml
+macx:DATA_FILES += runInTerminal.command
+win32:DATA_FILES ~= s|\\\\|/|g
+
+OTHER_FILES += $$DATA_FILES
+
 !isEmpty(copydata) {
 
     for(data_dir, DATA_DIRS) {
@@ -46,6 +56,7 @@ DATA_DIRS = \
         win32:files ~= s|\\\\|/|g
         for(file, files):!exists($$file/*):FILES += $$file
     }
+    for(file, DATA_FILES):FILES += $$PWD/$$file
 
     macx:OTHER_FILES += $$FILES
     copy2build.input = FILES
@@ -56,15 +67,6 @@ DATA_DIRS = \
     copy2build.name = COPY ${QMAKE_FILE_IN}
     copy2build.CONFIG += no_link
     QMAKE_EXTRA_COMPILERS += copy2build
-
-    macx {
-        run_in_term.target = $$IDE_DATA_PATH/runInTerminal.command
-        run_in_term.depends = $$PWD/runInTerminal.command
-        run_in_term.commands = $$QMAKE_COPY \"$<\" \"$@\"
-        QMAKE_EXTRA_TARGETS += run_in_term
-        PRE_TARGETDEPS += $$run_in_term.target
-        QMAKE_CLEAN += $$run_in_term.target
-    }
 }
 
 !macx {
@@ -73,4 +75,7 @@ DATA_DIRS = \
         eval($${data_dir}.path = /share/qtcreator)
         INSTALLS += $$data_dir
     }
+    data_files.files = $$DATA_FILES
+    data_files.path = /share/qtcreator
+    INSTALLS += $$data_files
 }
-- 
GitLab