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