public static void Main(string[] args) { Application.Init (); try { BusG.Init (); Bus bus = Bus.Session; string busName = "org.ocm.dbus"; if (bus.RequestName (busName) != RequestNameReply.PrimaryOwner) { IDBusComm comm = bus.GetObject<IDBusComm> (busName, new ObjectPath ("/org/ocm/dbus")); if (args != null) { if (args.Length > 0) comm.ImportGPX (args[0]); } comm.ShowOCM(); return; } else { DBusComm comm = new DBusComm (); bus.Register (new ObjectPath ("/org/ocm/dbus"), comm); } } catch { System.Console.Error.WriteLine("NO SESSION DBUS RUNNING"); } if (args != null) if (args.Length > 0) m_file = args[0]; //System.Console.WriteLine("Path is " + "@expanded_datadir@/locale"); // Set the localeDirectory right both for developement or for installed versions String localeDirectory = "@expanded_datadir@/locale"; if (localeDirectory.Contains("@" + "expanded_datadir" + "@")) { localeDirectory = "./locale"; } Mono.Unix.Catalog.Init ("opencachemanager", localeDirectory); //Mono.Unix.Catalog.Init ("opencachemanager", "./locale"); //Mono.Unix.Catalog.Init ("opencachemanager", "@expanded_datadir@/locale"); Config config = new Config(); bool runWizard = !config.WizardDone; if (runWizard) { UIMonitor.getInstance ().RunSetupAssistant (); } else { ShowSplash(); } Application.Run (); }
void HandleHandleClose(object sender, EventArgs e) { this.Hide (); this.Dispose (); if (!Directory.Exists (page2.DataDirectory)) Directory.CreateDirectory (page2.DataDirectory); if (!File.Exists (page2.DBFile)) { FileStore store = new FileStore (page2.DBFile); store.Dispose (); } Config config = new Config(); config.DataDirectory = page2.DataDirectory; config.DBFile = page2.DBFile; config.HomeLat = page3.HomeLat; config.HomeLon = page3.HomeLon; config.OwnerID = page3.MemberID; config.ImperialUnits = page2.ImperialUnits; config.MapType = page2.DefaultMap; config.WizardDone = true; m_App.InitializeApp(null, false); }
void HandleHandleClose(object sender, EventArgs e) { this.Hide (); this.Dispose (); if (!Directory.Exists(page2.DataDirectory)) Directory.CreateDirectory(page2.DataDirectory); if (!File.Exists(page2.DBFile)) Engine.getInstance().Store.CreateDB(page2.DBFile); Config config = new Config(); config.DataDirectory = page2.DataDirectory; config.DBFile = page2.DBFile; config.HomeLat = page3.HomeLat; config.HomeLon = page3.HomeLon; config.OwnerID = page3.MemberID; config.ImperialUnits = page2.ImperialUnits; config.MapType = page2.DefaultMap; config.WizardDone = true; MainWindow win = new MainWindow (); win.Show(); UIMonitor.getInstance().LoadConfig(true); }