~ubuntu-branches/ubuntu/natty/jabref/natty

« back to all changes in this revision

Viewing changes to src/java/net/sf/jabref/JabRef.java

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2007-11-16 18:38:18 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071116183818-20x934jdsju14618
Tags: 2.3-2
* Add /usr/lib/jvm/java-7-icedtea to wrapper script. Doesn't work on
  Debian yet but helps Ubuntu users (TODO: add dependency on
  icedtea-java7-jre (not yet in Debian)).
* Reformat wrapper script.
* debian/rules: re-arrange targets and their dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    boolean graphicFailure = false;
66
66
 
67
67
    StringOption importFile, exportFile, exportPrefs, importPrefs, auxImExport, importToOpenBase;
68
 
    BooleanOption helpO, disableGui, blank, loadSess, showVersion;
 
68
    BooleanOption helpO, disableGui, blank, loadSess, showVersion, disableSplash;
69
69
    /*
70
70
    * class StringArrayOption extends ArrayOption { public public void
71
71
    * modify(String value) { } public void modify(String[] value) { } public
148
148
        exportFile = new StringOption("");
149
149
        helpO = new BooleanOption();
150
150
        disableGui = new BooleanOption();
 
151
        disableSplash = new BooleanOption();
151
152
        blank = new BooleanOption();
152
153
        loadSess = new BooleanOption();
153
154
        showVersion = new BooleanOption();
164
165
                Globals.lang("Display version"), showVersion);
165
166
        options.register("nogui", 'n',
166
167
            Globals.lang("No GUI. Only process command line options."), disableGui);
 
168
        options.register("nosplash", 's',
 
169
                Globals.lang("Do not show splash window at startup"), disableSplash);
167
170
        options.register("import", 'i',
168
171
            Globals.lang("Import file") + ": " + Globals.lang("filename")
169
172
            + "[,import format]", importFile);
219
222
        // that the GUI
220
223
        // should not be opened. This is used to decide whether we should show the
221
224
        // splash screen or not.
222
 
        if (initialStartup && !disableGui.isInvoked()) {
 
225
        if (initialStartup && !disableGui.isInvoked() && !disableSplash.isInvoked()) {
223
226
            try {
224
227
 
225
228
                splashScreen = SplashScreen.splash();
368
371
                    // This signals that the latest import should be stored in the given
369
372
                    // format to the given file.
370
373
                    ParserResult pr = (ParserResult) loaded.elementAt(loaded.size() - 1);
 
374
 
 
375
                    // Set the global variable for this database's file directory before exporting,
 
376
                    // so formatters can resolve linked files correctly.
 
377
                    // (This is an ugly hack!)
 
378
                    MetaData metaData = new MetaData(pr.getMetaData(), pr.getDatabase());
 
379
                    metaData.setFile(pr.getFile());
 
380
                    Globals.prefs.fileDirForDatabase = metaData.getFileDirectory(GUIGlobals.FILE_FIELD);
371
381
                    System.out.println(Globals.lang("Exporting") + ": " + data[0]);
372
382
                    ExportFormat format = ExportFormats.getExportFormat(data[1]);
373
383
                    if (format != null) {
506
516
            // Jabref version.
507
517
            Util.performCompatibilityUpdate();
508
518
 
 
519
 
509
520
            // Set up custom or default icon theme:
510
521
            GUIGlobals.setUpIconTheme();
511
522
 
 
523
            // TODO: remove temporary registering of external file types?
 
524
            Globals.prefs.updateExternalFileTypes();
 
525
 
512
526
           // This property is set to make the Mac OSX Java VM move the menu bar to
513
527
            // the top
514
528
            // of the screen, where Mac users expect it to be.
688
702
            if (loaded.size() > 0) {
689
703
                for (Iterator i=loaded.iterator(); i.hasNext();) {
690
704
                    ParserResult pr = (ParserResult)i.next();
691
 
                    jrf.addTab(pr.getDatabase(), pr.getFile(), pr.getMetaData(), pr.getEncoding(), first);
692
 
                    first = false;
 
705
                            BasePanel panel = jrf.addTab(pr.getDatabase(), pr.getFile(),
 
706
                            pr.getMetaData(), pr.getEncoding(), first);
 
707
                    first = false;
693
708
                }
694
709
            }
695
710
 
702
717
                splashScreen = null;
703
718
            }
704
719
 
 
720
            /*JOptionPane.showMessageDialog(null, Globals.lang("Please note that this "
 
721
                +"is an early beta version. Do not use it without backing up your files!"),
 
722
                    Globals.lang("Beta version"), JOptionPane.WARNING_MESSAGE);*/
 
723
 
705
724
            //Util.pr(": Showing frame");
706
725
            jrf.setVisible(true);
707
726
 
724
743
                }
725
744
            }
726
745
 
 
746
            // After adding the databases, go through each and see if
 
747
            // any post open actions need to be done. For instance, checking
 
748
            // if we found new entry types that can be imported, or checking
 
749
            // if the database contents should be modified due to new features
 
750
            // in this version of JabRef:
 
751
            for (int i = 0; i < loaded.size(); i++) {
 
752
                ParserResult pr = (ParserResult) loaded.elementAt(i);
 
753
                BasePanel panel = jrf.baseAt(i);
 
754
                OpenDatabaseAction.performPostOpenActions(panel, pr, true);
 
755
            }
 
756
 
727
757
            //Util.pr(": Finished adding panels");
728
758
 
729
759
            if (loaded.size() > 0) {