Fix GObject deprecations
This commit is contained in:
		
							parent
							
								
									5f029342ed
								
							
						
					
					
						commit
						e50af35715
					
				| @ -96,7 +96,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): | |||||||
|         return False |         return False | ||||||
| 
 | 
 | ||||||
|     def activate(self): |     def activate(self): | ||||||
|         GObject.idle_add(self.run) |         GLib.idle_add(self.run) | ||||||
| 
 | 
 | ||||||
|     def run(self): |     def run(self): | ||||||
|         self.running = True |         self.running = True | ||||||
|  | |||||||
| @ -3,7 +3,7 @@ | |||||||
| import gi | import gi | ||||||
| gi.require_version("Gtk", "2.0") | gi.require_version("Gtk", "2.0") | ||||||
| 
 | 
 | ||||||
| from gi.repository import Gtk, GObject, Pango, Gdk, Gio | from gi.repository import Gtk, Pango, Gdk, Gio, GLib | ||||||
| 
 | 
 | ||||||
| import os | import os | ||||||
| #import mateconf | #import mateconf | ||||||
| @ -586,7 +586,7 @@ class pluginclass( object ): | |||||||
|     def buildButtonList( self ):          |     def buildButtonList( self ):          | ||||||
|         if self.buildingButtonList: |         if self.buildingButtonList: | ||||||
|             self.stopBuildingButtonList = True |             self.stopBuildingButtonList = True | ||||||
|             GObject.timeout_add( 100, self.buildButtonList ) |             GLib.timeout_add( 100, self.buildButtonList ) | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         self.stopBuildingButtonList = False |         self.stopBuildingButtonList = False | ||||||
| @ -600,12 +600,12 @@ class pluginclass( object ): | |||||||
|     def StartFilter( self, widget, category ): |     def StartFilter( self, widget, category ): | ||||||
|         # if there is a timer for a different category running stop it |         # if there is a timer for a different category running stop it | ||||||
|         if self.filterTimer: |         if self.filterTimer: | ||||||
|             GObject.source_remove( self.filterTimer ) |             GLib.source_remove( self.filterTimer ) | ||||||
|         self.filterTimer = GObject.timeout_add( self.categoryhoverdelay, self.Filter, widget, category ) |         self.filterTimer = GLib.timeout_add( self.categoryhoverdelay, self.Filter, widget, category ) | ||||||
| 
 | 
 | ||||||
|     def StopFilter( self, widget ): |     def StopFilter( self, widget ): | ||||||
|         if self.filterTimer: |         if self.filterTimer: | ||||||
|             GObject.source_remove( self.filterTimer ) |             GLib.source_remove( self.filterTimer ) | ||||||
|             self.filterTimer = None |             self.filterTimer = None | ||||||
| 
 | 
 | ||||||
|     def add_search_suggestions(self, text): |     def add_search_suggestions(self, text): | ||||||
| @ -813,11 +813,11 @@ class pluginclass( object ): | |||||||
|                             #if (len(self.current_results) > 0): |                             #if (len(self.current_results) > 0): | ||||||
|                                 #self.add_apt_filter_results_sync(self.current_results, text) |                                 #self.add_apt_filter_results_sync(self.current_results, text) | ||||||
|                             #else: |                             #else: | ||||||
|                             GObject.timeout_add (300, self.add_apt_filter_results, text) |                             GLib.timeout_add (300, self.add_apt_filter_results, text) | ||||||
|                         else: |                         else: | ||||||
|                             self.current_results = []   |                             self.current_results = []   | ||||||
|                             self.add_search_suggestions(text) |                             self.add_search_suggestions(text) | ||||||
|                             GObject.timeout_add (300, self.add_apt_filter_results, text) |                             GLib.timeout_add (300, self.add_apt_filter_results, text) | ||||||
| 
 | 
 | ||||||
|                         self.current_suggestion = text |                         self.current_suggestion = text | ||||||
|                     else: |                     else: | ||||||
| @ -1567,9 +1567,9 @@ class pluginclass( object ): | |||||||
|     def menuChanged( self, x, y ): |     def menuChanged( self, x, y ): | ||||||
|         # wait some miliseconds because there a multiple events send at the same time and we don't want to rebuild the menu for each |         # wait some miliseconds because there a multiple events send at the same time and we don't want to rebuild the menu for each | ||||||
|         if self.menuChangedTimer: |         if self.menuChangedTimer: | ||||||
|             GObject.source_remove( self.menuChangedTimer ) |             GLib.source_remove( self.menuChangedTimer ) | ||||||
| 
 | 
 | ||||||
|         self.menuChangedTimer = GObject.timeout_add( 100, self.updateBoxes, True ) |         self.menuChangedTimer = GLib.timeout_add( 100, self.updateBoxes, True ) | ||||||
| 
 | 
 | ||||||
|     def updateBoxes( self, menu_has_changed ):         |     def updateBoxes( self, menu_has_changed ):         | ||||||
|         # FIXME: This is really bad! |         # FIXME: This is really bad! | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ import os | |||||||
| import os.path | import os.path | ||||||
| import threading | import threading | ||||||
| import time | import time | ||||||
| from gi.repository import GObject | from gi.repository import GLib | ||||||
| 
 | 
 | ||||||
| try: | try: | ||||||
|     import pyinotify |     import pyinotify | ||||||
| @ -42,9 +42,9 @@ if hasInotify: | |||||||
|     #                       print event.path |     #                       print event.path | ||||||
|                 callback = self.callbacks[event.wd] |                 callback = self.callbacks[event.wd] | ||||||
|                 if callback[1]: |                 if callback[1]: | ||||||
|                     GObject.idle_add( callback[0], callback[1] ) |                     GLib.idle_add( callback[0], callback[1] ) | ||||||
|                 else: |                 else: | ||||||
|                     GObject.idle_add( callback[0] ) |                     GLib.idle_add( callback[0] ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| else: | else: | ||||||
| @ -114,9 +114,9 @@ else: | |||||||
|             for monitored in self.monitoredFiles: |             for monitored in self.monitoredFiles: | ||||||
|                 if monitored.hasChanged(): |                 if monitored.hasChanged(): | ||||||
|                     if monitored.args: |                     if monitored.args: | ||||||
|                         GObject.idle_add( monitored.callback, monitored.args ) |                         GLib.idle_add( monitored.callback, monitored.args ) | ||||||
|                     else: |                     else: | ||||||
|                         GObject.idle_add( monitored.callback ) |                         GLib.idle_add( monitored.callback ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| monitor = FileMonitor() | monitor = FileMonitor() | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user