Freeciv-3.1: /fast/freeciv/nightly/S3_1/tools/fcmp/mpgui_gtk4.c Source File

Freeciv-3.1

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