Moved async settings to debug menu.

Fixed classpath settings for aFreeRDP project.
This commit is contained in:
Armin Novak 2013-10-04 11:30:51 +02:00
parent d7ee71cc8b
commit a9c351a0ae
9 changed files with 121 additions and 25 deletions

View File

@ -3,7 +3,7 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View File

@ -41,10 +41,6 @@
<com.freerdp.freerdpcore.utils.IntListPreference android:key="bookmark.security" android:title="@string/settings_security" android:entries="@array/security_array" android:entryValues="@array/security_values_array" />
<EditTextPreference android:key="bookmark.remote_program" android:title="@string/settings_remote_program" android:summary="notepad.exe"/>
<EditTextPreference android:key="bookmark.work_dir" android:title="@string/settings_work_dir"/>
<CheckBoxPreference android:key="bookmark.async_channel" android:title="@string/settings_async_channel"/>
<CheckBoxPreference android:key="bookmark.async_transport" android:title="@string/settings_async_transport"/>
<CheckBoxPreference android:key="bookmark.async_update" android:title="@string/settings_async_update"/>
<CheckBoxPreference android:key="bookmark.async_input" android:title="@string/settings_async_input"/>
<CheckBoxPreference android:key="bookmark.console_mode" android:title="@string/settings_console_mode"/>
</PreferenceCategory>

View File

@ -32,4 +32,8 @@
freerdp:bounds_max="10"
freerdp:bounds_default="0" />
</PreferenceCategory>
<CheckBoxPreference android:key="bookmark.async_channel" android:title="@string/settings_async_channel"/>
<CheckBoxPreference android:key="bookmark.async_transport" android:title="@string/settings_async_transport"/>
<CheckBoxPreference android:key="bookmark.async_update" android:title="@string/settings_async_update"/>
<CheckBoxPreference android:key="bookmark.async_input" android:title="@string/settings_async_input"/>
</PreferenceScreen>

View File

@ -275,17 +275,29 @@ public class BookmarkBase implements Parcelable, Cloneable {
public static class DebugSettings implements Parcelable {
private int debug;
private boolean asyncChannel;
private boolean asyncTransport;
private boolean asyncInput;
private boolean asyncUpdate;
public DebugSettings() {
init();
}
// Session Settings
public DebugSettings(Parcel parcel) {
asyncChannel = (parcel.readInt() == 1) ? true : false;
asyncTransport = (parcel.readInt() == 1) ? true : false;
asyncInput = (parcel.readInt() == 1) ? true : false;
asyncUpdate = (parcel.readInt() == 1) ? true : false;
debug = parcel.readInt();
}
private void init() {
debug = 0;
asyncChannel = true;
asyncTransport = true;
asyncInput = true;
asyncUpdate = true;
}
public int getDebugLevel() {
@ -296,6 +308,46 @@ public class BookmarkBase implements Parcelable, Cloneable {
this.debug = debug;
}
public boolean getAsyncTransport()
{
return asyncTransport;
}
public void setAsyncTransport(boolean enabled)
{
asyncTransport = enabled;
}
public boolean getAsyncUpdate()
{
return asyncUpdate;
}
public void setAsyncUpdate(boolean enabled)
{
asyncUpdate = enabled;
}
public boolean getAsyncInput()
{
return asyncInput;
}
public void setAsyncInput(boolean enabled)
{
asyncInput = enabled;
}
public void setAsyncChannel(boolean enabled)
{
asyncChannel = enabled;
}
public boolean getAsyncChannel()
{
return asyncChannel;
}
public static final Parcelable.Creator<DebugSettings> CREATOR = new Parcelable.Creator<DebugSettings>() {
public DebugSettings createFromParcel(Parcel in) {
return new DebugSettings(in);
@ -314,6 +366,10 @@ public class BookmarkBase implements Parcelable, Cloneable {
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(asyncChannel ? 1 : 0);
out.writeInt(asyncTransport ? 1 : 0);
out.writeInt(asyncInput ? 1 : 0);
out.writeInt(asyncUpdate ? 1 : 0);
out.writeInt(debug);
}
}
@ -443,7 +499,8 @@ public class BookmarkBase implements Parcelable, Cloneable {
return workDir;
}
public static final Parcelable.Creator<AdvancedSettings> CREATOR = new Parcelable.Creator<AdvancedSettings>() {
public static final Parcelable.Creator<AdvancedSettings> CREATOR = new Parcelable.Creator<AdvancedSettings>()
{
public AdvancedSettings createFromParcel(Parcel in) {
return new AdvancedSettings(in);
}
@ -715,13 +772,13 @@ public class BookmarkBase implements Parcelable, Cloneable {
editor.putString("bookmark.remote_program",
advancedSettings.getRemoteProgram());
editor.putString("bookmark.work_dir", advancedSettings.getWorkDir());
editor.putBoolean("bookmark.async_channel", advancedSettings.getAsyncChannel());
editor.putBoolean("bookmark.async_transport", advancedSettings.getAsyncTransport());
editor.putBoolean("bookmark.async_input", advancedSettings.getAsyncInput());
editor.putBoolean("bookmark.async_update", advancedSettings.getAsyncUpdate());
editor.putBoolean("bookmark.console_mode",
advancedSettings.getConsoleMode());
editor.putBoolean("bookmark.async_channel", debugSettings.getAsyncChannel());
editor.putBoolean("bookmark.async_transport", debugSettings.getAsyncTransport());
editor.putBoolean("bookmark.async_input", debugSettings.getAsyncInput());
editor.putBoolean("bookmark.async_update", debugSettings.getAsyncUpdate());
editor.putInt("bookmark.debug_level",
debugSettings.getDebugLevel());
@ -791,11 +848,12 @@ public class BookmarkBase implements Parcelable, Cloneable {
advancedSettings.setSecurity(sharedPrefs.getInt("bookmark.security", 0));
advancedSettings.setRemoteProgram(sharedPrefs.getString("bookmark.remote_program", ""));
advancedSettings.setWorkDir(sharedPrefs.getString("bookmark.work_dir", ""));
advancedSettings.setAsyncChannel(sharedPrefs.getBoolean("bookmark.async_channel", true));
advancedSettings.setAsyncTransport(sharedPrefs.getBoolean("bookmark.async_transport", true));
advancedSettings.setAsyncInput(sharedPrefs.getBoolean("bookmark.async_input", true));
advancedSettings.setAsyncUpdate(sharedPrefs.getBoolean("bookmark.async_update", true));
advancedSettings.setConsoleMode(sharedPrefs.getBoolean("bookmark.console_mode", false));
debugSettings.setAsyncChannel(sharedPrefs.getBoolean("bookmark.async_channel", true));
debugSettings.setAsyncTransport(sharedPrefs.getBoolean("bookmark.async_transport", true));
debugSettings.setAsyncInput(sharedPrefs.getBoolean("bookmark.async_input", true));
debugSettings.setAsyncUpdate(sharedPrefs.getBoolean("bookmark.async_update", true));
debugSettings.setDebugLevel(sharedPrefs.getInt("bookmark.debug_level", 0));
}

View File

@ -504,6 +504,10 @@ public class BookmarkActivity extends PreferenceActivity implements
private void initDebugSettings(SharedPreferences sharedPreferences) {
debugSettingsChanged(sharedPreferences, "bookmark.debug_level");
debugSettingsChanged(sharedPreferences, "bookmark.async_channel");
debugSettingsChanged(sharedPreferences, "bookmark.async_transport");
debugSettingsChanged(sharedPreferences, "bookmark.async_update");
debugSettingsChanged(sharedPreferences, "bookmark.async_input");
}
private void initGatewaySettings(SharedPreferences sharedPreferences) {
@ -520,6 +524,22 @@ public class BookmarkActivity extends PreferenceActivity implements
int level = sharedPreferences.getInt(key, 0);
Preference pref = findPreference("bookmark.debug_level");
pref.setDefaultValue(level);
} else if (key.equals("bookmark.async_channel")) {
boolean enabled = sharedPreferences.getBoolean(key, false);
Preference pref = findPreference("bookmark.async_channel");
pref.setDefaultValue(enabled);
}else if (key.equals("bookmark.async_transport")) {
boolean enabled = sharedPreferences.getBoolean(key, false);
Preference pref = findPreference("bookmark.async_transport");
pref.setDefaultValue(enabled);
}else if (key.equals("bookmark.async_update")) {
boolean enabled = sharedPreferences.getBoolean(key, false);
Preference pref = findPreference("bookmark.async_update");
pref.setDefaultValue(enabled);
}else if (key.equals("bookmark.async_input")) {
boolean enabled = sharedPreferences.getBoolean(key, false);
Preference pref = findPreference("bookmark.async_input1");
pref.setDefaultValue(enabled);
}
}

View File

@ -70,7 +70,11 @@ public abstract class BookmarkBaseGateway
values.put("console_mode", bookmark.getAdvancedSettings().getConsoleMode());
values.put("remote_program", bookmark.getAdvancedSettings().getRemoteProgram());
values.put("work_dir", bookmark.getAdvancedSettings().getWorkDir());
values.put("async_channel", bookmark.getDebugSettings().getAsyncChannel());
values.put("async_transport", bookmark.getDebugSettings().getAsyncTransport());
values.put("async_input", bookmark.getDebugSettings().getAsyncInput());
values.put("async_update", bookmark.getDebugSettings().getAsyncUpdate());
values.put("debug_level", bookmark.getDebugSettings().getDebugLevel());
// add any special columns
@ -111,6 +115,10 @@ public abstract class BookmarkBaseGateway
values.put("remote_program", bookmark.getAdvancedSettings().getRemoteProgram());
values.put("work_dir", bookmark.getAdvancedSettings().getWorkDir());
values.put("async_channel", bookmark.getDebugSettings().getAsyncChannel());
values.put("async_transport", bookmark.getDebugSettings().getAsyncTransport());
values.put("async_input", bookmark.getDebugSettings().getAsyncInput());
values.put("async_update", bookmark.getDebugSettings().getAsyncUpdate());
values.put("debug_level", bookmark.getDebugSettings().getDebugLevel());
addBookmarkSpecificColumns(bookmark, values);
@ -236,6 +244,10 @@ public abstract class BookmarkBaseGateway
// debug settings
columns.add("debug_level");
columns.add("async_channel");
columns.add("async_transport");
columns.add("async_update");
columns.add("async_input");
addBookmarkSpecificColumns(columns);
}
@ -296,13 +308,14 @@ public abstract class BookmarkBaseGateway
bookmark.getAdvancedSettings().setConsoleMode(cursor.getInt(cursor.getColumnIndex("console_mode")) == 0 ? false : true);
bookmark.getAdvancedSettings().setRemoteProgram(cursor.getString(cursor.getColumnIndex("remote_program")));
bookmark.getAdvancedSettings().setWorkDir(cursor.getString(cursor.getColumnIndex("work_dir")));
bookmark.getAdvancedSettings().setAsyncChannel(
bookmark.getDebugSettings().setAsyncChannel(
cursor.getInt(cursor.getColumnIndex("async_channel")) == 1 ? true : false);
bookmark.getAdvancedSettings().setAsyncTransport(
bookmark.getDebugSettings().setAsyncTransport(
cursor.getInt(cursor.getColumnIndex("async_transport")) == 1 ? true : false);
bookmark.getAdvancedSettings().setAsyncInput(
bookmark.getDebugSettings().setAsyncInput(
cursor.getInt(cursor.getColumnIndex("async_input")) == 1 ? true : false);
bookmark.getAdvancedSettings().setAsyncUpdate(
bookmark.getDebugSettings().setAsyncUpdate(
cursor.getInt(cursor.getColumnIndex("async_update")) == 1 ? true : false);
bookmark.getDebugSettings().setDebugLevel(cursor.getInt(cursor.getColumnIndex("debug_level")));

View File

@ -110,7 +110,7 @@ public class BookmarkDB extends SQLiteOpenHelper
+ "async_transport, "
+ "async_input, "
+ "async_update, "
+ "console_mode) "
+ "console_mode, "
+ "debug_level ) "
+ "VALUES ( "
+ "'Test Server', "
@ -119,7 +119,9 @@ public class BookmarkDB extends SQLiteOpenHelper
+ "'', "
+ "'', "
+ "3389, "
+ "1, 1, 2, 2, 0, 0, 0, 0, '', '', 1, 1, 1, 1, 0, 0);";
+ "1, 1, 2, 2, 0, 0, 0, 0, "
+ "'', '', "
+ "1, 1, 1, 1, 0, 0);";
db.execSQL(sqlInsertDefaultSessionEntry);
}

View File

@ -153,10 +153,11 @@ public class LibFreeRDP
flags.getDesktopComposition());
BookmarkBase.AdvancedSettings advancedSettings = bookmark.getAdvancedSettings();
BookmarkBase.DebugSettings debugSettings = bookmark.getDebugSettings();
freerdp_set_advanced_settings(inst, advancedSettings.getRemoteProgram(),
advancedSettings.getWorkDir(), advancedSettings.getAsyncChannel(),
advancedSettings.getAsyncTransport(), advancedSettings.getAsyncInput(),
advancedSettings.getAsyncUpdate());
advancedSettings.getWorkDir(), debugSettings.getAsyncChannel(),
debugSettings.getAsyncTransport(), debugSettings.getAsyncInput(),
debugSettings.getAsyncUpdate());
// drive redirection enabled?
if (advancedSettings.getRedirectSDCard())

View File

@ -3,5 +3,7 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>