/* ***********************IMPORTANT *********************************************
 *  Copyright (C) 2004-2007 Thierry Lagarde <tlagarde@users.sourceforge.net>
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License.
 *
 *
 *                      ********************
 *
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *
 *                      ********************
 *
 *
 * You are highly encouraged to send your changes to <tlagarde@users.sourceforge.net>
 * for possible incorporation into the main distribution.
 * By sending these changes to <tlagarde@users.sourceforge.net>,
 * it is assumed that you are offering <tlagarde@users.sourceforge.net>
 * the unlimited, non-exclusive right to reuse, modify, and relicense the code.
 *
 *
 *                      ********************
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **************************************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include "Wizard_Callbacks_Add_FingerPrinting.h"
#include "Wizard_Interface_Add_FingerPrinting.h"
#include "Wizard_Interface.h" 
#include "Wizard_Callbacks.h" 
#include "../Declaration_Constante.h"
#include "../Image.h"
#include "Combo.h"
#include "../Debug.h"


void Wizard_Interface_Add_Fingerprinting_Page1(){

  gtk_label_set_text(label_wizard, "<span foreground=\"white\" font_desc=\"18\"><b>Os FingerPrinting Wizard</b></span>");
  gtk_label_set_use_markup (GTK_LABEL (label_wizard), TRUE);
  gtk_widget_set_sensitive (button_wizard_Revenir, FALSE);

  hbox_wizard_Intro_Unknown_Equipement = gtk_hbox_new (FALSE, 0);
  viewport_wizard_Contenu = hbox_wizard_Intro_Unknown_Equipement;
  gtk_widget_show (hbox_wizard_Intro_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (viewport_wizard), hbox_wizard_Intro_Unknown_Equipement);

  eventbox_wizard_Intro_Unknown_Equipement = gtk_event_box_new ();
  gtk_widget_show (eventbox_wizard_Intro_Unknown_Equipement);
  gtk_box_pack_start (GTK_BOX (hbox_wizard_Intro_Unknown_Equipement), eventbox_wizard_Intro_Unknown_Equipement, FALSE, TRUE, 0);

  image_wizard_Intro_Unknown_Equipement = gtk_image_new_from_file (PATH_ICONE "Os_Fingerprinting.png");
  gtk_widget_modify_bg (eventbox_wizard_Intro_Unknown_Equipement, GTK_STATE_NORMAL, &Couleur_Bleu);
  gtk_widget_show (image_wizard_Intro_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (eventbox_wizard_Intro_Unknown_Equipement), image_wizard_Intro_Unknown_Equipement);

  eventbox_label_wizard_Intro_Unknown_Equipement = gtk_event_box_new ();
  gtk_widget_show (eventbox_label_wizard_Intro_Unknown_Equipement);
  gtk_box_pack_start (GTK_BOX (hbox_wizard_Intro_Unknown_Equipement), eventbox_label_wizard_Intro_Unknown_Equipement, TRUE, TRUE, 0);

  label_wizard_Intro_Unknown_Equipement = gtk_label_new ("This Wizard will add an unknown equipment to the AutoScan database\n");
  gtk_widget_modify_bg (eventbox_label_wizard_Intro_Unknown_Equipement, GTK_STATE_NORMAL, &Couleur_Blanc);
  gtk_widget_show (label_wizard_Intro_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (eventbox_label_wizard_Intro_Unknown_Equipement), label_wizard_Intro_Unknown_Equipement);
  gtk_label_set_use_markup (GTK_LABEL (label_wizard_Intro_Unknown_Equipement), TRUE);
  gtk_label_set_line_wrap (GTK_LABEL (label_wizard_Intro_Unknown_Equipement), TRUE);

 
  Wizard_Bouton_Annuler = Wizard_Bouton_Annuler_Add_FingerPrinting_Standard;
  Wizard_Bouton_Revenir = NULL;
  Wizard_Bouton_Avancer_Post = NULL;
  Wizard_Bouton_Avancer = Wizard_Bouton_Add_FingerPrinting_Page2;
  Wizard_Bouton_Enable();
 
}


void Wizard_Interface_Add_Fingerprinting_Page2(){

  gtk_label_set_text (label_wizard, "<span foreground=\"white\" font_desc=\"18\"><b>Information</b></span>");
  gtk_label_set_use_markup (GTK_LABEL (label_wizard), TRUE);
  gtk_widget_set_sensitive (button_wizard_Revenir, TRUE);

  vbox_Information_OS = gtk_vbox_new (FALSE, 0);
  viewport_wizard_Contenu = vbox_Information_OS;
  gtk_widget_show (vbox_Information_OS);
  gtk_container_add (GTK_CONTAINER (viewport_wizard), vbox_Information_OS);

  hbox_Information_OS_System_Name = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox_Information_OS_System_Name);
  gtk_box_pack_start (GTK_BOX (vbox_Information_OS), hbox_Information_OS_System_Name, FALSE, TRUE, 3);

  label_Information_OS_System_Name = gtk_label_new ("System name ");
  gtk_widget_show (label_Information_OS_System_Name);
  gtk_box_pack_start (GTK_BOX (hbox_Information_OS_System_Name), label_Information_OS_System_Name, FALSE, FALSE, 15);

  entry_Information_OS_System_Name = gtk_entry_new ();
  gtk_widget_show (entry_Information_OS_System_Name);
  gtk_box_pack_start (GTK_BOX (hbox_Information_OS_System_Name), entry_Information_OS_System_Name, FALSE, TRUE, 0);


  hbox_Information_OS_Type = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox_Information_OS_Type);
  gtk_box_pack_start (GTK_BOX (vbox_Information_OS), hbox_Information_OS_Type, FALSE, TRUE, 3);

  label_Information_OS_Type = gtk_label_new ("Type");
  gtk_widget_show (label_Information_OS_Type);
  gtk_box_pack_start (GTK_BOX (hbox_Information_OS_Type), label_Information_OS_Type, FALSE, FALSE, 41);

  combobox_Information_OS_Type = creation_combo (FALSE);
  gtk_combo_box_new_text ();
  creation_combo_type (combobox_Information_OS_Type);
  gtk_combo_box_set_active (GTK_COMBO_BOX (combobox_Information_OS_Type), -1);
  gtk_widget_show (combobox_Information_OS_Type);
  gtk_box_pack_start (GTK_BOX (hbox_Information_OS_Type), combobox_Information_OS_Type, FALSE, FALSE, 0);


  hbox_Information_MD5 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox_Information_MD5);
  gtk_box_pack_start (GTK_BOX (vbox_Information_OS), hbox_Information_MD5, FALSE, TRUE, 3);

  label_Information_MD5 = gtk_label_new ("Md5 Fingerprinting");
  gtk_widget_show (label_Information_MD5);
  gtk_box_pack_start (GTK_BOX (hbox_Information_MD5), label_Information_MD5, FALSE, FALSE, 3);

  entry_Information_MD5 = gtk_entry_new ();
  gtk_widget_show (entry_Information_MD5);
  gtk_box_pack_start (GTK_BOX (hbox_Information_MD5), entry_Information_MD5, TRUE, TRUE, 0);
  gtk_editable_set_editable (GTK_EDITABLE (entry_Information_MD5), FALSE);
 

  combobox_Information_Icon = creation_combo (FALSE);
  Creation_Combo_Liste_Fichier_Image (combobox_Information_Icon, PATH_ICONE "Equipment/", TRUE);
  gtk_widget_show (combobox_Information_Icon);	
  gtk_box_pack_start (GTK_BOX (vbox_Information_OS), combobox_Information_Icon, FALSE, FALSE, 0);
  gtk_combo_box_set_active (GTK_COMBO_BOX (combobox_Information_Icon), -1);

 
 
 
  Wizard_Bouton_Annuler = Wizard_Bouton_Annuler_Add_FingerPrinting_Standard;
  Wizard_Bouton_Revenir = Wizard_Bouton_Add_FingerPrinting_Page1;
  Wizard_Bouton_Avancer_Post =  Wizard_Bouton_Post_Add_FingerPrinting_Page3;
  Wizard_Bouton_Avancer = Wizard_Bouton_Add_FingerPrinting_Page3;
  Wizard_Bouton_Enable();
}



void Wizard_Interface_Add_Fingerprinting_Page3(){
  gtk_label_set_text (label_wizard, "<span foreground=\"white\" font_desc=\"18\"><b>Summary</b></span>");
  gtk_label_set_use_markup (GTK_LABEL (label_wizard), TRUE);

  hbox_wizard_Final_Unknown_Equipement = gtk_hbox_new (FALSE, 0);
  viewport_wizard_Contenu = hbox_wizard_Final_Unknown_Equipement;
  gtk_widget_show (hbox_wizard_Final_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (viewport_wizard), hbox_wizard_Final_Unknown_Equipement);

  eventbox_wizard_Final_Unknown_Equipement = gtk_event_box_new ();
  gtk_widget_show (eventbox_wizard_Final_Unknown_Equipement);
  gtk_box_pack_start (GTK_BOX (hbox_wizard_Final_Unknown_Equipement), eventbox_wizard_Final_Unknown_Equipement, FALSE, TRUE, 0);

  image_wizard_Final_Unknown_Equipement = gtk_image_new_from_file (PATH_ICONE "Os_Fingerprinting.png");
  gtk_widget_modify_bg (eventbox_wizard_Final_Unknown_Equipement, GTK_STATE_NORMAL, &Couleur_Bleu);
  gtk_widget_show (image_wizard_Final_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (eventbox_wizard_Final_Unknown_Equipement), image_wizard_Final_Unknown_Equipement);

  eventbox_label_wizard_Final_Unknown_Equipement = gtk_event_box_new ();
  gtk_widget_show (eventbox_label_wizard_Final_Unknown_Equipement);
  gtk_box_pack_start (GTK_BOX (hbox_wizard_Final_Unknown_Equipement), eventbox_label_wizard_Final_Unknown_Equipement, TRUE, TRUE, 0);

  label_wizard_Final_Unknown_Equipement = gtk_label_new ("Confirm the following information :\nSystem name :\nType :\n\nThis data allows you to contribute new equipment fingerprint to the AutoScan database. By submitting fingerprints you are transfering any copyright interest in the data to tlagarde@users.sourceforge.net These data can be to modify,relicense or incorporate into programs like AutoScan.");
  gtk_widget_modify_bg (eventbox_label_wizard_Final_Unknown_Equipement, GTK_STATE_NORMAL, &Couleur_Blanc);
  gtk_widget_show (label_wizard_Final_Unknown_Equipement);
  gtk_container_add (GTK_CONTAINER (eventbox_label_wizard_Final_Unknown_Equipement), label_wizard_Final_Unknown_Equipement);
  gtk_label_set_use_markup (GTK_LABEL (label_wizard_Final_Unknown_Equipement), TRUE);
  gtk_label_set_line_wrap (GTK_LABEL (label_wizard_Final_Unknown_Equipement), TRUE);
 

 
  Wizard_Bouton_Annuler = Wizard_Bouton_Annuler_Add_FingerPrinting_Standard;
  Wizard_Bouton_Revenir = Wizard_Bouton_Add_FingerPrinting_Page2;
  Wizard_Bouton_Avancer_Post = NULL;
  Wizard_Bouton_Avancer = Wizard_Bouton_Add_FingerPrinting_Fin;
  Wizard_Bouton_Enable();
}
