Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Attributes
diplo_wdg Class Reference

#include <diplodlg.h>

+ Inheritance diagram for diplo_wdg:

Public Member Functions

 diplo_wdg (struct treaty *ptreaty, struct player *they, struct player *initiator)
 
 ~diplo_wdg ()
 
void update_wdg ()
 
void set_index (int ind)
 
int get_index ()
 

Data Fields

struct treatytreaty
 

Protected Member Functions

void closeEvent (QCloseEvent *event)
 

Private Slots

void all_advances ()
 
void dbl_click (QTableWidgetItem *item)
 
void give_advance (int tech)
 
void give_city (int city_num)
 
void give_embassy ()
 
void give_shared_vision ()
 
void gold_changed1 (int val)
 
void gold_changed2 (int val)
 
void pact_allianze ()
 
void pact_ceasfire ()
 
void pact_peace ()
 
void response_accept ()
 
void response_cancel ()
 
void sea_map_clause ()
 
void show_menu (struct player *pplayer)
 
void show_menu_p1 ()
 
void show_menu_p2 ()
 
void world_map_clause ()
 
void restore_pixmap ()
 

Private Attributes

QGridLayoutlayout
 
QLabel * plr1_accept
 
QLabel * plr2_accept
 
QPushButton * accept_treaty
 
QPushButton * cancel_treaty
 
QTableWidget * text_edit
 
struct playerplr1
 
struct playerplr2
 
int active_menu
 
struct playercurr_player
 
bool p1_accept
 
bool p2_accept
 
int index
 

Detailed Description

Definition at line 49 of file diplodlg.h.

Constructor & Destructor Documentation

◆ diplo_wdg()

diplo_wdg::diplo_wdg ( struct treaty ptreaty,
struct player they,
struct player initiator 
)

Constructor for diplomacy widget

Definition at line 57 of file diplodlg.cpp.

◆ ~diplo_wdg()

diplo_wdg::~diplo_wdg ( )

Destructor for diplomacy widget

Definition at line 260 of file diplodlg.cpp.

Member Function Documentation

◆ all_advances

void diplo_wdg::all_advances ( )
privateslot

Give all advances menu activated

Definition at line 624 of file diplodlg.cpp.

Referenced by show_menu().

◆ closeEvent()

void diplo_wdg::closeEvent ( QCloseEvent event)
protected

Received event about diplomacy widget being closed

Definition at line 289 of file diplodlg.cpp.

◆ dbl_click

void diplo_wdg::dbl_click ( QTableWidgetItem item)
privateslot

Double click on treaty list - it removes clicked clause from list

Definition at line 267 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ get_index()

int diplo_wdg::get_index ( )

Sets index in QTabWidget

Definition at line 690 of file diplodlg.cpp.

◆ give_advance

void diplo_wdg::give_advance ( int  tech)
privateslot

Give advance menu activated

Definition at line 599 of file diplodlg.cpp.

Referenced by show_menu().

◆ give_city

void diplo_wdg::give_city ( int  city_num)
privateslot

Give city menu activated

Definition at line 574 of file diplodlg.cpp.

Referenced by show_menu().

◆ give_embassy

void diplo_wdg::give_embassy ( )
privateslot

Give embassy menu activated

Definition at line 497 of file diplodlg.cpp.

Referenced by show_menu().

◆ give_shared_vision

void diplo_wdg::give_shared_vision ( )
privateslot

Give shared vision menu activated

Definition at line 508 of file diplodlg.cpp.

Referenced by show_menu().

◆ gold_changed1

void diplo_wdg::gold_changed1 ( int  val)
privateslot

Gold changed on first spinner

Definition at line 300 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ gold_changed2

void diplo_wdg::gold_changed2 ( int  val)
privateslot

Gold changed on second spinner

Definition at line 311 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ pact_allianze

void diplo_wdg::pact_allianze ( )
privateslot

Create alliance menu activated

Definition at line 519 of file diplodlg.cpp.

Referenced by show_menu().

◆ pact_ceasfire

void diplo_wdg::pact_ceasfire ( )
privateslot

Ceasefire pact menu activated

Definition at line 530 of file diplodlg.cpp.

Referenced by show_menu().

◆ pact_peace

void diplo_wdg::pact_peace ( )
privateslot

Peace pact menu activated

Definition at line 541 of file diplodlg.cpp.

Referenced by show_menu().

◆ response_accept

void diplo_wdg::response_accept ( )
privateslot

Button 'Accept treaty' has been clicked

Definition at line 764 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ response_cancel

void diplo_wdg::response_cancel ( )
privateslot

Button 'Cancel treaty' has been clicked

Definition at line 774 of file diplodlg.cpp.

Referenced by closeEvent(), and diplo_wdg().

◆ restore_pixmap

void diplo_wdg::restore_pixmap ( )
privateslot

Restores original nations pixmap

Definition at line 752 of file diplodlg.cpp.

Referenced by response_accept(), and response_cancel().

◆ sea_map_clause

void diplo_wdg::sea_map_clause ( )
privateslot

Sea map menu activated

Definition at line 552 of file diplodlg.cpp.

Referenced by show_menu().

◆ set_index()

void diplo_wdg::set_index ( int  ind)

Sets index in QTabWidget

Definition at line 682 of file diplodlg.cpp.

◆ show_menu

void diplo_wdg::show_menu ( struct player pplayer)
privateslot

Shows popup menu with available clauses to create

Definition at line 322 of file diplodlg.cpp.

Referenced by show_menu_p1(), and show_menu_p2().

◆ show_menu_p1

void diplo_wdg::show_menu_p1 ( )
privateslot

Show menu for first player

Definition at line 674 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ show_menu_p2

void diplo_wdg::show_menu_p2 ( )
privateslot

Show menu for second player

Definition at line 666 of file diplodlg.cpp.

Referenced by diplo_wdg().

◆ update_wdg()

void diplo_wdg::update_wdg ( )

Updates diplomacy widget - updates clauses and redraws pixmaps

Definition at line 698 of file diplodlg.cpp.

Referenced by diplo_wdg(), and diplo_dlg::update_dlg().

◆ world_map_clause

void diplo_wdg::world_map_clause ( )
privateslot

World map menu activated

Definition at line 563 of file diplodlg.cpp.

Referenced by show_menu().

Field Documentation

◆ accept_treaty

QPushButton* diplo_wdg::accept_treaty
private

Definition at line 55 of file diplodlg.h.

Referenced by diplo_wdg().

◆ active_menu

int diplo_wdg::active_menu
private

Definition at line 94 of file diplodlg.h.

◆ cancel_treaty

QPushButton* diplo_wdg::cancel_treaty
private

Definition at line 56 of file diplodlg.h.

Referenced by diplo_wdg().

◆ curr_player

struct player* diplo_wdg::curr_player
private

◆ index

int diplo_wdg::index
private

Definition at line 98 of file diplodlg.h.

Referenced by get_index(), and set_index().

◆ layout

QGridLayout* diplo_wdg::layout
private

Definition at line 52 of file diplodlg.h.

Referenced by diplo_wdg().

◆ p1_accept

bool diplo_wdg::p1_accept
private

Definition at line 96 of file diplodlg.h.

Referenced by diplo_wdg().

◆ p2_accept

bool diplo_wdg::p2_accept
private

Definition at line 97 of file diplodlg.h.

Referenced by diplo_wdg().

◆ plr1

struct player* diplo_wdg::plr1
private

◆ plr1_accept

QLabel* diplo_wdg::plr1_accept
private

Definition at line 53 of file diplodlg.h.

Referenced by diplo_wdg(), and update_wdg().

◆ plr2

struct player* diplo_wdg::plr2
private

◆ plr2_accept

QLabel* diplo_wdg::plr2_accept
private

Definition at line 54 of file diplodlg.h.

Referenced by diplo_wdg(), and update_wdg().

◆ text_edit

QTableWidget* diplo_wdg::text_edit
private

Definition at line 57 of file diplodlg.h.

◆ treaty

struct treaty* diplo_wdg::treaty

Definition at line 66 of file diplodlg.h.