Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Display an error message if SickRage doesn't support version check
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Jul 19, 2015
1 parent aa72450 commit 736d25f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
int id = menuItem.getItemId();

switch (id) {
case R.id.menu_check_update: {
this.checkForUpdate(true);

return true;
}

case R.id.menu_coming_episodes: {
Intent intent = new Intent(this, ComingEpisodesActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
Expand Down Expand Up @@ -152,12 +158,6 @@ public void onClick(DialogInterface dialog, int which) {
return true;
}

case R.id.menu_check_update: {
this.checkForUpdate(true);

return true;
}

case R.id.menu_shows: {
Intent intent = new Intent(this, ShowsActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
Expand Down Expand Up @@ -391,6 +391,12 @@ private CheckForUpdateCallback(AppCompatActivity activity, boolean manualCheck)
public void failure(RetrofitError error) {
// SickRage may not support this request
// SickRage version 4.0.30 is required
AppCompatActivity activity = this.activityReference.get();

if (activity != null) {
Toast.makeText(activity, R.string.sickrage_4030_required, Toast.LENGTH_SHORT).show();
}

error.printStackTrace();
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<string name="show">Série</string>
<string name="show_name_episode"><xliff:g example="2 Broke Girls" id="show_name">%1$s</xliff:g> - S<xliff:g example="01" id="season">%2$02d</xliff:g>E<xliff:g example="01" id="episode">%3$02d</xliff:g></string>
<string name="shows">Séries</string>
<string name="sickrage_4030_required">Cette fonctionnalité nécessite SickRage version 4.0.30</string>
<string name="sickrage_updated">SickRage a bien été mis à jour</string>
<string name="skipped">Passé</string>
<string name="snatched">Récupéré</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<string name="show">Show</string>
<string name="show_name_episode"><xliff:g example="2 Broke Girls" id="show_name">%1$s</xliff:g> - S<xliff:g example="01" id="season">%2$02d</xliff:g>E<xliff:g example="01" id="episode">%3$02d</xliff:g></string>
<string name="shows">Shows</string>
<string name="sickrage_4030_required">This feature requires SickRage version 4.0.30</string>
<string name="sickrage_updated">SickRage was successfully updated</string>
<string name="skipped">Skipped</string>
<string name="snatched">Snatched</string>
Expand Down

0 comments on commit 736d25f

Please sign in to comment.