~ubuntu-branches/ubuntu/wily/playonlinux/wily

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env bash

# Copyright (C) 2007-2010 PlayOnLinux Team
# Copyright (C) 2007-2011 Pâris Quentin

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 

# PlayOnLinux bug report script
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

[ "$POL_OS" == "Linux" ] && TRACKER="1"
[ "$POL_OS" == "FreeBSD" ] && TRACKER="1"
[ "$POL_OS" == "Mac" ] && TRACKER="4"

# $1 = Nom de l'application
#export TITLE="$1"
export POL_SCRIPT_FAILED="NO" # Sinon on va tourner en rond

POL_DEBUG_TITLE="$(eval_gettext "Report a bug")"
export TITLE="$POL_DEBUG_TITLE"

POL_SetupWindow_Init

POL_SetupWindow_free_presentation "$POL_DEBUG_TITLE" "$(eval_gettext "This wizard will help you to report a bug about an officially supported program.")\n\n$(eval_gettext "Please give the more details as you can, otherwise, it will be very difficult to help you")"

if [ "$POL_UPTODATE" = "FALSE" ];
then
	POL_SetupWindow_message "$(eval_gettext 'Your $APPLICATION_TITLE version is not up to date.\nYou must update $APPLICATION_TITLE before sending a bug report.\nThank you')" "$TITLE"
	POL_SetupWindow_Close
	exit 0
fi
if [ "$LOGTITLE" = "" ]
then
POL_SetupWindow_menu_num "$(eval_gettext "What kind of problem do you have?")" "$POL_DEBUG_TITLE" "$(eval_gettext 'My problem concerns $APPLICATION_TITLE itself')~$(eval_gettext "I have a problem with a software")" "~"
PROBLEM_TYPE="$APP_ANSWER"
if [ "$PROBLEM_TYPE" = "1" ]
then
	LNG_NO_JOIN="$(eval_gettext "Don't join any log file")"
	LIST="$LNG_NO_JOIN"
	cd "$POL_USER_ROOT/logs"
	LNG_MANUAL="$(eval_gettext 'Manual installation')"
	LNG_AUTOMATIC="$(eval_gettext 'Automatic installation')"
	for file in *
	do
		case "$file" in
			"$LNG_MANUAL"*|"Automatic installation"|"$LNG_AUTOMATIC"*)
				;;
			*)
				LIST="$LIST~$file"
				;;
		esac
	done
	POL_SetupWindow_menu "$(eval_gettext "Choose the log file corresponding to your software.")" "$POL_DEBUG_TITLE" "$LIST" "~"
	[ "$APP_ANSWER" = "$LNG_NO_JOIN" ] || LOGTITLE="$APP_ANSWER"
fi
fi


TEMPLATE="- What were you doing when the problem occurred?

- What did you expect?

- What happened instead?

- Anything else to report?
"
POL_SetupWindow_textbox_multiline "$(eval_gettext "Please explain your problem clearly (english only):")" "$POL_DEBUG_TITLE" "$TEMPLATE"

if [ -z "$APP_ANSWER" -o "$APP_ANSWER" = "$TEMPLATE" ]
then
	POL_SetupWindow_message "$(eval_gettext 'Sorry, we need a detailed description.')" "$TITLE"
	POL_SetupWindow_Close
	exit 0
fi

DESCRIPTION="$APP_ANSWER"
	
POL_Website_login
POL_Website_Init

SCRIPTTITLE="$LOGTITLE"


if [ "$LOGTITLE" = "" ]
then
	POL_Website_curl "http://www.playonlinux.com/api/uploadLog.php" -F message="$DESCRIPTION" -F script="$SCRIPTTITLE"
else
	POL_Website_curl "http://www.playonlinux.com/api/uploadLog.php" -F message="$DESCRIPTION" -F script="$SCRIPTTITLE" -F bugfile="@$POL_USER_ROOT/logs/$LOGTITLE/$LOGTITLE.log"
fi

BugURL="$(POL_Website_Result)"

POL_Website_Close
POL_Website_logout
POL_SetupWindow_message "$(eval_gettext "Thank you !\n\nYour report has been sent.")" "$TITLE"

POL_Open "$BugURL"

POL_SetupWindow_Close