#include <gtk/gtk.h>
#include <stdlib.h>
#include <stdio.h>

#include "interface.h"
#include "support.h"

sat *filecontent;
GtkWidget *PICTracker_Prog;

int main(int argc, char *argv[]) {
    sat *prevsat;

    filecontent=NULL;

    gtk_init(&argc, &argv);

    PICTracker_Prog = create_PICTracker_Prog ();

    gtk_combo_box_set_active(GTK_COMBO_BOX(SELECT_Port),0);
    gtk_combo_box_set_active(GTK_COMBO_BOX(SELECT_Speed),3);

    g_signal_connect ((gpointer) BTN_Prog, "clicked",G_CALLBACK (on_BTN_Prog_clicked), NULL);
    g_signal_connect ((gpointer) BTN_Load, "clicked",G_CALLBACK (on_BTN_Load_clicked), NULL);
    g_signal_connect ((gpointer) BTN_Quit, "clicked",G_CALLBACK (on_BTN_Quit_clicked), NULL);
    g_signal_connect ((gpointer) BTN_Filechoose, "selection_changed",G_CALLBACK (on_BTN_Filechoose_selection_changed), NULL);
    g_signal_connect ((gpointer) PICTracker_Prog, "destroy",G_CALLBACK (gtk_main_quit), NULL);

    gtk_widget_show_all(PICTracker_Prog);
    gtk_main ();

    while(filecontent!=NULL) {
        prevsat=filecontent->prev;
        free(filecontent);
        filecontent=prevsat;
    }

    return 0;
}
