use of com.faforever.client.main.event.NavigationItem in project downlords-faf-client by FAForever.
the class MainController method onNavigateEvent.
@Subscribe
public void onNavigateEvent(NavigateEvent navigateEvent) {
NavigationItem item = navigateEvent.getItem();
AbstractViewController<?> controller = getView(item);
displayView(controller, navigateEvent);
mainNavigation.getToggles().stream().filter(toggle -> toggle.getUserData() == navigateEvent.getItem()).findFirst().ifPresent(toggle -> toggle.setSelected(true));
currentItem = item;
preferencesService.getPreferences().getMainWindow().setLastView(item.name());
preferencesService.storeInBackground();
}
use of com.faforever.client.main.event.NavigationItem in project downlords-faf-client by FAForever.
the class MainController method restoreLastView.
private void restoreLastView() {
final NavigationItem navigationItem;
if (preferencesService.getPreferences().getRememberLastTab()) {
final WindowPrefs mainWindowPrefs = preferencesService.getPreferences().getMainWindow();
navigationItem = Optional.ofNullable(NavigationItem.fromString(mainWindowPrefs.getLastView())).orElse(NavigationItem.NEWS);
} else {
navigationItem = NavigationItem.NEWS;
}
eventBus.post(new NavigateEvent(navigationItem));
}
Aggregations