Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.task_entry.grab_focus() # I specified this in the .ui file but it gets ignored
self.add_button = builder.get_object('add_button')
self.add_button.grab_default() # I specified this in the .ui file but it gets ignored
self.log_view = LogView()
swap_widget(builder, 'log_view', self.log_view)
self.bind_property('timelog', self.task_entry, 'timelog', GObject.BindingFlags.DEFAULT)
self.bind_property('timelog', self.log_view, 'timelog', GObject.BindingFlags.DEFAULT)
self.bind_property('showing_today', self.log_view, 'showing_today', GObject.BindingFlags.DEFAULT)
self.bind_property('date', self.log_view, 'date', GObject.BindingFlags.DEFAULT)
self.bind_property('detail_level', self.log_view, 'detail_level', GObject.BindingFlags.SYNC_CREATE)
self.bind_property('time_range', self.log_view, 'time_range', GObject.BindingFlags.SYNC_CREATE)
self.task_entry.bind_property('text', self.log_view, 'current_task', GObject.BindingFlags.DEFAULT)
self.bind_property('subtitle', self.headerbar, 'subtitle', GObject.BindingFlags.DEFAULT)
self.task_pane = builder.get_object("task_pane")
self.task_list = TaskList()
swap_widget(builder, 'task_list', self.task_list)
self.task_list.connect('row-activated', self.task_list_row_activated)
self.bind_property('tasks', self.task_list, 'tasks', GObject.BindingFlags.DEFAULT)
self.actions = self.Actions(self)
self.actions.add_entry.set_enabled(False)
self.actions.send_report.set_enabled(True)
# couldn't figure out how to set action targets in the .ui file
builder.get_object('daily_report_toggle').set_detailed_action_name('win.time-range::day')
builder.get_object('weekly_report_toggle').set_detailed_action_name('win.time-range::week')
builder.get_object('monthly_report_toggle').set_detailed_action_name('win.time-range::month')
self.report_view = ReportView()
swap_widget(builder, 'report_view', self.report_view)
self.bind_property('timelog', self.report_view, 'timelog', GObject.BindingFlags.DEFAULT)