Accept control-click as an alternative for right-click when the Gdk
backend is Quartz. This is a standard behavior on Macs, since they often have single-button mice or trackpads. svn: r19753
This commit is contained in:
parent
c78eeb5b51
commit
7bf5c1147e
@ -56,6 +56,7 @@ from constfunc import mac
|
|||||||
from glade import Glade
|
from glade import Glade
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
from gui.makefilter import make_filter
|
from gui.makefilter import make_filter
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -1420,7 +1421,7 @@ class MultiTreeView(gtk.TreeView):
|
|||||||
# Here we intercept mouse clicks on selected items so that we can
|
# Here we intercept mouse clicks on selected items so that we can
|
||||||
# drag multiple items without the click selecting only one
|
# drag multiple items without the click selecting only one
|
||||||
target = self.get_path_at_pos(int(event.x), int(event.y))
|
target = self.get_path_at_pos(int(event.x), int(event.y))
|
||||||
if event.button == 3: # right mouse
|
if gui.utils.is_right_click(event):
|
||||||
selection = widget.get_selection()
|
selection = widget.get_selection()
|
||||||
store, paths = selection.get_selected_rows()
|
store, paths = selection.get_selected_rows()
|
||||||
tpath = paths[0] if len(paths) > 0 else None
|
tpath = paths[0] if len(paths) > 0 else None
|
||||||
|
@ -32,6 +32,7 @@ import copy
|
|||||||
from gen.ggettext import sgettext as _
|
from gen.ggettext import sgettext as _
|
||||||
from TransUtils import trans_objclass
|
from TransUtils import trans_objclass
|
||||||
import cPickle as pickle
|
import cPickle as pickle
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
import gen.lib
|
import gen.lib
|
||||||
import Errors
|
import Errors
|
||||||
@ -109,7 +110,7 @@ class SimpleTable(object):
|
|||||||
#rectangle = treeview.get_cell_area("0:0",
|
#rectangle = treeview.get_cell_area("0:0",
|
||||||
#x, y = rectangle.x, rectangle.y
|
#x, y = rectangle.x, rectangle.y
|
||||||
#func = lambda menu: (x, y, True)
|
#func = lambda menu: (x, y, True)
|
||||||
elif event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
button_code = 3
|
button_code = 3
|
||||||
event_time = event.time
|
event_time = event.time
|
||||||
x = int(event.x)
|
x = int(event.x)
|
||||||
|
@ -43,6 +43,7 @@ import pango
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
import gui.utils
|
||||||
from buttontab import ButtonTab
|
from buttontab import ButtonTab
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -97,7 +98,7 @@ class EmbeddedList(ButtonTab):
|
|||||||
"""
|
"""
|
||||||
Handle button press, not double-click, that is done in init_interface
|
Handle button press, not double-click, that is done in init_interface
|
||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
if gui.utils.is_right_click(event):
|
||||||
ref = self.get_selected()
|
ref = self.get_selected()
|
||||||
if ref:
|
if ref:
|
||||||
self.right_click(obj, event)
|
self.right_click(obj, event)
|
||||||
|
@ -47,7 +47,7 @@ import gobject
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gui.utils import open_file_with_default_application
|
import gui.utils
|
||||||
from gui.dbguielement import DbGUIElement
|
from gui.dbguielement import DbGUIElement
|
||||||
from gui.selectors import SelectorFactory
|
from gui.selectors import SelectorFactory
|
||||||
import gen.lib
|
import gen.lib
|
||||||
@ -66,7 +66,7 @@ import const
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
def make_launcher(path):
|
def make_launcher(path):
|
||||||
return lambda x: open_file_with_default_application(path)
|
return lambda x: gui.utils.open_file_with_default_application(path)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -112,7 +112,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
|||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
self.edit_button_clicked(obj)
|
self.edit_button_clicked(obj)
|
||||||
return True
|
return True
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
reflist = self.iconlist.get_selected_items()
|
reflist = self.iconlist.get_selected_items()
|
||||||
if len(reflist) == 1:
|
if len(reflist) == 1:
|
||||||
ref = self.media_list[reflist[0][0]]
|
ref = self.media_list[reflist[0][0]]
|
||||||
|
@ -42,6 +42,7 @@ import gobject
|
|||||||
# GRAMPS classes
|
# GRAMPS classes
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
import gui.utils
|
||||||
from embeddedlist import EmbeddedList
|
from embeddedlist import EmbeddedList
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -102,7 +103,7 @@ class GroupEmbeddedList(EmbeddedList):
|
|||||||
"""
|
"""
|
||||||
Handle button press, not double-click, that is done in init_interface
|
Handle button press, not double-click, that is done in init_interface
|
||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
if gui.utils.is_right_click(event):
|
||||||
obj = self.get_selected()
|
obj = self.get_selected()
|
||||||
if obj and obj[1]:
|
if obj and obj[1]:
|
||||||
self._tmpgroup = obj[0]
|
self._tmpgroup = obj[0]
|
||||||
|
@ -51,7 +51,7 @@ import pango
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import Utils
|
import Utils
|
||||||
import ThumbNails
|
import ThumbNails
|
||||||
from gui.utils import add_menuitem, open_file_with_default_application
|
import gui.utils
|
||||||
import gen.lib
|
import gen.lib
|
||||||
from gen.db import DbTxn
|
from gen.db import DbTxn
|
||||||
from gui import widgets
|
from gui import widgets
|
||||||
@ -592,7 +592,7 @@ class EditPerson(EditPrimary):
|
|||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
media_list = self.obj.get_media_list()
|
media_list = self.obj.get_media_list()
|
||||||
if media_list:
|
if media_list:
|
||||||
photo = media_list[0]
|
photo = media_list[0]
|
||||||
@ -610,8 +610,9 @@ class EditPerson(EditPrimary):
|
|||||||
menu.set_title(_("Media Object"))
|
menu.set_title(_("Media Object"))
|
||||||
obj = self.db.get_object_from_handle(photo.get_reference_handle())
|
obj = self.db.get_object_from_handle(photo.get_reference_handle())
|
||||||
if obj:
|
if obj:
|
||||||
add_menuitem(menu, _("View"), photo, self._popup_view_photo)
|
gui.utilsadd_menuitem(menu, _("View"), photo,
|
||||||
add_menuitem(menu, _("Edit Object Properties"), photo,
|
self._popup_view_photo)
|
||||||
|
gui.utils.add_menuitem(menu, _("Edit Object Properties"), photo,
|
||||||
self._popup_change_description)
|
self._popup_change_description)
|
||||||
menu.popup(None, None, None, event.button, event.time)
|
menu.popup(None, None, None, event.button, event.time)
|
||||||
|
|
||||||
@ -625,7 +626,7 @@ class EditPerson(EditPrimary):
|
|||||||
object_handle = photo.get_reference_handle()
|
object_handle = photo.get_reference_handle()
|
||||||
ref_obj = self.db.get_object_from_handle(object_handle)
|
ref_obj = self.db.get_object_from_handle(object_handle)
|
||||||
photo_path = Utils.media_path_full(self.db, ref_obj.get_path())
|
photo_path = Utils.media_path_full(self.db, ref_obj.get_path())
|
||||||
open_file_with_default_application(photo_path)
|
gui.utils.open_file_with_default_application(photo_path)
|
||||||
|
|
||||||
def _popup_change_description(self, obj):
|
def _popup_change_description(self, obj):
|
||||||
"""
|
"""
|
||||||
|
@ -44,6 +44,7 @@ import ManagedWindow
|
|||||||
import DateHandler
|
import DateHandler
|
||||||
from gen.display.name import displayer as name_displayer
|
from gen.display.name import displayer as name_displayer
|
||||||
import config
|
import config
|
||||||
|
import gui.utils
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
from QuestionDialog import SaveDialog
|
from QuestionDialog import SaveDialog
|
||||||
import gen.lib
|
import gen.lib
|
||||||
@ -283,7 +284,7 @@ class EditPrimary(ManagedWindow.ManagedWindow, DbGUIElement):
|
|||||||
pressed while on contexteventbox
|
pressed while on contexteventbox
|
||||||
It opens a context menu with possible actions
|
It opens a context menu with possible actions
|
||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3 :
|
if gui.utils.is_right_click(event):
|
||||||
if self.obj.get_handle() == 0 :
|
if self.obj.get_handle() == 0 :
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ from gui.widgets.grampletpane import (AVAILABLE_GRAMPLETS,
|
|||||||
make_requested_gramplet,
|
make_requested_gramplet,
|
||||||
GuiGramplet)
|
GuiGramplet)
|
||||||
from gui.widgets.undoablebuffer import UndoableBuffer
|
from gui.widgets.undoablebuffer import UndoableBuffer
|
||||||
from gui.utils import add_menuitem
|
import gui.utils
|
||||||
from QuestionDialog import QuestionDialog
|
from QuestionDialog import QuestionDialog
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -415,7 +415,7 @@ class GrampsBar(gtk.Notebook):
|
|||||||
"""
|
"""
|
||||||
Called when a button is pressed in the tabs section of the GrampsBar.
|
Called when a button is pressed in the tabs section of the GrampsBar.
|
||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
if gui.utils.is_right_click(event):
|
||||||
menu = gtk.Menu()
|
menu = gtk.Menu()
|
||||||
|
|
||||||
ag_menu = gtk.MenuItem(_('Add a gramplet'))
|
ag_menu = gtk.MenuItem(_('Add a gramplet'))
|
||||||
|
@ -32,7 +32,7 @@ Utility functions that depend on GUI components or for GUI components
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
from constfunc import has_display
|
import constfunc
|
||||||
# gtk is not included here, because this file is currently imported
|
# gtk is not included here, because this file is currently imported
|
||||||
# by code that needs to run without the DISPLAY variable (eg, in
|
# by code that needs to run without the DISPLAY variable (eg, in
|
||||||
# the cli only).
|
# the cli only).
|
||||||
@ -144,7 +144,7 @@ class ProgressMeter(object):
|
|||||||
else:
|
else:
|
||||||
self.__cancel_callback = self.handle_cancel
|
self.__cancel_callback = self.handle_cancel
|
||||||
|
|
||||||
if has_display():
|
if constfunc.has_display():
|
||||||
self.__dialog = gtk.Dialog()
|
self.__dialog = gtk.Dialog()
|
||||||
else:
|
else:
|
||||||
self.__dialog = CLIDialog()
|
self.__dialog = CLIDialog()
|
||||||
@ -363,3 +363,23 @@ def process_pending_events(max_count=10):
|
|||||||
count += 1
|
count += 1
|
||||||
if count >= max_count:
|
if count >= max_count:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# Then there's the infamous Mac one-button mouse (or more likely these
|
||||||
|
# days, one-button trackpad). The canonical mac way to generate what
|
||||||
|
# Gdk calls a button-3 is <ctrl> button-1, but that's not baked into
|
||||||
|
# Gdk. We'll emulate the behavior here.
|
||||||
|
|
||||||
|
def is_right_click(event):
|
||||||
|
"""
|
||||||
|
Returns True if the event is a button-3 or equivalent
|
||||||
|
"""
|
||||||
|
import gtk
|
||||||
|
|
||||||
|
if event.type == gtk.gdk.BUTTON_PRESS:
|
||||||
|
if constfunc.is_quartz():
|
||||||
|
if (event.button == 3
|
||||||
|
or (event.button == 1 and event.state & gtk.gdk.CONTROL_MASK)):
|
||||||
|
return True
|
||||||
|
|
||||||
|
if event.button == 3:
|
||||||
|
return True
|
||||||
|
@ -64,6 +64,7 @@ from QuestionDialog import QuestionDialog, QuestionDialog2
|
|||||||
from gui.filtereditor import FilterEditor
|
from gui.filtereditor import FilterEditor
|
||||||
from gen.ggettext import sgettext as _
|
from gen.ggettext import sgettext as _
|
||||||
from DdTargets import DdTargets
|
from DdTargets import DdTargets
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#----------------------------------------------------------------
|
#----------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -757,7 +758,7 @@ class ListView(NavigationView):
|
|||||||
else:
|
else:
|
||||||
self.edit(obj)
|
self.edit(obj)
|
||||||
return True
|
return True
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
menu = self.uistate.uimanager.get_widget('/Popup')
|
menu = self.uistate.uimanager.get_widget('/Popup')
|
||||||
#construct quick reports if needed
|
#construct quick reports if needed
|
||||||
if menu and self.QR_CATEGORY > -1 :
|
if menu and self.QR_CATEGORY > -1 :
|
||||||
|
@ -46,7 +46,7 @@ import const
|
|||||||
from gui.editors import EditPerson, EditFamily
|
from gui.editors import EditPerson, EditFamily
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
from gui.utils import add_menuitem
|
import gui.utils
|
||||||
from QuickReports import run_quick_report_by_name
|
from QuickReports import run_quick_report_by_name
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
@ -603,7 +603,7 @@ class GuiGramplet(object):
|
|||||||
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
||||||
self.uistate.set_active(handle, 'Person')
|
self.uistate.set_active(handle, 'Person')
|
||||||
return True # handled event
|
return True # handled event
|
||||||
elif event.button == 3: # right mouse
|
elif gui.utils.is_right_click(event):
|
||||||
#FIXME: add a popup menu with options
|
#FIXME: add a popup menu with options
|
||||||
try:
|
try:
|
||||||
EditPerson(self.dbstate,
|
EditPerson(self.dbstate,
|
||||||
@ -664,7 +664,7 @@ class GuiGramplet(object):
|
|||||||
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
||||||
self.uistate.set_active(handle, 'Family')
|
self.uistate.set_active(handle, 'Family')
|
||||||
return True # handle event
|
return True # handle event
|
||||||
elif event.button == 3: # right mouse
|
elif gui.utils.is_right_click(event):
|
||||||
#FIXME: add a popup menu with options
|
#FIXME: add a popup menu with options
|
||||||
try:
|
try:
|
||||||
EditFamily(self.dbstate,
|
EditFamily(self.dbstate,
|
||||||
@ -1373,7 +1373,7 @@ class GrampletPane(gtk.ScrolledWindow):
|
|||||||
print "Can't make gramplet of type '%s'." % name
|
print "Can't make gramplet of type '%s'." % name
|
||||||
|
|
||||||
def _button_press(self, obj, event):
|
def _button_press(self, obj, event):
|
||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
if gui.utils.is_right_click(event):
|
||||||
self._popup_xy = (event.x, event.y)
|
self._popup_xy = (event.x, event.y)
|
||||||
uiman = self.uistate.uimanager
|
uiman = self.uistate.uimanager
|
||||||
ag_menu = uiman.get_widget('/GrampletPopup/AddGramplet')
|
ag_menu = uiman.get_widget('/GrampletPopup/AddGramplet')
|
||||||
@ -1384,7 +1384,8 @@ class GrampletPane(gtk.ScrolledWindow):
|
|||||||
if gplug.navtypes == []]
|
if gplug.navtypes == []]
|
||||||
names.sort()
|
names.sort()
|
||||||
for name in names:
|
for name in names:
|
||||||
add_menuitem(qr_menu, name, None, self.add_gramplet)
|
gui.utils.add_menuitem(qr_menu, name, None,
|
||||||
|
self.add_gramplet)
|
||||||
ag_menu.set_submenu(qr_menu)
|
ag_menu.set_submenu(qr_menu)
|
||||||
rg_menu = uiman.get_widget('/GrampletPopup/RestoreGramplet')
|
rg_menu = uiman.get_widget('/GrampletPopup/RestoreGramplet')
|
||||||
if rg_menu:
|
if rg_menu:
|
||||||
@ -1397,7 +1398,8 @@ class GrampletPane(gtk.ScrolledWindow):
|
|||||||
if len(names) > 0:
|
if len(names) > 0:
|
||||||
qr_menu = gtk.Menu()
|
qr_menu = gtk.Menu()
|
||||||
for name in names:
|
for name in names:
|
||||||
add_menuitem(qr_menu, name, None, self.restore_gramplet)
|
gui.utils.add_menuitem(qr_menu, name, None,
|
||||||
|
self.restore_gramplet)
|
||||||
rg_menu.set_submenu(qr_menu)
|
rg_menu.set_submenu(qr_menu)
|
||||||
menu = uiman.get_widget('/GrampletPopup')
|
menu = uiman.get_widget('/GrampletPopup')
|
||||||
if menu:
|
if menu:
|
||||||
|
@ -77,7 +77,7 @@ from QuestionDialog import WarningDialog, ErrorDialog
|
|||||||
from gen.plug.menu import PersonOption, FilterOption, FamilyOption
|
from gen.plug.menu import PersonOption, FilterOption, FamilyOption
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
from gui.utils import open_file_with_default_application
|
import gui.utils
|
||||||
import gui.user
|
import gui.user
|
||||||
|
|
||||||
# Import from specific modules in ReportBase
|
# Import from specific modules in ReportBase
|
||||||
@ -970,7 +970,7 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
|
|||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
self.on_setup_clicked(obj)
|
self.on_setup_clicked(obj)
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
self.build_book_context_menu(event)
|
self.build_book_context_menu(event)
|
||||||
|
|
||||||
def avail_button_press(self, obj, event):
|
def avail_button_press(self, obj, event):
|
||||||
@ -980,7 +980,7 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
|
|||||||
"""
|
"""
|
||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
self.on_add_clicked(obj)
|
self.on_add_clicked(obj)
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
self.build_avail_context_menu(event)
|
self.build_avail_context_menu(event)
|
||||||
|
|
||||||
def build_book_context_menu(self, event):
|
def build_book_context_menu(self, event):
|
||||||
@ -1282,7 +1282,7 @@ class BookReportDialog(DocReportDialog):
|
|||||||
self.doc.close()
|
self.doc.close()
|
||||||
|
|
||||||
if self.open_with_app.get_active():
|
if self.open_with_app.get_active():
|
||||||
open_file_with_default_application(self.target_path)
|
gui.utils.open_file_with_default_application(self.target_path)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -60,6 +60,7 @@ from libformatting import FormattingHelper
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
import Errors
|
import Errors
|
||||||
from gui.editors import EditPerson
|
from gui.editors import EditPerson
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -523,7 +524,8 @@ class FanChartWidget(gtk.Widget):
|
|||||||
if selected is None: # clicked in open area, or center
|
if selected is None: # clicked in open area, or center
|
||||||
if radius < self.center:
|
if radius < self.center:
|
||||||
# right mouse
|
# right mouse
|
||||||
if event.button == 3 and self.context_popup_callback:
|
if (gui.utils.is_right_click(event)
|
||||||
|
and self.context_popup_callback):
|
||||||
if self.data[0][0][1]:
|
if self.data[0][0][1]:
|
||||||
self.context_popup_callback(widget, event,
|
self.context_popup_callback(widget, event,
|
||||||
self.data[0][0][1].handle)
|
self.data[0][0][1].handle)
|
||||||
@ -538,7 +540,7 @@ class FanChartWidget(gtk.Widget):
|
|||||||
# Do things based on state, event.state, or button, event.button
|
# Do things based on state, event.state, or button, event.button
|
||||||
if event.button == 1: # left mouse
|
if event.button == 1: # left mouse
|
||||||
self.change_slice(generation, selected)
|
self.change_slice(generation, selected)
|
||||||
elif event.button == 3: # right mouse
|
elif gui.utils.is_right_click(event): # right mouse
|
||||||
text, person, parents, child = self.data[generation][selected]
|
text, person, parents, child = self.data[generation][selected]
|
||||||
if person and self.context_popup_callback:
|
if person and self.context_popup_callback:
|
||||||
self.context_popup_callback(widget, event, person.handle)
|
self.context_popup_callback(widget, event, person.handle)
|
||||||
|
@ -57,6 +57,7 @@ from gen.ggettext import sgettext as _
|
|||||||
from gen.ggettext import ngettext
|
from gen.ggettext import ngettext
|
||||||
from config import config
|
from config import config
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -294,7 +295,7 @@ class osmGpsMap():
|
|||||||
elif event.button == 2 and event.type == gtk.gdk.BUTTON_RELEASE:
|
elif event.button == 2 and event.type == gtk.gdk.BUTTON_RELEASE:
|
||||||
self.end_selection = current
|
self.end_selection = current
|
||||||
self.zone_selection = False
|
self.zone_selection = False
|
||||||
elif event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
self.build_nav_menu(osm, event, lat, lon )
|
self.build_nav_menu(osm, event, lat, lon )
|
||||||
else:
|
else:
|
||||||
self.save_center(lat,lon)
|
self.save_center(lat,lon)
|
||||||
|
@ -56,6 +56,7 @@ from gui.plug import tool
|
|||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from QuestionDialog import InfoDialog
|
from QuestionDialog import InfoDialog
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -116,7 +117,7 @@ class Leak(tool.Tool, ManagedWindow.ManagedWindow):
|
|||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
self.referenced_in()
|
self.referenced_in()
|
||||||
return True
|
return True
|
||||||
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
elif gui.utils.is_right_click(event):
|
||||||
self.refers_to()
|
self.refers_to()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import ManagedWindow
|
|||||||
from gui.plug import tool
|
from gui.plug import tool
|
||||||
from gen.ggettext import sgettext as _
|
from gen.ggettext import sgettext as _
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -154,7 +155,7 @@ class OwnerEditor(tool.Tool, ManagedWindow.ManagedWindow):
|
|||||||
|
|
||||||
def on_button_press_event(self, obj, event):
|
def on_button_press_event(self, obj, event):
|
||||||
"""Shows popup-menu for db <-> preferences copying"""
|
"""Shows popup-menu for db <-> preferences copying"""
|
||||||
if event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
|
if gui.utils.is_right_click(event):
|
||||||
self.menu.popup(None,None,None,0,0)
|
self.menu.popup(None,None,None,0,0)
|
||||||
|
|
||||||
def build_menu_names(self, obj):
|
def build_menu_names(self, obj):
|
||||||
|
@ -61,6 +61,7 @@ from gui.views.navigationview import NavigationView
|
|||||||
import Errors
|
import Errors
|
||||||
import Bookmarks
|
import Bookmarks
|
||||||
from gui.editors import EditPerson
|
from gui.editors import EditPerson
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -539,7 +540,7 @@ class FanChartWidget(gtk.Widget):
|
|||||||
if selected is None: # clicked in open area, or center
|
if selected is None: # clicked in open area, or center
|
||||||
if radius < self.center:
|
if radius < self.center:
|
||||||
# right mouse
|
# right mouse
|
||||||
if event.button == 3 and self.context_popup_callback:
|
if gui.utils.is_right_click(event):
|
||||||
if self.data[0][0][1]:
|
if self.data[0][0][1]:
|
||||||
self.context_popup_callback(widget, event,
|
self.context_popup_callback(widget, event,
|
||||||
self.data[0][0][1].handle)
|
self.data[0][0][1].handle)
|
||||||
@ -554,7 +555,7 @@ class FanChartWidget(gtk.Widget):
|
|||||||
# Do things based on state, event.state, or button, event.button
|
# Do things based on state, event.state, or button, event.button
|
||||||
if event.button == 1: # left mouse
|
if event.button == 1: # left mouse
|
||||||
self.change_slice(generation, selected)
|
self.change_slice(generation, selected)
|
||||||
elif event.button == 3: # right mouse
|
elif gui.utils.is_right_click(event):
|
||||||
text, person, parents, child = self.data[generation][selected]
|
text, person, parents, child = self.data[generation][selected]
|
||||||
if person and self.context_popup_callback:
|
if person and self.context_popup_callback:
|
||||||
self.context_popup_callback(widget, event, person.handle)
|
self.context_popup_callback(widget, event, person.handle)
|
||||||
|
@ -64,6 +64,7 @@ import Bookmarks
|
|||||||
import const
|
import const
|
||||||
import constfunc
|
import constfunc
|
||||||
from QuestionDialog import RunDatabaseRepair, ErrorDialog
|
from QuestionDialog import RunDatabaseRepair, ErrorDialog
|
||||||
|
import gui.utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -1511,7 +1512,7 @@ class PedigreeView(NavigationView):
|
|||||||
self._last_y = event.y
|
self._last_y = event.y
|
||||||
self._in_move = True
|
self._in_move = True
|
||||||
return True
|
return True
|
||||||
elif event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
|
elif gui.utils.is_right_click(event):
|
||||||
self.cb_on_show_option_menu(widget, event)
|
self.cb_on_show_option_menu(widget, event)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -1565,7 +1566,7 @@ class PedigreeView(NavigationView):
|
|||||||
or submenu for person for mouse right click.
|
or submenu for person for mouse right click.
|
||||||
And setup plug for button press on person widget.
|
And setup plug for button press on person widget.
|
||||||
"""
|
"""
|
||||||
if event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
|
if gui.utils.is_right_click(event):
|
||||||
self.cb_build_full_nav_menu(obj, event,
|
self.cb_build_full_nav_menu(obj, event,
|
||||||
person_handle, family_handle)
|
person_handle, family_handle)
|
||||||
return True
|
return True
|
||||||
@ -1580,7 +1581,7 @@ class PedigreeView(NavigationView):
|
|||||||
on family line or call full submenu for mouse right click.
|
on family line or call full submenu for mouse right click.
|
||||||
And setup plug for button press on family line.
|
And setup plug for button press on family line.
|
||||||
"""
|
"""
|
||||||
if event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
|
if gui.utils.is_right_click(event):
|
||||||
self.cb_build_relation_nav_menu(obj, event, family_handle)
|
self.cb_build_relation_nav_menu(obj, event, family_handle)
|
||||||
return True
|
return True
|
||||||
elif event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
elif event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||||
@ -1597,7 +1598,7 @@ class PedigreeView(NavigationView):
|
|||||||
if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
|
||||||
self.cb_add_parents(obj, person_handle, family_handle)
|
self.cb_add_parents(obj, person_handle, family_handle)
|
||||||
return True
|
return True
|
||||||
elif event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS:
|
elif gui.utils.is_right_click(event):
|
||||||
self.cb_build_missing_parent_nav_menu(obj, event, person_handle,
|
self.cb_build_missing_parent_nav_menu(obj, event, person_handle,
|
||||||
family_handle)
|
family_handle)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user