diff --git a/include/signal.h b/include/signal.h index b26fd52..9b0a664 100644 --- a/include/signal.h +++ b/include/signal.h @@ -155,5 +155,7 @@ void on_measure_time_elapsed_between_two_events (GtkWidget *btt, gpointer data); void on_measure_third_event_occurences_in_between (GtkWidget *btt, gpointer data); // correlate ? -void on_select_a_second_measurement(GtkWidget *btt, gpointer data); -void on_not_yet_defined(GtkWidget *btt, gpointer data); +void on_select_a_second_measurement (GtkWidget *btt, gpointer data); +void on_not_yet_defined (GtkWidget *btt, gpointer data); +void on_something_else (GtkWidget *btt, gpointer data); + diff --git a/include/widget.h b/include/widget.h index 1783ebf..753b2e2 100644 --- a/include/widget.h +++ b/include/widget.h @@ -265,3 +265,4 @@ void *widget_measure_event_occurences_situations(); void *widget_measure_time_elapsed_between_two_events(); void *widget_measure_third_event_occurences_in_between(); void *widget_measure_do_we_select_another_measurement(); +void *widget_not_yet_defined(); diff --git a/src/signal.c b/src/signal.c index 05a4805..2948c2e 100644 --- a/src/signal.c +++ b/src/signal.c @@ -406,19 +406,22 @@ void on_select_a_second_rules_set (GtkWidget *btt, gpointer data) } -void on_select_a_second_measurement(GtkWidget *btt, gpointer data) +void on_select_a_second_measurement (GtkWidget *btt, gpointer data) { gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), GTK_WIDGET (widget_measure_do_we_select_another_measurement())); } -void on_not_yet_defined(GtkWidget *btt, gpointer data) +void on_not_yet_defined (GtkWidget *btt, gpointer data) { - printf("OK > Then, select the other measurement to correlate with.\n"); + gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), + GTK_WIDGET (widget_not_yet_defined ())); } - - +void on_something_else (GtkWidget *btt, gpointer data) +{ + printf("insert in measurements list (this print comes from signal.c)\n"); +} void on_measure_single_event_occurences_nb (GtkWidget *btt, gpointer data) { diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c index 0df6430..c694f3c 100644 --- a/src/widget/measure/dispatch.c +++ b/src/widget/measure/dispatch.c @@ -72,6 +72,10 @@ static GtkBox *correlation_measures_box; //TODO static GtkWidget *correl; static GtkWidget *btt_select_another_measurement_question; +static GtkBox *insertion_in_list_measurements_box; //TODO +static GtkWidget *insert; +static GtkWidget *btt_insert_in_measurements_list; + // Measure concerns // - nb of occurences of the rule @@ -85,9 +89,26 @@ static GtkWidget *btt_select_another_measurement_question; // Is this measure to be correlated to some others ? +void *widget_not_yet_defined() +{ +// printf("insert in measurements list\n"); + insertion_in_list_measurements_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); + insert = gtk_picture_new_for_filename + ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/data collection.png"); + btt_insert_in_measurements_list = + gtk_toggle_button_new_with_label ("insert in measurements list"); + g_signal_connect (btt_insert_in_measurements_list, "toggled", + G_CALLBACK (on_something_else), NULL); + gtk_box_append (insertion_in_list_measurements_box, GTK_WIDGET (insert)); + gtk_box_append (insertion_in_list_measurements_box, GTK_WIDGET (btt_insert_in_measurements_list)); + gtk_box_append (measure_page, GTK_WIDGET (insertion_in_list_measurements_box)); + + return measure_page; +} + void *widget_measure_do_we_select_another_measurement() { - printf("Could this measurement be related to another one ?\n"); +// printf("Could this measurement be related to another one ?\n"); correlation_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); correl = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/buoy.png"); @@ -155,14 +176,14 @@ void *widget_measure_do_depends_on_a_single_event() G_CALLBACK (on_measure_single_event_occurences_nb), NULL); g_signal_connect (btt_select_date, "toggled", G_CALLBACK (on_measure_single_event_occurences_dates), NULL); - g_signal_connect (btt_select_date, "toggled", + g_signal_connect (btt_select_situation, "toggled", G_CALLBACK (on_measure_single_event_occurences_situations), NULL); g_signal_connect (btt_select_nb, "toggled", G_CALLBACK (on_select_a_second_measurement), NULL); g_signal_connect (btt_select_date, "toggled", G_CALLBACK (on_select_a_second_measurement), NULL); - g_signal_connect (btt_select_date, "toggled", + g_signal_connect (btt_select_situation, "toggled", G_CALLBACK (on_select_a_second_measurement), NULL); gtk_box_append (one_rule_measures_box, GTK_WIDGET (scale));