mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Updated BugzReporter -
- Fixed layout issues causing truncated labels. - Changed "Git rev" field to "SVN rev." field. - Added "Steps to Reproduce" field. - Check Summary and Description fields for valid data, Error Message Dialog if not. - Attempt to match Build Version with Mantis version list. - Populate SVN rev. field with revision if available. - If crash report, relabel "Additional Information" field as "Error Dump" and auto-select category "New Crash Report". - Fix log4j warning. - Fix close and Cancel buttons not terminating window.
This commit is contained in:
@@ -7,11 +7,10 @@ import javax.swing.JButton;
|
|||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import com.jgoodies.forms.layout.FormLayout;
|
|
||||||
import com.jgoodies.forms.layout.ColumnSpec;
|
|
||||||
import com.jgoodies.forms.layout.RowSpec;
|
|
||||||
import com.jgoodies.forms.factories.FormFactory;
|
|
||||||
|
|
||||||
|
import forge.Singletons;
|
||||||
|
import forge.model.BuildInfo;
|
||||||
|
import forge.model.FModel;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
@@ -26,6 +25,7 @@ import javax.swing.JTextArea;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.mantisbt.connect.MCException;
|
import org.mantisbt.connect.MCException;
|
||||||
import org.mantisbt.connect.axis.MCSession;
|
import org.mantisbt.connect.axis.MCSession;
|
||||||
import org.mantisbt.connect.model.CustomFieldValue;
|
import org.mantisbt.connect.model.CustomFieldValue;
|
||||||
@@ -62,9 +62,13 @@ public class BugzReporter extends JDialog {
|
|||||||
private JComboBox cboVersion = new JComboBox();
|
private JComboBox cboVersion = new JComboBox();
|
||||||
private JComboBox cboSeverity = new JComboBox();
|
private JComboBox cboSeverity = new JComboBox();
|
||||||
final JCheckBox chkReportAnonymously = new JCheckBox("Report Anonymously");
|
final JCheckBox chkReportAnonymously = new JCheckBox("Report Anonymously");
|
||||||
private JTextField txtGit;
|
private JTextField txtSVN;
|
||||||
|
private JLabel lblAddInfo = new JLabel();
|
||||||
|
private JTextArea txtSteps = new JTextArea();
|
||||||
|
|
||||||
private static BugzReporter dialog = new BugzReporter();
|
private static BugzReporter dialog = null;
|
||||||
|
|
||||||
|
private IMCAttribute Severities[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch the application.
|
* Launch the application.
|
||||||
@@ -79,15 +83,28 @@ public class BugzReporter extends JDialog {
|
|||||||
|
|
||||||
public void setDumpText(String dump) {
|
public void setDumpText(String dump) {
|
||||||
txtErrorDump.setText(dump);
|
txtErrorDump.setText(dump);
|
||||||
|
lblAddInfo.setText("Error Dump");
|
||||||
|
cboCategory.setSelectedItem("New Crash Report");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the dialog.
|
* Create the dialog.
|
||||||
*/
|
*/
|
||||||
public BugzReporter() {
|
public BugzReporter() {
|
||||||
|
dialog = this;
|
||||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
|
|
||||||
|
// Init Logger for Axis, which is used by Mantis Library
|
||||||
|
org.apache.log4j.ConsoleAppender appCON = new org.apache.log4j.ConsoleAppender(new org.apache.log4j.SimpleLayout(), "System.out");
|
||||||
|
|
||||||
|
org.apache.log4j.Logger logAxis= Logger.getLogger("org.apache.axis");
|
||||||
|
logAxis.addAppender(appCON);
|
||||||
|
logAxis.setLevel(org.apache.log4j.Level.ERROR);
|
||||||
|
// Init Logger
|
||||||
|
|
||||||
|
//System.out.println(System.getProperties().toString().replace(", ", "\n"));
|
||||||
|
|
||||||
MCSession mCS = null;
|
MCSession mCS = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -105,13 +122,11 @@ public class BugzReporter extends JDialog {
|
|||||||
System.out.println("MCException - getCategories - " + e1.getMessage());
|
System.out.println("MCException - getCategories - " + e1.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
IMCAttribute sevs[] = {};
|
|
||||||
try {
|
try {
|
||||||
sevs = mCS.getEnum(Enumeration.SEVERITIES);
|
Severities = mCS.getEnum(Enumeration.SEVERITIES);
|
||||||
} catch (MCException e1) {
|
} catch (MCException e1) {
|
||||||
System.out.println("MCException - getEnum - " + e1.getMessage());
|
System.out.println("MCException - getEnum - " + e1.getMessage());
|
||||||
}
|
}
|
||||||
final IMCAttribute imCA[] = sevs;
|
|
||||||
|
|
||||||
IProjectVersion[] vers = {};
|
IProjectVersion[] vers = {};
|
||||||
try {
|
try {
|
||||||
@@ -120,60 +135,25 @@ public class BugzReporter extends JDialog {
|
|||||||
System.out.println("MCException - getVersions - " + e1.getMessage());
|
System.out.println("MCException - getVersions - " + e1.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
setTitle("Bug Report");
|
BuildInfo bi = Singletons.getModel().getBuildInfo();
|
||||||
setBounds(100, 100, 500, 542);
|
|
||||||
|
setTitle("Report Issue");
|
||||||
|
setBounds(100, 100, 442, 575);
|
||||||
getContentPane().setLayout(new BorderLayout());
|
getContentPane().setLayout(new BorderLayout());
|
||||||
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||||
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
||||||
contentPanel.setLayout(new FormLayout(new ColumnSpec[] {
|
contentPanel.setLayout(null);
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("35dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu:grow"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu:grow"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
|
|
||||||
ColumnSpec.decode("16dlu"),
|
|
||||||
FormFactory.LABEL_COMPONENT_GAP_COLSPEC,},
|
|
||||||
new RowSpec[] {
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,
|
|
||||||
FormFactory.RELATED_GAP_ROWSPEC,
|
|
||||||
FormFactory.DEFAULT_ROWSPEC,}));
|
|
||||||
{
|
{
|
||||||
JLabel lblMantisUsername = new JLabel("Username");
|
JLabel lblMantisUsername = new JLabel("Username");
|
||||||
contentPanel.add(lblMantisUsername, "2, 2, right, default");
|
lblMantisUsername.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
|
lblMantisUsername.setBounds(10, 16, 75, 14);
|
||||||
|
contentPanel.add(lblMantisUsername);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
txtUserName = new JTextField("ForgeGUI");
|
txtUserName = new JTextField("ForgeGUI");
|
||||||
|
txtUserName.setBounds(90, 13, 185, 21);
|
||||||
txtUserName.setFont(new Font("Dialog", Font.PLAIN, 11));
|
txtUserName.setFont(new Font("Dialog", Font.PLAIN, 11));
|
||||||
contentPanel.add(txtUserName, "4, 2, 9, 1, fill, default");
|
contentPanel.add(txtUserName);
|
||||||
txtUserName.setColumns(4);
|
txtUserName.setColumns(4);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -190,6 +170,7 @@ public class BugzReporter extends JDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
chkReportAnonymously.setBounds(284, 11, 139, 25);
|
||||||
chkReportAnonymously.setFont(new Font("Dialog", Font.PLAIN, 12));
|
chkReportAnonymously.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
chkReportAnonymously.setHorizontalAlignment(SwingConstants.CENTER);
|
chkReportAnonymously.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
|
|
||||||
@@ -208,27 +189,33 @@ public class BugzReporter extends JDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
contentPanel.add(chkReportAnonymously, "14, 2, 7, 1, center, default");
|
contentPanel.add(chkReportAnonymously);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblMantisPassword = new JLabel("Password");
|
JLabel lblMantisPassword = new JLabel("Password");
|
||||||
contentPanel.add(lblMantisPassword, "2, 4, right, default");
|
lblMantisPassword.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
|
lblMantisPassword.setBounds(10, 45, 75, 14);
|
||||||
|
contentPanel.add(lblMantisPassword);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
txtPassword.setBounds(90, 42, 185, 21);
|
||||||
txtPassword.setFont(new Font("Dialog", Font.PLAIN, 11));
|
txtPassword.setFont(new Font("Dialog", Font.PLAIN, 11));
|
||||||
contentPanel.add(txtPassword, "4, 4, 9, 1, fill, default");
|
contentPanel.add(txtPassword);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JSeparator separator = new JSeparator();
|
JSeparator separator = new JSeparator();
|
||||||
contentPanel.add(separator, "2, 6, 19, 1");
|
separator.setBounds(10, 69, 417, 2);
|
||||||
|
contentPanel.add(separator);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblCategory = new JLabel("Category");
|
JLabel lblCategory = new JLabel("Category");
|
||||||
|
lblCategory.setBounds(10, 81, 75, 14);
|
||||||
lblCategory.setFont(new Font("Tahoma", Font.BOLD, 11));
|
lblCategory.setFont(new Font("Tahoma", Font.BOLD, 11));
|
||||||
lblCategory.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblCategory.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblCategory, "2, 8");
|
contentPanel.add(lblCategory);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
cboCategory.setBounds(90, 77, 223, 22);
|
||||||
cboCategory.setFont(new Font("Dialog", Font.BOLD, 10));
|
cboCategory.setFont(new Font("Dialog", Font.BOLD, 10));
|
||||||
|
|
||||||
if (cats.length > 0) {
|
if (cats.length > 0) {
|
||||||
@@ -236,47 +223,56 @@ public class BugzReporter extends JDialog {
|
|||||||
cboCategory.addItem(cats[i]);
|
cboCategory.addItem(cats[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
contentPanel.add(cboCategory, "4, 8, 11, 1, fill, default");
|
cboCategory.setSelectedItem("General Bug Report");
|
||||||
|
|
||||||
|
contentPanel.add(cboCategory);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblSummary = new JLabel("Summary");
|
JLabel lblSummary = new JLabel("Summary");
|
||||||
|
lblSummary.setBounds(10, 108, 75, 14);
|
||||||
lblSummary.setFont(new Font("Tahoma", Font.BOLD, 11));
|
lblSummary.setFont(new Font("Tahoma", Font.BOLD, 11));
|
||||||
lblSummary.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblSummary.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblSummary, "2, 10");
|
contentPanel.add(lblSummary);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
txtSummary = new JTextField();
|
txtSummary = new JTextField();
|
||||||
|
txtSummary.setBounds(90, 105, 337, 21);
|
||||||
txtSummary.setFont(new Font("Dialog", Font.PLAIN, 11));
|
txtSummary.setFont(new Font("Dialog", Font.PLAIN, 11));
|
||||||
contentPanel.add(txtSummary, "4, 10, 17, 1, fill, default");
|
contentPanel.add(txtSummary);
|
||||||
txtSummary.setColumns(10);
|
txtSummary.setColumns(10);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblDescription = new JLabel("Description");
|
JLabel lblDescription = new JLabel("Description");
|
||||||
|
lblDescription.setBounds(10, 182, 75, 21);
|
||||||
lblDescription.setFont(new Font("Tahoma", Font.BOLD, 11));
|
lblDescription.setFont(new Font("Tahoma", Font.BOLD, 11));
|
||||||
lblDescription.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblDescription.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblDescription, "2, 12");
|
contentPanel.add(lblDescription);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JScrollPane scrollPane = new JScrollPane();
|
JScrollPane scrollPane = new JScrollPane();
|
||||||
contentPanel.add(scrollPane, "4, 12, 17, 1, fill, fill");
|
scrollPane.setBounds(90, 132, 337, 120);
|
||||||
|
contentPanel.add(scrollPane);
|
||||||
{
|
{
|
||||||
txtDescription.setFont(new Font("Dialog", Font.PLAIN, 10));
|
txtDescription.setFont(new Font("Dialog", Font.PLAIN, 10));
|
||||||
scrollPane.setViewportView(txtDescription);
|
scrollPane.setViewportView(txtDescription);
|
||||||
txtDescription.setBorder(null);
|
txtDescription.setBorder(null);
|
||||||
txtDescription.setWrapStyleWord(true);
|
txtDescription.setWrapStyleWord(true);
|
||||||
txtDescription.setLineWrap(true);
|
txtDescription.setLineWrap(true);
|
||||||
txtDescription.setRows(10);
|
txtDescription.setRows(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblNewLabel = new JLabel("Error Dump");
|
lblAddInfo.setText("<html><p align=\"right\">Additional<br>Information</p></html>");
|
||||||
lblNewLabel.setFont(new Font("Dialog", Font.PLAIN, 12));
|
lblAddInfo.setBounds(10, 294, 75, 40);
|
||||||
lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblAddInfo.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
contentPanel.add(lblNewLabel, "2, 14");
|
lblAddInfo.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
|
|
||||||
|
contentPanel.add(lblAddInfo);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JScrollPane scrollPane = new JScrollPane();
|
JScrollPane scrollPane = new JScrollPane();
|
||||||
contentPanel.add(scrollPane, "4, 14, 17, 1, fill, fill");
|
scrollPane.setBounds(90, 254, 337, 120);
|
||||||
|
contentPanel.add(scrollPane);
|
||||||
{
|
{
|
||||||
txtErrorDump.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
txtErrorDump.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
||||||
scrollPane.setViewportView(txtErrorDump);
|
scrollPane.setViewportView(txtErrorDump);
|
||||||
@@ -285,65 +281,153 @@ public class BugzReporter extends JDialog {
|
|||||||
txtErrorDump.setBorder(null);
|
txtErrorDump.setBorder(null);
|
||||||
txtErrorDump.setLineWrap(true);
|
txtErrorDump.setLineWrap(true);
|
||||||
txtErrorDump.setWrapStyleWord(true);
|
txtErrorDump.setWrapStyleWord(true);
|
||||||
txtErrorDump.setRows(10);
|
txtErrorDump.setRows(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblNewLabel_1 = new JLabel("Version");
|
JLabel lblVersion = new JLabel("Version");
|
||||||
lblNewLabel_1.setFont(new Font("Dialog", Font.PLAIN, 12));
|
lblVersion.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblNewLabel_1, "2, 16, right, default");
|
lblVersion.setBounds(20, 468, 65, 16);
|
||||||
|
lblVersion.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
|
contentPanel.add(lblVersion);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
cboVersion.setBounds(90, 465, 160, 22);
|
||||||
cboVersion.setFont(new Font("Dialog", Font.BOLD, 10));
|
cboVersion.setFont(new Font("Dialog", Font.BOLD, 10));
|
||||||
|
|
||||||
|
cboVersion.addItem("");
|
||||||
if (vers.length > 0) {
|
if (vers.length > 0) {
|
||||||
for (int i=0; i<vers.length; i++)
|
for (int i=0; i<vers.length; i++) {
|
||||||
cboVersion.addItem(vers[i].getName());
|
cboVersion.addItem(vers[i].getName());
|
||||||
|
//System.out.println(vers[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cboVersion.setSelectedIndex(0);
|
||||||
|
|
||||||
|
String curVer = bi.getVersion();
|
||||||
|
String ss[] = curVer.split("-");
|
||||||
|
String rx = "^" + ss[0].replaceAll("\\.", "\\\\.") + ".*";
|
||||||
|
System.out.println(ss[0] + " -> " + rx);
|
||||||
|
|
||||||
|
if (curVer.equals("SVN")) {
|
||||||
|
cboVersion.setSelectedItem("SVN");
|
||||||
|
} else {
|
||||||
|
for (int i=0; i<vers.length; i++) {
|
||||||
|
System.out.println(vers[i].getName());
|
||||||
|
if (vers[i].getName().matches(rx)) {
|
||||||
|
System.out.println("match");
|
||||||
|
cboVersion.setSelectedItem(vers[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentPanel.add(cboVersion, "4, 16, 9, 1, fill, default");
|
contentPanel.add(cboVersion);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblGit = new JLabel("Git");
|
JLabel lblRev = new JLabel("SVN rev.");
|
||||||
lblGit.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblRev.setBounds(247, 468, 66, 16);
|
||||||
lblGit.setFont(new Font("Dialog", Font.PLAIN, 12));
|
lblRev.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblGit, "14, 16, right, default");
|
lblRev.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
|
contentPanel.add(lblRev);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
txtGit = new JTextField();
|
txtSVN = new JTextField();
|
||||||
txtGit.setFont(new Font("Dialog", Font.PLAIN, 11));
|
|
||||||
txtGit.setColumns(10);
|
String curRev = bi.getBuildID();
|
||||||
contentPanel.add(txtGit, "16, 16, 5, 1, fill, default");
|
if (curRev != null) {
|
||||||
|
if (!curRev.equals("null"))
|
||||||
|
txtSVN.setText(curRev);
|
||||||
|
}
|
||||||
|
txtSVN.setBounds(318, 465, 109, 21);
|
||||||
|
txtSVN.setFont(new Font("Dialog", Font.PLAIN, 11));
|
||||||
|
txtSVN.setColumns(10);
|
||||||
|
contentPanel.add(txtSVN);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JLabel lblSeverity = new JLabel("Severity");
|
JLabel lblSeverity = new JLabel("Severity");
|
||||||
|
lblSeverity.setBounds(10, 496, 75, 16);
|
||||||
lblSeverity.setFont(new Font("Dialog", Font.PLAIN, 12));
|
lblSeverity.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
lblSeverity.setHorizontalAlignment(SwingConstants.RIGHT);
|
lblSeverity.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
contentPanel.add(lblSeverity, "2, 18");
|
contentPanel.add(lblSeverity);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
cboSeverity.setBounds(90, 493, 160, 22);
|
||||||
cboSeverity.setFont(new Font("Dialog", Font.BOLD, 10));
|
cboSeverity.setFont(new Font("Dialog", Font.BOLD, 10));
|
||||||
|
cboSeverity.addItem("");
|
||||||
|
|
||||||
if (imCA.length > 0) {
|
if (Severities.length > 0) {
|
||||||
for (int i=0; i<imCA.length; i++)
|
for (int i=0; i<Severities.length; i++)
|
||||||
cboSeverity.addItem(imCA[i].getName());
|
cboSeverity.addItem(Severities[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
contentPanel.add(cboSeverity, "4, 18, 9, 1, fill, default");
|
contentPanel.add(cboSeverity);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
JScrollPane scrollPane = new JScrollPane();
|
||||||
|
scrollPane.setBounds(90, 380, 337, 80);
|
||||||
|
contentPanel.add(scrollPane);
|
||||||
|
{
|
||||||
|
txtSteps.setWrapStyleWord(true);
|
||||||
|
txtSteps.setRows(5);
|
||||||
|
txtSteps.setMaximumSize(new Dimension(2147483647, 300));
|
||||||
|
txtSteps.setLineWrap(true);
|
||||||
|
txtSteps.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
||||||
|
txtSteps.setAutoscrolls(false);
|
||||||
|
scrollPane.setViewportView(txtSteps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
JLabel lblSteps = new JLabel();
|
||||||
|
lblSteps.setText("<html><p align=\"right\">Steps to<br>Reproduce</p></html>");
|
||||||
|
lblSteps.setHorizontalAlignment(SwingConstants.RIGHT);
|
||||||
|
lblSteps.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||||
|
lblSteps.setBounds(10, 400, 75, 40);
|
||||||
|
contentPanel.add(lblSteps);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JPanel buttonPane = new JPanel();
|
JPanel buttonPane = new JPanel();
|
||||||
|
buttonPane.setOpaque(false);
|
||||||
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
||||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||||
{
|
{
|
||||||
JButton cmdReport = new JButton("Report");
|
JButton cmdReport = new JButton("Report");
|
||||||
cmdReport.addActionListener(new ActionListener() {
|
cmdReport.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
|
doReport();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buttonPane.add(cmdReport);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
JButton cmdCancel = new JButton("Cancel");
|
||||||
|
|
||||||
|
cmdCancel.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
|
dialog.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
buttonPane.add(cmdCancel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doReport() {
|
||||||
Report: {
|
Report: {
|
||||||
|
|
||||||
|
if (txtSummary.getText().length() < 4) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Summary field must be provided", "Bug Report", JOptionPane.ERROR_MESSAGE);
|
||||||
|
break Report;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (txtDescription.getText().length() < 10) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Description field must be provided", "Bug Report", JOptionPane.ERROR_MESSAGE);
|
||||||
|
break Report;
|
||||||
|
}
|
||||||
|
|
||||||
MCSession rep = null;
|
MCSession rep = null;
|
||||||
if (!chkReportAnonymously.isSelected()) {
|
if (!chkReportAnonymously.isSelected()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rep = new MCSession(new URL("http://cardforge.org/bugz/api/soap/mantisconnect.php"), txtUserName.getText(), String.valueOf(txtPassword.getPassword()));
|
rep = new MCSession(new URL("http://cardforge.org/bugz/api/soap/mantisconnect.php"), txtUserName.getText(), String.valueOf(txtPassword.getPassword()));
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
@@ -380,12 +464,15 @@ Report: {
|
|||||||
iBug.setAdditionalInformation(txtErrorDump.getText());
|
iBug.setAdditionalInformation(txtErrorDump.getText());
|
||||||
iBug.setVersion(cboVersion.getSelectedItem().toString());
|
iBug.setVersion(cboVersion.getSelectedItem().toString());
|
||||||
|
|
||||||
for (int i=0; i<imCA.length; i++) {
|
for (int i=0; i<Severities.length; i++) {
|
||||||
if (cboSeverity.getSelectedItem().toString().equals(imCA[i].getName()))
|
if (cboSeverity.getSelectedItem().toString().equals(Severities[i].getName()))
|
||||||
iBug.setSeverity(imCA[i]);
|
iBug.setSeverity(Severities[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICustomFieldValue icfv[] = {new CustomFieldValue(new MCAttribute(1, "Detected at Git Rev (hex7)"), txtGit.getText())};
|
ICustomFieldValue icfv[] = {
|
||||||
|
new CustomFieldValue(new MCAttribute(1, "Detected at SVN Rev"), txtSVN.getText()),
|
||||||
|
new CustomFieldValue(new MCAttribute(1, "Steps to Reproduce"), txtSteps.getText())
|
||||||
|
};
|
||||||
iBug.setCustomFields(icfv);
|
iBug.setCustomFields(icfv);
|
||||||
|
|
||||||
DefaultSubmitter ds = new DefaultSubmitter(false);
|
DefaultSubmitter ds = new DefaultSubmitter(false);
|
||||||
@@ -408,23 +495,6 @@ Report: {
|
|||||||
JOptionPane.showMessageDialog(null, "This Issue Has Been Reported, Thank You.", "Bug Report", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, "This Issue Has Been Reported, Thank You.", "Bug Report", JOptionPane.INFORMATION_MESSAGE);
|
||||||
dialog.dispose();
|
dialog.dispose();
|
||||||
}// Report:
|
}// Report:
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
buttonPane.add(cmdReport);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
JButton cmdCancel = new JButton("Cancel");
|
|
||||||
|
|
||||||
cmdCancel.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
|
||||||
dialog.dispose();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
buttonPane.add(cmdCancel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user