![]() Registered Member ![]()
|
Hi there!
I'm participating in an app with some level of cross desktop environment compatibility. One of the things is that it uses each DE's default file chooser, so if I'm in gnome it uses the gnome file chooser, while if I'm in KDE, I'll use the KDE one. The binary cannot, obviously, have any static dependencies. Everything is detected at runtime, and everything is working fine, with the exception of the kde file chooser which is not implemented. So, some first questions. - which shared object do I need to dlopen ? will libkdeui be enough ? - considering kde is c++ and therefore name decoration is an issue, how can I inspect the exported symbols of the .so file, so I know what to import ? Are there functions exported with C naming ? Any recommendations or pointers would be appreciated. Thank you |
![]() Registered Member ![]()
|
It seems I can read the contents of the so files using "readelf -s -W file". But there's too much info there, and difficult to sort out.
|
![]() Registered Member ![]()
|
One approach could be to, once the app has determined it is running in KDE, to do something as simple as launching a cli app from within the program to display the file-selector.
I.e kdialog --getopenfilename /home Opens the file-selector, starting in /home.
OpenSUSE 11.4, 64-bit with KDE 4.6.4
Proud to be a member of KDE forums since 2008-Oct. |
![]() Registered Member ![]()
|
Wow, that's nice ! It works. Have to check if it's acceptable per the app's achitecture
![]() |
![]() KDE Developer ![]()
|
In this case be sure you use the --attach command line argument to make the dialog transient for the window calling it.
This relationship information is used by window manager to decide whether to bring a window to the foreground when it shows (focus stealing prevention). Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
It seems using kdialog is good ! Thank you very much
![]() |
![]() Registered Member ![]()
|
Hi there,
I'd love to combine kdialog/kde file chosser within fortran. In g95 I can call kdialog like this: call system('kdialog --getopenfilename /home/memyself/ filter') But how can I assign the return value/file name to a fortran variable ? |
![]() KDE Developer ![]()
|
That's more a Fortran question than anything else. In C, system() also just executes the command without any output, but there is another function called popen() which executes a command and gives you an inpu/output handle for it. Maybe something similar exists in Fortran as well Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
OK, here is a (somewhat clumsy) solution:
the answer=selected_file_name is written to file: answer_file which then can be read: call system('kdialog --getopenfilename /home/memyself/ filter > answer_file') |
![]() Registered Member ![]()
|
Can this be done for Opera. currently Opera either uses QT file choser or if i change the values in opera:config, it uses the GTK file picker..
any idea how this can be accomplished in Opera 10.10 |
![]() Administrator ![]()
|
Are you using the shared Qt 4 builds of Opera? By default they forward you to Qt 3, or the static Qt 4 builds, which are unable to use the KDE 4 file picker.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Hi there.. thanks for your query.. I'm using the qt4 build and not the shared one!
In my recent figetting around, I found something. When using OpenSUSE 11.2 with KDE 4.4 beta1, there is a "window specific" behavior which is added in the "windows" option of "Appearance" option under system settings. When I added (opera) to the list of applications there, it seemed to work perfectly. The KDE file picker was shown and it worked well. I tried doing something like that in Kubuntu, but I'm not that big a techie.. any help there? |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]