Freeciv-3.2: fc_shortcuts Class Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
fc_shortcuts Class Reference

`#include <shortcuts.h>`

## Public Member Functions

| ~fc_shortcuts ()
fc_shortcut * | get_shortcut (shortcut_id id)
shortcut_id | get_id (fc_shortcut *sc)
void | set_shortcut (fc_shortcut *sc)
QString | get_desc (shortcut_id id)

## Static Public Member Functions

static fc_shortcuts * | sc ()
static bool | is_instantiated ()
static void | drop ()
static void | init_default (bool read)

## Static Public Attributes

static QMap< shortcut_id, fc_shortcut * > | hash = QMap<shortcut_id, fc_shortcut*>()

## Private Member Functions

| Q_DISABLE_COPY (fc_shortcuts)
| fc_shortcuts ()

## Static Private Attributes

static fc_shortcuts * | m_instance = 0

## Detailed Description

Definition at line 119 of file shortcuts.h.

## Constructor & Destructor Documentation

## ◆ fc_shortcuts()

fc_shortcuts::fc_shortcuts | ( |  | ) |

private

fc_shortcuts contructor

Definition at line 208 of file shortcuts.cpp.

Referenced by sc().

## ◆ ~fc_shortcuts()

fc_shortcuts::~fc_shortcuts | ( |  | ) |

fc_shortcuts destructor

Definition at line 216 of file shortcuts.cpp.

## Member Function Documentation

## ◆ drop()

void fc_shortcuts::drop | ( |  | ) |

static

Deletes current instance

Definition at line 267 of file shortcuts.cpp.

## ◆ get_desc()

QString fc_shortcuts::get_desc | ( | shortcut_id | id | ) |

Returns description for given shortcut

Definition at line 226 of file shortcuts.cpp.

Referenced by fc_shortcut_popup::check_if_exist(), and fc_shortcuts_dialog::init().

## ◆ get_id()

shortcut_id fc_shortcuts::get_id | ( | fc_shortcut * | sc | ) |

Returns id for given shortcut

Definition at line 246 of file shortcuts.cpp.

Referenced by fc_shortcuts_dialog::init().

## ◆ get_shortcut()

fc_shortcut * fc_shortcuts::get_shortcut | ( | shortcut_id | id | ) |

Returns shortcut for given id

Definition at line 236 of file shortcuts.cpp.

Referenced by mr_menu::execute_shortcut(), mr_menu::shortcut_2_menustring(), map_view::shortcut_pressed(), and map_view::shortcut_released().

## ◆ init_default()

void fc_shortcuts::init_default | ( | bool | read | ) |

static

Inits defaults shortcuts or reads from settings

Definition at line 299 of file shortcuts.cpp.

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

## ◆ is_instantiated()

bool fc_shortcuts::is_instantiated | ( |  | ) |

static

Check, without instantiating it in the process, if shortcuts system has been instantiated already.

Definition at line 291 of file shortcuts.cpp.

Referenced by write_shortcuts().

## ◆ Q_DISABLE_COPY()

fc_shortcuts::Q_DISABLE_COPY | ( | fc_shortcuts |  | ) |

private

## ◆ sc()

fc_shortcuts * fc_shortcuts::sc | ( |  | ) |

static

Returns given instance

Definition at line 278 of file shortcuts.cpp.

Referenced by fc_shortcuts_dialog::apply_option(), fc_shortcut_popup::check_if_exist(), fc_shortcut_popup::closeEvent(), mr_menu::execute_shortcut(), get_id(), fc_shortcuts_dialog::init(), set_shortcut(), mr_menu::setup_menus(), mr_menu::shortcut_2_menustring(), map_view::shortcut_pressed(), map_view::shortcut_released(), and fc_client::~fc_client().

## ◆ set_shortcut()

void fc_shortcuts::set_shortcut | ( | fc_shortcut * | s | ) |

Sets given shortcut

Definition at line 254 of file shortcuts.cpp.

Referenced by fc_shortcut_popup::closeEvent().

## Field Documentation

## ◆ hash

QMap< shortcut_id, fc_shortcut * > fc_shortcuts::hash = QMap<shortcut_id, fc_shortcut*>()

static

Definition at line 130 of file shortcuts.h.

Referenced by fc_shortcuts_dialog::apply_option(), fc_shortcuts_dialog::fc_shortcuts_dialog(), get_desc(), get_id(), get_shortcut(), init_default(), read_shortcuts(), set_shortcut(), write_shortcuts(), and ~fc_shortcuts().

## ◆ m_instance

fc_shortcuts * fc_shortcuts::m_instance = 0

staticprivate

Definition at line 123 of file shortcuts.h.

Referenced by drop(), is_instantiated(), and sc().