Freeciv-3.3
Loading...
Searching...
No Matches
Enumerations | Functions | Variables
gotodlg.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "astring.h"
#include "fcintl.h"
#include "log.h"
#include "support.h"
#include "game.h"
#include "map.h"
#include "packets.h"
#include "player.h"
#include "unit.h"
#include "unitlist.h"
#include "client_main.h"
#include "control.h"
#include "goto.h"
#include "options.h"
#include "text.h"
#include "plrdlg.h"
#include "dialogs.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "gotodlg.h"

Go to the source code of this file.

Enumerations

enum  { CMD_AIRLIFT = 1 , CMD_GOTO }
 
enum  {
  GD_COL_CITY_ID = 0 , GD_COL_CITY_NAME , GD_COL_FLAG , GD_COL_NATION ,
  GD_COL_AIRLIFT , GD_COL_NUM
}
 

Functions

static void update_goto_dialog (GtkToggleButton *button)
 
static void update_source_label (void)
 
static void refresh_airlift_column (void)
 
static void refresh_airlift_button (void)
 
static void goto_selection_callback (GtkTreeSelection *selection, gpointer data)
 
static struct cityget_selected_city (void)
 
static void goto_cmd_callback (GtkWidget *dlg, gint arg)
 
static void create_goto_dialog (void)
 
void popup_goto_dialog (void)
 
static bool list_store_append_player_cities (GtkListStore *store, const struct player *pplayer)
 
void goto_dialog_focus_units_changed (void)
 

Variables

static GtkWidgetdshell = NULL
 
static GtkWidgetview
 
static GtkWidgetsource
 
static GtkWidgetall_toggle
 
static GtkListStoregoto_list_store
 
static GtkTreeSelectiongoto_list_selection
 
struct tileoriginal_tile
 
static bool gotodlg_updating = FALSE
 

Enumeration Type Documentation

◆ anonymous enum

Enumerator
CMD_AIRLIFT 
CMD_GOTO 

Definition at line 73 of file gotodlg.c.

◆ anonymous enum

Enumerator
GD_COL_CITY_ID 
GD_COL_CITY_NAME 
GD_COL_FLAG 
GD_COL_NATION 
GD_COL_AIRLIFT 
GD_COL_NUM 

Definition at line 77 of file gotodlg.c.

Function Documentation

◆ create_goto_dialog()

static void create_goto_dialog ( void  )
static

Create goto -dialog for gotoing or airlifting unit

Definition at line 135 of file gotodlg.c.

Referenced by popup_goto_dialog().

◆ get_selected_city()

static struct city * get_selected_city ( void  )
static

Return currently selected city

Definition at line 274 of file gotodlg.c.

Referenced by goto_cmd_callback(), goto_selection_callback(), and refresh_airlift_button().

◆ goto_cmd_callback()

static void goto_cmd_callback ( GtkWidget dlg,
gint  arg 
)
static

User has responded to goto dialog

Definition at line 90 of file gotodlg.c.

Referenced by create_goto_dialog().

◆ goto_dialog_focus_units_changed()

void goto_dialog_focus_units_changed ( void  )

Called when the set of units in focus has changed; updates airlift info

Definition at line 541 of file gotodlg.c.

Referenced by real_focus_units_changed().

◆ goto_selection_callback()

static void goto_selection_callback ( GtkTreeSelection selection,
gpointer  data 
)
static

Update goto dialog. button tells if cities of all players or just client's player should be listed.

Definition at line 521 of file gotodlg.c.

Referenced by create_goto_dialog().

◆ list_store_append_player_cities()

static bool list_store_append_player_cities ( GtkListStore store,
const struct player pplayer 
)
static

Appends the list of the city owned by the player in the goto dialog.

Definition at line 294 of file gotodlg.c.

Referenced by update_goto_dialog().

◆ popup_goto_dialog()

void popup_goto_dialog ( void  )

Popup the dialog

Definition at line 258 of file gotodlg.c.

Referenced by mr_menu::slot_airlift(), unit_goto_city_callback(), unit_goto_city_callback(), and unit_order_callback().

◆ refresh_airlift_button()

static void refresh_airlift_button ( void  )
static

Refresh the state of the "Airlift" button for the currently selected unit(s) and city.

Definition at line 493 of file gotodlg.c.

Referenced by goto_dialog_focus_units_changed(), goto_selection_callback(), and update_goto_dialog().

◆ refresh_airlift_column()

static void refresh_airlift_column ( void  )
static

Refresh airlift column in city list (without tearing everything down).

Definition at line 467 of file gotodlg.c.

Referenced by goto_dialog_focus_units_changed(), and update_goto_dialog().

◆ update_goto_dialog()

static void update_goto_dialog ( GtkToggleButton button)
static

Refresh city list (in response to "all cities" checkbox changing).

Definition at line 432 of file gotodlg.c.

◆ update_source_label()

static void update_source_label ( void  )
static

Refresh the label that shows where the selected unit(s) currently are (and the relevant cities' airlift capacities, if relevant).

Definition at line 327 of file gotodlg.c.

Referenced by create_goto_dialog(), and goto_dialog_focus_units_changed().

Variable Documentation

◆ all_toggle

GtkWidget* all_toggle
static

Definition at line 59 of file gotodlg.c.

Referenced by create_goto_dialog().

◆ dshell

GtkWidget* dshell = NULL
static

◆ goto_list_selection

GtkTreeSelection* goto_list_selection
static

Definition at line 61 of file gotodlg.c.

Referenced by create_goto_dialog(), and get_selected_city().

◆ goto_list_store

GtkListStore* goto_list_store
static

Definition at line 60 of file gotodlg.c.

Referenced by create_goto_dialog(), refresh_airlift_column(), and update_goto_dialog().

◆ gotodlg_updating

bool gotodlg_updating = FALSE
static

Definition at line 63 of file gotodlg.c.

Referenced by goto_selection_callback(), and update_goto_dialog().

◆ original_tile

struct tile* original_tile

Definition at line 62 of file gotodlg.c.

Referenced by create_goto_dialog(), and goto_cmd_callback().

◆ source

GtkWidget* source
static

◆ view

GtkWidget* view
static

Definition at line 57 of file gotodlg.c.