public Preferences(IConfig config, QuickFilters filters) { this.Build (); m_config = config; coordinateEntry.Latitude = config.HomeLat; coordinateEntry.Longitude = config.HomeLon; memberId.Text = config.OwnerID; unitsCombo.Active = config.ImperialUnits ? 1:0; nearbyCombo.Active = config.ShowNearby ? 0:1; childPointCombo.Active = config.ShowAllChildren? 1:0; dataDirEntry.Text = config.DataDirectory; importDirEntry.Text = config.ImportDirectory; WaypointSolvedMode = config.SolvedModeState; SetStartupFilter(filters, config.StartupFilter); MapPoints = config.MapPoints; prefixModeCombo.Active = config.IgnoreWaypointPrefixes ? 1:0; updateCheck.Active = config.CheckForUpdates; UpdateInterval = config.UpdateInterval; directEntryCheck.Active = config.UseDirectEntryMode; autoCloseCheck.Active = config.AutoCloseWindows; selectCachesFromMapCheck.Active = config.AutoSelectCacheFromMap; dnfCheck.Active = config.ShowDNFIcon; pollEntry.Text = config.GPSDPoll.ToString(); recenterCheck.Active = config.GPSDAutoMoveMap; mapsWidget.Maps = config.OpenLayerMaps; }
public void InitializeApp(string filename, bool quitAfterImport) { m_Store = new FileStore(m_Config.DBFile); InitalizeTracing(); m_Locations = LocationList.LoadLocationList(); m_QuickFilters = QuickFilters.LoadQuickFilters(); m_Profiles = GPSProfileList.LoadProfileList(); m_Tools = EToolList.LoadEToolList(); m_Bookmarks = new BookmarkManager(this); m_CentreLat = AppConfig.LastLat; m_CentreLon = AppConfig.LastLon; m_CentreName = AppConfig.LastName; m_Window = new OCMMainWindow(this); QuickFilter startup = m_QuickFilters.GetFilter(AppConfig.StartupFilter); if (startup != null) { m_Window.CacheList.ApplyInitalQuickFilter(startup); } if (filename != null) { if (filename.EndsWith(".zip")) { ImportZip(filename); } else { ImportGPXFile(filename); } if (quitAfterImport) { this.End(); } else { ShowMainWindow(); } } else { m_splash = new OCMSplash(); m_splash.Show(); UpdateGUIThread(); m_splash.Preload(this, startup); } }
public static QuickFilters LoadQuickFilters() { String path = System.Environment.GetFolderPath (System.Environment.SpecialFolder.ApplicationData); if (!File.Exists(path + "/ocm/quickfilters.oqf")) { QuickFilters nfilters = new QuickFilters(); nfilters.AddFilter(QuickFilter.ALL_FILTER); nfilters.AddFilter(QuickFilter.TODO_FILTER); nfilters.AddFilter(QuickFilter.DONE_FILTER); nfilters.AddFilter(QuickFilter.MINE_FILTER); return nfilters; } FileStream fs = new FileStream(path + "/ocm/quickfilters.oqf", FileMode.Open, FileAccess.Read); BinaryFormatter ser = new BinaryFormatter(); System.Object filters = ser.Deserialize(fs); fs.Close(); return filters as QuickFilters; }
private void SetStartupFilter(QuickFilters filterList, String filterName) { int i = 0; foreach (QuickFilter item in filterList.FilterArray) { startupFilterCombo.AppendText(item.Name); if (item.Name == filterName) { startupFilterCombo.Active = i; } i++; } if (startupFilterCombo.Active < 0) { startupFilterCombo.Active = 0; } }
public DeleteItem(QuickFilters filters,bool includePreBuilt) { this.Build (); if (filters != null) { this.label1.Text = Catalog.GetString("Quick Filter:"); int iCount = 0; foreach (QuickFilter filter in filters.FilterArray) { if (!includePreBuilt) if (iCount <= 3) { iCount++; continue; } bmrkCombo.AppendText(filter.Name); bmrkCombo.Active = 0; iCount ++; } } }
public DeleteItem(QuickFilters filters, bool includePreBuilt) { this.Build(); if (filters != null) { this.label1.Text = Catalog.GetString("Quick Filter:"); int iCount = 0; foreach (QuickFilter filter in filters.FilterArray) { if (!includePreBuilt) { if (iCount <= 3) { iCount++; continue; } } bmrkCombo.AppendText(filter.Name); bmrkCombo.Active = 0; iCount++; } } }
public Preferences(IConfig config, QuickFilters filters) { this.Build(); m_config = config; coordinateEntry.Latitude = config.HomeLat; coordinateEntry.Longitude = config.HomeLon; memberId.Text = config.OwnerID; memberId2.Text = config.OwnerID2; memberId3.Text = config.OwnerID3; memberId4.Text = config.OwnerID4; unitsCombo.Active = config.ImperialUnits ? 1:0; nearbyCombo.Active = config.ShowNearby ? 0:1; childPointCombo.Active = config.ShowAllChildren? 1:0; dataDirEntry.Text = config.DataDirectory; importDirEntry.Text = config.ImportDirectory; WaypointSolvedMode = config.SolvedModeState; SetStartupFilter(filters, config.StartupFilter); MapPoints = config.MapPoints; prefixModeCombo.Active = config.IgnoreWaypointPrefixes ? 1:0; updateCheck.Active = config.CheckForUpdates; UpdateInterval = config.UpdateInterval; directEntryCheck.Active = config.UseDirectEntryMode; autoCloseCheck.Active = config.AutoCloseWindows; selectCachesFromMapCheck.Active = config.AutoSelectCacheFromMap; dnfCheck.Active = config.ShowDNFIcon; pollEntry.Text = config.GPSDPoll.ToString(); recenterCheck.Active = config.GPSDAutoMoveMap; mapsWidget.Maps = config.OpenLayerMaps; ShowDiffTer = config.ShowDiffTerrIcon; logTraceCheck.Active = config.EnableTraceLog; clearTraceLog.Active = config.ClearTraceLog; mapPopupCheck.Active = config.MapPopups; staleInterval.Text = config.StaleCacheInterval.ToString(); staleCheck.Active = config.ShowStaleCaches; newCacheEntry.Text = config.NewCacheInterval.ToString(); showNewCaches.Active = config.ShowNewCaches; }
public static QuickFilters LoadQuickFilters() { String path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); if (!File.Exists(path + "/ocm/quickfilters.oqf")) { QuickFilters nfilters = new QuickFilters(); nfilters.AddFilter(QuickFilter.ALL_FILTER); nfilters.AddFilter(QuickFilter.TODO_FILTER); nfilters.AddFilter(QuickFilter.DONE_FILTER); nfilters.AddFilter(QuickFilter.MINE_FILTER); nfilters.AddFilter(QuickFilter.DNF_FILTER); return(nfilters); } FileStream fs = new FileStream(path + "/ocm/quickfilters.oqf", FileMode.Open, FileAccess.Read); BinaryFormatter ser = new BinaryFormatter(); System.Object filters = ser.Deserialize(fs); fs.Close(); QuickFilters qfs = filters as QuickFilters; // Check and upgrade Quick filters if needed. return(filters as QuickFilters); }
public DeleteItem(QuickFilters filters) : this(filters, false) { }
private void SetStartupFilter(QuickFilters filterList, String filterName) { int i=0; foreach(QuickFilter item in filterList.FilterArray) { startupFilterCombo.AppendText(item.Name); if (item.Name == filterName) startupFilterCombo.Active = i; i++; } if (startupFilterCombo.Active < 0) startupFilterCombo.Active = 0; }
public DeleteItem(QuickFilters filters) : this(filters,false) { }
public void InitializeApp(string filename, bool quitAfterImport) { m_Store = new FileStore(m_Config.DBFile); InitalizeTracing (); m_Locations = LocationList.LoadLocationList(); m_QuickFilters = QuickFilters.LoadQuickFilters(); m_Profiles = GPSProfileList.LoadProfileList(); m_Tools = EToolList.LoadEToolList(); m_Bookmarks = new BookmarkManager(this); m_CentreLat = AppConfig.LastLat; m_CentreLon = AppConfig.LastLon; m_CentreName = AppConfig.LastName; m_Window = new OCMMainWindow(this); QuickFilter startup = m_QuickFilters.GetFilter(AppConfig.StartupFilter); if (startup != null) m_Window.CacheList.ApplyInitalQuickFilter(startup); if (filename != null) { if (filename.EndsWith(".zip")) ImportZip(filename); else ImportGPXFile(filename); if (quitAfterImport) this.End(); else ShowMainWindow(); } else { m_splash = new OCMSplash(); m_splash.Show(); UpdateGUIThread(); m_splash.Preload(this, startup); } }
public void RebuildQuickFilterMenu(QuickFilters filters) { Menu qmenu = filters.BuildQuickFilterMenu(); (QuickFilterAction.Proxies[0] as MenuItem).Submenu = qmenu; }