void saveSettingsToAltimeter()
	{
		settingsDialog.enableButtons(false);
		new Thread(new Runnable() {
			public void run() {
				try {
					log("Writing settings to altimeter ...", "message");
					Settings settingsToWrite = settingsDialog.getSettings();
					altimeter.settings = settingsToWrite;
					altimeter.writeSettings();
					log("Done.", "message");
					log("Rebooting altimeter with new settings ...", "message");
					altimeter.disconnect();
					String comPort = window.getSelectedCOMPort();
					Controller.log("Connecting to serial port " + comPort + " (please wait) ...", "message");
					Controller.log(altimeter.connect(comPort, 57600), "altimeter");
					Controller.log("Reboot finished.", "message");
					Controller.log("Verifying settings ...", "message");
					loadSettingsFromAltimeter();
					if (!settingsToWrite.equals(altimeter.settings)) {
						log("Error verifying altimeter settings. Please try saving again.", "error");
						settingsDialog.enableButtons(true);
						return;
					}
				} catch (IOException e) {
					log("Unable to write settings to altimeter.", "error");
					e.printStackTrace();
					disconnect();
				} catch (NotAnOpenaltimeterException e) {
					log("Incorrect reply from device. Check that you've selected the correct serial port, and that " +
							"the openaltimeter is connected and powered.", "error");
					e.printStackTrace();
					disconnect();
				} catch (Exception e) {
					log("Exception opening serial port. Check your serial port settings.", "error");
					e.printStackTrace();
					disconnect();
				} finally {
					settingsDialog.enableButtons(true);
					settingsDialog.dispose();
				}
			}}).start();
	}