Forráskód Böngészése

Databasesettings now points to demo database if empty.

Kenric Nugteren 1 éve
szülő
commit
f745847130
2 módosított fájl, 12 hozzáadás és 8 törlés
  1. 3 3
      prs.classes/Settings/DatabaseSettings.cs
  2. 9 5
      prs.desktop/App.xaml.cs

+ 3 - 3
prs.classes/Settings/DatabaseSettings.cs

@@ -29,7 +29,7 @@ namespace Comal.Classes
         {
             IsActive = true;
             
-            DatabaseType = DatabaseType.Standalone;
+            DatabaseType = DatabaseType.Networked;
             
             // If DatabaseType == Standalone
             FileName = Path.Combine(CoreUtils.GetPath(), "prs.dbs");
@@ -41,8 +41,8 @@ namespace Comal.Classes
             // If DatabaseType == Networked
             //URL = "http://127.0.0.1";
             //Port = 8000;
-            Protocol = SerializerProtocol.Rest;
-            URLs = new String[] { };
+            Protocol = SerializerProtocol.RPC;
+            URLs = new string[] { "https://demo.prsdigital.com.au:8033" };
 
             StartPanel = "";
             Autologin = false;

+ 9 - 5
prs.desktop/App.xaml.cs

@@ -64,8 +64,8 @@ namespace PRSDesktop
 
         private void AutoDiscover(Dictionary<string, DatabaseSettings> allsettings)
         {
-            var confirm = MessageWindow.ShowYesNoCancel("Try to configure Server Connection Automatically?", "Auto Discover");
-            if (confirm == MessageWindowResult.Yes)
+            var confirm = MessageWindow.ShowYesNo("Try to configure Server Connection Automatically?", "Auto Discover");
+            if (confirm)
                 try
                 {
                     using (new WaitCursor())
@@ -186,7 +186,7 @@ namespace PRSDesktop
                     sw.WriteLine();
                     sw.WriteLine("The following parameters are valid:");
                     _commandLineParameters.WriteOptionDescriptions(sw);
-                    MessageBox.Show(sw.ToString(), "PRS Desktop Startup Options");
+                    MessageWindow.ShowMessage(sw.ToString(), "PRS Desktop Startup Options");
                 }
             }
             
@@ -200,7 +200,11 @@ namespace PRSDesktop
             // Create Default Database Entry
             if (!allsettings.Any())
             {
-                allsettings["Default"] = new DatabaseSettings();
+                var settings = new DatabaseSettings();
+                settings.UserID = "GUEST";
+                settings.Password = "guest";
+                settings.Autologin = false;
+                allsettings["Default"] = settings;
                 bSaveSettings = true;
             }
 
@@ -255,7 +259,7 @@ namespace PRSDesktop
                 if (allsettings.ContainsKey(Profile))
                     DatabaseSettings = allsettings[Profile];
                 else
-                    MessageBox.Show(string.Format("Profile {0} does not exist!", Profile));
+                    MessageWindow.ShowMessage($"Profile {Profile} does not exist!", "Error");
             }
 
             if (DatabaseSettings == null)