def __init__(self):
Gtk.TextView.__init__(self)
self._update_pending = False
self._subject = ''
self.connect('notify::timelog', self.queue_update)
self.connect('notify::name', self.update_subject)
self.connect('notify::date', self.queue_update)
self.connect('notify::time-range', self.queue_update)
self.connect('notify::report-style', self.queue_update)
self.connect('notify::visible', self.queue_update)
self.connect('notify::recipient', self.update_already_sent_indication)
self.bind_property('body', self.get_buffer(), 'text',
GObject.BindingFlags.BIDIRECTIONAL)
if (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION) < (3, 16):
# Seems like a bug on GTK+ 3.10 where editing text doesn't emit the
# notify::text signal, and so property bindings don't get updated.
# I don't have the patience to dig through bugzilla to find when
# the bug was fixed, or to test GTK+ 3.12/3.14, so I'll just apply
# the workaround for all GTK+ versions older than the one I
# currently use, which doesn't have the bug. The workaround should
# be harmless.
self.get_buffer().connect('changed', self.buffer_changed_workaround)
# GTK+ versions before 3.16 did not have a 'monospace' property.
# GTK+ themes other than Adwaita ignore the 'monospace' property and
# use a proportional font for text widgets.
self.override_font(Pango.FontDescription.from_string("Monospace"))
filename = Settings().get_report_log_file()
self.record = ReportRecord(filename)
评论列表
文章目录