From f6268987ba5b548adf348d02b59845bd67956f1e Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Mon, 23 Oct 2006 14:25:38 +0000 Subject: [PATCH] "all" added in the "call list" search combo box --- .../impl/gui/customcontrols/SmartComboBox.java | 7 +++++-- .../impl/gui/i18n/messages.properties | 3 ++- .../impl/gui/main/call/CallListPanel.java | 18 +++++++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SmartComboBox.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SmartComboBox.java index 7a1d1cf88..9445cc4a1 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SmartComboBox.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SmartComboBox.java @@ -34,7 +34,7 @@ public SmartComboBox() setEditable(true); setFocusable(true); } - + /** * The data model used for this combo box. Filters the contents of the * combo box popup according to the user input. @@ -79,7 +79,10 @@ public void removeElementAt(int index) updateFilteredItems(); } - public void insertElementAt( Object obj, int index ) {} + public void insertElementAt( Object obj, int index ) { + items.add(index, obj); + updateFilteredItems(); + } public void setFilter(Filter filter) { diff --git a/src/net/java/sip/communicator/impl/gui/i18n/messages.properties b/src/net/java/sip/communicator/impl/gui/i18n/messages.properties index ccbff8363..87d6bada3 100644 --- a/src/net/java/sip/communicator/impl/gui/i18n/messages.properties +++ b/src/net/java/sip/communicator/impl/gui/i18n/messages.properties @@ -16,6 +16,7 @@ addGroupError=Failed to add group with name: ?. addGroupErrorTitle=Add group Error addGroupExistError=The group you're trying to create already exists in your contact list. addSubcontact=Add subcontact +all=All allContacts=All contacts alwaysOnTop=Always on top appearance=Appearance @@ -116,9 +117,9 @@ openInBrowser=Open in browser passwd=Password: paste=Paste previous=Previous -providerNotConnected=You must be connected to be able to communicate. print=Print protocol=Protocol +providerNotConnected=You must be connected to be able to communicate. quit=Quit ready=Ready reconnectionLimitExceeded=You have have been disconnecting and reconnecting to the server too fast. ? account is temporarily banned and would have to wait a bit before trying to login again. diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java index 66b482483..4442f787f 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java @@ -147,9 +147,15 @@ private void addToSearchComboBox(Object obj) FilterableComboBoxModel comboModel = (FilterableComboBoxModel)searchComboBox.getModel(); + String allItem = Messages.getString("all"); + + if(!comboModel.contains(allItem)) { + searchComboBox.addItem(allItem); + } if(!comboModel.contains(obj)) comboModel.addElement(obj); + } /** @@ -209,7 +215,17 @@ public void actionPerformed(ActionEvent e) this.callList.removeAll(); - new LoadParticipantCallsFromHistory(item).start(); + if(item.equals(Messages.getString("all"))) { + this.lastDateFromHistory = null; + + this.callList.removeAll(); + + new LoadLastCallsFromHistory().start(); + + filteredSearch = false; + } + else + new LoadParticipantCallsFromHistory(item).start(); filteredSearch = true; }