#!/usr/bin/python3

#  This file is part of gkraken.
#
#  Copyright (c) 2021 Roberto Leinardi and Guy Boldon
#
#  gkraken 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.
#
#  gkraken 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 gkraken.  If not, see <http://www.gnu.org/licenses/>.

import signal
from pathlib import Path

PKGDATA_DIR = Path(__file__).parent.parent / './build/output/install/share/gkraken'
localedir = Path(__file__).parent.parent / './build/output/install/share/locale'

signal.signal(signal.SIGINT, signal.SIG_DFL)

# gettext.install('trg', localedir)

if __name__ == '__main__':
    import gi

    gi.require_version('Gtk', '3.0')
    gi.require_version('Gdk', '3.0')
    gi.require_version('Notify', '0.7')

    from gi.repository import Gio

    resource = Gio.Resource.load(str(PKGDATA_DIR / 'com.leinardi.gkraken.gresource'))
    resource._register()

    from gkraken import __main__

    __main__.main()
