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