(file, fileOptions)
| 158 | |
| 159 | // Select to open a file with any handler |
| 160 | var openFileWith = function(file, fileOptions) { |
| 161 | var choices = {}; |
| 162 | _.each(handlers, function(handler) { |
| 163 | choices[handler.id] = handler.name; |
| 164 | }); |
| 165 | |
| 166 | if (_.size(choices) == 0) { |
| 167 | return Q.reject(new Error("No handlers for this file")); |
| 168 | } |
| 169 | |
| 170 | return dialogs.select("Can't open this file", "Sorry, No handler has been found to open this file. Try to find and install an add-on to manage this file or select one of the following handlers:", choices).then(function(value) { |
| 171 | var handler = handlers[value]; |
| 172 | return Q(openFileHandler(handler, file, fileOptions)); |
| 173 | }); |
| 174 | }; |
| 175 | |
| 176 | // Open a file |
| 177 | var openFile = function(file, options) { |
no test coverage detected