Try to make limelight more translatable

This commit is contained in:
Ansa89
2014-11-11 16:30:20 +01:00
parent 971263c52d
commit d317c5bf03
6 changed files with 270 additions and 187 deletions
+31 -31
View File
@@ -63,7 +63,7 @@ public class AppView extends Activity {
return; return;
} }
String labelText = "App List for "+getIntent().getStringExtra(NAME_EXTRA); String labelText = getResources().getString(R.string.title_applist)+" "+getIntent().getStringExtra(NAME_EXTRA);
TextView label = (TextView) findViewById(R.id.appListText); TextView label = (TextView) findViewById(R.id.appListText);
setTitle(labelText); setTitle(labelText);
label.setText(labelText); label.setText(labelText);
@@ -133,27 +133,27 @@ public class AppView extends Activity {
} }
@Override @Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo); super.onCreateContextMenu(menu, v, menuInfo);
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
AppObject selectedApp = appListAdapter.getItem(info.position); AppObject selectedApp = appListAdapter.getItem(info.position);
if (selectedApp == null || selectedApp.app == null) { if (selectedApp == null || selectedApp.app == null) {
return; return;
} }
int runningAppId = getRunningAppId(); int runningAppId = getRunningAppId();
if (runningAppId != -1) { if (runningAppId != -1) {
if (runningAppId == selectedApp.app.getAppId()) { if (runningAppId == selectedApp.app.getAppId()) {
menu.add(Menu.NONE, RESUME_ID, 1, "Resume Session"); menu.add(Menu.NONE, RESUME_ID, 1, getResources().getString(R.string.applist_menu_resume));
menu.add(Menu.NONE, QUIT_ID, 2, "Quit Session"); menu.add(Menu.NONE, QUIT_ID, 2, getResources().getString(R.string.applist_menu_quit));
} }
else { else {
menu.add(Menu.NONE, RESUME_ID, 1, "Quit Current Game and Start"); menu.add(Menu.NONE, RESUME_ID, 1, getResources().getString(R.string.applist_menu_quit_and_start));
menu.add(Menu.NONE, CANCEL_ID, 2, "Cancel"); menu.add(Menu.NONE, CANCEL_ID, 2, getResources().getString(R.string.applist_menu_cancel));
} }
} }
} }
@Override @Override
public void onContextMenuClosed(Menu menu) { public void onContextMenuClosed(Menu menu) {
@@ -186,17 +186,18 @@ public class AppView extends Activity {
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
str.append(app.getAppName()); str.append(app.getAppName());
if (app.getIsRunning()) { if (app.getIsRunning()) {
str.append(" - Running"); str.append(" - "+getResources().getString(R.string.applist_app_running));
} }
return str.toString(); return str.toString();
} }
private void addListPlaceholder() { private void addListPlaceholder() {
appListAdapter.add(new AppObject("No apps found. Try rescanning for games in GeForce Experience.", null)); appListAdapter.add(new AppObject(getResources().getString(R.string.applist_no_apps), null));
} }
private void updateAppList() { private void updateAppList() {
final SpinnerDialog spinner = SpinnerDialog.displayDialog(this, "App List", "Refreshing app list...", true); final SpinnerDialog spinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.applist_refresh_title),
getResources().getString(R.string.applist_refresh_msg), true);
new Thread() { new Thread() {
@Override @Override
public void run() { public void run() {
@@ -246,7 +247,7 @@ public class AppView extends Activity {
} }
private void doQuit(final NvApp app) { private void doQuit(final NvApp app) {
Toast.makeText(AppView.this, "Quitting "+app.getAppName()+"...", Toast.LENGTH_SHORT).show(); Toast.makeText(AppView.this, getResources().getString(R.string.applist_quit_app)+" "+app.getAppName()+"...", Toast.LENGTH_SHORT).show();
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -255,17 +256,16 @@ public class AppView extends Activity {
try { try {
httpConn = new NvHTTP(ipAddress, uniqueId, null, PlatformBinding.getCryptoProvider(AppView.this)); httpConn = new NvHTTP(ipAddress, uniqueId, null, PlatformBinding.getCryptoProvider(AppView.this));
if (httpConn.quitApp()) { if (httpConn.quitApp()) {
message = "Successfully quit "+app.getAppName(); message = getResources().getString(R.string.applist_quit_success)+" "+app.getAppName();
} }
else { else {
message = "Failed to quit "+app.getAppName(); message = getResources().getString(R.string.applist_quit_fail)+" "+app.getAppName();
} }
updateAppList(); updateAppList();
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
message = "Failed to resolve host"; message = getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " message = getResources().getString(R.string.error_404);
+ "Try rebooting your machine or reinstalling GFE.";
} catch (Exception e) { } catch (Exception e) {
message = e.getMessage(); message = e.getMessage();
} }
@@ -295,4 +295,4 @@ public class AppView extends Activity {
return text; return text;
} }
} }
} }
+17 -14
View File
@@ -113,12 +113,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
// Inflate the content // Inflate the content
setContentView(R.layout.activity_game); setContentView(R.layout.activity_game);
// Start the spinner // Start the spinner
spinner = SpinnerDialog.displayDialog(this, "Establishing Connection", "Starting connection", true); spinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.conn_establishing_title),
getResources().getString(R.string.conn_establishing_msg), true);
// Read the stream preferences // Read the stream preferences
prefConfig = PreferenceConfiguration.readPreferences(this); prefConfig = PreferenceConfiguration.readPreferences(this);
switch (prefConfig.decoder) { switch (prefConfig.decoder) {
case PreferenceConfiguration.FORCE_SOFTWARE_DECODER: case PreferenceConfiguration.FORCE_SOFTWARE_DECODER:
drFlags |= VideoDecoderRenderer.FLAG_FORCE_SOFTWARE_DECODING; drFlags |= VideoDecoderRenderer.FLAG_FORCE_SOFTWARE_DECODING;
@@ -143,11 +144,11 @@ public class Game extends Activity implements SurfaceHolder.Callback,
sv.setOnTouchListener(this); sv.setOnTouchListener(this);
// Warn the user if they're on a metered connection // Warn the user if they're on a metered connection
checkDataConnection(); checkDataConnection();
// Make sure Wi-Fi is fully powered up // Make sure Wi-Fi is fully powered up
WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Limelight"); wifiLock = wifiMgr.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Limelight");
wifiLock.setReferenceCounted(false); wifiLock.setReferenceCounted(false);
wifiLock.acquire(); wifiLock.acquire();
@@ -214,7 +215,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
{ {
ConnectivityManager mgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); ConnectivityManager mgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (mgr.isActiveNetworkMetered()) { if (mgr.isActiveNetworkMetered()) {
displayTransientMessage("Warning: Your active network connection is metered!"); displayTransientMessage(getResources().getString(R.string.conn_metered));
} }
} }
@@ -262,13 +263,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
int averageDecoderLat = decoderRenderer.getAverageDecoderLatency(); int averageDecoderLat = decoderRenderer.getAverageDecoderLatency();
String message = null; String message = null;
if (averageEndToEndLat > 0) { if (averageEndToEndLat > 0) {
message = "Average client-side frame latency: "+averageEndToEndLat+" ms"; message = getResources().getString(R.string.conn_client_latency)+" "+averageEndToEndLat+" ms";
if (averageDecoderLat > 0) { if (averageDecoderLat > 0) {
message += " (hardware decoder latency: "+averageDecoderLat+" ms)"; message += " ("+getResources().getString(R.string.conn_client_latency_hw)+" "+averageDecoderLat+" ms)";
} }
} }
else if (averageDecoderLat > 0) { else if (averageDecoderLat > 0) {
message = "Average hardware decoder latency: "+averageDecoderLat+" ms"; message = getResources().getString(R.string.conn_hardware_latency)+" "+averageDecoderLat+" ms";
} }
if (message != null) { if (message != null) {
@@ -634,7 +635,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
@Override @Override
public void stageStarting(Stage stage) { public void stageStarting(Stage stage) {
if (spinner != null) { if (spinner != null) {
spinner.setMessage("Starting "+stage.getName()); spinner.setMessage(getResources().getString(R.string.conn_starting)+" "+stage.getName());
} }
} }
@@ -665,7 +666,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
if (!displayedFailureDialog) { if (!displayedFailureDialog) {
displayedFailureDialog = true; displayedFailureDialog = true;
stopConnection(); stopConnection();
Dialog.displayDialog(this, "Connection Error", "Starting "+stage.getName()+" failed", true); Dialog.displayDialog(this, getResources().getString(R.string.conn_error_title),
getResources().getString(R.string.conn_error_msg)+" "+stage.getName(), true);
} }
} }
@@ -676,7 +678,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
e.printStackTrace(); e.printStackTrace();
stopConnection(); stopConnection();
Dialog.displayDialog(this, "Connection Terminated", "The connection failed unexpectedly", true); Dialog.displayDialog(this, getResources().getString(R.string.conn_fail_title),
getResources().getString(R.string.conn_fail_msg), true);
} }
} }
+123 -132
View File
@@ -237,35 +237,35 @@ public class PcView extends Activity {
} }
@Override @Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
stopComputerUpdates(false); stopComputerUpdates(false);
// Call superclass // Call superclass
super.onCreateContextMenu(menu, v, menuInfo); super.onCreateContextMenu(menu, v, menuInfo);
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
ComputerObject computer = pcListAdapter.getItem(info.position); ComputerObject computer = pcListAdapter.getItem(info.position);
if (computer == null || computer.details == null) { if (computer == null || computer.details == null) {
startComputerUpdates(); startComputerUpdates();
return; return;
} }
// Inflate the context menu // Inflate the context menu
if (computer.details.reachability == ComputerDetails.Reachability.OFFLINE) { if (computer.details.reachability == ComputerDetails.Reachability.OFFLINE) {
menu.add(Menu.NONE, WOL_ID, 1, "Send Wake-On-LAN request"); menu.add(Menu.NONE, WOL_ID, 1, getResources().getString(R.string.pcview_menu_send_wol));
menu.add(Menu.NONE, DELETE_ID, 2, "Delete PC"); menu.add(Menu.NONE, DELETE_ID, 2, getResources().getString(R.string.pcview_menu_delete_pc));
} }
else if (computer.details.pairState != PairState.PAIRED) { else if (computer.details.pairState != PairState.PAIRED) {
menu.add(Menu.NONE, PAIR_ID, 1, "Pair with PC"); menu.add(Menu.NONE, PAIR_ID, 1, getResources().getString(R.string.pcview_menu_pair_pc));
if (computer.details.reachability == ComputerDetails.Reachability.REMOTE) { if (computer.details.reachability == ComputerDetails.Reachability.REMOTE) {
menu.add(Menu.NONE, DELETE_ID, 2, "Delete PC"); menu.add(Menu.NONE, DELETE_ID, 2, getResources().getString(R.string.pcview_menu_delete_pc));
} }
} }
else { else {
menu.add(Menu.NONE, APP_LIST_ID, 1, "View Game List"); menu.add(Menu.NONE, APP_LIST_ID, 1, getResources().getString(R.string.pcview_menu_app_list));
menu.add(Menu.NONE, UNPAIR_ID, 2, "Unpair"); menu.add(Menu.NONE, UNPAIR_ID, 2, getResources().getString(R.string.pcview_menu_unpair_pc));
} }
} }
@Override @Override
public void onContextMenuClosed(Menu menu) { public void onContextMenuClosed(Menu menu) {
@@ -274,21 +274,19 @@ public class PcView extends Activity {
private void doPair(final ComputerDetails computer) { private void doPair(final ComputerDetails computer) {
if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) {
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_offline), Toast.LENGTH_SHORT).show();
return; return;
} }
if (computer.runningGameId != 0) { if (computer.runningGameId != 0) {
Toast.makeText(PcView.this, "Computer is currently in a game. " + Toast.makeText(PcView.this, getResources().getString(R.string.pair_pc_ingame), Toast.LENGTH_LONG).show();
"You must close the game before pairing.", Toast.LENGTH_LONG).show();
return; return;
} }
if (managerBinder == null) { if (managerBinder == null) {
Toast.makeText(PcView.this, "The ComputerManager service is not running. " + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
return; return;
} }
Toast.makeText(PcView.this, "Pairing...", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.pairing), Toast.LENGTH_SHORT).show();
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -311,23 +309,24 @@ public class PcView extends Activity {
PlatformBinding.getDeviceName(), PlatformBinding.getDeviceName(),
PlatformBinding.getCryptoProvider(PcView.this)); PlatformBinding.getCryptoProvider(PcView.this));
if (httpConn.getPairState() == PairingManager.PairState.PAIRED) { if (httpConn.getPairState() == PairingManager.PairState.PAIRED) {
message = "Already paired"; message = getResources().getString(R.string.pair_already_paired);
} }
else { else {
final String pinStr = PairingManager.generatePinString(); final String pinStr = PairingManager.generatePinString();
// Spin the dialog off in a thread because it blocks // Spin the dialog off in a thread because it blocks
Dialog.displayDialog(PcView.this, "Pairing", "Please enter the following PIN on the target PC: "+pinStr, false); Dialog.displayDialog(PcView.this, getResources().getString(R.string.pair_pairing_title),
getResources().getString(R.string.pair_pairing_msg)+" "+pinStr, false);
PairingManager.PairState pairState = httpConn.pair(pinStr); PairingManager.PairState pairState = httpConn.pair(pinStr);
if (pairState == PairingManager.PairState.PIN_WRONG) { if (pairState == PairingManager.PairState.PIN_WRONG) {
message = "Incorrect PIN"; message = getResources().getString(R.string.pair_incorrect_pin);
} }
else if (pairState == PairingManager.PairState.FAILED) { else if (pairState == PairingManager.PairState.FAILED) {
message = "Pairing failed"; message = getResources().getString(R.string.pair_fail);
} }
else if (pairState == PairingManager.PairState.PAIRED) { else if (pairState == PairingManager.PairState.PAIRED) {
message = "Paired successfully"; message = getResources().getString(R.string.pair_success);
} }
else { else {
// Should be no other values // Should be no other values
@@ -335,10 +334,9 @@ public class PcView extends Activity {
} }
} }
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
message = "Failed to resolve host"; message = getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " message = getResources().getString(R.string.error_404);
+ "Try rebooting your machine or reinstalling GFE.";
} catch (Exception e) { } catch (Exception e) {
message = e.getMessage(); message = e.getMessage();
} }
@@ -361,26 +359,25 @@ public class PcView extends Activity {
private void doWakeOnLan(final ComputerDetails computer) { private void doWakeOnLan(final ComputerDetails computer) {
if (computer.reachability != ComputerDetails.Reachability.OFFLINE) { if (computer.reachability != ComputerDetails.Reachability.OFFLINE) {
Toast.makeText(PcView.this, "Computer is online", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.wol_pc_online), Toast.LENGTH_SHORT).show();
return; return;
} }
if (computer.macAddress == null) { if (computer.macAddress == null) {
Toast.makeText(PcView.this, "Unable to wake PC because GFE didn't send a MAC address", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.wol_no_mac), Toast.LENGTH_SHORT).show();
return; return;
} }
Toast.makeText(PcView.this, "Waking PC...", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.wol_waking_pc), Toast.LENGTH_SHORT).show();
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
String message; String message;
try { try {
WakeOnLanSender.sendWolPacket(computer); WakeOnLanSender.sendWolPacket(computer);
message = "It may take a few seconds for your PC to wake up. " + message = getResources().getString(R.string.wol_waking_msg);
"If it doesn't, make sure it's configured properly for Wake-On-LAN.";
} catch (IOException e) { } catch (IOException e) {
message = "Failed to send Wake-On-LAN packets"; message = getResources().getString(R.string.wol_fail);
} }
final String toastMessage = message; final String toastMessage = message;
@@ -396,16 +393,15 @@ public class PcView extends Activity {
private void doUnpair(final ComputerDetails computer) { private void doUnpair(final ComputerDetails computer) {
if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) {
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show();
return; return;
} }
if (managerBinder == null) { if (managerBinder == null) {
Toast.makeText(PcView.this, "The ComputerManager service is not running. " + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
return; return;
} }
Toast.makeText(PcView.this, "Unpairing...", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.unpairing), Toast.LENGTH_SHORT).show();
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -427,20 +423,19 @@ public class PcView extends Activity {
if (httpConn.getPairState() == PairingManager.PairState.PAIRED) { if (httpConn.getPairState() == PairingManager.PairState.PAIRED) {
httpConn.unpair(); httpConn.unpair();
if (httpConn.getPairState() == PairingManager.PairState.NOT_PAIRED) { if (httpConn.getPairState() == PairingManager.PairState.NOT_PAIRED) {
message = "Unpaired successfully"; message = getResources().getString(R.string.unpair_success);
} }
else { else {
message = "Failed to unpair"; message = getResources().getString(R.string.unpair_fail);
} }
} }
else { else {
message = "Device was not paired"; message = getResources().getString(R.string.unpair_error);
} }
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
message = "Failed to resolve host"; message = getResources().getString(R.string.error_unknown_host);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
message = "GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU. Using remote desktop software can also cause this error. " message = getResources().getString(R.string.error_404);
+ "Try rebooting your machine or reinstalling GFE.";
} catch (Exception e) { } catch (Exception e) {
message = e.getMessage(); message = e.getMessage();
} }
@@ -458,12 +453,11 @@ public class PcView extends Activity {
private void doAppList(ComputerDetails computer) { private void doAppList(ComputerDetails computer) {
if (computer.reachability == ComputerDetails.Reachability.OFFLINE) { if (computer.reachability == ComputerDetails.Reachability.OFFLINE) {
Toast.makeText(PcView.this, "Computer is offline", Toast.LENGTH_SHORT).show(); Toast.makeText(PcView.this, getResources().getString(R.string.error_pc_offline), Toast.LENGTH_SHORT).show();
return; return;
} }
if (managerBinder == null) { if (managerBinder == null) {
Toast.makeText(PcView.this, "The ComputerManager service is not running. " + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show();
return; return;
} }
@@ -482,79 +476,76 @@ public class PcView extends Activity {
startActivity(i); startActivity(i);
} }
@Override @Override
public boolean onContextItemSelected(MenuItem item) { public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
ComputerObject computer = pcListAdapter.getItem(info.position); ComputerObject computer = pcListAdapter.getItem(info.position);
switch (item.getItemId()) switch (item.getItemId())
{ {
case PAIR_ID: case PAIR_ID:
doPair(computer.details); doPair(computer.details);
return true; return true;
case UNPAIR_ID: case UNPAIR_ID:
doUnpair(computer.details); doUnpair(computer.details);
return true; return true;
case WOL_ID: case WOL_ID:
doWakeOnLan(computer.details); doWakeOnLan(computer.details);
return true; return true;
case DELETE_ID: case DELETE_ID:
if (managerBinder == null) { if (managerBinder == null) {
Toast.makeText(PcView.this, "The ComputerManager service is not running. " + Toast.makeText(PcView.this, getResources().getString(R.string.error_manager_not_running), Toast.LENGTH_LONG).show();
"Please wait a few seconds or restart the app.", Toast.LENGTH_LONG).show(); return true;
return true; }
} managerBinder.removeComputer(computer.details.name);
managerBinder.removeComputer(computer.details.name); removeListView(computer.details);
removeListView(computer.details); return true;
return true;
case APP_LIST_ID:
case APP_LIST_ID: doAppList(computer.details);
doAppList(computer.details); return true;
return true;
default:
default: return super.onContextItemSelected(item);
return super.onContextItemSelected(item); }
} }
}
private static String generateString(ComputerDetails details) { private static String generateString(ComputerDetails details) {
StringBuilder str = new StringBuilder(); StringBuilder str = new StringBuilder();
str.append(details.name).append(" - "); str.append(details.name).append(" - ");
if (details.state == ComputerDetails.State.ONLINE) { if (details.state == ComputerDetails.State.ONLINE) {
str.append("Online "); str.append(getResources().getString(R.string.status_online)+" ");
if (details.reachability == ComputerDetails.Reachability.LOCAL) { if (details.reachability == ComputerDetails.Reachability.LOCAL) {
str.append("(Local) - "); str.append("("+getResources().getString(R.string.status_local)+") - ");
} }
else { else {
str.append("(Remote) - "); str.append("("+getResources().getString(R.string.status_remote)+") - ");
} }
if (details.pairState == PairState.PAIRED) { if (details.pairState == PairState.PAIRED) {
if (details.runningGameId == 0) { if (details.runningGameId == 0) {
str.append("Available"); str.append(getResources().getString(R.string.status_available));
} }
else { else {
str.append("In Game"); str.append(getResources().getString(R.string.status_ingame));
} }
} }
else { else {
str.append("Not Paired"); str.append(getResources().getString(R.string.status_not_paired));
} }
} }
else { else {
str.append("Offline"); str.append(getResources().getString(R.string.status_offline));
} }
return str.toString(); return str.toString();
} }
private void addListPlaceholder() { private void addListPlaceholder() {
pcListAdapter.add(new ComputerObject("Discovery is running. No computers found yet. " + pcListAdapter.add(new ComputerObject(getResources().getString(R.string.discovery_running), null));
"If your PC doesn't show up in about 15 seconds, " + }
"make sure your computer is running GFE or add your PC manually using the button above.", null));
} private void removeListView(ComputerDetails details) {
private void removeListView(ComputerDetails details) {
for (int i = 0; i < pcListAdapter.getCount(); i++) { for (int i = 0; i < pcListAdapter.getCount(); i++) {
ComputerObject computer = pcListAdapter.getItem(i); ComputerObject computer = pcListAdapter.getItem(i);
@@ -568,8 +559,8 @@ public class PcView extends Activity {
// Add the placeholder if we're down to 0 computers // Add the placeholder if we're down to 0 computers
addListPlaceholder(); addListPlaceholder();
} }
} }
private void updateListView(ComputerDetails details) { private void updateListView(ComputerDetails details) {
String computerString = generateString(details); String computerString = generateString(details);
ComputerObject existingEntry = null; ComputerObject existingEntry = null;
@@ -47,14 +47,14 @@ public class AddComputerManually extends Activity {
InetAddress addr = InetAddress.getByName(host); InetAddress addr = InetAddress.getByName(host);
if (!managerBinder.addComputerBlocking(addr)){ if (!managerBinder.addComputerBlocking(addr)){
msg = "Unable to connect to the specified computer. Make sure the required ports are allowed through the firewall."; msg = getResources().getString(R.string.addpc_fail);
} }
else { else {
msg = "Successfully added computer"; msg = getResources().getString(R.string.addpc_success);
finish = true; finish = true;
} }
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
msg = "Unable to resolve PC address. Make sure you didn't make a typo in the address."; msg = getResources().getString(R.string.addpc_unknown_host);
} }
final boolean toastFinish = finish; final boolean toastFinish = finish;
@@ -141,11 +141,11 @@ public class AddComputerManually extends Activity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (hostText.getText().length() == 0) { if (hostText.getText().length() == 0) {
Toast.makeText(AddComputerManually.this, "You must enter an IP address", Toast.LENGTH_LONG).show(); Toast.makeText(AddComputerManually.this, getResources().getString(R.string.addpc_enter_ip), Toast.LENGTH_LONG).show();
return; return;
} }
Toast.makeText(AddComputerManually.this, "Adding PC...", Toast.LENGTH_SHORT).show(); Toast.makeText(AddComputerManually.this, getResources().getString(R.string.addpc_adding_pc), Toast.LENGTH_SHORT).show();
computersToAdd.add(hostText.getText().toString()); computersToAdd.add(hostText.getText().toString());
} }
}); });
+5 -5
View File
@@ -6,7 +6,7 @@
<item>1080p 30 FPS</item> <item>1080p 30 FPS</item>
<item>1080p 60 FPS</item> <item>1080p 60 FPS</item>
</string-array> </string-array>
<string-array name="resolution_values"> <string-array name="resolution_values" translatable="false">
<item>720p30</item> <item>720p30</item>
<item>720p60</item> <item>720p60</item>
<item>1080p30</item> <item>1080p30</item>
@@ -14,13 +14,13 @@
</string-array> </string-array>
<string-array name="decoder_names"> <string-array name="decoder_names">
<item>Force Software Decoding</item>
<item>Auto-select Decoder</item> <item>Auto-select Decoder</item>
<item>Force Software Decoding</item>
<item>Force Hardware Decoding</item> <item>Force Hardware Decoding</item>
</string-array> </string-array>
<string-array name="decoder_values"> <string-array name="decoder_values" translatable="false">
<item>software</item>
<item>auto</item> <item>auto</item>
<item>software</item>
<item>hardware</item> <item>hardware</item>
</string-array> </string-array>
</resources> </resources>
+89
View File
@@ -1,13 +1,102 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Context menu entries -->
<string name="pcview_menu_app_list">View Game List</string>
<string name="pcview_menu_pair_pc">Pair with PC</string>
<string name="pcview_menu_unpair_pc">Unpair</string>
<string name="pcview_menu_send_wol">Send Wake-On-LAN request</string>
<string name="pcview_menu_delete_pc">Delete PC</string>
<!-- Pair messages -->
<string name="pairing">Pairing...</string>
<string name="pair_pc_offline">Computer is offline</string>
<string name="pair_pc_ingame">Computer is currently in a game. You must close the game before pairing.</string>
<string name="pair_already_paired">Already paired</string>
<string name="pair_pairing_title">Pairing</string>
<string name="pair_pairing_msg">Please enter the following PIN on the target PC:</string>
<string name="pair_incorrect_pin">Incorrect PIN</string>
<string name="pair_fail">Pairing failed</string>
<string name="pair_success">Paired successfully</string>
<!-- WOL messages -->
<string name="wol_pc_online">Computer is online</string>
<string name="wol_no_mac">Unable to wake PC because GFE didn\'t send a MAC address</string>
<string name="wol_waking_pc">Waking PC...</string>
<string name="wol_waking_msg">It may take a few seconds for your PC to wake up.
If it doesn\'t, make sure it'\s configured properly for Wake-On-LAN.
</string>
<string name="wol_fail">Failed to send Wake-On-LAN packets</string>
<!-- Unpair messages -->
<string name="unpairing">Unpairing...</string>
<string name="unpair_success">Unpaired successfully</string>
<string name="unpair_fail">Failed to unpair</string>
<string name="unpair_error">Device was not paired</string>
<!-- Errors -->
<string name="error_pc_offline">Computer is offline</string>
<string name="error_manager_not_running">The ComputerManager service is not running. Please wait a few seconds or restart the app.</string>
<string name="error_unknown_host">Failed to resolve host</string>
<string name="error_404">GFE returned an HTTP 404 error. Make sure your PC is running a supported GPU.
Using remote desktop software can also cause this error. Try rebooting your machine or reinstalling GFE.
</string>
<!-- Status info -->
<string name="status_online">Online</string>
<string name="status_offline">Offline</string>
<string name="status_local">Local</string>
<string name="status_remote">Remote</string>
<string name="status_available">Available</string>
<string name="status_ingame">In Game</string>
<string name="status_not_paired">Not Paired</string>
<!-- Start application messages -->
<string name="conn_establishing_title">Establishing Connection</string>
<string name="conn_establishing_msg">Starting connection</string>
<string name="conn_metered">Warning: Your active network connection is metered!</string>
<string name="conn_client_latency">Average client-side frame latency:</string>
<string name="conn_client_latency_hw">hardware decoder latency:</string>
<string name="conn_hardware_latency">Average hardware decoder latency:</string>
<string name="conn_starting">Starting</string>
<string name="conn_error_title">Connection Error</string>
<string name="conn_error_msg">Fail starting</string>
<string name="conn_fail_title">Connection Terminated</string>
<string name="conn_fail_msg">The connection failed unexpectedly</string>
<!-- Add computer manually messages -->
<string name="addpc_fail">Unable to connect to the specified computer. Make sure the required ports are allowed through the firewall.</string>
<string name="addpc_success">Successfully added computer</string>
<string name="addpc_unknown_host">Unable to resolve PC address. Make sure you didn\'t make a typo in the address.</string>
<string name="addpc_enter_ip">You must enter an IP address</string>
<string name="addpc_adding_pc">Adding PC...</string>
<!-- General strings --> <!-- General strings -->
<string name="discovery_running">Discovery is running. No computers found yet. If your PC doesn't show up in about 15 seconds,
make sure your computer is running GFE or add your PC manually using the button above.
</string>
<string name="ip_hint">IP address of GeForce PC</string> <string name="ip_hint">IP address of GeForce PC</string>
<!-- PC view activity --> <!-- PC view activity -->
<string name="title_pc_view">PC List</string> <string name="title_pc_view">PC List</string>
<string name="button_stream_settings">Streaming Settings</string> <string name="button_stream_settings">Streaming Settings</string>
<string name="button_add_pc_manually">Add PC Manually</string> <string name="button_add_pc_manually">Add PC Manually</string>
<!-- AppList activity -->
<string name="title_applist">App List for</string>
<string name="applist_menu_resume">Resume Session</string>
<string name="applist_menu_quit">Quit Session</string>
<string name="applist_menu_quit_and_start">Quit Current Game and Start</string>
<string name="applist_menu_cancel">Cancel</string>
<string name="applist_app_running">Running</string>
<string name="applist_no_apps">No apps found. Try rescanningfor games in GeForce Experience.</string>
<string name="applist_refersh_title">App List</string>
<string name="applist_refresh_msg">Refreshing app list...</string>
<string name="applist_refersh_error_title">Error</string>
<string name="applist_refersh_error_msg">Failed to get app list</string>
<string name="applist_quit_app">Quitting</string>
<string name="applist_quit_success">Successfully quit</string>
<string name="applist_quit_fail">Failed to quit</string>
<!-- Add computer manually activity --> <!-- Add computer manually activity -->
<string name="button_add_pc">Manually Add PC</string> <string name="button_add_pc">Manually Add PC</string>