Exemple #1
0
/**************************************************************************
  Sets the "page" that the client should show.  See documentation in
  pages_g.h.
**************************************************************************/
void real_set_client_page(enum client_pages page)
{
    switch (old_page) {
    case PAGE_MAIN:
        popdown_start_menu();
        break;
    case PAGE_LOAD:
        popdown_load_game_dialog();
        break;
    case PAGE_NETWORK:
        close_connection_dialog();
        break;
    case PAGE_START:
        popdown_conn_list_dialog();
        break;
    case PAGE_GAME:
        close_game_page();
        break;
    default:
        break;
    }

    switch (page) {
    case PAGE_MAIN:
        show_main_page();
        break;
    case PAGE_LOAD:
        client_start_server();
        break;
    case PAGE_NETWORK:
        popup_join_game_dialog();
        break;
    case PAGE_START:
        conn_list_dialog_update();
        break;
    case PAGE_GAME:
        show_game_page();
        enable_main_widgets();
        update_info_label();
        unit_focus_update();
        update_unit_info_label(get_units_in_focus());
        update_turn_done_button_state();
        refresh_overview();
        menus_update();
        break;
    default:
        break;
    }

    old_page = page;
}
Exemple #2
0
/*************************************************************************
  Close socket and cleanup.  This one doesn't print a message, so should
  do so before-hand if necessary.
**************************************************************************/
static void close_socket_nomessage(struct connection *pc)
{
  if (with_ggz || in_ggz) {
    remove_ggz_input();
  }
  if (in_ggz) {
    gui_ggz_embed_leave_table();
  }
  connection_common_close(pc);
  remove_net_input();
  popdown_races_dialog(); 
  close_connection_dialog();

  set_client_state(C_S_DISCONNECTED);
}