OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Rev 177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 156
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.config;
14
 package org.openconcerto.erp.config;
15
 
15
 
16
import org.openconcerto.erp.action.AboutAction;
16
import org.openconcerto.erp.action.AboutAction;
17
import org.openconcerto.erp.action.PreferencesAction;
-
 
18
import org.openconcerto.erp.core.common.ui.StatusPanel;
17
import org.openconcerto.erp.core.common.ui.StatusPanel;
19
import org.openconcerto.erp.panel.UserExitConf;
18
import org.openconcerto.erp.panel.UserExitConf;
20
import org.openconcerto.erp.panel.UserExitPanel;
19
import org.openconcerto.erp.panel.UserExitPanel;
21
import org.openconcerto.erp.rights.MenuComboRightEditor;
20
import org.openconcerto.erp.rights.MenuComboRightEditor;
22
import org.openconcerto.sql.Configuration;
-
 
23
import org.openconcerto.sql.PropsConfiguration;
21
import org.openconcerto.sql.PropsConfiguration;
24
import org.openconcerto.sql.users.UserManager;
22
import org.openconcerto.sql.users.UserManager;
25
import org.openconcerto.sql.users.rights.UserRightsManager;
23
import org.openconcerto.sql.users.rights.UserRightsManager;
26
import org.openconcerto.task.TodoListPanel;
24
import org.openconcerto.task.TodoListPanel;
27
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
25
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
Line 135... Line 133...
135
 
133
 
136
    public TodoListPanel getTodoPanel() {
134
    public TodoListPanel getTodoPanel() {
137
        return this.todoPanel;
135
        return this.todoPanel;
138
    }
136
    }
139
 
137
 
140
    public MainFrame() {
138
    public MainFrame(final PropsConfiguration conf) {
141
        super();
139
        super();
142
 
140
 
143
        this.setIconImage(new ImageIcon(MainFrame.class.getResource("frameicon.png")).getImage());
141
        this.setIconImage(new ImageIcon(MainFrame.class.getResource("frameicon.png")).getImage());
144
 
142
 
145
        Container co = this.getContentPane();
143
        Container co = this.getContentPane();
Line 183... Line 181...
183
            this.pack();
181
            this.pack();
184
            minSize = new Dimension(this.getSize());
182
            minSize = new Dimension(this.getSize());
185
        }
183
        }
186
        this.setMinimumSize(minSize);
184
        this.setMinimumSize(minSize);
187
 
185
 
188
        final Configuration conf = Configuration.getInstance();
-
 
189
        final File confFile = new File(conf.getConfDir(), "Configuration" + File.separator + "Frame" + File.separator + "mainFrame" + confSuffix + ".xml");
186
        final File confFile = new File(conf.getConfDir(), "Configuration" + File.separator + "Frame" + File.separator + "mainFrame" + confSuffix + ".xml");
190
        new WindowStateManager(this, confFile).loadState();
187
        new WindowStateManager(this, confFile).loadState();
191
 
188
 
192
        registerForMacOSXEvents();
189
        registerForMacOSXEvents();
193
 
190
 
Line 198... Line 195...
198
            }
195
            }
199
        });
196
        });
200
 
197
 
201
        setInstance(this);
198
        setInstance(this);
202
 
199
 
203
        final Thread dbConn = ((PropsConfiguration) conf).createDBCheckThread(this, new Runnable() {
200
        final Thread dbConn = conf.createDBCheckThread(this, new Runnable() {
204
            @Override
201
            @Override
205
            public void run() {
202
            public void run() {
206
                // the user has already clicked "Quit" don't ask him again
203
                // the user has already clicked "Quit" don't ask him again
207
                // Further the DB is unavailable so most actions (e.g. backup) cannot run
204
                // Further the DB is unavailable so most actions (e.g. backup) cannot run
208
                UserExitPanel.exit(UserExitConf.DEFAULT);
205
                UserExitPanel.exit(UserExitConf.DEFAULT);
Line 401... Line 398...
401
        }
398
        }
402
    }
399
    }
403
 
400
 
404
    // used by OSXAdapter
401
    // used by OSXAdapter
405
    public final void preferences() {
402
    public final void preferences() {
406
        new PreferencesAction().actionPerformed(null);
403
        MenuManager.getInstance().getActionForId("preferences").actionPerformed(null);
407
    }
404
    }
408
 
405
 
409
    public final void about() {
406
    public final void about() {
410
        AboutAction.getInstance().actionPerformed(null);
407
        AboutAction.getInstance().actionPerformed(null);
411
    }
408
    }