### Copyright (C) 1995, 1996, 1997 Jeppe Buk (buk@imada.sdu.dk)
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

proc paths {} {
  # Search Paths
  
  Desc "On this page you set up the paths that FVWM should use to" \
      "search for icons and modules."
  ShortDesc "Search paths for icons and modules."

  ######################################################################
  # Paths
  #
  Header patH -text "Search Paths Configuration" -frame:relief flat
  Line icpL
  Label icpH -text "Directories to search for icons:"

  Dir-Browser icpB -text dir
  ExtEntry icp -entries { frame_icpB }

  Line mdpL
  Label mdpH -text "Directories to search for modules"

  Dir-Browser mdpB -text dir
  ExtEntry mdp -entries { frame_mdpB }

  set icpHelp [concat \
      "All icon names are specified relative to directories in this" \
      "path." ]

  Help icpH $icpHelp
  Help icpB $icpHelp
  Help com_icpB $icpHelp

  set mdpHelp "The path to search for external modules is entered here."
  Help mdpH $mdpHelp
  Help mdpB $mdpHelp
  Help com_mdpB $mdpHelp

  Save {
    set iconPath ""
    forevery icp {
      if {$icpB != ""} {
        if {$iconPath == ""} { set iconPath $icpB
        } else { append iconPath ":$icpB" }
      }
    }
    if {$iconPath != ""} {print "IconPath\t$iconPath"}
    if {$iconPath != ""} {print "PixmapPath\t$iconPath"}
    set modulePath ""
    forevery mdp {
      if {$mdpB != ""} {
        if {$modulePath == ""} { set modulePath $mdpB
        } else { append modulePath ":$mdpB" }
      }
    }
    if {$modulePath != ""} {print "ModulePath\t$modulePath"}
  }
  #
  ######################################################################
}
