Add reboot option to power menu

This commit is contained in:
Synced Synapse 2015-03-29 12:48:51 +01:00
parent a8f9c3e660
commit c6dfce29a4
6 changed files with 34 additions and 0 deletions

View File

@ -72,4 +72,28 @@ public class System {
}
}
/**
* Reboots the system running XBMC
*/
public static final class Reboot extends ApiMethod<String> {
public final static String METHOD_NAME = "System.Reboot";
/**
* Reboots the system running XBMC
*/
public Reboot() {
super();
}
@Override
public String getMethodName() {
return METHOD_NAME;
}
@Override
public String resultFromJson(ObjectNode jsonObject) throws ApiException {
return jsonObject.get(RESULT_NODE).textValue();
}
}
}

View File

@ -201,6 +201,11 @@ public class RemoteActivity extends BaseActivity
// Fire and forget
actionSuspend.execute(hostManager.getConnection(), null, null);
return true;
case R.id.action_reboot:
System.Reboot actionReboot = new System.Reboot();
// Fire and forget
actionReboot.execute(hostManager.getConnection(), null, null);
return true;
case R.id.action_shutdown:
System.Shutdown actionShutdown = new System.Shutdown();
// Fire and forget

View File

@ -28,6 +28,8 @@
android:title="@string/quit" />
<item android:id="@+id/action_suspend"
android:title="@string/suspend" />
<item android:id="@+id/action_reboot"
android:title="@string/reboot" />
<item android:id="@+id/action_shutdown"
android:title="@string/shutdown" />
</menu>

View File

@ -36,6 +36,7 @@
<string name="power">Energia</string>
<string name="quit">Sair</string>
<string name="suspend">Suspender</string>
<string name="reboot">Reiniciar</string>
<string name="shutdown">Desligar</string>
<string name="send">Enviar</string>
<string name="send_text">Enviar texto para media center</string>

View File

@ -36,6 +36,7 @@
<string name="power">Energia</string>
<string name="quit">Encerrar</string>
<string name="suspend">Suspender</string>
<string name="reboot">Reiniciar</string>
<string name="shutdown">Desligar</string>
<string name="send">Enviar</string>
<string name="send_text">Enviar texto</string>

View File

@ -46,6 +46,7 @@
<string name="power">Power</string>
<string name="quit">Quit</string>
<string name="suspend">Suspend</string>
<string name="reboot">Reboot</string>
<string name="shutdown">Shutdown</string>
<string name="send">Send</string>