sync_dates, cal, priority=GLib.PRIORITY_HIGH)) datebox.pack_start(cal, True, True, 0) cal.show() datebox.set_no_show_all(True) datetoggle.connect('toggled', lambda t: datebox.set_visible(t.get_active())) # right pane hbox = Gtk.HBox() hbox.set_spacing(util.SPACING) hbox.pack_start(subjtoggle, False, True, 0) hbox.pack_start(printbutton, False, True, 0) vbox = Gtk.VBox() vbox.set_spacing(util.SPACING) vbox.pack_start(hbox, False, True, 0) vbox.pack_start(util.scrolled(tree), True, True, 0) vpaned = Gtk.VPaned() vpaned.pack1(vbox) vpaned.pack2(emailview) vpaned.set_position(450) # left pane hbox = Gtk.HBox() hbox.set_spacing(util.SPACING) hbox.pack_start(inverttoggle, False, True, 0) hbox.pack_start(threadstoggle, False, True, 0) hbox.pack_start(gobutton, True, True, 0) vbox = Gtk.VBox() vbox.set_spacing(util.SPACING)
def __init__(self): Gtk.Notebook.__init__(self) self.cur = None self.buf = Gtk.TextBuffer() text = Gtk.TextView.new_with_buffer(self.buf) text.set_border_width(util.SPACING) text.set_editable(False) text.set_cursor_visible(False) richview = Gtk.VBox() headers = Gtk.Label('TODO headers') # from, to, cc, subject, date richview.pack_start(headers, False, True, 0) self.parts = Gtk.TreeView() self.parts.set_headers_visible(False) self.parts.append_column(Gtk.TreeViewColumn('Part', Gtk.CellRendererText(), text=PartModel.LABEL)) def on_select_part(view): path, col = view.get_cursor() if not path: return row = view.get_model()[path] self.show_part(row[PartModel.MESSAGE]) self.parts.connect('cursor-changed', on_select_part) def on_activate_part(view, path, col): row = view.get_model()[path] msg = row[PartModel.MESSAGE] d = Gtk.FileChooserDialog('Save', self.get_toplevel(), Gtk.FileChooserAction.SAVE, (Gtk.STOCK_SAVE, Gtk.ResponseType.OK, Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)) d.set_do_overwrite_confirmation(True) if msg.get_filename(): d.set_current_name(msg.get_filename()) if d.run() == Gtk.ResponseType.OK: open(d.get_filename(), 'wb').write(msg.get_payload(decode=True)) d.destroy() self.parts.connect('row-activated', on_activate_part) self.scrolledparts = util.scrolled(self.parts) self.richbuf = Gtk.TextBuffer() richtext = Gtk.TextView.new_with_buffer(self.richbuf) richtext.set_border_width(util.SPACING) richtext.set_editable(False) richtext.set_cursor_visible(False) richtext.set_wrap_mode(Gtk.WrapMode.WORD_CHAR) self.viewer_text = util.scrolled(richtext) self.viewer_text.show_all() # TODO #self.av = gtkimageview.AnimView() #self.av.connect('button-release-event', lambda w, e: w.grab_focus()) #self.viewer_image = gtkimageview.ImageScrollWin(self.av) #self.viewer_image.show_all() self.richpaned = Gtk.HPaned() self.richpaned.set_position(100) self.richpaned.pack1(self.scrolledparts) richview.pack_start(self.richpaned, True, True, 0) scrolledtext = util.scrolled(text) scrolledtext.props.margin = util.SPACING self.append_page(scrolledtext, Gtk.Label('Raw')) richview.props.margin = util.SPACING self.append_page(richview, Gtk.Label('Message'))
def __init__(self): Gtk.Notebook.__init__(self) self.cur = None self.buf = Gtk.TextBuffer() text = Gtk.TextView.new_with_buffer(self.buf) text.set_border_width(util.SPACING) text.set_editable(False) text.set_cursor_visible(False) richview = Gtk.VBox() headers = Gtk.Label('TODO headers') # from, to, cc, subject, date richview.pack_start(headers, False, True, 0) self.parts = Gtk.TreeView() self.parts.set_headers_visible(False) self.parts.append_column( Gtk.TreeViewColumn('Part', Gtk.CellRendererText(), text=PartModel.LABEL)) def on_select_part(view): path, col = view.get_cursor() if not path: return row = view.get_model()[path] self.show_part(row[PartModel.MESSAGE]) self.parts.connect('cursor-changed', on_select_part) def on_activate_part(view, path, col): row = view.get_model()[path] msg = row[PartModel.MESSAGE] d = Gtk.FileChooserDialog( 'Save', self.get_toplevel(), Gtk.FileChooserAction.SAVE, (Gtk.STOCK_SAVE, Gtk.ResponseType.OK, Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)) d.set_do_overwrite_confirmation(True) if msg.get_filename(): d.set_current_name(msg.get_filename()) if d.run() == Gtk.ResponseType.OK: open(d.get_filename(), 'wb').write(msg.get_payload(decode=True)) d.destroy() self.parts.connect('row-activated', on_activate_part) self.scrolledparts = util.scrolled(self.parts) self.richbuf = Gtk.TextBuffer() richtext = Gtk.TextView.new_with_buffer(self.richbuf) richtext.set_border_width(util.SPACING) richtext.set_editable(False) richtext.set_cursor_visible(False) richtext.set_wrap_mode(Gtk.WrapMode.WORD_CHAR) self.viewer_text = util.scrolled(richtext) self.viewer_text.show_all() # TODO #self.av = gtkimageview.AnimView() #self.av.connect('button-release-event', lambda w, e: w.grab_focus()) #self.viewer_image = gtkimageview.ImageScrollWin(self.av) #self.viewer_image.show_all() self.richpaned = Gtk.HPaned() self.richpaned.set_position(100) self.richpaned.pack1(self.scrolledparts) richview.pack_start(self.richpaned, True, True, 0) scrolledtext = util.scrolled(text) scrolledtext.props.margin = util.SPACING self.append_page(scrolledtext, Gtk.Label('Raw')) richview.props.margin = util.SPACING self.append_page(richview, Gtk.Label('Message'))
cal.connect('day-selected', lambda cal: GLib.idle_add(sync_dates, cal, priority=GLib.PRIORITY_HIGH)) datebox.pack_start(cal, True, True, 0) cal.show() datebox.set_no_show_all(True) datetoggle.connect('toggled', lambda t: datebox.set_visible(t.get_active())) # right pane hbox = Gtk.HBox() hbox.set_spacing(util.SPACING) hbox.pack_start(subjtoggle, False, True, 0) hbox.pack_start(printbutton, False, True, 0) vbox = Gtk.VBox() vbox.set_spacing(util.SPACING) vbox.pack_start(hbox, False, True, 0) vbox.pack_start(util.scrolled(tree), True, True, 0) vpaned = Gtk.VPaned() vpaned.pack1(vbox) vpaned.pack2(emailview) vpaned.set_position(450) # left pane hbox = Gtk.HBox() hbox.set_spacing(util.SPACING) hbox.pack_start(inverttoggle, False, True, 0) hbox.pack_start(threadstoggle, False, True, 0) hbox.pack_start(gobutton, True, True, 0) vbox = Gtk.VBox() vbox.set_spacing(util.SPACING)