diff --git a/gui/src/main/groovy/com/muwire/gui/contacts/ContactChooser.groovy b/gui/src/main/groovy/com/muwire/gui/contacts/ContactChooser.groovy index b7a182cf..8c3bdfab 100644 --- a/gui/src/main/groovy/com/muwire/gui/contacts/ContactChooser.groovy +++ b/gui/src/main/groovy/com/muwire/gui/contacts/ContactChooser.groovy @@ -9,8 +9,10 @@ import javax.swing.JTextField class ContactChooser extends JComboBox{ private final ContactChooserEditor chooserEditor + private final ContactChooserModel chooserModel ContactChooser(UISettings settings, ContactChooserModel model) { setModel(model) + this.chooserModel = model chooserEditor = new ContactChooserEditor(model, this, settings) setEditor(chooserEditor) setRenderer(new PersonaOrProfileListCellRenderer(settings)) @@ -22,6 +24,13 @@ class ContactChooser extends JComboBox{ } Set getSelectedPOPs() { - chooserEditor.textPane.getSelectedPOPs() + Set rv = chooserEditor.textPane.getSelectedPOPs() + def lastPOP = chooserEditor.getItem() + if (lastPOP == null) + return rv + lastPOP = chooserModel.findByName(lastPOP.toString()) + if (lastPOP != null) + rv << lastPOP + rv } }