Fixed android settings.
authorArmin Novak <armin.novak@thincast.com>
Thu, 4 Aug 2016 12:37:19 +0000 (14:37 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 6 Oct 2016 11:43:07 +0000 (13:43 +0200)
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java
client/Android/Studio/freeRDPCore/src/main/res/values/strings.xml
client/Android/Studio/freeRDPCore/src/main/res/xml/debug_settings.xml

index 60add65..e73b1e4 100644 (file)
@@ -299,7 +299,7 @@ public class BookmarkBase implements Parcelable, Cloneable {
        
        public static class DebugSettings implements Parcelable {
                
-               private int debug;
+               private String debug;
                private boolean asyncChannel;
                private boolean asyncTransport;
                private boolean asyncInput;
@@ -314,22 +314,22 @@ public class BookmarkBase implements Parcelable, Cloneable {
                        asyncTransport = parcel.readInt() == 1;
                        asyncInput = parcel.readInt() == 1;
                        asyncUpdate = parcel.readInt() == 1;
-                       debug = parcel.readInt();
+                       debug = parcel.readString();
                }
 
                private void init() {
-                       debug = 0;
+                       debug = "INFO";
                        asyncChannel = true;
                        asyncTransport = true;
                        asyncInput = true;
                        asyncUpdate = true;
                }
 
-               public int getDebugLevel() {
+               public String getDebugLevel() {
                        return debug;
                }
 
-               public void setDebugLevel(int debug) {
+               public void setDebugLevel(String debug) {
                        this.debug = debug;                     
                }
 
@@ -395,7 +395,7 @@ public class BookmarkBase implements Parcelable, Cloneable {
                        out.writeInt(asyncTransport ? 1 : 0);
                        out.writeInt(asyncInput ? 1 : 0);
                        out.writeInt(asyncUpdate ? 1 : 0);
-                       out.writeInt(debug);
+                       out.writeString(debug);
                }
        }
 
@@ -812,7 +812,7 @@ public class BookmarkBase implements Parcelable, Cloneable {
                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",
+               editor.putString("bookmark.debug_level",
                                debugSettings.getDebugLevel());
                
                editor.commit();
@@ -895,7 +895,7 @@ public class BookmarkBase implements Parcelable, Cloneable {
                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));
+               debugSettings.setDebugLevel(sharedPrefs.getString("bookmark.debug_level", "INFO"));
        }
 
        // Cloneable
index d6277d6..5c82f5c 100644 (file)
@@ -510,7 +510,7 @@ public class BookmarkActivity extends PreferenceActivity implements
        private void debugSettingsChanged(SharedPreferences sharedPreferences,
                        String key) {
                if (key.equals("bookmark.debug_level")) {
-                       int level = sharedPreferences.getInt(key, 0);
+                       String level = sharedPreferences.getString(key, "INFO");
                        Preference pref = findPreference("bookmark.debug_level");
                        pref.setDefaultValue(level);
                } else if (key.equals("bookmark.async_channel")) {
index 287f8f5..41ac4ca 100644 (file)
@@ -321,7 +321,8 @@ public abstract class BookmarkBaseGateway
                                cursor.getInt(cursor.getColumnIndex("async_input")) == 1 ? true : false);               
                bookmark.getDebugSettings().setAsyncUpdate(
                                cursor.getInt(cursor.getColumnIndex("async_update")) == 1 ? true : false);              
-               bookmark.getDebugSettings().setDebugLevel(cursor.getInt(cursor.getColumnIndex("debug_level"))); 
+               bookmark.getDebugSettings().setDebugLevel(cursor.getString(cursor.getColumnIndex
+                               ("debug_level")));
        
                readBookmarkSpecificColumns(bookmark, cursor);
 
index 1ceb4ce..d523726 100644 (file)
@@ -21,7 +21,7 @@ import android.database.sqlite.SQLiteDatabase;
 import android.database.sqlite.SQLiteOpenHelper;
 
 public class BookmarkDB extends SQLiteOpenHelper {
-    private static final int DB_VERSION = 7;
+    private static final int DB_VERSION = 8;
     private static final String DB_NAME = "bookmarks.db";
 
     public static final String ID = BaseColumns._ID;
@@ -120,7 +120,7 @@ public class BookmarkDB extends SQLiteOpenHelper {
                         + "3389, "
                         + "1, 1, 2, 2, 0, 0, 0, 0, "
                         + "'', '', "
-                        + "1, 1, 1, 1, 0, 0);";
+                        + "1, 1, 1, 1, 0, 'INFO');";
         db.execSQL(sqlInsertDefaultSessionEntry);
     }
 
@@ -158,7 +158,7 @@ public class BookmarkDB extends SQLiteOpenHelper {
                         + "async_input INTEGER DEFAULT 0, "
                         + "async_update INTEGER DEFAULT 0, "
                         + "console_mode INTEGER, "
-                        + "debug_level INTEGER DEFAULT 0, "
+                        + "debug_level TEXT DEFAULT 'INFO', "
 
                         + "FOREIGN KEY(screen_settings) REFERENCES tbl_screen_settings(" + ID + "), "
                         + "FOREIGN KEY(performance_flags) REFERENCES tbl_performance_flags(" + ID + "), "
index e575305..0868037 100644 (file)
@@ -219,6 +219,7 @@ public class LibFreeRDP {
         args.add(addFlag("themes", flags.getTheming()));
         args.add(addFlag("fonts", flags.getFontSmoothing()));
         args.add(addFlag("aero", flags.getDesktopComposition()));
+        args.add(addFlag("glyph-cache", false));
 
         if (!advanced.getRemoteProgram().isEmpty()) {
             args.add("/app:" + advanced.getRemoteProgram());
@@ -272,7 +273,7 @@ public class LibFreeRDP {
             args.add("/microphone");
         }
 
-        args.add("/log-level:TRACE");
+        args.add("/log-level:"+debug.getDebugLevel());
         String[] arrayArgs = args.toArray(new String[args.size()]);
         return freerdp_parse_arguments(inst, arrayArgs);
     }
index 52ceda8..2df2799 100644 (file)
@@ -54,6 +54,8 @@
     <string name="settings_cat_screen">Screen Settings</string>
     <string name="settings_colors">Colors</string>
     <string-array name="colors_array">
+        <item>Palette (8 Bit)</item>
+        <item>High Color (15 Bit)</item>
         <item>High Color (16 Bit)</item>
         <item>True Color (24 Bit)</item>
         <item>Highest Quality (32 Bit)</item>
@@ -62,6 +64,8 @@
        do not translate! -->
     <string-array name="colors_values_array"
                   translatable="false">
+        <item>8</item>
+        <item>15</item>
         <item>16</item>
         <item>24</item>
         <item>32</item>
     <string name="dlg_msg_clear_cert_cache">Are you sure you want to delete all your cached Certificates?</string>
     <string name="debug_level">Debug Level</string>
     <string name="settings_debug">Debug Settings</string>
+    <string-array name="debug_array">
+        <item>OFF</item>
+        <item>FATAL</item>
+        <item>ERROR</item>
+        <item>WARN</item>
+        <item>INFO</item>
+        <item>DEBUG</item>
+        <item>TRACE</item>
+    </string-array>
+    <!-- This array is used as is in code,
+       do not translate! -->
+    <string-array name="debug_values_array"
+                  translatable="false">
+        <item>OFF</item>
+        <item>FATAL</item>
+        <item>ERROR</item>
+        <item>WARN</item>
+        <item>INFO</item>
+        <item>DEBUG</item>
+        <item>TRACE</item>
+    </string-array>
 </resources>
index fa46582..6d0422e 100644 (file)
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:freerdp="http://schemas.android.com/apk/res-auto">
         <PreferenceCategory android:title="@string/settings_debug">
-               <com.freerdp.freerdpcore.utils.IntEditTextPreference
-                   android:key="bookmark.debug_level"
-                   android:title="@string/debug_level"
-                   android:summary="Debug level, 0 to disable."
-                   android:numeric="integer"
-                   android:inputType="number"
-                   freerdp:bounds_min="0"
-                   freerdp:bounds_max="10"
-                   freerdp:bounds_default="0" />            
-                                               <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"/>
+                       <ListPreference
+                               android:key="bookmark.debug_level"
+                               android:title="@string/debug_level"
+                               android:entries="@array/debug_array"
+                               android:entryValues="@array/debug_values_array"/>
+                       <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"/>
         </PreferenceCategory>
 </PreferenceScreen>