Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, win):
# On Ubuntu 14.04 LTS we must use FakePropertyAction
# On Ubuntu 15.04 we can use Gio.PropertyAction
# But what's the actual difference -- PyGI version? GTK version?
# What test do I make to determine which one to use?
if gi.__version__ < '3.14':
PropertyAction = FakePropertyAction
else:
PropertyAction = Gio.PropertyAction
self.detail_level = PropertyAction.new("detail-level", win, "detail-level")
win.add_action(self.detail_level)
self.time_range = PropertyAction.new("time-range", win, "time-range")
win.add_action(self.time_range)
self.show_view_menu = PropertyAction.new("show-view-menu", win.view_button, "active")
win.add_action(self.show_view_menu)
self.show_task_pane = PropertyAction.new("show-task-pane", win.task_pane, "visible")
win.add_action(self.show_task_pane)
self.show_menu = PropertyAction.new("show-menu", win.menu_button, "active")