コード例 #1
0
    def __init__(self, iface):
        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value("locale/userLocale")[0:2]
        localePath = os.path.join(self.plugin_dir, 'i18n',
                                  'proportionalcircles_{}.qm'.format(locale))

        if os.path.exists(localePath):
            self.translator = QTranslator()
            self.translator.load(localePath)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)
        path = os.path.dirname(fTools.__file__)
        self.ftu = imp.load_source(
            'ftools_utils', os.path.join(path, 'tools', 'ftools_utils.py'))

        # Create the dialog (after translation) and keep reference
        self.dlg = ProportionalCirclesDialog()