#!/usr/bin/ruby
# encoding: utf-8

class VirusScreen	
	def initialize(extlayers, button)
		@layers = Array.new
		fixed = Gtk::Fixed.new
		throbber = Gtk::EventBox.new.add Gtk::Image.new("throbber.gif")
		throbtext = Gtk::Label.new
		throbtext.width_request = 250
		throbtext.wrap = true
		throbtext.set_markup('<span foreground="white">Die Virensignaturen werden im Hintergrund aktualisiert.</span>')
		text5 = Gtk::Label.new
		text5.width_request = 250
		text5.wrap = true
		text5.set_markup("<span color='white'>Klicken Sie hier, um mit Ihren Einstellungen fortzufahren.</span>")
		forw  = Gtk::EventBox.new.add Gtk::Image.new("forward.png")
		archtext = TileHelpers.create_label("Sollen Archive nach Schadsoftware durchsucht werden? Dies verlangsamt die Suche und birgt das Risiko von Suchabbrüchen, steigert jedoch die Erkennungsrate.", 380)
		actiontext =  TileHelpers.create_label("Wie soll nach einem Fund von Schadsoftware weiter vorgegangen werden?", 380)
		
		archive_yes_radio = Gtk::RadioButton.new
		archive_no_radio = Gtk::RadioButton.new(archive_yes_radio)
		action_delete_radio = Gtk::RadioButton.new
		action_ignore_radio = Gtk::RadioButton.new(action_delete_radio)
		action_show_radio = Gtk::RadioButton.new(action_delete_radio)
		yestext = TileHelpers.create_label("<b>Ja</b>, Archive durchsuchen", 280)
		notext = TileHelpers.create_label("<b>Nein</b>, Archive ignorieren", 280)
		actdeltext = TileHelpers.create_label("Reparieren (löschen wenn nicht möglich)", 280)
		actigntext = TileHelpers.create_label("Reparieren  (ignorieren wenn nicht möglich)", 280)
		actshowtext = TileHelpers.create_label("Funde nur anzeigen", 280)
	
		button1 = Gtk::EventBox.new.add Gtk::Image.new("neutralturq.png")
		button2 = Gtk::EventBox.new.add Gtk::Image.new("neutralorange.png")
		fixed.put(button1, 0, 0)
		fixed.put(button2, 0, 130)
		fixed.put(archtext, 130, 0)
		fixed.put(actiontext, 130, 130)
		fixed.put(archive_yes_radio, 140, 60)
		fixed.put(archive_no_radio, 140, 90)
		fixed.put(yestext, 165, 63)
		fixed.put(notext, 165, 93)
		fixed.put(action_delete_radio, 140, 170)
		fixed.put(action_ignore_radio, 140, 195)
		fixed.put(action_show_radio, 140, 220)
		fixed.put(actdeltext, 165, 173)
		fixed.put(actigntext, 165, 198)
		fixed.put(actshowtext, 165, 223)
	
		fixed.put(forw, 853, 282)
		fixed.put(text5, 630, 288)
		TileHelpers.place_back(fixed, extlayers)
		fixed.put(throbber, 0, 332)
		fixed.put(throbtext, 52, 338)
		
		
		
		extlayers["virusstart"] = fixed
		@layers[0] = fixed
		button.signal_connect('button-release-event') { |x, y|
			if y.button == 1 
				extlayers.each { |k,v|v.hide_all }
				extlayers["virusstart"].show_all
			end
		}
		
		
		
	end
	attr_reader :layers
	
end