Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-qt/shortcuts.cpp File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Enumerations | Functions | Variables
shortcuts.cpp File Reference
`#include <QDialog>`
`#include <QDialogButtonBox>`
`#include <QGridLayout>`
`#include <QLabel>`
`#include <QMouseEvent>`
`#include <QLineEdit>`
`#include <QScrollArea>`
`#include <QSettings>`
`#include <QVBoxLayout>`
`#include <QWidget>`
`#include "options.h"`
`#include "fc_client.h"`
`#include "shortcuts.h"`

Go to the source code of this file.

## Enumerations

enum | { RESPONSE_CANCEL , RESPONSE_OK , RESPONSE_APPLY , RESPONSE_RESET , RESPONSE_SAVE }

## Functions

void | real_menus_init ()
static QString | button_name (Qt::MouseButton bt)
static QMap< shortcut_id, fc_shortcut * > * | hash_copy (QMap< shortcut_id, fc_shortcut * > *h)
QString | shortcut_to_string (fc_shortcut *sc)
void | popup_shortcuts_dialog ()
void | write_shortcuts ()
bool | read_shortcuts ()
void | shortcutreset ()

## Variables

static QHash< int, const char * > | key_map
static bool | use_default_shortcuts = false
static int | num_shortcuts = SC_NUM_SHORTCUTS
fc_shortcut | default_shortcuts []

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
RESPONSE_CANCEL |
RESPONSE_OK |
RESPONSE_APPLY |
RESPONSE_RESET |
RESPONSE_SAVE |

Definition at line 46 of file shortcuts.cpp.

## Function Documentation

## ◆ button_name()

QString button_name | ( | Qt::MouseButton | bt | ) |

static

Returns mouse button name

Definition at line 453 of file shortcuts.cpp.

Referenced by choice_dialog_get_nth_button(), and shortcut_to_string().

## ◆ hash_copy()

QMap< shortcut_id, fc_shortcut * > * hash_copy | ( | QMap< shortcut_id, fc_shortcut * > * | h | ) |

static

Make deep copy of shortcut map

Definition at line 765 of file shortcuts.cpp.

Referenced by fc_shortcuts_dialog::fc_shortcuts_dialog().

## ◆ popup_shortcuts_dialog()

void popup_shortcuts_dialog | ( |  | ) |

Popups shortcut dialog

Definition at line 756 of file shortcuts.cpp.

Referenced by mr_menu::shortcut_options().

## ◆ read_shortcuts()

bool read_shortcuts | ( |  | ) |

Reads shortcuts from file. Returns false if failed.

Definition at line 825 of file shortcuts.cpp.

Referenced by fc_shortcuts::init_default().

## ◆ 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 2906 of file menu.c.

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

## ◆ shortcut_to_string()

QString shortcut_to_string | ( | fc_shortcut * | sc | ) |

Returns shortcut as string (eg. for menu)

Definition at line 184 of file shortcuts.cpp.

Referenced by fc_shortcut_popup::closeEvent(), mr_menu::execute_shortcut(), fc_sc_button::fc_sc_button(), fc_sc_button::popup_error(), mr_menu::setup_menus(), mr_menu::shortcut_2_menustring(), and mr_menu::shortcut_exist().

## ◆ shortcutreset()

void shortcutreset | ( |  | ) |

Do not use saved shortcuts, but default ones.

Definition at line 865 of file shortcuts.cpp.

Referenced by parse_options().

## ◆ write_shortcuts()

void write_shortcuts | ( |  | ) |

Writes shortcuts to file

Definition at line 792 of file shortcuts.cpp.

Referenced by fc_shortcuts_dialog::apply_option(), and fc_client::write_settings().

## Variable Documentation

## ◆ default_shortcuts

fc_shortcut default_shortcuts[]

Definition at line 58 of file shortcuts.cpp.

Referenced by fc_shortcuts::init_default(), and read_shortcuts().

## ◆ key_map

QHash<int, const char *> key_map

static

Definition at line 40 of file shortcuts.cpp.

## ◆ num_shortcuts

int num_shortcuts = SC_NUM_SHORTCUTS

static

Definition at line 56 of file shortcuts.cpp.

Referenced by hash_copy(), fc_shortcuts::init_default(), read_shortcuts(), and write_shortcuts().

## ◆ use_default_shortcuts

bool use_default_shortcuts = false

static

Definition at line 54 of file shortcuts.cpp.

Referenced by read_shortcuts(), and shortcutreset().