OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 177 Rev 182
Line 35... Line 35...
35
import java.awt.Window;
35
import java.awt.Window;
36
import java.awt.event.ActionEvent;
36
import java.awt.event.ActionEvent;
37
import java.awt.event.ActionListener;
37
import java.awt.event.ActionListener;
38
import java.awt.event.WindowAdapter;
38
import java.awt.event.WindowAdapter;
39
import java.awt.event.WindowEvent;
39
import java.awt.event.WindowEvent;
40
import java.io.File;
-
 
41
import java.io.IOException;
-
 
42
import java.util.Set;
40
import java.util.Set;
43
import java.util.concurrent.atomic.AtomicBoolean;
41
import java.util.concurrent.atomic.AtomicBoolean;
44
 
42
 
45
import javax.swing.AbstractAction;
43
import javax.swing.AbstractAction;
46
import javax.swing.JButton;
44
import javax.swing.JButton;
Line 188... Line 186...
188
        // ((JFrame) SwingUtilities.getRoot(UserExitingPanel.this)).dispose();
186
        // ((JFrame) SwingUtilities.getRoot(UserExitingPanel.this)).dispose();
189
        if (Gestion.pgFrameStart != null) {
187
        if (Gestion.pgFrameStart != null) {
190
            Gestion.pgFrameStart.setVisible(false);
188
            Gestion.pgFrameStart.setVisible(false);
191
        }
189
        }
192
        new Thread() {
190
        new Thread() {
193
            private PostgreSQLFrame pgFrame = null;
-
 
194
 
191
 
195
            @Override
192
            @Override
196
            public void run() {
193
            public void run() {
197
                try {
194
                try {
198
                    Configuration.getInstance().destroy();
195
                    Configuration.getInstance().destroy();
199
                    Runtime runtime = Runtime.getRuntime();
-
 
200
 
196
 
201
                    File f = new File(".\\PostgreSQL\\bin\\");
-
 
202
                    if (f.exists()) {
-
 
203
                        final Process p = runtime.exec(new String[] { "cmd.exe", "/C", "stopPostGres.bat" }, null, f);
-
 
204
                        SwingUtilities.invokeLater(new Runnable() {
-
 
205
 
-
 
206
                            @Override
-
 
207
                            public void run() {
-
 
208
 
-
 
209
                                try {
-
 
210
                                    pgFrame = new PostgreSQLFrame("Arrêt en cours");
-
 
211
                                    pgFrame.setVisible(true);
-
 
212
                                } catch (Exception e) {
-
 
213
                                    e.printStackTrace();
-
 
214
                                }
-
 
215
                            }
-
 
216
                        });
-
 
217
                        System.err.println("Execute end postgres");
-
 
218
                        ProcessStreams.handle(p, ProcessStreams.Action.REDIRECT);
-
 
219
                        p.waitFor();
-
 
220
 
-
 
221
                    }
-
 
222
                    ComptaPropsConfiguration.getInstanceCompta().tearDownLogging(true);
197
                    ComptaPropsConfiguration.getInstanceCompta().tearDownLogging(true);
223
                } catch (IOException e1) {
-
 
224
                    // TODO Auto-generated catch block
-
 
225
                    e1.printStackTrace();
-
 
226
                } catch (InterruptedException e) {
-
 
227
                    // TODO Auto-generated catch block
-
 
228
                    e.printStackTrace();
-
 
229
                } finally {
198
                } finally {
230
                    SwingUtilities.invokeLater(new Runnable() {
-
 
231
                        public void run() {
-
 
232
                            if (pgFrame != null) {
-
 
233
                                pgFrame.dispose();
-
 
234
                            }
-
 
235
                        }
-
 
236
                    });
-
 
-
 
199
 
237
                    startTimeOut();
200
                    startTimeOut();
238
                    // System.exit(0);
201
                    // System.exit(0);
239
                }
202
                }
240
            }
203
            }
241
        }.start();
204
        }.start();