Freeciv21
Develop your civilization from humble roots to a global empire
menu.cpp File Reference
#include "menu.h"
#include <QActionGroup>
#include <QApplication>
#include <QFileDialog>
#include <QMainWindow>
#include <QMenuBar>
#include <QMessageBox>
#include <QStandardPaths>
#include <QVBoxLayout>
#include "fcintl.h"
#include "fc_types.h"
#include "game.h"
#include "goto.h"
#include "government.h"
#include "helpdata.h"
#include "map.h"
#include "multipliers.h"
#include "road.h"
#include "tileset_options.h"
#include "unit.h"
#include "audio/audio.h"
#include "citybar.h"
#include "cityrep_g.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"
#include "connectdlg_common.h"
#include "control.h"
#include "dialogs.h"
#include "fc_client.h"
#include "gotodlg.h"
#include "gui_main.h"
#include "helpdlg.h"
#include "hudwidget.h"
#include "mapctrl_g.h"
#include "messageoptions.h"
#include "messagewin.h"
#include "minimap.h"
#include "minimap_panel.h"
#include "page_game.h"
#include "page_pregame.h"
#include "qtg_cxxside.h"
#include "ratesdlg.h"
#include "ratesdlg_g.h"
#include "renderer.h"
#include "repodlgs_g.h"
#include "shortcuts.h"
#include "spaceshipdlg.h"
#include "tileset/sprite.h"
#include "tileset/tilespec.h"
#include "top_bar.h"
#include "unithudselector.h"
#include "views/view_map.h"
#include "views/view_map_common.h"
#include "views/view_nations.h"
#include "views/view_units.h"

Go to the source code of this file.

Macros

#define CREATE_SUB_ITEM(_menu_, _act_id_, _sub_tgt_id_, _sub_tgt_name_)
 
#define ADD_OLD_SHORTCUT(wanted_action_id, sc_id)
 

Functions

void popup_endgame_report ()
 Popups endgame report to front if exists. More...
 
static void enable_interface (bool enable)
 Helper function to hide/show widgets. More...
 
void option_dialog_popup (const char *name, const struct option_set *poptset)
 Popup the option dialog for the option set. More...
 
void real_menus_init (void)
 Initialize menus (sensitivity, name, etc.) based on the current state and current ruleset, etc. More...
 
void real_menus_update (void)
 Update all of the menus (sensitivity, name, etc.) based on the current state. More...
 
static const char * get_tile_change_menu_text (struct tile *ptile, enum unit_activity activity)
 Return the text for the tile, changed by the activity. More...
 
static void reset_menu_and_sub_menues (QMenu *menu)
 Empty a menu of all its items and sub menues. More...
 
static struct extra_typenext_extra (const std::vector< unit * > &punits, extra_cause cause)
 
void multiairlift (struct city *acity, Unit_type_id ut)
 Airlift unit type to city acity from each city. More...
 

Macro Definition Documentation

◆ ADD_OLD_SHORTCUT

#define ADD_OLD_SHORTCUT (   wanted_action_id,
  sc_id 
)
Value:
if (act_id == wanted_action_id) { \
}
static fc_shortcuts * sc()
Returns given instance.
Definition: shortcuts.cpp:354
void link_action(shortcut_id id, QAction *action)
Links an action to a shortcut.
Definition: shortcuts.cpp:275
Definition: climisc.h:66

◆ CREATE_SUB_ITEM

#define CREATE_SUB_ITEM (   _menu_,
  _act_id_,
  _sub_tgt_id_,
  _sub_tgt_name_ 
)
Value:
{ \
QAction *_sub_item_ = _menu_->addAction(_sub_tgt_name_); \
int _sub_target_id_ = _sub_tgt_id_; \
QObject::connect(_sub_item_, &QAction::triggered, \
[this, _act_id_, _sub_target_id_]() { \
start_go_act(_act_id_, _sub_target_id_); \
}); \
}

Function Documentation

◆ enable_interface()

void enable_interface ( bool  enable)
static

Helper function to hide/show widgets.

Definition at line 2403 of file menu.cpp.

Referenced by mr_menu::slot_lock().

◆ get_tile_change_menu_text()

static const char* get_tile_change_menu_text ( struct tile ptile,
enum unit_activity  activity 
)
static

Return the text for the tile, changed by the activity.

Should only be called for irrigation, mining, or transformation, and only when the activity changes the base terrain type.

Definition at line 124 of file menu.cpp.

Referenced by mr_menu::menus_sensitive().

◆ multiairlift()

void multiairlift ( struct city acity,
Unit_type_id  ut 
)

Airlift unit type to city acity from each city.

Definition at line 2937 of file menu.cpp.

Referenced by map_view::shortcut_pressed().

◆ next_extra()

static struct extra_type* next_extra ( const std::vector< unit * > &  punits,
extra_cause  cause 
)
static

Definition at line 1500 of file menu.cpp.

Referenced by mr_menu::menus_sensitive().

◆ option_dialog_popup()

void option_dialog_popup ( const char *  name,
const struct option_set poptset 
)

Popup the option dialog for the option set.

Definition at line 722 of file optiondlg.cpp.

Referenced by mr_menu::server_options().

◆ popup_endgame_report()

void popup_endgame_report ( )

Popups endgame report to front if exists.

Definition at line 135 of file endgamereport.cpp.

Referenced by mr_menu::slot_endgame().

◆ real_menus_init()

void real_menus_init ( void  )

Initialize menus (sensitivity, name, etc.) based on the current state and current ruleset, etc.

Call menus_update().

Definition at line 83 of file menu.cpp.

Referenced by fc_shortcuts_dialog::apply_option(), and menus_init().

◆ real_menus_update()

void real_menus_update ( void  )

Update all of the menus (sensitivity, name, etc.) based on the current state.

Definition at line 101 of file menu.cpp.

Referenced by menus_init(), menus_update_callback(), and pageGame::updateInfoLabelTimeout().

◆ reset_menu_and_sub_menues()

static void reset_menu_and_sub_menues ( QMenu *  menu)
static

Empty a menu of all its items and sub menues.

Definition at line 282 of file menu.cpp.

Referenced by go_act_menu::reset().