pencil icon indicating copy to clipboard operation
pencil copied to clipboard

OSX File picker for Loading Developer Stencil does not allow you to choose "Default.xml"

Open prikhi opened this issue 11 years ago • 5 comments

From [email protected] on February 10, 2013 02:58:21

What steps will reproduce the problem? 1. Select from Menu: Tools/Developer Tools/Load Developer Stencil Directory... 2. Browse to folder with you Default.xml file What is the expected output? What do you see instead? I should be able to pick my Default.xml file, but instead all files including Default.xml are "grayed out" and can not be selected. What version of the product are you using? On what operating system? Pencil 2.0.3 OSX Lion 10.7.5 Please provide any additional information below. I was able to fix the issue by changing this file: Pencil.app/Contents/Resources/content/pencil/mainWindow.js Line: 188

Pencil.selectDeveloperStencilDir = function () { //alert("Please select the directory that contains the 'Definition.xml' file of your stencil"); var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, "Select Developer Stencil 'Definition.xml' file", nsIFilePicker.modeGetFile); // fp.appendFilter("Definition.xml", "Definition.xml"); // JJ: .appendfilter seems to only accept filters in the format of .??? fp.appendFilter("Definition.xml", ".xml");

Original issue: http://code.google.com/p/evoluspencil/issues/detail?id=539

prikhi avatar Mar 13 '15 19:03 prikhi

I've Tried to use fp.appendFilter("Definition.xml", "*.xml"); but didn't work

fabionaka avatar Jul 13 '15 19:07 fabionaka

@fabionaka that's concerning... the documentation shows your code should work fine: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#appendFilter()

Can you try it without the * like in the original report? fp.appendFilter("Definition.xml", ".xml");

prikhi avatar Dec 11 '15 03:12 prikhi

On OSX: apparently you have to delete the cached application files in ~/Library/Pencil. Once I did that the changes made to /Applications/Pencil.app/Contents/Resources/content/pencil/mainWindow.js began working. Also the correct line is now https://github.com/prikhi/pencil/blob/develop/app/content/pencil/mainWindow.js#L180

dingus9 avatar Dec 15 '15 07:12 dingus9

So this is already fixed?

And it's safe to remove the whole ~/Library/Pencil folder(or are the cached files in a sub-directory?)? If so I'll add it to the install/upgrade instructions for OS X.

On Tue, Dec 15, 2015 at 2:43 AM, Nick Shobe [email protected] wrote:

On OSX: apparently you have to delete the cached application files in ~/Library/Pencil. Once I did that the changes made to /Applications/Pencil.app/Contents/Resources/content/pencil/mainWindow.js began working. Also the correct line is now https://github.com/prikhi/pencil/blob/develop/app/content/pencil/mainWindow.js#L180

— Reply to this email directly or view it on GitHub https://github.com/prikhi/pencil/issues/539#issuecomment-164675342.

prikhi avatar Dec 15 '15 14:12 prikhi

sorry was reading from email... I'm assuming you meant the correct line is in the PR? https://github.com/prikhi/pencil/pull/772/files#diff-96a65e0f90225969027af243ae164e1cR180

prikhi avatar Dec 15 '15 15:12 prikhi