static void cb_button_ok(GtkButton *button, gpointer user_data) { u_int64_t pharr8[MAX_PHRASE_LEN]; int i; for(i=0; i < bigphoN; i++) { int idx = gtk_combo_box_get_active(GTK_COMBO_BOX(bigpho[i].opt_menu)); void *dest = get_ph_key_ptr(pharr8, i); cp_ph_key(bigpho[i].phokeys, idx, dest); } save_phrase_to_db(pharr8, current_str, bigphoN, 0); destroy_pho_sel_area(); }
static gboolean cb_ok(GtkWidget *widget, gpointer data) { SAVE_SESS *sess = (SAVE_SESS *)data; g_source_remove(sess->countdown_handle); int i; phokey_t pho[MAX_PHRASE_LEN]; u_int pho32[MAX_PHRASE_LEN]; u_int64_t pho64[MAX_PHRASE_LEN]; char tt[512]; void *dat; wsp_str(sess->mywsp, sess->mywspN, tt); if (ph_key_sz==2) { for(i=0;i<sess->mywspN;i++) pho[i] = sess->mywsp[i].key; dat = pho; } else if (ph_key_sz==4) { for(i=0;i< sess->mywspN;i++) { pho32[i] = sess->mywsp[i].key; } dat = pho32; } else if (ph_key_sz==8) { for(i=0;i< sess->mywspN;i++) pho64[i] = sess->mywsp[i].key; dat = pho64; } save_phrase_to_db(dat, tt, sess->mywspN, 1); gtk_widget_destroy(sess->win); free_mywsp(sess); return TRUE; }
static void cb_button_ok(GtkButton *button, gpointer user_data) { u_int64_t pharr8[MAX_PHRASE_LEN]; int i; for(i=0; i < bigphoN; i++) { int idx = gtk_combo_box_get_active(GTK_COMBO_BOX(bigpho[i].opt_menu)); void *dest = get_ph_key_ptr(pharr8, i); cp_ph_key(bigpho[i].phokeys, idx, dest); } save_phrase_to_db(pharr8, current_str, bigphoN, 0); destroy_pho_sel_area(); GtkTextMark *selebound = gtk_text_buffer_get_selection_bound(buffer); gtk_text_mark_set_visible(selebound, FALSE); cb_button_parse(NULL, NULL); }