]> source.dussan.org Git - gitblit.git/commitdiff
Improving first-run setup of GCA and Gitblit GO
authorJames Moger <james.moger@gitblit.com>
Wed, 5 Dec 2012 22:39:11 +0000 (17:39 -0500)
committerJames Moger <james.moger@gitblit.com>
Wed, 5 Dec 2012 22:39:11 +0000 (17:39 -0500)
src/com/gitblit/authority/GitblitAuthority.java
src/com/gitblit/wicket/GitBlitWebApp.properties

index 59cd22e39492b7080e9bf3fd3a8a492522c265aa..909831fe9cf71f09fbb9b81d0dc53131fc8a2ac7 100644 (file)
@@ -21,6 +21,7 @@ import java.awt.Desktop;
 import java.awt.Dimension;\r
 import java.awt.EventQueue;\r
 import java.awt.FlowLayout;\r
+import java.awt.GridLayout;\r
 import java.awt.Insets;\r
 import java.awt.Point;\r
 import java.awt.event.ActionEvent;\r
@@ -69,6 +70,7 @@ import javax.swing.JSplitPane;
 import javax.swing.JTable;\r
 import javax.swing.JTextArea;\r
 import javax.swing.JTextField;\r
+import javax.swing.JToolBar;\r
 import javax.swing.RowFilter;\r
 import javax.swing.SwingConstants;\r
 import javax.swing.UIManager;\r
@@ -565,15 +567,26 @@ public class GitblitAuthority extends JFrame implements X509Log {
                                        }\r
                                };\r
 \r
-                               JTextField durationTF = new JTextField(4);\r
-                               durationTF.setInputVerifier(verifier);\r
-                               durationTF.setVerifyInputWhenFocusTarget(true);\r
-                               durationTF.setText("" + certificateConfig.duration);\r
-                               JPanel durationPanel = Utils.newFieldPanel(Translation.get("gb.duration"), durationTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());\r
+                               JTextField siteNameTF = new JTextField(20);\r
+                               siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));\r
+                               JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"),\r
+                                               siteNameTF, Translation.get("gb.siteNameDescription"));\r
+\r
+                               JTextField validityTF = new JTextField(4);\r
+                               validityTF.setInputVerifier(verifier);\r
+                               validityTF.setVerifyInputWhenFocusTarget(true);\r
+                               validityTF.setText("" + certificateConfig.duration);\r
+                               JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"),\r
+                                               validityTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());\r
+                               \r
+                               JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));\r
+                               p1.add(siteNamePanel);\r
+                               p1.add(validityPanel);\r
+                               \r
                                DefaultOidsPanel oids = new DefaultOidsPanel(metadata);\r
 \r
                                JPanel panel = new JPanel(new BorderLayout());\r
-                               panel.add(durationPanel, BorderLayout.NORTH);\r
+                               panel.add(p1, BorderLayout.NORTH);\r
                                panel.add(oids, BorderLayout.CENTER);\r
 \r
                                int result = JOptionPane.showConfirmDialog(GitblitAuthority.this, \r
@@ -582,9 +595,13 @@ public class GitblitAuthority extends JFrame implements X509Log {
                                if (result == JOptionPane.OK_OPTION) {\r
                                        try {\r
                                                oids.update(metadata);\r
-                                               certificateConfig.duration = Integer.parseInt(durationTF.getText());\r
+                                               certificateConfig.duration = Integer.parseInt(validityTF.getText());\r
                                                certificateConfig.store(config, metadata);\r
                                                config.save();\r
+                                               \r
+                                               Map<String, String> updates = new HashMap<String, String>();\r
+                                               updates.put(Keys.web.siteName, siteNameTF.getText());\r
+                                               gitblitSettings.saveSettings(updates);\r
                                        } catch (Exception e1) {\r
                                                Utils.showException(GitblitAuthority.this, e1);\r
                                        }\r
@@ -728,7 +745,8 @@ public class GitblitAuthority extends JFrame implements X509Log {
                        }\r
                });\r
                \r
-               JPanel buttonControls = new JPanel(new FlowLayout(FlowLayout.LEFT, Utils.MARGIN, Utils.MARGIN));\r
+               JToolBar buttonControls = new JToolBar(JToolBar.HORIZONTAL);\r
+               buttonControls.setFloatable(false);\r
                buttonControls.add(certificateDefaultsButton);\r
                buttonControls.add(newSSLCertificate);\r
                buttonControls.add(emailBundle);\r
index 4f4d60e026983c5f770627467727793f8c00f648..5b42a2c0b6f2f5b566bc4fe28d1913b39e4d87e5 100644 (file)
@@ -436,4 +436,7 @@ gb.maxActivityCommitsDescription = maximum number of commits to contribute to th
 gb.noMaximum = no maximum\r
 gb.attributes = attributes\r
 gb.serveCertificate = serve https with this certificate\r
-gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''.
\ No newline at end of file
+gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''.\r
+gb.validity = validity\r
+gb.siteName = site name\r
+gb.siteNameDescription = short, descriptive name of your server 
\ No newline at end of file