13 #include <QGridLayout>
16 #include <QPushButton>
106 int vote_count, index;
108 char buf[1024], status[1024], color[32];
129 if (status[0] !=
'\0') {
131 "<b><p style=\"background-color: %s\"> %s</p></b> ", color,
139 lab_no->setText(QString::number(vi->
no));
141 if (buf[0] !=
'\0') {
144 label_text->setText(QString(
_(
"<b>%1 called a vote for:</b>"))
145 .arg(QString(vi->
user).toHtmlEscaped()));
148 " red\"> %1</p></b>")
149 .arg(QString(vi->
desc).toHtmlEscaped()));
153 lab_yes->setText(QStringLiteral(
"-"));
154 lab_no->setText(QStringLiteral(
"-"));
162 if (vote_count < 1) {
181 palette.setColor(QPalette::WindowText, QColor(0, 255, 255));
184 palette.setColor(QPalette::WindowText, QColor(255, 255, 0));
186 lab_no->setPalette(palette);
188 voters->setPalette(palette);
197 painter->setBrush(QColor(90, 90, 192, 185));
198 painter->drawRect(0, 0, width(), height());
199 painter->setBrush(QColor(90, 90, 192, 185));
200 painter->drawRect(5, 5, width() - 10, height() - 10);
221 if (
king()->current_page() == PAGE_START) {
222 qobject_cast<page_pregame *>(
king()->pages[PAGE_START])->update_vote();
224 if (
king()->current_page() == PAGE_GAME) {
225 if (
queen()->x_vote !=
nullptr) {
void v_yes()
Slot vote yes.
QPushButton * vote_abstain
pregamevote(QWidget *parent=nullptr)
Constructor for pregamevote.
void v_abstain()
Slot vote abstain.
void update_vote()
Updates text on vote.
~pregamevote() override
Destructor for pregamevote.
void paint(QPainter *painter, QPaintEvent *event)
Paints frames for xvote.
xvote(QWidget *parent)
pregamevote class used for displaying vote bar in PAGE START
void paintEvent(QPaintEvent *event) override
Paint event for xvote.
class fc_client * king()
Return fc_client instance.
pageGame * queen()
Return game instandce.
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
#define sz_strlcpy(dest, src)
void voteinfo_do_vote(int vote_no, enum client_vote_type vote)
Convenience function for submitting a vote to the server.
struct voteinfo * voteinfo_queue_get_current(int *pindex)
Get the voteinfo record at the start of the vote queue.
int voteinfo_queue_size()
Returns the number of pending votes.
void voteinfo_gui_update(void)
Refresh all vote related GUI widgets.