Changeset 24704


Ignore:
Timestamp:
2011-09-30T20:49:42+13:00 (10 years ago)
Author:
ak19
Message:

Dr Bainbridge found a default Linux file open command (xdg-open). This is now used for file associations when the user has not provided one.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java

    r10323 r24704  
    7474            XMLTools.setValue(entry, StaticStrings.MAC_OPEN_COMMAND);
    7575            }
     76            else { // assume linux?
     77            XMLTools.setValue(entry, StaticStrings.LINUX_OPEN_COMMAND);
     78            }
    7679        }
    7780        command = null;
     
    113116        command = StaticStrings.MAC_OPEN_COMMAND; // "open %1"
    114117    } else {
    115         // we try to look for a browser
     118        // we try to look for a browser
    116119        String [] browsers = new String [] {"mozilla", "netscape"};
    117120        for (int i=0; i<browsers.length; i++) {
     
    121124        }
    122125        }
     126        if (command == null) { 
     127            command = StaticStrings.LINUX_OPEN_COMMAND; // "xdg-open %1"
     128        }   
    123129    }
    124130
     
    190196            command = StaticStrings.MAC_OPEN_COMMAND;
    191197        }
    192 
     198       
     199        else { // If we are on a linux, default to using the xdg-open program
     200            command = StaticStrings.LINUX_OPEN_COMMAND;
     201        }
     202       
    193203        // Otherwise display the dialog and ask the user to enter launching command.
    194204        if(command == null || command.length() == 0) {
  • main/trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java

    r24478 r24704  
    181181    static final public String LEVELS_STR = "levels";
    182182    static final public String LIBRARY_URL_ARGUMENT = "-library_url";
     183    static final public String LINUX_OPEN_COMMAND = "xdg-open %1";
    183184    static final public String LOCAL_LIBRARY_ARGUMENT = "-local_library";
    184185    static final public String LOAD_ARGUMENT = "-load";
     
    230231    static final public String SEPARATOR_ATTRIBUTE = "separator";
    231232    static final public String SEPARATOR_CHARACTER = "/";
    232   static final public String SERVICE_RACK_LIST_ELEMENT = "serviceRackList";
     233    static final public String SERVICE_RACK_LIST_ELEMENT = "serviceRackList";
    233234    static final public String SERVLET_ARGUMENT ="-servlet";
    234235    static final public String SINGLE_QUOTE_CHARACTER = "'";
Note: See TracChangeset for help on using the changeset viewer.