OSDN Git Service

Use last login location as the default, if the configuration file does not exist
authorLatif Khalifa <latifer@streamgrid.net>
Sat, 10 Oct 2009 11:44:08 +0000 (11:44 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Sat, 10 Oct 2009 11:44:08 +0000 (11:44 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@338 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Consoles/MainConsole.cs
Radegast/RadegastBuild.cs

index 9b27cb8..a683ffa 100644 (file)
@@ -104,8 +104,17 @@ namespace Radegast
             txtPassword.Text = s["password"].AsString();\r
             netcom.LoginOptions.IsPasswordMD5 = true;\r
 \r
-            cbxLocation.SelectedIndex = s["login_location_type"].AsInteger();\r
-            cbxLocation.Text = s["login_location"].AsString();\r
+            // Use last location as default\r
+            if (s["login_location_type"].Type == OSDType.Unknown)\r
+            {\r
+                cbxLocation.SelectedIndex = 1;\r
+                s["login_location_type"] = OSD.FromInteger(1);\r
+            }\r
+            else\r
+            {\r
+                cbxLocation.SelectedIndex = s["login_location_type"].AsInteger();\r
+                cbxLocation.Text = s["login_location"].AsString();\r
+            }\r
 \r
             cbxGrid.SelectedIndex = s["login_grid"].AsInteger();\r
             txtCustomLoginUri.Text = s["login_uri"].AsString();\r
index e5bfde6..ca32b58 100644 (file)
@@ -1,5 +1,5 @@
 // Autogenerated: run updatebuildnr.bat/sh to update \r
 namespace Radegast \r
 { \r
-    public static class RadegastBuild { public static int CurrentRev = 337; } \r
+    public static class RadegastBuild { public static int CurrentRev = 338; } \r
 } \r