GUI_status InputDialog::callback(uint16 msg, GUI_CallBack *caller, void *data) { if(caller == (GUI_CallBack *)cancel_button) { return close_dialog(); } else if(caller == (GUI_CallBack *)save_button) { Game *game = Game::get_game(); MapWindow *map_window = game->get_map_window(); Configuration *config = Game::get_game()->get_config(); std::string interface_str; if(interface_button->GetSelection() == 2) interface_str = "ignore_block"; else if(interface_button->GetSelection() == 1) interface_str = "fullscreen"; else // 0 interface_str = "normal"; config->set("config/input/interface", interface_str); map_window->set_interface(); // must come after you set cfg game->set_dragging_enabled(dragging_button->GetSelection()); config->set("config/input/enabled_dragging", dragging_button->GetSelection() ? "yes" : "no"); game->get_event()->set_direction_selects_target(direction_button->GetSelection()); config->set("config/input/direction_selects_target", direction_button->GetSelection() ? "yes" : "no"); map_window->set_look_on_left_click(look_button->GetSelection()); config->set("config/input/look_on_left_click", look_button->GetSelection() ? "yes" : "no"); map_window->set_walk_with_left_button(walk_button->GetSelection()); config->set("config/input/walk_with_left_button", walk_button->GetSelection() ? "yes" : "no"); map_window->set_enable_doubleclick(doubleclick_button->GetSelection()); config->set("config/input/enable_doubleclick", doubleclick_button->GetSelection() ? "yes" : "no"); map_window->set_use_left_clicks(); // allow or disallow left clicks - Must come after look_on_left_click and enable_doubleclick if(game->get_game_type() == NUVIE_GAME_U6) { game->set_free_balloon_movement(balloon_button->GetSelection() == 1); config->set(config_get_game_key(config) + "/free_balloon_movement", balloon_button->GetSelection() ? "yes" : "no"); } if(open_container_button) { game->set_doubleclick_opens_containers(open_container_button->GetSelection()); config->set("config/input/doubleclick_opens_containers", open_container_button->GetSelection() ? "yes" : "no"); } if(command_button->GetSelection()) game->init_new_command_bar(); else game->delete_new_command_bar(); config->set("config/input/new_command_bar", command_button->GetSelection() ? "yes" : "no"); if(party_targeting_button) { game->get_view_manager()->get_party_view()->set_party_view_targeting(party_targeting_button->GetSelection()); config->set("config/input/party_view_targeting", party_targeting_button->GetSelection() ? "yes" : "no"); } config->write(); close_dialog(); return GUI_YUM; } return GUI_PASS; }
void progress_dialog::on_update_channels_completion() { // Change the stop button label to OK XMLCTRL( *this, "progress_dialog_stop_button", wxButton )->SetLabel( _( "OK" ) ); // Read close behaviour from config file. bool progress_dialog_close_on_exit; bool progress_dialog_close_on_error; progress_dialog_close_on_exit = (bool)the_configuration->Read( "/PLUCKER_DESKTOP/progress_dialog_close_on_exit", 0L ); progress_dialog_close_on_error = (bool)the_configuration->Read( "/PLUCKER_DESKTOP/progress_dialog_close_on_error", 0L ); if ( progress_dialog_close_on_exit && progress_dialog_close_on_error ) { // Always close the dialog, regardless of whether an error occurred. close_dialog(); } else if ( progress_dialog_close_on_exit && ! progress_dialog_close_on_error ) { // If no stderr erupted from piped_process::has_input, then shut down the dialog if ( ! m_error_occurred ) { close_dialog(); } } // Otherwise just leave it alone and wait for user to press "OK" or the "X" to close. }
void check_infowin(RESULT svar) { if((svar.type==WINDOW_CLICKED)&&(svar.data[0]==WM_CLOSED)) { close_dialog(&info_win); menu_icheck(menu_tree,MENU_INFORMATION,FALSE); menu_ienable(menu_tree,MENU_INFORMATION,TRUE); } else if(svar.type==DIALOG_CLICKED) switch(svar.data[0]) { case INFO_OK: button(&info_win, INFO_OK, CLEAR_STATE, SELECTED); close_dialog(&info_win); menu_icheck(menu_tree,MENU_INFORMATION,FALSE); menu_ienable(menu_tree,MENU_INFORMATION,TRUE); break; case INFO_REGISTER: button(&info_win, INFO_REGISTER, CLEAR_STATE, SELECTED); close_dialog(&info_win); open_dialog(®ister_win); break; default: ; } }
void check_user_win(const RESULT svar) { #ifdef LOGGING Log(LOG_FUNCTION,"check_user_win(...)\n"); #endif if((svar.type==WINDOW_CLICKED)&&(svar.data[SVAR_WINDOW_MESSAGE]==WM_CLOSED)) { close_dialog(&user_win); } else if(svar.type==DIALOG_CLICKED) { switch(svar.data[SVAR_OBJECT]) { case USER_OK: ted2str(user_win.dialog,USER_EMAIL,config.email); ted2str(user_win.dialog,USER_REALNAME,config.real_name); ted2str(user_win.dialog,USER_REPLYTO,config.replyto); ted2str(user_win.dialog,USER_ORGANIZ,config.organization); ted2str(user_win.dialog,USER_PAGE,config.homepage); ted2str(user_win.dialog,USER_REPLYSTR1,config.replystring1); ted2str(user_win.dialog,USER_REPLYSTR2,config.replystring2); button(&user_win, USER_OK, CLEAR_STATE, SELECTED,TRUE); close_dialog(&user_win); break; case USER_CANCEL: button(&user_win, USER_CANCEL, CLEAR_STATE, SELECTED,FALSE); close_dialog(&user_win); break; default:; } } Return; }
static void ok_clicked_cb (GtkWidget *widget, DialogData *data) { GList *file_list; GFile *destination; GError *error = NULL; gboolean import; file_list = get_selected_file_list (data); destination = gth_import_preferences_get_destination (); if (! gth_import_task_check_free_space (destination, file_list, &error)) { _gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->dialog), _("Could not import the files"), error); g_clear_error (&error); import = FALSE; } else import = TRUE; _g_object_unref (destination); _g_object_list_unref (file_list); if (! import) return; data->import = TRUE; close_dialog (NULL, data); }
int MCA_folder(MCExecPoint& ep, const char *p_title, const char *p_prompt, const char *p_initial, unsigned int p_options) { if (!MCModeMakeLocalWindows()) { char *t_resolved_initial_path = MCS_resolvepath(p_initial); MCRemoteFolderDialog(ep, p_title, p_prompt, t_resolved_initial_path); if (t_resolved_initial_path != NULL) free(t_resolved_initial_path); return 0; } ////////// GtkWidget *dialog ; dialog = create_open_dialog( p_title == NULL ? p_prompt : p_title, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ); if ( p_initial != NULL ) gtk_file_chooser_set_current_folder ( GTK_FILE_CHOOSER ( dialog ) , MCS_resolvepath(p_initial) ); run_dialog ( dialog, ep) ; close_dialog ( dialog ) ; return (1); }
GUI_status InputDialog::KeyDown(SDL_keysym key) { KeyBinder *keybinder = Game::get_game()->get_keybinder(); ActionType a = keybinder->get_ActionType(key); switch(keybinder->GetActionKeyType(a)) { case NORTH_KEY: case WEST_KEY: if(b_index_num != -1) button_index[b_index_num]->set_highlighted(false); if(b_index_num <= 0) b_index_num = last_index; else b_index_num = b_index_num - 1; button_index[b_index_num]->set_highlighted(true); break; case SOUTH_KEY: case EAST_KEY: if(b_index_num != -1) button_index[b_index_num]->set_highlighted(false); if(b_index_num == last_index) b_index_num = 0; else b_index_num += 1; button_index[b_index_num]->set_highlighted(true); break; case DO_ACTION_KEY: if(b_index_num != -1) return button_index[b_index_num]->Activate_button(); break; case CANCEL_ACTION_KEY: return close_dialog(); default: keybinder->handle_always_available_keys(a); break; } return GUI_YUM; }
SDiscDetector::~SDiscDetector() { if( p->dialog != 0 ) close_dialog(); delete p; }
static void loader_completed_cb (GthTask *task, GError *error, gpointer user_data) { LoaderData *loader_data = user_data; DialogData *data = loader_data->data; if (error != NULL) { if (! g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) _gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->browser), _("Cannot read file information"), error); loader_data_free (loader_data); if (data->never_shown) close_dialog (data); return; } _g_object_list_unref (data->file_list); data->file_list = _g_object_list_ref (gth_load_file_data_task_get_result (GTH_LOAD_FILE_DATA_TASK (task))); gth_edit_metadata_dialog_set_file_list (GTH_EDIT_METADATA_DIALOG (data->dialog), data->file_list); gtk_window_set_transient_for (GTK_WINDOW (data->dialog), GTK_WINDOW (data->browser)); gtk_window_set_modal (GTK_WINDOW (data->dialog), FALSE); gtk_window_present (GTK_WINDOW (data->dialog)); data->never_shown = FALSE; loader_data_free (loader_data); }
static void saver_completed_cb (GthTask *task, GError *error, gpointer user_data) { DialogData *data = user_data; GthMonitor *monitor; GList *scan; monitor = gth_main_get_default_monitor (); for (scan = data->parents; scan; scan = scan->next) gth_monitor_resume (monitor, (GFile *) scan->data); if (error != NULL) { if (! g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) _gtk_error_dialog_from_gerror_show (GTK_WINDOW (data->dialog), _("Could not save the file metadata"), error); } else { for (scan = data->file_list; scan; scan = scan->next) { GthFileData *file_data = scan->data; GList *files; files = g_list_prepend (NULL, g_object_ref (file_data->file)); gth_monitor_metadata_changed (monitor, file_data); _g_object_list_unref (files); } } if (data->close_dialog) close_dialog (data); dialog_data_unref (data); }
static void edit_metadata_dialog__response_cb (GtkDialog *dialog, int response, gpointer user_data) { DialogData *data = user_data; GthMonitor *monitor; GHashTable *parents; GList *scan; GthTask *task; if ((response != GTK_RESPONSE_OK) && (response != GTK_RESPONSE_APPLY)) { cancel_file_list_loading (data); close_dialog (data); return; } if (data->file_list == NULL) return; data->close_dialog = (response == GTK_RESPONSE_OK); /* get the parents list */ parents = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, NULL); for (scan = data->file_list; scan; scan = scan->next) { GthFileData *file_data = scan->data; GFile *parent; parent = g_file_get_parent (file_data->file); if (G_LIKELY (parent != NULL)) { if (g_hash_table_lookup (parents, parent) == NULL) g_hash_table_insert (parents, g_object_ref (parent), GINT_TO_POINTER (1)); g_object_unref (parent); } } _g_object_list_unref (data->parents); data->parents = g_hash_table_get_keys (parents); g_list_foreach (data->parents, (GFunc) g_object_ref, NULL); g_hash_table_unref (parents); /* ignore changes to all the parents */ monitor = gth_main_get_default_monitor (); for (scan = data->parents; scan; scan = scan->next) gth_monitor_pause (monitor, (GFile *) scan->data); gth_edit_metadata_dialog_update_info (GTH_EDIT_METADATA_DIALOG (data->dialog), data->file_list); dialog_data_ref (data); task = gth_save_file_data_task_new (data->file_list, "*"); g_signal_connect (task, "completed", G_CALLBACK (saver_completed_cb), data); gth_browser_exec_task (data->browser, task, FALSE); g_object_unref (task); }
ReferenceDialog::~ReferenceDialog() { the = 0; previous_size = size(); close_dialog(this); }
int check_registerwin(RESULT svar) { short xy[4]; if((svar.type==WINDOW_CLICKED)&&(svar.data[0]==WM_CLOSED)) { close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFO,FALSE); menu_ienable(menu_tree,MENU_INFO,TRUE); } else if(svar.type==DIALOG_CLICKED) switch(svar.data[0]) { case REG_EXIT: button(®ister_win, REG_EXIT, CLEAR_STATE, SELECTED); close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFO,FALSE); menu_ienable(menu_tree,MENU_INFO,TRUE); break; case REG_REGISTER: if(check_key(FALSE)) { init_var.registered=TRUE; button(®ister_win, REG_REGISTER, CLEAR_STATE, SELECTED); close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFO,FALSE); menu_ienable(menu_tree,MENU_INFO,TRUE); } else { init_var.registered=FALSE; button(®ister_win, REG_REGISTER, CLEAR_STATE, SELECTED); } break; case REG_LOAD_KEY: load_reg_file(); button(®ister_win, REG_LOAD_KEY, CLEAR_STATE, SELECTED); xy[0]=screenx; xy[1]=screeny; xy[2]=screenw; xy[3]=screenh; update(®ister_win,xy); break; } return(FALSE); }
static gboolean dialog_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { close_dialog (NULL, (DialogData *) user_data); return TRUE; }
void SDiscDetector::button_clicked( QAbstractButton *button ) { QMessageBox::ButtonRole role = p->message->buttonRole( button ); switch( static_cast<int>(role) ) { case QMessageBox::Rejected: close_dialog(); checking(); break; case QMessageBox::Accepted: close_dialog(); disconnect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , this , SLOT(checking()) ); emit rejected(); break; } }
void check_registerwin(RESULT svar) { short xy[4]; if((svar.type==WINDOW_CLICKED)&&(svar.data[0]==WM_CLOSED)) { close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFORMATION,FALSE); menu_ienable(menu_tree,MENU_INFORMATION,TRUE); } else if(svar.type==DIALOG_CLICKED) { switch(svar.data[0]) { case REG_EXIT: button(®ister_win, REG_EXIT, CLEAR_STATE, SELECTED); close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFORMATION,FALSE); menu_ienable(menu_tree,MENU_INFORMATION,TRUE); break; case REG_REGISTER: if(check_key(FALSE)) { tempvar.registered=TRUE; button(®ister_win, REG_REGISTER, CLEAR_STATE, SELECTED); close_dialog(®ister_win); menu_icheck(menu_tree,MENU_INFORMATION,FALSE); menu_ienable(menu_tree,MENU_INFORMATION,TRUE); } else { tempvar.registered=FALSE; button(®ister_win, REG_REGISTER, CLEAR_STATE, SELECTED); } tempvar.conf_change=TRUE; break; case REG_LOAD_KEY: load_reg_file(); button(®ister_win, REG_LOAD_KEY, CLEAR_STATE, SELECTED); wind_get(mailconv_win.ident,WF_WORKXYWH,xy,xy+1,xy+2,xy+3); update(®ister_win,xy); break; default: ; } } }
BodyDialog::~BodyDialog() { previous_size = size(); if (eds.remove(this) && (f != 0)) // dialog still active f(dlg, e->text()); close_dialog(this); }
ActivityPartitionDialog::~ActivityPartitionDialog() { data->browser_node->edit_end(); previous_size = size(); while (!edits.isEmpty()) edits.take(0)->close(); close_dialog(this); }
BasicDialog::~BasicDialog() { data->get_browser_node()->edit_end(); previous_size = size(); while (!edits.isEmpty()) edits.take(0)->close(); close_dialog(this); }
PinDialog::~PinDialog() { pin->browser_node->edit_end(); previous_size = size(); while (!edits.isEmpty()) edits.take(0)->close(); close_dialog(this); }
ParameterSetDialog::~ParameterSetDialog() { data->browser_node->edit_end(); previous_size = size(); while (!edits.isEmpty()) edits.take(0)->close(); close_dialog(this); }
SimpleRelationDialog::~SimpleRelationDialog() { rel->browser_node->edit_end(); previous_size = size(); while (!edits.isEmpty()) edits.take(0)->close(); close_dialog(this); }
/**************************************************************** * * * affiche une boŒte de dialogue des caractŠres ASCII * * * ****************************************************************/ char m_ascii_box(char car, int modal) { DIAINFO *info; int exit, dc; int mx, my, bx, dummy; sprintf(Dialog[ASCII].tree[ASCII_CARACTERE].ob_spec.tedinfo -> te_ptext, "%c, x%02X, %3d", car, car, car); if (modal) { info = open_dialog(Dialog[ASCII].tree, NULL, NULL, NULL, TRUE, TRUE, AUTO_DIAL|MODAL|NO_ICONIFY, 0, NULL, NULL); do { exit = X_Form_Do(NULL); /* enlŠve le flag double clic */ dc = exit & DOUBLE_CLICK; exit &= NO_CLICK; if (exit == ASCII_OK) break; mouse(&mx, &my); /* position de la premiŠre ligne */ objc_offset(Dialog[ASCII].tree, ASCII_LIGNE_1, &bx, &dummy); /* d‚termination du caractŠre */ car = (char)((exit - ASCII_LIGNE_1)*32 + (mx - bx)/8); if (car == 0) car = ' '; sprintf(Dialog[ASCII].tree[ASCII_CARACTERE].ob_spec.tedinfo -> te_ptext, "%c, x%02X, %3d", car, car, car); ob_draw(info, ASCII_CARACTERE); if (dc) /* on sort aussi avec un double clic */ break; } while (TRUE); if (exit!=W_ABANDON && exit!=W_CLOSED) { exit &= 0x7fff; ob_undostate(Dialog[ASCII].tree, exit, SELECTED); } close_dialog(info, TRUE); } else { Dialog[ASCII].proc = m_ascii_box_proc; my_open_dialog(&Dialog[ASCII], AUTO_DIAL, FAIL); } return car; } /* m_ascii_box */
ParameterDialog::~ParameterDialog() { param->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
TransitionDialog::~TransitionDialog() { rel->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
ClassInstanceDialog::~ClassInstanceDialog() { inst->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
PseudoStateDialog::~PseudoStateDialog() { pst->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
ActivityDialog::~ActivityDialog() { activity->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
ExpansionRegionDialog::~ExpansionRegionDialog() { data->browser_node->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }
ComponentDialog::~ComponentDialog() { data->get_browser_node()->edit_end(); previous_size = size(); foreach (BodyDialog *dialog, edits) dialog->close(); edits.clear(); close_dialog(this); }