if user is xfce4 user [startxfce4 or xfce4-session in running procs] then use exo-open (needs libexo) to open urls using the xfce defined default apps

This commit is contained in:
Nikos Kouremenos 2006-10-20 09:22:17 +00:00
parent 62051dd998
commit d63d78be66
3 changed files with 12 additions and 1 deletions

View File

@ -3001,6 +3001,7 @@ Disabled</property>
<property name="items" translatable="yes">Autodetect on every Gajim startup
Always use GNOME default applications
Always use KDE default applications
Always use XFCE4 default applications
Custom</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>

View File

@ -929,7 +929,7 @@ class PreferencesWindow:
def on_applications_combobox_changed(self, widget):
gajim.config.set('autodetect_browser_mailer', False)
if widget.get_active() == 3:
if widget.get_active() == 4:
self.xml.get_widget('custom_apps_frame').show()
gajim.config.set('openwith', 'custom')
else:
@ -939,6 +939,8 @@ class PreferencesWindow:
gajim.config.set('openwith', 'gnome-open')
elif widget.get_active() == 2:
gajim.config.set('openwith', 'kfmclient exec')
elif widget.get_active() == 3:
gajim.config.set('openwith', 'exo-open')
self.xml.get_widget('custom_apps_frame').hide()
gajim.interface.save_config()

View File

@ -188,6 +188,8 @@ def autodetect_browser_mailer():
gajim.config.set('openwith', 'gnome-open')
elif user_runs_kde():
gajim.config.set('openwith', 'kfmclient exec')
elif user_runs_xfce():
gajim.config.set('openwith', 'exo-open')
else:
gajim.config.set('openwith', 'custom')
@ -197,6 +199,12 @@ def user_runs_gnome():
def user_runs_kde():
return 'startkde' in get_running_processes()
der user_runs_xfce():
procs = get_running_processes()
if 'startxfce4' in procs or 'xfce4-session' in procs:
return True
return False
def get_running_processes():
'''returns running processes or None (if not /proc exists)'''
if os.path.isdir('/proc'):