added newline at EOF for any file not having one at its end

This commit is contained in:
delvh 2020-03-14 19:59:37 +01:00
parent b46bfd1181
commit 99441b770f
15 changed files with 36 additions and 46 deletions

View File

@ -28,7 +28,7 @@
<dependency>
<groupId>com.github.informatik-ag-ngl</groupId>
<artifactId>envoy-common</artifactId>
<version>develop-SNAPSHOT</version>
<version>f~forwarding_messages-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -61,15 +61,13 @@ public class Chat implements Serializable {
public void read(WriteProxy writeProxy) throws IOException {
for (int i = model.size() - 1; i >= 0; --i) {
final Message m = model.get(i);
if (m.getSenderId() == recipient.getId()) {
if (m.getStatus() == MessageStatus.READ) break;
if (m.getSenderId() == recipient.getId()) if (m.getStatus() == MessageStatus.READ) break;
else {
m.setStatus(MessageStatus.READ);
writeProxy.writeMessageStatusChangeEvent(new MessageStatusChangeEvent(m));
}
}
}
}
/**
* @return {@code true} if the newest message received in the chat doesn't have

View File

@ -127,11 +127,9 @@ public class Startup {
// Save all users to the local database and flush cache
localDb.setUsers(client.getUsers());
writeProxy.flushCache();
} else {
} else
// Set all contacts to offline mode
localDb.getUsers().values().stream().filter(u -> u != localDb.getUser()).forEach(u -> u.setStatus(UserStatus.OFFLINE));
}
// Display ChatWindow and StatusTrayIcon
EventQueue.invokeLater(() -> {

View File

@ -43,9 +43,11 @@ public class NewThemeScreen extends JDialog {
* There are two versions of this Window. The first one is responsible for
* choosing the name, the second one appears, if the name already exists.
*
* @param parent the dialog is launched with its location relative to this {@link SettingsScreen}
* @param parent the dialog is launched with its location relative to
* this {@link SettingsScreen}
* @param newThemeAction is executed when a new theme name is entered
* @param modifyThemeAction is executed when an existing theme name is entered and confirmed
* @param modifyThemeAction is executed when an existing theme name is entered
* and confirmed
* @since Envoy v0.3-alpha
*/
public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) {

View File

@ -2,8 +2,6 @@ package envoy.client.ui.settings;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -100,17 +98,13 @@ public class ThemeCustomizationPanel extends SettingsPanel {
colorsPanel.setBackground(theme.getCellColor());
// Apply theme upon selection
themes.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
themes.addItemListener(e -> {
String selectedValue = (String) themes.getSelectedItem();
logger.log(Level.FINEST, "Selected theme: " + selectedValue);
final Theme currentTheme = Settings.getInstance().getTheme(selectedValue);
Settings.getInstance().setCurrentTheme(selectedValue);
EventBus.getInstance().dispatch(new ThemeChangeEvent(currentTheme));
}
});
// Apply current theme
@ -143,11 +137,9 @@ public class ThemeCustomizationPanel extends SettingsPanel {
}, name -> {
// Modify theme
Settings.getInstance().getThemes().replace(name, new Theme(name, temporaryTheme));
if (themes.getSelectedItem().equals(name)) {
if (themes.getSelectedItem().equals(name))
EventBus.getInstance().dispatch(new ThemeChangeEvent(Settings.getInstance().getTheme(name)));
} else {
themes.setSelectedItem(name);
}
else themes.setSelectedItem(name);
}).setVisible(true);
themeChanged = false;
}