예제 #1
0
 public void SendToGPS()
 {
     if (m_app.Profiles.GetActiveProfile () == null) {
         MessageDialog err = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok,
                                                Catalog.GetString ("There is no active GPS profile. Either select an"
                                                                   + " existing one from the GPS Menu or add a new profile ."));
         err.Run ();
         err.Hide ();
         err.Dispose ();
         return;
     }
     SendWaypointsDialog dlg = new SendWaypointsDialog ();
     dlg.Parent = this;
     dlg.Icon = this.Icon;
     dlg.AutoClose = Config.AutoCloseWindows;
     dlg.Start (CacheList.UnfilteredCaches, m_app.Profiles.GetActiveProfile (), m_app.CacheStore);
 }
예제 #2
0
 public void ExportGarminPOI()
 {
     ExportPOIDialog dlg = new ExportPOIDialog (Config);
     if ((int)ResponseType.Ok == dlg.Run ()) {
         GPSProfile poiProfile = new GPSProfile ();
         poiProfile.BabelFormat = "garmin_gpi";
         poiProfile.NameMode = dlg.NameMode;
         poiProfile.DescMode = dlg.DescMode;
         poiProfile.OutputFile = dlg.FileName;
         poiProfile.CacheLimit = dlg.CacheLimit;
         poiProfile.LogLimit = dlg.LogLimit;
         poiProfile.FieldNotesFile = null;
         poiProfile.IncludeAttributes = false;
         poiProfile.ForcePlainText = dlg.UsePlainText;
         poiProfile.Name = "POI";
         StringBuilder builder = new StringBuilder ();
         // Build other properties
         if (dlg.BMPFile != null) {
             builder.Append ("bitmap=\"");
             builder.Append (dlg.BMPFile);
             builder.Append ("\"");
         } else {
             builder.Append ("hide");
         }
         if (dlg.ProximityDistance > 0) {
             builder.Append (",proximity=");
             builder.Append (dlg.ProximityDistance.ToString (CultureInfo.InvariantCulture));
             builder.Append (",units=");
             builder.Append (dlg.ProximityUnits);
         }
         builder.Append (",");
         builder.Append ("category=\"");
         builder.Append (dlg.Category);
         builder.Append ("\"");
         poiProfile.OtherProperties = builder.ToString ();
         SendWaypointsDialog edlg = new SendWaypointsDialog ();
         edlg.Icon = this.Icon;
         edlg.AutoClose = Config.AutoCloseWindows;
         edlg.Start (CacheList.UnfilteredCaches, poiProfile, m_app.CacheStore);
     }
     dlg.Dispose ();
 }