From: Andrej N. G. <an...@re...> - 2012-11-17 21:07:19
|
Hello! Sergio has written on Saturday, 17 November, at 9:30: >> > Hi, how are these GNOME and KDE template formats? GNOME way is to create (empty or minimal, depending on what you want) file in ~/Templates, such as: image.jpeg script.sh file.txt document.odt KDE way is to create some ShellScript.desktop file with contents: [Desktop Entry] Name=Shell script ... Comment=Enter the shell script file name: Type=Link URL=script.sh Icon=system-run >> > If it's just any file with a descriptive name and some >> > common content then it works in Thunar but not in >> pcmanfm: >> >(thunar→) http://www.zimagez.com/zimage/screenshot-11172012-031118pm.php >> (correct pcmanfm here →) http://www.zimagez.com/zimage/screenshot-11172012-031256pm.php I see. Your files seems to be something neither clean GNOME nor KDE. >> > I forgot if it worked in pcmanfm before this change. Never. It's new functionality, it's why I asked you to test. >> > Also, as seen on the image, context menu offers only >> to >> > create a new 'Folder'. In Edit menu it still offers >> 'Blank >> > File' but it doesn't work. I hope, 'Blank File' in Edit menu should work after last changes. And context menu shows only entries which were recognized. There was no deep test (for file content) done because in most cases (as GNOME way assumes often empty file) template type should be recognized by its name. Therefore your non-suffixed files were ignored. And since file name is a hint to create new file from template (where suffix is preserved and the dialog offers you to change name part of file name - i.e. from text.txt you'll replace "text" while ".txt" will stay) it's not convenient to have it not-suffixed. >> > A side-note is that that desktop file is called >> 'Desktop >> > File' (not 'Desktop File.desktop') and pcmanfm >> recognizes >> > it's a desktop file by its contents and doesn't display >> its >> > name (because the 'Name' key is empty). Yes, pcmanfm folder view will recognize it but templates filter (which attempts to remove duplicates, hidden and invalid entries) assumes it is not template. May be the templates filter of libfm should be loosed a bit. I would like to see file names of your templates and contents of them to have clues. You know, loosing the check may make duplicates and wrong entries other users will complain about... that's hard decision. I have, for example, 19 entries in /usr/share/templates, and only 5 of those are functional, others work only in KDE4. And some number of entries are under /opt/* as well. And without check I can end up with very big list where most will not work. And guessing from contents may give such recognitions as "undefined" or "binary file" (application/octet-stream. How about some prompt text: "Enter the name for new Undefined:" in window "Creating new Undefined"? Are you sure it is OK to have such entries in templates submenu? ;) I understand, user should blame himself if he/she puts such junk into Templates folder but I think we should filter it. Or we should not? If it's better not filter such things I will enable guessing from content. What do you think? WBR, Andriy. |
From: Andrej N. G. <an...@re...> - 2012-11-17 22:02:03
|
Hello! Stephan Sokolow has written on Saturday, 17 November, at 16:36: >On 12-11-17 04:07 PM, Andrej N. Gritsenko wrote: >> >> GNOME way is to create (empty or minimal, depending on what you want) >> file in ~/Templates, such as: >> >> image.jpeg >> script.sh >> file.txt >> document.odt >> > > KDE way is to create some ShellScript.desktop file with contents: >So, let me get this straight. GNOME somehow managed to get the Nautilus >templates folder into ~/.config/user-dirs.dirs alongside stuff that's >actually used by more than one application in the same desktop >environment like the desktop, documents, downloads, pictures, and music >folders? Precisely. It's XDG_TEMPLATES_DIR statement in that file. >My first (sane) impression was that it was something where you drop >templates for all applications and each application filters by filetype >for only its own formats but, if I understand you correctly, doing so >would render Nautilus's New menu uselessly large. >(eg. Suppose everything supported it and I dropped 10 LibreOffice >templates and 5 Inkscape ones in there.) Exactly. Each file in ~/Templates will be added by Nautilus to the 'New' submenu. I've implemented it such way pcmanfm will show only one file per file type (i.e. only one LibreOffice text doc or only one JPEG file) and it's why I do some filtering which caused the beforementioned effect. >Given that I've never seen a file manager other than Nautilus that >supports parsing a ".hidden" file to hide non-dotfiles, I tend to blame >GNOME developers' NIH syndrome whenever I see a non-hidden folder in my >homedir getting regenerated but I don't actually expect to see such an >impression confirmed in a standard. GNOME ways are sometimes very out of common sense. That's why I prefer to avoid GNOME ways sometimes. :) Cheers! Andriy. |
From: Andrej N. G. <an...@re...> - 2012-11-17 23:20:54
|
Hello! Stephan Sokolow has written on Saturday, 17 November, at 17:24: >On 12-11-17 05:01 PM, Andrej N. Gritsenko wrote: >> Exactly. Each file in ~/Templates will be added by Nautilus to the 'New' >> submenu. I've implemented it such way pcmanfm will show only one file per >> file type (i.e. only one LibreOffice text doc or only one JPEG file) and >> it's why I do some filtering which caused the beforementioned effect. >Do you have a clear plan for how the user will select the one to appear? >(Hopefully, something less amateurish than how, in the 2000s, all the >Windows users were sticking "!!" at the beginning of their torrents' >README files to game the explorer.exe sorting algorithm) The implementation allows creation of simple .desktop file which will override any names and select one of them which will be used as template. For example: [Desktop Entry] Type=Link URL=The Document.odt >Also, have you given any thought to potential alternative >implementations that could overcome that "one entry per type" >limitation? (eg. Suppose I wanted multiple .txt templates and I wasn't >using Vim+SnipMate for that) The way I've implemented it removes duplicates but probably it would be good to add a setting to select another behavior - remove duplicates by basename, not by type. It will show all your LibreOffice documents from your example in 'Create New' submenu though. >>> Given that I've never seen a file manager other than Nautilus that >>> supports parsing a ".hidden" file to hide non-dotfiles, I tend to blame >>> GNOME developers' NIH syndrome whenever I see a non-hidden folder in my >>> homedir getting regenerated but I don't actually expect to see such an >>> impression confirmed in a standard. >> GNOME ways are sometimes very out of common sense. That's why I prefer to >> avoid GNOME ways sometimes. :) >Agreed, though I'd definitely love it if ".hidden" started to get used >outside Nautilus so I could have the option of hiding things I almost >never visit and only in the terminal (like /proc and /sys) from my GTK+ >Open/Save dialogs and PCManFM. It'd make for a much cleaner experience. >...not to mention allowing me to hide things like ~/espeak-data while I >wait to see if devs are going to actually fix reported use-of-filesystem >bugs. I would like to avoid such things very much. They may be changed by GNOME people in any moment and if I want to follow any step of GNOME then I would just use GNOME. Let follow standards (XDG specifications). If we reimplement some bloated and dirty things we multiply the mess which they made for own sake. The more we use Nautilus hacks the more we will behave Nautilus-like, heavy and fat. I'm sorry. Let make it convenient but use only standard means, OK? WBR, Andriy. |