@Override
	public void saveSettings(HashMap<String, String> settingsToSave) {
		Set<String> keys = settingsToSave.keySet();
		Iterator<String> keysIterator = keys.iterator();
		String key;
		while(keysIterator.hasNext()) {
			key = keysIterator.next();

			if(key.equals("minimizeToTray")) {
				System.out.println("minimizeToTray");
				Boolean minimizeToTray = Boolean.parseBoolean(settings.getProperty("minimizeToTray")); 
				Boolean minimizeToTrayNew = Boolean.parseBoolean(settingsToSave.get(key));
				System.out.println("minimizeToTray: " + minimizeToTray);
				System.out.println("minimizeToTrayNew: " + minimizeToTrayNew);
				if(minimizeToTray != minimizeToTrayNew) {
					if(minimizeToTrayNew) {
						addIconToTrayBar();
					} else {
						removeIconFromTrayBar();
					}				
				}
			}
			
			if(key.equals("name")) {
				String name = settings.getProperty("name");
				String nameNew = settingsToSave.get(key);
				if(!name.equals(nameNew)) {
					chatCore.changeMyName(nameNew);
				}
			}
			
			settings.setProperty(key, settingsToSave.get(key));
		}
		settings.saveSettings();	
	}