Fixed errors caused by preparing the merge into develop
This commit is contained in:
		@@ -170,7 +170,7 @@ public class ChatWindow extends JFrame {
 | 
			
		||||
		settingsButton.addActionListener((evt) -> {
 | 
			
		||||
			try {
 | 
			
		||||
				new SettingsScreen().setVisible(true);
 | 
			
		||||
				changeChatWindowColors(Settings.getInstance().getCurrentTheme());
 | 
			
		||||
				changeChatWindowColors(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()));
 | 
			
		||||
			} catch (Exception e) {
 | 
			
		||||
				logger.log(Level.WARNING, "An error occured while opening the settings screen", e);
 | 
			
		||||
				e.printStackTrace();
 | 
			
		||||
 
 | 
			
		||||
@@ -64,17 +64,10 @@ public class SettingsScreen extends JDialog {
 | 
			
		||||
 | 
			
		||||
	private static int	space			= 5;
 | 
			
		||||
 | 
			
		||||
	private Theme temporaryTheme;
 | 
			
		||||
	private Theme temporaryTheme, selectedTheme;
 | 
			
		||||
 | 
			
		||||
	private static final Logger logger = EnvoyLog.getLogger(SettingsScreen.class.getSimpleName());
 | 
			
		||||
 | 
			
		||||
	private static SettingsScreen settingsScreen;
 | 
			
		||||
 | 
			
		||||
	// TODO: Add a JPanel with all the Information necessary:
 | 
			
		||||
	// change (Picture,Username, Email, Password) and toggle(light/dark mode,
 | 
			
		||||
	// "ctrl+enter"/"enter"
 | 
			
		||||
	// to send a message directly)
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Builds the settings screen.
 | 
			
		||||
	 *
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@ package envoy.client.ui;
 | 
			
		||||
 | 
			
		||||
import java.awt.EventQueue;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.logging.Level;
 | 
			
		||||
import java.util.logging.Logger;
 | 
			
		||||
 | 
			
		||||
import javax.swing.JFrame;
 | 
			
		||||
@@ -10,9 +11,7 @@ import javax.swing.JOptionPane;
 | 
			
		||||
import envoy.client.Client;
 | 
			
		||||
import envoy.client.Config;
 | 
			
		||||
import envoy.client.LocalDB;
 | 
			
		||||
import envoy.client.Settings;
 | 
			
		||||
import envoy.client.util.EnvoyLog;
 | 
			
		||||
 | 
			
		||||
import envoy.exception.EnvoyException;
 | 
			
		||||
import envoy.schema.User;
 | 
			
		||||
 | 
			
		||||
@@ -81,8 +80,7 @@ public class Startup {
 | 
			
		||||
				// Try entering offline mode
 | 
			
		||||
				localDB.loadUsers();
 | 
			
		||||
				User clientUser = localDB.getUsers().get(userName);
 | 
			
		||||
				if(clientUser == null)
 | 
			
		||||
					throw new EnvoyException("Could not enter offline mode: user name unknown");
 | 
			
		||||
				if (clientUser == null) throw new EnvoyException("Could not enter offline mode: user name unknown");
 | 
			
		||||
				client.setSender(clientUser);
 | 
			
		||||
			} catch (Exception e2) {
 | 
			
		||||
				JOptionPane.showMessageDialog(null, e2.toString(), "Client error", JOptionPane.ERROR_MESSAGE);
 | 
			
		||||
@@ -109,8 +107,7 @@ public class Startup {
 | 
			
		||||
		logger.info("Client user ID: " + client.getSender().getID());
 | 
			
		||||
 | 
			
		||||
		// Save all users to the local database
 | 
			
		||||
		if(client.isOnline())
 | 
			
		||||
			localDB.setUsers(client.getUsers());
 | 
			
		||||
		if (client.isOnline()) localDB.setUsers(client.getUsers());
 | 
			
		||||
 | 
			
		||||
		EventQueue.invokeLater(() -> {
 | 
			
		||||
			try {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user