def change_mode(self):
        mode = ModeDialog.change_mode(self._neo, self)

        if mode is not None:
            try:
                self._neo.set_mode(mode)
            except ModeSwitchError:
                QtGui.QMessageBox.critical(self, m.mode_error,
                                           m.mode_error_desc)
                return

            self._mode_btn.setText(m.change_mode_1 % MODE.name_for_mode(mode))

            remove_dialog = QtGui.QMessageBox(self)
            remove_dialog.setWindowTitle(m.change_mode)
            remove_dialog.setIcon(QtGui.QMessageBox.Information)
            remove_dialog.setText(m.remove_device)
            remove_dialog.setStandardButtons(QtGui.QMessageBox.NoButton)
            self._neo.removed.connect(remove_dialog.accept)
            remove_dialog.exec_()
dataset/ETHPy150Open Yubico/yubikey-neo-manager/neoman/view/neo.py/SettingsTab.change_mode/original