446 GtkWidget *mbox, *Ubox;
447 GtkWidget *version_label;
448 GtkWidget *install_button;
449 GtkWidget *URL_label;
450 GtkCellRenderer *renderer;
451 GtkTreeSelection *selection;
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);
463 if (rev_ver == NULL) {
466 fc_snprintf(verbuf,
sizeof(verbuf),
_(
"%s%s\ncommit: %s"),
470 version_label = gtk_label_new(verbuf);
473 renderer = gtk_cell_renderer_text_new();
474 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
476 _(
"Name"), renderer,
"text", 0,
478 renderer = gtk_cell_renderer_text_new();
479 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
481 _(
"Version"), renderer,
"text", 1,
483 renderer = gtk_cell_renderer_text_new();
484 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
486 _(
"Installed"), renderer,
"text", 2,
488 renderer = gtk_cell_renderer_text_new();
489 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
494 renderer = gtk_cell_renderer_text_new();
495 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
500 renderer = gtk_cell_renderer_text_new();
501 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
504 _(
"License"), renderer,
"text", 5,
506 renderer = gtk_cell_renderer_text_new();
507 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
509 _(
"URL"), renderer,
"text", 6,
511 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
main_list));
514 install_button = gtk_button_new();
515 gtk_button_set_label(GTK_BUTTON(install_button),
_(
"Install modpack"));
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"));
523 gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(
URL_input)),
528 g_signal_connect(install_button,
"clicked",
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);
536 statusbar = gtk_label_new(
_(
"Select modpack to install"));
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);
548 gtk_window_set_child(GTK_WINDOW(
toplevel), mbox);
551 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
552 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
558 g_signal_connect(
main_list,
"query-tooltip",
563 if (errmsg != NULL) {
564 gtk_label_set_text(GTK_LABEL(
statusbar), errmsg);