module ListPrint

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)

Public Instance Methods

gtkprint() click to toggle source
# File lib/ListHolder/EditableList/ListPrintOperation.rb, line 371
def gtkprint
        @pop=ListPrintOperation.new(self)
        ps=Gtk::PageSetup.new
        case gtk_attribute("page_orientation").upcase
                when "LANDSCAPE" then ps.set_orientation(Gtk::PrintSettings::PageOrientation::LANDSCAPE)
                when "PORTRAIT" then ps.set_orientation(Gtk::PrintSettings::PageOrientation::PORTRAIT)
        end if gtk_attribute("page_orientation")
        case gtk_attribute("paper_size").upcase
                when "A3" then ps.set_paper_size_and_default_margins(Gtk::PaperSize.new(Gtk::PaperSize::A3))
                when "A4" then ps.set_paper_size_and_default_margins(Gtk::PaperSize.new(Gtk::PaperSize::A4))
                when "A5" then ps.set_paper_size_and_default_margins(Gtk::PaperSize.new(Gtk::PaperSize::A5))
        end if gtk_attribute("paper_size")
        pop.set_default_page_setup(ps)
        #restore saved print_settings
        pop.print_settings=Gtk::PrintSettings.new.deserialize(get_conf(list_id,0,'print_settings'))
        #run the dialog
        pop.run_print_dialog
        #save the settings
        set_conf(list_id,0,'print_settings',pop.print_settings.serialize)
end