19#include <QApplication>
26#include <QStyleFactory>
29#include <QTextBrowser>
120 index =
message.indexOf(
"PICK:");
123 s = s.remove(
"PICK:");
139 if (
message.startsWith(
"/take ")) {
140 s = s.remove(
"/take ");
146 if (
is_ai(pplayer)) {
236 if (
cmplt !=
nullptr) {
241 cmplt->setCaseSensitivity(Qt::CaseInsensitive);
242 cmplt->setCompletionMode(QCompleter::InlineCompletion);
251 if (
event->type() == QEvent::KeyPress) {
262 return QLineEdit::event(
event);
274 cb->setToolTip(
_(
"Allies only"));
283 gl->setVerticalSpacing(0);
286 gl->addWidget(
cb,1,1);
288 gl->setContentsMargins(0, 0, 6, 0);
318 if (state != Qt::Unchecked) {
343 if (
gui()->infotab->chat_maximized) {
344 gui()->infotab->restore_chat();
347 gui()->infotab->maximize_chat();
357 chat_output->verticalScrollBar()->setSliderPosition(
389 struct tile *ptile =
nullptr;
391 sl = link.toString().split(
",");
392 n =
sl.at(0).toInt();
393 id =
sl.at(1).toInt();
413 _(
"This tile doesn't exist in this game!"));
427 if (ptile !=
nullptr) {
452 chat_output->verticalScrollBar()->setSliderPosition(
483 if (
event->type() == QEvent::KeyPress) {
486 if (
keyEvent->key() == Qt::Key_Escape) {
487 gui()->infotab->restore_chat();
488 gui()->mapview_wdg->setFocus();
492 if (
event->type() == QEvent::ShortcutOverride) {
493 event->setAccepted(
true);
497 return QObject::eventFilter(
obj,
event);
529 while (
qtb.isValid()) {
530 line_count = line_count +
qtb.layout()->lineCount();
534 if (line_count == 0) {
584 if (tags ==
nullptr) {
604 mm.insert(stop,
"</b>");
605 mm.insert(start,
"<b>");
608 mm.insert(stop,
"</i>");
609 mm.insert(start,
"<i>");
612 mm.insert(stop,
"</s>");
613 mm.insert(start,
"<s>");
616 mm.insert(stop,
"</u>");
617 mm.insert(start,
"<u>");
622 if (
color ==
"#00008B") {
626 qc = QColor::fromString(
color);
630 qc =
qc.lighter(200);
634 mm.insert(stop,
"</span>");
641 QColor::isValidColorName(
color)
643 QColor::isValidColor(
color)
647 mm.insert(stop,
"</span>");
672 mm.insert(stop,
"</a></font>");
684 QMultiMap<int, QString>::const_iterator
i =
mm.constEnd();
685 QMultiMap<int, QString>::const_iterator j =
mm.constEnd();
687 while (
i !=
mm.constBegin()) {
696 if (
i !=
mm.constBegin()) {
699 if (j.key() ==
i.key() &&
i != j) {
741 if (
s1.length() <
i) {
744 if (!QString::compare(
s1.left(
i),
str, Qt::CaseInsensitive)) {
750 if (
s1.length() <
i) {
753 if (!QString::compare(
s1.left(
i),
str, Qt::CaseInsensitive)) {
774 gui()->set_status_bar(
str);
779 if (
wakeup.contains(
"%1")) {
786 qapp->alert(
gui()->central_wdg);
792 qapp->alert(
gui()->central_wdg);
826 QEvent(QEvent::
User),
void audio_play_sound(const char *const tag, const char *const alt_tag, const char *const alt_tag2)
static QFont * get_font(enum client_font font)
struct canvas int int struct sprite int int int int height
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
struct canvas int int struct sprite int int int width
#define CHAT_DIRECT_PREFIX
#define CHAT_ALLIES_PREFIX
#define SERVER_COMMAND_PREFIX
void log_output_window(void)
void clear_output_window(void)
QString apply_tags(QString str, const struct text_tag_list *tags, QColor bg_color)
void qtg_version_message(const char *vertext)
void qtg_real_output_window_append(const char *astring, const struct text_tag_list *tags, int conn_id)
static bool is_plain_public_message(QString s)
int send_chat(const char *message)
void output_window_append(const struct ft_color color, const char *featured_text)
void write_chatline_content(const char *txt)
QStringList current_word_list()
static const int HISTORY_END
QString forward_in_history()
void send_chat_message(const QString &message)
void reset_history_position()
QString back_in_history()
static QStringList history
virtual void chat_word_list_changed(const QStringList &cmplt_word_list)
static void update_word_list()
static QStringList word_list
virtual void chat_message_received(const QString &, const struct text_tag_list *)
bool eventFilter(QObject *obj, QEvent *event)
void paintEvent(QPaintEvent *event)
void anchor_clicked(const QUrl &link)
int default_size(int lines)
text_browser_dblclck * chat_output
void make_link(struct tile *ptile)
void chat_message_received(const QString &message, const struct text_tag_list *tags)
void state_changed(Qt::CheckState state)
void paint(QPainter *painter, QPaintEvent *event)
void state_changed_depr(int state)
QPushButton * remove_links
void append(const QString &str)
static fc_font * instance()
QFont * get_font(QString name)
static void invoke(_member_fct_ function)
version_message_event(const QString &msg)
enum client_states client_state(void)
struct tile * client_city_tile(const struct city *pcity)
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
bool is_server_running(void)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
struct unit * find_visible_unit(struct tile *ptile)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
enum text_link_type text_tag_link_type(const struct text_tag *ptag)
const char * tile_link(const struct tile *ptile)
ft_offset_t text_tag_stop_offset(const struct text_tag *ptag)
const char * text_tag_color_foreground(const struct text_tag *ptag)
const struct ft_color ftc_client
const char * city_link(const struct city *pcity)
int text_tag_link_id(const struct text_tag *ptag)
ft_offset_t text_tag_start_offset(const struct text_tag *ptag)
const char * unit_link(const struct unit *punit)
const char * text_tag_color_background(const struct text_tag *ptag)
#define text_tag_list_iterate_end
#define text_tag_list_iterate(tags, ptag)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
static bool is_plain_public_message(const char *s)
void popup_races_dialog(struct player *pplayer)
QString apply_tags(QString str, const struct text_tag_list *tags, QColor bg_color)
#define set_output_window_text(_pstr_)
static QApplication * qapp
QApplication * current_app()
#define FC_CPP_DECLARE_LISTENER(_type_)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
void link_mark_restore(enum text_link_type type, int id)
void center_tile_mapcanvas(const struct tile *ptile)
void link_marks_clear_all(void)
const char *const chatline
struct client_options gui_options
#define players_iterate_end
#define players_iterate(_pplayer)
struct conn_list * est_connections
struct conn_list * all_connections
bool gui_qt_allied_chat_only
char gui_qt_wakeup_text[512]
char username[MAX_LEN_NAME]
#define sz_strlcpy(dest, src)
struct city * tile_city(const struct tile *ptile)