Freeciv-3.1
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;
44class QTableWidgetItem;
45
46/****************************************************************************
47 Diplomacy tab for one nation
48****************************************************************************/
49class diplo_wdg: public QWidget
50{
51 Q_OBJECT
52 QGridLayout *layout;
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(int id, int id2);
61 ~diplo_wdg();
62 void update_wdg();
63 void set_index(int ind);
64 int get_index();
65 struct Treaty treaty;
66
67private slots:
68 void all_advances();
69 void dbl_click(QTableWidgetItem *item);
70 void give_advance(int tech);
71 void give_city(int city_num);
72 void give_embassy();
73 void give_shared_vision();
74 void gold_changed1(int val);
75 void gold_changed2(int val);
76 void pact_allianze();
77 void pact_ceasfire();
78 void pact_peace();
79 void response_accept();
80 void response_cancel();
81 void sea_map_clause();
82 void show_menu(int player);
83 void show_menu_p1();
84 void show_menu_p2();
85 void world_map_clause();
86 void restore_pixmap();
87
88protected:
89 void closeEvent(QCloseEvent *event);
90private:
97 int index;
98};
99
100/****************************************************************************
101 Diplomacy dialog containing many diplo_wdg
102****************************************************************************/
103class diplo_dlg: public QTabWidget
104{
105 Q_OBJECT
106 QMap<int, diplo_wdg *> treaty_list;
107
108public:
109 diplo_dlg(int counterpart, int initiated_from);
110 ~diplo_dlg();
111 void reactivate();
112 void update_dlg();
113 bool init(bool raise);
115 void close_widget(int counterpart);
116 void add_widget(int counterpart, int initiated_from);
117 void make_active(int party);
118
119private:
120 int index;
121};
122
123#endif /* FC__DIPLODLG_H */
QMap< int, diplo_wdg * > treaty_list
Definition diplodlg.h:106
void make_active(int party)
Definition diplodlg.cpp:804
void update_dlg()
Definition diplodlg.cpp:879
void add_widget(int counterpart, int initiated_from)
Definition diplodlg.cpp:778
diplo_wdg * find_widget(int counterpart)
Definition diplodlg.cpp:856
int index
Definition diplodlg.h:120
void reactivate()
Definition diplodlg.cpp:894
void response_accept()
Definition diplodlg.cpp:749
void pact_ceasfire()
Definition diplodlg.cpp:518
bool p2_accept
Definition diplodlg.h:96
int active_menu
Definition diplodlg.h:93
void show_menu_p1()
Definition diplodlg.cpp:660
void give_embassy()
Definition diplodlg.cpp:488
QLabel * plr2_accept
Definition diplodlg.h:54
void show_menu(int player)
Definition diplodlg.cpp:314
void gold_changed1(int val)
Definition diplodlg.cpp:294
void world_map_clause()
Definition diplodlg.cpp:548
void gold_changed2(int val)
Definition diplodlg.cpp:304
QTableWidget * text_edit
Definition diplodlg.h:57
int get_index()
Definition diplodlg.cpp:676
void pact_allianze()
Definition diplodlg.cpp:508
void closeEvent(QCloseEvent *event)
Definition diplodlg.cpp:283
int player1
Definition diplodlg.h:91
void all_advances()
Definition diplodlg.cpp:606
QPushButton * cancel_treaty
Definition diplodlg.h:56
void sea_map_clause()
Definition diplodlg.cpp:538
void give_shared_vision()
Definition diplodlg.cpp:498
void give_city(int city_num)
Definition diplodlg.cpp:558
void response_cancel()
Definition diplodlg.cpp:759
void dbl_click(QTableWidgetItem *item)
Definition diplodlg.cpp:261
void show_menu_p2()
Definition diplodlg.cpp:652
void update_wdg()
Definition diplodlg.cpp:684
int curr_player
Definition diplodlg.h:94
int index
Definition diplodlg.h:97
void restore_pixmap()
Definition diplodlg.cpp:737
bool p1_accept
Definition diplodlg.h:95
QPushButton * accept_treaty
Definition diplodlg.h:55
int player2
Definition diplodlg.h:92
void give_advance(int tech)
Definition diplodlg.cpp:582
QGridLayout * layout
Definition diplodlg.h:52
void pact_peace()
Definition diplodlg.cpp:528
void set_index(int ind)
Definition diplodlg.cpp:668
struct Treaty treaty
Definition diplodlg.h:65
QLabel * plr1_accept
Definition diplodlg.h:53
int counterpart
Definition diplodlg_g.h:25
enum event_type event
Definition events.c:81
bool init
Definition mapimg.c:482
struct player_slot * slots
Definition player.c:50
Definition climisc.h:82