it would be really cool if we could show native icons in the directory viewer. Turns out it's incredibly simple. Attaching a one line patch the only confusion I'm having is how to show a folder icon...
Does it work on Mac? :)
don't think so... you have to figure out how to get imglib to paint native icons, and then hook them up to the moz-icon protocol
well it's still a good start :)
Yes it works on Mac. Simon you need to try out the mailnews client =). I'm painting native mac and windows icons in the attachment pane. moz-icon urls work on the Mac and on Windows. =)
Hmmm, interesting... http://lxr.mozilla.org/mozilla/source/modules/libpr0n/decoders/icon/mac/ nsIconChannel.cpp looks like there's a couple of slightly dodgy assumptions in there, like icons being 8 bit never 24, and the only possible icon sizes being 16 and 32, but all in all its a cool thing to have. Will file bugs on those if/when I see problems stemming from those assumptions. The code uses PBDTGetIcon which is supported in Carbon, though I wonder if some of the code would be more future proof (128x128 icons etc) if ported to use the newer IconServices APIs?
Yes, it should use Icon Services. And instead of reading the pixels directly, I think it would be safer to draw to a GWorld, and convert that to an nsIImage.
Just FYI, I have patches (bug 78148) to move file:/// to html format, but they probably won't be turned on for a while. My patches use the same icons ns4 does, or would if they actually still worked (I'm about to file a bug on pav for that - they did work not that long ago)
*** Bug 82687 has been marked as a duplicate of this bug. ***
xp-apps - directory viewer
Component: Networking: File → XP Apps
QA Contact: tever → sairuh
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.0
Alec: native Mac icon support bug is 66814 - has a patch, needs review. I'd also repeat my comment: IconServices is a very nice modern API for doing this and the existing code should probably be replaced by an IconServices implementation.
Depends on: 66814
Note that we'll be moving to html soon for all the listings, at least until this moves to outliner. After my patch, that uses the 4.7 icons, but if someone can give me a url I can get them to use these instead.
Bradely, as I understand it this is about showing the directory browser for local (file:///) URLs. So when it says "native icons" it means "the icon the file has on my local disk here" rather than a set of generic document icons as FTP uses.
yes, but as of tomorrow (hopefully) file (and gopher) will follow the pref which ftp does for whether to use xul or html for directory listings - see bug 78148 And I'd like to do this, too, if you can give me a way which will work on all platforms.
OK cool - then I think that depends which way you want to go - if you have an nsIImage for the icon you want to show and you need a native mac icon, then you need the patch I linked in the bug above. However, I think its much more likely that you have a URL pointing to the file on disk you want to display the icon for? In that case I think the protocol moz- icon: can be used to display the correct icon for the file, and you shouldn't have to do anything other than generate URLs in the right format. I'm not sure what one needs to put in the URL exactly... possibly the path of a file on disk? From the first patch on this bug I think not. I just tried that in yesterday's build (typing it into the URL bar on Mac OS) and it didn't work. So, anyone know precisely what needs to be done?
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
this would be cool, but the directory viewer isn't even used anymore. futuring for now, but I still think it would be neat. Hopefully someone else will take the reins on this...
Target Milestone: mozilla1.2alpha → Future
Was this (patch) fixed/included in bug 113742 patch !? See <http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/suite/common/directory/directory.xul&rev=1.40&mark=47-48#24>
Assignee: alecf → jag
Status: ASSIGNED → NEW
Priority: P3 → --
QA Contact: bugzilla
Target Milestone: Future → ---
Well, I just tried it, and no native icons appear in Firefox or Camino. So if it was ever fixed then it's broken again.
WORKSFORME: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b12pre) Gecko/20110212 Firefox/4.0b12pre SeaMonkey/2.1b3pre
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.