19#include <QApplication>
52#define FLAG_HEIGHT_DIPLDLG 150
108 text =
"<b><h3><center>"
111 +
"</center></h3></b>";
113 text =
"<style>h3{background-color: "
116 +
"}</style>" + text;
118 label3->setMinimumWidth(300);
120 text =
"<b><h3><center>"
123 +
"</center></h3></b></body>";
125 text =
"<style>h3{background-color: "
128 +
"}</style>" + text;
129 label4->setMinimumWidth(300);
147 text =
"<b><center>" + text.toHtmlEscaped() +
"</center></b>";
148 label->setText(text);
151 layout->addWidget(label, 1, 5);
167 text2 =
"<b><center>" +
text2.toHtmlEscaped() +
"</center></b>";
181 goldlab1->setAlignment(Qt::AlignRight);
183 goldlab2->setAlignment(Qt::AlignRight);
216 text_edit->setProperty(
"showGrid",
"false");
217 text_edit->setProperty(
"selectionBehavior",
"SelectRows");
218 text_edit->setEditTriggers(QAbstractItemView::NoEditTriggers);
219 text_edit->verticalHeader()->setVisible(
false);
220 text_edit->horizontalHeader()->setVisible(
false);
221 text_edit->setSelectionMode(QAbstractItemView::SingleSelection);
224 header->setStretchLastSection(
true);
225 connect(
text_edit, &QTableWidget::itemDoubleClicked,
231 new QPushButton(style()->
standardIcon(QStyle::SP_DialogYesButton),
234 new QPushButton(style()->
standardIcon(QStyle::SP_DialogNoButton),
235 _(
"Cancel meeting"));
324 struct player *other_player;
330 QMap <QString, int>::const_iterator
city_iter;
332 QMap <QString, Tech_type_id>::const_iterator
adv_iter;
335 QMenu *menu =
new QMenu(
this);
418 city_list.insert(pcity->name, pcity->id);
422 if (city_list.count() > 0) {
423 while (
city_iter != city_list.constEnd()) {
490 menu->setAttribute(Qt::WA_DeleteOnClose);
491 menu->popup(QCursor::pos());
717 qitem->setTextAlignment(Qt::AlignLeft);
726 qitem->setText(
_(
"--- This treaty is blank. "
727 "Please add some clauses. ---"));
728 qitem->setTextAlignment(Qt::AlignLeft);
755 gui()->sw_diplo->resize_pixmap(
gui()->sw_diplo->width(),
756 gui()->sw_diplo->height());
757 gui()->sw_diplo->set_custom_labels(
QString());
758 gui()->sw_diplo->update_final_pixmap();
843 gui()->gimme_place(
this,
"DDI");
845 gui()->game_tab_widget->setCurrentIndex(
index);
858 while (
i.hasNext()) {
865 gui()->remove_repo_dlg(
"DDI");
866 gui()->game_tab_widget->setCurrentIndex(0);
900 while (
i.hasNext()) {
926 if (!
gui()->is_repo_dlg_open(
"DDI")) {
929 i =
gui()->gimme_index_of(
"DDI");
931 w =
gui()->game_tab_widget->widget(
i);
967 *
pix2 = pix->scaledToWidth(
gui()->sw_diplo->width() - 2,
968 Qt::SmoothTransformation);
969 if (
pix2->height() >
gui()->sw_diplo->height()) {
970 *
pix2 = pix->scaledToHeight(
gui()->sw_diplo->height(),
971 Qt::SmoothTransformation);
974 pix3->fill(Qt::transparent);
977 gui()->sw_diplo->height(),
978 Qt::IgnoreAspectRatio,
979 Qt::SmoothTransformation);
981 p.drawPixmap(1, 1, *
pix2);
984 gui()->sw_diplo->set_pixmap(
pix3);
985 gui()->sw_diplo->resize_pixmap(
gui()->sw_diplo->width(),
986 gui()->sw_diplo->height());
989 gui()->sw_diplo->update_final_pixmap();
998 if (!
dd->init(
false)) {
1005 i =
gui()->gimme_index_of(
"DDI");
1007 w =
gui()->game_tab_widget->widget(
i);
1017 gui()->game_tab_widget->setCurrentIndex(
i);
1023 gui()->game_tab_widget->setCurrentIndex(
i);
1045 if (!
gui()->is_repo_dlg_open(
"DDI")) {
1049 i =
gui()->gimme_index_of(
"DDI");
1051 w =
gui()->game_tab_widget->widget(
i);
1069 if (!
gui()->is_repo_dlg_open(
"DDI")) {
1072 i =
gui()->gimme_index_of(
"DDI");
1074 w =
gui()->game_tab_widget->widget(
i);
1089 if (!
gui()->is_repo_dlg_open(
"DDI")) {
1093 i =
gui()->gimme_index_of(
"DDI");
1095 w =
gui()->game_tab_widget->widget(
i);
1114 if (!
gui()->is_repo_dlg_open(
"DDI")) {
1117 i =
gui()->gimme_index_of(
"DDI");
1119 w =
gui()->game_tab_widget->widget(
i);
bool is_capital(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
void close_widget(struct player *they)
diplo_dlg(struct Treaty *ptreaty, struct player *they, struct player *initiator)
QMap< struct player *, diplo_wdg * > treaty_list
void make_active(struct player *party)
diplo_wdg * find_widget(struct player *they)
void add_widget(struct Treaty *ptreaty, struct player *they, struct player *initiator)
struct player * curr_player
void gold_changed1(int val)
void show_menu(struct player *pplayer)
void gold_changed2(int val)
diplo_wdg(struct Treaty *ptreaty, struct player *they, struct player *initiator)
void closeEvent(QCloseEvent *event)
QPushButton * cancel_treaty
void give_shared_vision()
void give_city(int city_num)
void dbl_click(QTableWidgetItem *item)
QPushButton * accept_treaty
void give_advance(int tech)
QPixmap * get_pixmap(const QString &id)
static fc_icons * instance()
bool client_is_observer(void)
enum client_states client_state(void)
bool can_client_issue_orders(void)
const char * title_for_player(const struct player *pplayer, char *buf, size_t buf_len)
void client_diplomacy_clause_string(char *buf, int bufsiz, struct Clause *pclause)
struct color * color_best_contrast(struct color *subject, struct color **candidates, int ncandidates)
struct color * get_player_color(const struct tileset *t, const struct player *pplayer)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
void qtg_recv_create_clause(struct Treaty *ptreaty, struct player *they)
void qtg_recv_accept_treaty(struct Treaty *ptreaty, struct player *they)
struct player * player_by_number(const int player_id)
void qtg_prepare_clause_updt(struct Treaty *ptreaty, struct player *they)
void qtg_init_meeting(struct Treaty *ptreaty, struct player *they, struct player *initiator)
#define FLAG_HEIGHT_DIPLDLG
int client_player_number(void)
void qtg_recv_cancel_meeting(struct Treaty *ptreaty, struct player *they, struct player *initiator)
void close_all_diplomacy_dialogs(void)
void qtg_recv_remove_clause(struct Treaty *ptreaty, struct player *they)
struct Treaty struct player * they
bool clause_enabled(enum clause_type type)
#define clause_list_iterate_end
#define clause_list_iterate(clauselist, pclause)
#define PL_(String1, String2, n)
const char * ruler_title_for_player(const struct player *pplayer, char *buf, size_t buf_len)
static enum client_pages current_page
#define CAPTURE_DEFAULT_THIS
QApplication * current_app()
#define fc_assert(condition)
#define log_normal(message,...)
struct nation_type * nation_of_player(const struct player *pplayer)
const char * nation_plural_for_player(const struct player *pplayer)
int dsend_packet_diplomacy_create_clause_req(struct connection *pc, int counterpart, int giver, enum clause_type type, int value)
int dsend_packet_diplomacy_cancel_meeting_req(struct connection *pc, int counterpart)
int dsend_packet_diplomacy_remove_clause_req(struct connection *pc, int counterpart, int giver, enum clause_type type, int value)
int dsend_packet_diplomacy_accept_treaty_req(struct connection *pc, int counterpart)
int player_number(const struct player *pplayer)
bool player_has_real_embassy(const struct player *pplayer, const struct player *pplayer2)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool gives_shared_vision(const struct player *me, const struct player *them)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
struct clause_list * clauses
struct packet_game_info info
bool tech_trade_allow_holes
#define is_svg_flag_enabled()
const char * advance_name_translation(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_iterate(_p)
#define advance_iterate_end
struct sprite * get_treaty_thumb_sprite(const struct tileset *t, bool on_off)
struct sprite * get_nation_flag_sprite(const struct tileset *t, const struct nation_type *pnation)