New DocumentWindow wiki page - How to do this on Linux / Mac?
I have just added a "page":http://developer.qt.nokia.com/wiki/Assigning_a_file_type_to_an_Application_on_Windows in the Snippets category that details a class to deal with file type registration for editors on windows. I would really welcome any comments you may have, on the text of the Wiki page or the API of the class.
Thanks a lot.
The first codeblock hides part of the ToC - we don't have a fix for that :/
I've seen this, but how to solve it?
insert empty lines is no solution... :-(
If someone has an idea how to do this on linux / on the mac, it would be nice to know, so we can adapt the class to be more general and platform independant.
On linux, you edit /etc/mailcap and /etc/mime.types to achieve this. I never done it manualy only through a gui. So im not a real help here. :(
Here a litle example:
video/mpeg mpeg mpg mpe
video/quicktime qt mov
video/mpeg; /usr/bin/mplayer '%s'; description="MPEG Video Format"; test=test -n "$DISPLAY"
video/quicktime; /usr/bin/mplayer '%s'; description="Apple Quicktime Video"; test=test -n "$DISPLAY"
video/x-mpeg2; /usr/bin/mplayer '%s'; description="MPEG Video"; test=test -n "$DISPLAY"
video/x-mpeg; /usr/bin/mplayer '%s'; description="MPEG 2 Video"; test=test -n "$DISPLAY"
video/mpeg; /usr/bin/mplayer '%s'; description="MPEG 2 Video"; test=test -n "$DISPLAY"
video/x-ms-afs; /usr/bin/mplayer '%s'; description="Audio Video Interleave - Microsoft"; test=test -n "$DISPLAY"
video/x-ms-asf; /usr/bin/mplayer '%s'; description="MS ASF video"; test=test -n "$DISPLAY"
hi vinb, thanks for the info.
I will look into this, I'm sure it is possible...
My biggest problem was: I did not know where the information is located...
im only happy that i can help(a little) you for once ;)
you can check "this":http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html or "this":http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec for more info.
I know for sure that it can be done on Linux, but you have kind of situation like of HTML before W3C gained ground, everybody (Gnome, KDE, Xfce) does things in its own way, as there is no standard which gained ground.
At least with /etc/mime.types and /etc/mailcap you can define types, but to assign apps which will open some type of document you'll need to check GConf/gconf-editor for Gnome (e.g. for Ubuntu till Unity, dconf-editor for Ubuntu with Unity), KDE is simpler but files do not have letter G in them... :)
/etc/alternatives dir with symlinks is also part of the game. Hopefully LSB (Linux Standard Base) will get it eventually.
[quote author="mariusg" date="1301476705"]The first codeblock hides part of the ToC - we don't have a fix for that :/[/quote]
I ”solved” this by adding one new line.
This is more of normal CSS layouting issue than related to Wiki: unless you say so, table-like elements will not go over each other.
The TOC has its own space, which limits the space other elements can take. This is all wanted, because otherwise elements would be under that TOC, being completely unreadable. So TOC must have its own space only for itself.
When adding full-width element like code block, if it is next to TOC, it must either be made smaller than full-width or moved below the TOC. Depending of how the site is designed, it behaves like one of these.
This line I added moved the code block enough of pixels lower that it is not anymore considered to be next of TOC, hence be able to use full wiki page width for itself. So if there isn’t enough of ”preview” text for article before first code block, this will happen. Just means that maybe there is something else that could be written? ;)
EDIT: or did it go below / top of TOC before? Anyway, this is why it behaves so...
EDIT2: Okay, sorry everyone, now I see this is old post...
Thank you for the great article. However, it seems to be a little bit outdated now. Your code does not seem to work with the following combination (sorry cannot locate the problem exactly):
- windows 7 64-bit
- mingw64 gcc 4.8.0
DDE messages work if the process is already running. But DDE fails at the first startup when double-clicking the icon: It yields the Windows error message "There was a problem sending the command to the program".
BTW, other posts suggest that DDE is deprecated and one should use "DropTarget" and COM instead. However, I could not figure out how to do this with activeqt, either.
Any help will be appreciated…
PS: On 64-bit the code (line 233-234)
@ //IA64: Assume DDE LPARAMs are still 32-bit
Q_ASSERT(::UnpackDDElParam(WM_DDE_EXECUTE, message->lParam, &unused, (UINT_PTR*)&hData));
@ had to be replaced to use "message->lParam" directly with no UnpackDDElParam(). This yields the command string which is otherwise corrupted.