Remove promptRestoreFromRemoteQueue
This commit is contained in:
parent
7f5c726583
commit
e5c9a7b566
|
@ -746,68 +746,8 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done(Void arg) {
|
||||
if(!context.isDestroyedCompat() && playerQueue != null) {
|
||||
promptRestoreFromRemoteQueue(playerQueue);
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
private void promptRestoreFromRemoteQueue(final PlayerQueue remoteState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
String message = getResources().getString(R.string.common_confirm_message, Util.formatDate(remoteState.changed));
|
||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setTitle(R.string.common_confirm)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(R.string.common_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
new SilentBackgroundTask<Void>(SubsonicFragmentActivity.this) {
|
||||
@Override
|
||||
protected Void doInBackground() throws Throwable {
|
||||
DownloadService downloadService = getDownloadService();
|
||||
downloadService.clear();
|
||||
downloadService.download(remoteState.songs, false, false, false, false, remoteState.currentPlayingIndex, remoteState.currentPlayingPosition);
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
})
|
||||
.setNeutralButton(R.string.common_cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
new SilentBackgroundTask<Void>(SubsonicFragmentActivity.this) {
|
||||
@Override
|
||||
protected Void doInBackground() throws Throwable {
|
||||
DownloadService downloadService = getDownloadService();
|
||||
downloadService.serializeQueue(false);
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.common_never, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
new SilentBackgroundTask<Void>(SubsonicFragmentActivity.this) {
|
||||
@Override
|
||||
protected Void doInBackground() throws Throwable {
|
||||
DownloadService downloadService = getDownloadService();
|
||||
downloadService.serializeQueue(false);
|
||||
|
||||
SharedPreferences.Editor editor = Util.getPreferences(SubsonicFragmentActivity.this).edit();
|
||||
editor.putBoolean(Constants.PREFERENCES_KEY_RESUME_PLAY_QUEUE_NEVER, true);
|
||||
editor.commit();
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
});
|
||||
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
private void createAccount() {
|
||||
final Context context = this;
|
||||
|
|
Loading…
Reference in New Issue