when in windows open links/mailtos with default application. arnaud njoy
This commit is contained in:
		
							parent
							
								
									7aaffae0dc
								
							
						
					
					
						commit
						36bf675fd3
					
				
					 3 changed files with 33 additions and 17 deletions
				
			
		| 
						 | 
					@ -86,6 +86,10 @@ class Preferences_window:
 | 
				
			||||||
		if self.plugin.systray_capabilities:
 | 
							if self.plugin.systray_capabilities:
 | 
				
			||||||
			st = gajim.config.get('trayicon')
 | 
								st = gajim.config.get('trayicon')
 | 
				
			||||||
			self.trayicon_checkbutton.set_active(st)
 | 
								self.trayicon_checkbutton.set_active(st)
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
 | 
								if os.name == 'nt':
 | 
				
			||||||
 | 
									self.trayicon_checkbutton.hide()
 | 
				
			||||||
 | 
									self.trayicon_checkbutton.set_no_show_all(True)
 | 
				
			||||||
			else:
 | 
								else:
 | 
				
			||||||
				self.trayicon_checkbutton.set_sensitive(False)
 | 
									self.trayicon_checkbutton.set_sensitive(False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -231,6 +235,8 @@ class Preferences_window:
 | 
				
			||||||
			set_active(gajim.config.get('ignore_unknown_contacts'))
 | 
								set_active(gajim.config.get('ignore_unknown_contacts'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		#sounds
 | 
							#sounds
 | 
				
			||||||
 | 
							if os.name == 'nt': # if windows, player must not become visible on show_all
 | 
				
			||||||
 | 
								self.xml.get_widget('soundplayer_hbox').set_no_show_all(True)
 | 
				
			||||||
		if gajim.config.get('sounds_on'):
 | 
							if gajim.config.get('sounds_on'):
 | 
				
			||||||
			self.xml.get_widget('play_sounds_checkbutton').set_active(True)
 | 
								self.xml.get_widget('play_sounds_checkbutton').set_active(True)
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
| 
						 | 
					@ -312,7 +318,14 @@ class Preferences_window:
 | 
				
			||||||
		buf.connect('changed', self.on_msg_textview_changed)
 | 
							buf.connect('changed', self.on_msg_textview_changed)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		#open links with
 | 
							#open links with
 | 
				
			||||||
 | 
							if os.name == 'nt':
 | 
				
			||||||
 | 
								self.links_frame = self.xml.get_widget('links_frame')
 | 
				
			||||||
 | 
								self.links_frame.hide()
 | 
				
			||||||
 | 
								self.links_frame.set_no_show_all(True)
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
			self.links_open_with_combobox = self.xml.get_widget('links_open_with_combobox')
 | 
								self.links_open_with_combobox = self.xml.get_widget('links_open_with_combobox')
 | 
				
			||||||
 | 
								self.links_open_with_combobox.hide()
 | 
				
			||||||
 | 
								self.links_open_with_combobox.set_no_show_all(True)
 | 
				
			||||||
			if gajim.config.get('openwith') == 'gnome-open':
 | 
								if gajim.config.get('openwith') == 'gnome-open':
 | 
				
			||||||
				self.links_open_with_combobox.set_active(0)
 | 
									self.links_open_with_combobox.set_active(0)
 | 
				
			||||||
			elif gajim.config.get('openwith') == 'kfmclient exec':
 | 
								elif gajim.config.get('openwith') == 'kfmclient exec':
 | 
				
			||||||
| 
						 | 
					@ -353,9 +366,6 @@ class Preferences_window:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_preferences_window_show(self, widget):
 | 
						def on_preferences_window_show(self, widget):
 | 
				
			||||||
		self.notebook.set_current_page(0)
 | 
							self.notebook.set_current_page(0)
 | 
				
			||||||
		if os.name == 'nt': # if windows, player must not be visible
 | 
					 | 
				
			||||||
			self.xml.get_widget('soundplayer_hbox').hide()
 | 
					 | 
				
			||||||
			self.trayicon_checkbutton.hide()
 | 
					 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		theme_combobox = self.xml.get_widget('theme_combobox')
 | 
							theme_combobox = self.xml.get_widget('theme_combobox')
 | 
				
			||||||
		model = theme_combobox.get_model()
 | 
							model = theme_combobox.get_model()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -109,6 +109,12 @@ GTKGUI_GLADE = 'gtkgui.glade'
 | 
				
			||||||
class Interface:
 | 
					class Interface:
 | 
				
			||||||
	def launch_browser_mailer(self, kind, url):
 | 
						def launch_browser_mailer(self, kind, url):
 | 
				
			||||||
		#kind = 'url' or 'mail'
 | 
							#kind = 'url' or 'mail'
 | 
				
			||||||
 | 
							if os.name == 'nt':
 | 
				
			||||||
 | 
								try:
 | 
				
			||||||
 | 
									os.startfile(url) # if pywin32 is installed we open
 | 
				
			||||||
 | 
								except:
 | 
				
			||||||
 | 
									pass
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
		if gajim.config.get('openwith') == 'gnome-open':
 | 
							if gajim.config.get('openwith') == 'gnome-open':
 | 
				
			||||||
			app = 'gnome-open'
 | 
								app = 'gnome-open'
 | 
				
			||||||
			args = ['gnome-open']
 | 
								args = ['gnome-open']
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5290,7 +5290,7 @@
 | 
				
			||||||
	      <property name="spacing">5</property>
 | 
						      <property name="spacing">5</property>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	      <child>
 | 
						      <child>
 | 
				
			||||||
		<widget class="GtkFrame" id="frame21">
 | 
							<widget class="GtkFrame" id="links_frame">
 | 
				
			||||||
		  <property name="visible">True</property>
 | 
							  <property name="visible">True</property>
 | 
				
			||||||
		  <property name="label_xalign">0</property>
 | 
							  <property name="label_xalign">0</property>
 | 
				
			||||||
		  <property name="label_yalign">0.5</property>
 | 
							  <property name="label_yalign">0.5</property>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue