コード例 #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
ファイル: OCMApp.cs プロジェクト: ksued/opencache-manager
        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
ファイル: DeleteItem.cs プロジェクト: ksued/opencache-manager
 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
ファイル: DeleteItem.cs プロジェクト: ksued/opencache-manager
 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
ファイル: OCMApp.cs プロジェクト: cbuehler/opencachemanager
        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;
	}