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 ConfigureEToolsDlg() { this.Build (); m_toolList = EToolList.LoadEToolList(); BuildTree(); }
private void CreatePopup(Gtk.ButtonPressEventArgs args) { Menu popup = new Menu(); MenuItem setCenterItem = new MenuItem(Catalog.GetString("_Set As Map Centre")); MenuItem showOnline = new MenuItem(Catalog.GetString("_View Cache Online")); MenuItem mark = new MenuItem(Catalog.GetString("_Mark")); Menu markSub = new Menu(); MenuItem markFound = new MenuItem(Catalog.GetString("Mark _Found")); MenuItem markFTF = new MenuItem(Catalog.GetString("Mark First To Find")); MenuItem markDNF = new MenuItem(Catalog.GetString("Mark Did Not Find")); MenuItem markUnfound = new MenuItem(Catalog.GetString("Mark _Unfound")); MenuItem markDisabled = new MenuItem(Catalog.GetString("Mark _Disabled")); MenuItem markArchived = new MenuItem(Catalog.GetString("Mark _Archived")); MenuItem markAvailable = new MenuItem(Catalog.GetString("Mark A_vailable")); MenuItem correctCoordinates = new MenuItem(Catalog.GetString("_Corrected Coordinates...")); MenuItem addWaypoint = new MenuItem(Catalog.GetString("Add Child _Waypoint...")); MenuItem deleteItem = new MenuItem(Catalog.GetString("Delete...")); MenuItem bookmark = new MenuItem(Catalog.GetString("_Add to Bookmark List")); MenuItem rmvCache = new MenuItem(Catalog.GetString("_Remove From Bookmark List")); MenuItem qlandkarte = new MenuItem(Catalog.GetString("View in _QLandkarte GT...")); MenuItem logCache = new MenuItem(Catalog.GetString("_Log Find")); MenuItem externalTools = new MenuItem(Catalog.GetString("_External Tools")); MenuItem grabImages = new MenuItem(Catalog.GetString("_Grab Images")); EToolList eTools = m_app.Tools; Menu eToolMenu = new Menu(); foreach (ExternalTool tool in eTools.ToolArray) { if (tool.Command.Contains("%selected%") || tool.Command.Contains("%selectedname%")) { Gtk.Action eCmd = new Gtk.Action(tool.Name, tool.Name); eCmd.Activated += HandleECmdActivated; eToolMenu.Add(eCmd.CreateMenuItem()); } } externalTools.Submenu = eToolMenu; TreePath path; TreeIter itr; cacheListTree.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path); cacheListTree.Model.GetIter(out itr, path); Geocache cache = (Geocache)cacheListTree.Model.GetValue(itr, 0); if (cache != null) { logCache.Sensitive = true; if (!cache.Available) { markAvailable.Sensitive = true; markDisabled.Sensitive = false; } else { markAvailable.Sensitive = false; markDisabled.Sensitive = true; } if (!cache.Archived) { markArchived.Sensitive = true; } else { markArchived.Sensitive = false; } if (cache.Symbol.Contains("Found")) { if (cache.FTF) { markFTF.Sensitive = false; markFound.Sensitive = true; } else { markFTF.Sensitive = true; markFound.Sensitive = false; } markUnfound.Sensitive = true; markDNF.Sensitive = true; } else { markFound.Sensitive = true; markFTF.Sensitive = true; if (cache.DNF) { markDNF.Sensitive = false; markUnfound.Sensitive = true; } else { markDNF.Sensitive = true; markUnfound.Sensitive = false; } } } else { logCache.Sensitive = false; } string[] bookmarklists = m_app.CacheStore.GetBookmarkLists(); if (bookmarklists.Length > 0) { Menu bookMarksSub = new Menu(); foreach (String str in bookmarklists) { MenuItem itm = new MenuItem(str); if (str == m_app.CacheStore.ActiveBookmarkList) { itm.Sensitive = false; } bookMarksSub.Append(itm); itm.Activated += HandleItmActivated; } bookmark.Submenu = bookMarksSub; } else { bookmark.Sensitive = false; } if (m_app.CacheStore.ActiveBookmarkList == null) { rmvCache.Sensitive = false; } rmvCache.Activated += HandleRmvCacheActivated; setCenterItem.Activated += HandleSetCenterItemActivated; showOnline.Activated += HandleShowOnlineActivated; deleteItem.Activated += HandleDeleteItemActivated; markFound.Activated += HandleMarkFoundActivated; markUnfound.Activated += HandleMarkUnfoundActivated; markDisabled.Activated += HandleMarkDisabledActivated; markArchived.Activated += HandleMarkArchivedActivated; markAvailable.Activated += HandleMarkAvailableActivated; correctCoordinates.Activated += HandleCorrectCoordinatesActivated; addWaypoint.Activated += HandleAddWayPointActivated; qlandkarte.Activated += HandleQlandkarteActivated; logCache.Activated += HandleLogCacheActivated; markDNF.Activated += HandleMarkDNFActivated; markFTF.Activated += HandleMarkFTFActivated; grabImages.Activated += HandleGrabImagesActivated; popup.Add(setCenterItem); popup.Add(showOnline); popup.Add(new MenuItem()); popup.Add(logCache); popup.Add(mark); markSub.Add(markFound); markSub.Add(markFTF); markSub.Add(markDNF); markSub.Add(markUnfound); markSub.Add(markDisabled); markSub.Add(markArchived); markSub.Add(markAvailable); mark.Submenu = markSub; popup.Add(addWaypoint); popup.Add(correctCoordinates); popup.Add(grabImages); popup.Add(new MenuItem()); popup.Add(externalTools); popup.Add(new MenuItem()); popup.Add(bookmark); popup.Add(rmvCache); popup.Add(new MenuItem()); popup.Add(qlandkarte); popup.Add(deleteItem); popup.ShowAll(); popup.Popup(); }
public ConfigureEToolsDlg(EToolList tools) { this.Build (); m_toolList = tools; BuildTree(); }
public ConfigureEToolsDlg(EToolList tools) { this.Build(); m_toolList = tools; BuildTree(); }
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 RebuildEToolMenu(EToolList tools) { Menu emenu = tools.BuildEToolMenu(); (ExternalToolsAction.Proxies[0] as MenuItem).Submenu = emenu; }