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', 'projectsldplugin_{}.qm'.format(locale)) if os.path.exists(localePath): self.translator = QTranslator() self.translator.load(localePath) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) self.SETTINGS_SECTION = '/projectsldplugin/' self.filename = self.getSettingsValue('lastfile') # Create the dialog (after translation) and keep reference self.dlg = ProjectSldPluginDialog() self.dlg.ui.cbx_save_as_file.toggled.connect(self.saveAsFileToggled) self.dlg.ui.cbx_post_to_server.toggled.connect( self.postToServerToggled) self.dlg.ui.btn_filename.clicked.connect(self.filenameButtonClicked)