2011-09-27 14:24:55 -05:00
|
|
|
#!/usr/bin/env python3
|
2012-03-15 13:28:40 -05:00
|
|
|
# Copyright 2012 Hardcoded Software (http://www.hardcoded.net)
|
2010-10-05 03:22:02 -05:00
|
|
|
#
|
|
|
|
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
|
|
|
# which should be included with this package. The terms are also available at
|
|
|
|
# http://www.hardcoded.net/licenses/bsd_license
|
2010-10-04 08:42:38 -05:00
|
|
|
|
|
|
|
import sys
|
2011-11-30 10:06:08 -06:00
|
|
|
import os.path as op
|
2010-10-05 03:22:02 -05:00
|
|
|
|
2011-01-19 02:47:00 -06:00
|
|
|
from PyQt4.QtCore import QCoreApplication, QSettings
|
2010-10-05 03:22:02 -05:00
|
|
|
from PyQt4.QtGui import QApplication, QIcon, QPixmap
|
|
|
|
|
2011-09-22 08:32:09 -05:00
|
|
|
from hscommon.plat import ISWINDOWS
|
2011-11-03 09:25:15 -05:00
|
|
|
from hscommon.trans import install_gettext_trans_under_qt
|
2010-11-20 05:42:15 -06:00
|
|
|
from qtlib.error_report_dialog import install_excepthook
|
2012-08-07 11:37:17 -05:00
|
|
|
from qtlib.util import setupQtLogging
|
2010-10-05 03:22:02 -05:00
|
|
|
from qt.base import dg_rc
|
2011-11-30 11:13:02 -06:00
|
|
|
from qt.base.platform import BASE_PATH
|
2012-08-15 10:01:29 -05:00
|
|
|
from core_{edition} import __version__, __appname__
|
2010-10-05 03:22:02 -05:00
|
|
|
|
2011-09-22 08:32:09 -05:00
|
|
|
if ISWINDOWS:
|
2010-10-05 03:48:07 -05:00
|
|
|
import qt.base.cxfreeze_fix
|
2010-10-05 03:22:02 -05:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
app = QApplication(sys.argv)
|
2011-01-21 06:57:54 -06:00
|
|
|
QCoreApplication.setOrganizationName('Hardcoded Software')
|
|
|
|
QCoreApplication.setApplicationName(__appname__)
|
|
|
|
QCoreApplication.setApplicationVersion(__version__)
|
2012-08-07 11:37:17 -05:00
|
|
|
setupQtLogging()
|
2011-01-19 02:47:00 -06:00
|
|
|
settings = QSettings()
|
2012-03-16 13:07:29 -05:00
|
|
|
lang = settings.value('Language')
|
2011-11-30 11:13:02 -06:00
|
|
|
locale_folder = op.join(BASE_PATH, 'locale')
|
2011-11-30 10:06:08 -06:00
|
|
|
install_gettext_trans_under_qt(locale_folder, lang)
|
2011-01-19 02:47:00 -06:00
|
|
|
# Many strings are translated at import time, so this is why we only import after the translator
|
|
|
|
# has been installed
|
2012-08-15 10:01:29 -05:00
|
|
|
from qt.{edition}.app import DupeGuru
|
2010-10-05 03:22:02 -05:00
|
|
|
app.setWindowIcon(QIcon(QPixmap(":/{0}".format(DupeGuru.LOGO_NAME))))
|
|
|
|
dgapp = DupeGuru()
|
2013-03-24 10:10:07 -05:00
|
|
|
if not ISWINDOWS:
|
|
|
|
dgapp.model.registered = True
|
2010-11-20 05:42:15 -06:00
|
|
|
install_excepthook()
|
2010-10-05 03:22:02 -05:00
|
|
|
sys.exit(app.exec_())
|