|
|
| 579 |
605 |
|
| 82 | 82 | private static final int HOURS_IN_DAY = 24;
|
| 83 | 83 | private static final int MINUTES_IN_HOUR = 60;
|
| 84 | 84 | private static boolean sUSB = false;
|
| 85 | private static boolean sCreatedDB = false;
|
| 85 | 86 |
|
| 86 | 87 | /**
|
| 87 | 88 | * @brief Try to guarantee a directory for saving 'cached copies'
|
| --- | --- | |
| 396 | 397 | setUI(null, null, UIManager.getInstalledLookAndFeels());
|
| 397 | 398 |
|
| 398 | 399 | try {
|
| 400 | boolean creatingDB = JConfig.queryConfiguration("jbidwatcher.created_db", "false").equals("false");
|
| 399 | 401 | Upgrader.upgrade();
|
| 402 | if(creatingDB && JConfig.queryConfiguration("jbidwatcher.created_db", "false").equals("true")) {
|
| 403 | sCreatedDB = true;
|
| 404 | }
|
| 400 | 405 | } catch(Exception e) {
|
| 401 | 406 | if (e.getMessage().matches("^Failed to start database.*")) {
|
| 402 | 407 | JOptionPane.showMessageDialog(null, "JBidwatcher can't access its database.\nPlease check to see if you are running another instance.", "Can't access auction database", JOptionPane.PLAIN_MESSAGE);
|
| --- | --- | |
| 543 | 548 | Initializer.setup();
|
| 544 | 549 | FilterManager.getInstance().loadFilters();
|
| 545 | 550 | inSplash.message("Loading Auctions");
|
| 546 | | if (AuctionsManager.getInstance().loadAuctionsFromDatabase() == 0) {
|
| 551 | if (sCreatedDB) {
|
| 547 | 552 | AuctionsManager.getInstance().loadAuctions();
|
| 553 | } else {
|
| 554 | AuctionsManager.getInstance().loadAuctionsFromDatabase();
|
| 548 | 555 | }
|
| 549 | 556 |
|
| 550 | 557 | AuctionServerManager.getInstance().getDefaultServerTime();
|