def importClicked(self):
        if self.repo is None:
            connector = PyQtConnectorDecorator()
            connector.checkIsAlive()
            self.repo = Repository(self.repos[self.repoCombo.currentText()], connector)
        if self.layer is None:
            text = self.layerCombo.currentText()
            self.layer = resolveLayer(text)

        source = self.layer.source()
        hasIdField = self.layer.dataProvider().fieldNameIndex("geogigid") != -1

        if not hasIdField:
            autoAddId = config.getConfigValue(config.GENERAL, config.AUTO_ADD_ID)
            if not autoAddId:
                dlg = AddGeogigIdDialog(self)
                ok, check = dlg.exec_()
                if ok == QtGui.QMessageBox.No:
                    self.close()
                    return
                if check:
                    config.setConfigValue(config.GENERAL, config.AUTO_ADD_ID, True)

            QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
            addIdField(self.layer)
            QtGui.QApplication.restoreOverrideCursor()
            hasIdField = self.layer.dataProvider().fieldNameIndex("geogigid") != -1
            if not hasIdField:
                QtGui.QMessageBox.warning(self, "Error",
                            "Could not add 'geogigid' field to layer.\n"
                            "Possible causes for this are:\n"
                            "- No permission to edit the layer.\n",
                            QtGui.QMessageBox.Ok, QtGui.QMessageBox.Ok)
                return

        self.repo.importshp(source, False, self.layer.name(), "geogigid", True)
        message = self.messageBox.toPlainText()
        self.repo.add()
        try:
            self.repo.commit(message)
        except UnconfiguredUserException, e:
            configdlg = UserConfigDialog(config.iface.mainWindow())
            configdlg.exec_()
            if configdlg.user is not None:
                self.repo.config(geogig.USER_NAME, configdlg.user)
                self.repo.config(geogig.USER_EMAIL, configdlg.email)
                self.repo.commit(message)
            else:
                return
def getUserInfo():
    """Return user information from the settings dialog"""
    user = pluginSetting(USERNAME).strip()
    email = pluginSetting(EMAIL).strip()
    if not (user and email):
        configdlg = UserConfigDialog(iface.mainWindow())
        configdlg.exec_()
        if configdlg.user is not None:
            user = configdlg.user
            email = configdlg.email
            setPluginSetting(USERNAME, user)
            setPluginSetting(EMAIL, email)
            return user, email
        else:
            return None, None
    return user, email
def getUserInfo():
    """Return user information from the settings dialog"""
    user = getConfigValue(GENERAL, USERNAME).strip()
    email = getConfigValue(GENERAL, EMAIL).strip()
    if not (user and email):
        configdlg = UserConfigDialog(iface.mainWindow())
        configdlg.exec_()
        if configdlg.user is not None:
            user = configdlg.user
            email = configdlg.email
            setConfigValue(GENERAL, USERNAME, user)
            setConfigValue(GENERAL, EMAIL, email)
            return user, email
        else:
            return None, None
    return user, email
        else:
            self.doUpdateLayer(trackedlayer.layername, repo)
        unstaged = repo.difftreestats(geogig.HEAD, geogig.WORK_HEAD)
        total = 0
        for counts in unstaged.values():
            total += sum(counts)
        if total == 0:
            return
            #TODO: maybe show message dialog?
        dlg = CommitDialog(repo, iface.mainWindow())
        dlg.exec_()
        try:
            repo.addandcommit(dlg.getMessage())
        except UnconfiguredUserException, e:
            #It should not raise this exception unless config file has been manually deleted
            configdlg = UserConfigDialog(iface.mainWindow())
            configdlg.exec_()
            if configdlg.user is not None:
                repo.config(geogig.USER_NAME, configdlg.user)
                repo.config(geogig.USER_EMAIL, configdlg.email)
                repo.commit(dlg.getMessage())
            else:
                return
        headid = repo.revparse(geogig.HEAD)
        setRef(self.layer, headid)
        iface.messageBar().pushMessage("Repository correctly updated",
                                                  level = QgsMessageBar.INFO, duration = 4)
        setInSync(self.layer, True)


    def _getFid(self, feature):