#!/usr/bin/env python3
#
#  gpxviewer - Launcher File
#
#  Copyright (C) 2009 Andrew Gee
#
#  GPX Viewer 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 3 of the License, or
#  (at your option) any later version.
#  
#  GPX Viewer 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, see <http://www.gnu.org/licenses/>.

#
#  If you're having any problems, don't hesitate to contact: andrew@andrewgee.org
#

import os.path, sys
import gpxviewer
sys.path.append(gpxviewer.__path__[0])

import gi
gi.require_version('Gdk', '3.0')

from gi.repository import Gdk
from gpxviewer.ui import MainWindow

POSSIBLE_SHARE_DIRS = ["/usr/local/share/gpxviewer/","/usr/share/gpxviewer/"]

prefix = ""
for share_dir in POSSIBLE_SHARE_DIRS:
	if os.path.exists(share_dir):
		prefix = share_dir

files = sys.argv[1:]

gui = MainWindow(ui_dir="%sui/" % prefix,files=files).main()
