430 GtkWidget *mbox, *Ubox;
431 GtkWidget *version_label;
432 GtkWidget *install_button, *install_label;
433 GtkWidget *URL_label;
434 GtkCellRenderer *renderer;
435 GtkTreeSelection *selection;
440 mbox = gtk_grid_new();
441 gtk_orientable_set_orientation(GTK_ORIENTABLE(mbox),
442 GTK_ORIENTATION_VERTICAL);
443 gtk_grid_set_row_spacing(GTK_GRID(mbox), 4);
447 if (rev_ver == NULL) {
450 fc_snprintf(verbuf,
sizeof(verbuf),
_(
"%s%s\ncommit: %s"),
454 version_label = gtk_label_new(verbuf);
457 renderer = gtk_cell_renderer_text_new();
458 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
460 _(
"Name"), renderer,
"text", 0,
462 renderer = gtk_cell_renderer_text_new();
463 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
465 _(
"Version"), renderer,
"text", 1,
467 renderer = gtk_cell_renderer_text_new();
468 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
470 _(
"Installed"), renderer,
"text", 2,
472 renderer = gtk_cell_renderer_text_new();
473 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
478 renderer = gtk_cell_renderer_text_new();
479 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
484 renderer = gtk_cell_renderer_text_new();
485 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
488 _(
"License"), renderer,
"text", 5,
490 renderer = gtk_cell_renderer_text_new();
491 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(
main_list),
493 _(
"URL"), renderer,
"text", 6,
495 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(
main_list));
498 install_button = gtk_button_new();
499 install_label = gtk_label_new(
_(
"Install modpack"));
500 gtk_label_set_mnemonic_widget(GTK_LABEL(install_label), install_button);
501 g_object_set_data(G_OBJECT(install_button),
"label", install_label);
502 gtk_container_add(GTK_CONTAINER(install_button), install_label);
504 Ubox = gtk_grid_new();
505 gtk_widget_set_halign(Ubox, GTK_ALIGN_CENTER);
506 gtk_grid_set_column_spacing(GTK_GRID(Ubox), 4);
507 URL_label = gtk_label_new_with_mnemonic(
_(
"Modpack URL"));
510 gtk_entry_set_width_chars(GTK_ENTRY(
URL_input),
516 g_signal_connect(install_button,
"clicked",
519 gtk_container_add(GTK_CONTAINER(Ubox), URL_label);
520 gtk_container_add(GTK_CONTAINER(Ubox),
URL_input);
524 statusbar = gtk_label_new(
_(
"Select modpack to install"));
529 gtk_container_add(GTK_CONTAINER(mbox), version_label);
530 gtk_container_add(GTK_CONTAINER(mbox),
main_list);
531 gtk_container_add(GTK_CONTAINER(mbox), Ubox);
532 gtk_container_add(GTK_CONTAINER(mbox), install_button);
533 gtk_container_add(GTK_CONTAINER(mbox),
progressbar);
534 gtk_container_add(GTK_CONTAINER(mbox),
statusbar);
536 gtk_container_add(GTK_CONTAINER(
toplevel), mbox);
539 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
540 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
546 g_signal_connect(
main_list,
"query-tooltip",
551 if (errmsg != NULL) {
552 gtk_label_set_text(GTK_LABEL(
statusbar), errmsg);