Changeset 10555
- Timestamp:
- 2005-08-24T15:11:34+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
r10517 r10555 143 143 144 144 145 public void openFileInExternalApplication(File file)146 {147 // If we're using a remote Greenstone server, we need to download the file before viewing it...148 if (Gatherer.isGsdlRemote) {149 // ... but only if it is inside the collection and we haven't already downloaded it150 if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) {151 RemoteGreenstoneServer.downloadCollectionFile(Gatherer.c_man.getCollection().getName(), file);152 }153 }154 155 Gatherer.spawnApplication(file);156 }157 158 159 145 private class FileTask 160 146 extends Thread … … 197 183 progress_bar.setIndeterminate(false); 198 184 progress_bar.clear(); 185 } 186 } 187 188 189 public void openFileInExternalApplication(File file) 190 { 191 // This must go in a separate thread because we need the progress bar to work (remote Greenstone server) 192 new OpenFileInExternalApplicationTask(file).start(); 193 } 194 195 196 private class OpenFileInExternalApplicationTask 197 extends Thread 198 { 199 private File file = null; 200 201 public OpenFileInExternalApplicationTask(File file) 202 { 203 this.file = file; 204 } 205 206 public void run() 207 { 208 // If we're using a remote Greenstone server, we need to download the file before viewing it... 209 if (Gatherer.isGsdlRemote) { 210 // ... but only if it is inside the collection and we haven't already downloaded it 211 if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) { 212 RemoteGreenstoneServer.downloadCollectionFile(Gatherer.c_man.getCollection().getName(), file); 213 } 214 } 215 216 // View the file in an external application 217 Gatherer.spawnApplication(file); 199 218 } 200 219 }
Note:
See TracChangeset
for help on using the changeset viewer.