From: James Moger Date: Thu, 10 Nov 2011 13:10:19 +0000 (-0500) Subject: Refresh log on display. Adjusted spacing of status panel. X-Git-Tag: v0.7.0~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a568f2ac97f4c7b73ee0cdf2007f553bb8c81c2c;p=gitblit.git Refresh log on display. Adjusted spacing of status panel. --- 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);