prikhi / pencil

DEPRECATED: Multiplatform GUI Prototyping/Wireframing
https://github.com/evolus/pencil
GNU General Public License v2.0
1.92k stars 193 forks source link

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

Open prikhi opened 9 years ago

prikhi commented 9 years ago

From j...@saec-kv.com on February 10, 2013 02:58:21

What steps will reproduce the problem? 1. Select from Menu: Tools/Developer Tools/Load Developer Stencil Directory...

  1. 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

fabionaka commented 9 years ago

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

prikhi commented 8 years ago

@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");

dingus9 commented 8 years ago

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

prikhi commented 8 years ago

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 notifications@github.com 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 commented 8 years ago

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