Changeset 6748 for trunk/gli/src/org/greenstone/gatherer/file
- Timestamp:
- 2004-02-09T15:55:22+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r6630 r6748 32 32 import org.greenstone.gatherer.Gatherer; 33 33 import org.greenstone.gatherer.gui.FileAssociationDialog; 34 import org.greenstone.gatherer.gui.PreviewCommandDialog; 34 35 import org.greenstone.gatherer.msm.MSMUtils; 35 36 import org.greenstone.gatherer.util.StaticStrings; … … 104 105 return command; 105 106 } 106 // Failing that we have to prompt the user for what they want to do, but we do our best to provide a sensible default (if available).107 // F or windows we can have a pretty good guess107 command = null; 108 // Failing that we have a guess at a sensible default 108 109 if(Utility.isWindows()) { 109 110 // we use cmd and start … … 113 114 command = StaticStrings.WIN_OPEN_COMMAND;//"cmd.exe /c start \"\" \""+url+"\""; 114 115 } 115 } 116 117 // Now prompt the user 118 FileAssociationDialog dialog = new FileAssociationDialog(this); 119 command = dialog.display(true, command); 120 dialog.dispose(); 121 dialog = null; 116 } else if (Utility.isMac()) { 117 command = StaticStrings.MAC_OPEN_COMMAND; // "open %1" 118 } else { 119 // we try to look for a browser 120 } 121 122 // if we still haven't found something, prompt the user 123 if (command == null) { 124 PreviewCommandDialog dialog = new PreviewCommandDialog(); 125 command = dialog.display(); 126 dialog.dispose(); 127 dialog = null; 128 } 122 129 123 130 // Store the result if any 124 if(command != null ) {131 if(command != null && !command.equals("")) { 125 132 Gatherer.config.setPreviewCommand(command); 126 } 127 128 // for now uder linux get the fileassoc thing. but eventually want a separate thing. 129 // pretend we are trying to open an html file 130 // Mmmoooo. - jmt12 131 133 command = command.replaceAll(FILENAME_ARG, url); 134 Gatherer.println("Result = " + command); 135 return command; 136 } 132 137 // if we haven't got a command by now, we'll never get one 133 if (command == null) { 134 Gatherer.println("Result = " + command); 135 return null; 136 } 137 // Replace %1 with the url in quotes 138 command = command.replaceAll(FILENAME_ARG, url); 139 Gatherer.println("Result = " + command); 140 return command; 138 Gatherer.println("Result = null"); 139 return null; 140 141 141 } 142 142
Note:
See TracChangeset
for help on using the changeset viewer.