Freeciv-3.3
Loading...
Searching...
No Matches
conversion_log.cpp
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#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18// Qt
19#include <QGridLayout>
20#include <QPushButton>
21
22// utility
23#include "fcintl.h"
24
25#include "conversion_log.h"
26
27/**********************************************************************/
31{
32 QGridLayout *main_layout = new QGridLayout(this);
33 QPushButton *close_button;
34 int row = 0;
35
36 area = new QTextEdit();
37 area->setParent(this);
38 area->setReadOnly(true);
39 main_layout->addWidget(area, row++, 0);
40
41 close_button = new QPushButton(QString::fromUtf8(R__("Close")), this);
42 connect(close_button, SIGNAL(pressed()), this, SLOT(close_now()));
43 main_layout->addWidget(close_button, row++, 0);
44
45 setLayout(main_layout);
47
48 setVisible(false);
49}
50
51/**********************************************************************/
54void conversion_log::add(const char *msg)
55{
56 area->append(QString::fromUtf8(msg));
57 setVisible(true);
58}
59
60/**********************************************************************/
64{
65 done(0);
66}
conversion_log(QString title)
void add(const char *msg)
QTextEdit * area
char * incite_cost
Definition comments.c:76
#define R__(String)
Definition fcintl.h:75
const char * title
Definition repodlgs.c:1314