mirror of
https://github.com/cryptomator/cryptomator.git
synced 2024-11-23 03:59:51 +00:00
removed blank line, unused instance variable, import and Logger
refactored DateTimeFormatter into an instance variable
This commit is contained in:
parent
9ae2f4e0f6
commit
ff3306cc17
@ -168,7 +168,6 @@ public class Settings {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SettingsJson serialized() {
|
||||
|
@ -19,11 +19,7 @@ import javafx.concurrent.Worker;
|
||||
import javafx.concurrent.WorkerStateEvent;
|
||||
import javafx.util.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@FxApplicationScoped
|
||||
public class UpdateChecker {
|
||||
@ -37,7 +33,6 @@ public class UpdateChecker {
|
||||
private final ScheduledService<String> updateCheckerService;
|
||||
private final ObjectProperty<UpdateCheckState> state = new SimpleObjectProperty<>(UpdateCheckState.NOT_CHECKED);
|
||||
private final ObjectProperty<Instant> lastSuccessfulUpdateCheck = new SimpleObjectProperty<>();
|
||||
private final StringProperty timeDifferenceMessage = new SimpleStringProperty();
|
||||
private final Comparator<String> versionComparator = new SemVerComparator();
|
||||
private final BooleanBinding updateAvailable;
|
||||
|
||||
|
@ -49,6 +49,7 @@ public class UpdatesPreferencesController implements FxController {
|
||||
private final BooleanBinding updateAvailable;
|
||||
private final BooleanProperty upToDateLabelVisible = new SimpleBooleanProperty(false);
|
||||
private final ObjectProperty<UpdateChecker.UpdateCheckState> updateCheckState;
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
/* FXML */
|
||||
public CheckBox checkForUpdatesCheckbox;
|
||||
@ -69,6 +70,7 @@ public class UpdatesPreferencesController implements FxController {
|
||||
this.currentVersion = updateChecker.getCurrentVersion();
|
||||
this.updateAvailable = updateChecker.updateAvailableProperty();
|
||||
this.updateCheckState = updateChecker.updateCheckStateProperty();
|
||||
this.formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault());
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
@ -130,7 +132,6 @@ public class UpdatesPreferencesController implements FxController {
|
||||
public String getLastSuccessfulUpdateCheck() {
|
||||
Instant lastCheck = lastSuccessfulUpdateCheck.getValue();
|
||||
if (lastCheck != null && !lastCheck.equals(Settings.DEFAULT_LAST_SUCCESSFUL_UPDATE_CHECK)) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault());
|
||||
return formatter.format(LocalDateTime.ofInstant(lastCheck, ZoneId.systemDefault()));
|
||||
} else {
|
||||
return "-";
|
||||
|
@ -5,21 +5,16 @@ import dagger.Subcomponent;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlScene;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
|
||||
@UpdateReminderScoped
|
||||
@Subcomponent(modules = {UpdateReminderModule.class})
|
||||
public interface UpdateReminderComponent {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(UpdateReminderComponent.class);
|
||||
|
||||
@UpdateReminderWindow
|
||||
Stage window();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user