Module: ListPrint

Included in:
MyEditableList
Defined in:
lib/ListHolder/EditableList/ListPrintOperation.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Defined Under Namespace

Classes: ListPrintOperation

Instance Method Summary collapse

Instance Method Details

#gtkprintObject



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# 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