Skip to content
Snippets Groups Projects
Commit 1b4ebf91 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Improve search result dialog

parent 7c78ed84
Branches
Tags
No related merge requests found
...@@ -239,7 +239,8 @@ public class Strings { ...@@ -239,7 +239,8 @@ public class Strings {
// Search // Search
public static final String SEARCH_BUTTON = "Search.Button"; public static final String SEARCH_BUTTON = "Search.Button";
public static final String SEARCH_PLACEHOLDER = "Search.Placeholder"; public static final String SEARCH_PLACEHOLDER = "Search.Placeholder";
public static final String SEARCH_ALERT_NO_MATCHES = "Search.Alert.NoMatches"; public static final String SEARCH_ALERT_NO_MATCHES_HEADER = "Search.Alert.NoMatches.Header";
public static final String SEARCH_ALERT_NO_MATCHES_CONTENT = "Search.Alert.NoMatches.Content";
// UI - Dialog - Page - Delete // UI - Dialog - Page - Delete
public static final String UI_DIALOG_PAGE_DELETE_HEADER = "UI.Dialog.Page.Delete.Header"; public static final String UI_DIALOG_PAGE_DELETE_HEADER = "UI.Dialog.Page.Delete.Header";
......
package de.tobias.playpad.layout.desktop.listener; package de.tobias.playpad.layout.desktop.listener;
import de.thecodelabs.utils.application.ApplicationUtils;
import de.thecodelabs.utils.ui.Alerts;
import de.thecodelabs.utils.util.Localization; import de.thecodelabs.utils.util.Localization;
import de.tobias.playpad.Strings; import de.tobias.playpad.Strings;
import de.tobias.playpad.pad.Pad; import de.tobias.playpad.pad.Pad;
...@@ -7,6 +9,7 @@ import de.tobias.playpad.project.Project; ...@@ -7,6 +9,7 @@ import de.tobias.playpad.project.Project;
import de.tobias.playpad.viewcontroller.main.IMainViewController; import de.tobias.playpad.viewcontroller.main.IMainViewController;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.event.EventHandler; import javafx.event.EventHandler;
import javafx.scene.control.Alert;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import java.util.List; import java.util.List;
...@@ -47,7 +50,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> { ...@@ -47,7 +50,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> {
} }
if (searchResult.isEmpty()) { if (searchResult.isEmpty()) {
mainView.showInfoMessage(Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES)); Alerts.getInstance().createAlert(
Alert.AlertType.INFORMATION, ApplicationUtils.getApplication().getInfo().getName(),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_HEADER),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_CONTENT, currentSearchTerm),
mainView.getStage()
).showAndWait();
return; return;
} }
...@@ -58,7 +66,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> { ...@@ -58,7 +66,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> {
result.getController().getView().highlightView(HIGHLIGHT_DURATION); result.getController().getView().highlightView(HIGHLIGHT_DURATION);
} }
} else { } else {
mainView.showInfoMessage(Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES)); Alerts.getInstance().createAlert(
Alert.AlertType.INFORMATION, ApplicationUtils.getApplication().getInfo().getName(),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_HEADER),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_CONTENT, currentSearchTerm),
mainView.getStage()
).showAndWait();
currentIndex = 0; currentIndex = 0;
} }
} }
......
...@@ -218,10 +218,13 @@ DnDMode.Move=Tauschen ...@@ -218,10 +218,13 @@ DnDMode.Move=Tauschen
# Main Layout # Main Layout
MainLayout.Desktop=Desktopmodus MainLayout.Desktop=Desktopmodus
MainLayout.Touch=Touchmodus MainLayout.Touch=Touchmodus
# Suche # Suche
Search.Button=Suchen Search.Button=Suchen
Search.Placeholder=Suche Search.Placeholder=Suche
Search.Alert.NoMatches=Keine Treffer gefunden. Search.Alert.NoMatches.Header=Kachelsuche
Search.Alert.NoMatches.Content=Keine weiteren Treffer zu '{}' gefunden.
# UI - Dialog - Page - Delete # UI - Dialog - Page - Delete
UI.Dialog.Page.Delete.Header=Seite l\u00F6schen UI.Dialog.Page.Delete.Header=Seite l\u00F6schen
UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen? UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment