|
|
@ -294,34 +294,35 @@ public class MainSettingsActivity extends PreferenceCompatActivity { |
|
|
|
protected void onServerBarcodeScanHandled(String[] qrResult) { |
|
|
|
protected void onServerBarcodeScanHandled(String[] qrResult) { |
|
|
|
final String server = qrResult[0]; |
|
|
|
final String server = qrResult[0]; |
|
|
|
final String token = qrResult[2]; |
|
|
|
final String token = qrResult[2]; |
|
|
|
switch (qrResult[1]) { |
|
|
|
|
|
|
|
case "P": |
|
|
|
new XirvikSharedSettingsActivity.RetrieveXirvikAutoConfTask(server, "", "", token) { |
|
|
|
XirvikDediSettings xirvikDediSettings = new XirvikDediSettings(); |
|
|
|
@Override |
|
|
|
xirvikDediSettings.saveServerSetting(this, server, token); |
|
|
|
protected void onPostExecute(String result) { |
|
|
|
onResume(); |
|
|
|
if (result == null) { |
|
|
|
break; |
|
|
|
log.d(MainSettingsActivity.this, "Could not retrieve the Xirvik shared seedbox RPC mount point setting"); |
|
|
|
case "N": |
|
|
|
} |
|
|
|
XirvikSemiSettings xirvikSemiSettings = new XirvikSemiSettings(); |
|
|
|
switch (qrResult[1]) { |
|
|
|
xirvikSemiSettings.saveServerSetting(this, server, token); |
|
|
|
case "P": |
|
|
|
onResume(); |
|
|
|
XirvikDediSettings xirvikDediSettings = new XirvikDediSettings(); |
|
|
|
break; |
|
|
|
xirvikDediSettings.saveServerSetting(getApplicationContext(), server, token); |
|
|
|
case "RG": |
|
|
|
onResume(); |
|
|
|
new XirvikSharedSettingsActivity.RetrieveXirvikAutoConfTask(server, "", "", token) { |
|
|
|
break; |
|
|
|
@Override |
|
|
|
case "N": |
|
|
|
protected void onPostExecute(String result) { |
|
|
|
XirvikSemiSettings xirvikSemiSettings = new XirvikSemiSettings(); |
|
|
|
if (result == null) { |
|
|
|
xirvikSemiSettings.saveServerSetting(getApplicationContext(), server, token); |
|
|
|
log.d(MainSettingsActivity.this, "Could not retrieve the Xirvik shared seedbox RPC mount point setting"); |
|
|
|
onResume(); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case "RG": |
|
|
|
XirvikSharedSettings xirvikSharedSettings = new XirvikSharedSettings(); |
|
|
|
XirvikSharedSettings xirvikSharedSettings = new XirvikSharedSettings(); |
|
|
|
xirvikSharedSettings.saveServerSetting(getApplicationContext(), server, token, result); |
|
|
|
xirvikSharedSettings.saveServerSetting(getApplicationContext(), server, token, result); |
|
|
|
onResume(); |
|
|
|
onResume(); |
|
|
|
} |
|
|
|
break; |
|
|
|
}.execute(); |
|
|
|
default: |
|
|
|
break; |
|
|
|
SnackbarManager.show(Snackbar.with(MainSettingsActivity.this).text(R.string.pref_seedbox_xirvikscanerror).colorResource(R.color.red).type(SnackbarType.MULTI_LINE)); |
|
|
|
default: |
|
|
|
break; |
|
|
|
SnackbarManager.show(Snackbar.with(this).text(R.string.pref_seedbox_xirvikscanerror).colorResource(R.color.red).type(SnackbarType.MULTI_LINE)); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}.execute(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|