14 #include <fc_config.h>
19 #ifdef FREECIV_MSWINDOWS
24 #include <QApplication>
25 #include <QCommandLineParser>
57 int main(
int argc,
char **argv)
59 QApplication app(argc, argv);
61 app.setDesktopFileName(QStringLiteral(
"net.longturn.freeciv21.ruledit"));
64 QIcon::setThemeSearchPaths(
get_data_dirs() + QIcon::themeSearchPaths());
65 QIcon::setFallbackThemeName(QIcon::themeName());
66 QIcon::setThemeName(QStringLiteral(
"icons"));
68 qApp->setWindowIcon(QIcon::fromTheme(QStringLiteral(
"freeciv21-ruledit")));
105 QObject::connect(&app, &QCoreApplication::aboutToQuit,
main,
106 &QObject::deleteLater);
129 QCommandLineParser parser;
130 parser.addHelpOption();
131 parser.addVersionOption();
133 bool ok = parser.addOptions({
134 {{
"F",
"Fatal"},
_(
"Raise a signal on failed assertion")},
136 R__(
"Ruleset to use as the starting point."),
141 qFatal(
"Adding command line arguments failed");
150 if (parser.isSet(QStringLiteral(
"ruleset"))) {
151 if (parser.values(QStringLiteral(
"ruleset")).
size() >= 1) {
152 fc_fprintf(stderr,
R__(
"Can only edit one ruleset at a time.\n"));
165 #ifdef RULEDIT_EXPERIMENTAL
void free_libfreeciv()
Free misc resources allocated for libfreeciv.
void fc_fprintf(FILE *stream, const char *format,...)
Do a fprintf from the internal charset into the local charset.
void init_character_encodings(const char *my_internal_encoding, bool my_use_transliteration)
Must be called during the initialization phase of server and client to initialize the character encod...
const char * get_internal_encoding()
Return the internal encoding.
#define FC_DEFAULT_DATA_ENCODING
const char * get_locale_dir()
Return directory containing locales.
void game_init(bool keep_ruleset_value)
Initialise all game settings.
bool log_init(const QString &level_str, const QStringList &extra_rules)
Parses a log level string as provided by the user on the command line, and installs the corresponding...
void fc_assert_set_fatal(bool fatal)
Set what signal the assert* macros should raise on failed assertion (-1 to disable).
void log_close()
Deinitialize logging module.
struct ruledit_arguments reargs
int main(int argc, char **argv)
Main entry point for freeciv-ruledit.
void show_experimental(QWidget *wdg)
Show widget if experimental features enabled, hide otherwise.
static void re_parse_cmdline(const QCoreApplication &app)
Parse freeciv-ruledit commandline.
void init_connections()
Initialize connection related stuff.
void settings_init(bool act)
Initialize stuff related to this code module.
const QStringList & get_data_dirs()
Returns a list of data directory paths, in the order in which they should be searched.
void free_nls()
Free memory allocated by Native Language Support.
void init_nls()
Setup for Native Language Support, if configured to use it.
struct packet_game_info info
const char * freeciv21_version()
Returns the raw version string.