Freeciv-3.3: /fast/freeciv/nightly/main/tools/fcmp/mpgui_gtk5.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
mpgui_gtk5.c
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#include <stdlib.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "fc_cmdline.h"
24#include "fciconv.h"
25#include "fcintl.h"
26#include "log.h"
27#include "mem.h"
28
29/* common */
30#include "version.h"
31
32/* modinst */
33#include "download.h"
34#include "mpcmdline.h"
35#include "mpdb.h"
36
37#include "modinst.h"
38
39 static GtkWidget *toplevel;
40 static GtkWidget *statusbar;
41 static GtkWidget *progressbar;
42 static GtkWidget *main_list;
43 static GtkListStore *main_store;
44 static GtkWidget *URL_input;
45 static GtkAlertDialog *quit_dialog;
46 static gboolean downloading = FALSE;
47
48 struct fcmp_params fcmp = {
49 .list_url = MODPACK_LIST_URL,
50 .inst_prefix = nullptr,
51 .autoinstall = nullptr
52};
53
54 static GtkApplication *fcmp_app;
55
56static gboolean quit_dialog_callback(void);
57
58#define ML_COL_NAME 0
59#define ML_COL_VER 1
60#define ML_COL_INST 2
61#define ML_COL_TYPE 3
62#define ML_COL_SUBTYPE 4
63#define ML_COL_LIC 5
64#define ML_COL_URL 6
65
66#define ML_COL_COUNT 7
67
68#define ML_TYPE 7
69#define ML_NOTES 8
70#define ML_STORE_SIZE 9
71
72/**********************************************************************/
75 static void modinst_quit(void)
76{
77 g_application_quit(G_APPLICATION(fcmp_app));
78}
79
80/**********************************************************************/
84 static void quit_dialog_response(GObject *dialog, GAsyncResult *result,
85 gpointer data)
86{
87 int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
88 result, nullptr);
89
90 if (button == 0) {
91 modinst_quit();
92 }
93
94 quit_dialog = nullptr;
95}
96
97/**********************************************************************/
100 static gboolean quit_dialog_callback(void)
101{
102 if (downloading || TRUE) {
103 /* Download in progress. Confirm quit from user. */
104
105 if (quit_dialog == nullptr) {
106 const char *buttons[] = { _("Quit"), _("Cancel"), nullptr };
107
108 quit_dialog = gtk_alert_dialog_new(_("Modpack installation in progress.\n"
109 "Are you sure you want to quit?"));
110
111 gtk_alert_dialog_set_buttons(GTK_ALERT_DIALOG(quit_dialog), buttons);
112
113 gtk_alert_dialog_choose(GTK_ALERT_DIALOG(quit_dialog),
114 GTK_WINDOW(toplevel), nullptr,
115 quit_dialog_response, nullptr);
116 }
117
118 } else {
119 /* User loses no work by quitting, so let's not annoy them
120 * with confirmation dialog. */
121 modinst_quit();
122 }
123
124 /* Stop emission of event. */
125 return TRUE;
126}
127
128/**********************************************************************/
131 static void msg_callback(const char *msg)
132{
133 log_verbose("%s", msg);
134 gtk_label_set_text(GTK_LABEL(statusbar), msg);
135}
136
137/**********************************************************************/
140 static void pbar_callback(int downloaded, int max)
141{
142 /* Control file already downloaded */
143 double fraction = (double) downloaded / (max);
144
145 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), fraction);
146}
147
148struct msg_data {
149 char *msg;
150};
151
152/**********************************************************************/
155 static gboolean msg_main_thread(gpointer user_data)
156{
157 struct msg_data *data = (struct msg_data *)user_data;
158
159 msg_callback(data->msg);
160
161 FC_FREE(data->msg);
162 FC_FREE(data);
163
164 return G_SOURCE_REMOVE;
165}
166
167/**********************************************************************/
170 static void msg_dl_thread(const char *msg)
171{
172 struct msg_data *data = fc_malloc(sizeof(*data));
173
174 data->msg = fc_strdup(msg);
175
176 g_idle_add(msg_main_thread, data);
177}
178
179struct pbar_data {
180 int current;
181 int max;
182};
183
184/**********************************************************************/
187 static gboolean pbar_main_thread(gpointer user_data)
188{
189 struct pbar_data *data = (struct pbar_data *)user_data;
190
191 pbar_callback(data->current, data->max);
192
193 FC_FREE(data);
194
195 return G_SOURCE_REMOVE;
196}
197
198/**********************************************************************/
201 static void pbar_dl_thread(int current, int max)
202{
203 struct pbar_data *data = fc_malloc(sizeof(*data));
204
205 data->current = current;
206 data->max = max;
207
208 g_idle_add(pbar_main_thread, data);
209}
210
211/**********************************************************************/
214 static gboolean versionlist_update_main_thread(gpointer user_data)
215{
216 GtkTreeIter iter;
217
218 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_store), &iter)) {
219 do {
220 const char *name_str;
221 int type_int;
222 const char *new_inst;
223 enum modpack_type type;
224
225 gtk_tree_model_get(GTK_TREE_MODEL(main_store), &iter,
226 ML_COL_NAME, &name_str,
227 ML_TYPE, &type_int,
228 -1);
229
230 type = type_int;
231
232 new_inst = mpdb_installed_version(name_str, type);
233
234 if (new_inst == nullptr) {
235 new_inst = _("Not installed");
236 }
237
238 gtk_list_store_set(main_store, &iter,
239 ML_COL_INST, new_inst,
240 -1);
241
242 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(main_store), &iter));
243 }
244
245 return G_SOURCE_REMOVE;
246}
247
248/**********************************************************************/
251 static void versionlist_update_dl_thread(void)
252{
253 g_idle_add(versionlist_update_main_thread, nullptr);
254}
255
256/**********************************************************************/
259 static gpointer download_thread(gpointer data)
260{
261 const char *errmsg;
262
263 errmsg = download_modpack(data, &fcmp, msg_dl_thread, pbar_dl_thread);
264
265 if (errmsg == nullptr) {
266 msg_dl_thread(_("Ready"));
267 } else {
268 msg_dl_thread(errmsg);
269 }
270
271 free(data);
272
273 versionlist_update_dl_thread();
274
275 downloading = FALSE;
276
277 return nullptr;
278}
279
280/**********************************************************************/
283 static void gui_download_modpack(const char *URL)
284{
285 GThread *downloader;
286 char *URLbuf;
287
288 if (downloading) {
289 gtk_label_set_text(GTK_LABEL(statusbar),
290 _("Another download already active"));
291 return;
292 }
293
294 downloading = TRUE;
295
296 URLbuf = fc_malloc(strlen(URL) + 1);
297
298 strcpy(URLbuf, URL);
299
300 downloader = g_thread_new("Downloader", download_thread, URLbuf);
301 if (downloader == nullptr) {
302 gtk_label_set_text(GTK_LABEL(statusbar),
303 _("Failed to start downloader"));
304 free(URLbuf);
305 } else {
306 g_thread_unref(downloader);
307 }
308}
309
310/**********************************************************************/
313 static void install_clicked(GtkWidget *w, gpointer data)
314{
315 GtkEntry *URL_in = data;
316 GtkEntryBuffer *buffer = gtk_entry_get_buffer(URL_in);
317 const char *URL = gtk_entry_buffer_get_text(buffer);
318
319 gui_download_modpack(URL);
320}
321
322/**********************************************************************/
325 static void URL_return(GtkEntry *w, gpointer data)
326{
327 const char *URL;
328 GtkEntryBuffer *buffer = gtk_entry_get_buffer(w);
329
330 URL = gtk_entry_buffer_get_text(buffer);
331 gui_download_modpack(URL);
332}
333
334/**********************************************************************/
337 static gboolean query_main_list_tooltip_cb(GtkWidget *widget,
338 gint x, gint y,
339 gboolean keyboard_tip,
340 GtkTooltip *tooltip,
341 gpointer data)
342{
343 GtkTreeIter iter;
344 GtkTreeView *tree_view = GTK_TREE_VIEW(widget);
345 GtkTreeModel *model;
346 const char *notes;
347
348 if (!gtk_tree_view_get_tooltip_context(tree_view, x, y,
349 keyboard_tip,
350 &model, nullptr, &iter)) {
351 return FALSE;
352 }
353
354 gtk_tree_model_get(model, &iter,
355 ML_NOTES, &notes,
356 -1);
357
358 if (notes != nullptr) {
359 gtk_tooltip_set_markup(tooltip, notes);
360
361 return TRUE;
362 }
363
364 return FALSE;
365}
366
367/**********************************************************************/
370 static void setup_modpack_list(const char *name, const char *URL,
371 const char *version, const char *license,
372 enum modpack_type type, const char *subtype,
373 const char *notes)
374{
375 GtkTreeIter iter;
376 const char *type_str;
377 const char *lic_str;
378 const char *inst_str;
379
380 if (modpack_type_is_valid(type)) {
381 type_str = _(modpack_type_name(type));
382 } else {
383 /* TRANS: Unknown modpack type */
384 type_str = _("?");
385 }
386
387 if (license != nullptr) {
388 lic_str = license;
389 } else {
390 /* TRANS: License of modpack is not known */
391 lic_str = Q_("?license:Unknown");
392 }
393
394 inst_str = mpdb_installed_version(name, type);
395 if (inst_str == nullptr) {
396 inst_str = _("Not installed");
397 }
398
399 gtk_list_store_append(main_store, &iter);
400 gtk_list_store_set(main_store, &iter,
401 ML_COL_NAME, name,
402 ML_COL_VER, version,
403 ML_COL_INST, inst_str,
404 ML_COL_TYPE, type_str,
405 ML_COL_SUBTYPE, subtype,
406 ML_COL_LIC, lic_str,
407 ML_COL_URL, URL,
408 ML_TYPE, type,
409 ML_NOTES, notes,
410 -1);
411}
412
413/**********************************************************************/
416 static void select_from_list(GtkTreeSelection *select, gpointer data)
417{
418 GtkTreeModel *model;
419 GtkTreeIter it;
420 const char *URL;
421 GtkEntryBuffer *buffer;
422
423 if (!gtk_tree_selection_get_selected(select, &model, &it)) {
424 return;
425 }
426
427 gtk_tree_model_get(model, &it, ML_COL_URL, &URL, -1);
428
429 buffer = gtk_entry_get_buffer(GTK_ENTRY(URL_input));
430 gtk_entry_buffer_set_text(buffer, URL, -1);
431}
432
433/**********************************************************************/
436 static void modinst_setup_widgets(void)
437{
438 GtkWidget *mbox, *Ubox;
439 GtkWidget *version_label;
440 GtkWidget *install_button;
441 GtkWidget *URL_label;
442 GtkCellRenderer *renderer;
443 GtkTreeSelection *selection;
444 const char *errmsg;
445 char verbuf[2048];
446 const char *rev_ver;
447
448 mbox = gtk_grid_new();
449 gtk_orientable_set_orientation(GTK_ORIENTABLE(mbox),
450 GTK_ORIENTATION_VERTICAL);
451 gtk_grid_set_row_spacing(GTK_GRID(mbox), 4);
452
453 rev_ver = fc_git_revision();
454
455 if (rev_ver == nullptr) {
456 fc_snprintf(verbuf, sizeof(verbuf), "%s%s", word_version(), VERSION_STRING);
457 } else {
458 fc_snprintf(verbuf, sizeof(verbuf), _("%s%s\ncommit: %s"),
459 word_version(), VERSION_STRING, rev_ver);
460 }
461
462 version_label = gtk_label_new(verbuf);
463
464 main_list = gtk_tree_view_new();
465 renderer = gtk_cell_renderer_text_new();
466 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
467 ML_COL_NAME,
468 _("Name"), renderer, "text", 0,
469 nullptr);
470 renderer = gtk_cell_renderer_text_new();
471 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
472 ML_COL_VER,
473 _("Version"), renderer, "text", 1,
474 nullptr);
475 renderer = gtk_cell_renderer_text_new();
476 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
477 ML_COL_INST,
478 _("Installed"), renderer, "text", 2,
479 nullptr);
480 renderer = gtk_cell_renderer_text_new();
481 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
482 ML_COL_TYPE,
483 Q_("?modpack:Type"),
484 renderer, "text", 3,
485 nullptr);
486 renderer = gtk_cell_renderer_text_new();
487 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
488 ML_COL_SUBTYPE,
489 _("Subtype"),
490 renderer, "text", 4,
491 nullptr);
492 renderer = gtk_cell_renderer_text_new();
493 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
494 ML_COL_LIC,
495 /* TRANS: noun */
496 _("License"), renderer, "text", 5,
497 nullptr);
498 renderer = gtk_cell_renderer_text_new();
499 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(main_list),
500 ML_COL_URL,
501 _("URL"), renderer, "text", 6,
502 nullptr);
503 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(main_list));
504 g_signal_connect(selection, "changed", G_CALLBACK(select_from_list), nullptr);
505
506 install_button = gtk_button_new();
507 gtk_button_set_label(GTK_BUTTON(install_button), _("Install modpack"));
508
509 Ubox = gtk_grid_new();
510 gtk_widget_set_halign(Ubox, GTK_ALIGN_CENTER);
511 gtk_grid_set_column_spacing(GTK_GRID(Ubox), 4);
512 URL_label = gtk_label_new_with_mnemonic(_("Modpack URL"));
513
514 URL_input = gtk_entry_new();
515 gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(URL_input)),
516 DEFAULT_URL_START, -1);
517 g_signal_connect(URL_input, "activate",
518 G_CALLBACK(URL_return), nullptr);
519
520 g_signal_connect(install_button, "clicked",
521 G_CALLBACK(install_clicked), URL_input);
522
523 gtk_grid_attach(GTK_GRID(Ubox), URL_label, 0, 0, 1, 1);
524 gtk_grid_attach(GTK_GRID(Ubox), URL_input, 0, 1, 1, 1);
525
526 progressbar = gtk_progress_bar_new();
527
528 statusbar = gtk_label_new(_("Select modpack to install"));
529
530 gtk_widget_set_hexpand(main_list, TRUE);
531 gtk_widget_set_vexpand(main_list, TRUE);
532
533 gtk_grid_attach(GTK_GRID(mbox), version_label, 0, 0, 1, 1);
534 gtk_grid_attach(GTK_GRID(mbox), main_list, 0, 1, 1, 1);
535 gtk_grid_attach(GTK_GRID(mbox), Ubox, 0, 2, 1, 1);
536 gtk_grid_attach(GTK_GRID(mbox), install_button, 0, 3, 1, 1);
537 gtk_grid_attach(GTK_GRID(mbox), progressbar, 0, 4, 1, 1);
538 gtk_grid_attach(GTK_GRID(mbox), statusbar, 0, 5, 1, 1);
539
540 gtk_window_set_child(GTK_WINDOW(toplevel), mbox);
541
542 main_store = gtk_list_store_new((ML_STORE_SIZE), G_TYPE_STRING, G_TYPE_STRING,
543 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
544 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
545 G_TYPE_STRING);
546 errmsg = download_modpack_list(&fcmp, setup_modpack_list, msg_callback);
547 gtk_tree_view_set_model(GTK_TREE_VIEW(main_list), GTK_TREE_MODEL(main_store));
548
549 g_object_set(main_list, "has-tooltip", TRUE, nullptr);
550 g_signal_connect(main_list, "query-tooltip",
551 G_CALLBACK(query_main_list_tooltip_cb), nullptr);
552
553 g_object_unref(main_store);
554
555 if (errmsg != nullptr) {
556 gtk_label_set_text(GTK_LABEL(statusbar), errmsg);
557 }
558}
559
560/**********************************************************************/
563 static void activate_gui(GtkApplication *app, gpointer data)
564{
565 quit_dialog = nullptr;
566
567 toplevel = gtk_application_window_new(app);
568
569 gtk_widget_realize(toplevel);
570 gtk_widget_set_name(toplevel, "Freeciv-modpack");
571 gtk_window_set_title(GTK_WINDOW(toplevel),
572 _("Freeciv modpack installer (gtk4x)"));
573
574#if 0
575 /* Keep the icon of the executable on Windows */
576#ifndef FREECIV_MSWINDOWS
577 {
578 /* Unlike main client, this only works if installed. Ignore any
579 * errors loading the icon. */
580 GError *err;
581
582 (void) gtk_window_set_icon_from_file(GTK_WINDOW(toplevel),
583 MPICON_PATH, &err);
584 }
585#endif /* FREECIV_MSWINDOWS */
586#endif /* 0 */
587
588 g_signal_connect(toplevel, "close_request",
589 G_CALLBACK(quit_dialog_callback), nullptr);
590
591 modinst_setup_widgets();
592
593 gtk_widget_set_visible(toplevel, TRUE);
594
595 if (fcmp.autoinstall != nullptr) {
596 gui_download_modpack(fcmp.autoinstall);
597 }
598}
599
600/**********************************************************************/
603 int main(int argc, char *argv[])
604{
605 int ui_options;
606
607 fcmp_init();
608
609 /* This modifies argv! */
610 ui_options = fcmp_parse_cmdline(argc, argv);
611
612 if (ui_options != -1) {
613 int i;
614
615 for (i = 1; i <= ui_options; i++) {
616 if (is_option("--help", argv[i])) {
617 /* TRANS: No full stop after the URL, could cause confusion. */
618 fc_fprintf(stderr, _("Report bugs at %s\n"), BUG_URL);
619
620 ui_options = -1;
621 }
622 }
623 }
624
625 if (ui_options != -1) {
626 load_install_info_lists(&fcmp);
627
628 if (gtk_init_check()) {
629 fcmp_app = gtk_application_new(nullptr, 0);
630 g_signal_connect(fcmp_app, "activate",
631 G_CALLBACK(activate_gui), nullptr);
632 g_application_run(G_APPLICATION(fcmp_app), 0, nullptr);
633
634 g_object_unref(fcmp_app);
635 } else {
636 log_fatal(_("Failed to open graphical mode."));
637 }
638
639 close_mpdbs();
640 }
641
642 fcmp_deinit();
643 cmdline_option_values_free();
644
645 return EXIT_SUCCESS;
646}
incite_cost
char * incite_cost
Definition comments.c:74
download_modpack
const char * download_modpack(const char *URL, const struct fcmp_params *fcmp, dl_msg_callback mcb, dl_pb_callback pbcb)
Definition download.c:66
download_modpack_list
const char * download_modpack_list(const struct fcmp_params *fcmp, modpack_list_setup_cb cb, dl_msg_callback mcb)
Definition download.c:427
download.h
is_option
bool is_option(const char *option_name, char *option)
Definition fc_cmdline.c:112
cmdline_option_values_free
void cmdline_option_values_free(void)
Definition fc_cmdline.c:97
fc_cmdline.h
fciconv.h
fc_fprintf
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
_
#define _(String)
Definition fcintl.h:67
tooltip
const char * tooltip
Definition repodlgs.c:1315
type
GType type
Definition repodlgs.c:1313
name
const char * name
Definition inputfile.c:127
log.h
log_verbose
#define log_verbose(message,...)
Definition log.h:109
log_fatal
#define log_fatal(message,...)
Definition log.h:100
mem.h
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
fc_strdup
#define fc_strdup(str)
Definition mem.h:43
fc_malloc
#define fc_malloc(sz)
Definition mem.h:34
load_install_info_lists
void load_install_info_lists(struct fcmp_params *fcmp)
Definition modinst.c:44
fcmp_deinit
void fcmp_deinit(void)
Definition modinst.c:98
fcmp_init
void fcmp_init(void)
Definition modinst.c:82
modinst.h
DEFAULT_URL_START
#define DEFAULT_URL_START
Definition modinst.h:32
MODPACK_LIST_URL
#define MODPACK_LIST_URL
Definition modinst.h:30
fcmp_parse_cmdline
int fcmp_parse_cmdline(int argc, char *argv[])
Definition mpcmdline.c:45
mpcmdline.h
mpdb_installed_version
const char * mpdb_installed_version(const char *name, enum modpack_type type)
Definition mpdb.c:253
close_mpdbs
void close_mpdbs(void)
Definition mpdb.c:202
mpdb.h
ML_COL_SUBTYPE
#define ML_COL_SUBTYPE
Definition mpgui_gtk5.c:62
msg_dl_thread
static void msg_dl_thread(const char *msg)
Definition mpgui_gtk5.c:170
ML_TYPE
#define ML_TYPE
Definition mpgui_gtk5.c:68
main
int main(int argc, char *argv[])
Definition mpgui_gtk5.c:603
ML_NOTES
#define ML_NOTES
Definition mpgui_gtk5.c:69
quit_dialog_callback
static gboolean quit_dialog_callback(void)
Definition mpgui_gtk5.c:100
statusbar
static GtkWidget * statusbar
Definition mpgui_gtk5.c:40
query_main_list_tooltip_cb
static gboolean query_main_list_tooltip_cb(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer data)
Definition mpgui_gtk5.c:337
select_from_list
static void select_from_list(GtkTreeSelection *select, gpointer data)
Definition mpgui_gtk5.c:416
ML_STORE_SIZE
#define ML_STORE_SIZE
Definition mpgui_gtk5.c:70
main_store
static GtkListStore * main_store
Definition mpgui_gtk5.c:43
versionlist_update_main_thread
static gboolean versionlist_update_main_thread(gpointer user_data)
Definition mpgui_gtk5.c:214
activate_gui
static void activate_gui(GtkApplication *app, gpointer data)
Definition mpgui_gtk5.c:563
ML_COL_NAME
#define ML_COL_NAME
Definition mpgui_gtk5.c:58
toplevel
static GtkWidget * toplevel
Definition mpgui_gtk5.c:39
modinst_quit
static void modinst_quit(void)
Definition mpgui_gtk5.c:75
ML_COL_LIC
#define ML_COL_LIC
Definition mpgui_gtk5.c:63
pbar_callback
static void pbar_callback(int downloaded, int max)
Definition mpgui_gtk5.c:140
URL_return
static void URL_return(GtkEntry *w, gpointer data)
Definition mpgui_gtk5.c:325
URL_input
static GtkWidget * URL_input
Definition mpgui_gtk5.c:44
fcmp
struct fcmp_params fcmp
Definition mpgui_gtk5.c:48
downloading
static gboolean downloading
Definition mpgui_gtk5.c:46
progressbar
static GtkWidget * progressbar
Definition mpgui_gtk5.c:41
gui_download_modpack
static void gui_download_modpack(const char *URL)
Definition mpgui_gtk5.c:283
msg_main_thread
static gboolean msg_main_thread(gpointer user_data)
Definition mpgui_gtk5.c:155
install_clicked
static void install_clicked(GtkWidget *w, gpointer data)
Definition mpgui_gtk5.c:313
quit_dialog
static GtkAlertDialog * quit_dialog
Definition mpgui_gtk5.c:45
ML_COL_TYPE
#define ML_COL_TYPE
Definition mpgui_gtk5.c:61
setup_modpack_list
static void setup_modpack_list(const char *name, const char *URL, const char *version, const char *license, enum modpack_type type, const char *subtype, const char *notes)
Definition mpgui_gtk5.c:370
fcmp_app
static GtkApplication * fcmp_app
Definition mpgui_gtk5.c:54
pbar_dl_thread
static void pbar_dl_thread(int current, int max)
Definition mpgui_gtk5.c:201
msg_callback
static void msg_callback(const char *msg)
Definition mpgui_gtk5.c:131
ML_COL_INST
#define ML_COL_INST
Definition mpgui_gtk5.c:60
main_list
static GtkWidget * main_list
Definition mpgui_gtk5.c:42
quit_dialog_response
static void quit_dialog_response(GObject *dialog, GAsyncResult *result, gpointer data)
Definition mpgui_gtk5.c:84
modinst_setup_widgets
static void modinst_setup_widgets(void)
Definition mpgui_gtk5.c:436
versionlist_update_dl_thread
static void versionlist_update_dl_thread(void)
Definition mpgui_gtk5.c:251
ML_COL_URL
#define ML_COL_URL
Definition mpgui_gtk5.c:64
pbar_main_thread
static gboolean pbar_main_thread(gpointer user_data)
Definition mpgui_gtk5.c:187
ML_COL_VER
#define ML_COL_VER
Definition mpgui_gtk5.c:59
download_thread
static gpointer download_thread(gpointer data)
Definition mpgui_gtk5.c:259
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
fcmp_params
Definition modinst.h:17
fcmp_params::list_url
const char * list_url
Definition modinst.h:18
fcmp_params::autoinstall
const char * autoinstall
Definition modinst.h:20
msg_data
Definition mpgui_gtk3.c:144
msg_data::msg
char * msg
Definition mpgui_gtk3.c:145
pbar_data
Definition mpgui_gtk3.c:175
pbar_data::max
int max
Definition mpgui_gtk3.c:177
pbar_data::current
int current
Definition mpgui_gtk3.c:176
widget
Definition widget.h:112
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
fc_git_revision
const char * fc_git_revision(void)
Definition version.c:75
word_version
const char * word_version(void)
Definition version.c:62
version.h