From 69dfd7184eb7b03d6ff00ec6f38787f77f4ac096 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 6 Dec 2006 14:16:34 +0000 Subject: [PATCH] init progress bar before making the query to the history --- .../main/message/history/HistoryWindow.java | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/message/history/HistoryWindow.java b/src/net/java/sip/communicator/impl/gui/main/message/history/HistoryWindow.java index 5cb290d95..e384472a6 100644 --- a/src/net/java/sip/communicator/impl/gui/main/message/history/HistoryWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/message/history/HistoryWindow.java @@ -136,7 +136,7 @@ public HistoryWindow(MainFrame mainFrame, MetaContact metaContact) this.initPanels(); - this.initData(); + this.initDates(); this.addWindowListener(new HistoryWindowAdapter()); } @@ -168,8 +168,9 @@ private void initPanels() * Initializes the history with a list of all dates, for which a history * with the given contact is availabled. */ - private void initData() - { + private void initDates() + { + this.initProgressBar(); new DatesLoader().start(); } @@ -179,7 +180,9 @@ private void initData() * @param endDate the end date of the period */ public void showHistoryByPeriod(Date startDate, Date endDate) - { + { + this.initProgressBar(); + if((searchKeyword == null || searchKeyword == "") && dateHistoryTable.containsKey(startDate)) { @@ -202,7 +205,9 @@ public void showHistoryByPeriod(Date startDate, Date endDate) * @param keyword the keyword to search */ public void showHistoryByKeyword(String keyword) - { + { + this.initProgressBar(); + chatConvPanel.clear(); datesPanel.setLastSelectedIndex(-1); @@ -322,14 +327,7 @@ public void progressChanged(ProgressEvent evt) if((lastProgress != progress) && evt.getStartDate() == null || evt.getStartDate() != ignoreProgressDate) { - - if(progressBar.getPercentComplete() == 0) { - this.mainPanel.remove(readyLabel); - this.mainPanel.add(progressBar, BorderLayout.SOUTH); - this.mainPanel.revalidate(); - this.mainPanel.repaint(); - } - + this.progressBar.setValue(progress); if(progressBar.getPercentComplete() == 1.0) { @@ -567,4 +565,13 @@ public void refreshHistory() { } + + private void initProgressBar() + { + this.mainPanel.remove(readyLabel); + this.mainPanel.add(progressBar, BorderLayout.SOUTH); + this.mainPanel.revalidate(); + this.mainPanel.repaint(); + + } }