Modify Fit Screen option to not require global context object
This commit is contained in:
parent
3a9a41d900
commit
999c571335
@ -79,10 +79,12 @@
|
||||
<item>1920x1080</item>
|
||||
<item>1920x1200</item>
|
||||
</string-array>
|
||||
<!-- The strings in resolutions_values_array should not be localized -->
|
||||
<!-- They are used for text comparison and must remain in english -->
|
||||
<string-array name="resolutions_values_array">
|
||||
<item>automatico</item>
|
||||
<item>pantalla</item>
|
||||
<item>manual</item>
|
||||
<item>automatic</item>
|
||||
<item>fitscreen</item>
|
||||
<item>custom</item>
|
||||
<item>640x480</item>
|
||||
<item>720x480</item>
|
||||
<item>800x600</item>
|
||||
@ -92,6 +94,7 @@
|
||||
<item>1920x1080</item>
|
||||
<item>1920x1200</item>
|
||||
</string-array>
|
||||
<!-- end protected string section -->
|
||||
<string name="settings_width">Ancho</string>
|
||||
<string name="settings_height">Altura</string>
|
||||
<string name="settings_performance">Rendimiento</string>
|
||||
|
@ -78,19 +78,22 @@
|
||||
<item>"1920x1080"</item>
|
||||
<item>"1920x1200"</item>
|
||||
</string-array>
|
||||
<!-- The strings in resolutions_values_array should not be localized -->
|
||||
<!-- They are used for text comparison and must remain in english -->
|
||||
<string-array name="resolutions_values_array">
|
||||
<item>"Automatique"</item>
|
||||
<item>"fenêtre"</item>
|
||||
<item>"Personalisé"</item>
|
||||
<item>"640x480"</item>
|
||||
<item>"720x480"</item>
|
||||
<item>"800x600"</item>
|
||||
<item>"1024x768"</item>
|
||||
<item>"1280x1024"</item>
|
||||
<item>"1440x900"</item>
|
||||
<item>"1920x1080"</item>
|
||||
<item>"1920x1200"</item>
|
||||
<item>automatic</item>
|
||||
<item>fitscreen</item>
|
||||
<item>custom</item>
|
||||
<item>640x480</item>
|
||||
<item>720x480</item>
|
||||
<item>800x600</item>
|
||||
<item>1024x768</item>
|
||||
<item>1280x1024</item>
|
||||
<item>1440x900</item>
|
||||
<item>1920x1080</item>
|
||||
<item>1920x1200</item>
|
||||
</string-array>
|
||||
<!-- end protected string section -->
|
||||
<string name="settings_width">"Largeur"</string>
|
||||
<string name="settings_height">"Hauteur"</string>
|
||||
<string name="settings_performance">"Performance"</string>
|
||||
|
@ -79,10 +79,12 @@
|
||||
<item>1920x1080</item>
|
||||
<item>1920x1200</item>
|
||||
</string-array>
|
||||
<!-- The strings in resolutions_values_array should not be localized -->
|
||||
<!-- They are used for text comparison and must remain in english -->
|
||||
<string-array name="resolutions_values_array">
|
||||
<item>Automatisch</item>
|
||||
<item>Schermvullend</item>
|
||||
<item>Aangepast</item>
|
||||
<item>automatic</item>
|
||||
<item>fitscreen</item>
|
||||
<item>custom</item>
|
||||
<item>640x480</item>
|
||||
<item>720x480</item>
|
||||
<item>800x600</item>
|
||||
@ -92,6 +94,7 @@
|
||||
<item>1920x1080</item>
|
||||
<item>1920x1200</item>
|
||||
</string-array>
|
||||
<!-- end protected string section -->
|
||||
<string name="settings_width">Breedte</string>
|
||||
<string name="settings_height">Hoogte</string>
|
||||
<string name="settings_performance">Prestatie</string>
|
||||
|
@ -12,6 +12,7 @@ package com.freerdp.freerdpcore.application;
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.*;
|
||||
@ -50,6 +51,7 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener
|
||||
|
||||
// timer for disconnecting sessions after the screen was turned off
|
||||
private static Timer disconnectTimer = null;
|
||||
public static GlobalApp instance = null;
|
||||
|
||||
// TimerTask for disconnecting sessions after screen was turned off
|
||||
private static class DisconnectTask extends TimerTask
|
||||
@ -88,6 +90,7 @@ public class GlobalApp extends Application implements LibFreeRDP.EventListener
|
||||
quickConnectHistoryGateway = new QuickConnectHistoryGateway(historyDB);
|
||||
|
||||
GlobalSettings.init(this);
|
||||
instance = this;
|
||||
ConnectedTo3G = NetworkStateReceiver.isConnectedTo3G(this);
|
||||
|
||||
// init screen receiver here (this can't be declared in AndroidManifest - refer to:
|
||||
|
@ -27,11 +27,9 @@ public class GlobalSettings {
|
||||
private static final String PREF_SECURITY_ACCEPTALLCERTIFICATES = "security.accept_certificates";
|
||||
|
||||
private static SharedPreferences settings;
|
||||
public static Context initialContext;
|
||||
|
||||
public static void init(Context context)
|
||||
{
|
||||
initialContext = context;
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
initValues();
|
||||
}
|
||||
|
@ -191,13 +191,13 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
this.height = Integer.valueOf(dimensions[1]);
|
||||
this.resolution = PREDEFINED;
|
||||
}
|
||||
else if (resolution.equalsIgnoreCase(GlobalSettings.initialContext.getResources().getString(R.string.resolution_custom)))
|
||||
else if (resolution.equalsIgnoreCase("custom"))
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.resolution = CUSTOM;
|
||||
}
|
||||
else if (resolution.equalsIgnoreCase(GlobalSettings.initialContext.getResources().getString(R.string.resolution_fit)))
|
||||
else if (resolution.equalsIgnoreCase("fitscreen"))
|
||||
{
|
||||
this.width = this.height = 0;
|
||||
this.resolution = FITSCREEN;
|
||||
@ -219,9 +219,7 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
if (isPredefined())
|
||||
return (width + "x" + height);
|
||||
|
||||
return (isFitScreen() ? GlobalSettings.initialContext.getResources().getString(R.string.resolution_fit) :
|
||||
isAutomatic() ? GlobalSettings.initialContext.getResources().getString(R.string.resolution_automatic) :
|
||||
GlobalSettings.initialContext.getResources().getString(R.string.resolution_custom));
|
||||
return (isFitScreen() ? "fitscreen" : isAutomatic() ? "automatic" : "custom");
|
||||
}
|
||||
|
||||
public boolean isPredefined() {
|
||||
|
Loading…
Reference in New Issue
Block a user