![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <helpdlg.h>
Inheritance diagram for help_widget:
Collaboration diagram for help_widget:Public Slots | |
| void | set_topic (const help_item *item) |
| Shows the given help page. More... | |
Public Member Functions | |
| help_widget (QWidget *parent=0) | |
| Creates a new, empty help widget. More... | |
| help_widget (const help_item *item, QWidget *parent=0) | |
| Creates a new help widget displaying the specified topic. More... | |
| ~help_widget () override | |
| Destructor. More... | |
| void | update_fonts () |
| Updates fonts for manual. More... | |
| struct terrain * | terrain_max_values () |
| Retrieves the maximum values any terrain will ever have. More... | |
| struct unit_type * | uclass_max_values (struct unit_class *uclass) |
| Retrieves the maximum values any unit of uclass will ever have. More... | |
Private Slots | |
| void | anchor_clicked (const QString &link) |
| Hyperlink clicked, link has 2 variables, string(name of given help) and int(help_page_type) More... | |
Private Member Functions | |
| void | setup_ui () |
| Creates the UI. More... | |
| void | do_layout () |
| Lays things out. More... | |
| void | undo_layout () |
| Deletes the widgets created by do_complex_layout(). More... | |
| void | show_info_panel () |
| Creates the information panel. More... | |
| void | add_info_pixmap (const QPixmap *pm, bool shadow=false) |
| Adds a pixmap to the information panel. More... | |
| void | add_info_label (const QString &text) |
| Adds a text label to the information panel. More... | |
| void | add_info_progress (const QString &label, int progress, int min, int max, const QString &value=QString()) |
| Adds a widget indicating a progress to the information panel. More... | |
| void | add_extras_of_act_for_terrain (struct terrain *pterr, enum unit_activity act, const char *label) |
| Create labels about all extras of one cause buildable to the terrain. More... | |
| void | add_info_separator () |
| Adds a separator to the information panel. More... | |
| void | info_panel_done () |
| Called when everything needed has been added to the information panel. More... | |
| void | set_bottom_panel (QWidget *widget) |
| Sets the bottom panel. More... | |
| QLayout * | create_terrain_widget (const QString &title, const QPixmap *image, const int &food, const int &sh, const int &eco, const QString &tooltip=QString()) |
| Creates a terrain widget with title, terrain image, legend. More... | |
| void | set_topic_other (const help_item *item, const char *title) |
| Creates help pages with no special widgets. More... | |
| void | set_topic_unit (const help_item *item, const char *title) |
| Creates unit help pages. More... | |
| void | set_topic_building (const help_item *item, const char *title) |
| Creates improvement help pages. More... | |
| void | set_topic_tech (const help_item *item, const char *title) |
| Creates technology help pages. More... | |
| void | set_topic_terrain (const help_item *item, const char *title) |
| Creates terrain help pages. More... | |
| void | set_topic_extra (const help_item *item, const char *title) |
| Creates extra help pages. More... | |
| void | set_topic_specialist (const help_item *item, const char *title) |
| Creates specialist help pages. More... | |
| void | set_topic_government (const help_item *item, const char *title) |
| Creates government help pages. More... | |
| void | set_topic_nation (const help_item *item, const char *title) |
| Creates nation help pages. More... | |
| void | set_topic_goods (const help_item *item, const char *title) |
| Creates goods help page. More... | |
| void | make_terrain_lab (QString &str) |
| QString | link_me (const char *str, help_page_type hpt) |
| Creates link to given help page. More... | |
Private Attributes | |
| QFrame * | box_wdg |
| QLabel * | title_label |
| QWidget * | main_widget |
| QTextBrowser * | text_browser |
| QWidget * | bottom_panel |
| QWidget * | info_panel |
| QSplitter * | splitter |
| QVBoxLayout * | info_layout |
| QList< int > | splitter_sizes |
| help_widget::help_widget | ( | QWidget * | parent = 0 | ) |
Creates a new, empty help widget.
Definition at line 414 of file helpdlg.cpp.
| help_widget::help_widget | ( | const help_item * | item, |
| QWidget * | parent = 0 |
||
| ) |
Creates a new help widget displaying the specified topic.
Definition at line 425 of file helpdlg.cpp.
|
override |
Destructor.
Definition at line 437 of file helpdlg.cpp.
|
private |
Create labels about all extras of one cause buildable to the terrain.
Definition at line 680 of file helpdlg.cpp.
Referenced by set_topic_terrain().
|
private |
Adds a text label to the information panel.
Definition at line 615 of file helpdlg.cpp.
Referenced by set_topic_building(), and set_topic_unit().
|
private |
Adds a pixmap to the information panel.
Definition at line 594 of file helpdlg.cpp.
Referenced by set_topic_building(), set_topic_tech(), set_topic_terrain(), and set_topic_unit().
|
private |
Adds a widget indicating a progress to the information panel.
Arguments: text: A descriptive text progress: The progress to display [min,max]: The interval progress is in value: Use this to display a non-numeral value
Definition at line 632 of file helpdlg.cpp.
Referenced by set_topic_terrain(), and set_topic_unit().
|
private |
Adds a separator to the information panel.
Definition at line 727 of file helpdlg.cpp.
Referenced by set_topic_terrain(), and set_topic_unit().
|
privateslot |
Hyperlink clicked, link has 2 variables, string(name of given help) and int(help_page_type)
Definition at line 741 of file helpdlg.cpp.
Referenced by add_extras_of_act_for_terrain(), make_terrain_lab(), set_topic_building(), set_topic_tech(), and set_topic_unit().
|
private |
Creates a terrain widget with title, terrain image, legend.
An optional tooltip can be given to explain the legend.
Definition at line 1239 of file helpdlg.cpp.
Referenced by set_topic_terrain().
|
private |
Lays things out.
The widget is organized as follows, with the additional complexity that info_ and/or bottom_panel may be absent.
+------------------------------—+ | title_label | +------------------------------—+ |+-main_widget----------------—+| ||+---------—+ +-----------—+|| ||| | | ||| ||| info_panel | | text_browser ||| ||| | | ||| ||| |.+-----------—+|| ||| |. ... || ||| |.+-----------—+|| ||| | | ||| ||| | | bottom_panel ||| ||| | | ||| ||+---------—+ +-----------—+|| |+----------------------------—+| +------------------------------—+
Definition at line 495 of file helpdlg.cpp.
Referenced by set_topic().
|
private |
Called when everything needed has been added to the information panel.
Definition at line 735 of file helpdlg.cpp.
Referenced by set_topic_building(), set_topic_tech(), set_topic_terrain(), and set_topic_unit().
|
private |
Creates link to given help page.
Definition at line 716 of file helpdlg.cpp.
Referenced by add_extras_of_act_for_terrain(), set_topic_building(), set_topic_tech(), set_topic_terrain(), and set_topic_unit().
|
private |
Definition at line 1284 of file helpdlg.cpp.
Referenced by set_topic_terrain().
|
private |
Sets the bottom panel.
Definition at line 826 of file helpdlg.cpp.
Referenced by set_topic_terrain().
|
slot |
Shows the given help page.
Definition at line 768 of file helpdlg.cpp.
Referenced by help_widget(), help_dialog::item_changed(), and help_dialog::set_topic().
|
private |
Creates improvement help pages.
Definition at line 959 of file helpdlg.cpp.
Referenced by set_topic().
|
private |
|
private |
|
private |
Creates government help pages.
Definition at line 1492 of file helpdlg.cpp.
Referenced by set_topic().
|
private |
|
private |
Creates help pages with no special widgets.
Definition at line 834 of file helpdlg.cpp.
Referenced by set_topic(), set_topic_building(), set_topic_extra(), set_topic_goods(), set_topic_government(), set_topic_nation(), set_topic_specialist(), set_topic_tech(), set_topic_terrain(), and set_topic_unit().
|
private |
Creates specialist help pages.
Definition at line 1475 of file helpdlg.cpp.
Referenced by set_topic().
|
private |
Creates technology help pages.
Definition at line 1051 of file helpdlg.cpp.
Referenced by set_topic().
|
private |
|
private |
|
private |
|
private |
Creates the information panel.
It will be shown by do_complex_layout().
Definition at line 585 of file helpdlg.cpp.
Referenced by set_topic_building(), set_topic_tech(), set_topic_terrain(), and set_topic_unit().
| struct terrain * help_widget::terrain_max_values | ( | ) |
Retrieves the maximum values any terrain will ever have.
Supported fields: base_time, clean_fallout_time, clean_pollution_time, defense_bonus, irrigation_food_incr, irrigation_time, mining_shield_incr, mining_time, movement_cost, output, pillage_time, road_output_incr_pct, road_time, transform_time Other fields in returned value are undefined. Especially, all pointers are invalid.
Definition at line 1547 of file helpdlg.cpp.
Referenced by set_topic_terrain().
| struct unit_type * help_widget::uclass_max_values | ( | struct unit_class * | uclass | ) |
Retrieves the maximum values any unit of uclass will ever have.
Supported fields: attack_strength, bombard_rate, build_cost, city_size, convert_time, defense_strength, firepower, fuel, happy_cost, hp, move_rate, pop_cost, upkeep, vision_radius_sq Other fiels in returned value are undefined. Especially, all pointers are invalid except uclass.
Definition at line 1618 of file helpdlg.cpp.
Referenced by set_topic_unit().
|
private |
Deletes the widgets created by do_complex_layout().
Definition at line 562 of file helpdlg.cpp.
Referenced by set_topic().
| void help_widget::update_fonts | ( | ) |
Updates fonts for manual.
Definition at line 533 of file helpdlg.cpp.
Referenced by setup_ui(), and help_dialog::update_fonts().
|
private |
Definition at line 79 of file helpdlg.h.
Referenced by do_layout(), set_bottom_panel(), and undo_layout().
|
private |
Definition at line 74 of file helpdlg.h.
Referenced by setup_ui().
|
private |
Definition at line 82 of file helpdlg.h.
Referenced by add_extras_of_act_for_terrain(), add_info_label(), add_info_pixmap(), add_info_progress(), add_info_separator(), do_layout(), info_panel_done(), make_terrain_lab(), set_topic_building(), set_topic_tech(), set_topic_unit(), show_info_panel(), and undo_layout().
|
private |
Definition at line 80 of file helpdlg.h.
Referenced by do_layout(), show_info_panel(), and undo_layout().
|
private |
Definition at line 77 of file helpdlg.h.
Referenced by do_layout(), setup_ui(), and undo_layout().
|
private |
Definition at line 81 of file helpdlg.h.
Referenced by do_layout(), and undo_layout().
|
private |
Definition at line 83 of file helpdlg.h.
Referenced by do_layout(), setup_ui(), and undo_layout().
|
private |
Definition at line 78 of file helpdlg.h.
Referenced by do_layout(), set_topic_building(), set_topic_extra(), set_topic_goods(), set_topic_government(), set_topic_nation(), set_topic_other(), set_topic_specialist(), set_topic_tech(), set_topic_terrain(), set_topic_unit(), setup_ui(), and undo_layout().
|
private |
Definition at line 75 of file helpdlg.h.
Referenced by set_topic(), and setup_ui().