Ejemplo n.º 1
0
 def removeWaypoint(self,id_waypoint, confirm = False):
     logging.debug('>>')
     if confirm:
          self.waypoint.removeWaypoint(id_waypoint)
          self.refreshWaypointView()
     else:
          msg = _("Delete this waypoint?")
          params = [id_waypoint,True]
          warning = Warning(self.data_path,self.removeWaypoint,params)
          warning.set_text(msg)
          warning.run()
     logging.debug('<<')
Ejemplo n.º 2
0
 def removeRecord(self, id_record, confirm = False, view=None):
     logging.debug('>>')
     if confirm:
          self.record.removeRecord(id_record)
     else:
          msg = _("Delete this database entry?")
          params = [id_record,True]
          warning = Warning(self.data_path,self.removeRecord,params)
          warning.set_text(msg)
          warning.run()
     self.refreshListRecords()
     if view is not None:
         self.refreshGraphView(view)
     logging.debug('<<')
Ejemplo n.º 3
0
	def actualize_fromgpx(self,gpxfile):
		logging.debug(">>")
		#self.pytrainer_main.ddbb.connect()
		from lib.gpx import Gpx
		gpx = Gpx(self.data_path,gpxfile)
		tracks = gpx.getTrackRoutes()

		if len(tracks) > 1:
			time = self.date.unixtime2date(tracks[0][1])
			self.recordwindow.rcd_date.set_text(time)
			self._actualize_fromgpx(gpx)
		else:
			msg = _("The gpx file seems to be a several days records. Perhaps you will need to edit your gpx file")
			from gui.warning import Warning
			warning = Warning(self.data_path,self._actualize_fromgpx,[gpx])
                        warning.set_text(msg)
                        warning.run()
		#self.pytrainer_main.ddbb.disconnect()
		logging.debug("<<")
Ejemplo n.º 4
0
	def actualize_fromgpx(self,gpxfile): #TODO remove? - should never have multiple tracks per GPX file
		logging.debug('>>')
		logging.debug('loading file: '+gpxfile)
		gpx = Gpx(self.data_path,gpxfile)
		tracks = gpx.getTrackRoutes()

		if len(tracks) == 1:
			logging.debug('Just 1 track')
			self._actualize_fromgpx(gpx)
		elif len(tracks) > 1:
			logging.debug('Found '+str(len(tracks))+' tracks')
			self._select_trkfromgpx(gpxfile,tracks)
		else:
			msg = _("pytrainer can't import data from your gpx file")
			from gui.warning import Warning
			warning = Warning(self.data_path)
			warning.set_text(msg)
			warning.run()
		logging.debug('<<')
Ejemplo n.º 5
0
 def removeWaypoint(self, id_waypoint, confirm=False):
     logging.debug('>>')
     if confirm:
         self.waypoint.removeWaypoint(id_waypoint)
         self.refreshWaypointView()
     else:
         msg = _("Delete this waypoint?")
         params = [id_waypoint, True]
         warning = Warning(self.data_path, self.removeWaypoint, params)
         warning.set_text(msg)
         warning.run()
     logging.debug('<<')
Ejemplo n.º 6
0
 def removeRecord(self, id_record, confirm=False, view=None):
     logging.debug('>>')
     if confirm:
         self.record.removeRecord(id_record)
     else:
         msg = _("Delete this database entry?")
         params = [id_record, True]
         warning = Warning(self.data_path, self.removeRecord, params)
         warning.set_text(msg)
         warning.run()
     self.refreshListRecords()
     if view is not None:
         self.refreshGraphView(view)
     logging.debug('<<')
Ejemplo n.º 7
0
    def actualize_fromgpx(self, gpxfile):
        logging.debug(">>")
        from lib.gpx import Gpx
        gpx = Gpx(self.data_path, gpxfile)
        tracks = gpx.getTrackRoutes()

        if len(tracks) > 1:
            time = unixtime2date(tracks[0][1])
            self.recordwindow.rcd_date.set_text(time)
            self._actualize_fromgpx(gpx)
        else:
            msg = _(
                "The gpx file seems to be a several days records. Perhaps you will need to edit your gpx file"
            )
            from gui.warning import Warning
            warning = Warning(self.data_path, self._actualize_fromgpx, [gpx])
            warning.set_text(msg)
            warning.run()
        logging.debug("<<")
Ejemplo n.º 8
0
    def actualize_fromgpx(self,gpxfile): #TODO remove? - should never have multiple tracks per GPX file
        logging.debug('>>')
        logging.debug('loading file: '+gpxfile)
        gpx = Gpx(self.data_path,gpxfile)
        tracks = gpx.getTrackRoutes()

        if len(tracks) == 1:
            logging.debug('Just 1 track')
            self._actualize_fromgpx(gpx)
        elif len(tracks) > 1:
            logging.debug('Found '+str(len(tracks))+' tracks')
            self._select_trkfromgpx(gpxfile,tracks)
        else:
            msg = _("pytrainer can't import data from your gpx file")
            from gui.warning import Warning
            warning = Warning(self.data_path)
            warning.set_text(msg)
            warning.run()
        logging.debug('<<')