Пример #1
0
        void HandleCacheListSelectionChanged(object sender, CacheEventArgs args)
        {
            if (this.GdkWindow != null)
                this.GdkWindow.Cursor = Cursor.NewFromName(this.Display, "left_ptr_watch");
            OCMApp.UpdateGUIThread();
            SetFilterFlags ();
            Geocache cache = args.Cache;
            ocmCacheInfo.SetCache(cache);
            if (args.Cache == null)
            {
                CacheAction.Sensitive = false;
                printAction.Sensitive = false;
                AddSelectedCacheToAction.Sensitive = false;
                PanToSelectedCacheAction.Sensitive = false;
                ZoomToSelectedCacheAction.Sensitive = false;
                DeleteAction.Sensitive = false;
                DeselectAction.Sensitive = false;
                GrabImagesAction1.Sensitive = false;
                ocmMapWidget.SetCache(cache);
                if (this.GdkWindow != null)
                    this.GdkWindow.Cursor = ARROWCURSOR;
                return;
            }

            CacheAction.Sensitive = true;
            GrabImagesAction1.Sensitive = true;
            printAction.Sensitive = true;
            PanToSelectedCacheAction.Sensitive = true;
            AddSelectedCacheToAction.Sensitive = true;
            ZoomToSelectedCacheAction.Sensitive = true;
            DeleteAction.Sensitive = true;
            DeselectAction.Sensitive = true;
            MarkUnfoundAction.Sensitive = (cache.Found || cache.DNF)? true:false;
            MarkDidNotFindAction.Sensitive = cache.DNF? false:true;
            MarkFoundAction.Sensitive = (!cache.Found || cache.FTF)? true:false;
            MarkFirstToFindAction.Sensitive = (!cache.Found || !cache.FTF)?true:false;
            MarkAvailableAction.Sensitive = !cache.Available;
            MarkArchivedAction.Sensitive = (cache.Available || !cache.Archived)? true:false;
            MarkDisabledAction.Sensitive = (cache.Available || cache.Archived)? true:false;
            if (m_app.CacheStore.ActiveBookmarkList != null)
                RemoveSelectedCacheFromBookmarkListAction.Sensitive = true;
            else
                RemoveSelectedCacheFromBookmarkListAction.Sensitive = false;
            ocmMapWidget.SetCache(cache);
            OCMApp.UpdateGUIThread();
            if (this.GdkWindow != null)
                this.GdkWindow.Cursor = ARROWCURSOR;
        }
Пример #2
0
 void HandleCacheListRefreshPulse(object sender, CacheEventArgs args)
 {
     m_pulseCount++;
     ocmMapWidget.AddGeocache(args.Cache);
     if (m_pulseCount == 50)
     {
         statusProgressBar.Pulse();
         m_pulseCount = 0;
         OCMApp.UpdateGUIThread();
     }
 }