Show clients' country flags beside their names, and optionally in the tree
The server places each client in a country (client_country, from its GeoIP database); a client's details now show that country's flag left of their name, as TeamSpeak's info frame does, on both clients. "Show country flags in the channel tree" (off by default, as TeamSpeak's EnableCountryFlags) also puts it last on client rows. The flags are TeamSpeak's countries.zip, which now ships with the icon packs; core's CountryFlags reads it, else a TeamSpeak 3 install's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.DefaultListModel;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFileChooser;
|
||||
@@ -59,6 +60,7 @@ final class DesignPanel extends JPanel {
|
||||
private final JComboBox<Object> packCombo = new JComboBox<>();
|
||||
private final JLabel packInfo = new JLabel();
|
||||
private final JTextField packDirField;
|
||||
private final JCheckBox countryFlags = new JCheckBox("Show country flags in the channel tree");
|
||||
private final DefaultListModel<String> previewModel = new DefaultListModel<>();
|
||||
private final JList<String> preview = new JList<>(previewModel);
|
||||
|
||||
@@ -84,6 +86,7 @@ final class DesignPanel extends JPanel {
|
||||
settings.iconPackDir = packDirField.getText().trim();
|
||||
Object selected = packCombo.getSelectedItem();
|
||||
settings.iconPack = selected instanceof IconPack pack ? pack.id() : "";
|
||||
settings.countryFlags = countryFlags.isSelected();
|
||||
}
|
||||
|
||||
/** Puts back the appearance and pack the dialog started with, for a cancelled edit. */
|
||||
@@ -149,7 +152,12 @@ final class DesignPanel extends JPanel {
|
||||
dirRow.add(packDirField, BorderLayout.CENTER);
|
||||
dirRow.add(browse, BorderLayout.EAST);
|
||||
packDirField.setToolTipText("Extra folder to look for icon packs in");
|
||||
addRow(p, c, row, new JLabel("Extra pack folder:"), dirRow);
|
||||
addRow(p, c, row++, new JLabel("Extra pack folder:"), dirRow);
|
||||
|
||||
countryFlags.setSelected(settings.countryFlags);
|
||||
c.gridx = 1;
|
||||
c.gridy = row;
|
||||
p.add(countryFlags, c);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user