Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-qt/menu.cpp File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Macros | Functions
menu.cpp File Reference
`#include <QActionGroup>`
`#include <QApplication>`
`#include <QFileDialog>`
`#include <QMainWindow>`
`#include <QMessageBox>`
`#include <QScrollArea>`
`#include <QStandardPaths>`
`#include <QVBoxLayout>`
`#include "string_vector.h"`
`#include "game.h"`
`#include "government.h"`
`#include "goto.h"`
`#include "name_translation.h"`
`#include "road.h"`
`#include "unit.h"`
`#include "connectdlg_common.h"`
`#include "control.h"`
`#include "helpdata.h"`
`#include "fc_client.h"`
`#include "chatline.h"`
`#include "cityrep.h"`
`#include "dialogs.h"`
`#include "gotodlg.h"`
`#include "gui_main.h"`
`#include "hudwidget.h"`
`#include "mapctrl.h"`
`#include "messagedlg.h"`
`#include "plrdlg.h"`
`#include "ratesdlg.h"`
`#include "repodlgs.h"`
`#include "shortcuts.h"`
`#include "spaceshipdlg.h"`
`#include "sprite.h"`
`#include "menu.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

static void | enable_interface (bool enable)
void | real_menus_init (void)
void | real_menus_update (void)
static const char * | get_tile_change_menu_text (struct tile *ptile, enum unit_activity activity)
void | multiairlift (struct city *acity, Unit_type_id ut)

## Macro Definition Documentation

## ◆ ADD_OLD_SHORTCUT

#define ADD_OLD_SHORTCUT | ( |  | wanted_action_id,
|  |  | sc_id
| ) |  |

Value:
if (act_id == wanted_action_id) { \
item->setShortcut(QKeySequence(shortcut_to_string( \
fc_shortcuts::sc()->get_shortcut(sc_id)))); \
}
fc_shortcuts::sc
static fc_shortcuts * sc()
Definition shortcuts.cpp:278
incite_cost
char * incite_cost
Definition comments.c:74
shortcut_to_string
QString shortcut_to_string(fc_shortcut *sc)
Definition shortcuts.cpp:184
item
Definition climisc.h:80

## ◆ 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 3197 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 553 of file menu.cpp.

## ◆ multiairlift()

void multiairlift | ( | struct city * | acity,
|  | Unit_type_id | ut
| ) |  |

Airlift unit type to city acity from each city

Definition at line 3918 of file menu.cpp.

Referenced by map_view::shortcut_pressed().

## ◆ 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 512 of file menu.cpp.

## ◆ real_menus_update()

void real_menus_update | ( | void |  | ) |

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

Definition at line 530 of file menu.cpp.