Freeciv-3.2
Loading...
Searching...
No Matches
luaconsole.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#ifdef HAVE_CONFIG_H
14#include <fc_config.h>
15#endif
16
17// Qt
18#include <QFileDialog>
19#include <QString>
20
21// utility
22#include "shared.h"
23
24// common
25#include "featured_text.h"
26
27// client/luascript
28#include "script_client.h"
29
30// gui-qt
31#include "fc_client.h"
32#include "luaconsole.h"
33#include "qtg_cxxside.h"
34
36
37/*************************************************************************/
41{
42 // Lua output is in chat
43}
44
45/*************************************************************************/
49{
50 return true;
51}
52
53/*************************************************************************/
59
60/*************************************************************************/
65 const struct text_tag_list *tags)
66{
68}
69
70/*************************************************************************/
74{
76
77 str = QString(_("Lua scripts")) + QString(" (*.lua)");
78 qlua_filename = QFileDialog::getOpenFileName(gui()->central_wdg,
79 _("Load lua script"),
80 QDir::homePath(), str);
81 if (!qlua_filename.isEmpty()) {
82 script_client_do_file(qlua_filename.toUtf8().constData());
83 }
84}
85
86/*************************************************************************/
90{
91 if (!qlua_filename.isEmpty()) {
92 script_client_do_file(qlua_filename.toUtf8().constData());
93 }
94}
#define str
Definition astring.c:76
void qtg_real_output_window_append(const char *astring, const struct text_tag_list *tags, int conn_id)
Definition chatline.cpp:738
char * incite_cost
Definition comments.c:75
#define _(String)
Definition fcintl.h:67
QString qlua_filename
bool luaconsole_dialog_is_open(void)
void qload_lua_script()
void real_luaconsole_append(const char *astring, const struct text_tag_list *tags)
void real_luaconsole_dialog_update(void)
void luaconsole_dialog_popup(bool raise)
void qreload_lua_script()
static mpgui * gui
Definition mpgui_qt.cpp:52
bool script_client_do_file(const char *filename)