Fixed settings load/store.
authorArmin Novak <armin.novak@gmail.com>
Thu, 10 Mar 2016 20:52:40 +0000 (21:52 +0100)
committerArmin Novak <armin.novak@gmail.com>
Thu, 10 Mar 2016 20:52:40 +0000 (21:52 +0100)
client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.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

index eaf1eb6..60add65 100644 (file)
@@ -748,6 +748,10 @@ public class BookmarkBase implements Parcelable, Cloneable {
 
                editor.putBoolean("bookmark.perf_remotefx",
                                performanceFlags.getRemoteFX());
+               editor.putBoolean("bookmark.perf_gfx",
+                               performanceFlags.getGfx());
+               editor.putBoolean("bookmark.perf_gfx_h264",
+                               performanceFlags.getH264());
                editor.putBoolean("bookmark.perf_wallpaper",
                                performanceFlags.getWallpaper());
                editor.putBoolean("bookmark.perf_font_smoothing",
@@ -774,6 +778,10 @@ public class BookmarkBase implements Parcelable, Cloneable {
 
                editor.putBoolean("bookmark.perf_remotefx_3g", advancedSettings
                                .getPerformance3G().getRemoteFX());
+               editor.putBoolean("bookmark.perf_gfx_3g", advancedSettings
+                               .getPerformance3G().getGfx());
+               editor.putBoolean("bookmark.perf_gfx_h264_3g", advancedSettings
+                               .getPerformance3G().getH264());
                editor.putBoolean("bookmark.perf_wallpaper_3g", advancedSettings
                                .getPerformance3G().getWallpaper());
                editor.putBoolean("bookmark.perf_font_smoothing_3g", advancedSettings
@@ -825,6 +833,10 @@ public class BookmarkBase implements Parcelable, Cloneable {
 
                performanceFlags.setRemoteFX(sharedPrefs.getBoolean(
                                "bookmark.perf_remotefx", false));
+               performanceFlags.setGfx(sharedPrefs.getBoolean(
+                               "bookmark.perf_gfx", false));
+               performanceFlags.setH264(sharedPrefs.getBoolean(
+                               "bookmark.perf_gfx_h264", false));
                performanceFlags.setWallpaper(sharedPrefs.getBoolean(
                                "bookmark.perf_wallpaper", false));
                performanceFlags.setFontSmoothing(sharedPrefs.getBoolean(
@@ -850,6 +862,10 @@ public class BookmarkBase implements Parcelable, Cloneable {
 
                advancedSettings.getPerformance3G().setRemoteFX(
                                sharedPrefs.getBoolean("bookmark.perf_remotefx_3g", false));
+               advancedSettings.getPerformance3G().setGfx(sharedPrefs.getBoolean(
+                               "bookmark.perf_gfx_3g", false));
+               advancedSettings.getPerformance3G().setH264(sharedPrefs.getBoolean(
+                               "bookmark.perf_gfx_h264_3g", false));
                advancedSettings.getPerformance3G().setWallpaper(
                                sharedPrefs.getBoolean("bookmark.perf_wallpaper_3g", false));
                advancedSettings.getPerformance3G().setFontSmoothing(
index be01240..287f8f5 100644 (file)
@@ -261,6 +261,8 @@ public abstract class BookmarkBaseGateway
        
        private void addPerformanceFlagsColumns(ArrayList<String> columns) {
                columns.add("join_performance_flags.perf_remotefx as performanceRemoteFX");
+               columns.add("join_performance_flags.perf_gfx as performanceGfx");
+               columns.add("join_performance_flags.perf_gfx_h264 as performanceGfxH264");
                columns.add("join_performance_flags.perf_wallpaper as performanceWallpaper");
                columns.add("join_performance_flags.perf_theming as performanceTheming");
                columns.add("join_performance_flags.perf_full_window_drag as performanceFullWindowDrag");
@@ -278,6 +280,8 @@ public abstract class BookmarkBaseGateway
        
        private void addPerformanceFlags3GColumns(ArrayList<String> columns) {
                columns.add("join_performance_3G.perf_remotefx as performanceRemoteFX3G");
+               columns.add("join_performance_3G.perf_gfx as performanceGfx3G");
+               columns.add("join_performance_3G.perf_gfx_h264 as performanceGfxH2643G");
                columns.add("join_performance_3G.perf_wallpaper as performanceWallpaper3G");
                columns.add("join_performance_3G.perf_theming as performanceTheming3G");
                columns.add("join_performance_3G.perf_full_window_drag as performanceFullWindowDrag3G");
@@ -335,6 +339,11 @@ public abstract class BookmarkBaseGateway
        private void readPerformanceFlags(BookmarkBase bookmark, Cursor cursor) {
                BookmarkBase.PerformanceFlags perfFlags = bookmark.getPerformanceFlags();
                perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex("performanceRemoteFX")) == 0 ? false : true);
+               perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex("performanceGfx")) == 0 ? false :
+                               true);
+               perfFlags.setH264(cursor.getInt(cursor.getColumnIndex("performanceGfxH264")) == 0 ?
+                               false :
+                               true);
                perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex("performanceWallpaper")) == 0 ? false : true);
                perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex("performanceTheming")) == 0 ? false : true);
                perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex("performanceFullWindowDrag")) == 0 ? false : true);
@@ -354,6 +363,11 @@ public abstract class BookmarkBaseGateway
        private void readPerformanceFlags3G(BookmarkBase bookmark, Cursor cursor) {
                BookmarkBase.PerformanceFlags perfFlags = bookmark.getAdvancedSettings().getPerformance3G();
                perfFlags.setRemoteFX(cursor.getInt(cursor.getColumnIndex("performanceRemoteFX3G")) == 0 ? false : true);
+               perfFlags.setGfx(cursor.getInt(cursor.getColumnIndex("performanceGfx3G")) == 0 ? false :
+                               true);
+               perfFlags.setH264(cursor.getInt(cursor.getColumnIndex("performanceGfxH2643G")) == 0 ?
+                               false :
+                               true);
                perfFlags.setWallpaper(cursor.getInt(cursor.getColumnIndex("performanceWallpaper3G")) == 0 ? false : true);
                perfFlags.setTheming(cursor.getInt(cursor.getColumnIndex("performanceTheming3G")) == 0 ? false : true);
                perfFlags.setFullWindowDrag(cursor.getInt(cursor.getColumnIndex("performanceFullWindowDrag3G")) == 0 ? false : true);
@@ -373,6 +387,8 @@ public abstract class BookmarkBaseGateway
        private void fillPerformanceFlagsContentValues(BookmarkBase.PerformanceFlags perfFlags, ContentValues values)
        {
                values.put("perf_remotefx", perfFlags.getRemoteFX());
+               values.put("perf_gfx", perfFlags.getGfx());
+               values.put("perf_gfx_h264", perfFlags.getH264());
                values.put("perf_wallpaper", perfFlags.getWallpaper());
                values.put("perf_theming", perfFlags.getTheming());
                values.put("perf_full_window_drag", perfFlags.getFullWindowDrag());
index fddee9d..1ceb4ce 100644 (file)
@@ -46,8 +46,8 @@ public class BookmarkDB extends SQLiteOpenHelper {
                 "CREATE TABLE tbl_performance_flags ("
                         + ID + " INTEGER PRIMARY KEY, "
                         + "perf_remotefx INTEGER, "
-                        + "perf_gfx INTEGER,"
-                        + "perf_gfx_h264 INTEGER,"
+                        + "perf_gfx INTEGER, "
+                        + "perf_gfx_h264 INTEGER, "
                         + "perf_wallpaper INTEGER, "
                         + "perf_theming INTEGER, "
                         + "perf_full_window_drag INTEGER, "
@@ -71,7 +71,6 @@ public class BookmarkDB extends SQLiteOpenHelper {
                         + "VALUES ( "
                         + "32, 1, 1024, 768);";
         db.execSQL(sqlInsertDefaultScreenEntry);
-        db.execSQL(sqlInsertDefaultScreenEntry);
 
         String sqlInsertDefaultPerfFlags =
                 "INSERT INTO tbl_performance_flags ("
@@ -87,7 +86,6 @@ public class BookmarkDB extends SQLiteOpenHelper {
                         + "VALUES ( "
                         + "1, 1, 1, 0, 0, 0, 0, 0, 0);";
         db.execSQL(sqlInsertDefaultPerfFlags);
-        db.execSQL(sqlInsertDefaultPerfFlags);
 
         String sqlInsertDefaultSessionEntry =
                 "INSERT INTO tbl_manual_bookmarks ("
index c4bb57f..b45f45c 100644 (file)
@@ -207,7 +207,9 @@ public class LibFreeRDP {
             args.add("/gfx");
         }
 
-        args.add(addFlag("gfx-h264", flags.getH264()));
+        if (flags.getH264()) {
+            args.add("/gfx-h264");
+        }
 
         args.add(addFlag("wallpaper", flags.getWallpaper()));
         args.add(addFlag("window-drag", flags.getFullWindowDrag()));