[Libreoffice-commits] .: 2 commits - android/sdremote
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 29 03:24:44 PST 2012
android/sdremote/res/menu/actionbar_selector.xml | 18 ++++++++++
android/sdremote/res/values/strings.xml | 2 +
android/sdremote/res/xml/preferences.xml | 6 +++
android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java | 10 +++++
android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java | 6 ++-
5 files changed, 41 insertions(+), 1 deletion(-)
New commits:
commit 0c4a7499619d54038aae39c869ee2de5836b03d2
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Thu Nov 29 12:23:03 2012 +0100
sdremote: disable wifi by default in the client
It can be still enabled, but it makes little sense to have it on by
default when the server is off by default.
Change-Id: I625f90fd67781244cc4fffa90127fd1c8707c580
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index 150a38d..9beaab7 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -18,6 +18,8 @@
<string name="options_description">Automatically decline all incoming calls.</string>
<string name="options_volumeswitching">Volume Switching</string>
<string name="options_volumeswitching_descripton">Change slides using volume buttons</string>
+ <string name="options_enablewifi">Enable wireless</string>
+ <string name="options_enablewifi_descripton">Try to connect to the computer over wireless</string>
<string name="options_switchcomputer">Switch computer</string>
<string name="blankscreen_return">Return to Slide</string>
<string name="bluetooth">Bluetooth</string>
diff --git a/android/sdremote/res/xml/preferences.xml b/android/sdremote/res/xml/preferences.xml
index 0a10063..ad7b1b3 100644
--- a/android/sdremote/res/xml/preferences.xml
+++ b/android/sdremote/res/xml/preferences.xml
@@ -8,6 +8,12 @@
android:summary="@string/options_volumeswitching_descripton"
android:title="@string/options_volumeswitching" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="option_enablewifi"
+ android:summary="@string/options_enablewifi_descripton"
+ android:title="@string/options_enablewifi" />
+
<Preference
android:key="option_switchcomputer"
android:title="@string/options_switchcomputer" />
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index b35e1e9..cc56398 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -23,6 +23,7 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Binder;
import android.os.IBinder;
+import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
public class CommunicationService extends Service implements Runnable {
@@ -125,7 +126,10 @@ public class CommunicationService extends Service implements Runnable {
private boolean mBluetoothPreviouslyEnabled;
public void startSearching() {
- mNetworkFinder.startFinding();
+ SharedPreferences aPref = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean bEnableWifi = aPref.getBoolean("option_enablewifi", false);
+ if (bEnableWifi)
+ mNetworkFinder.startFinding();
BluetoothAdapter aAdapter = BluetoothAdapter.getDefaultAdapter();
if (aAdapter != null) {
mBluetoothPreviouslyEnabled = aAdapter.isEnabled();
commit 5386ce98300bbd1a8d2bda1342f6963ebb4e1a06
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Thu Nov 29 12:11:48 2012 +0100
sdremote: allow accessing options menu from the selector activity as well
The options menu had 3 items, only one required a connection, so show
the rest when selecting servers.
Change-Id: I70797be5fc8f0550380286e0cff2abbf4664591b
diff --git a/android/sdremote/res/menu/actionbar_selector.xml b/android/sdremote/res/menu/actionbar_selector.xml
new file mode 100644
index 0000000..f70139e
--- /dev/null
+++ b/android/sdremote/res/menu/actionbar_selector.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <item
+ android:id="@+id/actionbar_presentation_submenu"
+ android:showAsAction="always"
+ android:icon="@drawable/actionbar_icon_overflow">
+ <menu>
+ <item
+ android:id="@+id/actionbar_presentation_submenu_options"
+ android:title="@string/options"/>
+ <item
+ android:id="@+id/actionbar_presentation_submenu_about"
+ android:title="@string/about"/>
+ </menu>
+ </item>
+
+</menu>
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
index b5e75d4..e9d0686 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
@@ -91,6 +91,7 @@ public class SelectorActivity extends SherlockActivity {
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.selector_activity, menu);
+ inflater.inflate(R.menu.actionbar_selector, menu);
return true;
}
@@ -135,6 +136,15 @@ public class SelectorActivity extends SherlockActivity {
alertDialog.show();
return true;
+ case R.id.actionbar_presentation_submenu_options:
+ Intent aIntent = new Intent(this, SettingsActivity.class);
+ startActivity(aIntent);
+ return true;
+ case R.id.actionbar_presentation_submenu_about:
+ AboutDialogBuilder aBuilder = new AboutDialogBuilder(this);
+ AlertDialog aDialog = aBuilder.create();
+ aDialog.show();
+ return true;
}
return super.onOptionsItemSelected(item);
}
More information about the Libreoffice-commits
mailing list