예제 #1
0
 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;
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 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;
 }
예제 #4
0
        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;
            }
        }
예제 #5
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 ++;
         }
     }
 }
예제 #6
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++;
         }
     }
 }
예제 #7
0
 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;
 }
예제 #8
0
        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);
        }
예제 #9
0
 public DeleteItem(QuickFilters filters) : this(filters, false)
 {
 }
예제 #10
0
 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;
 }
예제 #11
0
 public DeleteItem(QuickFilters filters)
     : this(filters,false)
 {
 }
예제 #12
0
        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);
            }
        }
예제 #13
0
	public void RebuildQuickFilterMenu(QuickFilters filters)
	{
			Menu qmenu = filters.BuildQuickFilterMenu();
			(QuickFilterAction.Proxies[0] as MenuItem).Submenu = qmenu;
	}