feat: add option to search on System config string with "s:"
This commit is contained in:
parent
3dcdb28808
commit
353c49ae28
2
pom.xml
2
pom.xml
|
@ -2,7 +2,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>se.lantz</groupId>
|
||||
<artifactId>PCUAEManager</artifactId>
|
||||
<version>2.12.1</version>
|
||||
<version>2.12.2</version>
|
||||
<name>PCUAEManager</name>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
|
||||
|
|
|
@ -316,7 +316,7 @@ public class DbConnector
|
|||
//Construct SQL
|
||||
StringBuilder sqlBuilder = new StringBuilder();
|
||||
sqlBuilder
|
||||
.append("SELECT title, composer, year, author, gamefile, rowid, favorite, viewtag, disk2, disk3, disk4, disk5, disk6 FROM gameinfo ");
|
||||
.append("SELECT title, composer, year, author, gamefile, rowid, favorite, viewtag, system, disk2, disk3, disk4, disk5, disk6 FROM gameinfo ");
|
||||
sqlBuilder.append(view.getSqlQuery());
|
||||
sqlBuilder.append(" ORDER BY title COLLATE NOCASE ASC");
|
||||
|
||||
|
@ -339,6 +339,7 @@ public class DbConnector
|
|||
data.setAuthor(rs.getString("Author"));
|
||||
data.setYear(rs.getInt("Year"));
|
||||
data.setViewTag(rs.getString("Viewtag"));
|
||||
data.setSystem(rs.getString("System"));
|
||||
|
||||
if (data.isInfoSlot() && !viewTag.equalsIgnoreCase("GIS:" + view.getGameViewId()))
|
||||
{
|
||||
|
|
|
@ -217,7 +217,7 @@ public class ListPanel extends JPanel
|
|||
filterTextField = new JXSearchField();
|
||||
filterTextField.getDocument().addDocumentListener(filterTextFieldListener);
|
||||
String tooltipText =
|
||||
"<html>Type to search on game title in<br>the current gamelist view.<p><br>Special tags:<br><b>a:</b> - match Author<br><b>c:</b> - match Composer<br><b>y:</b> - match Year<br><b>v:</b> - match View tag<p>Use ',' as separator<br>to match several tags.<p><br>Example: <i>a:imagine,c:martin galway</i></html>";
|
||||
"<html>Type to search on game title in<br>the current gamelist view.<p><br><u>Special tags</u><br><b>a:</b> - match Author<br><b>c:</b> - match Composer<br><b>y:</b> - match Year<br><b>v:</b> - match View tag<br><b>s:</b> - match System config<p><br>Use ',' as separator to<br>match several tags.<p>Example: <i>a:imagine,c:martin galway</i><br></html>";
|
||||
filterTextField.setToolTipText(tooltipText);
|
||||
}
|
||||
return filterTextField;
|
||||
|
|
|
@ -61,6 +61,11 @@ public class GameListModel extends DefaultListModel<GameListData>
|
|||
String viewTag = filterText.substring(2);
|
||||
found = data.getViewTag().toLowerCase().contains(viewTag);
|
||||
}
|
||||
else if (filterText.startsWith("s:"))
|
||||
{
|
||||
String systemConfig = filterText.substring(2);
|
||||
found = data.getSystem().toLowerCase().contains(systemConfig);
|
||||
}
|
||||
else
|
||||
{
|
||||
found = data.getTitle().toLowerCase().contains(filterText);
|
||||
|
|
|
@ -13,6 +13,7 @@ public class GameListData implements Comparable
|
|||
private String author = "";
|
||||
private int year = 0;
|
||||
private String viewTag = "";
|
||||
private String system = "";
|
||||
|
||||
public GameListData(String title, String gameFileName, String gameId, int favorite, boolean infoSlot)
|
||||
{
|
||||
|
@ -182,4 +183,14 @@ public class GameListData implements Comparable
|
|||
{
|
||||
this.viewTag = viewTag;
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return system;
|
||||
}
|
||||
|
||||
public void setSystem(String system)
|
||||
{
|
||||
this.system = system;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue