Exemple #1
0
/**************************************************************************
...
**************************************************************************/
static void meswin_response_callback(struct gui_dialog *dlg, int response,
                                     gpointer data)
{
  GtkTreeSelection *sel;
  GtkTreeModel *model;
  GtkTreeIter iter;
  gint row;

  if (response != CMD_GOTO && response != CMD_POPCITY) {
    gui_dialog_destroy(dlg);
    return;
  }

  sel = meswin_selection;
  g_return_if_fail(sel != NULL);
  if (!gtk_tree_selection_get_selected(sel, &model, &iter)) {
    return;
  }

  gtk_tree_model_get(model, &iter, 2, &row, -1);

  if (response == CMD_GOTO) {
    meswin_goto(row);
  } else {
    meswin_popup_city(row);
  }
  meswin_set_visited(&iter, TRUE);
}
Exemple #2
0
/**************************************************************************
  Destroy all dialogs.
**************************************************************************/
void gui_dialog_destroy_all(void)
{
  GList *it, *it_next;

  for (it = dialog_list; it; it = it_next) {
    it_next = g_list_next(it);

    gui_dialog_destroy((struct gui_dialog *)it->data);
  }
}
Exemple #3
0
/*****************************************************************************
  Closes a lua console.
*****************************************************************************/
static void luaconsole_dialog_destroy(struct luaconsole_data *pdialog)
{
  fc_assert_ret(NULL != pdialog);

  if (pdialog->shell) {
    gui_dialog_destroy(pdialog->shell);
    fc_assert(NULL == pdialog->shell);
  }
  fc_assert(NULL == pdialog->message_area);
}
Exemple #4
0
/*****************************************************************************
  Dialog response callback.
*****************************************************************************/
static void luaconsole_response_callback(struct gui_dialog *pgui_dialog,
                                         int response, gpointer data)
{
  switch (response) {
  case LUACONSOLE_RES_OPEN:
    break;
  default:
    gui_dialog_destroy(pgui_dialog);
    return;
  }

  switch (response) {
  case LUACONSOLE_RES_OPEN:
    luaconsole_load_file_popup();
    break;
  }
}
Exemple #5
0
/**************************************************************************
 Closes the message window dialog.
**************************************************************************/
void popdown_meswin_dialog(void)
{
  if (meswin_shell) {
    gui_dialog_destroy(meswin_shell);
  }
}
Exemple #6
0
/**************************************************************************
  Default dialog response handler. Destroys the dialog.
**************************************************************************/
static void gui_dialog_destroyed(struct gui_dialog *dlg, int response,
                                 gpointer data)
{
  gui_dialog_destroy(dlg);
}