summaryrefslogtreecommitdiff
path: root/scripts/q_add_application
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /scripts/q_add_application
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'scripts/q_add_application') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/q_add_application49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/q_add_application b/scripts/q_add_application
new file mode 100755
index 0000000..f9d259f
--- a/dev/null
+++ b/scripts/q_add_application
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Script to add a new application to the Qtopia Environment
+#
+# Copyright 1999-2000 Trolltech AS. All rights reserved.
+#
+
+
+# load the helper functions
+. q_functions
+
+
+if [ $# -lt 2 ]
+then
+echo "Usage: q_add_application NewAppName NewAppsMainClassName [MenuItemName] [Description]"
+print_example_usage
+exit
+fi
+
+
+NEW_APP_NAME=$1
+NEW_CLASS_NAME=$2
+NEW_APP_MENU_NAME=$NEW_CLASS_NAME
+NEW_APP_DESCRIPTION=$NEW_CLASS_NAME
+[ $# -lt 3 ] || NEW_APP_MENU_NAME=$3
+[ $# -lt 4 ] || NEW_APP_DESCRIPTION=$4
+
+
+NEW_APP_FOLDER=$NEW_APP_NAME
+NEW_APP_PRO_FILE="$NEW_APP_NAME".pro
+NEW_APP_DESKTOP_FILE="$NEW_APP_NAME".desktop
+NEW_APP_ICON_FILE="$NEW_APP_NAME"_icon.xpm
+NEW_APP_MAIN_FILE=main.cpp
+NEW_CLASS_HEADER_FILE="$NEW_APP_NAME".h
+NEW_CLASS_SOURCE_FILE="$NEW_APP_NAME".cpp
+NEW_CLASS_HEADER_DEFINE=__`echo $NEW_APP_NAME | tr [a-z] [A-Z]`_H__
+
+
+[ -d $NEW_APP_FOLDER ] || mkdir $NEW_APP_FOLDER
+print_source_file >> $NEW_APP_FOLDER/$NEW_CLASS_SOURCE_FILE
+print_header_file >> $NEW_APP_FOLDER/$NEW_CLASS_HEADER_FILE
+print_main_file >> $NEW_APP_FOLDER/$NEW_APP_MAIN_FILE
+print_pro_file >> $NEW_APP_FOLDER/$NEW_APP_PRO_FILE
+print_desktop_file >> $NEW_APP_FOLDER/$NEW_APP_DESKTOP_FILE
+print_icon_file >> $NEW_APP_FOLDER/$NEW_APP_ICON_FILE
+print_install_file >> $NEW_APP_FOLDER/install
+chmod u+x $NEW_APP_FOLDER/install
+
+