Freeciv-3.3
Loading...
Searching...
No Matches
diplodlg.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__DIPLODLG_H
15#define FC__DIPLODLG_H
16
17#ifdef HAVE_CONFIG_H
18#include <fc_config.h>
19#endif
20
21// Qt
22#include <QMap>
23#include <QTabWidget>
24
25extern "C" {
26#include "diplodlg_g.h"
27}
28
29// common
30#include "research.h"
31
32// client
33#include "game.h"
34#include "sprite.h"
35#include "tilespec.h"
36
37class QCloseEvent;
38class QGridLayout;
39class QIcon;
40class QLabel;
41class QPushButton;
42class QSpinBox;
43class QTableWidget;
45
46/****************************************************************************
47 Diplomacy tab for one nation
48****************************************************************************/
49class diplo_wdg: public QWidget
50{
53 QLabel *plr1_accept;
54 QLabel *plr2_accept;
55 QPushButton *accept_treaty;
56 QPushButton *cancel_treaty;
57 QTableWidget *text_edit;
58
59public:
60 diplo_wdg(struct treaty *ptreaty,
61 struct player *they, struct player *initiator);
62 ~diplo_wdg();
63 void update_wdg();
64 void set_index(int ind);
65 int get_index();
66 struct treaty *treaty;
67
68private slots:
69 void all_advances();
71 void give_advance(int tech);
72 void give_city(int city_num);
73 void give_embassy();
74 void give_shared_vision();
75 void gold_changed1(int val);
76 void gold_changed2(int val);
77 void pact_allianze();
78 void pact_ceasfire();
79 void pact_peace();
80 void response_accept();
81 void response_cancel();
82 void sea_map_clause();
83 void show_menu(struct player *pplayer);
84 void show_menu_p1();
85 void show_menu_p2();
86 void world_map_clause();
87 void restore_pixmap();
88
89protected:
91private:
92 struct player *plr1;
93 struct player *plr2;
98 int index;
99};
100
101/****************************************************************************
102 Diplomacy dialog containing many diplo_wdg
103****************************************************************************/
104class diplo_dlg: public QTabWidget
105{
108
109public:
110 diplo_dlg(struct treaty *ptreaty, struct player *they,
111 struct player *initiator);
112 ~diplo_dlg();
113 void reactivate();
114 void update_dlg();
115 bool init(bool raise);
117 void close_widget(struct player *they);
118 void add_widget(struct treaty *ptreaty, struct player *they,
119 struct player *initiator);
120 void make_active(struct player *party);
121
122private:
123 int index;
124};
125
126#endif // FC__DIPLODLG_H
void add_widget(struct treaty *ptreaty, struct player *they, struct player *initiator)
Definition diplodlg.cpp:794
void update_dlg()
Definition diplodlg.cpp:895
QMap< struct player *, diplo_wdg * > treaty_list
Definition diplodlg.h:107
void make_active(struct player *party)
Definition diplodlg.cpp:820
int index
Definition diplodlg.h:123
void reactivate()
Definition diplodlg.cpp:910
diplo_wdg * find_widget(struct player *they)
Definition diplodlg.cpp:872
struct player * curr_player
Definition diplodlg.h:95
void response_accept()
Definition diplodlg.cpp:764
void pact_ceasfire()
Definition diplodlg.cpp:530
bool p2_accept
Definition diplodlg.h:97
int active_menu
Definition diplodlg.h:94
void show_menu_p1()
Definition diplodlg.cpp:674
void give_embassy()
Definition diplodlg.cpp:497
QLabel * plr2_accept
Definition diplodlg.h:54
void gold_changed1(int val)
Definition diplodlg.cpp:300
void world_map_clause()
Definition diplodlg.cpp:563
void show_menu(struct player *pplayer)
Definition diplodlg.cpp:322
void gold_changed2(int val)
Definition diplodlg.cpp:311
QTableWidget * text_edit
Definition diplodlg.h:57
int get_index()
Definition diplodlg.cpp:690
void pact_allianze()
Definition diplodlg.cpp:519
void closeEvent(QCloseEvent *event)
Definition diplodlg.cpp:289
void all_advances()
Definition diplodlg.cpp:624
QPushButton * cancel_treaty
Definition diplodlg.h:56
void sea_map_clause()
Definition diplodlg.cpp:552
void give_shared_vision()
Definition diplodlg.cpp:508
void give_city(int city_num)
Definition diplodlg.cpp:574
void response_cancel()
Definition diplodlg.cpp:774
struct player * plr1
Definition diplodlg.h:92
struct treaty * treaty
Definition diplodlg.h:66
void dbl_click(QTableWidgetItem *item)
Definition diplodlg.cpp:267
void show_menu_p2()
Definition diplodlg.cpp:666
void update_wdg()
Definition diplodlg.cpp:698
struct player * plr2
Definition diplodlg.h:93
int index
Definition diplodlg.h:98
void restore_pixmap()
Definition diplodlg.cpp:752
bool p1_accept
Definition diplodlg.h:96
QPushButton * accept_treaty
Definition diplodlg.h:55
void give_advance(int tech)
Definition diplodlg.cpp:599
QGridLayout * layout
Definition diplodlg.h:52
void pact_peace()
Definition diplodlg.cpp:541
void set_index(int ind)
Definition diplodlg.cpp:682
QLabel * plr1_accept
Definition diplodlg.h:53
char * incite_cost
Definition comments.c:76
struct treaty * ptreaty
Definition diplodlg_g.h:28
struct treaty struct player * they
Definition diplodlg_g.h:28
enum event_type event
Definition events.c:81
bool init
Definition mapimg.c:483
struct player_slot * slots
Definition player.c:51
Definition climisc.h:82