From a568f2ac97f4c7b73ee0cdf2007f553bb8c81c2c Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 10 Nov 2011 08:10:19 -0500 Subject: [PATCH] Refresh log on display. Adjusted spacing of status panel. --- src/com/gitblit/client/SearchDialog.java | 25 ++++++++++++++---------- src/com/gitblit/client/StatusPanel.java | 6 +++--- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/com/gitblit/client/SearchDialog.java b/src/com/gitblit/client/SearchDialog.java index 0f25e9a0..88864a91 100644 --- a/src/com/gitblit/client/SearchDialog.java +++ b/src/com/gitblit/client/SearchDialog.java @@ -284,19 +284,23 @@ public class SearchDialog extends JFrame { contentPanel.add(controls, BorderLayout.SOUTH); setLayout(new BorderLayout()); add(contentPanel, BorderLayout.CENTER); - if (isSearch) { - addWindowListener(new WindowAdapter() { - @Override - public void windowOpened(WindowEvent event) { + addWindowListener(new WindowAdapter() { + @Override + public void windowOpened(WindowEvent event) { + if (isSearch) { searchFragment.requestFocus(); + } else { + search(0); } + } - @Override - public void windowActivated(WindowEvent event) { + @Override + public void windowActivated(WindowEvent event) { + if (isSearch) { searchFragment.requestFocus(); } - }); - } + } + }); } public void selectRepository(RepositoryModel repository) { @@ -363,8 +367,9 @@ public class SearchDialog extends JFrame { tableModel.entries.clear(); tableModel.entries.addAll(entries); tableModel.fireTableDataChanged(); - setTitle(Translation.get(isSearch ? "gb.search" : "gb.log") + ": " + text + " (" - + entries.size() + (page > 0 ? (", pg " + (page + 1)) : "") + ")"); + setTitle(Translation.get(isSearch ? "gb.search" : "gb.log") + + (StringUtils.isEmpty(text) ? "" : (": " + text)) + " (" + entries.size() + + (page > 0 ? (", pg " + (page + 1)) : "") + ")"); header.setText(getTitle()); if (pack) { Utils.packColumns(table, Utils.MARGIN); diff --git a/src/com/gitblit/client/StatusPanel.java b/src/com/gitblit/client/StatusPanel.java index 669aa47a..f22d69c8 100644 --- a/src/com/gitblit/client/StatusPanel.java +++ b/src/com/gitblit/client/StatusPanel.java @@ -106,15 +106,15 @@ public class StatusPanel extends JPanel { propertiesTable.setRowHeight(nameRenderer.getFont().getSize() + 8); propertiesTable.getColumn(name).setCellRenderer(nameRenderer); - JPanel centerPanel = new JPanel(new BorderLayout()); + JPanel centerPanel = new JPanel(new BorderLayout(Utils.MARGIN, Utils.MARGIN)); centerPanel.add(fieldsPanel, BorderLayout.NORTH); centerPanel.add(new JScrollPane(propertiesTable), BorderLayout.CENTER); - JPanel controls = new JPanel(); + JPanel controls = new JPanel(new FlowLayout(FlowLayout.CENTER, Utils.MARGIN, 0)); controls.add(refreshStatus); header = new HeaderPanel(Translation.get("gb.status"), "health_16x16.png"); - setLayout(new BorderLayout()); + setLayout(new BorderLayout(Utils.MARGIN, Utils.MARGIN)); add(header, BorderLayout.NORTH); add(centerPanel, BorderLayout.CENTER); add(controls, BorderLayout.SOUTH); -- 2.39.5