Opened 8 years ago

Last modified 6 years ago

#862 new enhancement/feature request

Navit needs a CONFIGDIR environment variable

Reported by: themroc.myopenid.com Owned by: KaZeR
Priority: minor Milestone: version 0.6.0
Component: core Version: git master
Severity: Keywords: configuration, xml, customization
Cc: sebastian.leske@…

Description

... to allow for platform independent OSD configs. Now, a designer has to write something like

<osd x="0" y="O" enabled="yes" type="image" src="/sdcard/navit/top.png"/>

which the poor users without an android have to edit. With this little patch, it would look like

<osd x="0" y="O" enabled="yes" type="image" src="$NAVIT_CONFIGDIR/top.png"/>

and nobody needs to edit anything.

NAVIT_CONFIGDIR can be set before navit starts, in will then be used to load navit.xml if no absolute path is given (for instance when navit is called like

navit -c my-navit-cfg.xml

or no $NAVIT_USER_DATADIR/navit.xml was found and therefore navit.xml.local is used. In any case, after the config-file is found, $NAVIT_CONFIGDIR will hold its directory.

Attachments (3)

navit-r4495-configdir.patch (2.7 KB) - added by themroc.myopenid.com 8 years ago.
navit-r5003-configdir.patch (2.6 KB) - added by themroc.myopenid.com 7 years ago.
navit-r5196-configdir.patch (1.7 KB) - added by sleske 6 years ago.
Updated patch for rev. 5196

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by themroc.myopenid.com

Changed 7 years ago by themroc.myopenid.com

comment:1 Changed 6 years ago by sleske

The patch looks OK technically, however I'm not sure this is the best way to solve the problem.

The underlying problem, if I understand correctly, is that on Android, the user cannot write files into Navit's image directory (res/drawable). So people put extra images into /sdcard/navit , and to use them, they have to use the /sdcard/navit path every time they want to use one of the images in navit.xml.

Wouldn't it be a better solution to have an image search path? Navit already automatically searches images in res/drawable (Android) or $NAVIT_SHAREDIR/xpm (other platforms). We could just define an additional "user image directory" - probably ~/.navit/xpm on Linux, /sdcard/navit/xpm on Android etc.

Then Navit would search for images in both folders. Main advantage is that you can use image names without any path, and Navit just figures out where the image is. This is also nice if images become popular and are accepted into Navit's SVN repo - they will change directory, but Navit still finds them under the same name.

Would that solve the problem you are addressing?

Changed 6 years ago by sleske

Updated patch for rev. 5196

comment:2 Changed 6 years ago by sleske

  • Cc sebastian.leske@… added

comment:3 Changed 6 years ago by usul

  • Keywords xml customization added
  • Milestone changed from version 0.5.0 to version 0.6.0

So this is not about $NAVIT_SHAREDIR isn't it?

We are currently working on splitting up the XML file into smaller .XML files and to introduce the ability to inherite and to overwrite elements with new files: https://forum.navit-project.org/viewtopic.php?f=19&t=400
Because this is a bigger change, I schedule this ticket for the next major release, too.

Maybe you can give us more details on your specific usecase?

Note: See TracTickets for help on using tickets.