Freeciv21
Develop your civilization from humble roots to a global empire
units_view Class Reference

Table widget to display units view (F2) More...

#include <view_units.h>

+ Inheritance diagram for units_view:
+ Collaboration diagram for units_view:

Public Member Functions

 units_view ()
 Constructor for units view. More...
 
 ~units_view ()
 Destructor for units view. More...
 
void update_view ()
 Refresh all widgets for units view. More...
 
void update_units ()
 Updates the units table. More...
 
void init ()
 Initializes place in tab for units view. More...
 

Private Slots

void disband_units ()
 Disband selected units. More...
 
void find_nearest ()
 Find nearest selected unit, closest units view when button is clicked. More...
 
void upgrade_units ()
 Upgrade selected units. More...
 
void selection_changed (const QItemSelection &sl, const QItemSelection &ds)
 Action for selection changed in units view. More...
 

Private Member Functions

void update_waiting ()
 Function to load the units waiting table. More...
 
void update_buttons (const QItemSelection &sl)
 Updates the buttons according to the item selection sl in the units table. More...
 

Private Attributes

int index
 
int curr_row {-1}
 
int max_row {0}
 
cid uid {0}
 
int counter {0}
 
Ui::FormUnitsView ui
 

Detailed Description

Table widget to display units view (F2)

Definition at line 54 of file view_units.h.

Constructor & Destructor Documentation

◆ units_view()

units_view::units_view ( )

Constructor for units view.

Definition at line 39 of file view_units.cpp.

◆ ~units_view()

units_view::~units_view ( )

Destructor for units view.

Definition at line 123 of file view_units.cpp.

Member Function Documentation

◆ disband_units

void units_view::disband_units ( )
privateslot

Disband selected units.

Definition at line 501 of file view_units.cpp.

Referenced by units_view().

◆ find_nearest

void units_view::find_nearest ( )
privateslot

Find nearest selected unit, closest units view when button is clicked.

Definition at line 539 of file view_units.cpp.

Referenced by units_view().

◆ init()

void units_view::init ( )

Initializes place in tab for units view.

Definition at line 128 of file view_units.cpp.

Referenced by top_bar_units_view(), and units_view_dialog_popup().

◆ selection_changed

void units_view::selection_changed ( const QItemSelection &  sl,
const QItemSelection &  ds 
)
privateslot

Action for selection changed in units view.

Definition at line 451 of file view_units.cpp.

Referenced by units_view().

◆ update_buttons()

void units_view::update_buttons ( const QItemSelection &  sl)
private

Updates the buttons according to the item selection sl in the units table.

Definition at line 461 of file view_units.cpp.

Referenced by selection_changed(), and update_units().

◆ update_units()

void units_view::update_units ( )

Updates the units table.

Definition at line 146 of file view_units.cpp.

Referenced by top_bar_units_view(), and update_view().

◆ update_view()

void units_view::update_view ( )

Refresh all widgets for units view.

Definition at line 133 of file view_units.cpp.

Referenced by top_bar_units_view(), units_view_dialog_popup(), and units_view_dialog_update().

◆ update_waiting()

void units_view::update_waiting ( )
private

Function to load the units waiting table.

Definition at line 348 of file view_units.cpp.

Referenced by update_view().

◆ upgrade_units

void units_view::upgrade_units ( )
privateslot

Upgrade selected units.

Definition at line 568 of file view_units.cpp.

Referenced by units_view().

Member Data Documentation

◆ counter

int units_view::counter {0}
private

Definition at line 69 of file view_units.h.

Referenced by disband_units(), and update_buttons().

◆ curr_row

int units_view::curr_row {-1}
private

Definition at line 66 of file view_units.h.

Referenced by update_buttons().

◆ index

int units_view::index
private

Definition at line 65 of file view_units.h.

Referenced by init(), and units_view().

◆ max_row

int units_view::max_row {0}
private

Definition at line 67 of file view_units.h.

Referenced by update_buttons(), update_units(), and update_waiting().

◆ ui

Ui::FormUnitsView units_view::ui
private

Definition at line 70 of file view_units.h.

Referenced by units_view(), update_buttons(), update_units(), and update_waiting().

◆ uid

cid units_view::uid {0}
private

Definition at line 68 of file view_units.h.

Referenced by disband_units(), find_nearest(), update_buttons(), and upgrade_units().