code for instantly apply changements about links grabber
function to launch the application
This commit is contained in:
parent
e6b04e8159
commit
09ce159387
3 changed files with 43 additions and 22 deletions
|
@ -337,17 +337,6 @@ class preferences_window:
|
||||||
del self.plugin.config['msg%i' % i]
|
del self.plugin.config['msg%i' % i]
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
#open links with
|
|
||||||
if self.links_open_with_combobox.get_active() == 0:
|
|
||||||
self.plugin.config['openwith'] = 'gnome-open'
|
|
||||||
elif self.links_open_with_combobox.get_active() == 1:
|
|
||||||
self.plugin.config['openwith'] = 'kfmclient exec'
|
|
||||||
elif self.links_open_with_combobox.get_active() == 2:
|
|
||||||
self.plugin.config['openwith'] = 'custom'
|
|
||||||
self.plugin.config['custombrowser'] = \
|
|
||||||
self.xml.get_widget('custom_browser_entry').get_text()
|
|
||||||
self.plugin.config['custommailapp'] = \
|
|
||||||
self.xml.get_widget('custom_mail_app_entry').get_text()
|
|
||||||
#log presences in user file
|
#log presences in user file
|
||||||
if self.xml.get_widget('chk_log_pres_usr').get_active():
|
if self.xml.get_widget('chk_log_pres_usr').get_active():
|
||||||
self.config_logger['lognotusr'] = 1
|
self.config_logger['lognotusr'] = 1
|
||||||
|
@ -620,9 +609,20 @@ class preferences_window:
|
||||||
def on_links_open_with_combobox_changed(self, widget):
|
def on_links_open_with_combobox_changed(self, widget):
|
||||||
if widget.get_active() == 2:
|
if widget.get_active() == 2:
|
||||||
self.xml.get_widget('custom_apps_frame').set_sensitive(True)
|
self.xml.get_widget('custom_apps_frame').set_sensitive(True)
|
||||||
|
self.plugin.config['openwith'] = 'custom'
|
||||||
else:
|
else:
|
||||||
|
if widget.get_active() == 0:
|
||||||
|
self.plugin.config['openwith'] = 'gnome-open'
|
||||||
|
if widget.get_active() == 1:
|
||||||
|
self.plugin.config['openwith'] = 'kfmclient exec'
|
||||||
self.xml.get_widget('custom_apps_frame').set_sensitive(False)
|
self.xml.get_widget('custom_apps_frame').set_sensitive(False)
|
||||||
|
|
||||||
|
def on_custom_browser_entry_changed(self, widget):
|
||||||
|
self.plugin.config['custombrowser'] = widget.get_text()
|
||||||
|
|
||||||
|
def on_custom_mail_client_entry_changed(self, widget):
|
||||||
|
self.plugin.config['custommailapp'] = widget.get_text()
|
||||||
|
|
||||||
def __init__(self, plugin):
|
def __init__(self, plugin):
|
||||||
"""Initialize Preference window"""
|
"""Initialize Preference window"""
|
||||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'preferences_window', APP)
|
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'preferences_window', APP)
|
||||||
|
@ -887,10 +887,10 @@ class preferences_window:
|
||||||
elif self.plugin.config['openwith'] == 'custom':
|
elif self.plugin.config['openwith'] == 'custom':
|
||||||
self.links_open_with_combobox.set_active(2)
|
self.links_open_with_combobox.set_active(2)
|
||||||
self.xml.get_widget('custom_apps_frame').set_sensitive(True)
|
self.xml.get_widget('custom_apps_frame').set_sensitive(True)
|
||||||
self.xml.get_widget('custom_browser_entry').set_text(\
|
self.xml.get_widget('custom_browser_entry').set_text(\
|
||||||
self.plugin.config['custombrowser'])
|
self.plugin.config['custombrowser'])
|
||||||
self.xml.get_widget('custom_mail_app_entry').set_text(\
|
self.xml.get_widget('custom_mail_client_entry').set_text(\
|
||||||
self.plugin.config['custommailapp'])
|
self.plugin.config['custommailapp'])
|
||||||
|
|
||||||
#log presences in user file
|
#log presences in user file
|
||||||
st = self.config_logger['lognotusr']
|
st = self.config_logger['lognotusr']
|
||||||
|
|
|
@ -5347,10 +5347,11 @@ Custom</property>
|
||||||
<property name="editable">True</property>
|
<property name="editable">True</property>
|
||||||
<property name="visibility">True</property>
|
<property name="visibility">True</property>
|
||||||
<property name="max_length">0</property>
|
<property name="max_length">0</property>
|
||||||
<property name="text" translatable="yes">thunderbird -remote 'mailto(%s)'</property>
|
<property name="text" translatable="yes"></property>
|
||||||
<property name="has_frame">True</property>
|
<property name="has_frame">True</property>
|
||||||
<property name="invisible_char">*</property>
|
<property name="invisible_char">*</property>
|
||||||
<property name="activates_default">False</property>
|
<property name="activates_default">False</property>
|
||||||
|
<signal name="changed" handler="on_custom_mail_client_entry_changed" last_modification_time="Tue, 08 Mar 2005 19:59:41 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
@ -5368,10 +5369,11 @@ Custom</property>
|
||||||
<property name="editable">True</property>
|
<property name="editable">True</property>
|
||||||
<property name="visibility">True</property>
|
<property name="visibility">True</property>
|
||||||
<property name="max_length">0</property>
|
<property name="max_length">0</property>
|
||||||
<property name="text" translatable="yes">firefox -remote 'OpenURL(%s)'</property>
|
<property name="text" translatable="yes"></property>
|
||||||
<property name="has_frame">True</property>
|
<property name="has_frame">True</property>
|
||||||
<property name="invisible_char">*</property>
|
<property name="invisible_char">*</property>
|
||||||
<property name="activates_default">False</property>
|
<property name="activates_default">False</property>
|
||||||
|
<signal name="changed" handler="on_custom_browser_entry_changed" last_modification_time="Tue, 08 Mar 2005 19:59:36 GMT"/>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
|
|
@ -228,7 +228,27 @@ class tabbed_chat_window:
|
||||||
self.on_tabbed_chat_window_key_press_event)
|
self.on_tabbed_chat_window_key_press_event)
|
||||||
self.xml.signal_connect('on_chat_notebook_switch_page', \
|
self.xml.signal_connect('on_chat_notebook_switch_page', \
|
||||||
self.on_chat_notebook_switch_page)
|
self.on_chat_notebook_switch_page)
|
||||||
#self.xml.signal_autoconnect(self) #FIXME: (nk) THIS SEGFAULTS GAJIM. WHY? -> (asterix) we delete the first page, so we delete the widgets, so we don't want to connect associated signals.
|
|
||||||
|
def run_application(self, type, url):
|
||||||
|
#type = 'url' or 'mail'
|
||||||
|
if self.plugin.config['openwith'] == 'gnome-open':
|
||||||
|
app = 'gnome-open'
|
||||||
|
args = ['gnome-open']
|
||||||
|
args.append(url)
|
||||||
|
elif self.plugin.config['openwith'] == 'kfmclient exec':
|
||||||
|
app = 'kfmclient'
|
||||||
|
args = ['kfmclient', 'exec']
|
||||||
|
elif self.plugin.config['openwith'] == 'custom':
|
||||||
|
if type == 'url':
|
||||||
|
conf = self.plugin.config['custombrowser']
|
||||||
|
if type == 'mail':
|
||||||
|
conf = self.plugin.config['custommailapp']
|
||||||
|
if conf == '':
|
||||||
|
return
|
||||||
|
args = conf.split()
|
||||||
|
app = args[0]
|
||||||
|
args.append(url)
|
||||||
|
os.spawnvp(os.P_NOWAIT, app, args)
|
||||||
|
|
||||||
def update_tags(self):
|
def update_tags(self):
|
||||||
for jid in self.tagIn:
|
for jid in self.tagIn:
|
||||||
|
@ -1337,7 +1357,6 @@ class Groupchat_window:
|
||||||
self.on_chat_notebook_switch_page)
|
self.on_chat_notebook_switch_page)
|
||||||
self.xml.signal_connect('on_set_button_clicked', \
|
self.xml.signal_connect('on_set_button_clicked', \
|
||||||
self.on_set_button_clicked)
|
self.on_set_button_clicked)
|
||||||
#FIXME: (nk) WHY AUTOCONNECT segfaults? [haven't test here but looks the same] with tabbed chat window ;P
|
|
||||||
|
|
||||||
class history_window:
|
class history_window:
|
||||||
"""Class for bowser agent window :
|
"""Class for bowser agent window :
|
||||||
|
@ -3418,9 +3437,9 @@ class plugin:
|
||||||
'sound_contact_disconnected_file': 'sounds/disconnected.wav',\
|
'sound_contact_disconnected_file': 'sounds/disconnected.wav',\
|
||||||
'sound_message_sent': 1,\
|
'sound_message_sent': 1,\
|
||||||
'sound_message_sent_file': 'sounds/sent.wav',\
|
'sound_message_sent_file': 'sounds/sent.wav',\
|
||||||
'openwith': 'gnome-open', \
|
'openwith': 'gnome-open',\
|
||||||
'custombrowser' : '', \
|
'custombrowser' : 'firefox',\
|
||||||
'custommailapp' : '', \
|
'custommailapp' : 'thunderbird',\
|
||||||
'x-position': 0,\
|
'x-position': 0,\
|
||||||
'y-position': 0,\
|
'y-position': 0,\
|
||||||
'width': 150,\
|
'width': 150,\
|
||||||
|
|
Loading…
Add table
Reference in a new issue