Line 11... |
Line 11... |
11 |
* When distributing the software, include this License Header Notice in each file.
|
11 |
* When distributing the software, include this License Header Notice in each file.
|
12 |
*/
|
12 |
*/
|
13 |
|
13 |
|
14 |
package org.openconcerto.erp.config;
|
14 |
package org.openconcerto.erp.config;
|
15 |
|
15 |
|
- |
|
16 |
import static java.lang.System.getProperty;
|
- |
|
17 |
|
16 |
import org.openconcerto.erp.action.NouvelleConnexionAction;
|
18 |
import org.openconcerto.erp.action.NouvelleConnexionAction;
|
17 |
import org.openconcerto.erp.core.common.ui.PanelFrame;
|
19 |
import org.openconcerto.erp.core.common.ui.PanelFrame;
|
18 |
import org.openconcerto.erp.modules.ModuleManager;
|
- |
|
19 |
import org.openconcerto.erp.panel.PostgreSQLFrame;
|
20 |
import org.openconcerto.erp.panel.PostgreSQLFrame;
|
20 |
import org.openconcerto.erp.panel.UserExitConf;
|
21 |
import org.openconcerto.erp.panel.UserExitConf;
|
21 |
import org.openconcerto.erp.panel.UserExitPanel;
|
22 |
import org.openconcerto.erp.panel.UserExitPanel;
|
22 |
import org.openconcerto.erp.preferences.UIPreferencePanel;
|
23 |
import org.openconcerto.erp.preferences.UIPreferencePanel;
|
23 |
import org.openconcerto.erp.rights.ComptaTotalUserRight;
|
24 |
import org.openconcerto.erp.rights.ComptaTotalUserRight;
|
Line 35... |
Line 36... |
35 |
import org.openconcerto.sql.request.ComboSQLRequest;
|
36 |
import org.openconcerto.sql.request.ComboSQLRequest;
|
36 |
import org.openconcerto.sql.sqlobject.ElementComboBox;
|
37 |
import org.openconcerto.sql.sqlobject.ElementComboBox;
|
37 |
import org.openconcerto.sql.sqlobject.IComboSelectionItem;
|
38 |
import org.openconcerto.sql.sqlobject.IComboSelectionItem;
|
38 |
import org.openconcerto.sql.ui.SoftwareInfoPanel;
|
39 |
import org.openconcerto.sql.ui.SoftwareInfoPanel;
|
39 |
import org.openconcerto.sql.users.rights.UserRightsManager;
|
40 |
import org.openconcerto.sql.users.rights.UserRightsManager;
|
- |
|
41 |
import org.openconcerto.sql.utils.ReOrder;
|
40 |
import org.openconcerto.sql.view.EditPanel;
|
42 |
import org.openconcerto.sql.view.EditPanel;
|
- |
|
43 |
import org.openconcerto.sql.view.IListFrame;
|
41 |
import org.openconcerto.sql.view.list.IListe;
|
44 |
import org.openconcerto.sql.view.list.IListe;
|
42 |
import org.openconcerto.ui.FrameUtil;
|
45 |
import org.openconcerto.ui.FrameUtil;
|
43 |
import org.openconcerto.ui.component.ITextCombo;
|
46 |
import org.openconcerto.ui.component.ITextCombo;
|
44 |
import org.openconcerto.ui.component.WaitIndeterminatePanel;
|
47 |
import org.openconcerto.ui.component.WaitIndeterminatePanel;
|
45 |
import org.openconcerto.ui.preferences.EmailProps;
|
48 |
import org.openconcerto.ui.preferences.EmailProps;
|
Line 49... |
Line 52... |
49 |
import org.openconcerto.utils.ThrowableHandler;
|
52 |
import org.openconcerto.utils.ThrowableHandler;
|
50 |
import org.openconcerto.utils.protocol.Helper;
|
53 |
import org.openconcerto.utils.protocol.Helper;
|
51 |
|
54 |
|
52 |
import java.awt.AWTEvent;
|
55 |
import java.awt.AWTEvent;
|
53 |
import java.awt.Component;
|
56 |
import java.awt.Component;
|
- |
|
57 |
import java.awt.Desktop;
|
54 |
import java.awt.Image;
|
58 |
import java.awt.Image;
|
55 |
import java.awt.SplashScreen;
|
59 |
import java.awt.SplashScreen;
|
56 |
import java.awt.Toolkit;
|
60 |
import java.awt.Toolkit;
|
57 |
import java.awt.event.AWTEventListener;
|
61 |
import java.awt.event.AWTEventListener;
|
58 |
import java.awt.event.HierarchyEvent;
|
62 |
import java.awt.event.HierarchyEvent;
|
Line 61... |
Line 65... |
61 |
import java.beans.PropertyChangeEvent;
|
65 |
import java.beans.PropertyChangeEvent;
|
62 |
import java.beans.PropertyChangeListener;
|
66 |
import java.beans.PropertyChangeListener;
|
63 |
import java.io.BufferedReader;
|
67 |
import java.io.BufferedReader;
|
64 |
import java.io.ByteArrayOutputStream;
|
68 |
import java.io.ByteArrayOutputStream;
|
65 |
import java.io.File;
|
69 |
import java.io.File;
|
- |
|
70 |
import java.io.FileInputStream;
|
- |
|
71 |
import java.io.FileOutputStream;
|
66 |
import java.io.IOException;
|
72 |
import java.io.IOException;
|
67 |
import java.io.InputStreamReader;
|
73 |
import java.io.InputStreamReader;
|
68 |
import java.io.PrintStream;
|
74 |
import java.io.PrintStream;
|
69 |
import java.lang.Thread.UncaughtExceptionHandler;
|
75 |
import java.lang.Thread.UncaughtExceptionHandler;
|
70 |
import java.net.InetAddress;
|
76 |
import java.net.InetAddress;
|
71 |
import java.net.NetworkInterface;
|
77 |
import java.net.NetworkInterface;
|
- |
|
78 |
import java.net.URI;
|
72 |
import java.net.URL;
|
79 |
import java.net.URL;
|
73 |
import java.net.UnknownHostException;
|
80 |
import java.net.UnknownHostException;
|
74 |
import java.security.AllPermission;
|
81 |
import java.security.AllPermission;
|
75 |
import java.security.Permission;
|
82 |
import java.security.Permission;
|
76 |
import java.security.PermissionCollection;
|
83 |
import java.security.PermissionCollection;
|
Line 79... |
Line 86... |
79 |
import java.sql.SQLException;
|
86 |
import java.sql.SQLException;
|
80 |
import java.util.ArrayList;
|
87 |
import java.util.ArrayList;
|
81 |
import java.util.Enumeration;
|
88 |
import java.util.Enumeration;
|
82 |
import java.util.HashSet;
|
89 |
import java.util.HashSet;
|
83 |
import java.util.List;
|
90 |
import java.util.List;
|
- |
|
91 |
import java.util.Properties;
|
84 |
import java.util.Set;
|
92 |
import java.util.Set;
|
85 |
|
93 |
|
86 |
import javax.swing.ImageIcon;
|
94 |
import javax.swing.ImageIcon;
|
87 |
import javax.swing.JDialog;
|
95 |
import javax.swing.JDialog;
|
88 |
import javax.swing.JFrame;
|
96 |
import javax.swing.JFrame;
|
Line 195... |
Line 203... |
195 |
System.setSecurityManager(new SecurityManager());
|
203 |
System.setSecurityManager(new SecurityManager());
|
196 |
}
|
204 |
}
|
197 |
|
205 |
|
198 |
public static void main(String[] args) {
|
206 |
public static void main(String[] args) {
|
199 |
ComptaPropsConfiguration.checkJava();
|
207 |
ComptaPropsConfiguration.checkJava();
|
- |
|
208 |
// Check MacOS Sandbox
|
- |
|
209 |
String cwd = new File(getProperty("user.dir")).toURI().toString();
|
- |
|
210 |
if (cwd.startsWith("file:/private/var/folders")) {
|
- |
|
211 |
JOptionPane.showMessageDialog(null,
|
- |
|
212 |
"Vous éxecutez OpenConcerto depuis la sandbox de MacOS.\nVous devez déplacer le logiciel dans votre dossier Application.\n\nSi cela ne fonctionne pas, vous pouvez utiliser la commande : \nsudo xattr -r -d com.apple.quarantine /Applications/OpenConcerto",
|
- |
|
213 |
"Sandbox", JOptionPane.ERROR_MESSAGE);
|
- |
|
214 |
return;
|
- |
|
215 |
}
|
- |
|
216 |
|
200 |
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
217 |
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
201 |
|
218 |
|
202 |
@Override
|
219 |
@Override
|
203 |
public void uncaughtException(Thread t, Throwable e) {
|
220 |
public void uncaughtException(Thread t, Throwable e) {
|
204 |
e.printStackTrace();
|
221 |
e.printStackTrace();
|
Line 207... |
Line 224... |
207 |
});
|
224 |
});
|
208 |
System.out.println("Java version: " + System.getProperty("java.vendor", "??") + " - " + System.getProperty("java.version", "??"));
|
225 |
System.out.println("Java version: " + System.getProperty("java.vendor", "??") + " - " + System.getProperty("java.version", "??"));
|
209 |
System.out.println("Runtime: Java " + System.getProperty("java.runtime.version", "??") + " - " + System.getProperty("os.name", "??"));
|
226 |
System.out.println("Runtime: Java " + System.getProperty("java.runtime.version", "??") + " - " + System.getProperty("os.name", "??"));
|
210 |
ExceptionHandler.setForceUI(true);
|
227 |
ExceptionHandler.setForceUI(true);
|
211 |
ExceptionHandler.setForumURL("http://www.openconcerto.org/forum");
|
228 |
ExceptionHandler.setForumURL("http://www.openconcerto.org/forum");
|
- |
|
229 |
|
212 |
ExceptionHandler.setSoftwareInformations(SoftwareInfoPanel.FACTORY);
|
230 |
ExceptionHandler.setSoftwareInformations(SoftwareInfoPanel.FACTORY);
|
213 |
ExceptionHandler.setShowProbably(true);
|
231 |
ExceptionHandler.setShowProbably(true);
|
214 |
ExceptionHandler.setThrowableHandler(createDefaultThrowableHandler());
|
232 |
ExceptionHandler.setThrowableHandler(createDefaultThrowableHandler());
|
215 |
|
233 |
|
- |
|
234 |
// Guillaume : handle people importing data directly into the DB
|
- |
|
235 |
ReOrder.setAutoFixNulls(true);
|
- |
|
236 |
|
216 |
System.setProperty(SQLRowAccessor.ACCESS_DB_IF_NEEDED_PROP, "true");
|
237 |
System.setProperty(SQLRowAccessor.ACCESS_DB_IF_NEEDED_PROP, "true");
|
217 |
System.setProperty(PropsConfiguration.REDIRECT_TO_FILE, "true");
|
238 |
System.setProperty(PropsConfiguration.REDIRECT_TO_FILE, "true");
|
218 |
// Mac
|
239 |
// Mac
|
219 |
// only works with Aqua laf
|
240 |
// only works with Aqua laf
|
220 |
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
241 |
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
Line 225... |
Line 246... |
225 |
|
246 |
|
226 |
System.setProperty(EditPanel.NOBORDER, "true");
|
247 |
System.setProperty(EditPanel.NOBORDER, "true");
|
227 |
System.setProperty(EditPanel.ADD_AT_THE_END, "true");
|
248 |
System.setProperty(EditPanel.ADD_AT_THE_END, "true");
|
228 |
System.setProperty("org.openconcerto.sql.listPanel.deafEditPanel", "true");
|
249 |
System.setProperty("org.openconcerto.sql.listPanel.deafEditPanel", "true");
|
229 |
|
250 |
|
- |
|
251 |
// needed as long as IListFrame title isn't localised
|
- |
|
252 |
System.setProperty(IListFrame.SHORT_TITLE, "true");
|
- |
|
253 |
|
230 |
// Gérer avec le droit SAVE_LIST
|
254 |
// Gérer avec le droit SAVE_LIST
|
231 |
System.setProperty("org.openconcerto.sql.canSaveInList", "false");
|
255 |
System.setProperty("org.openconcerto.sql.canSaveInList", "false");
|
232 |
|
256 |
|
233 |
System.setProperty("org.openconcerto.ui.addComboButton", "true");
|
257 |
System.setProperty("org.openconcerto.ui.addComboButton", "true");
|
234 |
System.setProperty(SQLBase.STRUCTURE_USE_XML, "true");
|
258 |
System.setProperty(SQLBase.STRUCTURE_USE_XML, "true");
|
Line 288... |
Line 312... |
288 |
// to dynamically loaded jars. So to allow OOConnexion to work we need to remove the
|
312 |
// to dynamically loaded jars. So to allow OOConnexion to work we need to remove the
|
289 |
// security manager.
|
313 |
// security manager.
|
290 |
System.setSecurityManager(null);
|
314 |
System.setSecurityManager(null);
|
291 |
}
|
315 |
}
|
292 |
Configuration.setInstance(conf);
|
316 |
Configuration.setInstance(conf);
|
- |
|
317 |
|
- |
|
318 |
ExceptionHandler.setSafeToExit(!conf.getServerIp().contains("file:"));
|
293 |
try {
|
319 |
try {
|
294 |
Configuration.migrateToNewDir(conf.getOldDataDir(), conf.getDataDir());
|
320 |
Configuration.migrateToNewDir(conf.getOldDataDir(), conf.getDataDir());
|
295 |
} catch (IOException ex) {
|
321 |
} catch (IOException ex) {
|
296 |
throw new IllegalStateException("Couldn't migrate data dir", ex);
|
322 |
throw new IllegalStateException("Couldn't migrate data dir", ex);
|
297 |
}
|
323 |
}
|
Line 372... |
Line 398... |
372 |
}
|
398 |
}
|
373 |
ExceptionHandler.die("Erreur de connexion à la base de données", e);
|
399 |
ExceptionHandler.die("Erreur de connexion à la base de données", e);
|
374 |
}
|
400 |
}
|
375 |
System.out.println("Init phase 1:" + (System.currentTimeMillis() - t1) + "ms");
|
401 |
System.out.println("Init phase 1:" + (System.currentTimeMillis() - t1) + "ms");
|
376 |
|
402 |
|
- |
|
403 |
// Counter and user agreement
|
- |
|
404 |
File fTOS = new File(Configuration.getInstance().getConfDir(), "tos.properties");
|
- |
|
405 |
Properties pTOS = new Properties();
|
- |
|
406 |
pTOS.setProperty("launchCounter", "1");
|
- |
|
407 |
pTOS.setProperty("allowDebug", "false");
|
- |
|
408 |
pTOS.setProperty("hasManual", "false");
|
- |
|
409 |
pTOS.setProperty("hasCloud", "false");
|
- |
|
410 |
|
- |
|
411 |
if (fTOS.exists()) {
|
- |
|
412 |
try {
|
- |
|
413 |
pTOS.loadFromXML(new FileInputStream(fTOS));
|
- |
|
414 |
} catch (Exception e1) {
|
- |
|
415 |
e1.printStackTrace();
|
- |
|
416 |
}
|
- |
|
417 |
}
|
- |
|
418 |
if (ComptaPropsConfiguration.getInstanceCompta().isOnCloud()) {
|
- |
|
419 |
pTOS.setProperty("hasCloud", "true");
|
- |
|
420 |
}
|
- |
|
421 |
final boolean allowDebug = pTOS.getProperty("allowDebug", "false").equals("true");
|
- |
|
422 |
|
- |
|
423 |
ExceptionHandler.setSubmitErrorAutoEnabled(allowDebug);
|
- |
|
424 |
|
- |
|
425 |
final int launchCounter = Integer.parseInt(pTOS.getProperty("launchCounter", "0"));
|
- |
|
426 |
pTOS.setProperty("launchCounter", String.valueOf(launchCounter + 1));
|
- |
|
427 |
saveProperties(fTOS, pTOS);
|
- |
|
428 |
if (!allowDebug && (launchCounter - 2) % 30 == 0) {
|
- |
|
429 |
SwingUtilities.invokeLater(new Runnable() {
|
- |
|
430 |
public void run() {
|
- |
|
431 |
Object[] options = { "J'accepte", "Non, merci" };
|
- |
|
432 |
int n = JOptionPane.showOptionDialog(null,
|
- |
|
433 |
"Afin d'améliorer plus rapidement le logiciel, nous avons intégré l'envoi automatique de rapports d'erreur.\nIl contient les informations techniques nécessaires à la corrections de bugs.\nSouhaitez-vous activer l'envoi automatique ?",
|
- |
|
434 |
"Rapport d'erreur", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
|
- |
|
435 |
if (n == JOptionPane.YES_OPTION) {
|
- |
|
436 |
pTOS.setProperty("allowDebug", "true");
|
- |
|
437 |
saveProperties(fTOS, pTOS);
|
- |
|
438 |
ExceptionHandler.setSubmitErrorAutoEnabled(true);
|
- |
|
439 |
}
|
- |
|
440 |
|
- |
|
441 |
}
|
- |
|
442 |
});
|
- |
|
443 |
}
|
- |
|
444 |
final boolean hasManual = pTOS.getProperty("hasManual", "false").equals("true");
|
- |
|
445 |
if (!hasManual && (launchCounter - 5) % 100 == 0) {
|
- |
|
446 |
SwingUtilities.invokeLater(new Runnable() {
|
- |
|
447 |
public void run() {
|
- |
|
448 |
Object[] options = { "Je l'ai déjà", "Bonne idée!" };
|
- |
|
449 |
int n = JOptionPane.showOptionDialog(null,
|
- |
|
450 |
"Afin de maîtriser le logiciel, nous conseillons vivement l'acquisition du manuel.\nSon achat vous permet de soutenir les développements d'OpenConcerto et d'avoir une documentation papier de plus de 250 pages.\nVous pouvez le commmander avec port gratuit depuis le site internet : https://www.openconcerto.org ",
|
- |
|
451 |
"Le manuel utilisateur", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);
|
- |
|
452 |
if (n == JOptionPane.YES_OPTION) {
|
- |
|
453 |
pTOS.setProperty("hasManual", "true");
|
- |
|
454 |
saveProperties(fTOS, pTOS);
|
- |
|
455 |
} else {
|
- |
|
456 |
try {
|
- |
|
457 |
Desktop.getDesktop().browse(new URI("https://www.openconcerto.org/fr/documentation.html"));
|
- |
|
458 |
} catch (Exception e) {
|
- |
|
459 |
e.printStackTrace();
|
- |
|
460 |
}
|
- |
|
461 |
}
|
- |
|
462 |
}
|
- |
|
463 |
});
|
- |
|
464 |
}
|
- |
|
465 |
final boolean hasCloud = pTOS.getProperty("hasCloud", "false").equals("true");
|
- |
|
466 |
if (!hasCloud && (launchCounter - 30) % 100 == 0 && ComptaPropsConfiguration.getInstanceCompta().isServerless()) {
|
- |
|
467 |
SwingUtilities.invokeLater(new Runnable() {
|
- |
|
468 |
public void run() {
|
- |
|
469 |
JOptionPane.showMessageDialog(null,
|
- |
|
470 |
"Vous utilisez actuellement le logiciel en version monoposte.\nLes données sont stockées sur votre ordinateur, ce qui peut poser problème en cas de vol ou de panne.\nNous proposons une offre cloud qui vous permet de travailler à plusieurs et de ne plus avoir à vous soucier de la sauvegarde de vos données.\nVous aurez juste besoin d'une connexion internet.\nPlus d'informations sur https://cloud.openconcerto.org",
|
- |
|
471 |
"Cloud", JOptionPane.INFORMATION_MESSAGE);
|
- |
|
472 |
try {
|
- |
|
473 |
Desktop.getDesktop().browse(new URI("https://cloud.openconcerto.org"));
|
- |
|
474 |
} catch (Exception e) {
|
- |
|
475 |
e.printStackTrace();
|
- |
|
476 |
}
|
- |
|
477 |
|
- |
|
478 |
}
|
- |
|
479 |
});
|
- |
|
480 |
}
|
- |
|
481 |
|
377 |
// Email props in .java
|
482 |
// Email props in .java
|
378 |
File fMail2 = new File(Configuration.getInstance().getConfDir(), "Email.properties");
|
483 |
File fMail2 = new File(Configuration.getInstance().getConfDir(), "Email.properties");
|
- |
|
484 |
EmailProps.getInstance().setDefaultPropsFileName(fMail2.toString());
|
379 |
EmailProps.getInstance().setPropsFileName(fMail2.toString());
|
485 |
EmailProps.getInstance().setPropsFileName(fMail2.toString());
|
380 |
|
486 |
|
381 |
SwingUtilities.invokeLater(new Runnable() {
|
487 |
SwingUtilities.invokeLater(new Runnable() {
|
382 |
|
488 |
|
383 |
public void run() {
|
489 |
public void run() {
|
384 |
long t1 = System.currentTimeMillis();
|
490 |
long t1 = System.currentTimeMillis();
|
385 |
|
491 |
|
386 |
IListe.setForceAlternateCellRenderer(true);
|
492 |
IListe.setForceAlternateCellRenderer(true);
|
387 |
// ITableModel.setDefaultCellsEditable(false);
|
- |
|
388 |
// ITableModel.setDefaultOrderEditable(true);
|
- |
|
389 |
|
493 |
|
390 |
AWTEventListener awtListener = new AWTEventListener() {
|
494 |
AWTEventListener awtListener = new AWTEventListener() {
|
391 |
Set<Integer> frames = new HashSet<Integer>();
|
495 |
Set<Integer> frames = new HashSet<Integer>();
|
392 |
String prefix;
|
496 |
String prefix;
|
393 |
|
497 |
|
Line 433... |
Line 537... |
433 |
SQLRequestLog.showFrame();
|
537 |
SQLRequestLog.showFrame();
|
434 |
}
|
538 |
}
|
435 |
|
539 |
|
436 |
JFrame f = null;
|
540 |
JFrame f = null;
|
437 |
try {
|
541 |
try {
|
438 |
f = new NouvelleConnexionAction().createFrame();
|
542 |
f = new NouvelleConnexionAction(conf).createFrame();
|
439 |
// happens with quick login
|
543 |
// happens with quick login
|
440 |
if (f != null) {
|
544 |
if (f != null) {
|
441 |
f.pack();
|
545 |
f.pack();
|
442 |
f.setResizable(false);
|
546 |
f.setResizable(false);
|
443 |
f.addWindowListener(new WindowAdapter() {
|
547 |
f.addWindowListener(new WindowAdapter() {
|
Line 467... |
Line 571... |
467 |
}
|
571 |
}
|
468 |
});
|
572 |
});
|
469 |
|
573 |
|
470 |
// needed so that we can uninstall modules
|
574 |
// needed so that we can uninstall modules
|
471 |
System.setProperty(SQLBase.ALLOW_OBJECT_REMOVAL, "true");
|
575 |
System.setProperty(SQLBase.ALLOW_OBJECT_REMOVAL, "true");
|
- |
|
576 |
}
|
- |
|
577 |
|
- |
|
578 |
private static void saveProperties(File fTOS, Properties pTOS) {
|
472 |
try {
|
579 |
try {
|
- |
|
580 |
final FileOutputStream outputStream = new FileOutputStream(fTOS);
|
473 |
ModuleManager.getInstance().addFactories(MODULES_DIR);
|
581 |
pTOS.storeToXML(outputStream, "tos", "UTF-8");
|
- |
|
582 |
outputStream.close();
|
474 |
} catch (Throwable e) {
|
583 |
} catch (Exception e) {
|
475 |
ExceptionHandler.handle("Erreur d'accès aux modules", e);
|
584 |
e.printStackTrace();
|
476 |
}
|
585 |
}
|
477 |
}
|
586 |
}
|
478 |
|
587 |
|
479 |
public static ThrowableHandler createDefaultThrowableHandler() {
|
588 |
public static ThrowableHandler createDefaultThrowableHandler() {
|
480 |
|
589 |
|
Line 500... |
Line 609... |
500 |
} else if (s.contains("File corrupted while reading")) {
|
609 |
} else if (s.contains("File corrupted while reading")) {
|
501 |
JOptionPane.showMessageDialog(null,
|
610 |
JOptionPane.showMessageDialog(null,
|
502 |
"Votre fichier de base de données est endommagé.\nLes causes possibles sont variées : problème matériel (mémoire, disque dur...), coupure brutale du PC, virus, antivirus, erreur de fichiers...\n\nIl vous faudra restaurer votre base de données depuis une sauvegarde\nou contacter notre service technique pour réparation (voir https://www.openconcerto.org).");
|
611 |
"Votre fichier de base de données est endommagé.\nLes causes possibles sont variées : problème matériel (mémoire, disque dur...), coupure brutale du PC, virus, antivirus, erreur de fichiers...\n\nIl vous faudra restaurer votre base de données depuis une sauvegarde\nou contacter notre service technique pour réparation (voir https://www.openconcerto.org).");
|
503 |
System.exit(1);
|
612 |
System.exit(1);
|
504 |
return true;
|
613 |
return true;
|
505 |
} else if (s.contains("File corrupted while reading")) {
|
614 |
} else if (s.contains("h2") && (s.contains("File corrupted while reading") || s.contains("data leaf table"))) {
|
506 |
JOptionPane.showMessageDialog(null,
|
615 |
JOptionPane.showMessageDialog(null,
|
507 |
"Votre fichier de base de données est endommagé.\nLes causes possibles sont variées : problème matériel (mémoire, disque dur...), coupure brutale du PC, virus, antivirus, erreur de fichiers...\n\nIl vous faudra restaurer votre base de données depuis une sauvegarde\nou contacter notre service technique pour réparation (voir https://www.openconcerto.org).");
|
616 |
"Votre fichier de base de données est endommagé.\nLes causes possibles sont variées : problème matériel (mémoire, disque dur...), coupure brutale du PC, virus, antivirus, erreur de fichiers...\n\nIl vous faudra restaurer votre base de données depuis une sauvegarde\nou contacter notre service technique pour réparation (voir https://www.openconcerto.org).");
|
508 |
System.exit(1);
|
617 |
System.exit(1);
|
509 |
return true;
|
618 |
return true;
|
510 |
} else if (s.contains("/private/var/folders/")) {
|
619 |
} else if (s.contains("/private/var/folders/")) {
|
Line 513... |
Line 622... |
513 |
System.exit(1);
|
622 |
System.exit(1);
|
514 |
return true;
|
623 |
return true;
|
515 |
} else if (s.contains("com.sun.java.swing.plaf.windows.WindowsTableHeaderUI")) {
|
624 |
} else if (s.contains("com.sun.java.swing.plaf.windows.WindowsTableHeaderUI")) {
|
516 |
// bug connu de Java sur les TableHeader
|
625 |
// bug connu de Java sur les TableHeader
|
517 |
return true;
|
626 |
return true;
|
- |
|
627 |
} else if (s.contains("WInputMethod.openCandidateWindow") && s.contains("java.lang.NullPointerException: peer")) {
|
- |
|
628 |
// bug windows...
|
- |
|
629 |
// Caused by: java.lang.NullPointerException: peer
|
- |
|
630 |
// at sun.awt.windows.WInputMethod.openCandidateWindow(Native Method)
|
- |
|
631 |
// at sun.awt.windows.WInputMethod.access$400(Unknown Source)
|
- |
|
632 |
// at sun.awt.windows.WInputMethod$1.run(Unknown Source)
|
- |
|
633 |
// at java.awt.event.InvocationEvent.dispatch(Unknown Source)
|
- |
|
634 |
return true;
|
- |
|
635 |
}
|
- |
|
636 |
|
- |
|
637 |
else if (s.contains("No application is associated with the specified file for this operation")) {
|
- |
|
638 |
JOptionPane.showMessageDialog(null, "Merci d'installer LibreOffice ou tout autre application succeptible d'ouvrir ce fichier");
|
- |
|
639 |
return true;
|
- |
|
640 |
} else if (s.contains("java.net.SocketTimeoutException: connect timed out")) {
|
- |
|
641 |
JOptionPane.showMessageDialog(null, "Le serveur de base de données n'est pas joignable.\n" + message);
|
- |
|
642 |
return true;
|
- |
|
643 |
} else if (s.contains("java.lang.NoSuchMethodError")) {
|
- |
|
644 |
JOptionPane.showMessageDialog(null, "Un de vos modules n'est pas à jour.\n" + message);
|
- |
|
645 |
return true;
|
- |
|
646 |
} else if (s.contains("InvalidTemplateException")) {
|
- |
|
647 |
JOptionPane.showMessageDialog(null, "Votre modèle de document n'est pas valide.\n" + message, "Modèle incorrect", JOptionPane.ERROR_MESSAGE);
|
- |
|
648 |
return true;
|
518 |
}
|
649 |
}
|
519 |
return false;
|
650 |
return false;
|
520 |
}
|
651 |
}
|
521 |
};
|
652 |
};
|
522 |
}
|
653 |
}
|