Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-03-11 15:07:20 +01:00
commit 9e95ca10b2
5 changed files with 43 additions and 13 deletions

View File

@ -78,10 +78,12 @@ public class ErrorActivity extends AppCompatActivity {
public static final int REQUESTED_STREAM = 1;
public static final int GET_SUGGESTIONS = 2;
public static final int SOMETHING_ELSE = 3;
public static final int USER_REPORT = 4;
public static final String SEARCHED_STRING = "searched";
public static final String REQUESTED_STREAM_STRING = "requested stream";
public static final String GET_SUGGESTIONS_STRING = "get suggestions";
public static final String SOMETHING_ELSE_STRING = "something";
public static final String USER_REPORT_STRING = "user report";
public static final String ERROR_EMAIL_ADDRESS = "crashreport@newpipe.schabi.org";
public static final String ERROR_EMAIL_SUBJECT = "Exception in NewPipe " + BuildConfig.VERSION_NAME;
@ -129,16 +131,23 @@ public class ErrorActivity extends AppCompatActivity {
public static void reportError(final Context context, final Exception e,
final Class returnAcitivty, View rootView, final ErrorInfo errorInfo) {
List<Exception> el = new Vector<>();
el.add(e);
List<Exception> el = null;
if(e != null) {
el = new Vector<>();
el.add(e);
}
reportError(context, el, returnAcitivty, rootView, errorInfo);
}
// async call
public static void reportError(Handler handler, final Context context, final Exception e,
final Class returnAcitivty, final View rootView, final ErrorInfo errorInfo) {
List<Exception> el = new Vector<>();
el.add(e);
List<Exception> el = null;
if(e != null) {
el = new Vector<>();
el.add(e);
}
reportError(handler, context, el, returnAcitivty, rootView, errorInfo);
}
@ -230,9 +239,11 @@ public class ErrorActivity extends AppCompatActivity {
private String formErrorText(List<Exception> el) {
String text = "";
for (Exception e : el) {
text += "-------------------------------------\n"
+ ExceptionUtils.getStackTrace(e);
if(el != null) {
for (Exception e : el) {
text += "-------------------------------------\n"
+ ExceptionUtils.getStackTrace(e);
}
}
text += "-------------------------------------";
return text;
@ -286,8 +297,10 @@ public class ErrorActivity extends AppCompatActivity {
.put("ip_range", globIpRange);
JSONArray exceptionArray = new JSONArray();
for (Exception e : errorList) {
exceptionArray.put(ExceptionUtils.getStackTrace(e));
if(errorList != null) {
for (Exception e : errorList) {
exceptionArray.put(ExceptionUtils.getStackTrace(e));
}
}
errorObject.put("exceptions", exceptionArray);
@ -312,6 +325,8 @@ public class ErrorActivity extends AppCompatActivity {
return GET_SUGGESTIONS_STRING;
case SOMETHING_ELSE:
return SOMETHING_ELSE_STRING;
case USER_REPORT:
return USER_REPORT_STRING;
default:
return "Your description is in another castle.";
}

View File

@ -24,6 +24,7 @@ import org.schabi.newpipe.extractor.StreamingService;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Vector;
/**
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
@ -346,6 +347,14 @@ public class VideoItemListActivity extends AppCompatActivity
startActivity(intent);
return true;
}
case R.id.action_report_error: {
ErrorActivity.reportError(VideoItemListActivity.this, new Vector<Exception>(),
null, null,
ErrorActivity.ErrorInfo.make(ErrorActivity.USER_REPORT,
ServiceList.getNameOfService(currentStreamingServiceId),
"user_report", R.string.user_report));
return true;
}
default:
return videoFragment.onOptionsItemSelected(item) ||
super.onOptionsItemSelected(item);

View File

@ -10,4 +10,8 @@
<item android:id="@+id/action_settings"
app:showAsAction="never"
android:title="@string/settings"/>
<item android:id="@+id/action_report_error"
app:showAsAction="never"
android:title="@string/report_error" />
</menu>

View File

@ -32,8 +32,8 @@
<string name="download_path_audio_summary">Path to store downloaded audio in.</string>
<string name="download_path_audio_dialog_title">Enter download path for audio files.</string>
<string name="autoplay_through_intent_title">Autoplay through Intent</string>
<string name="autoplay_through_intent_summary">Automatically play a video when it\'s called from another app.</string>
<string name="autoplay_by_calling_app_title">Autoplay when called form another app.</string>
<string name="autoplay_by_calling_app_summary">Automatically play a video when NewPipe is called from another app.</string>
<string name="default_resolution_title">Default Resolution</string>
<string name="play_with_kodi_title">Play with Kodi</string>
<string name="kore_not_found">Kore app not found. Install Kore?</string>
@ -113,6 +113,8 @@
<string name="detail_dislikes_img_view_description">Dislikes</string>
<string name="use_tor_title">Use Tor</string>
<string name="use_tor_summary">(Experimental) Force download traffic through Tor for increased privacy (streaming videos not yet supported).</string>
<string name="report_error">Report an Error</string>
<string name="user_report">User report</string>
<string name="err_dir_create">Cannot create download directory \'%1$s\'</string>
<string name="info_dir_created">Created download directory \'%1$s\'</string>

View File

@ -106,8 +106,8 @@
<CheckBoxPreference
android:key="@string/autoplay_through_intent_key"
android:title="@string/autoplay_through_intent_title"
android:summary="@string/autoplay_through_intent_summary"
android:title="@string/autoplay_by_calling_app_title"
android:summary="@string/autoplay_by_calling_app_summary"
android:defaultValue="false" />
<CheckBoxPreference