Freeciv-3.2: req_edit Class Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Signals | Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
req_edit Class Reference

`#include <req_edit.h>`

Inheritance diagram for req_edit:

## Signals

void | req_vec_may_have_changed (const requirement_vector *vec)

## Public Member Functions

| req_edit (ruledit_gui *ui_in, QString target, struct requirement_vector *preqs)
void | refresh ()
void | add (const char *msg)

## Data Fields

struct requirement_vector * | req_vector

## Protected Member Functions

void | closeEvent (QCloseEvent *event)

## Private Slots

void | select_req ()
void | fill_active ()
void | add_now ()
void | delete_now ()
void | close_now ()
void | req_type_menu (QAction *action)
void | req_range_menu (QAction *action)
void | req_present_menu (QAction *action)
void | univ_value_enum_menu (QAction *action)
void | univ_value_edit (int value)
void | incoming_req_vec_change (const requirement_vector *vec)

## Private Member Functions

void | clear_selected ()
void | update_selected ()
void | refresh_item (QListWidgetItem *item, struct requirement *preq)
void | refresh_selected ()

## Private Attributes

ruledit_gui * | ui
QListWidget * | req_list
struct requirement * | selected
struct requirement | selected_values
QToolButton * | edit_type_button
QToolButton * | edit_value_enum_button
QMenu * | edit_value_enum_menu
QSpinBox * | edit_value_nbr_field
QToolButton * | edit_range_button
QToolButton * | edit_present_button

## Detailed Description

Definition at line 35 of file req_edit.h.

## Constructor & Destructor Documentation

## ◆ req_edit()

req_edit::req_edit | ( | ruledit_gui * | ui_in,
|  | QString | target,
|  | struct requirement_vector * | preqs
| ) |  |

explicit

Setup req_edit object

Definition at line 42 of file req_edit.cpp.

## Member Function Documentation

## ◆ add()

void req_edit::add | ( | const char * | msg | ) |

## ◆ add_now

void req_edit::add_now | ( |  | ) |

privateslot

User requested new requirement

Definition at line 411 of file req_edit.cpp.

Referenced by req_edit().

## ◆ clear_selected()

void req_edit::clear_selected | ( |  | ) |

private

Unselect the currently selected requirement.

Definition at line 222 of file req_edit.cpp.

Referenced by delete_now(), incoming_req_vec_change(), and req_edit().

## ◆ close_now

void req_edit::close_now | ( |  | ) |

privateslot

User pushed close button

Definition at line 237 of file req_edit.cpp.

Referenced by req_edit().

## ◆ closeEvent()

void req_edit::closeEvent | ( | QCloseEvent * | event | ) |

protected

User clicked windows close button.

Definition at line 477 of file req_edit.cpp.

## ◆ delete_now

void req_edit::delete_now | ( |  | ) |

privateslot

User requested requirement deletion

Definition at line 428 of file req_edit.cpp.

Referenced by req_edit().

## ◆ fill_active

void req_edit::fill_active | ( |  | ) |

privateslot

Fill active menus from selected req.

Definition at line 295 of file req_edit.cpp.

Referenced by refresh(), and select_req().

## ◆ incoming_req_vec_change

void req_edit::incoming_req_vec_change | ( | const requirement_vector * | vec | ) |

privateslot

The requirement vector may have been changed.

Parameters

  vec | the requirement vector that may have been changed.

Definition at line 452 of file req_edit.cpp.

Referenced by req_edit().

## ◆ refresh()

void req_edit::refresh | ( |  | ) |

Refresh the information.

Definition at line 189 of file req_edit.cpp.

Referenced by add_now(), delete_now(), incoming_req_vec_change(), req_edit(), req_present_menu(), req_range_menu(), req_type_menu(), and univ_value_enum_menu().

## ◆ refresh_item()

void req_edit::refresh_item | ( | QListWidgetItem * | item,
|  | struct requirement * | preq
| ) |  |

private

Refresh information in list widget item.

Definition at line 150 of file req_edit.cpp.

Referenced by refresh(), and refresh_selected().

## ◆ refresh_selected()

void req_edit::refresh_selected | ( |  | ) |

private

Refresh the row of currently selected item.

Definition at line 172 of file req_edit.cpp.

Referenced by univ_value_edit().

## ◆ req_present_menu

void req_edit::req_present_menu | ( | QAction * | action | ) |

privateslot

User selected 'present' value for the requirement.

Definition at line 356 of file req_edit.cpp.

Referenced by req_edit().

## ◆ req_range_menu

void req_edit::req_range_menu | ( | QAction * | action | ) |

privateslot

User selected range for the requirement.

Definition at line 339 of file req_edit.cpp.

Referenced by req_edit().

## ◆ req_type_menu

void req_edit::req_type_menu | ( | QAction * | action | ) |

privateslot

User selected type for the requirement.

Definition at line 321 of file req_edit.cpp.

Referenced by req_edit().

## ◆ req_vec_may_have_changed

void req_edit::req_vec_may_have_changed | ( | const requirement_vector * | vec | ) |

signal

A requirement vector may have been changed.

Parameters

  vec | the requirement vector that was changed.

Referenced by add_now(), delete_now(), and req_edit().

## ◆ select_req

void req_edit::select_req | ( |  | ) |

privateslot

User selected requirement from the list.

Definition at line 246 of file req_edit.cpp.

Referenced by req_edit().

## ◆ univ_value_edit

void req_edit::univ_value_edit | ( | int | value | ) |

privateslot

User entered numerical requirement value.

Definition at line 390 of file req_edit.cpp.

Referenced by req_edit().

## ◆ univ_value_enum_menu

void req_edit::univ_value_enum_menu | ( | QAction * | action | ) |

privateslot

User selected value for the requirement.

Definition at line 375 of file req_edit.cpp.

Referenced by req_edit().

## ◆ update_selected()

void req_edit::update_selected | ( |  | ) |

private

The selected requirement has changed.

Definition at line 212 of file req_edit.cpp.

Referenced by req_present_menu(), req_range_menu(), req_type_menu(), select_req(), univ_value_edit(), and univ_value_enum_menu().

## Field Documentation

## ◆ edit_present_button

QToolButton* req_edit::edit_present_button

private

Definition at line 71 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ edit_range_button

QToolButton* req_edit::edit_range_button

private

Definition at line 70 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ edit_type_button

QToolButton* req_edit::edit_type_button

private

Definition at line 66 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ edit_value_enum_button

QToolButton* req_edit::edit_value_enum_button

private

Definition at line 67 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ edit_value_enum_menu

QMenu* req_edit::edit_value_enum_menu

private

Definition at line 68 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ edit_value_nbr_field

QSpinBox* req_edit::edit_value_nbr_field

private

Definition at line 69 of file req_edit.h.

Referenced by fill_active(), and req_edit().

## ◆ req_list

QListWidget* req_edit::req_list

private

Definition at line 57 of file req_edit.h.

Referenced by refresh(), refresh_selected(), req_edit(), and select_req().

## ◆ req_vector

struct requirement_vector* req_edit::req_vector

Definition at line 45 of file req_edit.h.

Referenced by add_now(), delete_now(), incoming_req_vec_change(), refresh(), req_edit(), and select_req().

## ◆ selected

struct requirement* req_edit::selected

private

Definition at line 59 of file req_edit.h.

Referenced by clear_selected(), delete_now(), fill_active(), incoming_req_vec_change(), refresh(), refresh_selected(), req_present_menu(), req_range_menu(), req_type_menu(), select_req(), univ_value_edit(), univ_value_enum_menu(), and update_selected().

## ◆ selected_values

struct requirement req_edit::selected_values

private

Definition at line 60 of file req_edit.h.

Referenced by clear_selected(), incoming_req_vec_change(), and update_selected().

## ◆ ui

ruledit_gui* req_edit::ui

private

Definition at line 55 of file req_edit.h.

Referenced by close_now(), closeEvent(), and req_edit().