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);
326 if (
gui()->infotab->chat_maximized) {
327 gui()->infotab->restore_chat();
330 gui()->infotab->maximize_chat();
340 chat_output->verticalScrollBar()->setSliderPosition(
372 struct tile *ptile =
nullptr;
374 sl = link.toString().split(
",");
375 n =
sl.at(0).toInt();
376 id =
sl.at(1).toInt();
396 _(
"This tile doesn't exist in this game!"));
410 if (ptile !=
nullptr) {
435 chat_output->verticalScrollBar()->setSliderPosition(
466 if (
event->type() == QEvent::KeyPress) {
469 if (
keyEvent->key() == Qt::Key_Escape) {
470 gui()->infotab->restore_chat();
471 gui()->mapview_wdg->setFocus();
475 if (
event->type() == QEvent::ShortcutOverride) {
476 event->setAccepted(
true);
480 return QObject::eventFilter(
obj,
event);
512 while (
qtb.isValid()) {
513 line_count = line_count +
qtb.layout()->lineCount();
517 if (line_count == 0) {
567 if (tags ==
nullptr) {
587 mm.insert(stop,
"</b>");
588 mm.insert(start,
"<b>");
591 mm.insert(stop,
"</i>");
592 mm.insert(start,
"<i>");
595 mm.insert(stop,
"</s>");
596 mm.insert(start,
"<s>");
599 mm.insert(stop,
"</u>");
600 mm.insert(start,
"<u>");
605 if (
color ==
"#00008B") {
609 qc =
qc.lighter(200);
613 mm.insert(stop,
"</span>");
618 if (QColor::isValidColor(
color)) {
620 mm.insert(stop,
"</span>");
645 mm.insert(stop,
"</a></font>");
657 QMultiMap<int, QString>::const_iterator
i =
mm.constEnd();
658 QMultiMap<int, QString>::const_iterator j =
mm.constEnd();
660 while (
i !=
mm.constBegin()) {
669 if (
i !=
mm.constBegin()) {
672 if (j.key() ==
i.key() &&
i != j) {
714 if (
s1.length() <
i) {
717 if (!QString::compare(
s1.left(
i),
str, Qt::CaseInsensitive)) {
723 if (
s1.length() <
i) {
726 if (!QString::compare(
s1.left(
i),
str, Qt::CaseInsensitive)) {
747 gui()->set_status_bar(
str);
752 if (
wakeup.contains(
"%1")) {
759 qapp->alert(
gui()->central_wdg);
765 qapp->alert(
gui()->central_wdg);
799 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 paint(QPainter *painter, QPaintEvent *event)
QPushButton * remove_links
void state_changed(int state)
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
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)