OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 177
Line 42... Line 42...
42
import javax.swing.SwingUtilities;
42
import javax.swing.SwingUtilities;
43
import javax.swing.SwingWorker;
43
import javax.swing.SwingWorker;
44
 
44
 
45
public final class AboutAction extends AbstractAction {
45
public final class AboutAction extends AbstractAction {
46
 
46
 
47
    static private final AboutAction instance = new AboutAction();
47
    private final ComptaPropsConfiguration conf;
48
 
48
 
49
    public static AboutAction getInstance() {
49
    public AboutAction(final ComptaPropsConfiguration conf) {
50
        return instance;
-
 
51
    }
-
 
52
 
-
 
53
    private AboutAction() {
-
 
54
        super("Informations");
50
        super("Informations");
55
 
-
 
-
 
51
        this.conf = conf;
56
    }
52
    }
57
 
53
 
58
    @Override
54
    @Override
59
    public void actionPerformed(final ActionEvent event) {
55
    public void actionPerformed(final ActionEvent event) {
60
        final JFrame frame = new JFrame((String) this.getValue(Action.NAME));
56
        final JFrame frame = new JFrame((String) this.getValue(Action.NAME));
61
        JPanel p = new JPanel();
57
        JPanel p = new JPanel();
62
        p.setLayout(new BorderLayout());
58
        p.setLayout(new BorderLayout());
63
 
59
 
64
        final JScrollPane contentPane = new JScrollPane(new InfoPanel());
60
        final JScrollPane contentPane = new JScrollPane(new InfoPanel(this.conf.getLocale()));
65
        p.add(createComptaInfoPanel(), BorderLayout.NORTH);
61
        p.add(createComptaInfoPanel(), BorderLayout.NORTH);
66
        p.add(contentPane, BorderLayout.CENTER);
62
        p.add(contentPane, BorderLayout.CENTER);
67
        p.add(createBenchMarkPanel(), BorderLayout.SOUTH);
63
        p.add(createBenchMarkPanel(), BorderLayout.SOUTH);
68
        frame.setContentPane(p);
64
        frame.setContentPane(p);
69
        frame.pack();
65
        frame.pack();
Line 105... Line 101...
105
        c.weightx = 1;
101
        c.weightx = 1;
106
        c.anchor = GridBagConstraints.WEST;
102
        c.anchor = GridBagConstraints.WEST;
107
        p.add(new JLabel(path), c);
103
        p.add(new JLabel(path), c);
108
        c.gridy++;
104
        c.gridy++;
109
        c.gridx = 0;
105
        c.gridx = 0;
110
        final String serverIp = ComptaPropsConfiguration.getInstanceCompta().getServerIp();
106
        final String serverIp = this.conf.getServerIp();
111
        if (serverIp.startsWith("file:")) {
107
        if (serverIp.startsWith("file:")) {
112
            final String dbPath = ComptaPropsConfiguration.getInstanceCompta().getServerIp().substring(5);
108
            final String dbPath = serverIp.substring(5);
113
            c.weightx = 0;
109
            c.weightx = 0;
114
            c.anchor = GridBagConstraints.EAST;
110
            c.anchor = GridBagConstraints.EAST;
115
            p.add(new JLabelBold("Fichier de base de données : "), c);
111
            p.add(new JLabelBold("Fichier de base de données : "), c);
116
            c.gridx++;
112
            c.gridx++;
117
            c.weightx = 1;
113
            c.weightx = 1;