def initGui(self):
        utils.debug("initGui")
        """Create the menu entries and toolbar icons inside the QGIS GUI."""

        icon_path = ':/plugins/BioDispersal/icons/cerf.png'
        self.add_action(icon_path,
                        text=self.tr(u'BioDispersal'),
                        callback=self.run,
                        parent=self.iface.mainWindow())

        self.iface.mainWindow()

        self.dlg.initTabs()
        self.dlg.initGui()
        locale = QSettings().value('locale/userLocale')[0:2]
        if locale.startswith('fr'):
            self.dlg.switchLangFr()
        else:
            self.dlg.switchLangEn()
        self.connectComponents()
示例#2
0
import os
from PyQt5.QtCore import QSettings


def classFactory(iface):
    from .batch_gps_importer import BatchGpsImporter
    return BatchGpsImporter(iface)


from os.path import expanduser
HOME = expanduser("~")
LOCALE = QSettings().value("locale/userLocale")[0:2]
PLUGIN_FOLDER = 'batch_gps_importer'
PLUGIN_DIR = os.path.dirname(os.path.realpath(__file__))

if LOCALE.startswith('en_'):
    LOCALE = 'en'
DYNAMIC_HELP = '{}/help/dynamic/{}'.format(PLUGIN_DIR, LOCALE)
STATIC_HELP = '{}/help/html/{}'.format(PLUGIN_DIR, LOCALE)
EN_HELP = '{}/help/html/en'.format(PLUGIN_DIR)