Freeciv21
Develop your civilization from humble roots to a global empire
conversion_log.cpp
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 
14 // Qt
15 #include <QGridLayout>
16 #include <QPushButton>
17 
18 // utility
19 #include "fcintl.h"
20 
21 #include "conversion_log.h"
22 
27 {
28  QGridLayout *main_layout = new QGridLayout(this);
29  QPushButton *close_button;
30  int row = 0;
31 
32  area = new QTextEdit();
33  area->setParent(this);
34  area->setReadOnly(true);
35  main_layout->addWidget(area, row++, 0);
36 
37  close_button = new QPushButton(QString::fromUtf8(R__("Close")), this);
38  connect(close_button, &QAbstractButton::pressed, this,
40  main_layout->addWidget(close_button, row++, 0);
41 
42  setLayout(main_layout);
43  setWindowTitle(QString::fromUtf8(R__("Old ruleset to a new format")));
44 
45  setVisible(false);
46 }
47 
51 void conversion_log::add(const char *msg)
52 {
53  area->append(QString::fromUtf8(msg));
54  setVisible(true);
55 }
56 
60 void conversion_log::close_now() { done(0); }
conversion_log()
Setup conversion_log object.
void add(const char *msg)
Add entry.
QTextEdit * area
void close_now()
User pushed close button.
#define R__(String)
Definition: fcintl.h:58