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

Freeciv-3.2

Loading...
Searching...
No Matches
Functions | Variables
citydlg.cpp File Reference
`#include <QApplication>`
`#include <QCheckBox>`
`#include <QGroupBox>`
`#include <QHeaderView>`
`#include <QImage>`
`#include <QMenu>`
`#include <QMessageBox>`
`#include <QPainter>`
`#include <QRadioButton>`
`#include <QRect>`
`#include <QScreen>`
`#include <QScrollArea>`
`#include <QScrollBar>`
`#include <QSplitter>`
`#include <QToolTip>`
`#include <QVBoxLayout>`
`#include <QWheelEvent>`
`#include <QWidgetAction>`
`#include "support.h"`
`#include "citizens.h"`
`#include "city.h"`
`#include "game.h"`
`#include "cma_core.h"`
`#include "cma_fec.h"`
`#include "citydlg_common.h"`
`#include "client_main.h"`
`#include "climisc.h"`
`#include "control.h"`
`#include "global_worklist.h"`
`#include "helpdata.h"`
`#include "mapview_common.h"`
`#include "movement.h"`
`#include "sprite.h"`
`#include "text.h"`
`#include "tilespec.h"`
`#include "citydlg.h"`
`#include "colors.h"`
`#include "fc_client.h"`
`#include "gui_main.h"`
`#include "hudwidget.h"`

Go to the source code of this file.

## Functions

QString | split_text (QString text, bool cut)
QString | cut_helptext (QString text)
static void | pixmap_put_x (QPixmap *pix)
void | qtg_real_city_dialog_popup (struct city *pcity)
void | destroy_city_dialog ()
void | qtg_popdown_city_dialog (struct city *pcity)
void | qtg_popdown_all_city_dialogs ()
void | qtg_real_city_dialog_refresh (struct city *pcity)
void | city_font_update ()
void | qtg_refresh_unit_city_dialogs (struct unit *punit)
bool | qtg_city_dialog_is_open (struct city *pcity)
static QString | bold (QString text)
QString | get_tooltip_improvement (const impr_type *building, struct city *pcity, bool ext)
QString | get_tooltip_unit (const struct unit_type *utype, bool ext)
QString | get_tooltip (QVariant qvar)

## Variables

static bool | city_dlg_created = false
static city_dialog * | city_dlg

## Function Documentation

## ◆ bold()

static QString bold | ( | QString | text | ) |

static

'text' is assumed to have already been HTML-escaped if necessary

Definition at line 3870 of file citydlg.cpp.

Referenced by configure_font(), configure_single(), get_tooltip_unit(), and remake_label_size().

## ◆ city_font_update()

void city_font_update | ( |  | ) |

Updates city font

Definition at line 3768 of file citydlg.cpp.

Referenced by apply_notify_font().

## ◆ cut_helptext()

QString cut_helptext | ( | QString | text | ) |

extern

Remove some text from given text(help text) to show as tooltip

Definition at line 105 of file optiondlg.cpp.

Referenced by get_tooltip(), get_tooltip_improvement(), get_tooltip_unit(), and research_diagram::mouseMoveEvent().

## ◆ destroy_city_dialog()

void destroy_city_dialog | ( |  | ) |

Closes city dialog

Definition at line 3721 of file citydlg.cpp.

Referenced by qtg_popdown_all_city_dialogs(), qtg_popdown_city_dialog(), city_dialog::refresh(), and tileset_changed().

## ◆ get_tooltip()

QString get_tooltip | ( | QVariant | qvar | ) |

Returns shortened help for given universal ( stored in qvar )

Definition at line 4006 of file citydlg.cpp.

Referenced by city_production_model::data().

## ◆ get_tooltip_improvement()

QString get_tooltip_improvement | ( | const impr_type * | building,
|  | struct city * | pcity,
|  | bool | ext
| ) |  |

Returns improvement properties to append in tooltip ext is used to get extra info from help

Definition at line 3879 of file citydlg.cpp.

Referenced by get_tooltip(), impr_item::impr_item(), research_diagram::mouseMoveEvent(), and city_dialog::update_improvements().

## ◆ get_tooltip_unit()

QString get_tooltip_unit | ( | const struct unit_type * | utype,
|  | bool | ext
| ) |  |

Returns unit properties to append in tooltip ext is used to get extra info from help

Definition at line 3936 of file citydlg.cpp.

Referenced by get_tooltip(), research_diagram::mouseMoveEvent(), and city_dialog::update_improvements().

## ◆ pixmap_put_x()

static void pixmap_put_x | ( | QPixmap * | pix | ) |

static

Draws X on pixmap pointing its useless

Definition at line 349 of file citydlg.cpp.

Referenced by city_production_delegate::paint().

## ◆ qtg_city_dialog_is_open()

bool qtg_city_dialog_is_open | ( | struct city * | pcity | ) |

Return whether the dialog for the given city is open.

Definition at line 3809 of file citydlg.cpp.

Referenced by qtg_real_city_dialog_refresh(), and setup_gui_funcs().

## ◆ qtg_popdown_all_city_dialogs()

void qtg_popdown_all_city_dialogs | ( |  | ) |

Close the dialogs for all cities.

Definition at line 3746 of file citydlg.cpp.

Referenced by unit_item::activate_and_close_dialog(), unit_item::mousePressEvent(), and setup_gui_funcs().

## ◆ qtg_popdown_city_dialog()

void qtg_popdown_city_dialog | ( | struct city * | pcity | ) |

Close the dialog for the given city.

Definition at line 3734 of file citydlg.cpp.

Referenced by setup_gui_funcs().

## ◆ qtg_real_city_dialog_popup()

void qtg_real_city_dialog_popup | ( | struct city * | pcity | ) |

Pop up (or bring to the front) a dialog for the given city. It may or may not be modal.

Definition at line 3706 of file citydlg.cpp.

Referenced by city_widget::city_view(), notify_goto::inspect_city(), city_dialog::next_city(), city_dialog::prev_city(), and setup_gui_funcs().

## ◆ qtg_real_city_dialog_refresh()

void qtg_real_city_dialog_refresh | ( | struct city * | pcity | ) |

Refresh (update) all data for the given city's dialog.

Definition at line 3754 of file citydlg.cpp.

Referenced by qtg_refresh_unit_city_dialogs(), and setup_gui_funcs().

## ◆ qtg_refresh_unit_city_dialogs()

void qtg_refresh_unit_city_dialogs | ( | struct unit * | punit | ) |

Update city dialogs when the given unit's status changes. This typically means updating both the unit's home city (if any) and the city in which it is present (if any).

Definition at line 3793 of file citydlg.cpp.

Referenced by setup_gui_funcs().

## ◆ split_text()

QString split_text | ( | QString | text,
|  | bool | cut
| ) |  |

extern

Splits long text to 80 characters

Definition at line 62 of file optiondlg.cpp.

Referenced by option_dialog::add_option(), get_tooltip(), get_tooltip_improvement(), get_tooltip_unit(), and research_diagram::mouseMoveEvent().

## Variable Documentation

## ◆ city_dlg

city_dialog* city_dlg

static

defines if dialog for city has been already created. It's created only once per client

Definition at line 74 of file citydlg.cpp.

Referenced by city_dialog::buy(), city_font_update(), city_dialog::cma_remove(), destroy_city_dialog(), impr_item::mouseDoubleClickEvent(), qtg_city_dialog_is_open(), qtg_real_city_dialog_popup(), qtg_real_city_dialog_refresh(), impr_info::update_buildings(), and unit_info::update_units().

## ◆ city_dlg_created

bool city_dlg_created = false

static

Definition at line 70 of file citydlg.cpp.

Referenced by city_dialog::city_dialog(), city_font_update(), destroy_city_dialog(), qtg_city_dialog_is_open(), qtg_popdown_city_dialog(), qtg_real_city_dialog_popup(), qtg_real_city_dialog_refresh(), and city_dialog::~city_dialog().