void setPreferences(Preferences pref) {

		cacheCheckBox.setSelected(ConnectionManager.sharedInstance().isCachingAllowed());
		dayField.setValue(HistoryManager.sharedInstance().getDays());

		if (pref == null)
			return;

		connectTimeoutField.setValue(pref.getInt("Connect Timeout", 5));
		readTimeoutField.setValue(pref.getInt("Read Timeout", 30));

		String s = pref.get("Proxy Address", null);
		if (s != null) {
			int i = pref.getInt("Proxy Port", -1);
			if (i != -1) {
				setUseProxy(true);
				proxyPortField.setValue(i);
				proxyAddressField.setText(s);
				s = pref.get("Proxy Username", null);
				if (s != null)
					usernameField.setText(s);
				s = pref.get("Proxy Password", null);
				if (s != null)
					passwordField.setText(s);
			}
		}
		else {
			setUseProxy(false);
		}

		s = Initializer.sharedInstance().getSystemProperty(HOME_PAGE);
		setHome(s != null ? s : modeler.navigator.getHomePage());

		s = pref.get("Start From", null);
		if (s != null)
			setStartPageType(s);

	}