Gdk.Cursor.new() deprecation fixes
This commit is contained in:
parent
1abc0ad1fa
commit
55c99fe718
@ -110,6 +110,7 @@ BACKEND_COL = 7
|
|||||||
RCS_BUTTON = {True : _('_Extract'), False : _('_Archive')}
|
RCS_BUTTON = {True : _('_Extract'), False : _('_Archive')}
|
||||||
|
|
||||||
class Information(ManagedWindow):
|
class Information(ManagedWindow):
|
||||||
|
|
||||||
def __init__(self, uistate, data, parent):
|
def __init__(self, uistate, data, parent):
|
||||||
super().__init__(uistate, [], self)
|
super().__init__(uistate, [], self)
|
||||||
self.window = Gtk.Dialog()
|
self.window = Gtk.Dialog()
|
||||||
@ -154,6 +155,9 @@ class DbManager(CLIDbManager):
|
|||||||
|
|
||||||
ERROR = ErrorDialog
|
ERROR = ErrorDialog
|
||||||
|
|
||||||
|
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.WATCH)
|
||||||
|
|
||||||
def __init__(self, uistate, dbstate, parent=None):
|
def __init__(self, uistate, dbstate, parent=None):
|
||||||
"""
|
"""
|
||||||
Create the top level window from the glade description, and extracts
|
Create the top level window from the glade description, and extracts
|
||||||
@ -936,7 +940,7 @@ class DbManager(CLIDbManager):
|
|||||||
message
|
message
|
||||||
"""
|
"""
|
||||||
self.msg.set_label(msg)
|
self.msg.set_label(msg)
|
||||||
self.top.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
|
self.top.get_window().set_cursor(self.BUSY_CURSOR)
|
||||||
while Gtk.events_pending():
|
while Gtk.events_pending():
|
||||||
Gtk.main_iteration()
|
Gtk.main_iteration()
|
||||||
|
|
||||||
|
|||||||
@ -386,7 +386,8 @@ class DisplayState(Callback):
|
|||||||
'Note': _("No active note"),
|
'Note': _("No active note"),
|
||||||
}
|
}
|
||||||
|
|
||||||
BUSY_CURSOR = Gdk.Cursor.new(Gdk.CursorType.WATCH)
|
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.WATCH)
|
||||||
|
|
||||||
def __init__(self, window, status, uimanager, viewmanager=None):
|
def __init__(self, window, status, uimanager, viewmanager=None):
|
||||||
|
|
||||||
|
|||||||
@ -759,8 +759,12 @@ class ToolManagedWindowBase(ManagedWindow):
|
|||||||
self.results_text.connect('motion-notify-event',
|
self.results_text.connect('motion-notify-event',
|
||||||
self.on_motion)
|
self.on_motion)
|
||||||
self.tags = []
|
self.tags = []
|
||||||
self.link_cursor = Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR)
|
self.link_cursor = \
|
||||||
self.standard_cursor = Gdk.Cursor.new(Gdk.CursorType.XTERM)
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.LEFT_PTR)
|
||||||
|
self.standard_cursor = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.XTERM)
|
||||||
|
|
||||||
self.setup_other_frames()
|
self.setup_other_frames()
|
||||||
self.set_current_frame(self.initial_frame())
|
self.set_current_frame(self.initial_frame())
|
||||||
|
|||||||
@ -625,8 +625,11 @@ class ExportAssistant(Gtk.Assistant, ManagedWindow) :
|
|||||||
a part of ManagedWindow
|
a part of ManagedWindow
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.WATCH)
|
||||||
|
|
||||||
if value:
|
if value:
|
||||||
self.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
|
self.get_window().set_cursor(BUSY_CURSOR)
|
||||||
#self.set_sensitive(0)
|
#self.set_sensitive(0)
|
||||||
else:
|
else:
|
||||||
self.get_window().set_cursor(None)
|
self.get_window().set_cursor(None)
|
||||||
|
|||||||
@ -46,7 +46,8 @@ from gramps.gen.constfunc import has_display
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
if has_display():
|
if has_display():
|
||||||
HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2)
|
HAND_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.HAND2)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|||||||
@ -197,14 +197,30 @@ GRABBERS_SWITCH = [
|
|||||||
|
|
||||||
# cursors
|
# cursors
|
||||||
try:
|
try:
|
||||||
CURSOR_UPPER = Gdk.Cursor.new(Gdk.CursorType.TOP_SIDE)
|
CURSOR_UPPER = \
|
||||||
CURSOR_LOWER = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_SIDE)
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
CURSOR_LEFT = Gdk.Cursor.new(Gdk.CursorType.LEFT_SIDE)
|
Gdk.CursorType.TOP_SIDE)
|
||||||
CURSOR_RIGHT = Gdk.Cursor.new(Gdk.CursorType.RIGHT_SIDE)
|
CURSOR_LOWER = \
|
||||||
CURSOR_UPPER_LEFT = Gdk.Cursor.new(Gdk.CursorType.TOP_LEFT_CORNER)
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
CURSOR_UPPER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.TOP_RIGHT_CORNER)
|
Gdk.CursorType.BOTTOM_SIDE)
|
||||||
CURSOR_LOWER_LEFT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_LEFT_CORNER)
|
CURSOR_LEFT = \
|
||||||
CURSOR_LOWER_RIGHT = Gdk.Cursor.new(Gdk.CursorType.BOTTOM_RIGHT_CORNER)
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.LEFT_SIDE)
|
||||||
|
CURSOR_RIGHT = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.RIGHT_SIDE)
|
||||||
|
CURSOR_UPPER_LEFT = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.TOP_LEFT_CORNER)
|
||||||
|
CURSOR_UPPER_RIGHT = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.TOP_RIGHT_CORNER)
|
||||||
|
CURSOR_LOWER_LEFT = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.BOTTOM_LEFT_CORNER)
|
||||||
|
CURSOR_LOWER_RIGHT = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.BOTTOM_RIGHT_CORNER)
|
||||||
except:
|
except:
|
||||||
CURSOR_UPPER = None
|
CURSOR_UPPER = None
|
||||||
CURSOR_LOWER = None
|
CURSOR_LOWER = None
|
||||||
|
|||||||
@ -372,8 +372,12 @@ class GuiGramplet:
|
|||||||
self.pui = None # user code
|
self.pui = None # user code
|
||||||
self.tooltips_text = None
|
self.tooltips_text = None
|
||||||
|
|
||||||
self.link_cursor = Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR)
|
self.link_cursor = \
|
||||||
self.standard_cursor = Gdk.Cursor.new(Gdk.CursorType.XTERM)
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.LEFT_PTR)
|
||||||
|
self.standard_cursor = \
|
||||||
|
Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.XTERM)
|
||||||
|
|
||||||
self.scrolledwindow = None
|
self.scrolledwindow = None
|
||||||
self.textview = None
|
self.textview = None
|
||||||
|
|||||||
@ -56,7 +56,8 @@ from ..utils import rgb_to_hex
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
if has_display():
|
if has_display():
|
||||||
HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2)
|
HAND_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.HAND2)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|||||||
@ -61,6 +61,9 @@ class RemoveUnused(tool.Tool, ManagedWindow, UpdateCallback):
|
|||||||
OBJ_TYPE_COL = 3
|
OBJ_TYPE_COL = 3
|
||||||
OBJ_HANDLE_COL = 4
|
OBJ_HANDLE_COL = 4
|
||||||
|
|
||||||
|
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.WATCH)
|
||||||
|
|
||||||
def __init__(self, dbstate, user, options_class, name, callback=None):
|
def __init__(self, dbstate, user, options_class, name, callback=None):
|
||||||
uistate = user.uistate
|
uistate = user.uistate
|
||||||
self.title = _('Unused Objects')
|
self.title = _('Unused Objects')
|
||||||
@ -236,7 +239,7 @@ class RemoveUnused(tool.Tool, ManagedWindow, UpdateCallback):
|
|||||||
|
|
||||||
self.uistate.set_busy_cursor(True)
|
self.uistate.set_busy_cursor(True)
|
||||||
self.uistate.progress.show()
|
self.uistate.progress.show()
|
||||||
self.window.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
|
self.window.get_window().set_cursor(self.BUSY_CURSOR)
|
||||||
|
|
||||||
self.real_model.clear()
|
self.real_model.clear()
|
||||||
self.collect_unused()
|
self.collect_unused()
|
||||||
|
|||||||
@ -349,9 +349,11 @@ class Verify(tool.Tool, ManagedWindow, UpdateCallback):
|
|||||||
|
|
||||||
self.uistate.set_busy_cursor(True)
|
self.uistate.set_busy_cursor(True)
|
||||||
self.uistate.progress.show()
|
self.uistate.progress.show()
|
||||||
self.window.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
|
BUSY_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.WATCH)
|
||||||
|
self.window.get_window().set_cursor(BUSY_CURSOR)
|
||||||
try:
|
try:
|
||||||
self.vr.window.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
|
self.vr.window.get_window().set_cursor(BUSY_CURSOR)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@ -508,6 +508,10 @@ class PedigreeView(NavigationView):
|
|||||||
('interface.pedview-show-unknown-people', True),
|
('interface.pedview-show-unknown-people', True),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
FLEUR_CURSOR = Gdk.Cursor.new_for_display(Gdk.Display.get_default(),
|
||||||
|
Gdk.CursorType.FLEUR)
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, pdata, dbstate, uistate, nav_group=0):
|
def __init__(self, pdata, dbstate, uistate, nav_group=0):
|
||||||
NavigationView.__init__(self, _('Pedigree'), pdata, dbstate, uistate,
|
NavigationView.__init__(self, _('Pedigree'), pdata, dbstate, uistate,
|
||||||
PersonBookmarks, nav_group)
|
PersonBookmarks, nav_group)
|
||||||
@ -1325,7 +1329,7 @@ class PedigreeView(NavigationView):
|
|||||||
or call option menu.
|
or call option menu.
|
||||||
"""
|
"""
|
||||||
if event.button == 1 and event.type == Gdk.EventType.BUTTON_PRESS:
|
if event.button == 1 and event.type == Gdk.EventType.BUTTON_PRESS:
|
||||||
widget.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.FLEUR))
|
widget.get_window().set_cursor(self.FLEUR_CURSOR)
|
||||||
self._last_x = event.x
|
self._last_x = event.x
|
||||||
self._last_y = event.y
|
self._last_y = event.y
|
||||||
self._in_move = True
|
self._in_move = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user