KGtk (Use KDE Dialogs in Gtk Apps) 0.9.6

Craig Drummond Craig.Drummond at lycos.co.uk
Thu Jun 12 23:47:23 CEST 2008


Name: KGtk (Use KDE Dialogs in Gtk Apps)
Version: 0.9.6
Type: KDE Improvement
Depend: 
License: GPL
More Info:
http://www.kde-apps.org/content/show.php?content=36077

Description:
 This is a quick-and-dirty LD_PRELOAD hack that
allows *some* Gtk applications to use KDE's file
dialogs when run under KDE. 

The Gtk file chooser functions have been
overridden to communicate with this KDE
module/application.

After compiling and installing this, you can run
Gtk applications in 2 ways:

A. call /usr/local/bin/kgtk-wrapper gimp

B. i. Create a symbolic link from the wrapper
script to your application, e.g.
       ln -s /usr/local/bin/kgtk-wrapper
/usr/local/bin/gimp
   ii. Make sure /usr/local/bin is before /usr/bin
(or wherever gimp is installed) in your $PATH
   iii. Now simply run 'gimp' - this should find
the wrapper script first.

If this works OK, then edit the .desktop file
(e.g. /usr/share/applications/gimp.desktop) to
have "Exec=/usr/local/bin/[appname]"  instead of
"Exec=[appname]", e.g. for gimp.desktop this would
be:

    Exec=/usr/local/bin/gimp-remote-2.2 %U

or:

    Exec=/usr/local/bin/kgtk-wrapper
gimp-remote-2.2 %U


So far I have tested this with the following
applications:

1. Kino. Works perfectly - in fact Kino was my
main reason for doing this.
2. Firefox. Works with Firefox 1.5, but *not*
Firefox 1.0.x
3. GIMP. Again, seems to work just fine. However,
there is no progress bar on file loading - as GIMP
uses a progress bar embedded in the file chooser.
4. Inkscape. Works OK - at least 0.43
5. Streamtuner - the folder browser button works.
6. AbiWord - does *not* work. Don't even try...
7. Glade2. Seems to work OK, however I have had it
crash when loading Kino's .glade file, but not
always. So I'm not sure if this is Glade's fault,
or mine.
8. Eclipse. Will work only if dlsym can be
overriden

As the only Gtk apps I use are Kino, GIMP, and a
little of Firefox, this library works great for
me. Your millage may vary, and please note that
this is only a quick hack to get things working
now for me. I'm not sure how stable it will be
under heavy usage, so don't be surprised if it
breaks. However, if it does break - the only thing
that should happen is that the Gtk apps will fall
back to using the standard Gtk dialogs.

The 'Portland' freedesktop project will
undoubtedly come up with a far better solution.
But until then, you can give this a try.

p.s. Before anyone asks, as they always do:
Widget style: QtCurve, works for KDE and Gtk (also
does KDE->Gtk icon mapping). This is set on the
"Clear" variation.
Window decoration: Crystal with Knifty buttons
Font: Verdana. However, I have recompiled FreeType
with the TrueType byte encoder enabled - this give
great looking non anti-aliased fonts (otherwise
they look *horrible*)


Changelog:
 0.9.6
-----
1. Fix russion translation files - thanks to Yar
Odin
2. Fix some CMake 2.6 issues.

0.9.5
-----
1. Fix detection of firefox. Treat xulrunner as
Firefox.
2. Quick hack for kino - always save as .kino
3. Prevent dummy gtk window from appearing in
KDE4's 'present windows' window selector.
4. Translations:
       Brazillian Portuguese (pt_BR) Márcio
Moraes
       Russion (ru) Yar Odin
5. Fix kdialogd4's file widget.
6. Fix kgtk-wrapper script for relative paths -
thanks to Ingo Müller.
7. set G_BROKEN_FILENAMES=1 for non UTF8 locales.

0.9.4
-----
1. Translations:
       Spanish (es) Marco Antonio Blanco 
2. When saving with opera, show the suggested
filename.

0.9.3
-----
1. Translations:
       German (de) jakuhr-linux at gmx.de
       Czech  (cs) Marián Kyral 
2. Fix firefox crash when overwriting an existing
file.


0.9.2
-----
1. Remove 'which gimp' from kgtk-wrapper - oops!
2. In kgtk-wrapper, set opera to use qt3
3. Fix opera crash.
4. Use GLib's convert function to convert to/from
utf8, and to/from URIs
5. Walk through Qt3's QFileDialog's children to
locate combobox containing filetypes, as opposed
to using a copy of QFileDialogPrivate
6. Translations:
       Simplified Chinese (zh_CN) Liang Qi 
       French             (fr)    Paul Thomas 
       British English    (en_GB) Me!
7. Implement over-riding of non statically called
Qt4 QFileDialogs

0.9.1
-----
1. Use cmake as build system.
2. Fix recognition of gimp 2.4
3. Fix translation of standard kde strings.
4. Fix case where kgtk-wrapper is called via a
symlink.

0.9
---
1. Fix dialog parenting issues with Gtk folder
picker combo/menu.
2. Fix compilation issue for KDE < 3.4
3. Treat Iceweasel and Swiftfox the same as
firefox.
4. Improve operation under beryl.
5. Add KDE4 and Qt4 support.
6. Reduce heavy CPU usage of kqt
7. Fix some i18n issues.
8. Place wrapper scripts into prefix/bin, and
libraries into prefix/lib/kgtk
9. kgtk-wrapper can now be called for Gtk2, Qt3,
and Qt4 apps. The app is checked to determine
which toolkit it is using. If this check fails,
you may edit ~/.kde/share/config/kgtkrc and add
lines such as

   [Apps]
   eclipse=gtk2
   scribus=qt3
   abiword=x

   Setting "abiword=x" disables kgtk for abiword
(as it doesnt work!)



More information about the Kde-announce-apps mailing list