示例#1
0
void alert_window(GtkWidget *widget) {
  UNUSED(widget);
  check_alerts();
  char **listCompte = bdd_get_libelle_account();
  if (listCompte != NULL) {
    UNUSED(widget);
    clean_window();
    GtkWidget *button_alerte_cat, *button_alert_compte, *button_retour;

    gtk_window_set_title(GTK_WINDOW(window), "Alertes");
    gtk_window_set_default_size(GTK_WINDOW(window), 800,600);
    gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);

    button_alerte_cat = gtk_button_new_with_label("Nouvelle alerte sur une categorie");
    g_signal_connect(button_alerte_cat, "clicked", G_CALLBACK(create_alert_form), "max_cat");

    button_alert_compte = gtk_button_new_with_label("Nouvelle alerte sur un compte");
    g_signal_connect(button_alert_compte, "clicked", G_CALLBACK(create_alert_form), "min_account");

    button_retour = gtk_button_new_with_label("Retour");
    g_signal_connect(button_retour, "clicked", G_CALLBACK(main_window), NULL);

    gtk_grid_attach(GTK_GRID(grid), button_alerte_cat, 0, 0, 1, 1);
    gtk_grid_attach(GTK_GRID(grid), button_alert_compte, 0, 1, 1, 1);
    gtk_grid_attach(GTK_GRID(grid), button_retour, 0, 2, 1, 1);

    gtk_widget_show_all(window);
  } else {
    alert_dialog(window, "Please create accounts before trying to add alerts");
  }
}
示例#2
0
/*
 * This could be further simplified by constructing an expected
 * HANDSHAKE_RESULT, and implementing comparison methods for
 * its fields.
 */
static int check_test(HANDSHAKE_RESULT result, SSL_TEST_CTX *test_ctx)
{
    int ret = 1;
    ret &= check_result(result, test_ctx);
    ret &= check_alerts(result, test_ctx);
    if (result.result == SSL_TEST_SUCCESS) {
        ret &= check_protocol(result, test_ctx);
        ret &= check_servername(result, test_ctx);
        ret &= check_session_ticket(result, test_ctx);
        ret &= (result.session_ticket_do_not_call == 0);
    }
    return ret;
}
示例#3
0
/*
 * This could be further simplified by constructing an expected
 * HANDSHAKE_RESULT, and implementing comparison methods for
 * its fields.
 */
static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx)
{
    int ret = 1;
    ret &= check_result(result, test_ctx);
    ret &= check_alerts(result, test_ctx);
    if (result->result == SSL_TEST_SUCCESS) {
        ret &= check_protocol(result, test_ctx);
        ret &= check_servername(result, test_ctx);
        ret &= check_session_ticket(result, test_ctx);
        ret &= (result->session_ticket_do_not_call == 0);
#ifndef OPENSSL_NO_NEXTPROTONEG
        ret &= check_npn(result, test_ctx);
#endif
        ret &= check_alpn(result, test_ctx);
        ret &= check_resumption(result, test_ctx);
        ret &= check_tmp_key(result, test_ctx);
    }
    return ret;
}