From 9594c8518bf498cf36bd92e224896bc55048b469 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Wed, 17 Sep 2025 20:15:45 +0300
Subject: [PATCH 18/18] Drop gtk4x sources

Drop gtk4x-client and gtk4x modpack installer
completely from S3_3.

See RM #1686

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 bootstrap/org.freeciv.gtk4x.desktop           |   24 -
 bootstrap/org.freeciv.gtk4x.metainfo.xml.in   |   48 -
 bootstrap/org.freeciv.gtk4x.mp.desktop        |   12 -
 .../org.freeciv.gtk4x.mp.metainfo.xml.in      |   46 -
 client/gui-gtk-5.0/.gitignore                 |    1 -
 client/gui-gtk-5.0/Makefile.am                |  112 -
 client/gui-gtk-5.0/action_dialog.c            | 1880 -----
 client/gui-gtk-5.0/canvas.c                   |  426 --
 client/gui-gtk-5.0/canvas.h                   |   35 -
 client/gui-gtk-5.0/chatline.c                 | 1542 ----
 client/gui-gtk-5.0/chatline.h                 |   42 -
 client/gui-gtk-5.0/choice_dialog.c            |  249 -
 client/gui-gtk-5.0/choice_dialog.h            |   39 -
 client/gui-gtk-5.0/citizensinfo.c             |  394 -
 client/gui-gtk-5.0/citizensinfo.h             |   27 -
 client/gui-gtk-5.0/citydlg.c                  | 4019 ----------
 client/gui-gtk-5.0/citydlg.h                  |   22 -
 client/gui-gtk-5.0/cityrep.c                  | 2244 ------
 client/gui-gtk-5.0/cityrep.h                  |   21 -
 client/gui-gtk-5.0/cma_fe.c                   |  847 ---
 client/gui-gtk-5.0/cma_fe.h                   |   56 -
 client/gui-gtk-5.0/colors.c                   |   71 -
 client/gui-gtk-5.0/colors.h                   |   25 -
 client/gui-gtk-5.0/connectdlg.c               |   64 -
 client/gui-gtk-5.0/connectdlg.h               |   19 -
 client/gui-gtk-5.0/dialogs.c                  | 1696 -----
 client/gui-gtk-5.0/dialogs.h                  |   30 -
 client/gui-gtk-5.0/diplodlg.c                 | 1396 ----
 client/gui-gtk-5.0/diplodlg.h                 |   24 -
 client/gui-gtk-5.0/editgui.c                  | 1940 -----
 client/gui-gtk-5.0/editgui.h                  |   72 -
 client/gui-gtk-5.0/editprop.c                 | 6630 -----------------
 client/gui-gtk-5.0/editprop.h                 |   42 -
 client/gui-gtk-5.0/finddlg.c                  |  214 -
 client/gui-gtk-5.0/finddlg.h                  |   21 -
 client/gui-gtk-5.0/gamedlgs.c                 |  546 --
 client/gui-gtk-5.0/gamedlgs.h                 |   18 -
 client/gui-gtk-5.0/gotodlg.c                  |  549 --
 client/gui-gtk-5.0/gotodlg.h                  |   21 -
 client/gui-gtk-5.0/graphics.c                 |   82 -
 client/gui-gtk-5.0/graphics.h                 |   32 -
 client/gui-gtk-5.0/gui_main.c                 | 2748 -------
 client/gui-gtk-5.0/gui_main.h                 |  110 -
 client/gui-gtk-5.0/gui_stuff.c                | 1201 ---
 client/gui-gtk-5.0/gui_stuff.h                |  177 -
 client/gui-gtk-5.0/happiness.c                |  340 -
 client/gui-gtk-5.0/happiness.h                |   29 -
 client/gui-gtk-5.0/helpdlg.c                  | 1817 -----
 client/gui-gtk-5.0/helpdlg.h                  |   21 -
 client/gui-gtk-5.0/infradlg.c                 |  206 -
 client/gui-gtk-5.0/infradlg.h                 |   20 -
 client/gui-gtk-5.0/inputdlg.c                 |  104 -
 client/gui-gtk-5.0/inputdlg.h                 |   26 -
 client/gui-gtk-5.0/inteldlg.c                 |  879 ---
 client/gui-gtk-5.0/inteldlg.h                 |   26 -
 client/gui-gtk-5.0/luaconsole.c               |  505 --
 client/gui-gtk-5.0/luaconsole.h               |   24 -
 client/gui-gtk-5.0/mapctrl.c                  |  523 --
 client/gui-gtk-5.0/mapctrl.h                  |   49 -
 client/gui-gtk-5.0/mapview.c                  |  800 --
 client/gui-gtk-5.0/mapview.h                  |   62 -
 client/gui-gtk-5.0/menu.c                     | 4171 -----------
 client/gui-gtk-5.0/menu.h                     |   26 -
 client/gui-gtk-5.0/messagedlg.c               |  229 -
 client/gui-gtk-5.0/messagedlg.h               |   18 -
 client/gui-gtk-5.0/messagewin.c               |  459 --
 client/gui-gtk-5.0/messagewin.h               |   21 -
 client/gui-gtk-5.0/optiondlg.c                | 1099 ---
 client/gui-gtk-5.0/optiondlg.h                |   21 -
 client/gui-gtk-5.0/pages.c                    | 4145 -----------
 client/gui-gtk-5.0/pages.h                    |   44 -
 client/gui-gtk-5.0/plrdlg.c                   | 1119 ---
 client/gui-gtk-5.0/plrdlg.h                   |   27 -
 client/gui-gtk-5.0/rallypointdlg.c            |  197 -
 client/gui-gtk-5.0/rallypointdlg.h            |   22 -
 client/gui-gtk-5.0/ratesdlg.h                 |   21 -
 client/gui-gtk-5.0/repodlgs.c                 | 2017 -----
 client/gui-gtk-5.0/repodlgs.h                 |   23 -
 client/gui-gtk-5.0/soundset_dlg.c             |  138 -
 client/gui-gtk-5.0/spaceshipdlg.c             |  292 -
 client/gui-gtk-5.0/spaceshipdlg.h             |   24 -
 client/gui-gtk-5.0/sprite.c                   |  593 --
 client/gui-gtk-5.0/sprite.h                   |   42 -
 client/gui-gtk-5.0/theme_dlg.c                |   85 -
 client/gui-gtk-5.0/themes.c                   |  193 -
 client/gui-gtk-5.0/tileset_dlg.c              |   92 -
 client/gui-gtk-5.0/transportdlg.c             |  117 -
 client/gui-gtk-5.0/transportdlg.h             |   19 -
 client/gui-gtk-5.0/unitselect.c               | 1305 ----
 client/gui-gtk-5.0/unitselect.h               |   27 -
 client/gui-gtk-5.0/unitselextradlg.c          |  244 -
 client/gui-gtk-5.0/unitselextradlg.h          |   25 -
 client/gui-gtk-5.0/unitselunitdlg.c           |  201 -
 client/gui-gtk-5.0/unitselunitdlg.h           |   25 -
 client/gui-gtk-5.0/voteinfo_bar.c             |  320 -
 client/gui-gtk-5.0/voteinfo_bar.h             |   26 -
 client/gui-gtk-5.0/wldlg.c                    | 1799 -----
 client/gui-gtk-5.0/wldlg.h                    |   44 -
 tools/fcmp/mpgui_gtk5.c                       |  789 --
 99 files changed, 55304 deletions(-)
 delete mode 100644 bootstrap/org.freeciv.gtk4x.desktop
 delete mode 100644 bootstrap/org.freeciv.gtk4x.metainfo.xml.in
 delete mode 100644 bootstrap/org.freeciv.gtk4x.mp.desktop
 delete mode 100644 bootstrap/org.freeciv.gtk4x.mp.metainfo.xml.in
 delete mode 100644 client/gui-gtk-5.0/.gitignore
 delete mode 100644 client/gui-gtk-5.0/Makefile.am
 delete mode 100644 client/gui-gtk-5.0/action_dialog.c
 delete mode 100644 client/gui-gtk-5.0/canvas.c
 delete mode 100644 client/gui-gtk-5.0/canvas.h
 delete mode 100644 client/gui-gtk-5.0/chatline.c
 delete mode 100644 client/gui-gtk-5.0/chatline.h
 delete mode 100644 client/gui-gtk-5.0/choice_dialog.c
 delete mode 100644 client/gui-gtk-5.0/choice_dialog.h
 delete mode 100644 client/gui-gtk-5.0/citizensinfo.c
 delete mode 100644 client/gui-gtk-5.0/citizensinfo.h
 delete mode 100644 client/gui-gtk-5.0/citydlg.c
 delete mode 100644 client/gui-gtk-5.0/citydlg.h
 delete mode 100644 client/gui-gtk-5.0/cityrep.c
 delete mode 100644 client/gui-gtk-5.0/cityrep.h
 delete mode 100644 client/gui-gtk-5.0/cma_fe.c
 delete mode 100644 client/gui-gtk-5.0/cma_fe.h
 delete mode 100644 client/gui-gtk-5.0/colors.c
 delete mode 100644 client/gui-gtk-5.0/colors.h
 delete mode 100644 client/gui-gtk-5.0/connectdlg.c
 delete mode 100644 client/gui-gtk-5.0/connectdlg.h
 delete mode 100644 client/gui-gtk-5.0/dialogs.c
 delete mode 100644 client/gui-gtk-5.0/dialogs.h
 delete mode 100644 client/gui-gtk-5.0/diplodlg.c
 delete mode 100644 client/gui-gtk-5.0/diplodlg.h
 delete mode 100644 client/gui-gtk-5.0/editgui.c
 delete mode 100644 client/gui-gtk-5.0/editgui.h
 delete mode 100644 client/gui-gtk-5.0/editprop.c
 delete mode 100644 client/gui-gtk-5.0/editprop.h
 delete mode 100644 client/gui-gtk-5.0/finddlg.c
 delete mode 100644 client/gui-gtk-5.0/finddlg.h
 delete mode 100644 client/gui-gtk-5.0/gamedlgs.c
 delete mode 100644 client/gui-gtk-5.0/gamedlgs.h
 delete mode 100644 client/gui-gtk-5.0/gotodlg.c
 delete mode 100644 client/gui-gtk-5.0/gotodlg.h
 delete mode 100644 client/gui-gtk-5.0/graphics.c
 delete mode 100644 client/gui-gtk-5.0/graphics.h
 delete mode 100644 client/gui-gtk-5.0/gui_main.c
 delete mode 100644 client/gui-gtk-5.0/gui_main.h
 delete mode 100644 client/gui-gtk-5.0/gui_stuff.c
 delete mode 100644 client/gui-gtk-5.0/gui_stuff.h
 delete mode 100644 client/gui-gtk-5.0/happiness.c
 delete mode 100644 client/gui-gtk-5.0/happiness.h
 delete mode 100644 client/gui-gtk-5.0/helpdlg.c
 delete mode 100644 client/gui-gtk-5.0/helpdlg.h
 delete mode 100644 client/gui-gtk-5.0/infradlg.c
 delete mode 100644 client/gui-gtk-5.0/infradlg.h
 delete mode 100644 client/gui-gtk-5.0/inputdlg.c
 delete mode 100644 client/gui-gtk-5.0/inputdlg.h
 delete mode 100644 client/gui-gtk-5.0/inteldlg.c
 delete mode 100644 client/gui-gtk-5.0/inteldlg.h
 delete mode 100644 client/gui-gtk-5.0/luaconsole.c
 delete mode 100644 client/gui-gtk-5.0/luaconsole.h
 delete mode 100644 client/gui-gtk-5.0/mapctrl.c
 delete mode 100644 client/gui-gtk-5.0/mapctrl.h
 delete mode 100644 client/gui-gtk-5.0/mapview.c
 delete mode 100644 client/gui-gtk-5.0/mapview.h
 delete mode 100644 client/gui-gtk-5.0/menu.c
 delete mode 100644 client/gui-gtk-5.0/menu.h
 delete mode 100644 client/gui-gtk-5.0/messagedlg.c
 delete mode 100644 client/gui-gtk-5.0/messagedlg.h
 delete mode 100644 client/gui-gtk-5.0/messagewin.c
 delete mode 100644 client/gui-gtk-5.0/messagewin.h
 delete mode 100644 client/gui-gtk-5.0/optiondlg.c
 delete mode 100644 client/gui-gtk-5.0/optiondlg.h
 delete mode 100644 client/gui-gtk-5.0/pages.c
 delete mode 100644 client/gui-gtk-5.0/pages.h
 delete mode 100644 client/gui-gtk-5.0/plrdlg.c
 delete mode 100644 client/gui-gtk-5.0/plrdlg.h
 delete mode 100644 client/gui-gtk-5.0/rallypointdlg.c
 delete mode 100644 client/gui-gtk-5.0/rallypointdlg.h
 delete mode 100644 client/gui-gtk-5.0/ratesdlg.h
 delete mode 100644 client/gui-gtk-5.0/repodlgs.c
 delete mode 100644 client/gui-gtk-5.0/repodlgs.h
 delete mode 100644 client/gui-gtk-5.0/soundset_dlg.c
 delete mode 100644 client/gui-gtk-5.0/spaceshipdlg.c
 delete mode 100644 client/gui-gtk-5.0/spaceshipdlg.h
 delete mode 100644 client/gui-gtk-5.0/sprite.c
 delete mode 100644 client/gui-gtk-5.0/sprite.h
 delete mode 100644 client/gui-gtk-5.0/theme_dlg.c
 delete mode 100644 client/gui-gtk-5.0/themes.c
 delete mode 100644 client/gui-gtk-5.0/tileset_dlg.c
 delete mode 100644 client/gui-gtk-5.0/transportdlg.c
 delete mode 100644 client/gui-gtk-5.0/transportdlg.h
 delete mode 100644 client/gui-gtk-5.0/unitselect.c
 delete mode 100644 client/gui-gtk-5.0/unitselect.h
 delete mode 100644 client/gui-gtk-5.0/unitselextradlg.c
 delete mode 100644 client/gui-gtk-5.0/unitselextradlg.h
 delete mode 100644 client/gui-gtk-5.0/unitselunitdlg.c
 delete mode 100644 client/gui-gtk-5.0/unitselunitdlg.h
 delete mode 100644 client/gui-gtk-5.0/voteinfo_bar.c
 delete mode 100644 client/gui-gtk-5.0/voteinfo_bar.h
 delete mode 100644 client/gui-gtk-5.0/wldlg.c
 delete mode 100644 client/gui-gtk-5.0/wldlg.h
 delete mode 100644 tools/fcmp/mpgui_gtk5.c

diff --git a/bootstrap/org.freeciv.gtk4x.desktop b/bootstrap/org.freeciv.gtk4x.desktop
deleted file mode 100644
index 15014a4001..0000000000
--- a/bootstrap/org.freeciv.gtk4x.desktop
+++ /dev/null
@@ -1,24 +0,0 @@
-[Desktop Entry]
-Name=Freeciv
-Name[ca]=Freeciv
-Name[es]=Freeciv
-Name[fr]=Freeciv
-Name[nb]=Freeciv
-Name[pt]=Freeciv
-Name[ru]=Freeciv
-Comment=Turn-based strategy game inspired by the history of human civilization
-Comment[ca]=Joc d'estratègia inspirat en la història de la civilització humana
-Comment[da]=Strategispil inspireret af den menneskelige civilisations historie
-Comment[de]=Rundenbasiertes Strategiespiel, inspiriert durch die Geschichte der menschlichen Zivilisation
-Comment[fi]=Ihmiskunnan historian inspiroima vuoropohjainen strategiapeli
-Comment[nb]=Strategispill inspirert av historien til menneskelig sivilisasjon
-Comment[pt]=Jogo de estratégia por turnos inspirado na História da civilização humana
-Comment[ru]=Пошаговая стратегическая игра, вдохновлённая историей человеческой цивилизации
-Comment[sv]=Turordningsbaserat strategispel inspirerat av den mänskliga historien
-Exec=freeciv-gtk4x
-Icon=freeciv-client
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=GTK;Game;StrategyGame;
-Keywords=strategy;simulation;civilization;tiles;history;mankind;multiplayer;
diff --git a/bootstrap/org.freeciv.gtk4x.metainfo.xml.in b/bootstrap/org.freeciv.gtk4x.metainfo.xml.in
deleted file mode 100644
index d27d219c4a..0000000000
--- a/bootstrap/org.freeciv.gtk4x.metainfo.xml.in
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component type="desktop-application">
-    <name>Freeciv gtk4x client</name>
-    <id>org.freeciv.gtk4x</id>
-    <project_license>GPL-2.0-or-later</project_license>
-    <metadata_license>CC0</metadata_license>
-    <developer id="org.freeciv">
-      <name>Freeciv Team</name>
-    </developer>
-    <summary>Gtk4 based client for the Freeciv game</summary>
-    <description>
-        <p>
-            Freeciv is a Free and Open Source empire-building strategy game inspired by the history of human civilization. The game commences in prehistory and your
-            mission is to lead your tribe from the Stone Age to the Space Age...
-        </p>
-        <p>
-            This client for connecting to network games, or to launch local single-player games, is based on gtk4 widget set.
-        </p>
-    </description>
-    <launchable type="desktop-id">org.freeciv.gtk4x.desktop</launchable>
-
-    <url type="homepage">https://www.freeciv.org/</url>
-    <url type="bugtracker">https://osdn.net/projects/freeciv/ticket/</url>
-    <url type="faq">https://www.freeciv.org/wiki/FAQ</url>
-    <url type="donation">https://www.freeciv.org/donate.html</url>
-    <url type="translate">https://www.freeciv.org/wiki/Translations</url>
-    <url type="contact">https://www.freeciv.org/maillists.html</url>
-
-    <!-- flatpak does not understand these
-    <url type="vcs-browser">https://github.com/freeciv/freeciv/</url>
-    <url type="contribute">https://www.freeciv.org/wiki/How_to_Contribute</url>
-    -->
-
-    <releases>
-      [release]
-    </releases>
-
-    <content_rating type="oars-1.0">
-      <content_attribute id="social-chat">intense</content_attribute>
-    </content_rating>
-
-    <screenshots>
-      <screenshot type="default">
-        <image>https://files.freeciv.org/screenshots/3.1/client.gtk4-3.1.0-beta2.png</image>
-      </screenshot>
-    </screenshots>
-    <update_contact>freeciv-dev@freelists.org</update_contact>
-</component>
diff --git a/bootstrap/org.freeciv.gtk4x.mp.desktop b/bootstrap/org.freeciv.gtk4x.mp.desktop
deleted file mode 100644
index dfc1131803..0000000000
--- a/bootstrap/org.freeciv.gtk4x.mp.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Name=Freeciv modpack installer (gtk4x)
-Name[ru]=Установщик модпаков Freeciv (gtk4x)
-Comment=Download and install add-ons for Freeciv
-Comment[ru]=Скачивайте и устанавливайте дополнения для Freeciv
-Exec=freeciv-mp-gtk4x
-Icon=freeciv-modpack
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=GTK;Game;StrategyGame;
-Keywords=strategy;simulation;civilization;tiles;history;mankind;multiplayer;download;installer;
diff --git a/bootstrap/org.freeciv.gtk4x.mp.metainfo.xml.in b/bootstrap/org.freeciv.gtk4x.mp.metainfo.xml.in
deleted file mode 100644
index 98d951add9..0000000000
--- a/bootstrap/org.freeciv.gtk4x.mp.metainfo.xml.in
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component type="desktop-application">
-    <name>Freeciv gtk-4+ modpack installer</name>
-    <id>org.freeciv.gtk4x.mp</id>
-    <project_license>GPL-2.0-or-later</project_license>
-    <metadata_license>CC0</metadata_license>
-    <developer id="org.freeciv">
-      <name>Freeciv Team</name>
-    </developer>
-    <summary>Gtk-4 based modpack installer for the Freeciv game</summary>
-    <description>
-        <p>
-            Freeciv is a Free and Open Source empire-building strategy game inspired by the history of human civilization. The game commences in prehistory and your
-            mission is to lead your tribe from the Stone Age to the Space Age...
-        </p>
-        <p>
-            Freeciv modpack utility can be used to automatically download and install custom rulesets, tilesets, soundsets, and maps for freeciv to use.
-        </p>
-    </description>
-    <launchable type="desktop-id">org.freeciv.gtk4x.mp.desktop</launchable>
-
-    <url type="homepage">https://www.freeciv.org/</url>
-    <url type="bugtracker">https://osdn.net/projects/freeciv/ticket/</url>
-    <url type="faq">https://www.freeciv.org/wiki/FAQ</url>
-    <url type="donation">https://www.freeciv.org/donate.html</url>
-    <url type="translate">https://www.freeciv.org/wiki/Translations</url>
-    <url type="contact">https://www.freeciv.org/maillists.html</url>
-
-    <!-- flatpak does not understand these
-    <url type="vcs-browser">https://github.com/freeciv/freeciv/</url>
-    <url type="contribute">https://www.freeciv.org/wiki/How_to_Contribute</url>
-    -->
-
-    <releases>
-      [release]
-    </releases>
-
-    <content_rating type="oars-1.0" />
-
-    <screenshots>
-      <screenshot type="default">
-        <image>https://files.freeciv.org/screenshots/3.0/modinst.gtk4-3.0.6.png</image>
-      </screenshot>
-    </screenshots>
-    <update_contact>freeciv-dev@freelists.org</update_contact>
-</component>
diff --git a/client/gui-gtk-5.0/.gitignore b/client/gui-gtk-5.0/.gitignore
deleted file mode 100644
index 10a7e8d6c7..0000000000
--- a/client/gui-gtk-5.0/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/Makefile.in
diff --git a/client/gui-gtk-5.0/Makefile.am b/client/gui-gtk-5.0/Makefile.am
deleted file mode 100644
index 9d3f9b4038..0000000000
--- a/client/gui-gtk-5.0/Makefile.am
+++ /dev/null
@@ -1,112 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-noinst_LTLIBRARIES = libgui-gtk5.la
-AM_CPPFLAGS = \
-	-I$(srcdir)/.. \
-	-I$(srcdir)/../include \
-	-I$(top_srcdir)/utility \
-	-I$(top_srcdir)/common \
-	-I$(top_srcdir)/common/aicore \
-	-I$(top_srcdir)/common/networking \
-	-I$(top_srcdir)/common/scriptcore \
-	-I$(srcdir)/../agents \
-	-I$(srcdir)/../luascript \
-	-I$(top_srcdir)/dependencies/tinycthread \
-	-I$(top_srcdir)/gen_headers/enums \
-	$(gui_gtk5_cflags) $(SOUND_CFLAGS)
-
-libgui_gtk5_la_SOURCES = \
-	action_dialog.c \
-	canvas.c	\
-	canvas.h	\
-	chatline.h	\
-	chatline.c	\
-	choice_dialog.c	\
-	choice_dialog.h \
-	citizensinfo.c	\
-	citizensinfo.h	\
-	citydlg.c	\
-	citydlg.h	\
-	cityrep.c	\
-	cityrep.h	\
-	cma_fe.c	\
-	cma_fe.h	\
-	colors.c	\
-	colors.h	\
-	connectdlg.c	\
-	connectdlg.h	\
-	dialogs.c	\
-	dialogs.h	\
-	diplodlg.c	\
-	diplodlg.h	\
-	editgui.c	\
-	editgui.h	\
-	editprop.c	\
-	editprop.h	\
-	finddlg.c	\
-	finddlg.h	\
-	gamedlgs.c	\
-	gamedlgs.h	\
-	gotodlg.c	\
-	gotodlg.h	\
-	graphics.c	\
-	graphics.h	\
-	gui_main.c	\
-	gui_main.h	\
-	gui_stuff.c	\
-	gui_stuff.h	\
-	happiness.c	\
-	happiness.h	\
-	helpdlg.c	\
-	helpdlg.h	\
-	infradlg.c	\
-	infradlg.h	\
-	inputdlg.c	\
-	inputdlg.h	\
-	inteldlg.c	\
-	inteldlg.h	\
-	luaconsole.c	\
-	luaconsole.h	\
-	mapctrl.c	\
-	mapctrl.h	\
-	mapview.c	\
-	mapview.h	\
-	menu.c		\
-	menu.h		\
-	messagedlg.c	\
-	messagedlg.h	\
-	messagewin.c	\
-	messagewin.h	\
-	optiondlg.c	\
-	optiondlg.h	\
-	pages.c		\
-	pages.h		\
-	plrdlg.c	\
-	plrdlg.h	\
-	rallypointdlg.c	\
-	rallypointdlg.h	\
-	ratesdlg.h	\
-	repodlgs.c	\
-	repodlgs.h	\
-	soundset_dlg.c	\
-	spaceshipdlg.c	\
-	spaceshipdlg.h  \
-	sprite.c	\
-	sprite.h	\
-	theme_dlg.c	\
-	themes.c	\
-	tileset_dlg.c	\
-	transportdlg.c	\
-	transportdlg.h	\
-	unitselextradlg.c	\
-	unitselextradlg.h	\
-	unitselunitdlg.c	\
-	unitselunitdlg.h	\
-	unitselect.h	\
-	unitselect.c	\
-	voteinfo_bar.c	\
-	voteinfo_bar.h	\
-	wldlg.c		\
-	wldlg.h
-
-libgui_gtk5_la_LIBADD = -lm
diff --git a/client/gui-gtk-5.0/action_dialog.c b/client/gui-gtk-5.0/action_dialog.c
deleted file mode 100644
index bfa0e50c6a..0000000000
--- a/client/gui-gtk-5.0/action_dialog.c
+++ /dev/null
@@ -1,1880 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "astring.h"
-#include "support.h"
-
-/* common */
-#include "actions.h"
-#include "game.h"
-#include "traderoutes.h"
-#include "movement.h"
-#include "research.h"
-#include "unit.h"
-#include "unitlist.h"
-
-/* client */
-#include "dialogs_g.h"
-#include "chatline.h"
-#include "choice_dialog.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "connectdlg_common.h"
-#include "control.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-#include "packhand.h"
-#include "text.h"
-
-/* client/gui-gtk-5.0 */
-#include "citydlg.h"
-#include "dialogs.h"
-#include "unitselextradlg.h"
-#include "unitselunitdlg.h"
-#include "wldlg.h"
-
-/* Locations for non action enabler controlled buttons. */
-#define BUTTON_NEW_UNIT_TGT (ACTION_COUNT + 1)
-#define BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1)
-#define BUTTON_LOCATION (BUTTON_NEW_EXTRA_TGT + 1)
-#define BUTTON_WAIT (BUTTON_LOCATION + 1)
-#define BUTTON_CANCEL (BUTTON_WAIT + 1)
-#define BUTTON_COUNT (BUTTON_CANCEL + 1)
-
-#define BUTTON_NOT_THERE -1
-
-
-static GtkWidget *act_sel_dialog;
-static int action_button_map[BUTTON_COUNT];
-
-static int actor_unit_id;
-static int target_ids[ATK_COUNT];
-static int target_extra_id;
-static bool is_more_user_input_needed = FALSE;
-static bool did_not_decide = FALSE;
-static bool action_selection_restart = FALSE;
-
-static GtkWidget  *spy_tech_shell;
-
-static GtkWidget  *spy_sabotage_shell;
-
-/* A structure to hold parameters for actions inside the GUI instead of
- * storing the needed data in a global variable. */
-struct action_data {
-  action_id act_id;
-  int actor_unit_id;
-  int target_city_id;
-  int target_unit_id;
-  int target_tile_id;
-  int target_building_id;
-  int target_tech_id;
-  int target_extra_id;
-};
-
-/* TODO: Maybe this should be in the dialog itself? */
-static struct action_data *act_sel_dialog_data;
-
-#define FC_TYPE_ACTION_ROW (fc_action_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcActionRow, fc_action_row, FC, ACTION_ROW, GObject)
-
-struct _FcActionRow
-{
-  GObject parent_instance;
-
-  char *name;
-  int id;
-};
-
-struct _FcActionRowClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcActionRow, fc_action_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Finalizing method for FcActionRow
-**************************************************************************/
-static void fc_action_row_finalize(GObject *gobject)
-{
-  FcActionRow *row = FC_ACTION_ROW(gobject);
-
-  free(row->name);
-  row->name = nullptr;
-
-  G_OBJECT_CLASS(fc_action_row_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcActionRow class
-**************************************************************************/
-static void
-fc_action_row_class_init(FcActionRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_action_row_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcActionRow
-**************************************************************************/
-static void
-fc_action_row_init(FcActionRow *self)
-{
-  self->name = nullptr;
-}
-
-/**********************************************************************//**
-  FcActionRow creation method
-**************************************************************************/
-static FcActionRow *fc_action_row_new(void)
-{
-  FcActionRow *result;
-
-  result = g_object_new(FC_TYPE_ACTION_ROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  Create a new action data structure that can be stored in the
-  dialogs.
-**************************************************************************/
-static struct action_data *act_data(action_id act_id,
-                                    int actor_id,
-                                    int target_city_id,
-                                    int target_unit_id,
-                                    int target_tile_id,
-                                    int target_building_id,
-                                    int target_tech_id,
-                                    int tgt_extra_id)
-{
-  struct action_data *data = fc_malloc(sizeof(*data));
-
-  data->act_id = act_id;
-  data->actor_unit_id = actor_id;
-  data->target_city_id = target_city_id;
-  data->target_unit_id = target_unit_id;
-  data->target_tile_id = target_tile_id;
-  data->target_building_id = target_building_id;
-  data->target_tech_id = target_tech_id;
-  data->target_extra_id = tgt_extra_id;
-
-  return data;
-}
-
-/**********************************************************************//**
-  Move the queue of units that need user input forward unless the current
-  unit is going to need more input.
-**************************************************************************/
-static void diplomat_queue_handle_primary(void)
-{
-  if (!is_more_user_input_needed) {
-    /* The client isn't waiting for information for any unanswered follow
-     * up questions. */
-
-    struct unit *actor_unit;
-
-    if ((actor_unit = game_unit_by_number(actor_unit_id))) {
-      /* The action selection dialog wasn't closed because the actor unit
-       * was lost. */
-
-      /* The probabilities didn't just disappear, right? */
-      fc_assert_action(actor_unit->client.act_prob_cache,
-                       client_unit_init_act_prob_cache(actor_unit));
-
-      FC_FREE(actor_unit->client.act_prob_cache);
-    }
-
-    if (action_selection_restart) {
-      /* The action selection dialog was closed but only so it can be
-       * redrawn with fresh data. */
-
-      action_selection_restart = FALSE;
-    } else {
-      /* The action selection process is over, at least for now. */
-      action_selection_no_longer_in_progress(actor_unit_id);
-    }
-
-    if (did_not_decide) {
-      /* The action selection dialog was closed but the player didn't
-       * decide what the unit should do. */
-
-      /* Reset so the next action selection dialog does the right thing. */
-      did_not_decide = FALSE;
-    } else {
-      /* An action, or no action at all, was selected. */
-      action_decision_clear_want(actor_unit_id);
-      action_selection_next_in_focus(actor_unit_id);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Move the queue of units that need user input forward since the
-  current unit doesn't require the extra input any more.
-**************************************************************************/
-static void diplomat_queue_handle_secondary(void)
-{
-  /* Stop waiting. Move on to the next queued unit. */
-  is_more_user_input_needed = FALSE;
-  diplomat_queue_handle_primary();
-}
-
-/**********************************************************************//**
-  Let the non shared client code know that the action selection process
-  no longer is in progress for the specified unit.
-
-  This allows the client to clean up any client specific assumptions.
-**************************************************************************/
-void action_selection_no_longer_in_progress_gui_specific(int actor_id)
-{
-  /* Stop assuming the answer to a follow up question will arrive. */
-  is_more_user_input_needed = FALSE;
-}
-
-/**********************************************************************//**
-  Get the non targeted version of an action so it, if enabled, can appear
-  in the target selection dialog.
-**************************************************************************/
-static action_id get_non_targeted_action_id(action_id tgt_action_id)
-{
-  /* Don't add an action mapping here unless the non targeted version is
-   * selectable in the targeted version's target selection dialog. */
-  switch ((enum gen_action)tgt_action_id) {
-  case ACTION_SPY_TARGETED_SABOTAGE_CITY:
-    return ACTION_SPY_SABOTAGE_CITY;
-  case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
-    return ACTION_SPY_SABOTAGE_CITY_ESC;
-  case ACTION_SPY_TARGETED_STEAL_TECH:
-    return ACTION_SPY_STEAL_TECH;
-  case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
-    return ACTION_SPY_STEAL_TECH_ESC;
-  default:
-    /* No non targeted version found. */
-    return ACTION_NONE;
-  }
-}
-
-/**********************************************************************//**
-  Get the production targeted version of an action so it, if enabled, can
-  appear in the target selection dialog.
-**************************************************************************/
-static action_id get_production_targeted_action_id(action_id tgt_action_id)
-{
-  /* Don't add an action mapping here unless the non targeted version is
-   * selectable in the targeted version's target selection dialog. */
-  switch ((enum gen_action)tgt_action_id) {
-  case ACTION_SPY_TARGETED_SABOTAGE_CITY:
-    return ACTION_SPY_SABOTAGE_CITY_PRODUCTION;
-  case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
-    return ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC;
-  case ACTION_STRIKE_BUILDING:
-    return ACTION_STRIKE_PRODUCTION;
-  default:
-    /* No non targeted version found. */
-    return ACTION_NONE;
-  }
-}
-
-/**********************************************************************//**
-  User selected an action from the choice dialog and the action has no
-  special needs.
-**************************************************************************/
-static void simple_action_callback(GtkWidget *w, gpointer data)
-{
-  int actor_id, target_id, sub_target;
-  struct action *paction;
-
-  struct action_data *args = act_sel_dialog_data;
-
-  bool failed = FALSE;
-
-  /* Data */
-  args->act_id = GPOINTER_TO_INT(data);
-  paction = action_by_number(args->act_id);
-
-  /* Actor */
-  fc_assert(action_get_actor_kind(paction) == AAK_UNIT);
-  actor_id = args->actor_unit_id;
-  if (NULL == game_unit_by_number(actor_id)) {
-    /* Probably dead. */
-    failed = TRUE;
-  }
-
-  /* Target */
-  target_id = IDENTITY_NUMBER_ZERO;
-  switch (action_get_target_kind(paction)) {
-  case ATK_CITY:
-    target_id = args->target_city_id;
-    if (NULL == game_city_by_number(target_id)) {
-      /* Probably destroyed. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_UNIT:
-    target_id = args->target_unit_id;
-    if (NULL == game_unit_by_number(target_id)) {
-      /* Probably dead. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_STACK:
-  case ATK_TILE:
-  case ATK_EXTRAS:
-    target_id = args->target_tile_id;
-    if (NULL == index_to_tile(&(wld.map), target_id)) {
-      /* TODO: Should this be possible at all? If not: add assertion. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_SELF:
-    target_id = IDENTITY_NUMBER_ZERO;
-    break;
-  case ATK_COUNT:
-    fc_assert(action_get_target_kind(paction) != ATK_COUNT);
-    failed = TRUE;
-  }
-
-  /* Sub target. */
-  sub_target = NO_TARGET;
-  if (paction->target_complexity != ACT_TGT_COMPL_SIMPLE) {
-    switch (action_get_sub_target_kind(paction)) {
-    case ASTK_BUILDING:
-      sub_target = args->target_building_id;
-      if (NULL == improvement_by_number(sub_target)) {
-        /* Did the ruleset change? */
-        failed = TRUE;
-      }
-      break;
-    case ASTK_TECH:
-      sub_target = args->target_tech_id;
-      if (NULL == valid_advance_by_number(sub_target)) {
-        /* Did the ruleset change? */
-        failed = TRUE;
-      }
-      break;
-    case ASTK_EXTRA:
-    case ASTK_EXTRA_NOT_THERE:
-      /* TODO: Validate if the extra is there? */
-      sub_target = args->target_extra_id;
-      if (NULL == extra_by_number(sub_target)) {
-        /* Did the ruleset change? */
-        failed = TRUE;
-      }
-      break;
-    case ASTK_NONE:
-    case ASTK_COUNT:
-      /* Shouldn't happen. */
-      fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE);
-      failed = TRUE;
-      break;
-    }
-  }
-
-  /* Send request. */
-  if (!failed) {
-    request_do_action(paction->id, actor_id, target_id, sub_target, "");
-  }
-
-  /* Clean up. */
-  choice_dialog_destroy(act_sel_dialog);
-  /* No follow up questions. */
-  act_sel_dialog_data = NULL;
-  FC_FREE(args);
-}
-
-/**********************************************************************//**
-  User selected an action from the choice dialog that needs details from
-  the server.
-**************************************************************************/
-static void request_action_details_callback(GtkWidget *w, gpointer data)
-{
-  int actor_id, target_id;
-  struct action *paction;
-
-  struct action_data *args = act_sel_dialog_data;
-
-  bool failed = FALSE;
-
-  /* Data */
-  args->act_id = GPOINTER_TO_INT(data);
-  paction = action_by_number(args->act_id);
-
-  /* Actor */
-  fc_assert(action_get_actor_kind(paction) == AAK_UNIT);
-  actor_id = args->actor_unit_id;
-  if (NULL == game_unit_by_number(actor_id)) {
-    /* Probably dead. */
-    failed = TRUE;
-  }
-
-  /* Target */
-  target_id = IDENTITY_NUMBER_ZERO;
-  switch (action_get_target_kind(paction)) {
-  case ATK_CITY:
-    target_id = args->target_city_id;
-    if (NULL == game_city_by_number(target_id)) {
-      /* Probably destroyed. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_UNIT:
-    target_id = args->target_unit_id;
-    if (NULL == game_unit_by_number(target_id)) {
-      /* Probably dead. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_STACK:
-  case ATK_TILE:
-  case ATK_EXTRAS:
-    target_id = args->target_tile_id;
-    if (NULL == index_to_tile(&(wld.map), target_id)) {
-      /* TODO: Should this be possible at all? If not: add assertion. */
-      failed = TRUE;
-    }
-    break;
-  case ATK_SELF:
-    target_id = IDENTITY_NUMBER_ZERO;
-    break;
-  case ATK_COUNT:
-    fc_assert(action_get_target_kind(paction) != ATK_COUNT);
-    failed = TRUE;
-  }
-
-  /* Send request. */
-  if (!failed) {
-    request_action_details(paction->id, actor_id, target_id);
-  }
-
-  /* Wait for the server's reply before moving on to the next unit that
-   * needs to know what action to take. */
-  is_more_user_input_needed = TRUE;
-
-  /* Clean up. */
-  choice_dialog_destroy(act_sel_dialog);
-  /* No client side follow up questions. */
-  act_sel_dialog_data = NULL;
-  FC_FREE(args);
-}
-
-/**********************************************************************//**
-  User selected build city from the choice dialog
-**************************************************************************/
-static void found_city_callback(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = act_sel_dialog_data;
-
-  dsend_packet_city_name_suggestion_req(&client.conn,
-                                        args->actor_unit_id);
-
-  choice_dialog_destroy(act_sel_dialog);
-  free(args);
-}
-
-/**********************************************************************//**
-  User selected "Upgrade Unit" from choice dialog.
-**************************************************************************/
-static void upgrade_callback(GtkWidget *w, gpointer data)
-{
-  struct unit *punit;
-  struct action_data *args = act_sel_dialog_data;
-
-  if ((punit = game_unit_by_number(args->actor_unit_id))
-      && NULL != game_city_by_number(args->target_city_id)) {
-    struct unit_list *as_list;
-
-    as_list = unit_list_new();
-    unit_list_append(as_list, punit);
-    popup_upgrade_dialog(as_list);
-    unit_list_destroy(as_list);
-  }
-
-  choice_dialog_destroy(act_sel_dialog);
-  free(args);
-}
-
-/**********************************************************************//**
-  User responded to bribe unit dialog
-**************************************************************************/
-static void bribe_unit_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  if (response == GTK_RESPONSE_YES) {
-    request_do_action(args->act_id, args->actor_unit_id,
-                      args->target_unit_id, 0, "");
-  }
-
-  gtk_window_destroy(GTK_WINDOW(w));
-  free(args);
-
-  /* The user have answered the follow up question. Move on. */
-  diplomat_queue_handle_secondary();
-}
-
-/**********************************************************************//**
-  User responded to bribe stack dialog
-**************************************************************************/
-static void bribe_stack_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  if (response == GTK_RESPONSE_YES) {
-    request_do_action(args->act_id, args->actor_unit_id,
-                      args->target_tile_id, 0, "");
-  }
-
-  gtk_window_destroy(GTK_WINDOW(w));
-  free(args);
-
-  /* The user have answered the follow up question. Move on. */
-  diplomat_queue_handle_secondary();
-}
-
-/**********************************************************************//**
-  Popup unit bribe dialog
-**************************************************************************/
-void popup_bribe_unit_dialog(struct unit *actor, struct unit *punit, int cost,
-                             const struct action *paction)
-{
-  GtkWidget *shell;
-  char buf[1024];
-
-  fc_snprintf(buf, ARRAY_SIZE(buf), PL_("Treasury contains %d gold.",
-                                        "Treasury contains %d gold.",
-                                        client_player()->economic.gold),
-              client_player()->economic.gold);
-
-  if (cost <= client_player()->economic.gold) {
-    shell = gtk_message_dialog_new(NULL, 0,
-      GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Bribe unit for %d gold?\n%s",
-          "Bribe unit for %d gold?\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Bribe Enemy Unit"));
-    setup_dialog(shell, toplevel);
-  } else {
-    shell = gtk_message_dialog_new(NULL, 0,
-      GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Bribing the unit costs %d gold.\n%s",
-          "Bribing the unit costs %d gold.\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Traitors Demand Too Much!"));
-    setup_dialog(shell, toplevel);
-  }
-  gtk_window_present(GTK_WINDOW(shell));
-
-  g_signal_connect(shell, "response", G_CALLBACK(bribe_unit_response),
-                   act_data(paction->id, actor->id,
-                            0, punit->id, 0,
-                            0, 0, 0));
-}
-
-/**********************************************************************//**
-  Popup stack bribe dialog
-**************************************************************************/
-void popup_bribe_stack_dialog(struct unit *actor, struct tile *ptile, int cost,
-                             const struct action *paction)
-{
-  GtkWidget *shell;
-  char buf[1024];
-
-  fc_snprintf(buf, ARRAY_SIZE(buf), PL_("Treasury contains %d gold.",
-                                        "Treasury contains %d gold.",
-                                        client_player()->economic.gold),
-              client_player()->economic.gold);
-
-  if (cost <= client_player()->economic.gold) {
-    shell = gtk_message_dialog_new(NULL, 0,
-      GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Bribe unit stack for %d gold?\n%s",
-          "Bribe unit stack for %d gold?\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Bribe Enemy Stack"));
-    setup_dialog(shell, toplevel);
-  } else {
-    shell = gtk_message_dialog_new(NULL, 0,
-      GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Bribing units costs %d gold.\n%s",
-          "Bribing units costs %d gold.\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Traitors Demand Too Much!"));
-    setup_dialog(shell, toplevel);
-  }
-  gtk_window_present(GTK_WINDOW(shell));
-
-  g_signal_connect(shell, "response", G_CALLBACK(bribe_stack_response),
-                   act_data(paction->id, actor->id,
-                            0, 0, ptile->index,
-                            0, 0, 0));
-}
-
-/**********************************************************************//**
-  User responded to steal advances dialog
-**************************************************************************/
-static void spy_advances_response(GtkWidget *w, gint response,
-                                  gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  if (response == GTK_RESPONSE_ACCEPT && args->target_tech_id > 0) {
-    if (NULL != game_unit_by_number(args->actor_unit_id)
-        && NULL != game_city_by_number(args->target_city_id)) {
-      if (args->target_tech_id == A_UNSET) {
-        /* This is the untargeted version. */
-        request_do_action(get_non_targeted_action_id(args->act_id),
-                          args->actor_unit_id, args->target_city_id,
-                          args->target_tech_id, "");
-      } else {
-        /* This is the targeted version. */
-        request_do_action(args->act_id,
-                          args->actor_unit_id, args->target_city_id,
-                          args->target_tech_id, "");
-      }
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(spy_tech_shell));
-  spy_tech_shell = NULL;
-  free(data);
-
-  /* The user have answered the follow up question. Move on. */
-  diplomat_queue_handle_secondary();
-}
-
-/**********************************************************************//**
-  User selected entry in steal advances dialog
-**************************************************************************/
-static void spy_advances_callback(GtkSelectionModel *self,
-                                  guint position,
-                                  guint n_items,
-                                  gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-  FcActionRow *row = gtk_single_selection_get_selected_item(
-                                    GTK_SINGLE_SELECTION(self));
-
-  if (row != NULL) {
-    args->target_tech_id = row->id;
-
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell),
-      GTK_RESPONSE_ACCEPT, TRUE);
-  } else {
-    args->target_tech_id = 0;
-
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell),
-      GTK_RESPONSE_ACCEPT, FALSE);
-  }
-}
-
-/**********************************************************************//**
-  Action table cell bind function
-**************************************************************************/
-static void action_factory_bind(GtkSignalListItemFactory *self,
-                                GtkListItem *list_item,
-                                gpointer user_data)
-{
-  FcActionRow *row;
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(gtk_list_item_get_child(list_item)),
-                     row->name);
-}
-
-/**********************************************************************//**
-  Action table cell setup function
-**************************************************************************/
-static void action_factory_setup(GtkSignalListItemFactory *self,
-                                 GtkListItem *list_item,
-                                 gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Create spy's tech stealing dialog
-**************************************************************************/
-static void create_advances_list(struct player *pplayer,
-                                 struct player *pvictim,
-                                 struct action_data *args)
-{
-  GtkWidget *frame, *label, *vgrid;
-  GListStore *store;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-
-  struct unit *actor_unit = game_unit_by_number(args->actor_unit_id);
-
-  spy_tech_shell = gtk_dialog_new_with_buttons(_("Steal Technology"),
-                                               NULL, 0,
-                                               _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                               _("_Steal"), GTK_RESPONSE_ACCEPT,
-                                               NULL);
-  setup_dialog(spy_tech_shell, toplevel);
-
-  gtk_dialog_set_default_response(GTK_DIALOG(spy_tech_shell),
-                                  GTK_RESPONSE_ACCEPT);
-
-  frame = gtk_frame_new(_("Select Advance to Steal"));
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(spy_tech_shell))), frame);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 6);
-  gtk_frame_set_child(GTK_FRAME(frame), vgrid);
-
-  store = g_list_store_new(FC_TYPE_ACTION_ROW);
-
-  selection = gtk_single_selection_new(G_LIST_MODEL(store));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(action_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(action_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("Tech"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "mnemonic-widget", list,
-    "label", _("_Advances:"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-  gtk_grid_attach(GTK_GRID(vgrid), label, 0, 0, 1, 1);
-
-  gtk_grid_attach(GTK_GRID(vgrid), list, 0, 1, 1, 1);
-
-  /* Now populate the list */
-  if (pvictim) { /* You don't want to know what lag can do -- Syela */
-    const struct research *presearch = research_get(pplayer);
-    const struct research *vresearch = research_get(pvictim);
-    GValue value = { 0, };
-
-    advance_index_iterate(A_FIRST, i) {
-      if (research_invention_gettable(presearch, i,
-                                      game.info.tech_steal_allow_holes)
-          && research_invention_state(vresearch, i) == TECH_KNOWN
-          && research_invention_state(presearch, i) != TECH_KNOWN) {
-        FcActionRow *row = fc_action_row_new();
-
-        row->name = fc_strdup(research_advance_name_translation(presearch, i));
-        row->id = i;
-
-        g_list_store_append(store, row);
-        g_object_unref(row);
-      }
-    } advance_index_iterate_end;
-
-    if (action_prob_possible(actor_unit->client.act_prob_cache[
-                             get_non_targeted_action_id(args->act_id)])) {
-      FcActionRow *row = fc_action_row_new();
-
-      {
-        struct astring str = ASTRING_INIT;
-
-        /* TRANS: %s is a unit name, e.g., Spy */
-        astr_set(&str, _("At %s's Discretion"),
-                 unit_name_translation(actor_unit));
-        g_value_set_string(&value, astr_str(&str));
-
-        row->name = fc_strdup(astr_str(&str));
-
-        astr_free(&str);
-      }
-
-      row->id = A_UNSET;
-
-      g_list_store_append(store, row);
-      g_object_unref(row);
-    }
-  }
-
-  gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell),
-    GTK_RESPONSE_ACCEPT, FALSE);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(spy_tech_shell)),
-                         TRUE);
-
-  g_signal_connect(selection, "selection-changed",
-                   G_CALLBACK(spy_advances_callback), args);
-  g_signal_connect(spy_tech_shell, "response",
-                   G_CALLBACK(spy_advances_response), args);
-
-  args->target_tech_id = 0;
-}
-
-/**********************************************************************//**
-  User has responded to spy's sabotage building dialog
-**************************************************************************/
-static void spy_improvements_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  if (response == GTK_RESPONSE_ACCEPT && args->target_building_id > -2) {
-    if (NULL != game_unit_by_number(args->actor_unit_id)
-        && NULL != game_city_by_number(args->target_city_id)) {
-      if (args->target_building_id == B_LAST) {
-        /* This is the untargeted version. */
-        request_do_action(get_non_targeted_action_id(args->act_id),
-                          args->actor_unit_id,
-                          args->target_city_id,
-                          args->target_building_id, "");
-      } else if (args->target_building_id == -1) {
-        /* This is the city production version. */
-        request_do_action(get_production_targeted_action_id(args->act_id),
-                          args->actor_unit_id,
-                          args->target_city_id,
-                          args->target_building_id, "");
-      } else {
-        /* This is the targeted version. */
-        request_do_action(args->act_id,
-                          args->actor_unit_id,
-                          args->target_city_id,
-                          args->target_building_id, "");
-      }
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(spy_sabotage_shell));
-  spy_sabotage_shell = NULL;
-  free(args);
-
-  /* The user have answered the follow up question. Move on. */
-  diplomat_queue_handle_secondary();
-}
-
-/**********************************************************************//**
-  User has selected new building from spy's sabotage dialog
-**************************************************************************/
-static void spy_improvements_callback(GtkSelectionModel *self,
-                                      guint position,
-                                      guint n_items,
-                                      gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-  FcActionRow *row = gtk_single_selection_get_selected_item(
-                                    GTK_SINGLE_SELECTION(self));
-
-  if (row != NULL) {
-    args->target_building_id = row->id;
-
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_sabotage_shell),
-                                      GTK_RESPONSE_ACCEPT, TRUE);
-  } else {
-    args->target_building_id = -2;
-
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_sabotage_shell),
-                                      GTK_RESPONSE_ACCEPT, FALSE);
-  }
-}
-
-/**********************************************************************//**
-  Creates spy's building sabotaging dialog
-**************************************************************************/
-static void create_improvements_list(struct player *pplayer,
-                                     struct city *pcity,
-                                     struct action_data *args)
-{
-  GtkWidget *frame, *label, *vgrid;
-  GListStore *store;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-
-  struct unit *actor_unit = game_unit_by_number(args->actor_unit_id);
-
-  spy_sabotage_shell = gtk_dialog_new_with_buttons(_("Sabotage Improvements"),
-                                                   NULL, 0,
-                                                   _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                                   _("_Sabotage"), GTK_RESPONSE_ACCEPT,
-                                                   NULL);
-  setup_dialog(spy_sabotage_shell, toplevel);
-
-  gtk_dialog_set_default_response(GTK_DIALOG(spy_sabotage_shell),
-                                  GTK_RESPONSE_ACCEPT);
-
-  frame = gtk_frame_new(_("Select Improvement to Sabotage"));
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(spy_sabotage_shell))), frame);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 6);
-  gtk_frame_set_child(GTK_FRAME(frame), vgrid);
-
-  store = g_list_store_new(FC_TYPE_ACTION_ROW);
-
-  selection = gtk_single_selection_new(G_LIST_MODEL(store));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(action_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(action_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("Improvement"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "mnemonic-widget", list,
-    "label", _("_Improvements:"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-  gtk_grid_attach(GTK_GRID(vgrid), label, 0, 0, 1, 1);
-  gtk_grid_attach(GTK_GRID(vgrid), list, 0, 1, 1, 1);
-
-  /* Now populate the list */
-  if (action_prob_possible(actor_unit->client.act_prob_cache[
-                           get_production_targeted_action_id(
-                               args->act_id)])) {
-    FcActionRow *row = fc_action_row_new();
-
-    row->name = fc_strdup(_("City Production"));
-    row->id = -1;
-
-    g_list_store_append(store, row);
-    g_object_unref(row);
-  }
-
-  city_built_iterate(pcity, pimprove) {
-    if (pimprove->sabotage > 0) {
-      FcActionRow *row = fc_action_row_new();
-
-      row->name = fc_strdup(city_improvement_name_translation(pcity, pimprove));
-      row->id = improvement_number(pimprove);
-
-      g_list_store_append(store, row);
-      g_object_unref(row);
-    }
-  } city_built_iterate_end;
-
-  if (action_prob_possible(actor_unit->client.act_prob_cache[
-                           get_non_targeted_action_id(args->act_id)])) {
-    struct astring str = ASTRING_INIT;
-    FcActionRow *row = fc_action_row_new();
-
-    /* TRANS: %s is a unit name, e.g., Spy */
-    astr_set(&str, _("At %s's Discretion"),
-             unit_name_translation(actor_unit));
-
-    row->name = fc_strdup(astr_str(&str));
-    row->id = B_LAST;
-
-    g_list_store_append(store, row);
-    g_object_unref(row);
-
-    astr_free(&str);
-  }
-
-  gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_sabotage_shell),
-                                    GTK_RESPONSE_ACCEPT, FALSE);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(spy_sabotage_shell)),
-                         TRUE);
-
-  g_signal_connect(selection, "selection-changed",
-                   G_CALLBACK(spy_improvements_callback), args);
-  g_signal_connect(spy_sabotage_shell, "response",
-                   G_CALLBACK(spy_improvements_response), args);
-
-  args->target_building_id = -2;
-}
-
-/**********************************************************************//**
-  Popup tech stealing dialog with list of possible techs
-**************************************************************************/
-static void spy_steal_popup_shared(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  args->act_id = args->act_id;
-
-  struct city *pvcity = game_city_by_number(args->target_city_id);
-  struct player *pvictim = NULL;
-
-  if (pvcity) {
-    pvictim = city_owner(pvcity);
-  }
-
-/* It is concievable that pvcity will not be found, because something
-   has happened to the city during latency. Therefore we must initialize
-   pvictim to NULL and account for !pvictim in create_advances_list. -- Syela */
-
-  /* FIXME: Don't discard the second tech choice dialog. */
-  if (!spy_tech_shell) {
-    create_advances_list(client.conn.playing, pvictim, args);
-    gtk_window_present(GTK_WINDOW(spy_tech_shell));
-  } else {
-    free(args);
-  }
-
-  /* Wait for the player's reply before moving on to the next unit that
-   * needs to know what action to take. */
-  is_more_user_input_needed = TRUE;
-
-  choice_dialog_destroy(act_sel_dialog);
-}
-
-/**********************************************************************//**
-  Popup tech stealing dialog with list of possible techs for
-  "Targeted Steal Tech"
-**************************************************************************/
-static void spy_steal_popup(GtkWidget *w, gpointer data)
-{
-  act_sel_dialog_data->act_id = ACTION_SPY_TARGETED_STEAL_TECH;
-  spy_steal_popup_shared(w, act_sel_dialog_data);
-}
-
-/**********************************************************************//**
-  Popup tech stealing dialog with list of possible techs for
-  "Targeted Steal Tech Escape Expected"
-**************************************************************************/
-static void spy_steal_esc_popup(GtkWidget *w, gpointer data)
-{
-  act_sel_dialog_data->act_id = ACTION_SPY_TARGETED_STEAL_TECH_ESC;
-  spy_steal_popup_shared(w, act_sel_dialog_data);
-}
-
-/**********************************************************************//**
-  Pops-up the Spy sabotage dialog, upon return of list of
-  available improvements requested by the above function.
-**************************************************************************/
-void popup_sabotage_dialog(struct unit *actor, struct city *pcity,
-                           const struct action *paction)
-{
-  /* FIXME: Don't discard the second target choice dialog. */
-  if (!spy_sabotage_shell) {
-    create_improvements_list(client.conn.playing, pcity,
-                             act_data(paction->id,
-                                      actor->id, pcity->id, 0, 0,
-                                      0, 0, 0));
-    gtk_window_present(GTK_WINDOW(spy_sabotage_shell));
-  }
-}
-
-/**********************************************************************//**
-  User has responded to incite dialog
-**************************************************************************/
-static void incite_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct action_data *args = (struct action_data *)data;
-
-  if (response == GTK_RESPONSE_YES) {
-    request_do_action(args->act_id, args->actor_unit_id,
-                      args->target_city_id, 0, "");
-  }
-
-  gtk_window_destroy(GTK_WINDOW(w));
-  free(args);
-
-  /* The user have answered the follow up question. Move on. */
-  diplomat_queue_handle_secondary();
-}
-
-/**********************************************************************//**
-  Popup the yes/no dialog for inciting, since we know the cost now
-**************************************************************************/
-void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost,
-                         const struct action *paction)
-{
-  GtkWidget *shell;
-  char buf[1024];
-
-  fc_snprintf(buf, ARRAY_SIZE(buf), PL_("Treasury contains %d gold.",
-                                        "Treasury contains %d gold.",
-                                        client_player()->economic.gold),
-              client_player()->economic.gold);
-
-  if (INCITE_IMPOSSIBLE_COST == cost) {
-    shell = gtk_message_dialog_new(NULL, 0,
-                                   GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-                                   _("You can't incite a revolt in %s."),
-                                   city_name_get(pcity));
-    gtk_window_set_title(GTK_WINDOW(shell), _("City can't be incited!"));
-  setup_dialog(shell, toplevel);
-  } else if (cost <= client_player()->economic.gold) {
-    shell = gtk_message_dialog_new(NULL, 0,
-      GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Incite a revolt for %d gold?\n%s",
-          "Incite a revolt for %d gold?\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Incite a Revolt!"));
-    setup_dialog(shell, toplevel);
-  } else {
-    shell = gtk_message_dialog_new(NULL,
-      0,
-      GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-      /* TRANS: %s is pre-pluralised "Treasury contains %d gold." */
-      PL_("Inciting a revolt costs %d gold.\n%s",
-          "Inciting a revolt costs %d gold.\n%s", cost), cost, buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Traitors Demand Too Much!"));
-    setup_dialog(shell, toplevel);
-  }
-  gtk_window_present(GTK_WINDOW(shell));
-
-  g_signal_connect(shell, "response", G_CALLBACK(incite_response),
-                   act_data(paction->id, actor->id,
-                            pcity->id, 0, 0,
-                            0, 0, 0));
-}
-
-/**********************************************************************//**
-  Callback from the unit target selection dialog.
-**************************************************************************/
-static void tgt_unit_change_callback(GtkWidget *dlg, gint arg)
-{
-  int au_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg), "actor"));
-
-  if (arg == GTK_RESPONSE_YES) {
-    struct unit *actor = game_unit_by_number(au_id);
-
-    if (actor != NULL) {
-      int tgt_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
-                                                     "target"));
-      struct unit *tgt_unit = game_unit_by_number(tgt_id);
-      struct tile *tgt_tile = g_object_get_data(G_OBJECT(dlg), "tile");
-
-      if (tgt_unit == NULL) {
-        /* Make the action dialog pop up again. */
-        dsend_packet_unit_get_actions(&client.conn,
-                                      actor->id,
-                                      /* Let the server choose the target
-                                       * unit. */
-                                      IDENTITY_NUMBER_ZERO,
-                                      tgt_tile->index,
-                                      action_selection_target_extra(),
-                                      REQEST_PLAYER_INITIATED);
-      } else {
-        dsend_packet_unit_get_actions(&client.conn,
-                                      actor->id,
-                                      tgt_id,
-                                      tgt_tile->index,
-                                      action_selection_target_extra(),
-                                      REQEST_PLAYER_INITIATED);
-      }
-    }
-  } else {
-    /* Dialog canceled. This ends the action selection process. */
-    action_selection_no_longer_in_progress(au_id);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/**********************************************************************//**
-  Callback from action selection dialog for "Change unit target".
-**************************************************************************/
-static void act_sel_new_unit_tgt_callback(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = act_sel_dialog_data;
-
-  struct unit *punit;
-  struct unit *tunit;
-  struct tile *ptile;
-
-  if ((punit = game_unit_by_number(args->actor_unit_id))
-      && (ptile = index_to_tile(&(wld.map), args->target_tile_id))
-      && (tunit = game_unit_by_number(args->target_unit_id))) {
-    select_tgt_unit(punit, ptile, ptile->units, tunit,
-                    _("Target unit selection"),
-                    _("Looking for target unit:"),
-                    _("Units at tile:"),
-                    _("Select"),
-                    G_CALLBACK(tgt_unit_change_callback));
-  }
-
-  did_not_decide = TRUE;
-  action_selection_restart = TRUE;
-  choice_dialog_destroy(act_sel_dialog);
-  free(args);
-}
-
-/**********************************************************************//**
-  Callback from the extra target selection dialog.
-**************************************************************************/
-static void tgt_extra_change_callback(GtkWidget *dlg, gint arg)
-{
-  int au_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg), "actor"));
-
-  if (arg == GTK_RESPONSE_YES) {
-    struct unit *actor = game_unit_by_number(au_id);
-
-    if (actor != NULL) {
-      int tgt_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
-                                                     "target"));
-      struct extra_type *tgt_extra = extra_by_number(tgt_id);
-      struct tile *tgt_tile = g_object_get_data(G_OBJECT(dlg), "tile");
-
-      if (tgt_extra == NULL) {
-        /* Make the action dialog pop up again. */
-        dsend_packet_unit_get_actions(&client.conn,
-                                      actor->id,
-                                      action_selection_target_unit(),
-                                      tgt_tile->index,
-                                      /* Let the server choose the target
-                                       * extra. */
-                                      action_selection_target_extra(),
-                                      REQEST_PLAYER_INITIATED);
-      } else {
-        dsend_packet_unit_get_actions(&client.conn,
-                                      actor->id,
-                                      action_selection_target_unit(),
-                                      tgt_tile->index,
-                                      tgt_id,
-                                      REQEST_PLAYER_INITIATED);
-      }
-    }
-  } else {
-    /* Dialog canceled. This ends the action selection process. */
-    action_selection_no_longer_in_progress(au_id);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/**********************************************************************//**
-  Callback from action selection dialog for "Change extra target".
-**************************************************************************/
-static void act_sel_new_extra_tgt_callback(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = act_sel_dialog_data;
-
-  struct unit *act_unit;
-  struct extra_type *tgt_extra;
-  struct tile *tgt_tile;
-
-  if ((act_unit = game_unit_by_number(args->actor_unit_id))
-      && (tgt_tile = index_to_tile(&(wld.map), args->target_tile_id))
-      && (tgt_extra = extra_by_number(args->target_extra_id))) {
-    bv_extras potential_targets;
-
-    /* Start with the extras at the tile */
-    potential_targets = *tile_extras(tgt_tile);
-
-    extra_type_re_active_iterate(pextra) {
-      if (BV_ISSET(potential_targets, extra_number(pextra))) {
-        /* This extra is at the tile. Can anything be done to it? */
-        if (!utype_can_remove_extra(unit_type_get(act_unit),
-                                    pextra)) {
-          BV_CLR(potential_targets, extra_number(pextra));
-        }
-      } else {
-        /* This extra isn't at the tile yet. Can it be created? */
-        if (utype_can_create_extra(unit_type_get(act_unit),
-                                   pextra)) {
-          BV_SET(potential_targets, extra_number(pextra));
-        }
-      }
-    } extra_type_re_active_iterate_end;
-
-    select_tgt_extra(act_unit, tgt_tile, potential_targets, tgt_extra,
-                     /* TRANS: GTK action selection dialog extra target
-                      * selection dialog title. */
-                     _("Target extra selection"),
-                     /* TRANS: GTK action selection dialog extra target
-                      * selection dialog actor unit label. */
-                     _("Looking for target extra:"),
-                     /* TRANS: GTK action selection dialog extra target
-                      * selection dialog extra list label. */
-                     _("Extra targets:"),
-                     _("Select"),
-                     G_CALLBACK(tgt_extra_change_callback));
-  }
-
-  did_not_decide = TRUE;
-  action_selection_restart = TRUE;
-  choice_dialog_destroy(act_sel_dialog);
-  free(args);
-}
-
-/**********************************************************************//**
-  Callback from action selection dialog for "Show Location".
-**************************************************************************/
-static void act_sel_location_callback(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = act_sel_dialog_data;
-
-  struct unit *punit;
-
-  if ((punit = game_unit_by_number(args->actor_unit_id))) {
-    center_tile_mapcanvas(unit_tile(punit));
-  }
-}
-
-/**********************************************************************//**
-  Delay selection of what action to take.
-**************************************************************************/
-static void act_sel_wait_callback(GtkWidget *w, gpointer data)
-{
-  struct action_data *args = act_sel_dialog_data;
-
-  key_unit_wait();
-
-  /* The dialog was destroyed when key_unit_wait() resulted in
-   * action_selection_close() being called. */
-
-  free(args);
-}
-
-/**********************************************************************//**
-  Action selection dialog has been destroyed
-**************************************************************************/
-static void act_sel_destroy_callback(GtkWidget *w, gpointer data)
-{
-  act_sel_dialog = NULL;
-  diplomat_queue_handle_primary();
-}
-
-/**********************************************************************//**
-  Action selection dialog has been canceled
-**************************************************************************/
-static void act_sel_cancel_callback(GtkWidget *w, gpointer data)
-{
-  choice_dialog_destroy(act_sel_dialog);
-  free(act_sel_dialog_data);
-}
-
-/**********************************************************************//**
-  Action selection dialog has been closed
-**************************************************************************/
-static void act_sel_close_callback(GtkWidget *w, gpointer data)
-{
-  choice_dialog_destroy(act_sel_dialog);
-  free(act_sel_dialog_data);
-}
-
-/* Mapping from an action to the function to call when its button is
- * pushed. */
-static const GCallback af_map[ACTION_COUNT] = {
-  /* Unit acting against a city target. */
-  [ACTION_SPY_TARGETED_SABOTAGE_CITY] =
-      (GCallback)request_action_details_callback,
-  [ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC] =
-      (GCallback)request_action_details_callback,
-  [ACTION_SPY_TARGETED_STEAL_TECH] = (GCallback)spy_steal_popup,
-  [ACTION_SPY_TARGETED_STEAL_TECH_ESC] = (GCallback)spy_steal_esc_popup,
-  [ACTION_SPY_INCITE_CITY] = (GCallback)request_action_details_callback,
-  [ACTION_SPY_INCITE_CITY_ESC] = (GCallback)request_action_details_callback,
-  [ACTION_UPGRADE_UNIT] = (GCallback)upgrade_callback,
-  [ACTION_STRIKE_BUILDING] = (GCallback)request_action_details_callback,
-
-  /* Unit acting against a unit target. */
-  [ACTION_SPY_BRIBE_UNIT] = (GCallback)request_action_details_callback,
-
-  /* Unit acting against all units at a tile. */
-  [ACTION_SPY_BRIBE_STACK] = (GCallback)request_action_details_callback,
-
-  /* Unit acting against a tile. */
-  [ACTION_FOUND_CITY] = (GCallback)found_city_callback,
-
-  /* Unit acting with no target except itself. */
-  /* No special callback functions needed for any self targeted actions. */
-};
-
-/**********************************************************************//**
-  Show the user the action if it is enabled.
-**************************************************************************/
-static void action_entry(GtkWidget *shl,
-                         action_id act_id,
-                         const struct act_prob *act_probs,
-                         const char *custom,
-                         action_id act_num)
-{
-  const gchar *label;
-  const gchar *tooltip;
-  GCallback cb;
-
-  if (af_map[act_id] == NULL) {
-    /* No special call back function needed for this action. */
-    cb = (GCallback)simple_action_callback;
-  } else {
-    /* Special action specific callback function specified. */
-    cb = af_map[act_id];
-  }
-
-  /* Don't show disabled actions. */
-  if (!action_prob_possible(act_probs[act_id])) {
-    return;
-  }
-
-  label = action_prepare_ui_name(act_id, "_",
-                                 act_probs[act_id],
-                                 custom);
-
-  tooltip = act_sel_action_tool_tip(action_by_number(act_id),
-                                    act_probs[act_id]);
-
-  action_button_map[act_id] = choice_dialog_get_number_of_buttons(shl);
-  choice_dialog_add(shl, label, cb, GINT_TO_POINTER(act_num),
-                    FALSE, tooltip);
-}
-
-/**********************************************************************//**
-  Update an existing button.
-**************************************************************************/
-static void action_entry_update(GtkWidget *shl,
-                                action_id act_id,
-                                const struct act_prob *act_probs,
-                                const char *custom,
-                                action_id act_num)
-{
-  const gchar *label;
-  const gchar *tooltip;
-
-  /* An action that just became impossible has its button disabled.
-   * An action that became possible again must be re-enabled. */
-  choice_dialog_button_set_sensitive(act_sel_dialog,
-      action_button_map[act_id],
-      action_prob_possible(act_probs[act_id]));
-
-  /* The probability may have changed. */
-  label = action_prepare_ui_name(act_id, "_",
-                                 act_probs[act_id], custom);
-
-  tooltip = act_sel_action_tool_tip(action_by_number(act_id),
-                                    act_probs[act_id]);
-
-  choice_dialog_button_set_label(act_sel_dialog,
-                                 action_button_map[act_id],
-                                 label);
-  choice_dialog_button_set_tooltip(act_sel_dialog,
-                                   action_button_map[act_id],
-                                   tooltip);
-}
-
-/**********************************************************************//**
-  Popup a dialog that allows the player to select what action a unit
-  should take.
-**************************************************************************/
-void popup_action_selection(struct unit *actor_unit,
-                            struct city *target_city,
-                            struct unit *target_unit,
-                            struct tile *target_tile,
-                            struct extra_type *target_extra,
-                            const struct act_prob *act_probs)
-{
-  GtkWidget *shl;
-  struct astring title = ASTRING_INIT, text = ASTRING_INIT;
-  struct city *actor_homecity;
-
-  int button_id;
-
-  act_sel_dialog_data =
-      act_data(ACTION_ANY, /* Not decided yet */
-               actor_unit->id,
-               (target_city) ? target_city->id : IDENTITY_NUMBER_ZERO,
-               (target_unit) ? target_unit->id : IDENTITY_NUMBER_ZERO,
-               (target_tile) ? target_tile->index : TILE_INDEX_NONE,
-               /* No target_building or target_tech supplied. (Dec 2019) */
-               B_LAST, A_UNSET,
-               target_extra ? target_extra->id : EXTRA_NONE);
-
-  /* Could be caused by the server failing to reply to a request for more
-   * information or a bug in the client code. */
-  fc_assert_msg(!is_more_user_input_needed,
-                "Diplomat queue problem. Is another diplomat window open?");
-
-  /* No extra input is required as no action has been chosen yet. */
-  is_more_user_input_needed = FALSE;
-
-  /* No buttons are added yet. */
-  for (button_id = 0; button_id < BUTTON_COUNT; button_id++) {
-    action_button_map[button_id] = BUTTON_NOT_THERE;
-  }
-
-  actor_homecity = game_city_by_number(actor_unit->homecity);
-
-  actor_unit_id = actor_unit->id;
-  target_ids[ATK_SELF] = actor_unit_id;
-  target_ids[ATK_CITY] = target_city ?
-                         target_city->id :
-                         IDENTITY_NUMBER_ZERO;
-  target_ids[ATK_UNIT] = target_unit ?
-                         target_unit->id :
-                         IDENTITY_NUMBER_ZERO;
-  target_ids[ATK_STACK] = target_tile ?
-                          tile_index(target_tile) :
-                          TILE_INDEX_NONE;
-  target_ids[ATK_TILE] = target_tile ?
-                         tile_index(target_tile) :
-                         TILE_INDEX_NONE;
-  target_ids[ATK_EXTRAS] = target_tile ?
-                           tile_index(target_tile) :
-                           TILE_INDEX_NONE;
-  target_extra_id      = target_extra ?
-                         extra_number(target_extra) :
-                         EXTRA_NONE;
-
-  astr_set(&title,
-           /* TRANS: %s is a unit name, e.g., Spy */
-           _("Choose Your %s's Strategy"),
-           unit_name_translation(actor_unit));
-
-  if (target_city && actor_homecity) {
-    astr_set(&text,
-             _("Your %s from %s reaches the city of %s.\nWhat now?"),
-             unit_name_translation(actor_unit),
-             city_name_get(actor_homecity),
-             city_name_get(target_city));
-  } else if (target_city) {
-    astr_set(&text,
-             _("Your %s has arrived at %s.\nWhat is your command?"),
-             unit_name_translation(actor_unit),
-             city_name_get(target_city));
-  } else if (target_unit) {
-    astr_set(&text,
-             /* TRANS: Your Spy is ready to act against Roman Freight. */
-             _("Your %s is ready to act against %s %s."),
-             unit_name_translation(actor_unit),
-             nation_adjective_for_player(unit_owner(target_unit)),
-             unit_name_translation(target_unit));
-  } else {
-    fc_assert_msg(target_unit || target_city || target_tile,
-                  "No target specified.");
-    astr_set(&text,
-             /* TRANS: %s is a unit name, e.g., Diplomat, Spy */
-             _("Your %s is waiting for your command."),
-             unit_name_translation(actor_unit));
-  }
-
-  shl = choice_dialog_start(GTK_WINDOW(toplevel), astr_str(&title),
-                            astr_str(&text));
-
-  /* Unit acting against a city */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_CITY) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  /* Unit acting against another unit */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_UNIT) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  /* Unit acting against all units at a tile */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_STACK) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  /* Unit acting against a tile */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_TILE) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  /* Unit acting against a tile's extras */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_EXTRAS) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  /* Unit acting against itself. */
-
-  action_iterate(act) {
-    if (action_id_get_actor_kind(act) == AAK_UNIT
-        && action_id_get_target_kind(act) == ATK_SELF) {
-      action_entry(shl, act, act_probs,
-                   get_act_sel_action_custom_text(action_by_number(act),
-                                                  act_probs[act],
-                                                  actor_unit,
-                                                  target_city),
-                   act);
-    }
-  } action_iterate_end;
-
-  if (target_unit != NULL
-      && unit_list_size(target_tile->units) > 1) {
-    action_button_map[BUTTON_NEW_UNIT_TGT]
-      = choice_dialog_get_number_of_buttons(shl);
-    choice_dialog_add(shl, _("Change unit target"),
-                      (GCallback)act_sel_new_unit_tgt_callback,
-                      GINT_TO_POINTER(ACTION_NONE), TRUE, NULL);
-  }
-
-  if (target_extra != NULL) {
-    action_button_map[BUTTON_NEW_EXTRA_TGT]
-      = choice_dialog_get_number_of_buttons(shl);
-    choice_dialog_add(shl, _("Change extra target"),
-                      (GCallback)act_sel_new_extra_tgt_callback,
-                      GINT_TO_POINTER(ACTION_NONE), TRUE, NULL);
-  }
-
-  action_button_map[BUTTON_LOCATION]
-    = choice_dialog_get_number_of_buttons(shl);
-  choice_dialog_add(shl, _("Show Location"),
-                    (GCallback)act_sel_location_callback,
-                    GINT_TO_POINTER(ACTION_NONE),
-                    TRUE, NULL);
-
-  action_button_map[BUTTON_WAIT]
-    = choice_dialog_get_number_of_buttons(shl);
-  choice_dialog_add(shl, _("_Wait"),
-                    (GCallback)act_sel_wait_callback,
-                    GINT_TO_POINTER(ACTION_NONE),
-                    TRUE, NULL);
-
-  action_button_map[BUTTON_CANCEL]
-    = choice_dialog_get_number_of_buttons(shl);
-  choice_dialog_add(shl, _("_Cancel"),
-                    (GCallback)act_sel_cancel_callback,
-                    GINT_TO_POINTER(ACTION_NONE),
-                    FALSE, NULL);
-
-  choice_dialog_end(shl);
-
-  act_sel_dialog = shl;
-
-  choice_dialog_set_hide(shl, TRUE);
-  g_signal_connect(shl, "destroy",
-                   G_CALLBACK(act_sel_destroy_callback), NULL);
-  g_signal_connect(shl, "close-request",
-                   G_CALLBACK(act_sel_close_callback),
-                   GINT_TO_POINTER(ACTION_NONE));
-
-  /* Give follow up questions access to action probabilities. */
-  client_unit_init_act_prob_cache(actor_unit);
-  action_iterate(act) {
-    actor_unit->client.act_prob_cache[act] = act_probs[act];
-  } action_iterate_end;
-
-  astr_free(&title);
-  astr_free(&text);
-}
-
-/**********************************************************************//**
-  Returns the id of the actor unit currently handled in action selection
-  dialog when the action selection dialog is open.
-  Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open.
-**************************************************************************/
-int action_selection_actor_unit(void)
-{
-  if (act_sel_dialog == NULL) {
-    return IDENTITY_NUMBER_ZERO;
-  }
-  return actor_unit_id;
-}
-
-/**********************************************************************//**
-  Returns id of the target city of the actions currently handled in action
-  selection dialog when the action selection dialog is open and it has a
-  city target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
-  is open or no city target is present in the action selection dialog.
-**************************************************************************/
-int action_selection_target_city(void)
-{
-  if (act_sel_dialog == NULL) {
-    return IDENTITY_NUMBER_ZERO;
-  }
-  return target_ids[ATK_CITY];
-}
-
-/**********************************************************************//**
-  Returns id of the target unit of the actions currently handled in action
-  selection dialog when the action selection dialog is open and it has a
-  unit target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
-  is open or no unit target is present in the action selection dialog.
-**************************************************************************/
-int action_selection_target_unit(void)
-{
-  if (act_sel_dialog == NULL) {
-    return IDENTITY_NUMBER_ZERO;
-  }
-
-  return target_ids[ATK_UNIT];
-}
-
-/**********************************************************************//**
-  Returns id of the target tile of the actions currently handled in action
-  selection dialog when the action selection dialog is open and it has a
-  tile target. Returns TILE_INDEX_NONE if no action selection dialog is
-  open.
-**************************************************************************/
-int action_selection_target_tile(void)
-{
-  if (act_sel_dialog == NULL) {
-    return TILE_INDEX_NONE;
-  }
-
-  return target_ids[ATK_TILE];
-}
-
-/**********************************************************************//**
-  Returns id of the target extra of the actions currently handled in action
-  selection dialog when the action selection dialog is open and it has an
-  extra target. Returns EXTRA_NONE if no action selection dialog is open
-  or no extra target is present in the action selection dialog.
-**************************************************************************/
-int action_selection_target_extra(void)
-{
-  if (act_sel_dialog == NULL) {
-    return EXTRA_NONE;
-  }
-
-  return target_extra_id;
-}
-
-/**********************************************************************//**
-  Updates the action selection dialog with new information.
-**************************************************************************/
-void action_selection_refresh(struct unit *actor_unit,
-                              struct city *target_city,
-                              struct unit *target_unit,
-                              struct tile *target_tile,
-                              struct extra_type *target_extra,
-                              const struct act_prob *act_probs)
-{
-  if (act_sel_dialog == NULL) {
-    fc_assert_msg(act_sel_dialog != NULL,
-                  "The action selection dialog should have been open");
-    return;
-  }
-
-  if (actor_unit->id != action_selection_actor_unit()) {
-    fc_assert_msg(actor_unit->id == action_selection_actor_unit(),
-                  "The action selection dialog is for another actor unit.");
-    return;
-  }
-
-  /* A new target may have appeared. */
-  if (target_city) {
-    act_sel_dialog_data->target_city_id = target_city->id;
-  }
-  if (target_unit) {
-    act_sel_dialog_data->target_unit_id = target_unit->id;
-  }
-  if (target_tile) {
-    act_sel_dialog_data->target_tile_id = target_tile->index;
-  }
-  /* No target_building or target_tech supplied. (Dec 2019) */
-  if (target_extra) {
-    act_sel_dialog_data->target_extra_id = target_extra->id;
-  }
-
-  action_iterate(act) {
-    const char *custom;
-
-    if (action_id_get_actor_kind(act) != AAK_UNIT) {
-      /* Not relevant. */
-      continue;
-    }
-
-    custom = get_act_sel_action_custom_text(action_by_number(act),
-                                            act_probs[act],
-                                            actor_unit,
-                                            target_city);
-
-    if (BUTTON_NOT_THERE == action_button_map[act]) {
-      /* Add the button (unless its probability is 0). */
-      action_entry(act_sel_dialog, act, act_probs, custom, act);
-    } else {
-      /* Update the existing button. */
-      action_entry_update(act_sel_dialog, act, act_probs, custom, act);
-    }
-  } action_iterate_end;
-
-  /* DO NOT change the action_button_map[] for any button to reflect its
-   * new position. A button keeps its choice dialog internal name when its
-   * position changes. A button's id number is therefore based on when
-   * it was added, not on its current position. */
-
-  if (BUTTON_NOT_THERE != action_button_map[BUTTON_WAIT]) {
-    /* Move the wait button below the recently added button. */
-    choice_dialog_button_move_to_the_end(act_sel_dialog,
-        action_button_map[BUTTON_WAIT]);
-  }
-
-  if (BUTTON_NOT_THERE != action_button_map[BUTTON_CANCEL]) {
-    /* Move the cancel button below the recently added button. */
-    choice_dialog_button_move_to_the_end(act_sel_dialog,
-        action_button_map[BUTTON_CANCEL]);
-  }
-
-  choice_dialog_end(act_sel_dialog);
-}
-
-/**********************************************************************//**
-  Closes the action selection dialog
-**************************************************************************/
-void action_selection_close(void)
-{
-  if (act_sel_dialog != NULL) {
-    did_not_decide = TRUE;
-    choice_dialog_destroy(act_sel_dialog);
-  }
-}
diff --git a/client/gui-gtk-5.0/canvas.c b/client/gui-gtk-5.0/canvas.c
deleted file mode 100644
index 6e9b9bd498..0000000000
--- a/client/gui-gtk-5.0/canvas.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-/* gui-gtk-5.0 */
-#include "colors.h"
-#include "gui_main.h"
-#include "mapview.h"
-
-#include "canvas.h"
-
-/************************************************************************//**
-  Create a canvas of the given size.
-****************************************************************************/
-struct canvas *canvas_create(int width, int height)
-{
-  struct canvas *result = fc_malloc(sizeof(*result));
-
-  result->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                               width, height);
-  result->drawable = NULL;
-  result->zoom = 1.0;
-
-  return result;
-}
-
-/************************************************************************//**
-  Free any resources associated with this canvas and the canvas struct
-  itself.
-****************************************************************************/
-void canvas_free(struct canvas *store)
-{
-  cairo_surface_destroy(store->surface);
-  free(store);
-}
-
-/************************************************************************//**
-  Set canvas zoom for future drawing operations.
-****************************************************************************/
-void canvas_set_zoom(struct canvas *store, float zoom)
-{
-  store->zoom = zoom;
-}
-
-/************************************************************************//**
-  This gui has zoom support.
-****************************************************************************/
-bool has_zoom_support(void)
-{
-  return TRUE;
-}
-
-/************************************************************************//**
-  Initialize canvas as mapview.
-****************************************************************************/
-void canvas_mapview_init(struct canvas *store)
-{
-}
-
-/************************************************************************//**
-  Copies an area from the source canvas to the destination canvas.
-****************************************************************************/
-void canvas_copy(struct canvas *dest, struct canvas *src,
-                 int src_x, int src_y, int dest_x, int dest_y,
-                 int width, int height)
-{
-  cairo_t *cr;
-
-  if (!dest->drawable) {
-    cr = cairo_create(dest->surface);
-  } else {
-    cr = dest->drawable;
-  }
-
-  if (dest->drawable) {
-    cairo_save(cr);
-  }
-
-  cairo_scale(cr, dest->zoom / src->zoom, dest->zoom / src->zoom);
-  cairo_set_source_surface(cr, src->surface, dest_x - src_x, dest_y - src_y);
-  cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
-  cairo_rectangle(cr, dest_x, dest_y, width, height);
-  cairo_fill(cr);
-
-  if (!dest->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-/************************************************************************//**
-  Draw some or all of a sprite onto the mapview or citydialog canvas.
-  Supplied coordinates are prior to any canvas zoom.
-****************************************************************************/
-void canvas_put_sprite(struct canvas *pcanvas, int canvas_x, int canvas_y,
-                       struct sprite *sprite,
-                       int offset_x, int offset_y, int width, int height)
-{
-  int sswidth, ssheight;
-  cairo_t *cr;
-
-  get_sprite_dimensions(sprite, &sswidth, &ssheight);
-
-  if (!pcanvas->drawable) {
-    cr = cairo_create(pcanvas->surface);
-  } else {
-    cr = pcanvas->drawable;
-    cairo_save(cr);
-  }
-
-  cairo_scale(cr, pcanvas->zoom, pcanvas->zoom);
-  cairo_set_source_surface(cr, sprite->surface, canvas_x - offset_x, canvas_y - offset_y);
-  cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
-  cairo_rectangle(cr, canvas_x - offset_x, canvas_y - offset_y,
-                  MIN(width, MAX(0, sswidth - offset_x)),
-                  MIN(height, MAX(0, ssheight - offset_y)));
-  cairo_fill(cr);
-
-  if (!pcanvas->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-/************************************************************************//**
-  Draw a full sprite onto the mapview or citydialog canvas.
-  Supplied canvas_x/y are prior to any canvas zoom.
-****************************************************************************/
-void canvas_put_sprite_full(struct canvas *pcanvas, int canvas_x, int canvas_y,
-                            struct sprite *sprite)
-{
-  int width, height;
-
-  get_sprite_dimensions(sprite, &width, &height);
-  canvas_put_sprite(pcanvas, canvas_x, canvas_y, sprite,
-                    0, 0, width, height);
-}
-
-/************************************************************************//**
-  Draw a full sprite onto the canvas, scaled to the canvas size.
-****************************************************************************/
-void canvas_put_sprite_full_scaled(struct canvas *pcanvas,
-                                   int canvas_x, int canvas_y,
-                                   int canvas_w, int canvas_h,
-                                   struct sprite *sprite)
-{
-  /* This should never be called as we have not enabled support
-   * in this client yet. */
-  fc_assert(FALSE);
-}
-
-/************************************************************************//**
-  Draw a full sprite onto the canvas. If "fog" is specified draw it with fog.
-****************************************************************************/
-void canvas_put_sprite_fogged(struct canvas *pcanvas,
-                              int canvas_x, int canvas_y,
-                              struct sprite *psprite,
-                              bool fog, int fog_x, int fog_y)
-{
-  pixmap_put_overlay_tile_draw(pcanvas, canvas_x, canvas_y,
-                               psprite, fog);
-}
-
-/************************************************************************//**
-  Draw a filled-in colored rectangle onto the mapview or citydialog canvas.
-  Supplied coordinates are prior to any canvas zoom.
-****************************************************************************/
-void canvas_put_rectangle(struct canvas *pcanvas, struct color *pcolor,
-                          int canvas_x, int canvas_y, int width, int height)
-{
-  cairo_t *cr;
-
-  if (!pcanvas->drawable) {
-    cr = cairo_create(pcanvas->surface);
-  } else {
-    cr = pcanvas->drawable;
-    cairo_save(cr);
-  }
-
-  cairo_scale(cr, pcanvas->zoom, pcanvas->zoom);
-  gdk_cairo_set_source_rgba(cr, &pcolor->color);
-  cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_NEAREST);
-  cairo_rectangle(cr, canvas_x, canvas_y, width, height);
-  cairo_fill(cr);
-
-  if (!pcanvas->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-/************************************************************************//**
-  Fill the area covered by the sprite with the given color.
-****************************************************************************/
-void canvas_fill_sprite_area(struct canvas *pcanvas, struct sprite *psprite,
-                             struct color *pcolor, int canvas_x, int canvas_y)
-{
-  int width, height;
-
-  get_sprite_dimensions(psprite, &width, &height);
-  canvas_put_rectangle(pcanvas, pcolor, canvas_x, canvas_y, width, height);
-}
-
-/************************************************************************//**
-  Draw a colored line onto the mapview or citydialog canvas.
-  XXX: unlike other canvas_put functions, supplied x/y are *not* prior to
-  any canvas zoom.
-****************************************************************************/
-void canvas_put_line(struct canvas *pcanvas, struct color *pcolor,
-                     enum line_type ltype, int start_x, int start_y,
-                     int dx, int dy)
-{
-  cairo_t *cr;
-  double dashes[2] = {4.0, 4.0};
-
-  if (!pcanvas->drawable) {
-    cr = cairo_create(pcanvas->surface);
-  } else {
-    cr = pcanvas->drawable;
-    cairo_save(cr);
-  }
-
-  switch (ltype) {
-  case LINE_NORMAL:
-    cairo_set_line_width(cr, 1.);
-    break;
-  case LINE_BORDER:
-    cairo_set_line_width(cr, (double)BORDER_WIDTH);
-    cairo_set_dash(cr, dashes, 2, 0);
-    break;
-  case LINE_TILE_FRAME:
-    cairo_set_line_width(cr, 2.);
-    break;
-  case LINE_GOTO:
-    cairo_set_line_width(cr, 2.);
-    break;
-  case LINE_SELECT_RECT:
-    cairo_set_line_width(cr, 2.);
-    cairo_set_dash(cr, dashes, 2, 0);
-    cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
-    break;
-  }
-
-  gdk_cairo_set_source_rgba(cr, &pcolor->color);
-  cairo_move_to(cr, start_x, start_y);
-  cairo_line_to(cr, start_x + dx, start_y + dy);
-  cairo_stroke(cr);
-
-  if (!pcanvas->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-/************************************************************************//**
-  Draw a colored curved line for the Technology Tree connectors
-  A curved line is: 1 horizontal line, 2 arcs, 1 horizontal line
-****************************************************************************/
-void canvas_put_curved_line(struct canvas *pcanvas,
-                            struct color *pcolor,
-                            enum line_type ltype, int start_x, int start_y,
-                            int dx, int dy)
-{
-  int end_x = start_x + dx;
-  int end_y = start_y + dy;
-  cairo_t *cr;
-  double dashes[2] = {4.0, 4.0};
-
-  if (!pcanvas->drawable) {
-    cr = cairo_create(pcanvas->surface);
-  } else {
-    cr = pcanvas->drawable;
-  }
-
-  if (pcanvas->drawable) {
-    cairo_save(cr);
-  }
-
-  switch (ltype) {
-  case LINE_NORMAL:
-    cairo_set_line_width(cr, 1.);
-    break;
-  case LINE_BORDER:
-    cairo_set_dash(cr, dashes, 2, 0);
-    cairo_set_line_width(cr, (double)BORDER_WIDTH);
-    break;
-  case LINE_TILE_FRAME:
-    cairo_set_line_width(cr, 2.);
-    break;
-  case LINE_GOTO:
-    cairo_set_line_width(cr, 2.);
-    break;
-  case LINE_SELECT_RECT:
-    cairo_set_line_width(cr, 2.);
-    cairo_set_dash(cr, dashes, 2, 0);
-    cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
-    break;
-  }
-
-  gdk_cairo_set_source_rgba(cr, &pcolor->color);
-  cairo_move_to(cr, start_x, start_y);
-  cairo_curve_to(cr, end_x, start_y, start_x, end_y, end_x, end_y);
-  cairo_stroke(cr);
-
-  if (!pcanvas->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-static PangoLayout *layout;
-static struct {
-  PangoFontDescription **styles;
-  bool shadowed;
-} fonts[FONT_COUNT] = {
-  {&city_names_style, TRUE},
-  {&city_productions_style, TRUE},
-  {&reqtree_text_style, FALSE}
-};
-#define FONT(font) (*fonts[font].styles)
-
-/************************************************************************//**
-  Return the size of the given text in the given font. This size should
-  include the ascent and descent of the text. Either of width or height
-  may be NULL in which case those values simply shouldn't be filled out.
-****************************************************************************/
-void get_text_size(int *width, int *height,
-                   enum client_font font, const char *text)
-{
-  PangoRectangle rect;
-
-  if (!layout) {
-    layout = pango_layout_new(gtk_widget_get_pango_context(toplevel));
-  }
-
-  pango_layout_set_font_description(layout, FONT(font));
-  pango_layout_set_text(layout, text, -1);
-
-  pango_layout_get_pixel_extents(layout, NULL, &rect);
-  if (width) {
-    *width = rect.width;
-  }
-  if (height) {
-    *height = rect.height;
-  }
-}
-
-/************************************************************************//**
-  Draw the text onto the canvas in the given color and font. The canvas
-  position does not account for the ascent of the text; this function must
-  take care of this manually. The text will not be NULL but may be empty.
-  Supplied canvas_x/y are prior to any canvas zoom.
-****************************************************************************/
-void canvas_put_text(struct canvas *pcanvas, int canvas_x, int canvas_y,
-                     enum client_font font, struct color *pcolor,
-                     const char *text)
-{
-  cairo_t *cr;
-
-  if (!pcanvas->drawable) {
-    cr = cairo_create(pcanvas->surface);
-  } else {
-    cr = pcanvas->drawable;
-    cairo_save(cr);
-  }
-
-  surface_put_text(cr, canvas_x, canvas_y, pcanvas->zoom,
-                   font, pcolor, text);
-
-  if (!pcanvas->drawable) {
-    cairo_destroy(cr);
-  } else {
-    cairo_restore(cr);
-  }
-}
-
-/************************************************************************//**
-  Draw the text onto the surface in the given color and font. The
-  position does not account for the ascent of the text; this function must
-  take care of this manually. The text may not be NULL but may be empty.
-****************************************************************************/
-void surface_put_text(cairo_t *cr, int x, int y, float zoom,
-                      enum client_font font, struct color *pcolor,
-                      const char *text)
-{
-  if (!layout) {
-    layout = pango_layout_new(gtk_widget_get_pango_context(toplevel));
-  }
-
-  pango_layout_set_font_description(layout, FONT(font));
-  pango_layout_set_text(layout, text, -1);
-
-  if (fonts[font].shadowed) {
-    /* Suppress drop shadow for black text */
-    const GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
-
-    if (!gdk_rgba_equal(&pcolor->color, &black)) {
-      gdk_cairo_set_source_rgba(cr, &black);
-      cairo_move_to(cr, x * zoom + 1,
-                    y * zoom + 1);
-      pango_cairo_show_layout(cr, layout);
-    }
-  }
-
-  cairo_move_to(cr, x * zoom, y * zoom);
-  gdk_cairo_set_source_rgba(cr, &pcolor->color);
-  pango_cairo_show_layout(cr, layout);
-}
diff --git a/client/gui-gtk-5.0/canvas.h b/client/gui-gtk-5.0/canvas.h
deleted file mode 100644
index e1bbe89dc7..0000000000
--- a/client/gui-gtk-5.0/canvas.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CANVAS_H
-#define FC__CANVAS_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "canvas_g.h"
-
-struct canvas
-{
-  cairo_surface_t *surface;
-  cairo_t *drawable;
-  float zoom;
-};
-
-#define FC_STATIC_CANVAS_INIT \
-  { .surface = NULL, .drawable = NULL, .zoom = 1.0 }
-
-void surface_put_text(cairo_t *cr, int x, int y, float zoom,
-                      enum client_font font, struct color *pcolor,
-                      const char *text);
-
-#endif /* FC__CANVAS_H */
diff --git a/client/gui-gtk-5.0/chatline.c b/client/gui-gtk-5.0/chatline.c
deleted file mode 100644
index 5988b82238..0000000000
--- a/client/gui-gtk-5.0/chatline.c
+++ /dev/null
@@ -1,1542 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "genlist.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* common */
-#include "chat.h"
-#include "featured_text.h"
-#include "game.h"
-#include "packets.h"
-
-/* client */
-#include "client_main.h"
-#include "climap.h"
-#include "control.h"
-#include "mapview_common.h"
-#include "update_queue.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "menu.h"
-#include "pages.h"
-
-#include "chatline.h"
-
-#define MAX_CHATLINE_HISTORY 20
-
-static struct genlist *history_list = NULL;
-static int history_pos = -1;
-
-static struct inputline_toolkit {
-  GtkWidget *main_widget;
-  GtkWidget *entry;
-  GtkWidget *button_box;
-  GtkWidget *toolbar;
-  GtkWidget *toggle_button;
-  bool toolbar_displayed;
-} toolkit;      /* Singleton. */
-
-static void inputline_make_tag(GtkEntry *entry, enum text_tag_type type);
-
-/**********************************************************************//**
-  Returns TRUE iff the input line has focus.
-**************************************************************************/
-bool inputline_has_focus(void)
-{
-  return gtk_widget_has_focus(toolkit.entry);
-}
-
-/**********************************************************************//**
-  Gives the focus to the input line.
-**************************************************************************/
-void inputline_grab_focus(void)
-{
-  gtk_widget_grab_focus(toolkit.entry);
-}
-
-/**********************************************************************//**
-  Returns TRUE iff the input line is currently visible.
-**************************************************************************/
-bool inputline_is_visible(void)
-{
-  return gtk_widget_get_mapped(toolkit.entry);
-}
-
-/**********************************************************************//**
-  Inputline has lost focus
-**************************************************************************/
-static gboolean il_lost_focus(GtkEventControllerFocus *controller,
-                              gpointer data)
-{
-  real_menus_update();
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Inputline has gained focus
-**************************************************************************/
-static gboolean il_gained_focus(GtkEventControllerFocus *controller,
-                                gpointer data)
-{
-  menus_disable_unit_commands();
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Helper function to determine if a given client input line is intended as
-  a "plain" public message. Note that messages prefixed with : are a
-  special case (explicit public messages), and will return FALSE.
-**************************************************************************/
-static bool is_plain_public_message(const char *s)
-{
-  const char *p;
-
-  /* If it is a server command or an explicit ally
-   * message, then it is not a public message. */
-  if (s[0] == SERVER_COMMAND_PREFIX || s[0] == CHAT_ALLIES_PREFIX) {
-    return FALSE;
-  }
-
-  /* It might be a private message of the form
-   *   'player name with spaces':the message
-   * or with ". So skip past the player name part. */
-  if (s[0] == '\'' || s[0] == '"') {
-    p = strchr(s + 1, s[0]);
-  } else {
-    p = s;
-  }
-
-  /* Now we just need to check that it is not a private
-   * message. If we encounter a space then the preceding
-   * text could not have been a user/player name (the
-   * quote check above eliminated names with spaces) so
-   * it must be a public message. Otherwise if we encounter
-   * the message prefix : then the text parsed up until now
-   * was a player/user name and the line is intended as
-   * a private message (or explicit public message if the
-   * first character is :). */
-  while (p != NULL && *p != '\0') {
-    if (fc_isspace(*p)) {
-      return TRUE;
-    } else if (*p == CHAT_DIRECT_PREFIX) {
-      return FALSE;
-    }
-    p++;
-  }
-  return TRUE;
-}
-
-
-/**********************************************************************//**
-  Called when the return key is pressed.
-**************************************************************************/
-static void inputline_return(GtkEntry *w, gpointer data)
-{
-  const char *theinput;
-  GtkEntryBuffer *buffer = gtk_entry_get_buffer(w);
-
-  theinput = gtk_entry_buffer_get_text(buffer);
-
-  if (*theinput) {
-    if (client_state() == C_S_RUNNING
-        && GUI_GTK_OPTION(allied_chat_only)
-        && is_plain_public_message(theinput)) {
-      char buf[MAX_LEN_MSG];
-
-      fc_snprintf(buf, sizeof(buf), ". %s", theinput);
-      send_chat(buf);
-    } else {
-      send_chat(theinput);
-    }
-
-    if (genlist_size(history_list) >= MAX_CHATLINE_HISTORY) {
-      void *history_data;
-
-      history_data = genlist_get(history_list, -1);
-      genlist_remove(history_list, history_data);
-      free(history_data);
-    }
-
-    genlist_prepend(history_list, fc_strdup(theinput));
-    history_pos = -1;
-  }
-
-  gtk_entry_buffer_set_text(buffer, "", -1);
-}
-
-/**********************************************************************//**
-  Returns the name of player or user, set in the same list.
-**************************************************************************/
-static const char *get_player_or_user_name(int id)
-{
-  size_t size = conn_list_size(game.all_connections);
-
-  if (id < size) {
-    return conn_list_get(game.all_connections, id)->username;
-  } else {
-    struct player *pplayer = player_by_number(id - size);
-    if (pplayer) {
-      return pplayer->name;
-    } else {
-      /* Empty slot. Relies on being used with comparison function
-       * which can cope with NULL. */
-      return NULL;
-    }
-  }
-}
-
-/**********************************************************************//**
-  Find a player or a user by prefix.
-
-  @param prefix       The prefix.
-  @param matches      A string array to set the matches result.
-  @param max_matches  The maximum of matches.
-
-  @return the number of the matches names.
-**************************************************************************/
-static int check_player_or_user_name(const char *prefix,
-                                     const char **matches,
-                                     const int max_matches)
-{
-  int matches_id[max_matches * 2], ind, num;
-
-  switch (match_prefix_full(get_player_or_user_name,
-                            player_slot_count()
-                            + conn_list_size(game.all_connections),
-                            MAX_LEN_NAME, fc_strncasecmp, strlen,
-                            prefix, &ind, matches_id,
-                            max_matches * 2, &num)) {
-  case M_PRE_EXACT:
-  case M_PRE_ONLY:
-    matches[0] = get_player_or_user_name(ind);
-    return 1;
-  case M_PRE_AMBIGUOUS:
-    {
-      /* Remove duplications playername/username. */
-      const char *name;
-      int i, j, c = 0;
-
-      for (i = 0; i < num && c < max_matches; i++) {
-        name = get_player_or_user_name(matches_id[i]);
-        for (j = 0; j < c; j++) {
-          if (0 == fc_strncasecmp(name, matches[j], MAX_LEN_NAME)) {
-            break;
-          }
-        }
-        if (j >= c) {
-          matches[c++] = name;
-        }
-      }
-      return c;
-    }
-  case M_PRE_EMPTY:
-  case M_PRE_LONG:
-  case M_PRE_FAIL:
-  case M_PRE_LAST:
-    break;
-  }
-
-  return 0;
-}
-
-/**********************************************************************//**
-  Find the larger common prefix.
-
-  prefixes - A list of prefixes.
-  num_prefixes - The number of prefixes.
-  buf - The buffer to set.
-  buf_len - The maximal size of the buffer.
-
-  Returns the length of the common prefix (in characters).
-**************************************************************************/
-static size_t get_common_prefix(const char *const *prefixes,
-                                size_t num_prefixes,
-                                char *buf, size_t buf_len)
-{
-  const char *p;
-  char *q;
-  size_t i;
-
-  fc_strlcpy(buf, prefixes[0], buf_len);
-  for (i = 1; i < num_prefixes; i++) {
-    for (p = prefixes[i], q = buf; *p != '\0' && *q != '\0';
-         p = g_utf8_next_char(p), q = g_utf8_next_char(q)) {
-      if (g_unichar_toupper(g_utf8_get_char(p))
-          != g_unichar_toupper(g_utf8_get_char(q))) {
-        *q = '\0';
-        break;
-      }
-    }
-  }
-
- return g_utf8_strlen(buf, -1);
-}
-
-/**********************************************************************//**
-  Autocompletes the input line with a player or user name.
-  Returns FALSE if there is no string to complete.
-**************************************************************************/
-static bool chatline_autocomplete(GtkEditable *editable)
-{
-#define MAX_MATCHES 10
-  const char *name[MAX_MATCHES];
-  char buf[MAX_LEN_NAME * MAX_MATCHES];
-  gint pos;
-  gchar *chars, *p, *prev;
-  int num, i;
-  size_t prefix_len;
-
-  /* Part 1: get the string to complete. */
-  pos = gtk_editable_get_position(editable);
-  chars = gtk_editable_get_chars(editable, 0, pos);
-
-  p = chars + strlen(chars);
-  while ((prev = g_utf8_find_prev_char(chars, p))) {
-    if (!g_unichar_isalnum(g_utf8_get_char(prev))) {
-      break;
-    }
-    p = prev;
-  }
-  /* p points to the start of the last word, or the start of the string. */
-
-  prefix_len = g_utf8_strlen(p, -1);
-  if (0 == prefix_len) {
-    /* Empty: nothing to complete, propagate the event. */
-    g_free(chars);
-    return FALSE;
-  }
-
-  /* Part 2: Compare with player and user names. */
-  num = check_player_or_user_name(p, name, MAX_MATCHES);
-  if (1 == num) {
-    gtk_editable_delete_text(editable, pos - prefix_len, pos);
-    pos -= prefix_len;
-    gtk_editable_insert_text(editable, name[0], strlen(name[0]), &pos);
-    gtk_editable_set_position(editable, pos);
-    g_free(chars);
-    return TRUE;
-  } else if (num > 1) {
-    if (get_common_prefix(name, num, buf, sizeof(buf)) > prefix_len) {
-      gtk_editable_delete_text(editable, pos - prefix_len, pos);
-      pos -= prefix_len;
-      gtk_editable_insert_text(editable, buf, strlen(buf), &pos);
-      gtk_editable_set_position(editable, pos);
-    }
-    sz_strlcpy(buf, name[0]);
-    for (i = 1; i < num; i++) {
-      cat_snprintf(buf, sizeof(buf), ", %s", name[i]);
-    }
-    /* TRANS: comma-separated list of player/user names for completion */
-    output_window_printf(ftc_client, _("Suggestions: %s."), buf);
-  }
-
-  g_free(chars);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Called when a key is pressed.
-**************************************************************************/
-static gboolean inputline_handler(GtkEventControllerKey *controller,
-                                  guint keyval,
-                                  guint keycode,
-                                  GdkModifierType state,
-                                  gpointer data)
-{
-  GtkWidget *w = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(controller));
-
-  if ((state & GDK_CONTROL_MASK)) {
-    /* Chatline featured text support. */
-
-    switch (keyval) {
-    case GDK_KEY_b:
-      inputline_make_tag(GTK_ENTRY(w), TTT_BOLD);
-      return TRUE;
-
-    case GDK_KEY_c:
-      inputline_make_tag(GTK_ENTRY(w), TTT_COLOR);
-      return TRUE;
-
-    case GDK_KEY_i:
-      inputline_make_tag(GTK_ENTRY(w), TTT_ITALIC);
-      return TRUE;
-
-    case GDK_KEY_s:
-      inputline_make_tag(GTK_ENTRY(w), TTT_STRIKE);
-      return TRUE;
-
-    case GDK_KEY_u:
-      inputline_make_tag(GTK_ENTRY(w), TTT_UNDERLINE);
-      return TRUE;
-
-    default:
-      break;
-    }
-
-  } else {
-    /* Chatline history controls. */
-    GtkEntryBuffer *buffer = gtk_entry_get_buffer(GTK_ENTRY(w));
-
-    switch (keyval) {
-    case GDK_KEY_Up:
-      if (history_pos < genlist_size(history_list) - 1) {
-        gtk_entry_buffer_set_text(buffer,
-                                  genlist_get(history_list, ++history_pos),
-                                  -1);
-        gtk_editable_set_position(GTK_EDITABLE(w), -1);
-      }
-      return TRUE;
-
-    case GDK_KEY_Down:
-      if (history_pos >= 0) {
-        history_pos--;
-      }
-
-      if (history_pos >= 0) {
-        gtk_entry_buffer_set_text(buffer,
-                                  genlist_get(history_list, history_pos),
-                                  -1);
-      } else {
-        gtk_entry_buffer_set_text(buffer, "", -1);
-      }
-      gtk_editable_set_position(GTK_EDITABLE(w), -1);
-      return TRUE;
-
-    case GDK_KEY_Tab:
-      if (GUI_GTK_OPTION(chatline_autocompletion)) {
-        return chatline_autocomplete(GTK_EDITABLE(w));
-      }
-      return FALSE;
-
-    default:
-      break;
-    }
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Make a text tag for the selected text.
-**************************************************************************/
-void inputline_make_tag(GtkEntry *entry, enum text_tag_type type)
-{
-  char buf[MAX_LEN_MSG];
-  GtkEditable *editable = GTK_EDITABLE(entry);
-  gint start_pos, end_pos;
-  gchar *selection;
-  gchar *fg_color_text = NULL, *bg_color_text = NULL;
-
-  if (!gtk_editable_get_selection_bounds(editable, &start_pos, &end_pos)) {
-    /* Let's say the selection starts and ends at the current position. */
-    start_pos = end_pos = gtk_editable_get_position(editable);
-  }
-
-  selection = gtk_editable_get_chars(editable, start_pos, end_pos);
-
-  if (type == TTT_COLOR) {
-    /* Get the color arguments. */
-    GdkRGBA *fg_color = g_object_get_data(G_OBJECT(entry), "fg_color");
-    GdkRGBA *bg_color = g_object_get_data(G_OBJECT(entry), "bg_color");
-
-    if (!fg_color && !bg_color) {
-      goto CLEAN_UP;
-    }
-
-    if (fg_color) {
-      fg_color_text = gdk_rgba_to_string(fg_color);
-    }
-    if (bg_color) {
-      bg_color_text = gdk_rgba_to_string(bg_color);
-    }
-
-    if (0 == featured_text_apply_tag(selection, buf, sizeof(buf),
-                                     TTT_COLOR, 0, FT_OFFSET_UNSET,
-                                     ft_color_construct(fg_color_text,
-                                                        bg_color_text))) {
-      goto CLEAN_UP;
-    }
-  } else if (0 == featured_text_apply_tag(selection, buf, sizeof(buf),
-                                          type, 0, FT_OFFSET_UNSET)) {
-    goto CLEAN_UP;
-  }
-
-  /* Replace the selection. */
-  gtk_editable_delete_text(editable, start_pos, end_pos);
-  end_pos = start_pos;
-  gtk_editable_insert_text(editable, buf, -1, &end_pos);
-  gtk_editable_select_region(editable, start_pos, end_pos);
-
-CLEAN_UP:
-  g_free(selection);
-  g_free(fg_color_text);
-  g_free(bg_color_text);
-}
-
-/**********************************************************************//**
-  Make a chat link at the current position or make the current selection
-  clickable.
-**************************************************************************/
-void inputline_make_chat_link(struct tile *ptile, bool unit)
-{
-  char buf[MAX_LEN_MSG];
-  GtkWidget *entry = toolkit.entry;
-  GtkEditable *editable = GTK_EDITABLE(entry);
-  gint start_pos, end_pos;
-  gchar *chars;
-  struct unit *punit;
-
-  /* Get the target. */
-  if (unit) {
-    punit = find_visible_unit(ptile);
-    if (!punit) {
-      output_window_append(ftc_client, _("No visible unit on this tile."));
-      return;
-    }
-  } else {
-    punit = NULL;
-  }
-
-  if (gtk_editable_get_selection_bounds(editable, &start_pos, &end_pos)) {
-    /* There is a selection, make it clickable. */
-    gpointer target;
-    enum text_link_type type;
-
-    chars = gtk_editable_get_chars(editable, start_pos, end_pos);
-    if (punit) {
-      type = TLT_UNIT;
-      target = punit;
-    } else if (tile_city(ptile)) {
-      type = TLT_CITY;
-      target = tile_city(ptile);
-    } else {
-      type = TLT_TILE;
-      target = ptile;
-    }
-
-    if (0 != featured_text_apply_tag(chars, buf, sizeof(buf), TTT_LINK,
-                                     0, FT_OFFSET_UNSET, type, target)) {
-      /* Replace the selection. */
-      gtk_editable_delete_text(editable, start_pos, end_pos);
-      end_pos = start_pos;
-      gtk_editable_insert_text(editable, buf, -1, &end_pos);
-      gtk_widget_grab_focus(entry);
-      gtk_editable_select_region(editable, start_pos, end_pos);
-    }
-  } else {
-    /* Just insert the link at the current position. */
-    start_pos = gtk_editable_get_position(editable);
-    end_pos = start_pos;
-    chars = gtk_editable_get_chars(editable, MAX(start_pos - 1, 0),
-                                   start_pos + 1);
-    if (punit) {
-      sz_strlcpy(buf, unit_link(punit));
-    } else if (tile_city(ptile)) {
-      sz_strlcpy(buf, city_link(tile_city(ptile)));
-    } else {
-      sz_strlcpy(buf, tile_link(ptile));
-    }
-
-    if (start_pos > 0 && strlen(chars) > 0 && chars[0] != ' ') {
-      /* Maybe insert an extra space. */
-      gtk_editable_insert_text(editable, " ", 1, &end_pos);
-    }
-    gtk_editable_insert_text(editable, buf, -1, &end_pos);
-    if (chars[start_pos > 0 ? 1 : 0] != '\0'
-        && chars[start_pos > 0 ? 1 : 0] != ' ') {
-      /* Maybe insert an extra space. */
-      gtk_editable_insert_text(editable, " ", 1, &end_pos);
-    }
-    gtk_widget_grab_focus(entry);
-    gtk_editable_set_position(editable, end_pos);
-  }
-
-  g_free(chars);
-}
-
-/**********************************************************************//**
-  Scroll a textview so that the given mark is visible, but only if the
-  scroll window containing the textview is very close to the bottom. The
-  text mark 'scroll_target' should probably be the first character of the
-  last line in the text buffer.
-**************************************************************************/
-void scroll_if_necessary(GtkTextView *textview, GtkTextMark *scroll_target)
-{
-  GtkWidget *sw;
-  GtkAdjustment *vadj;
-  gdouble val, max, upper, page_size;
-
-  fc_assert_ret(textview != NULL);
-  fc_assert_ret(scroll_target != NULL);
-
-  sw = gtk_widget_get_parent(GTK_WIDGET(textview));
-  fc_assert_ret(sw != NULL);
-  fc_assert_ret(GTK_IS_SCROLLED_WINDOW(sw));
-
-  vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
-  val = gtk_adjustment_get_value(vadj);
-  g_object_get(G_OBJECT(vadj), "upper", &upper,
-               "page-size", &page_size, NULL);
-  max = upper - page_size;
-  if (max - val < 10.0) {
-    gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview), scroll_target,
-                                 0.0, TRUE, 1.0, 0.0);
-  }
-}
-
-/**********************************************************************//**
-  Click a link.
-**************************************************************************/
-static gboolean event_after(GtkGestureClick *gesture, int n_press,
-                            double x, double y, gpointer data)
-{
-  GtkWidget *text_view = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-  GtkTextIter start, end, iter;
-  GtkTextBuffer *buffer;
-  GSList *tags, *tagp;
-  gint bx, by;
-  struct tile *ptile = NULL;
-
-  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
-
-  /* We shouldn't follow a link if the user has selected something. */
-  gtk_text_buffer_get_selection_bounds(buffer, &start, &end);
-  if (gtk_text_iter_get_offset(&start) != gtk_text_iter_get_offset(&end)) {
-    return FALSE;
-  }
-
-  gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW (text_view),
-                                        GTK_TEXT_WINDOW_WIDGET,
-                                        x, y, &bx, &by);
-
-  gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW(text_view), &iter, bx, by);
-
-  if ((tags = gtk_text_iter_get_tags(&iter))) {
-    for (tagp = tags; tagp; tagp = tagp->next) {
-      GtkTextTag *tag = tagp->data;
-      enum text_link_type type =
-        GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tag), "type"));
-
-      if (type != 0) {
-        /* This is a link. */
-        int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tag), "id"));
-        ptile = NULL;
-
-        /* Real type is type - 1.
-         * See comment in apply_text_tag() for g_object_set_data(). */
-        type--;
-
-        switch (type) {
-        case TLT_CITY:
-          {
-            struct city *pcity = game_city_by_number(id);
-
-            if (pcity) {
-              ptile = client_city_tile(pcity);
-            } else {
-              output_window_append(ftc_client, _("This city isn't known!"));
-            }
-          }
-          break;
-        case TLT_TILE:
-          ptile = index_to_tile(&(wld.map), id);
-
-          if (!ptile) {
-            output_window_append(ftc_client,
-                                 _("This tile doesn't exist in this game!"));
-          }
-          break;
-        case TLT_UNIT:
-          {
-            struct unit *punit = game_unit_by_number(id);
-
-            if (punit) {
-              ptile = unit_tile(punit);
-            } else {
-              output_window_append(ftc_client, _("This unit isn't known!"));
-            }
-          }
-          break;
-        }
-
-        if (ptile) {
-          center_tile_mapcanvas(ptile);
-          link_mark_restore(type, id);
-          gtk_widget_grab_focus(GTK_WIDGET(map_canvas));
-        }
-      }
-    }
-    g_slist_free(tags);
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Set the "hand" cursor when moving over a link.
-**************************************************************************/
-static void set_cursor_if_appropriate(GtkTextView *text_view, gint x, gint y)
-{
-  static gboolean hovering_over_link = FALSE;
-  static GdkCursor *hand_cursor = NULL;
-  static GdkCursor *regular_cursor = NULL;
-  GSList *tags, *tagp;
-  GtkTextIter iter;
-  gboolean hovering = FALSE;
-
-  /* Initialize the cursors. */
-  if (!hand_cursor) {
-    hand_cursor = gdk_cursor_new_from_name("pointer", NULL);
-  }
-  if (!regular_cursor) {
-    regular_cursor = gdk_cursor_new_from_name("text", NULL);
-  }
-
-  gtk_text_view_get_iter_at_location(text_view, &iter, x, y);
-
-  tags = gtk_text_iter_get_tags(&iter);
-  for (tagp = tags; tagp; tagp = tagp->next) {
-    enum text_link_type type =
-      GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tagp->data), "type"));
-
-    if (type != 0) {
-      hovering = TRUE;
-      break;
-    }
-  }
-
-  if (hovering != hovering_over_link) {
-    hovering_over_link = hovering;
-
-    if (hovering_over_link) {
-      gtk_widget_set_cursor(GTK_WIDGET(text_view), hand_cursor);
-    } else {
-      gtk_widget_set_cursor(GTK_WIDGET(text_view), regular_cursor);
-    }
-  }
-
-  if (tags) {
-    g_slist_free(tags);
-  }
-}
-
-/**********************************************************************//**
-  Maybe mouse is moving over a link.
-**************************************************************************/
-static gboolean chat_pointer_motion(GtkEventControllerMotion *controller,
-                                    gdouble e_x, gdouble e_y, gpointer data)
-{
-  gint x, y;
-  GtkWidget *text_view
-    = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(controller));
-
-  gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view),
-                                        GTK_TEXT_WINDOW_WIDGET,
-                                        e_x, e_y, &x, &y);
-  set_cursor_if_appropriate(GTK_TEXT_VIEW(text_view), x, y);
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Set the appropriate callbacks for the message buffer.
-**************************************************************************/
-void set_message_buffer_view_link_handlers(GtkWidget *view)
-{
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  gesture = gtk_gesture_click_new();
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "released",
-                   G_CALLBACK(event_after), NULL);
-  gtk_widget_add_controller(view, controller);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_event_controller_motion_new());
-  g_signal_connect(controller, "motion",
-                   G_CALLBACK(chat_pointer_motion), NULL);
-  gtk_widget_add_controller(view, controller);
-}
-
-/**********************************************************************//**
-  Convert a struct text_tag to a GtkTextTag.
-**************************************************************************/
-void apply_text_tag(const struct text_tag *ptag, GtkTextBuffer *buf,
-                    ft_offset_t text_start_offset, const char *text)
-{
-  static bool initialized = FALSE;
-  GtkTextIter start, stop;
-
-  if (!initialized) {
-    gtk_text_buffer_create_tag(buf, "bold",
-                               "weight", PANGO_WEIGHT_BOLD, NULL);
-    gtk_text_buffer_create_tag(buf, "italic",
-                               "style", PANGO_STYLE_ITALIC, NULL);
-    gtk_text_buffer_create_tag(buf, "strike",
-                               "strikethrough", TRUE, NULL);
-    gtk_text_buffer_create_tag(buf, "underline",
-                               "underline", PANGO_UNDERLINE_SINGLE, NULL);
-    initialized = TRUE;
-  }
-
-  /* Get the position. */
-  /*
-   * N.B.: text_tag_*_offset() value is in bytes, so we need to convert it
-   * to utf8 character offset.
-   */
-  gtk_text_buffer_get_iter_at_offset(buf, &start, text_start_offset
-                                     + g_utf8_pointer_to_offset(text,
-                                     text + text_tag_start_offset(ptag)));
-  if (text_tag_stop_offset(ptag) == FT_OFFSET_UNSET) {
-    gtk_text_buffer_get_end_iter(buf, &stop);
-  } else {
-    gtk_text_buffer_get_iter_at_offset(buf, &stop, text_start_offset
-                                       + g_utf8_pointer_to_offset(text,
-                                       text + text_tag_stop_offset(ptag)));
-  }
-
-  switch (text_tag_type(ptag)) {
-  case TTT_BOLD:
-    gtk_text_buffer_apply_tag_by_name(buf, "bold", &start, &stop);
-    break;
-  case TTT_ITALIC:
-    gtk_text_buffer_apply_tag_by_name(buf, "italic", &start, &stop);
-    break;
-  case TTT_STRIKE:
-    gtk_text_buffer_apply_tag_by_name(buf, "strike", &start, &stop);
-    break;
-  case TTT_UNDERLINE:
-    gtk_text_buffer_apply_tag_by_name(buf, "underline", &start, &stop);
-    break;
-  case TTT_COLOR:
-    {
-      /* We have to make a new tag every time. */
-      GtkTextTag *tag = NULL;
-      const char *foreground = text_tag_color_foreground(ptag);
-      const char *background = text_tag_color_background(ptag);
-
-      if (foreground && foreground[0]) {
-        if (background && background[0]) {
-          tag = gtk_text_buffer_create_tag(buf, NULL,
-                                           "foreground", foreground,
-                                           "background", background,
-                                           NULL);
-        } else {
-          tag = gtk_text_buffer_create_tag(buf, NULL,
-                                           "foreground", foreground,
-                                           NULL);
-        }
-      } else if (background && background[0]) {
-        tag = gtk_text_buffer_create_tag(buf, NULL,
-                                         "background", background,
-                                         NULL);
-      }
-
-      if (!tag) {
-        break; /* No color. */
-      }
-      gtk_text_buffer_apply_tag(buf, tag, &start, &stop);
-    }
-    break;
-  case TTT_LINK:
-    {
-      struct color *pcolor = NULL;
-      GtkTextTag *tag;
-
-      switch (text_tag_link_type(ptag)) {
-      case TLT_CITY:
-        pcolor = get_color(tileset, COLOR_MAPVIEW_CITY_LINK);
-        break;
-      case TLT_TILE:
-        pcolor = get_color(tileset, COLOR_MAPVIEW_TILE_LINK);
-        break;
-      case TLT_UNIT:
-        pcolor = get_color(tileset, COLOR_MAPVIEW_UNIT_LINK);
-        break;
-      }
-
-      if (!pcolor) {
-        break; /* Not a valid link type case. */
-      }
-
-      tag = gtk_text_buffer_create_tag(buf, NULL,
-                                       "foreground-rgba", &pcolor->color,
-                                       "underline", PANGO_UNDERLINE_SINGLE,
-                                       NULL);
-
-      /* Type 0 is reserved for non-link tags. So, add 1 to the
-       * type value. */
-      g_object_set_data(G_OBJECT(tag), "type",
-                        GINT_TO_POINTER(text_tag_link_type(ptag) + 1));
-      g_object_set_data(G_OBJECT(tag), "id",
-                        GINT_TO_POINTER(text_tag_link_id(ptag)));
-      gtk_text_buffer_apply_tag(buf, tag, &start, &stop);
-      break;
-    }
-  }
-}
-
-/**********************************************************************//**
-  Appends the string to the chat output window. The string should be
-  inserted on its own line, although it will have no newline.
-**************************************************************************/
-void real_output_window_append(const char *astring,
-                               const struct text_tag_list *tags,
-                               int conn_id)
-{
-  GtkTextBuffer *buf;
-  GtkTextIter iter;
-  GtkTextMark *mark;
-  ft_offset_t text_start_offset;
-
-  buf = message_buffer;
-
-  if (buf == NULL) {
-    log_error("Output when no message buffer: %s", astring);
-
-    return;
-  }
-
-  gtk_text_buffer_get_end_iter(buf, &iter);
-  gtk_text_buffer_insert(buf, &iter, "\n", -1);
-  mark = gtk_text_buffer_create_mark(buf, NULL, &iter, TRUE);
-
-  if (GUI_GTK_OPTION(show_chat_message_time)) {
-    char timebuf[64];
-    time_t now;
-    struct tm now_tm;
-
-    now = time(NULL);
-    fc_localtime(&now, &now_tm);
-    strftime(timebuf, sizeof(timebuf), "[%H:%M:%S] ", &now_tm);
-    gtk_text_buffer_insert(buf, &iter, timebuf, -1);
-  }
-
-  text_start_offset = gtk_text_iter_get_offset(&iter);
-  gtk_text_buffer_insert(buf, &iter, astring, -1);
-  text_tag_list_iterate(tags, ptag) {
-    apply_text_tag(ptag, buf, text_start_offset, astring);
-  } text_tag_list_iterate_end;
-
-  if (main_message_area) {
-    scroll_if_necessary(GTK_TEXT_VIEW(main_message_area), mark);
-  }
-  if (start_message_area) {
-    scroll_if_necessary(GTK_TEXT_VIEW(start_message_area), mark);
-  }
-  gtk_text_buffer_delete_mark(buf, mark);
-
-  append_network_statusbar(astring, FALSE);
-}
-
-/**********************************************************************//**
-  I have no idea what module this belongs in -- Syela
-  I've decided to put output_window routines in chatline.c, because
-  the are somewhat related and output_window_* is already here.  --dwp
-**************************************************************************/
-void log_output_window(void)
-{
-  GtkTextIter start, end;
-  gchar *txt;
-
-  gtk_text_buffer_get_bounds(message_buffer, &start, &end);
-  txt = gtk_text_buffer_get_text(message_buffer, &start, &end, TRUE);
-
-  write_chatline_content(txt);
-  g_free(txt);
-}
-
-/**********************************************************************//**
-  Clear output window. This does *not* destroy it, or free its resources
-**************************************************************************/
-void clear_output_window(void)
-{
-  set_output_window_text(_("Cleared output window."));
-}
-
-/**********************************************************************//**
-  Set given text to output window
-**************************************************************************/
-void set_output_window_text(const char *text)
-{
-  gtk_text_buffer_set_text(message_buffer, text, -1);
-}
-
-/**********************************************************************//**
-  Returns whether the chatline is scrolled to the bottom.
-**************************************************************************/
-bool chatline_is_scrolled_to_bottom(void)
-{
-  GtkWidget *sw, *w;
-  GtkAdjustment *vadj;
-  gdouble val, max, upper, page_size;
-
-  if (get_client_page() == PAGE_GAME) {
-    w = GTK_WIDGET(main_message_area);
-  } else {
-    w = GTK_WIDGET(start_message_area);
-  }
-
-  if (w == NULL) {
-    return TRUE;
-  }
-
-  sw = gtk_widget_get_parent(w);
-  vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
-  val = gtk_adjustment_get_value(vadj);
-  g_object_get(G_OBJECT(vadj), "upper", &upper,
-               "page-size", &page_size, NULL);
-  max = upper - page_size;
-
-  /* Approximation. */
-  return max - val < 0.00000001;
-}
-
-/**********************************************************************//**
-  Scrolls the pregame and in-game chat windows all the way to the bottom.
-
-  Why do we do it in such a convuluted fasion rather than calling
-  chatline_scroll_to_bottom() directly from toplevel_configure?
-  Because the widget is not at its final size yet when the configure
-  event occurs.
-**************************************************************************/
-static gboolean chatline_scroll_callback(gpointer data)
-{
-  chatline_scroll_to_bottom(FALSE);     /* Not delayed this time! */
-
-  *((guint *) data) = 0;
-
-  return FALSE;         /* Remove this idle function. */
-}
-
-/**********************************************************************//**
-  Scrolls the pregame and in-game chat windows all the way to the bottom.
-  If delayed is TRUE, it will be done in a idle_callback.
-**************************************************************************/
-void chatline_scroll_to_bottom(bool delayed)
-{
-  static guint callback_id = 0;
-
-  if (delayed) {
-    if (callback_id == 0) {
-      callback_id = g_idle_add(chatline_scroll_callback, &callback_id);
-    }
-  } else if (message_buffer) {
-    GtkTextIter end;
-
-    gtk_text_buffer_get_end_iter(message_buffer, &end);
-
-    if (main_message_area) {
-      gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(main_message_area),
-                                   &end, 0.0, TRUE, 1.0, 0.0);
-    }
-    if (start_message_area) {
-      gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(start_message_area),
-                                   &end, 0.0, TRUE, 1.0, 0.0);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Tool button clicked.
-**************************************************************************/
-static void make_tag_callback(GtkButton *button, gpointer data)
-{
-  inputline_make_tag(GTK_ENTRY(data),
-                     GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),
-                                                       "text_tag_type")));
-}
-
-/**********************************************************************//**
-  Set the color for an object. Update the button if not NULL.
-**************************************************************************/
-static void color_set(GObject *object, const gchar *color_target,
-                      GdkRGBA *color, GtkButton *button)
-{
-  GdkRGBA *current_color = g_object_get_data(object, color_target);
-
-  if (NULL == color) {
-    /* Clears the current color. */
-    if (NULL != current_color) {
-      gdk_rgba_free(current_color);
-      g_object_set_data(object, color_target, NULL);
-      if (NULL != button) {
-        gtk_button_set_child(button, NULL);
-      }
-    }
-  } else {
-    /* Apply the new color. */
-    if (NULL != current_color) {
-      /* We already have a GdkRGBA pointer. */
-      *current_color = *color;
-    } else {
-      /* We need to make a GdkRGBA pointer. */
-      current_color = gdk_rgba_copy(color);
-      g_object_set_data(object, color_target, current_color);
-    }
-
-    if (NULL != button) {
-      /* Update the button. */
-      GdkPixbuf *pixbuf;
-      GtkWidget *image;
-
-      gtk_button_set_child(button, NULL);
-
-      {
-        cairo_surface_t *surface = cairo_image_surface_create(
-            CAIRO_FORMAT_RGB24, 16, 16);
-        cairo_t *cr = cairo_create(surface);
-
-        gdk_cairo_set_source_rgba(cr, current_color);
-        cairo_paint(cr);
-        cairo_destroy(cr);
-        pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
-        cairo_surface_destroy(surface);
-      }
-      image = gtk_image_new_from_pixbuf(pixbuf);
-      gtk_button_set_child(button, image);
-      gtk_widget_set_visible(image, TRUE);
-      g_object_unref(G_OBJECT(pixbuf));
-    }
-  }
-}
-
-/**********************************************************************//**
-  Color selection dialog response.
-**************************************************************************/
-static void color_selected(GtkDialog *dialog, gint res, gpointer data)
-{
-  const gchar *color_target =
-    g_object_get_data(G_OBJECT(data), "color_target");
-  GObject *entry = g_object_get_data(G_OBJECT(data), "entry");
-
-  if (res == GTK_RESPONSE_REJECT) {
-    /* Clears the current color. */
-    color_set(entry, color_target, NULL, data);
-  } else if (res == GTK_RESPONSE_OK) {
-    /* Apply the new color. */
-    GtkColorChooser *chooser
-      = GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
-    GdkRGBA new_color;
-
-    gtk_color_chooser_get_rgba(chooser, &new_color);
-    color_set(entry, color_target, &new_color, data);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
-
-/**********************************************************************//**
-  Color selection button clicked.
-**************************************************************************/
-static void select_color_callback(GtkButton *button, gpointer data)
-{
-  GtkWidget *dialog, *chooser;
-  /* "fg_color" or "bg_color". */
-  const gchar *color_target = g_object_get_data(G_OBJECT(button),
-                                                "color_target");
-  GdkRGBA *current_color = g_object_get_data(G_OBJECT(data), color_target);
-
-  /* TRANS: "text" or "background". */
-  gchar *buf = g_strdup_printf(_("Select the %s color"),
-              (const char *) g_object_get_data(G_OBJECT(button),
-                                               "color_info"));
-  dialog = gtk_dialog_new_with_buttons(buf, NULL, GTK_DIALOG_MODAL,
-                                       _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                       _("C_lear"), GTK_RESPONSE_REJECT,
-                                       _("_OK"), GTK_RESPONSE_OK, NULL);
-  setup_dialog(dialog, toplevel);
-  g_object_set_data(G_OBJECT(button), "entry", data);
-  g_signal_connect(dialog, "response", G_CALLBACK(color_selected), button);
-
-  chooser = gtk_color_chooser_widget_new();
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                             chooser, NULL);
-  g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
-
-  if (current_color != nullptr) {
-    gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(chooser), current_color);
-  }
-
-  gtk_widget_set_visible(dialog, TRUE);
-  g_free(buf);
-}
-
-/**********************************************************************//**
-  Moves the tool kit to the toolkit view.
-**************************************************************************/
-static gboolean move_toolkit(GtkWidget *toolkit_view, gpointer data)
-{
-  struct inputline_toolkit *ptoolkit = (struct inputline_toolkit *) data;
-  GtkWidget *parent = gtk_widget_get_parent(ptoolkit->main_widget);
-  GtkWidget *button_box = GTK_WIDGET(g_object_get_data(G_OBJECT(toolkit_view),
-                                                       "button_box"));
-  GtkWidget *iter;
-
-  if (parent) {
-    if (parent == toolkit_view) {
-      return FALSE;     /* Already owned. */
-    }
-
-    /* N.B.: We need to hide/show the toolbar to reset the sensitivity
-     * of the tool buttons. */
-    if (ptoolkit->toolbar_displayed) {
-      gtk_widget_set_visible(ptoolkit->toolbar, FALSE);
-    }
-    g_object_ref(ptoolkit->main_widget); /* Make sure reference count stays above 0
-                                          * during the transition to new parent. */
-    gtk_box_remove(GTK_BOX(parent), ptoolkit->main_widget);
-    gtk_box_append(GTK_BOX(toolkit_view), ptoolkit->main_widget);
-    g_object_unref(ptoolkit->main_widget);
-    if (ptoolkit->toolbar_displayed) {
-      gtk_widget_set_visible(ptoolkit->toolbar, TRUE);
-    }
-
-    if (!gtk_widget_get_parent(button_box)) {
-      /* Attach to the toolkit button_box. */
-      gtk_box_append(GTK_BOX(ptoolkit->button_box), button_box);
-    }
-    gtk_widget_set_visible(button_box, TRUE);
-    if (!ptoolkit->toolbar_displayed) {
-      gtk_widget_set_visible(ptoolkit->toolbar, FALSE);
-    }
-
-    /* Hide all other buttons boxes. */
-    for (iter = gtk_widget_get_first_child(GTK_WIDGET(ptoolkit->button_box));
-         iter != nullptr;
-         iter = gtk_widget_get_next_sibling(iter)) {
-      if (iter != button_box) {
-        gtk_widget_set_visible(iter, FALSE);
-      }
-    }
-
-  } else {
-    /* First time attached to a parent. */
-    gtk_box_append(GTK_BOX(toolkit_view), ptoolkit->main_widget);
-    gtk_box_append(GTK_BOX(ptoolkit->button_box), button_box);
-    gtk_widget_set_visible(ptoolkit->main_widget, TRUE);
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Show/Hide the toolbar.
-**************************************************************************/
-static gboolean set_toolbar_visibility(GtkWidget *w, gpointer data)
-{
-  struct inputline_toolkit *ptoolkit = (struct inputline_toolkit *) data;
-  GtkToggleButton *button = GTK_TOGGLE_BUTTON(toolkit.toggle_button);
-
-  if (ptoolkit->toolbar_displayed) {
-    if (!gtk_toggle_button_get_active(button)) {
-      /* button_toggled() will be called and the toolbar shown. */
-      gtk_toggle_button_set_active(button, TRUE);
-    } else {
-      /* Ensure the widget is visible. */
-      gtk_widget_set_visible(ptoolkit->toolbar, TRUE);
-    }
-  } else {
-    if (gtk_toggle_button_get_active(button)) {
-      /* button_toggled() will be called and the toolbar hidden. */
-      gtk_toggle_button_set_active(button, FALSE);
-    } else {
-      /* Ensure the widget is not visible. */
-      gtk_widget_set_visible(ptoolkit->toolbar, FALSE);
-    }
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Show/Hide the toolbar.
-**************************************************************************/
-static void button_toggled(GtkToggleButton *button, gpointer data)
-{
-  struct inputline_toolkit *ptoolkit = (struct inputline_toolkit *) data;
-
-  if (gtk_toggle_button_get_active(button)) {
-    gtk_widget_set_visible(ptoolkit->toolbar, TRUE);
-    ptoolkit->toolbar_displayed = TRUE;
-    if (chatline_is_scrolled_to_bottom()) {
-      /* Make sure to be still at the end. */
-      chatline_scroll_to_bottom(TRUE);
-    }
-  } else {
-    gtk_widget_set_visible(ptoolkit->toolbar, FALSE);
-    ptoolkit->toolbar_displayed = FALSE;
-  }
-}
-
-/**********************************************************************//**
-  Returns a new inputline toolkit view widget that can contain the
-  inputline.
-
-  This widget has the following datas:
-  "button_box": pointer to the GtkBox where to append buttons.
-**************************************************************************/
-GtkWidget *inputline_toolkit_view_new(void)
-{
-  GtkWidget *toolkit_view, *bbox;
-
-  /* Main widget. */
-  toolkit_view = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  g_signal_connect_after(toolkit_view, "map",
-                         G_CALLBACK(move_toolkit), &toolkit);
-
-  /* Button box. */
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-  g_object_set_data(G_OBJECT(toolkit_view), "button_box", bbox);
-
-  return toolkit_view;
-}
-
-/**********************************************************************//**
-  Appends a button to the inputline toolkit view widget.
-**************************************************************************/
-void inputline_toolkit_view_append_button(GtkWidget *toolkit_view,
-                                          GtkWidget *button)
-{
-  gtk_box_append(GTK_BOX(g_object_get_data(G_OBJECT(toolkit_view),
-                                           "button_box")), button);
-}
-
-/**********************************************************************//**
-  Initializes the chatline stuff.
-**************************************************************************/
-void chatline_init(void)
-{
-  GtkWidget *vbox, *hgrid, *entry, *bbox;
-  GtkWidget *button;
-  GtkWidget *toolbar;
-  GtkWidget *item;
-  GdkRGBA color;
-  int grid_col = 0;
-  GtkEventController *chat_controller;
-  GtkEventController *focus_controller;
-
-  /* Chatline history. */
-  if (!history_list) {
-    history_list = genlist_new();
-    history_pos = -1;
-  }
-
-  /* Inputline toolkit. */
-  memset(&toolkit, 0, sizeof(toolkit));
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-
-  toolkit.main_widget = vbox;
-  g_signal_connect_after(vbox, "map",
-                         G_CALLBACK(set_toolbar_visibility), &toolkit);
-
-  entry = gtk_entry_new();
-  gtk_widget_set_margin_bottom(entry, 2);
-  gtk_widget_set_margin_end(entry, 2);
-  gtk_widget_set_margin_start(entry, 2);
-  gtk_widget_set_margin_top(entry, 2);
-  gtk_widget_set_hexpand(entry, TRUE);
-  focus_controller = GTK_EVENT_CONTROLLER(gtk_event_controller_focus_new());
-  g_signal_connect(focus_controller, "enter",
-                   G_CALLBACK(il_gained_focus), NULL);
-  g_signal_connect(focus_controller, "leave",
-                   G_CALLBACK(il_lost_focus), NULL);
-  gtk_widget_add_controller(entry, focus_controller);
-  toolkit.entry = entry;
-
-  hgrid = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-
-  /* First line: toolbar */
-  toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_append(GTK_BOX(vbox), toolbar);
-  toolkit.toolbar = toolbar;
-
-  /* Bold button. */
-  item = gtk_button_new_from_icon_name("format-text-bold");
-
-  /* _("Bold")); */
-
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "text_tag_type",
-                    GINT_TO_POINTER(TTT_BOLD));
-  g_signal_connect(item, "clicked", G_CALLBACK(make_tag_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Bold (Ctrl-B)"));
-
-  /* Italic button. */
-  item = gtk_button_new_from_icon_name("format-text-italic");
-
-  /* _("Italic")); */
-
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "text_tag_type",
-                    GINT_TO_POINTER(TTT_ITALIC));
-  g_signal_connect(item, "clicked", G_CALLBACK(make_tag_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Italic (Ctrl-I)"));
-
-  /* Strike button. */
-  item = gtk_button_new_from_icon_name("format-text-strikethrough");
-
-  /* _("Strikethrough")); */
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "text_tag_type",
-                    GINT_TO_POINTER(TTT_STRIKE));
-  g_signal_connect(item, "clicked", G_CALLBACK(make_tag_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Strikethrough (Ctrl-S)"));
-
-  /* Underline button. */
-  item = gtk_button_new_from_icon_name("format-text-underline");
-
-  /* _("Underline")); */
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "text_tag_type",
-                    GINT_TO_POINTER(TTT_UNDERLINE));
-  g_signal_connect(item, "clicked", G_CALLBACK(make_tag_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Underline (Ctrl-U)"));
-
-  gtk_box_append(GTK_BOX(toolbar), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
-
-  /* Color button. */
-  item = gtk_button_new_with_label(_("Color"));
-
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "text_tag_type",
-                    GINT_TO_POINTER(TTT_COLOR));
-  g_signal_connect(item, "clicked", G_CALLBACK(make_tag_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Color (Ctrl-C)"));
-
-  gtk_box_append(GTK_BOX(toolbar), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
-
-  /* Foreground selector. */
-  item = gtk_button_new();
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "color_target", fc_strdup("fg_color"));
-  g_object_set_data(G_OBJECT(item), "color_info",
-                    fc_strdup(_("foreground")));
-  g_signal_connect(item, "clicked",
-                   G_CALLBACK(select_color_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item), _("Select the text color"));
-  if (gdk_rgba_parse(&color, "#000000")) {
-    /* Set default foreground color. */
-    color_set(G_OBJECT(entry), "fg_color", &color, GTK_BUTTON(item));
-  } else {
-    log_error("Failed to set the default foreground color.");
-  }
-
-  /* Background selector. */
-  item = gtk_button_new();
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_object_set_data(G_OBJECT(item), "color_target", fc_strdup("bg_color"));
-  g_object_set_data(G_OBJECT(item), "color_info",
-                    fc_strdup(_("background")));
-  g_signal_connect(item, "clicked",
-                   G_CALLBACK(select_color_callback), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item),
-                              _("Select the background color"));
-  if (gdk_rgba_parse(&color, "#ffffff")) {
-    /* Set default background color. */
-    color_set(G_OBJECT(entry), "bg_color", &color, GTK_BUTTON(item));
-  } else {
-    log_error("Failed to set the default background color.");
-  }
-
-  gtk_box_append(GTK_BOX(toolbar), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
-
-  /* Return button. */
-  item = gtk_button_new_with_label(_("OK"));
-  gtk_box_append(GTK_BOX(toolbar), item);
-  g_signal_connect_swapped(item, "clicked",
-                           G_CALLBACK(inputline_return), entry);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(item),
-                              /* TRANS: "Return" means the return key. */
-                              _("Send the chat (Return)"));
-
-  /* Second line */
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-
-  /* Toggle button. */
-  button = gtk_toggle_button_new();
-  gtk_widget_set_margin_bottom(button, 2);
-  gtk_widget_set_margin_end(button, 2);
-  gtk_widget_set_margin_start(button, 2);
-  gtk_widget_set_margin_top(button, 2);
-  gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  gtk_button_set_icon_name(GTK_BUTTON(button), "insert-link");
-  g_signal_connect(button, "toggled", G_CALLBACK(button_toggled), &toolkit);
-  gtk_widget_set_tooltip_text(GTK_WIDGET(button), _("Chat tools"));
-  toolkit.toggle_button = button;
-
-  /* Entry. */
-  gtk_grid_attach(GTK_GRID(hgrid), entry, grid_col++, 0, 1, 1);
-  g_signal_connect(entry, "activate", G_CALLBACK(inputline_return), NULL);
-
-  chat_controller = gtk_event_controller_key_new();
-  g_signal_connect(chat_controller, "key-pressed",
-                   G_CALLBACK(inputline_handler), NULL);
-  gtk_widget_add_controller(entry, chat_controller);
-
-  /* Button box. */
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_grid_attach(GTK_GRID(hgrid), bbox, grid_col++, 0, 1, 1);
-  toolkit.button_box = bbox;
-}
-
-/**********************************************************************//**
-  Main thread side callback to print version message
-**************************************************************************/
-static gboolean version_message_main_thread(gpointer user_data)
-{
-  char *vertext = (char *)user_data;
-
-  output_window_append(ftc_client, vertext);
-
-  FC_FREE(vertext);
-
-  return G_SOURCE_REMOVE;
-}
-
-/**********************************************************************//**
-  Got version message from metaserver thread.
-**************************************************************************/
-void version_message(const char *vertext)
-{
-  int len = strlen(vertext) + 1;
-  char *persistent = fc_malloc(len);
-
-  strncpy(persistent, vertext, len);
-
-  g_idle_add(version_message_main_thread, persistent);
-}
diff --git a/client/gui-gtk-5.0/chatline.h b/client/gui-gtk-5.0/chatline.h
deleted file mode 100644
index 46d5f80c7a..0000000000
--- a/client/gui-gtk-5.0/chatline.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CHATLINE_H
-#define FC__CHATLINE_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "chatline_g.h"
-
-void chatline_init(void);
-
-void inputline_make_chat_link(struct tile *ptile, bool unit);
-bool inputline_has_focus(void);
-void inputline_grab_focus(void);
-bool inputline_is_visible(void);
-
-void set_output_window_text(const char *text);
-bool chatline_is_scrolled_to_bottom(void);
-void chatline_scroll_to_bottom(bool delayed);
-
-void set_message_buffer_view_link_handlers(GtkWidget *view);
-
-GtkWidget *inputline_toolkit_view_new(void);
-void inputline_toolkit_view_append_button(GtkWidget *toolkit_view,
-                                          GtkWidget *button);
-
-void apply_text_tag(const struct text_tag *ptag, GtkTextBuffer *buf,
-                    ft_offset_t text_start_offset, const char *text);
-void scroll_if_necessary(GtkTextView *textview, GtkTextMark *scroll_target);
-
-#endif /* FC__CHATLINE_H */
diff --git a/client/gui-gtk-5.0/choice_dialog.c b/client/gui-gtk-5.0/choice_dialog.c
deleted file mode 100644
index 76f7b0f6d2..0000000000
--- a/client/gui-gtk-5.0/choice_dialog.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdarg.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "support.h"
-
-/* gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "choice_dialog.h"
-
-/***********************************************************************
-  Choice dialog: A dialog with a label and a list of buttons
-  placed vertically
-***********************************************************************/
-
-/*******************************************************************//**
-  Get the number of buttons in the choice dialog.
-***********************************************************************/
-int choice_dialog_get_number_of_buttons(GtkWidget *cd)
-{
-  return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cd), "nbuttons"));
-}
-
-/*******************************************************************//**
-  Get nth button widget from dialog
-***********************************************************************/
-static GtkWidget* choice_dialog_get_nth_button(GtkWidget *cd,
-                                               int button)
-{
-  char button_name[512];
-  GtkWidget *b;
-
-  fc_snprintf(button_name, sizeof(button_name), "button%d", button);
-
-  b = g_object_get_data(G_OBJECT(cd), button_name);
-
-  return b;
-}
-
-/*******************************************************************//**
-  Set sensitivity state of choice dialog button.
-***********************************************************************/
-void choice_dialog_button_set_sensitive(GtkWidget *cd, int button,
-                                        gboolean state)
-{
-  gtk_widget_set_sensitive(choice_dialog_get_nth_button(cd, button), state);
-}
-
-/*******************************************************************//**
-  Set label for choice dialog button.
-***********************************************************************/
-void choice_dialog_button_set_label(GtkWidget *cd, int number,
-                                    const char *label)
-{
-  GtkWidget* button = choice_dialog_get_nth_button(cd, number);
-  gtk_button_set_label(GTK_BUTTON(button), label);
-}
-
-/*******************************************************************//**
-  Set tool tip for choice dialog button.
-***********************************************************************/
-void choice_dialog_button_set_tooltip(GtkWidget *cd, int number,
-                                      const char *tool_tip)
-{
-  GtkWidget* button = choice_dialog_get_nth_button(cd, number);
-  gtk_widget_set_tooltip_text(button, tool_tip);
-}
-
-/*******************************************************************//**
-  Move the specified button to the end.
-***********************************************************************/
-void choice_dialog_button_move_to_the_end(GtkWidget *cd,
-                                          const int number)
-{
-  GtkWidget *button = choice_dialog_get_nth_button(cd, number);
-  GtkWidget *bbox = g_object_get_data(G_OBJECT(cd), "bbox");
-
-  gtk_box_reorder_child_after(GTK_BOX(bbox), button, NULL);
-}
-
-/*******************************************************************//**
-  Create choice dialog
-***********************************************************************/
-GtkWidget *choice_dialog_start(GtkWindow *parent, const gchar *name,
-                               const gchar *text)
-{
-  GtkWidget *dshell, *dlabel, *vbox, *bbox;
-
-  dshell = gtk_window_new();
-  setup_dialog(dshell, toplevel);
-
-  gtk_window_set_title(GTK_WINDOW(dshell), name);
-
-  gtk_window_set_transient_for(GTK_WINDOW(dshell), parent);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dshell), TRUE);
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
-  gtk_window_set_child(GTK_WINDOW(dshell), vbox);
-
-  gtk_widget_set_margin_start(vbox, 5);
-  gtk_widget_set_margin_end(vbox, 5);
-  gtk_widget_set_margin_top(vbox, 5);
-  gtk_widget_set_margin_bottom(vbox, 5);
-
-  dlabel = gtk_label_new(text);
-  gtk_box_append(GTK_BOX(vbox), dlabel);
-
-  bbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(vbox), bbox);
-
-  g_object_set_data(G_OBJECT(dshell), "bbox", bbox);
-  g_object_set_data(G_OBJECT(dshell), "nbuttons", GINT_TO_POINTER(0));
-  g_object_set_data(G_OBJECT(dshell), "hide", GINT_TO_POINTER(FALSE));
-
-  gtk_widget_set_visible(vbox, TRUE);
-  gtk_widget_set_visible(dlabel, TRUE);
-
-  return dshell;
-}
-
-/*******************************************************************//**
-  Choice dialog has been clicked and primary handling has
-  taken place already.
-***********************************************************************/
-static void choice_dialog_clicked(GtkWidget *w, gpointer data)
-{
-  if (g_object_get_data(G_OBJECT(data), "hide")) {
-    gtk_widget_set_visible(GTK_WIDGET(data), FALSE);
-  } else {
-    gtk_window_destroy(GTK_WINDOW(data));
-  }
-}
-
-/*******************************************************************//**
-  Add button to choice dialog.
-***********************************************************************/
-void choice_dialog_add(GtkWidget *dshell, const gchar *label,
-                       GCallback handler, gpointer data,
-                       bool meta, const gchar *tool_tip)
-{
-  GtkWidget *button, *bbox;
-  char name[512];
-  int nbuttons;
-
-  bbox = g_object_get_data(G_OBJECT(dshell), "bbox");
-  nbuttons = choice_dialog_get_number_of_buttons(dshell);
-  g_object_set_data(G_OBJECT(dshell), "nbuttons", GINT_TO_POINTER(nbuttons+1));
-
-  fc_snprintf(name, sizeof(name), "button%d", nbuttons);
-
-  button = gtk_button_new_with_mnemonic(label);
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_object_set_data(G_OBJECT(dshell), name, button);
-
-  if (handler) {
-    g_signal_connect(button, "clicked", handler, data);
-  }
-
-  if (!meta) {
-    /* This button makes the choice. */
-    g_signal_connect_after(button, "clicked",
-                           G_CALLBACK(choice_dialog_clicked), dshell);
-  }
-
-  if (tool_tip != NULL) {
-    gtk_widget_set_tooltip_text(button, tool_tip);
-  }
-}
-
-/*******************************************************************//**
-  Choice dialog construction ready
-***********************************************************************/
-void choice_dialog_end(GtkWidget *dshell)
-{
-  GtkWidget *bbox;
-
-  bbox = g_object_get_data(G_OBJECT(dshell), "bbox");
-
-  gtk_widget_set_visible(bbox, TRUE);
-  gtk_widget_set_visible(dshell, TRUE);
-}
-
-/*******************************************************************//**
-  Set hide property of choice dialog
-***********************************************************************/
-void choice_dialog_set_hide(GtkWidget *dshell, gboolean setting)
-{
-  g_object_set_data(G_OBJECT(dshell), "hide", GINT_TO_POINTER(setting));
-}
-
-/*******************************************************************//**
-  Open new choice dialog.
-***********************************************************************/
-GtkWidget *popup_choice_dialog(GtkWindow *parent, const gchar *dialogname,
-                               const gchar *text, ...)
-{
-  GtkWidget *dshell;
-  va_list args;
-  gchar *name;
-
-  dshell = choice_dialog_start(parent, dialogname, text);
-
-  va_start(args, text);
-
-  while ((name = va_arg(args, gchar *))) {
-    GCallback handler;
-    gpointer data;
-
-    handler = va_arg(args, GCallback);
-    data = va_arg(args, gpointer);
-
-    choice_dialog_add(dshell, name, handler, data, FALSE, NULL);
-  }
-
-  va_end(args);
-
-  choice_dialog_end(dshell);
-
-  return dshell;
-}
-
-/*******************************************************************//**
-  Free choice dialog.
-***********************************************************************/
-void choice_dialog_destroy(GtkWidget *dlg)
-{
-  if (dlg != NULL) {
-    gtk_window_destroy(GTK_WINDOW(dlg));
-  }
-}
diff --git a/client/gui-gtk-5.0/choice_dialog.h b/client/gui-gtk-5.0/choice_dialog.h
deleted file mode 100644
index 3e1051f2ce..0000000000
--- a/client/gui-gtk-5.0/choice_dialog.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CHOICE_DIALOG_H
-#define FC__CHOICE_DIALOG_H
-
-#include <gtk/gtk.h>
-
-GtkWidget *popup_choice_dialog(GtkWindow *parent, const gchar *dialogname,
-                               const gchar *text, ...);
-
-void choice_dialog_set_hide(GtkWidget *dshell, gboolean setting);
-
-GtkWidget *choice_dialog_start(GtkWindow *parent, const gchar *name,
-                               const gchar *text);
-void choice_dialog_destroy(GtkWidget *dlg);
-void choice_dialog_add(GtkWidget *dshell, const gchar *label,
-                       GCallback handler, gpointer data,
-                       bool meta, const gchar *tool_tip);
-void choice_dialog_end(GtkWidget *dshell);
-int choice_dialog_get_number_of_buttons(GtkWidget *cd);
-void choice_dialog_button_set_sensitive(GtkWidget *shl, int button,
-                                        gboolean state);
-void choice_dialog_button_set_label(GtkWidget *cd, int button,
-                                    const char *label);
-void choice_dialog_button_set_tooltip(GtkWidget *cd, int number,
-                                      const char *tool_tip);
-void choice_dialog_button_move_to_the_end(GtkWidget *cd,
-                                          const int number);
-#endif /* FC__CHOICE_DIALOG_H */
diff --git a/client/gui-gtk-5.0/citizensinfo.c b/client/gui-gtk-5.0/citizensinfo.c
deleted file mode 100644
index 800a55467d..0000000000
--- a/client/gui-gtk-5.0/citizensinfo.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* common */
-#include "citizens.h"
-#include "city.h"
-#include "nation.h"
-#include "player.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_stuff.h"
-#include "plrdlg.h"
-
-#include "citizensinfo.h"
-
-
-static struct citizens_dialog *citizens_dialog_get(const struct city *pcity);
-static struct citizens_dialog
-  *citizens_dialog_create(const struct city *pcity);
-static GtkTreeStore *citizens_dialog_store_new(void);
-static int citizens_dialog_default_sort_column(void);
-static void citizens_dialog_row(GtkTreeStore *store, GtkTreeIter *it,
-                                const struct city *pcity,
-                                const struct player_slot *pslot);
-
-static const char *col_nation(const struct city *pcity,
-                              const struct player_slot *pslot);
-static const char *col_citizens(const struct city *pcity,
-                                const struct player_slot *pslot);
-
-/*****************************************************************************
-  The layout of the citizens display.
-*****************************************************************************/
-static struct citizens_column {
-  bool show;
-  enum player_dlg_column_type type;
-  const char *title;
-  const char *(*func)(const struct city *, const struct player_slot *);
-                                       /* if type = COL_*TEXT */
-  const char *tagname;                 /* for save_options */
-} citizens_cols[] = {
-  {TRUE, COL_RIGHT_TEXT, N_("#"), col_citizens, "citizens"},
-  {TRUE, COL_FLAG, N_("Flag"), NULL, "flag"},
-  {TRUE, COL_TEXT, N_("Nation"), col_nation, "nation"}
-};
-static const int num_citizens_cols = ARRAY_SIZE(citizens_cols);
-#define CITIZENS_DLG_COL_STYLE       (0 + num_citizens_cols)
-#define CITIZENS_DLG_COL_WEIGHT      (1 + num_citizens_cols)
-#define CITIZENS_DLG_COL_ID          (2 + num_citizens_cols)
-
-/*****************************************************************************
-  The citizens dialog.
-*****************************************************************************/
-struct citizens_dialog {
-  const struct city *pcity;
-  GtkWidget *shell;
-  GtkTreeStore *store;
-  GtkWidget *list;
-  GtkTreeModel *sort;
-};
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct citizens_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct citizens_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-
-/*************************************************************************//**
-  The name of the player's nation for the plrdlg.
-*****************************************************************************/
-static const char *col_nation(const struct city *pcity,
-                              const struct player_slot *pslot)
-{
-  return nation_adjective_for_player(player_slot_get_player(pslot));
-}
-
-/*************************************************************************//**
-  The number of citizens for the player in the city.
-*****************************************************************************/
-static const char *col_citizens(const struct city *pcity,
-                                const struct player_slot *pslot)
-{
-  citizens nationality = citizens_nation_get(pcity, pslot);
-
-  if (nationality == 0) {
-    return "-";
-  } else {
-    static char buf[8];
-
-    fc_snprintf(buf, sizeof(buf), "%d", nationality);
-
-    return buf;
-  }
-}
-
-/*************************************************************************//**
-  Create a citizens dialog store.
-
-  FIXME: copy of players_dialog_store_new();
-*****************************************************************************/
-static GtkTreeStore *citizens_dialog_store_new(void)
-{
-  GtkTreeStore *store;
-  GType model_types[num_citizens_cols + 3];
-  int i;
-
-  for (i = 0; i < num_citizens_cols; i++) {
-    switch (citizens_cols[i].type) {
-    case COL_FLAG:
-      model_types[i] = GDK_TYPE_PIXBUF;
-      break;
-    case COL_COLOR:
-      model_types[i] = GDK_TYPE_PIXBUF;
-      break;
-    case COL_BOOLEAN:
-      model_types[i] = G_TYPE_BOOLEAN;
-      break;
-    case COL_TEXT:
-    case COL_RIGHT_TEXT:
-      model_types[i] = G_TYPE_STRING;
-      break;
-    }
-  }
-  /* special (invisible rows) - Text style, weight and player id */
-  model_types[i++] = G_TYPE_INT;        /* CITIZENS_DLG_COL_STYLE. */
-  model_types[i++] = G_TYPE_INT;        /* CITIZENS_DLG_COL_WEIGHT. */
-  model_types[i++] = G_TYPE_INT;        /* CITIZENS_DLG_COL_ID. */
-
-  store = gtk_tree_store_newv(i, model_types);
-
-  return store;
-}
-
-/*************************************************************************//**
-  Returns column to sort by by default
-*****************************************************************************/
-static int citizens_dialog_default_sort_column(void)
-{
-  return 0;
-}
-
-/*************************************************************************//**
-  Create citizens dialog
-*****************************************************************************/
-static struct citizens_dialog *citizens_dialog_create(const struct city *pcity)
-{
-  GtkWidget *frame, *sw;
-  struct citizens_dialog *pdialog = fc_malloc(sizeof(struct citizens_dialog));
-  int i;
-
-  pdialog->pcity = pcity;
-  pdialog->store = citizens_dialog_store_new();
-  pdialog->sort
-    = gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(pdialog->store));
-  g_object_unref(pdialog->store);
-
-  gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(pdialog->sort),
-                                       citizens_dialog_default_sort_column(),
-                                       GTK_SORT_DESCENDING);
-
-  pdialog->list
-    = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pdialog->sort));
-  gtk_widget_set_halign(pdialog->list, GTK_ALIGN_CENTER);
-  g_object_unref(pdialog->sort);
-
-  for (i = 0; i < num_citizens_cols; i++) {
-    struct citizens_column *pcol;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *col;
-
-    pcol = &citizens_cols[i];
-    col = NULL;
-
-    switch (pcol->type) {
-    case COL_FLAG:
-      renderer = gtk_cell_renderer_pixbuf_new();
-      col = gtk_tree_view_column_new_with_attributes(_(pcol->title), renderer,
-              "pixbuf", i, NULL);
-      break;
-    case COL_TEXT:
-      renderer = gtk_cell_renderer_text_new();
-      g_object_set(renderer, "style-set", TRUE, "weight-set", TRUE, NULL);
-
-      col = gtk_tree_view_column_new_with_attributes(_(pcol->title), renderer,
-              "text", i,
-              "style", CITIZENS_DLG_COL_STYLE,
-              "weight", CITIZENS_DLG_COL_WEIGHT,
-              NULL);
-      gtk_tree_view_column_set_sort_column_id(col, i);
-      break;
-    case COL_RIGHT_TEXT:
-      renderer = gtk_cell_renderer_text_new();
-      g_object_set(renderer, "style-set", TRUE, "weight-set", TRUE, NULL);
-
-      col = gtk_tree_view_column_new_with_attributes(_(pcol->title), renderer,
-              "text", i,
-              "style", CITIZENS_DLG_COL_STYLE,
-              "weight", CITIZENS_DLG_COL_WEIGHT,
-              NULL);
-      gtk_tree_view_column_set_sort_column_id(col, i);
-      g_object_set(renderer, "xalign", 1.0, NULL);
-      gtk_tree_view_column_set_alignment(col, 1.0);
-      break;
-    case COL_COLOR:
-    case COL_BOOLEAN:
-      /* These are not used. */
-      fc_assert(pcol->type != COL_COLOR && pcol->type != COL_BOOLEAN);
-      continue;
-    }
-
-    if (col) {
-      gtk_tree_view_append_column(GTK_TREE_VIEW(pdialog->list), col);
-    }
-  }
-
-  gtk_widget_set_hexpand(GTK_WIDGET(pdialog->list), TRUE);
-  gtk_widget_set_vexpand(GTK_WIDGET(pdialog->list), TRUE);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), FALSE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), pdialog->list);
-
-  frame = gtk_frame_new(_("Citizens"));
-  gtk_frame_set_child(GTK_FRAME(frame), sw);
-
-  pdialog->shell = frame;
-
-  dialog_list_prepend(dialog_list, pdialog);
-
-  citizens_dialog_refresh(pcity);
-
-  return pdialog;
-}
-
-/*************************************************************************//**
-  Initialize citizens dialog
-*****************************************************************************/
-void citizens_dialog_init(void)
-{
-  dialog_list = dialog_list_new();
-}
-
-/*************************************************************************//**
-  Free resources allocated for citizens dialog
-*****************************************************************************/
-void citizens_dialog_done(void)
-{
-  dialog_list_destroy(dialog_list);
-}
-
-/*************************************************************************//**
-  Get citizen dialog of the given city
-*****************************************************************************/
-static struct citizens_dialog *citizens_dialog_get(const struct city *pcity)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pcity == pcity) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/*************************************************************************//**
-  Refresh citizen dialog of the given city
-*****************************************************************************/
-void citizens_dialog_refresh(const struct city *pcity)
-{
-  struct citizens_dialog *pdialog = citizens_dialog_get(pcity);
-
-  if (pdialog == NULL) {
-    return;
-  }
-
-  gtk_tree_store_clear(pdialog->store);
-  citizens_iterate(pcity, pslot, nationality) {
-    GtkTreeIter iter;
-
-    gtk_tree_store_append(pdialog->store, &iter, NULL);
-    citizens_dialog_row(pdialog->store, &iter, pcity, pslot);
-  } citizens_iterate_end;
-}
-
-/*************************************************************************//**
-  Fills the citizens list with the data for 'pslot' at the row given by 'it'.
-*****************************************************************************/
-static void citizens_dialog_row(GtkTreeStore *store, GtkTreeIter *it,
-                                const struct city *pcity,
-                                const struct player_slot *pslot)
-{
-  GdkPixbuf *pixbuf;
-  int style = PANGO_STYLE_NORMAL, weight = PANGO_WEIGHT_NORMAL;
-  int k;
-
-  for (k = 0; k < num_citizens_cols; k++) {
-    struct citizens_column *pcol = &citizens_cols[k];
-    switch (pcol->type) {
-    case COL_TEXT:
-    case COL_RIGHT_TEXT:
-      gtk_tree_store_set(store, it, k, pcol->func(pcity, pslot), -1);
-      break;
-    case COL_FLAG:
-      pixbuf = get_flag(nation_of_player(player_slot_get_player(pslot)));
-      if (pixbuf != NULL) {
-        gtk_tree_store_set(store, it, k, pixbuf, -1);
-        g_object_unref(pixbuf);
-      }
-      break;
-    case COL_COLOR:
-    case COL_BOOLEAN:
-      /* These are not used. */
-      fc_assert(pcol->type != COL_COLOR && pcol->type != COL_BOOLEAN);
-      continue;
-      break;
-    }
-  }
-
-  if (city_owner(pcity)->slot == pslot) {
-    weight = PANGO_WEIGHT_BOLD;
-    style = PANGO_STYLE_NORMAL;
-  }
-
-  gtk_tree_store_set(store, it,
-                     CITIZENS_DLG_COL_STYLE, style,
-                     CITIZENS_DLG_COL_WEIGHT, weight,
-                     CITIZENS_DLG_COL_ID, player_slot_index(pslot),
-                     -1);
-}
-
-/*************************************************************************//**
-  Close citizens dialog of one city
-*****************************************************************************/
-void citizens_dialog_close(const struct city *pcity)
-{
-  struct citizens_dialog *pdialog = citizens_dialog_get(pcity);
-
-  if (pdialog == nullptr) {
-    return;
-  }
-
-  gtk_widget_set_visible(pdialog->shell, FALSE);
-
-  dialog_list_remove(dialog_list, pdialog);
-
-  gtk_box_remove(GTK_BOX(gtk_widget_get_parent(pdialog->shell)),
-                 pdialog->shell);
-  free(pdialog);
-}
-
-/*************************************************************************//**
-  Make citizen dialog of the city visible.
-*****************************************************************************/
-GtkWidget *citizens_dialog_display(const struct city *pcity)
-{
-  struct citizens_dialog *pdialog = citizens_dialog_get(pcity);
-
-  if (pdialog == nullptr) {
-    pdialog = citizens_dialog_create(pcity);
-  }
-
-  gtk_widget_set_visible(pdialog->shell, TRUE);
-  citizens_dialog_refresh(pcity);
-
-  return pdialog->shell;
-}
diff --git a/client/gui-gtk-5.0/citizensinfo.h b/client/gui-gtk-5.0/citizensinfo.h
deleted file mode 100644
index 7e5eb1eccb..0000000000
--- a/client/gui-gtk-5.0/citizensinfo.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-#ifndef FC__CITIZENSINFO_H
-#define FC__CITIZENSINFO_H
-
-#include <gtk/gtk.h>
-
-struct city;
-
-void citizens_dialog_init(void);
-void citizens_dialog_done(void);
-
-GtkWidget *citizens_dialog_display(const struct city *pcity);
-void citizens_dialog_refresh(const struct city *pcity);
-void citizens_dialog_close(const struct city *pcity);
-
-#endif  /* FC__CITIZENSINFO_H */
diff --git a/client/gui-gtk-5.0/citydlg.c b/client/gui-gtk-5.0/citydlg.c
deleted file mode 100644
index a319355eb7..0000000000
--- a/client/gui-gtk-5.0/citydlg.c
+++ /dev/null
@@ -1,4019 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "bitvector.h"
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "city.h"
-#include "counters.h"
-#include "game.h"
-#include "map.h"
-#include "movement.h"
-#include "packets.h"
-#include "player.h"
-#include "unitlist.h"
-
-/* client */
-#include "chatline_common.h"
-#include "client_main.h"
-#include "colors.h"
-#include "control.h"
-#include "climap.h"
-#include "options.h"
-#include "text.h"
-#include "tilespec.h"
-
-/* client/agents */
-#include "cma_fec.h"
-
-/* client/gui-gtk-5.0 */
-#include "choice_dialog.h"
-#include "citizensinfo.h"
-#include "cityrep.h"
-#include "cma_fe.h"
-#include "dialogs.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "happiness.h"
-#include "helpdlg.h"
-#include "inputdlg.h"
-#include "mapview.h"
-#include "update_queue.h"
-#include "wldlg.h"
-
-#include "citydlg.h"
-
-#define CITYMAP_WIDTH MIN(512, canvas_width)
-#define CITYMAP_HEIGHT (CITYMAP_WIDTH * canvas_height / canvas_width)
-#define CITYMAP_SCALE ((double)CITYMAP_WIDTH / (double)canvas_width)
-
-#define TINYSCREEN_MAX_HEIGHT (500 - 1)
-
-/* Only CDLGR_UNITS button currently uses these, others have
- * direct callback. */
-enum citydlg_response { CDLGR_UNITS, CDLGR_PREV, CDLGR_NEXT };
-
-struct city_dialog;
-
-/* Get 'struct dialog_list' and related function */
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct city_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-struct unit_node {
-  GtkWidget *cmd;
-  GtkWidget *pix;
-  int height;
-  GtkEventController *left;
-  GtkEventController *middle;
-  GtkEventController *right;
-};
-
-/* Get 'struct unit_node' and related function */
-#define SPECVEC_TAG unit_node
-#define SPECVEC_TYPE struct unit_node
-#include "specvec.h"
-
-#define unit_node_vector_iterate(list, elt) \
-    TYPED_VECTOR_ITERATE(struct unit_node, list, elt)
-#define unit_node_vector_iterate_end  VECTOR_ITERATE_END
-
-#define NUM_CITIZENS_SHOWN 30
-
-enum { OVERVIEW_PAGE, WORKLIST_PAGE, HAPPINESS_PAGE, COUNTERS_PAGE,
-    CMA_PAGE, SETTINGS_PAGE, STICKY_PAGE,
-    NUM_PAGES  /* The number of pages in city dialog notebook
-                * must match the entries in misc_whichtab_label[] */
-};
-
-enum {
-    INFO_SIZE, INFO_FOOD, INFO_SHIELD, INFO_TRADE, INFO_GOLD,
-    INFO_LUXURY, INFO_SCIENCE, INFO_GRANARY, INFO_GROWTH,
-    INFO_CORRUPTION, INFO_WASTE, INFO_CULTURE, INFO_POLLUTION,
-    INFO_ILLNESS, INFO_STEAL, INFO_AIRLIFT,
-    NUM_INFO_FIELDS /* Number of fields in city_info panel
-                     * must match entries in output_label[] */
-};
-
-/* Minimal size for the city map scrolling windows */
-#define CITY_MAP_MIN_SIZE_X  200
-#define CITY_MAP_MIN_SIZE_Y  150
-
-struct city_map_canvas {
-  GtkWidget *sw;
-  GtkWidget *darea;
-};
-
-struct city_dialog {
-  struct city *pcity;
-
-  GtkWidget *shell;
-  GtkWidget *name_label;
-  cairo_surface_t *map_canvas_store_unscaled;
-  GtkWidget *notebook;
-
-  GtkWidget *popover;
-  GtkWidget *citizen_pics;
-  cairo_surface_t *citizen_surface;
-
-  struct {
-    struct city_map_canvas map_canvas;
-
-    GtkWidget *production_bar;
-    GtkWidget *buy_command;
-    GListStore *improvement_list;
-
-    GtkWidget *supported_units_frame;
-    GtkWidget *supported_unit_table;
-
-    GtkWidget *present_units_frame;
-    GtkWidget *present_unit_table;
-
-    struct unit_node_vector supported_units;
-    struct unit_node_vector present_units;
-
-    GtkWidget *info_label[NUM_INFO_FIELDS];
-
-    GListStore *change_prod_store;
-    GtkSingleSelection *change_prod_selection;
-   } overview;
-
-  struct {
-    GtkWidget *production_label;
-    GtkWidget *production_bar;
-    GtkWidget *buy_command;
-    GtkWidget *worklist;
-  } production;
-
-  struct {
-    struct city_map_canvas map_canvas;
-
-    GtkWidget *widget;
-    GtkWidget *info_label[NUM_INFO_FIELDS];
-    GtkWidget *citizens;
-  } happiness;
-
-  struct {
-    GtkBox *container;
-    GtkBox *widget;
-  } counters;
-
-  struct cma_dialog *cma_editor;
-
-  struct {
-    GtkWidget *rename_command;
-    GtkWidget *new_citizens_radio[3];
-    GtkWidget *disband_on_settler;
-    GtkWidget *whichtab_radio[NUM_PAGES];
-    short block_signal;
-  } misc;
-
-  GtkWidget *sell_shell;
-  GtkTreeSelection *change_selection;
-  GtkWidget *rename_shell;
-
-  GtkWidget *show_units_command;
-  GtkWidget *prev_command;
-  GtkWidget *next_command;
-
-  Impr_type_id sell_id;
-
-  int cwidth;
-};
-
-static struct dialog_list *dialog_list;
-static bool city_dialogs_have_been_initialised = FALSE;
-static int canvas_width, canvas_height;
-static int new_dialog_def_page = OVERVIEW_PAGE;
-static int last_page = OVERVIEW_PAGE;
-
-static bool is_showing_workertask_dialog = FALSE;
-
-static struct
-{
-  struct city *owner;
-  struct tile *loc;
-} workertask_req;
-
-static bool low_citydlg;
-
-/****************************************/
-
-static void initialize_city_dialogs(void);
-static void city_dialog_map_create(struct city_dialog *pdialog,
-                                   struct city_map_canvas *cmap_canvas);
-static void city_dialog_map_recenter(GtkWidget *map_canvas_sw);
-
-static struct city_dialog *get_city_dialog(struct city *pcity);
-static gboolean citydlg_keyboard_handler(GtkEventControllerKey *controller,
-                                         guint keyval,
-                                         guint keycode,
-                                         GdkModifierType state,
-                                         gpointer data);
-
-static GtkWidget *create_city_info_table(struct city_dialog *pdialog,
-                                         GtkWidget **info_label);
-static void create_and_append_overview_page(struct city_dialog *pdialog);
-static void create_and_append_map_page(struct city_dialog *pdialog);
-static void create_and_append_buildings_page(struct city_dialog *pdialog);
-static void create_and_append_worklist_page(struct city_dialog *pdialog);
-static void create_and_append_happiness_page(struct city_dialog *pdialog);
-static void create_and_append_cma_page(struct city_dialog *pdialog);
-static void create_and_append_settings_page(struct city_dialog *pdialog);
-
-static struct city_dialog *create_city_dialog(struct city *pcity);
-
-static void city_dialog_update_title(struct city_dialog *pdialog);
-static void city_dialog_update_citizens(struct city_dialog *pdialog);
-static void city_dialog_update_counters(struct city_dialog *pdialog);
-static void city_dialog_update_information(GtkWidget **info_label,
-                                           struct city_dialog *pdialog);
-static void city_dialog_update_map(struct city_dialog *pdialog);
-static void city_dialog_update_building(struct city_dialog *pdialog);
-static void city_dialog_update_improvement_list(struct city_dialog
-                                                *pdialog);
-static void city_dialog_update_supported_units(struct city_dialog
-                                               *pdialog);
-static void city_dialog_update_present_units(struct city_dialog *pdialog);
-static void city_dialog_update_prev_next(void);
-
-static void show_units_response(void *data);
-
-static gboolean supported_unit_callback(GtkGestureClick *gesture, int n_press,
-                                        double x, double y, gpointer data);
-static gboolean present_unit_callback(GtkGestureClick *gesture, int n_press,
-                                      double x, double y, gpointer data);
-static gboolean middle_supported_unit_release(GtkGestureClick *gesture, int n_press,
-                                              double x, double y, gpointer data);
-static gboolean middle_present_unit_release(GtkGestureClick *gesture, int n_press,
-                                            double x, double y, gpointer data);
-static gboolean right_unit_release(GtkGestureClick *gesture, int n_press,
-                                   double x, double y, gpointer data);
-
-static void close_citydlg_unit_popover(struct city_dialog *pdialog);
-
-static void unit_center_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data);
-static void unit_activate_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data);
-static void supported_unit_activate_close_callback(GSimpleAction *action,
-                                                   GVariant *parameter,
-                                                   gpointer data);
-static void present_unit_activate_close_callback(GSimpleAction *action,
-                                                 GVariant *parameter,
-                                                 gpointer data);
-static void unit_load_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data);
-static void unit_unload_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data);
-static void unit_sentry_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data);
-static void unit_fortify_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data);
-static void unit_disband_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data);
-static void unit_homecity_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data);
-static void unit_upgrade_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data);
-static gboolean citizens_callback(GtkGestureClick *gesture, int n_press,
-                                  double x, double y, gpointer data);
-static gboolean left_button_down_citymap(GtkGestureClick *gesture, int n_press,
-                                         double x, double y, gpointer data);
-static gboolean right_button_down_citymap(GtkGestureClick *gesture, int n_press,
-                                          double x, double y, gpointer data);
-static void draw_map_canvas(struct city_dialog *pdialog);
-
-static void buy_callback(GtkWidget * w, gpointer data);
-static void change_production_callback(GtkSelectionModel *self,
-                                       guint position,
-                                       guint n_items,
-                                       gpointer data);
-
-static void sell_callback(const struct impr_type *pimprove, gpointer data);
-static void sell_callback_response(GtkWidget *w, gint response, gpointer data);
-
-static void impr_callback(GtkColumnView *self, guint position,
-                          gpointer data);
-
-static void rename_callback(GtkWidget * w, gpointer data);
-static void rename_popup_callback(gpointer data, gint response,
-                                  const char *input);
-static void set_cityopt_values(struct city_dialog *pdialog);
-static void cityopt_callback(GtkWidget * w, gpointer data);
-static void misc_whichtab_callback(GtkWidget * w, gpointer data);
-
-static void city_destroy_callback(GtkWidget *w, gpointer data);
-static void close_city_dialog(struct city_dialog *pdialog);
-static void citydlg_response_callback(GtkDialog *dlg, gint response,
-                                      void *data);
-static void close_callback(GtkWidget *w, gpointer data);
-static void switch_city_callback(GtkWidget *w, gpointer data);
-
-#define FC_TYPE_IMPR_ROW (fc_impr_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcImprRow, fc_impr_row, FC, IMPR_ROW, GObject)
-
-struct _FcImprRow
-{
-  GObject parent_instance;
-
-  const struct impr_type *impr;
-  GdkPixbuf *sprite;
-  char *description;
-  int upkeep;
-  bool redundant;
-  const char *tooltip;
-};
-
-struct _FcImprClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcImprRow, fc_impr_row, G_TYPE_OBJECT)
-
-#define IMPR_ROW_PIXBUF 0
-#define IMPR_ROW_DESC   1
-#define IMPR_ROW_UPKEEP 2
-
-#define FC_TYPE_PROD_ROW (fc_prod_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcProdRow, fc_prod_row, FC, PROD_ROW, GObject)
-
-struct _FcProdRow
-{
-  GObject parent_instance;
-
-  const char *name;
-  int id;
-  GdkPixbuf *sprite;
-  bool useless;
-};
-
-struct _FcProdClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcProdRow, fc_prod_row, G_TYPE_OBJECT)
-
-#define PROD_ROW_PIXBUF 0
-#define PROD_ROW_NAME   1
-
-/**********************************************************************//**
-  Finalizing method for FcImprRow class
-**************************************************************************/
-static void fc_impr_row_finalize(GObject *gobject)
-{
-  FcImprRow *row = FC_IMPR_ROW(gobject);
-
-  if (row->sprite != nullptr) {
-    g_object_unref(G_OBJECT(row->sprite));
-    row->sprite = nullptr;
-  }
-
-  G_OBJECT_CLASS(fc_impr_row_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcImprRow class
-**************************************************************************/
-static void
-fc_impr_row_class_init(FcImprRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_impr_row_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcImprRow
-**************************************************************************/
-static void
-fc_impr_row_init(FcImprRow *self)
-{
-  self->sprite = nullptr;
-}
-
-/**********************************************************************//**
-  FcImprRow creation method
-**************************************************************************/
-static FcImprRow *fc_impr_row_new(void)
-{
-  FcImprRow *result;
-
-  result = g_object_new(FC_TYPE_IMPR_ROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  Finalizing method for FcProdRow class
-**************************************************************************/
-static void fc_prod_row_finalize(GObject *gobject)
-{
-  FcProdRow *row = FC_PROD_ROW(gobject);
-
-  if (row->sprite != nullptr) {
-    g_object_unref(G_OBJECT(row->sprite));
-    row->sprite = nullptr;
-  }
-
-  G_OBJECT_CLASS(fc_prod_row_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcProdRow class
-**************************************************************************/
-static void
-fc_prod_row_class_init(FcProdRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_prod_row_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcProdRow
-**************************************************************************/
-static void
-fc_prod_row_init(FcProdRow *self)
-{
-  self->sprite = nullptr;
-}
-
-/**********************************************************************//**
-  FcProdRow creation method
-**************************************************************************/
-static FcProdRow *fc_prod_row_new(void)
-{
-  FcProdRow *result;
-
-  result = g_object_new(FC_TYPE_PROD_ROW, nullptr);
-
-  return result;
-}
-
-/***********************************************************************//**
-  Called to set the dimensions of the city dialog, both on
-  startup and if the tileset is changed.
-***************************************************************************/
-static void init_citydlg_dimensions(void)
-{
-  canvas_width = get_citydlg_canvas_width();
-  canvas_height = get_citydlg_canvas_height();
-}
-
-/***********************************************************************//**
-  Initialize stuff needed for city dialogs
-***************************************************************************/
-static void initialize_city_dialogs(void)
-{
-  int height;
-
-  fc_assert_ret(!city_dialogs_have_been_initialised);
-
-  dialog_list = dialog_list_new();
-  init_citydlg_dimensions();
-  height = screen_height();
-
-  /* Use default layout when height cannot be determined
-   * (when height == 0) */
-  if (height > 0 && height <= TINYSCREEN_MAX_HEIGHT) {
-    low_citydlg = TRUE;
-  } else {
-    low_citydlg = FALSE;
-  }
-
-  city_dialogs_have_been_initialised = TRUE;
-}
-
-/***********************************************************************//**
-  Called when the tileset changes.
-***************************************************************************/
-void reset_city_dialogs(void)
-{
-  if (!city_dialogs_have_been_initialised) {
-    return;
-  }
-
-  init_citydlg_dimensions();
-
-  dialog_list_iterate(dialog_list, pdialog) {
-    /* There's no reasonable way to resize a GtkImage, so we don't try.
-       Instead we just redraw the overview within the existing area.
-       The player has to close and reopen the dialog to fix this. */
-    city_dialog_update_map(pdialog);
-  } dialog_list_iterate_end;
-
-  popdown_all_city_dialogs();
-}
-
-/***********************************************************************//**
-  Return city dialog of the given city, or NULL is it doesn't
-  already exist
-***************************************************************************/
-static struct city_dialog *get_city_dialog(struct city *pcity)
-{
-  if (!city_dialogs_have_been_initialised) {
-    initialize_city_dialogs();
-  }
-
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pcity == pcity) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/***********************************************************************//**
-  Redraw map canvas.
-***************************************************************************/
-static void canvas_draw_cb(GtkDrawingArea *w, cairo_t *cr,
-                           int width, int height, gpointer data)
-{
-  struct city_dialog *pdialog = data;
-
-  cairo_scale(cr, CITYMAP_SCALE, CITYMAP_SCALE);
-  cairo_set_source_surface(cr, pdialog->map_canvas_store_unscaled, 0, 0);
-  if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-    cairo_paint_with_alpha(cr, 0.5);
-  } else {
-    cairo_paint(cr);
-  }
-}
-
-/***********************************************************************//**
-  Create a city map widget; used in the overview and in the happiness page.
-***************************************************************************/
-static void city_dialog_map_create(struct city_dialog *pdialog,
-                                   struct city_map_canvas *cmap_canvas)
-{
-  GtkWidget *sw, *darea;
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW(sw),
-                                            CITYMAP_WIDTH);
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw),
-                                             CITYMAP_HEIGHT);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), FALSE);
-
-  darea = gtk_drawing_area_new();
-  gtk_widget_set_size_request(darea, CITYMAP_WIDTH, CITYMAP_HEIGHT);
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(darea),
-                                 canvas_draw_cb, pdialog, NULL);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(left_button_down_citymap), pdialog);
-  gtk_widget_add_controller(darea, controller);
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(right_button_down_citymap), pdialog);
-  gtk_widget_add_controller(darea, controller);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), darea);
-
-  /* save all widgets for the city map */
-  cmap_canvas->sw = sw;
-  cmap_canvas->darea = darea;
-}
-
-/***********************************************************************//**
-  Center city dialog map.
-***************************************************************************/
-static void city_dialog_map_recenter(GtkWidget *map_canvas_sw)
-{
-  GtkAdjustment *adjust = NULL;
-  gdouble value;
-
-  fc_assert_ret(map_canvas_sw != NULL);
-
-  adjust = gtk_scrolled_window_get_hadjustment(
-    GTK_SCROLLED_WINDOW(map_canvas_sw));
-  value = (gtk_adjustment_get_lower(adjust)
-    + gtk_adjustment_get_upper(adjust)
-    - gtk_adjustment_get_page_size(adjust)) / 2;
-  gtk_adjustment_set_value(adjust, value);
-
-  adjust = gtk_scrolled_window_get_vadjustment(
-    GTK_SCROLLED_WINDOW(map_canvas_sw));
-  value = (gtk_adjustment_get_lower(adjust)
-    + gtk_adjustment_get_upper(adjust)
-    - gtk_adjustment_get_page_size(adjust)) / 2;
-  gtk_adjustment_set_value(adjust, value);
-}
-
-/***********************************************************************//**
-  Refresh city dialog of the given city
-***************************************************************************/
-void real_city_dialog_refresh(struct city *pcity)
-{
-  struct city_dialog *pdialog = get_city_dialog(pcity);
-
-  log_debug("CITYMAP_WIDTH:  %d", CITYMAP_WIDTH);
-  log_debug("CITYMAP_HEIGHT: %d", CITYMAP_HEIGHT);
-  log_debug("CITYMAP_SCALE:  %.3f", CITYMAP_SCALE);
-
-  if (city_owner(pcity) == client.conn.playing) {
-    city_report_dialog_update_city(pcity);
-    economy_report_dialog_update();
-  }
-
-  if (!pdialog) {
-    return;
-  }
-
-  city_dialog_update_title(pdialog);
-  city_dialog_update_citizens(pdialog);
-  city_dialog_update_counters(pdialog);
-  city_dialog_update_information(pdialog->overview.info_label, pdialog);
-  city_dialog_update_map(pdialog);
-  city_dialog_update_building(pdialog);
-  city_dialog_update_improvement_list(pdialog);
-  city_dialog_update_supported_units(pdialog);
-  city_dialog_update_present_units(pdialog);
-
-  if (!client_has_player() || city_owner(pcity) == client_player()) {
-    bool have_present_units = (unit_list_size(pcity->tile->units) > 0);
-
-    refresh_worklist(pdialog->production.worklist);
-
-    if (!low_citydlg) {
-      city_dialog_update_information(pdialog->happiness.info_label, pdialog);
-    }
-    refresh_happiness_dialog(pdialog->pcity);
-    if (game.info.citizen_nationality) {
-      citizens_dialog_refresh(pdialog->pcity);
-    }
-
-    if (!client_is_observer()) {
-      refresh_cma_dialog(pdialog->pcity, REFRESH_ALL);
-    }
-
-    gtk_widget_set_sensitive(pdialog->show_units_command,
-                             can_client_issue_orders()
-                             && have_present_units);
-  } else {
-    /* Set the buttons we do not want live while a Diplomat investigates */
-    gtk_widget_set_sensitive(pdialog->show_units_command, FALSE);
-  }
-}
-
-/***********************************************************************//**
-  Refresh city dialogs of unit's homecity and city where unit
-  currently is.
-***************************************************************************/
-void refresh_unit_city_dialogs(struct unit *punit)
-{
-  struct city *pcity_sup, *pcity_pre;
-  struct city_dialog *pdialog;
-
-  pcity_sup = game_city_by_number(punit->homecity);
-  pcity_pre = tile_city(unit_tile(punit));
-
-  if (pcity_sup && (pdialog = get_city_dialog(pcity_sup))) {
-    city_dialog_update_supported_units(pdialog);
-  }
-
-  if (pcity_pre && (pdialog = get_city_dialog(pcity_pre))) {
-    city_dialog_update_present_units(pdialog);
-  }
-}
-
-/***********************************************************************//**
-  Popup the dialog 10% inside the main-window
-***************************************************************************/
-void real_city_dialog_popup(struct city *pcity)
-{
-  struct city_dialog *pdialog;
-
-  if (!(pdialog = get_city_dialog(pcity))) {
-    pdialog = create_city_dialog(pcity);
-  }
-
-  gtk_window_present(GTK_WINDOW(pdialog->shell));
-
-  /* center the city map(s); this must be *after* the city dialog was drawn
-   * else the size information is missing! */
-  city_dialog_map_recenter(pdialog->overview.map_canvas.sw);
-  if (pdialog->happiness.map_canvas.sw) {
-    city_dialog_map_recenter(pdialog->happiness.map_canvas.sw);
-  }
-}
-
-/***********************************************************************//**
-  Return whether city dialog for given city is open
-***************************************************************************/
-bool city_dialog_is_open(struct city *pcity)
-{
-  return get_city_dialog(pcity) != NULL;
-}
-
-/***********************************************************************//**
-  Popdown the dialog
-***************************************************************************/
-void popdown_city_dialog(struct city *pcity)
-{
-  struct city_dialog *pdialog = get_city_dialog(pcity);
-
-  if (pdialog) {
-    close_city_dialog(pdialog);
-  }
-}
-
-/***********************************************************************//**
-  Popdown all dialogs
-***************************************************************************/
-void popdown_all_city_dialogs(void)
-{
-  if (!city_dialogs_have_been_initialised) {
-    return;
-  }
-
-  while (dialog_list_size(dialog_list)) {
-    close_city_dialog(dialog_list_get(dialog_list, 0));
-  }
-  dialog_list_destroy(dialog_list);
-
-  city_dialogs_have_been_initialised = FALSE;
-}
-
-/***********************************************************************//**
-  Keyboard handler for city dialog
-***************************************************************************/
-static gboolean citydlg_keyboard_handler(GtkEventControllerKey *controller,
-                                         guint keyval,
-                                         guint keycode,
-                                         GdkModifierType state,
-                                         gpointer data)
-{
-  struct city_dialog *pdialog = (struct city_dialog *)data;
-
-  if (state & GDK_CONTROL_MASK) {
-    switch (keyval) {
-    case GDK_KEY_Left:
-      gtk_notebook_prev_page(GTK_NOTEBOOK(pdialog->notebook));
-      return TRUE;
-
-    case GDK_KEY_Right:
-      gtk_notebook_next_page(GTK_NOTEBOOK(pdialog->notebook));
-      return TRUE;
-
-    default:
-      break;
-    }
-  }
-
-  return FALSE;
-}
-
-/***********************************************************************//**
-  Popup info dialog
-***************************************************************************/
-static gboolean show_info_popup(GtkGestureClick *gesture, int n_press,
-                                double x, double y, gpointer data)
-{
-  GtkWidget *w = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-  struct city_dialog *pdialog = g_object_get_data(G_OBJECT(w), "pdialog");
-  GtkWidget *p, *label;
-  char buf[1024];
-
-  switch (GPOINTER_TO_UINT(data)) {
-  case INFO_SIZE:
-    fc_snprintf(buf, sizeof(buf), _("Population: %d, Specialists: %d"),
-                pdialog->pcity->size, city_specialists(pdialog->pcity));
-    break;
-  case INFO_FOOD:
-    get_city_dialog_output_text(pdialog->pcity, O_FOOD, buf, sizeof(buf));
-    break;
-  case INFO_SHIELD:
-    get_city_dialog_output_text(pdialog->pcity, O_SHIELD,
-                                buf, sizeof(buf));
-    break;
-  case INFO_TRADE:
-    get_city_dialog_output_text(pdialog->pcity, O_TRADE, buf, sizeof(buf));
-    break;
-  case INFO_GOLD:
-    get_city_dialog_output_text(pdialog->pcity, O_GOLD, buf, sizeof(buf));
-    break;
-  case INFO_SCIENCE:
-    get_city_dialog_output_text(pdialog->pcity, O_SCIENCE,
-                                buf, sizeof(buf));
-    break;
-  case INFO_LUXURY:
-    get_city_dialog_output_text(pdialog->pcity, O_LUXURY,
-                                buf, sizeof(buf));
-    break;
-  case INFO_CULTURE:
-    get_city_dialog_culture_text(pdialog->pcity, buf, sizeof(buf));
-    break;
-  case INFO_POLLUTION:
-    get_city_dialog_pollution_text(pdialog->pcity, buf, sizeof(buf));
-    break;
-  case INFO_ILLNESS:
-    get_city_dialog_illness_text(pdialog->pcity, buf, sizeof(buf));
-    break;
-  case INFO_AIRLIFT:
-    get_city_dialog_airlift_text(pdialog->pcity, buf, sizeof(buf));
-    break;
-  default:
-    return TRUE;
-  }
-
-  p = gtk_popover_new();
-
-  gtk_widget_set_parent(p, w);
-
-  label = gtk_label_new(buf);
-  gtk_widget_set_name(label, "city_label");
-  gtk_widget_set_margin_start(label, 4);
-  gtk_widget_set_margin_end(label, 4);
-  gtk_widget_set_margin_top(label, 4);
-  gtk_widget_set_margin_bottom(label, 4);
-
-  gtk_popover_set_child(GTK_POPOVER(p), label);
-
-  gtk_popover_popup(GTK_POPOVER(p));
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Used once in the overview page and once in the happiness page
-  **info_label points to the info_label in the respective struct
-***************************************************************************/
-static GtkWidget *create_city_info_table(struct city_dialog *pdialog,
-                                         GtkWidget **info_label)
-{
-  int i;
-  GtkWidget *table, *label;
-
-  static const char *output_label[NUM_INFO_FIELDS] = {
-    N_("Size:"),
-    N_("Food:"),
-    N_("Prod:"),
-    N_("Trade:"),
-    N_("Gold:"),
-    N_("Luxury:"),
-    N_("Science:"),
-    N_("Granary:"),
-    N_("Change in:"),
-    N_("Corruption:"),
-    N_("Waste:"),
-    N_("Culture:"),
-    N_("Pollution:"),
-    N_("Plague risk:"),
-    N_("Tech Stolen:"),
-    N_("Airlift:"),
-  };
-  static bool output_label_done;
-  GtkEventController *controller;
-
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 4);
-  gtk_widget_set_margin_end(table, 4);
-  gtk_widget_set_margin_start(table, 4);
-  gtk_widget_set_margin_top(table, 4);
-
-  intl_slist(ARRAY_SIZE(output_label), output_label, &output_label_done);
-
-  for (i = 0; i < NUM_INFO_FIELDS; i++) {
-    label = gtk_label_new(output_label[i]);
-    switch (i) {
-    case INFO_SIZE:
-    case INFO_TRADE:
-    case INFO_SCIENCE:
-    case INFO_GROWTH:
-        gtk_widget_set_margin_bottom(label, 5);
-        break;
-
-    case INFO_FOOD:
-    case INFO_GOLD:
-    case INFO_GRANARY:
-    case INFO_CORRUPTION:
-        gtk_widget_set_margin_top(label, 5);
-        break;
-      default:
-        break;
-    }
-    gtk_widget_set_margin_end(label, 5);
-    gtk_widget_set_name(label, "city_label");   /* For font style? */
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_grid_attach(GTK_GRID(table), label, 0, i, 1, 1);
-
-    label = gtk_label_new("");
-    switch (i) {
-    case INFO_TRADE:
-    case INFO_SCIENCE:
-    case INFO_GROWTH:
-        gtk_widget_set_margin_bottom(label, 5);
-        break;
-
-    case INFO_GOLD:
-    case INFO_GRANARY:
-    case INFO_CORRUPTION:
-        gtk_widget_set_margin_top(label, 5);
-        break;
-      default:
-        break;
-    }
-
-    g_object_set_data(G_OBJECT(label), "pdialog", pdialog);
-
-    controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-    g_signal_connect(controller, "pressed",
-                     G_CALLBACK(show_info_popup), GUINT_TO_POINTER(i));
-    gtk_widget_add_controller(label, controller);
-
-    info_label[i] = label;
-    gtk_widget_set_name(label, "city_label");   /* Ditto */
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-
-    gtk_grid_attach(GTK_GRID(table), label, 1, i, 1, 1);
-  }
-
-  /*
-   * Allow special highlighting of emergencies for granary etc by
-   * city_dialog_update_information().
-   */
-  {
-    /* This will persist, and can be shared between overview and happiness
-     * pages. */
-    static GtkCssProvider *emergency_provider = NULL;
-
-    if (emergency_provider == NULL) {
-      emergency_provider = gtk_css_provider_new();
-
-      gtk_css_provider_load_from_data(emergency_provider,
-                                      ".emergency {\n"
-                                      "  color: rgba(255, 0.0, 0.0, 255);\n"
-                                      "}",
-                                      -1);
-
-      gtk_style_context_add_provider_for_display(
-                                   gtk_widget_get_display(toplevel),
-                                   GTK_STYLE_PROVIDER(emergency_provider),
-                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-    }
-  }
-
-  gtk_widget_set_visible(table, TRUE);
-
-  return table;
-}
-
-/***********************************************************************//**
-  Create main citydlg map
-
-  Map frame will be placed to top left (col, row) position of the grid.
-***************************************************************************/
-static void create_citydlg_main_map(struct city_dialog *pdialog,
-                                    GtkWidget *grid, int col, int row)
-{
-  GtkWidget *frame;
-
-  frame = gtk_frame_new(_("City map"));
-  gtk_widget_set_size_request(frame, CITY_MAP_MIN_SIZE_X,
-                              CITY_MAP_MIN_SIZE_Y);
-  gtk_grid_attach(GTK_GRID(grid), frame, col, row, 1, 1);
-
-  city_dialog_map_create(pdialog, &pdialog->overview.map_canvas);
-  gtk_frame_set_child(GTK_FRAME(frame), pdialog->overview.map_canvas.sw);
-}
-
-/**********************************************************************//**
-  Improvement table cell bind function
-**************************************************************************/
-static void impr_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcImprRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  switch (GPOINTER_TO_INT(user_data)) {
-  case IMPR_ROW_PIXBUF:
-    gtk_image_set_from_pixbuf(GTK_IMAGE(child), row->sprite);
-    break;
-  case IMPR_ROW_DESC:
-    {
-      gtk_label_set_text(GTK_LABEL(child), row->description);
-
-      if (row->redundant) {
-        PangoAttrList *attributes;
-        PangoAttribute *attr;
-
-        attributes = pango_attr_list_new();
-        attr = pango_attr_strikethrough_new(TRUE);
-        pango_attr_list_insert(attributes, attr);
-
-        gtk_label_set_attributes(GTK_LABEL(child), attributes);
-      }
-    }
-    break;
-  case IMPR_ROW_UPKEEP:
-    {
-      char buf[256];
-
-      fc_snprintf(buf, sizeof(buf), "%d", row->upkeep);
-      gtk_label_set_text(GTK_LABEL(child), buf);
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Improvement table cell setup function
-**************************************************************************/
-static void impr_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  switch (GPOINTER_TO_INT(user_data)) {
-  case IMPR_ROW_PIXBUF:
-    gtk_list_item_set_child(list_item, gtk_image_new());
-    break;
-  case IMPR_ROW_DESC:
-  case IMPR_ROW_UPKEEP:
-    gtk_list_item_set_child(list_item, gtk_label_new(""));
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Callback for getting main list row tooltip
-**************************************************************************/
-static gboolean query_impr_tooltip(GtkWidget *widget, gint x, gint y,
-                                   gboolean keyboard_tip,
-                                   GtkTooltip *tooltip,
-                                   gpointer data)
-{
-  int rnum = get_column_view_row(widget, y);
-
-  if (rnum >= 0) {
-    FcImprRow *row = g_list_model_get_item(G_LIST_MODEL(data), rnum);
-
-    if (row != nullptr && row->tooltip != nullptr) {
-      gtk_tooltip_set_markup(tooltip, row->tooltip);
-
-      return TRUE;
-    }
-  }
-
-  return FALSE;
-}
-
-/***********************************************************************//**
-  Create improvements list
-***************************************************************************/
-static GtkWidget *create_citydlg_improvement_list(struct city_dialog *pdialog)
-{
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-
-  /* Improvements */
-  pdialog->overview.improvement_list = g_list_store_new(FC_TYPE_IMPR_ROW);
-
-  selection = gtk_single_selection_new(G_LIST_MODEL(pdialog->overview.improvement_list));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(impr_factory_bind),
-                   GINT_TO_POINTER(IMPR_ROW_PIXBUF));
-  g_signal_connect(factory, "setup", G_CALLBACK(impr_factory_setup),
-                   GINT_TO_POINTER(IMPR_ROW_PIXBUF));
-
-  column = gtk_column_view_column_new(_("Pix"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(impr_factory_bind),
-                   GINT_TO_POINTER(IMPR_ROW_DESC));
-  g_signal_connect(factory, "setup", G_CALLBACK(impr_factory_setup),
-                   GINT_TO_POINTER(IMPR_ROW_DESC));
-
-  column = gtk_column_view_column_new(_("Description"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(impr_factory_bind),
-                   GINT_TO_POINTER(IMPR_ROW_UPKEEP));
-  g_signal_connect(factory, "setup", G_CALLBACK(impr_factory_setup),
-                   GINT_TO_POINTER(IMPR_ROW_UPKEEP));
-
-  column = gtk_column_view_column_new(_("Upkeep"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  g_object_set(list, "has-tooltip", TRUE, nullptr);
-  g_signal_connect(list, "query-tooltip",
-                   G_CALLBACK(query_impr_tooltip), pdialog->overview.improvement_list);
-
-  g_signal_connect(list, "activate",
-                   G_CALLBACK(impr_callback), pdialog);
-
-  return list;
-}
-
-/**********************************************************************//**
-  Prod table cell bind function
-**************************************************************************/
-static void prod_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcProdRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  switch (GPOINTER_TO_INT(user_data)) {
-  case PROD_ROW_PIXBUF:
-    gtk_image_set_from_pixbuf(GTK_IMAGE(child), row->sprite);
-    break;
-  case PROD_ROW_NAME:
-    {
-      gtk_label_set_text(GTK_LABEL(child), row->name);
-
-      if (row->useless) {
-        PangoAttrList *attributes;
-        PangoAttribute *attr;
-
-        attributes = pango_attr_list_new();
-        attr = pango_attr_strikethrough_new(TRUE);
-        pango_attr_list_insert(attributes, attr);
-
-        gtk_label_set_attributes(GTK_LABEL(child), attributes);
-      }
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Prod table cell setup function
-**************************************************************************/
-static void prod_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  switch (GPOINTER_TO_INT(user_data)) {
-  case PROD_ROW_PIXBUF:
-    gtk_list_item_set_child(list_item, gtk_image_new());
-    break;
-  case PROD_ROW_NAME:
-    gtk_list_item_set_child(list_item, gtk_label_new(""));
-    break;
-  }
-}
-
-/***********************************************************************//**
-                  **** Overview page ****
- +- GtkWidget *page ------------------------------------------+
- | +- GtkWidget *middle -----------+------------------------+ |
- | | City map                      |  Production            | |
- | +-------------------------------+------------------------+ |
- +------------------------------------------------------------+
- | +- GtkWidget *bottom -------+----------------------------+ |
- | | Info                      | +- GtkWidget *right -----+ | |
- | |                           | | supported units        | | |
- | |                           | +------------------------+ | |
- | |                           | | present units          | | |
- | |                           | +------------------------+ | |
- | +---------------------------+----------------------------+ |
- +------------------------------------------------------------+
-***************************************************************************/
-static void create_and_append_overview_page(struct city_dialog *pdialog)
-{
-  GtkWidget *page, *bottom;
-  GtkWidget *right, *frame, *table;
-  GtkWidget *label, *sw, *view, *bar;
-  /* TRANS: Overview tab in city dialog */
-  const char *tab_title = _("_Overview");
-  int unit_height = tileset_unit_with_upkeep_height(tileset);
-  int page_row = 0;
-
-  /* Main page */
-  page = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_widget_set_margin_start(page, 8);
-  gtk_widget_set_margin_end(page, 8);
-  gtk_widget_set_margin_top(page, 8);
-  gtk_widget_set_margin_bottom(page, 8);
-  label = gtk_label_new_with_mnemonic(tab_title);
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  if (!low_citydlg) {
-    GtkListItemFactory *factory;
-    GtkWidget *list;
-    GtkColumnViewColumn *column;
-    GtkWidget *middle;
-    GtkWidget *vbox;
-    GtkWidget *hbox;
-    int middle_col = 0;
-
-    /* Middle: city map, improvements */
-    middle = gtk_grid_new();
-    gtk_grid_set_column_spacing(GTK_GRID(middle), 6);
-    gtk_grid_attach(GTK_GRID(page), middle, 0, page_row++, 1, 1);
-
-    /* City map */
-    create_citydlg_main_map(pdialog, middle, middle_col++, 0);
-
-    /* Improvements */
-    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-    gtk_grid_attach(GTK_GRID(middle), vbox, middle_col++, 0, 1, 1);
-
-    view = create_citydlg_improvement_list(pdialog);
-
-    label = g_object_new(GTK_TYPE_LABEL, "label", _("Production:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    gtk_box_append(GTK_BOX(vbox), label);
-
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
-    gtk_box_append(GTK_BOX(vbox), hbox);
-
-    pdialog->overview.change_prod_store = g_list_store_new(FC_TYPE_PROD_ROW);
-
-    pdialog->overview.change_prod_selection
-      = gtk_single_selection_new(G_LIST_MODEL(pdialog->overview.change_prod_store));
-    list = gtk_column_view_new(GTK_SELECTION_MODEL(pdialog->overview.change_prod_selection));
-
-    factory = gtk_signal_list_item_factory_new();
-    g_signal_connect(factory, "bind", G_CALLBACK(prod_factory_bind),
-                     GINT_TO_POINTER(PROD_ROW_PIXBUF));
-    g_signal_connect(factory, "setup", G_CALLBACK(prod_factory_setup),
-                     GINT_TO_POINTER(PROD_ROW_PIXBUF));
-
-    column = gtk_column_view_column_new(_("Pix"), factory);
-    gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-    factory = gtk_signal_list_item_factory_new();
-    g_signal_connect(factory, "bind", G_CALLBACK(prod_factory_bind),
-                     GINT_TO_POINTER(PROD_ROW_NAME));
-    g_signal_connect(factory, "setup", G_CALLBACK(prod_factory_setup),
-                     GINT_TO_POINTER(PROD_ROW_NAME));
-
-    column = gtk_column_view_column_new(_("Name"), factory);
-    gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-    bar = gtk_progress_bar_new();
-    gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(bar), TRUE);
-    pdialog->overview.production_bar = bar;
-    gtk_box_append(GTK_BOX(hbox), bar);
-
-    gtk_progress_bar_set_text(GTK_PROGRESS_BAR(bar), _("%d/%d %d turns"));
-
-    gtk_box_append(GTK_BOX(hbox), list);
-
-    g_signal_connect(pdialog->overview.change_prod_selection, "selection-changed",
-                     G_CALLBACK(change_production_callback), pdialog);
-
-    pdialog->overview.buy_command
-      = icon_label_button_new("system-run", _("_Buy"));
-    gtk_box_append(GTK_BOX(hbox), GTK_WIDGET(pdialog->overview.buy_command));
-    g_signal_connect(pdialog->overview.buy_command, "clicked",
-                     G_CALLBACK(buy_callback), pdialog);
-
-    label = g_object_new(GTK_TYPE_LABEL, "use-underline", TRUE,
-                         "mnemonic-widget", view,
-                         "label", _("I_mprovements:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    gtk_box_append(GTK_BOX(vbox), label);
-    gtk_box_append(GTK_BOX(vbox), view);
-  } else {
-    pdialog->overview.buy_command = NULL;
-    pdialog->overview.production_bar = NULL;
-    pdialog->overview.change_prod_store = nullptr;
-    pdialog->overview.change_prod_selection = nullptr;
-  }
-
-  /* Bottom: info, units */
-  bottom = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_grid_attach(GTK_GRID(page), bottom, 0, page_row++, 1, 1);
-
-  /* Info */
-  frame = gtk_frame_new(_("Info"));
-  gtk_box_append(GTK_BOX(bottom), frame);
-
-  table = create_city_info_table(pdialog,
-                                 pdialog->overview.info_label);
-  gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(table, GTK_ALIGN_CENTER);
-  gtk_frame_set_child(GTK_FRAME(frame), table);
-
-  /* Right: present and supported units (overview page) */
-  right = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(bottom), right);
-
-  pdialog->overview.supported_units_frame = gtk_frame_new("");
-  gtk_box_append(GTK_BOX(right), pdialog->overview.supported_units_frame);
-  pdialog->overview.present_units_frame = gtk_frame_new("");
-  gtk_box_append(GTK_BOX(right), pdialog->overview.present_units_frame);
-
-  /* Supported units */
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_hexpand(sw, TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), FALSE);
-  gtk_frame_set_child(GTK_FRAME(pdialog->overview.supported_units_frame),
-                      sw);
-
-
-  table = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_widget_set_size_request(table, -1, unit_height);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), table);
-
-  pdialog->overview.supported_unit_table = table;
-  unit_node_vector_init(&pdialog->overview.supported_units);
-
-  /* Present units */
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_hexpand(sw, TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), FALSE);
-  gtk_frame_set_child(GTK_FRAME(pdialog->overview.present_units_frame), sw);
-
-  table = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_widget_set_size_request(table, -1, unit_height);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), table);
-
-  pdialog->overview.present_unit_table = table;
-  unit_node_vector_init(&pdialog->overview.present_units);
-
-  /* Show page */
-  gtk_widget_set_visible(page, TRUE);
-}
-
-/***********************************************************************//**
-  Create map page for small screens
-***************************************************************************/
-static void create_and_append_map_page(struct city_dialog *pdialog)
-{
-  if (low_citydlg) {
-    GtkWidget *page;
-    GtkWidget *label;
-    const char *tab_title = _("Citymap");
-    int page_row = 0;
-
-    page = gtk_grid_new();
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
-                                   GTK_ORIENTATION_VERTICAL);
-    gtk_widget_set_margin_start(page, 8);
-    gtk_widget_set_margin_end(page, 8);
-    gtk_widget_set_margin_top(page, 8);
-    gtk_widget_set_margin_bottom(page, 8);
-    label = gtk_label_new_with_mnemonic(tab_title);
-    gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-    create_citydlg_main_map(pdialog, page, 0, page_row++);
-
-    gtk_widget_set_visible(page, TRUE);
-  }
-}
-
-/***********************************************************************//**
-  Something dragged to worklist dialog.
-***************************************************************************/
-static gboolean target_drag_data_received(GtkDropTarget *target,
-                                          const GValue *value,
-                                          double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog = (struct city_dialog *) data;
-  cid id;
-  struct universal univ;
-
-  if (NULL != client.conn.playing
-      && city_owner(pdialog->pcity) != client.conn.playing) {
-    return FALSE;
-  }
-
-  id = g_value_get_int(value);
-  univ = cid_production(id);
-
-  city_change_production(pdialog->pcity, &univ);
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Create production page header - what tab this actually is,
-  depends on screen size and layout.
-***************************************************************************/
-static int create_production_header(struct city_dialog *pdialog,
-                                    GtkWidget *grid, int row)
-{
-  GtkWidget *hgrid, *bar;
-  int grid_col = 0;
-
-  hgrid = gtk_grid_new();
-  gtk_widget_set_margin_bottom(hgrid, 2);
-  gtk_widget_set_margin_end(hgrid, 2);
-  gtk_widget_set_margin_start(hgrid, 2);
-  gtk_widget_set_margin_top(hgrid, 2);
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 10);
-  gtk_grid_attach(GTK_GRID(grid), hgrid, 0, row++, 1, 1);
-
-  /* The label is set in city_dialog_update_building() */
-  bar = gtk_progress_bar_new();
-  gtk_widget_set_hexpand(bar, TRUE);
-  gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(bar), TRUE);
-  pdialog->production.production_bar = bar;
-  gtk_grid_attach(GTK_GRID(hgrid), bar, grid_col++, 0, 1, 1);
-  gtk_progress_bar_set_text(GTK_PROGRESS_BAR(bar), _("%d/%d %d turns"));
-
-  add_worklist_dnd_target(bar, target_drag_data_received, pdialog);
-
-  pdialog->production.buy_command
-    = icon_label_button_new("system-run", _("_Buy"));
-  gtk_grid_attach(GTK_GRID(hgrid), GTK_WIDGET(pdialog->production.buy_command),
-                  grid_col++, 0, 1, 1);
-
-  g_signal_connect(pdialog->production.buy_command, "clicked",
-                   G_CALLBACK(buy_callback), pdialog);
-
-  return row;
-}
-
-/***********************************************************************//**
-  Create buildings list page for small screens
-***************************************************************************/
-static void create_and_append_buildings_page(struct city_dialog *pdialog)
-{
-  if (low_citydlg) {
-    GtkWidget *page;
-    GtkWidget *label;
-    GtkWidget *vbox;
-    GtkWidget *view;
-    const char *tab_title = _("Buildings");
-    int page_row = 0;
-
-    page = gtk_grid_new();
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
-                                   GTK_ORIENTATION_VERTICAL);
-    gtk_widget_set_margin_start(page, 8);
-    gtk_widget_set_margin_end(page, 8);
-    gtk_widget_set_margin_top(page, 8);
-    gtk_widget_set_margin_bottom(page, 8);
-    label = gtk_label_new_with_mnemonic(tab_title);
-
-    page_row = create_production_header(pdialog, page, page_row);
-    gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-    gtk_grid_attach(GTK_GRID(page), vbox, 0, page_row++, 1, 1);
-
-    view = create_citydlg_improvement_list(pdialog);
-
-    gtk_box_append(GTK_BOX(vbox), view);
-
-    gtk_widget_set_visible(page, TRUE);
-  }
-}
-
-/***********************************************************************//**
-                    **** Production Page ****
-***************************************************************************/
-static void create_and_append_worklist_page(struct city_dialog *pdialog)
-{
-  const char *tab_title = _("P_roduction");
-  GtkWidget *label = gtk_label_new_with_mnemonic(tab_title);
-  GtkWidget *page, *editor;
-  int page_row = 0;
-
-  page = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_widget_set_margin_start(page, 8);
-  gtk_widget_set_margin_end(page, 8);
-  gtk_widget_set_margin_top(page, 8);
-  gtk_widget_set_margin_bottom(page, 8);
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  /* Stuff that's being currently built */
-  if (!low_citydlg) {
-    label = g_object_new(GTK_TYPE_LABEL,
-                         "label", _("Production:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    pdialog->production.production_label = label;
-    gtk_grid_attach(GTK_GRID(page), label, 0, page_row++, 1, 1);
-
-    page_row = create_production_header(pdialog, page, page_row);
-  } else {
-    pdialog->production.production_label = NULL;
-  }
-
-  editor = create_worklist();
-  gtk_widget_set_margin_bottom(editor, 6);
-  gtk_widget_set_margin_end(editor, 6);
-  gtk_widget_set_margin_start(editor, 6);
-  gtk_widget_set_margin_top(editor, 6);
-  reset_city_worklist(editor, pdialog->pcity);
-  gtk_grid_attach(GTK_GRID(page), editor, 0, page_row++, 1, 1);
-  pdialog->production.worklist = editor;
-
-  gtk_widget_set_visible(page, TRUE);
-}
-
-/***********************************************************************//**
-                     **** Happiness Page ****
- +- GtkWidget *page ----------+-------------------------------------------+
- | +- GtkWidget *left ------+ | +- GtkWidget *right --------------------+ |
- | | Info                   | | | City map                              | |
- | +- GtkWidget *citizens --+ | +- GtkWidget pdialog->happiness.widget -+ |
- | | Citizens data          | | | Happiness                             | |
- | +------------------------+ | +---------------------------------------+ |
- +----------------------------+-------------------------------------------+
-***************************************************************************/
-static void create_and_append_happiness_page(struct city_dialog *pdialog)
-{
-  GtkWidget *page, *label, *table, *right, *left, *frame;
-  const char *tab_title = _("Happ_iness");
-  int page_col = 0;
-  int left_row = 0;
-
-  /* Main page */
-  page = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(page), 6);
-  gtk_widget_set_margin_start(page, 8);
-  gtk_widget_set_margin_end(page, 8);
-  gtk_widget_set_margin_top(page, 8);
-  gtk_widget_set_margin_bottom(page, 8);
-  label = gtk_label_new_with_mnemonic(tab_title);
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  /* Left: info, citizens */
-  left = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(left),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_attach(GTK_GRID(page), left, page_col++, 0, 1, 1);
-
-  if (!low_citydlg) {
-    /* Upper left: info */
-    frame = gtk_frame_new(_("Info"));
-    gtk_grid_attach(GTK_GRID(left), frame, 0, left_row++, 1, 1);
-
-    table = create_city_info_table(pdialog,
-                                   pdialog->happiness.info_label);
-    gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-    gtk_frame_set_child(GTK_FRAME(frame), table);
-  }
-
-  /* Lower left: citizens */
-  if (game.info.citizen_nationality) {
-    pdialog->happiness.citizens = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-    gtk_grid_attach(GTK_GRID(left), pdialog->happiness.citizens,
-                    0, left_row++, 1, 1);
-    gtk_box_append(GTK_BOX(pdialog->happiness.citizens),
-                   citizens_dialog_display(pdialog->pcity));
-  }
-
-  /* Right: city map, happiness */
-  right = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_grid_attach(GTK_GRID(page), right, page_col++, 0, 1, 1);
-
-  if (!low_citydlg) {
-    /* Upper right: city map */
-    frame = gtk_frame_new(_("City map"));
-    gtk_widget_set_size_request(frame, CITY_MAP_MIN_SIZE_X,
-                                CITY_MAP_MIN_SIZE_Y);
-    gtk_box_append(GTK_BOX(right), frame);
-
-    city_dialog_map_create(pdialog, &pdialog->happiness.map_canvas);
-    gtk_frame_set_child(GTK_FRAME(frame), pdialog->happiness.map_canvas.sw);
-  }
-
-  /* Lower right: happiness */
-  pdialog->happiness.widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(right), pdialog->happiness.widget);
-  gtk_box_append(GTK_BOX(pdialog->happiness.widget),
-                 get_top_happiness_display(pdialog->pcity, low_citydlg,
-                                           pdialog->shell));
-
-  /* Show page */
-  gtk_widget_set_visible(page, TRUE);
-}
-
-/**********************************************************************//**
-                    **** Counters Page ****
-**************************************************************************/
-/**********************************************************************//**
-  Creates counters page
-**************************************************************************/
-
-static void create_and_append_counters_page(struct city_dialog *pdialog)
-{
-  GtkWidget *page = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-  GtkLabel *label =  GTK_LABEL(gtk_label_new(_("Counters")));
-
-  pdialog->counters.container = NULL;
-  pdialog->counters.widget = NULL;
-
-  city_dialog_update_counters(pdialog);
-
-  gtk_box_append(GTK_BOX(page), GTK_WIDGET(pdialog->counters.container));
-
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, GTK_WIDGET(label));
-
-  gtk_widget_show(page);
-}
-
-/***********************************************************************//**
-            **** Citizen Management Agent (CMA) Page ****
-***************************************************************************/
-static void create_and_append_cma_page(struct city_dialog *pdialog)
-{
-  GtkWidget *page, *label;
-  const char *tab_title = _("_Governor");
-
-  page = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-
-  label = gtk_label_new_with_mnemonic(tab_title);
-
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  pdialog->cma_editor = create_cma_dialog(pdialog->pcity, low_citydlg);
-  gtk_box_append(GTK_BOX(page), pdialog->cma_editor->shell);
-
-  gtk_widget_set_visible(page, TRUE);
-}
-
-/***********************************************************************//**
-                    **** Misc. Settings Page ****
-***************************************************************************/
-static void create_and_append_settings_page(struct city_dialog *pdialog)
-{
-  int i;
-  GtkWidget *vgrid, *page, *frame, *label, *button;
-  GtkSizeGroup *size;
-  GtkWidget *group;
-  const char *tab_title = _("_Settings");
-  int grid_row = 0;
-
-  static const char *new_citizens_output_label[] = {
-    N_("Luxury"),
-    N_("Science"),
-    N_("Gold")
-  };
-
-  static const char *disband_label
-    = N_("Allow unit production to disband city");
-
-  static const char *misc_whichtab_label[NUM_PAGES] = {
-    N_("Overview page"),
-    N_("Production page"),
-    N_("Happiness page"),
-    N_("Counters Page"),
-    N_("Governor page"),
-    N_("This Settings page"),
-    N_("Last active page")
-  };
-
-  static bool new_citizens_label_done;
-  static bool misc_whichtab_label_done;
-
-  /* Initialize signal_blocker */
-  pdialog->misc.block_signal = 0;
-
-
-  page = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(page), 18);
-  gtk_widget_set_margin_start(page, 8);
-  gtk_widget_set_margin_end(page, 8);
-  gtk_widget_set_margin_top(page, 8);
-  gtk_widget_set_margin_bottom(page, 8);
-
-  size = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-
-  label = gtk_label_new_with_mnemonic(tab_title);
-
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  /* new_citizens radio */
-  frame = gtk_frame_new(_("New citizens produce"));
-  gtk_grid_attach(GTK_GRID(page), frame, 0, 0, 1, 1);
-  gtk_size_group_add_widget(size, frame);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_frame_set_child(GTK_FRAME(frame), vgrid);
-
-  intl_slist(ARRAY_SIZE(new_citizens_output_label), new_citizens_output_label,
-             &new_citizens_label_done);
-
-  group = NULL;
-  for (i = 0; i < ARRAY_SIZE(new_citizens_output_label); i++) {
-    button = gtk_check_button_new_with_mnemonic(new_citizens_output_label[i]);
-    gtk_check_button_set_group(GTK_CHECK_BUTTON(button),
-                               GTK_CHECK_BUTTON(group));
-    pdialog->misc.new_citizens_radio[i] = button;
-    gtk_grid_attach(GTK_GRID(vgrid), button, 0, grid_row++, 1, 1);
-    g_signal_connect(button, "toggled",
-                     G_CALLBACK(cityopt_callback), pdialog);
-    group = button;
-  }
-
-  /* Next is the next-time-open radio group in the right column */
-  frame = gtk_frame_new(_("Next time open"));
-  gtk_grid_attach(GTK_GRID(page), frame, 1, 0, 1, 1);
-  gtk_size_group_add_widget(size, frame);
-
-  vgrid = gtk_grid_new();
-  grid_row = 0;
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_frame_set_child(GTK_FRAME(frame), vgrid);
-
-  intl_slist(ARRAY_SIZE(misc_whichtab_label), misc_whichtab_label,
-             &misc_whichtab_label_done);
-
-  group = NULL;
-  for (i = 0; i < ARRAY_SIZE(misc_whichtab_label); i++) {
-    button = gtk_check_button_new_with_mnemonic(misc_whichtab_label[i]);
-    gtk_check_button_set_group(GTK_CHECK_BUTTON(button),
-                               GTK_CHECK_BUTTON(group));
-    pdialog->misc.whichtab_radio[i] = button;
-    gtk_grid_attach(GTK_GRID(vgrid), button, 0, grid_row++, 1, 1);
-    g_signal_connect(button, "toggled",
-                     G_CALLBACK(misc_whichtab_callback), GINT_TO_POINTER(i));
-    group = button;
-  }
-
-  /* Now we go back and fill the hbox rename */
-  frame = gtk_frame_new(_("City"));
-  gtk_widget_set_margin_top(frame, 12);
-  gtk_widget_set_margin_bottom(frame, 12);
-  gtk_grid_attach(GTK_GRID(page), frame, 0, 1, 1, 1);
-
-  vgrid = gtk_grid_new();
-  grid_row = 0;
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_frame_set_child(GTK_FRAME(frame), vgrid);
-
-  button = gtk_button_new_with_mnemonic(_("R_ename..."));
-  pdialog->misc.rename_command = button;
-  gtk_grid_attach(GTK_GRID(vgrid), button, 0, grid_row++, 1, 1);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(rename_callback), pdialog);
-
-  gtk_widget_set_sensitive(button, can_client_issue_orders());
-
-  /* The disband-city-on-unit-production button */
-  button = gtk_check_button_new_with_mnemonic(_(disband_label));
-  pdialog->misc.disband_on_settler = button;
-  gtk_grid_attach(GTK_GRID(vgrid), button, 0, grid_row++, 1, 1);
-  g_signal_connect(button, "toggled",
-                   G_CALLBACK(cityopt_callback), pdialog);
-
-  /* We choose which page to popup by default */
-  gtk_check_button_set_active(GTK_CHECK_BUTTON
-                              (pdialog->
-                               misc.whichtab_radio[new_dialog_def_page]),
-                              TRUE);
-
-  set_cityopt_values(pdialog);
-
-  gtk_widget_set_visible(page, TRUE);
-
-  if (new_dialog_def_page == (NUM_PAGES - 1)) {
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(pdialog->notebook),
-                                  last_page);
-  } else {
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(pdialog->notebook),
-                                  new_dialog_def_page);
-  }
-}
-
-/***********************************************************************//**
-                     **** Main City Dialog ****
- +----------------------------+-------------------------------+
- | GtkWidget *top: Citizens   | city name                     |
- +----------------------------+-------------------------------+
- | [notebook tab]                                             |
- +------------------------------------------------------------+
-***************************************************************************/
-static struct city_dialog *create_city_dialog(struct city *pcity)
-{
-  struct city_dialog *pdialog;
-  GtkWidget *close_command;
-  GtkWidget *vbox, *hbox, *cbox;
-  int citizen_bar_width;
-  int citizen_bar_height;
-  int ccol = 0;
-  GtkEventController *controller;
-  struct player *owner;
-
-  if (!city_dialogs_have_been_initialised) {
-    initialize_city_dialogs();
-  }
-
-  pdialog = fc_malloc(sizeof(struct city_dialog));
-  pdialog->pcity = pcity;
-  pdialog->sell_shell = NULL;
-  pdialog->rename_shell = NULL;
-  pdialog->happiness.map_canvas.sw = NULL;      /* Make sure NULL if spy */
-  pdialog->happiness.map_canvas.darea = NULL;   /* Ditto */
-  pdialog->happiness.citizens = NULL;           /* Ditto */
-  pdialog->counters.widget = NULL;
-  pdialog->counters.container = NULL;
-  pdialog->production.buy_command = NULL;
-  pdialog->production.production_label = NULL;
-  pdialog->production.production_bar = NULL;
-  pdialog->cma_editor = NULL;
-  pdialog->map_canvas_store_unscaled
-    = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                 canvas_width, canvas_height);
-
-  pdialog->shell = gtk_dialog_new();
-  gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name_get(pcity));
-  setup_dialog(pdialog->shell, toplevel);
-
-  g_signal_connect(pdialog->shell, "destroy",
-                   G_CALLBACK(city_destroy_callback), pdialog);
-  gtk_widget_set_name(pdialog->shell, "Freeciv");
-
-  gtk_widget_realize(pdialog->shell);
-
-  /* Keep the icon of the executable on Windows (see PR#36491) */
-#ifndef FREECIV_MSWINDOWS
-  {
-    gtk_window_set_icon_name(GTK_WINDOW(pdialog->shell), "citydlg");
-  }
-#endif /* FREECIV_MSWINDOWS */
-
-  /* Restore size of the city dialog. */
-  gtk_window_set_default_size(GTK_WINDOW(pdialog->shell),
-                              GUI_GTK_OPTION(citydlg_xsize),
-                              GUI_GTK_OPTION(citydlg_ysize));
-
-  pdialog->popover = NULL;
-
-  vbox = gtk_dialog_get_content_area(GTK_DIALOG(pdialog->shell));
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_set_homogeneous(GTK_BOX(hbox), TRUE);
-  gtk_box_append(GTK_BOX(vbox), hbox);
-
-  /**** Citizens bar here ****/
-  cbox = gtk_grid_new();
-  gtk_box_append(GTK_BOX(hbox), cbox);
-
-  citizen_bar_width = tileset_small_sprite_width(tileset) * NUM_CITIZENS_SHOWN;
-  citizen_bar_height = tileset_small_sprite_height(tileset);
-
-  pdialog->citizen_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                                        citizen_bar_width,
-                                                        citizen_bar_height);
-  pdialog->citizen_pics = gtk_picture_new();
-
-  gtk_widget_set_margin_start(pdialog->citizen_pics, 2);
-  gtk_widget_set_margin_end(pdialog->citizen_pics, 2);
-  gtk_widget_set_margin_top(pdialog->citizen_pics, 2);
-  gtk_widget_set_margin_bottom(pdialog->citizen_pics, 2);
-  gtk_widget_set_size_request(pdialog->citizen_pics,
-                              citizen_bar_width, citizen_bar_height);
-  gtk_widget_set_halign(pdialog->citizen_pics, GTK_ALIGN_START);
-  gtk_widget_set_valign(pdialog->citizen_pics, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(cbox), pdialog->citizen_pics, ccol++, 0, 1, 1);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(citizens_callback), pdialog);
-  gtk_widget_add_controller(pdialog->citizen_pics, controller);
-
-  /**** City name label here ****/
-  pdialog->name_label = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(pdialog->name_label, TRUE);
-  gtk_widget_set_halign(pdialog->name_label, GTK_ALIGN_START);
-  gtk_widget_set_valign(pdialog->name_label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(hbox), pdialog->name_label);
-
-  /**** -Start of Notebook- ****/
-
-  pdialog->notebook = gtk_notebook_new();
-  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(pdialog->notebook),
-                           GTK_POS_BOTTOM);
-  gtk_box_append(GTK_BOX(vbox), pdialog->notebook);
-
-  create_and_append_overview_page(pdialog);
-  create_and_append_map_page(pdialog);
-  create_and_append_buildings_page(pdialog);
-
-  owner = city_owner(pcity);
-
-  /* Only create these tabs if not a spy */
-  if (owner == client_player() || client_is_global_observer()) {
-    create_and_append_worklist_page(pdialog);
-    create_and_append_happiness_page(pdialog);
-  }
-
-  create_and_append_counters_page(pdialog);
-
-  if (owner == client_player()
-      && !client_is_observer()) {
-    create_and_append_cma_page(pdialog);
-    create_and_append_settings_page(pdialog);
-  } else {
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(pdialog->notebook),
-                                  OVERVIEW_PAGE);
-  }
-
-  /**** End of Notebook ****/
-
-  /* Bottom buttons */
-
-  pdialog->show_units_command =
-    gtk_dialog_add_button(GTK_DIALOG(pdialog->shell), _("_List present units..."), CDLGR_UNITS);
-
-  g_signal_connect(GTK_DIALOG(pdialog->shell), "response",
-                   G_CALLBACK(citydlg_response_callback), pdialog);
-
-  pdialog->prev_command = gtk_button_new_from_icon_name("go-previous");
-  gtk_dialog_add_action_widget(GTK_DIALOG(pdialog->shell),
-                               GTK_WIDGET(pdialog->prev_command), 1);
-
-  pdialog->next_command = gtk_button_new_from_icon_name("go-next");
-  gtk_dialog_add_action_widget(GTK_DIALOG(pdialog->shell),
-                               GTK_WIDGET(pdialog->next_command), 2);
-
-  if (owner != client_player()) {
-    gtk_widget_set_sensitive(GTK_WIDGET(pdialog->prev_command), FALSE);
-    gtk_widget_set_sensitive(GTK_WIDGET(pdialog->next_command), FALSE);
-  }
-
-  close_command = gtk_dialog_add_button(GTK_DIALOG(pdialog->shell),
-                                        _("_Close"), GTK_RESPONSE_CLOSE);
-
-  gtk_dialog_set_default_response(GTK_DIALOG(pdialog->shell),
-                                  GTK_RESPONSE_CLOSE);
-
-  g_signal_connect(close_command, "clicked",
-                   G_CALLBACK(close_callback), pdialog);
-
-  g_signal_connect(pdialog->prev_command, "clicked",
-                   G_CALLBACK(switch_city_callback), pdialog);
-
-  g_signal_connect(pdialog->next_command, "clicked",
-                   G_CALLBACK(switch_city_callback), pdialog);
-
-  /* Some other things we gotta do */
-
-  controller = gtk_event_controller_key_new();
-  g_signal_connect(controller, "key-pressed",
-                   G_CALLBACK(citydlg_keyboard_handler), pdialog);
-  gtk_widget_add_controller(pdialog->shell, controller);
-
-  dialog_list_prepend(dialog_list, pdialog);
-
-  real_city_dialog_refresh(pdialog->pcity);
-
-  /* Need to do this every time a new dialog is opened. */
-  city_dialog_update_prev_next();
-
-  gtk_widget_set_visible(pdialog->shell, TRUE);
-
-  gtk_window_set_focus(GTK_WINDOW(pdialog->shell), close_command);
-
-  return pdialog;
-}
-
-/**************** Functions to update parts of the dialog *****************/
-
-/***********************************************************************//**
-  Update title of city dialog.
-***************************************************************************/
-static void city_dialog_update_title(struct city_dialog *pdialog)
-{
-  gchar *buf;
-  const gchar *now;
-
-  if (city_unhappy(pdialog->pcity)) {
-    /* TRANS: city dialog title */
-    buf = g_strdup_printf(_("<b>%s</b> - %s citizens - DISORDER"),
-                          city_name_get(pdialog->pcity),
-                          population_to_text(city_population(pdialog->pcity)));
-  } else if (city_celebrating(pdialog->pcity)) {
-    /* TRANS: city dialog title */
-    buf = g_strdup_printf(_("<b>%s</b> - %s citizens - celebrating"),
-                          city_name_get(pdialog->pcity),
-                          population_to_text(city_population(pdialog->pcity)));
-  } else if (city_happy(pdialog->pcity)) {
-    /* TRANS: city dialog title */
-    buf = g_strdup_printf(_("<b>%s</b> - %s citizens - happy"),
-                          city_name_get(pdialog->pcity),
-                          population_to_text(city_population(pdialog->pcity)));
-  } else {
-    /* TRANS: city dialog title */
-    buf = g_strdup_printf(_("<b>%s</b> - %s citizens"),
-                          city_name_get(pdialog->pcity),
-                          population_to_text(city_population(pdialog->pcity)));
-  }
-
-  now = gtk_label_get_text(GTK_LABEL(pdialog->name_label));
-  if (strcmp(now, buf) != 0) {
-    gtk_window_set_title(GTK_WINDOW(pdialog->shell), city_name_get(pdialog->pcity));
-    gtk_label_set_markup(GTK_LABEL(pdialog->name_label), buf);
-  }
-
-  g_free(buf);
-}
-
-/***********************************************************************//**
-  Update citizens in city dialog
-***************************************************************************/
-static void city_dialog_update_citizens(struct city_dialog *pdialog)
-{
-  enum citizen_category categories[MAX_CITY_SIZE];
-  int i, width, full_width, total_used_width;
-  int citizen_bar_width, citizen_bar_height;
-  struct city *pcity = pdialog->pcity;
-  int num_citizens = get_city_citizen_types(pcity, FEELING_FINAL, categories);
-  cairo_t *cr;
-
-  /* If there is not enough space we stack the icons. We draw from left to */
-  /* right. width is how far we go to the right for each drawn pixmap. The */
-  /* last icon is always drawn in full, and so has reserved                */
-  /* tileset_small_sprite_width(tileset) pixels.                           */
-
-  full_width = tileset_small_sprite_width(tileset);
-  if (num_citizens > 1) {
-    width = MIN(full_width, ((NUM_CITIZENS_SHOWN - 1) * full_width)
-                            / (num_citizens - 1));
-  } else {
-    width = full_width;
-  }
-  pdialog->cwidth = width;
-
-  /* overview page */
-  /* keep these values in sync with create_city_dialog */
-  citizen_bar_width  = full_width * NUM_CITIZENS_SHOWN;
-  citizen_bar_height = tileset_small_sprite_height(tileset);
-
-  cr = cairo_create(pdialog->citizen_surface);
-
-  for (i = 0; i < num_citizens; i++) {
-    cairo_set_source_surface(cr,
-                             get_citizen_sprite(tileset, categories[i], i, pcity)->surface,
-                             i * width, 0);
-    cairo_rectangle(cr, i * width, 0,
-                    /* Always draw last citizen in full */
-                    i + 1 < num_citizens ? width : full_width,
-                    citizen_bar_height);
-    cairo_fill(cr);
-  }
-
-  total_used_width = (i - 1) * width + full_width;
-
-  if (total_used_width < citizen_bar_width) {
-    /* Clear the rest of the area.
-     * Note that this might still be necessary even in cases where
-     * num_citizens > NUM_CITIZENS_SHOWN, if the available width cannot be
-     * divided perfectly. */
-    cairo_rectangle(cr, total_used_width, 0,
-                    citizen_bar_width - total_used_width,
-                    citizen_bar_height);
-    cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-    cairo_fill(cr);
-  }
-
-  cairo_destroy(cr);
-
-  picture_set_from_surface(GTK_PICTURE(pdialog->citizen_pics),
-                           pdialog->citizen_surface);
-
-  gtk_widget_queue_draw(pdialog->citizen_pics);
-}
-
-
-/**********************************************************************//**
-  Update counters tab  in city dialog
-**************************************************************************/
-static void city_dialog_update_counters(struct city_dialog *pdialog)
-{
-  GtkBox *counterInfo, *valueData;
-  GtkLabel *counterName;
-  GtkLabel *counterValue;
-  GtkLabel *counterDescription;
-  char  int_val[101];
-  char *text;
-  int text_size;
-
-  if (NULL != pdialog->counters.widget) {
-    gtk_box_remove(GTK_BOX(gtk_widget_get_parent(GTK_WIDGET(pdialog->counters.widget))),
-                   GTK_WIDGET(pdialog->counters.widget));
-  }
-
-  if (NULL == pdialog->counters.container) {
-    pdialog->counters.container = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
-  }
-
-  pdialog->counters.widget = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
-  city_counters_iterate(pcount) {
-    counterInfo = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
-
-    counterName = GTK_LABEL(gtk_label_new(name_translation_get(&pcount->name)));
-    gtk_box_append(counterInfo, GTK_WIDGET(counterName));
-    valueData = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
-    counterValue = GTK_LABEL(gtk_label_new(_("Current value is: ")));
-    gtk_box_append(valueData, GTK_WIDGET(counterValue));
-    fc_snprintf(int_val, sizeof(int_val), "%d", pdialog->pcity->counter_values[counter_index(pcount)]);
-    counterValue = GTK_LABEL(gtk_label_new(int_val));
-    gtk_box_append(valueData, GTK_WIDGET(counterValue));
-    gtk_box_append(counterInfo, GTK_WIDGET(valueData));
-
-    valueData = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
-    counterValue = GTK_LABEL(gtk_label_new(_("Activated once value equal or higher than: ")));
-    gtk_box_append(valueData, GTK_WIDGET(counterValue));
-    fc_snprintf(int_val, sizeof(int_val), "%d", pcount->checkpoint);
-    counterValue = GTK_LABEL(gtk_label_new(int_val));
-    gtk_box_append(valueData, GTK_WIDGET(counterValue));
-    gtk_box_append(counterInfo, GTK_WIDGET(valueData));
-
-    text_size = 0;
-    if (NULL != pcount->helptext) {
-      strvec_iterate(pcount->helptext, text_) {
-        text_size += strlen(text_);
-      } strvec_iterate_end;
-    }
-    if (0 < text_size) {
-      text = malloc(text_size+1);
-      text_size = 0;
-      strvec_iterate(pcount->helptext, text_) {
-        strcpy(&text[text_size], text_);
-        text_size += strlen(text_);
-      } strvec_iterate_end;
-      counterDescription = GTK_LABEL(gtk_label_new(text));
-      free(text);
-      gtk_box_append(counterInfo,GTK_WIDGET(counterDescription));
-    }
-    gtk_box_append(pdialog->counters.widget, GTK_WIDGET(counterInfo));
-  } city_counters_iterate_end;
-
-  gtk_box_append(pdialog->counters.container, GTK_WIDGET(pdialog->counters.widget));
-  gtk_widget_show(GTK_WIDGET(pdialog->counters.container));
-}
-
-/***********************************************************************//**
-  Update textual info fields in city dialog
-***************************************************************************/
-static void city_dialog_update_information(GtkWidget **info_label,
-                                           struct city_dialog *pdialog)
-{
-  int i, illness = 0;
-  char buf[NUM_INFO_FIELDS][512];
-  struct city *pcity = pdialog->pcity;
-  int granaryturns;
-  int non_workers = city_specialists(pcity);
-
-  /* fill the buffers with the necessary info */
-  if (non_workers) {
-    fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d (%3d)",
-                pcity->size, non_workers);
-  } else {
-    fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d", pcity->size);
-  }
-  fc_snprintf(buf[INFO_FOOD], sizeof(buf[INFO_FOOD]), "%3d (%+4d)",
-              pcity->prod[O_FOOD], pcity->surplus[O_FOOD]);
-  fc_snprintf(buf[INFO_SHIELD], sizeof(buf[INFO_SHIELD]), "%3d (%+4d)",
-              pcity->prod[O_SHIELD] + pcity->waste[O_SHIELD],
-              pcity->surplus[O_SHIELD]);
-  fc_snprintf(buf[INFO_TRADE], sizeof(buf[INFO_TRADE]), "%3d (%+4d)",
-              pcity->surplus[O_TRADE] + pcity->waste[O_TRADE],
-              pcity->surplus[O_TRADE]);
-  fc_snprintf(buf[INFO_GOLD], sizeof(buf[INFO_GOLD]), "%3d (%+4d)",
-              pcity->prod[O_GOLD], pcity->surplus[O_GOLD]);
-  fc_snprintf(buf[INFO_LUXURY], sizeof(buf[INFO_LUXURY]), "%3d",
-              pcity->prod[O_LUXURY]);
-  fc_snprintf(buf[INFO_SCIENCE], sizeof(buf[INFO_SCIENCE]), "%3d",
-              pcity->prod[O_SCIENCE]);
-  fc_snprintf(buf[INFO_GRANARY], sizeof(buf[INFO_GRANARY]), "%4d/%-4d",
-              pcity->food_stock, city_granary_size(city_size_get(pcity)));
-
-  granaryturns = city_turns_to_grow(pcity);
-  if (granaryturns == 0) {
-    /* TRANS: city growth is blocked.  Keep short. */
-    fc_snprintf(buf[INFO_GROWTH], sizeof(buf[INFO_GROWTH]), _("blocked"));
-  } else if (granaryturns == FC_INFINITY) {
-    /* TRANS: city is not growing.  Keep short. */
-    fc_snprintf(buf[INFO_GROWTH], sizeof(buf[INFO_GROWTH]), _("never"));
-  } else {
-    /* A negative value means we'll have famine in that many turns.
-       But that's handled down below. */
-    /* TRANS: city growth turns.  Keep short. */
-    fc_snprintf(buf[INFO_GROWTH], sizeof(buf[INFO_GROWTH]),
-                PL_("%d turn", "%d turns", abs(granaryturns)),
-                abs(granaryturns));
-  }
-  fc_snprintf(buf[INFO_CORRUPTION], sizeof(buf[INFO_CORRUPTION]), "%4d",
-              pcity->waste[O_TRADE]);
-  fc_snprintf(buf[INFO_WASTE], sizeof(buf[INFO_WASTE]), "%4d",
-              pcity->waste[O_SHIELD]);
-  fc_snprintf(buf[INFO_CULTURE], sizeof(buf[INFO_CULTURE]), "%4d",
-              pcity->client.culture);
-  fc_snprintf(buf[INFO_POLLUTION], sizeof(buf[INFO_POLLUTION]), "%4d",
-              pcity->pollution);
-  if (!game.info.illness_on) {
-    fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "  -.-");
-  } else {
-    illness = city_illness_calc(pcity, NULL, NULL, NULL, NULL);
-    /* illness is in tenth of percent */
-    fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "%5.1f%%",
-                (float)illness / 10.0);
-  }
-  if (pcity->steal) {
-    fc_snprintf(buf[INFO_STEAL], sizeof(buf[INFO_STEAL]), PL_("%d time", "%d times", pcity->steal),
-                pcity->steal);
-  } else {
-    fc_snprintf(buf[INFO_STEAL], sizeof(buf[INFO_STEAL]), _("Not stolen"));
-  }
-
-  get_city_dialog_airlift_value(pcity, buf[INFO_AIRLIFT], sizeof(buf[INFO_AIRLIFT]));
-
-  /* stick 'em in the labels */
-  for (i = 0; i < NUM_INFO_FIELDS; i++) {
-    gtk_label_set_text(GTK_LABEL(info_label[i]), buf[i]);
-  }
-
-  /*
-   * Make use of the emergency-indicating styles set up for certain labels
-   * in create_city_info_table().
-   */
-  /* For starvation, the "4" below is arbitrary. 3 turns should be enough
-   * of a warning. */
-  if (granaryturns > -4 && granaryturns < 0) {
-    gtk_widget_add_css_class(info_label[INFO_GRANARY], "emergency");
-  } else {
-    gtk_widget_remove_css_class(info_label[INFO_GRANARY], "emergency");
-  }
-
-  if (granaryturns == 0 || pcity->surplus[O_FOOD] < 0) {
-    gtk_widget_add_css_class(info_label[INFO_GROWTH], "emergency");
-  } else {
-    gtk_widget_remove_css_class(info_label[INFO_GROWTH], "emergency");
-  }
-
-  /* Someone could add the color &orange for better granularity here */
-  if (pcity->pollution >= 10) {
-    gtk_widget_add_css_class(info_label[INFO_POLLUTION], "emergency");
-  } else {
-    gtk_widget_remove_css_class(info_label[INFO_POLLUTION], "emergency");
-  }
-
-  /* Illness is in tenth of percent, i.e 100 == 10.0% */
-  if (illness >= 100) {
-    gtk_widget_add_css_class(info_label[INFO_ILLNESS], "emergency");
-  } else {
-    gtk_widget_remove_css_class(info_label[INFO_ILLNESS], "emergency");
-  }
-}
-
-/***********************************************************************//**
-  Update map display of city dialog
-***************************************************************************/
-static void city_dialog_update_map(struct city_dialog *pdialog)
-{
-  struct canvas store = FC_STATIC_CANVAS_INIT;
-
-  store.surface = pdialog->map_canvas_store_unscaled;
-
-  /* The drawing is done in three steps.
-   *   1.  First we render to a pixmap with the appropriate canvas size.
-   *   2.  Then the pixmap is rendered into a pixbuf of equal size.
-   *   3.  Finally this pixbuf is composited and scaled onto the GtkImage's
-   *       target pixbuf.
-   */
-
-  city_dialog_redraw_map(pdialog->pcity, &store);
-
-  /* draw to real window */
-  draw_map_canvas(pdialog);
-}
-
-/***********************************************************************//**
-  Update what city is building and buy cost in city dialog
-***************************************************************************/
-static void city_dialog_update_building(struct city_dialog *pdialog)
-{
-  char buf[32], buf2[200];
-  gdouble pct;
-  GListStore *store;
-  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
-  struct item items[MAX_NUM_PRODUCTION_TARGETS];
-  int targets_used, item;
-  struct city *pcity = pdialog->pcity;
-  gboolean sensitive = city_can_buy(pcity);
-  const char *descr = city_production_name_translation(pcity);
-  int cost = city_production_build_shield_cost(pcity);
-
-  if (pdialog->overview.buy_command != NULL) {
-    gtk_widget_set_sensitive(GTK_WIDGET(pdialog->overview.buy_command), sensitive);
-  }
-  if (pdialog->production.buy_command != NULL) {
-    gtk_widget_set_sensitive(GTK_WIDGET(pdialog->production.buy_command), sensitive);
-  }
-
-  /* Make sure build slots info is up to date */
-  if (pdialog->production.production_label != NULL) {
-    int build_slots = city_build_slots(pcity);
-
-    /* Only display extra info if more than one slot is available */
-    if (build_slots > 1) {
-      fc_snprintf(buf2, sizeof(buf2),
-                  /* TRANS: never actually used with built_slots <= 1 */
-                  PL_("Production (up to %d unit per turn):",
-                      "Production (up to %d units per turn):", build_slots),
-                  build_slots);
-      gtk_label_set_text(
-        GTK_LABEL(pdialog->production.production_label), buf2);
-    } else {
-      gtk_label_set_text(
-        GTK_LABEL(pdialog->production.production_label), _("Production:"));
-    }
-  }
-
-  /* Update what the city is working on */
-  get_city_dialog_production(pcity, buf, sizeof(buf));
-
-  if (cost > 0) {
-    pct = (gdouble) pcity->shield_stock / (gdouble) cost;
-    pct = CLAMP(pct, 0.0, 1.0);
-  } else {
-    pct = 1.0;
-  }
-
-  if (pdialog->overview.production_bar != NULL) {
-    fc_snprintf(buf2, sizeof(buf2), "%s%s\n%s", descr,
-                worklist_is_empty(&pcity->worklist) ? "" : " (+)", buf);
-    gtk_progress_bar_set_text(
-      GTK_PROGRESS_BAR(pdialog->overview.production_bar), buf2);
-    gtk_progress_bar_set_fraction(
-      GTK_PROGRESS_BAR(pdialog->overview.production_bar), pct);
-  }
-
-  if (pdialog->production.production_bar != NULL) {
-    fc_snprintf(buf2, sizeof(buf2), "%s%s: %s", descr,
-                worklist_is_empty(&pcity->worklist) ? "" : " (+)", buf);
-    gtk_progress_bar_set_text(
-      GTK_PROGRESS_BAR(pdialog->production.production_bar), buf2);
-    gtk_progress_bar_set_fraction(
-      GTK_PROGRESS_BAR(pdialog->production.production_bar), pct);
-  }
-
-  store = pdialog->overview.change_prod_store;
-  if (store != nullptr) {
-    int cur = -1;
-    int actcount = 0;
-
-    if (pdialog->overview.change_prod_selection != nullptr) {
-      gtk_selection_model_select_item(GTK_SELECTION_MODEL(pdialog->overview.change_prod_selection),
-                                      -1, TRUE);
-    }
-
-    g_list_store_remove_all(store);
-
-    targets_used
-      = collect_eventually_buildable_targets(targets, pdialog->pcity, FALSE);
-    name_and_sort_items(targets, targets_used, items, FALSE, pcity);
-
-    for (item = 0; item < targets_used; item++) {
-      if (can_city_build_now(&(wld.map), pcity, &items[item].item)) {
-        const char *name;
-        struct sprite *sprite;
-        GdkPixbuf *pix;
-        struct universal *target = &items[item].item;
-        bool useless;
-        FcProdRow *row = fc_prod_row_new();
-
-        if (VUT_UTYPE == target->kind) {
-          name = utype_name_translation(target->value.utype);
-          sprite = get_unittype_sprite(tileset, target->value.utype,
-                                       ACTIVITY_LAST, direction8_invalid());
-          useless = FALSE;
-        } else {
-          name = improvement_name_translation(target->value.building);
-          sprite = get_building_sprite(tileset, target->value.building);
-          useless = is_improvement_redundant(pcity, target->value.building);
-        }
-        pix = sprite_get_pixbuf(sprite);
-
-        row->name = name;
-        row->id = (gint)cid_encode(items[item].item);
-        row->sprite = pix;
-        row->useless = useless;
-
-        g_list_store_append(store, row);
-        g_object_unref(row);
-
-        if (are_universals_equal(target, &pcity->production)) {
-          cur = actcount;
-        }
-
-        actcount++;
-      }
-    }
-
-    if (pdialog->overview.change_prod_selection != nullptr) {
-      gtk_selection_model_select_item(GTK_SELECTION_MODEL(pdialog->overview.change_prod_selection),
-                                      cur, TRUE);
-    }
-  }
-}
-
-/***********************************************************************//**
-  Update list of improvements in city dialog
-***************************************************************************/
-static void city_dialog_update_improvement_list(struct city_dialog *pdialog)
-{
-  int item, targets_used;
-  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
-  struct item items[MAX_NUM_PRODUCTION_TARGETS];
-
-  const char *tooltip_sellable = _("Press <b>ENTER</b> or double-click to "
-                                   "sell an improvement.");
-  const char *tooltip_great_wonder = _("Great Wonder - cannot be sold.");
-  const char *tooltip_small_wonder = _("Small Wonder - cannot be sold.");
-
-  targets_used = collect_already_built_targets(targets, pdialog->pcity);
-  name_and_sort_items(targets, targets_used, items, FALSE, pdialog->pcity);
-
-  g_list_store_remove_all(pdialog->overview.improvement_list);
-
-  for (item = 0; item < targets_used; item++) {
-    GdkPixbuf *pix;
-    int upkeep;
-    struct sprite *sprite;
-    struct universal target = items[item].item;
-    FcImprRow *row = fc_impr_row_new();
-
-    fc_assert_action(VUT_IMPROVEMENT == target.kind, continue);
-    /* This takes effects (like Adam Smith's) into account. */
-    upkeep = city_improvement_upkeep(pdialog->pcity, target.value.building);
-    sprite = get_building_sprite(tileset, target.value.building);
-
-    pix = sprite_get_pixbuf(sprite);
-
-    row->impr = target.value.building;
-    row->sprite = pix;
-    row->description = items[item].descr;
-    row->upkeep = upkeep;
-    row->redundant = is_improvement_redundant(pdialog->pcity,
-                                              target.value.building);
-    row->tooltip = is_great_wonder(target.value.building) ?
-                         tooltip_great_wonder :
-                           (is_small_wonder(target.value.building) ?
-                            tooltip_small_wonder : tooltip_sellable);
-
-    g_list_store_append(pdialog->overview.improvement_list, row);
-    g_object_unref(row);
-  }
-}
-
-/***********************************************************************//**
-  Update list of supported units in city dialog
-***************************************************************************/
-static void city_dialog_update_supported_units(struct city_dialog *pdialog)
-{
-  struct unit_list *units;
-  struct unit_node_vector *nodes;
-  int n, m, i;
-  gchar *buf;
-  int free_unhappy = get_city_bonus(pdialog->pcity, EFT_MAKE_CONTENT_MIL);
-  const struct civ_map *nmap = &(wld.map);
-
-  if (NULL != client.conn.playing
-      && city_owner(pdialog->pcity) != client.conn.playing) {
-    units = pdialog->pcity->client.info_units_supported;
-  } else {
-    units = pdialog->pcity->units_supported;
-  }
-
-  nodes = &pdialog->overview.supported_units;
-
-  n = unit_list_size(units);
-  m = unit_node_vector_size(nodes);
-
-  if (m > n) {
-    i = 0;
-    unit_node_vector_iterate(nodes, elt) {
-      if (i++ >= n) {
-        gtk_box_remove(GTK_BOX(pdialog->overview.supported_unit_table),
-                       elt->cmd);
-      }
-    } unit_node_vector_iterate_end;
-
-    unit_node_vector_reserve(nodes, n);
-  } else {
-    for (i = m; i < n; i++) {
-      GtkWidget *cmd, *pix;
-      struct unit_node node;
-
-      cmd = gtk_button_new();
-      node.cmd = cmd;
-
-      gtk_button_set_has_frame(GTK_BUTTON(cmd), FALSE);
-
-      pix = gtk_picture_new();
-      node.pix = pix;
-      node.height = tileset_unit_with_upkeep_height(tileset);
-
-      gtk_button_set_child(GTK_BUTTON(cmd), pix);
-
-      gtk_box_append(GTK_BOX(pdialog->overview.supported_unit_table),
-                     cmd);
-
-      node.left = NULL;
-      node.middle = NULL;
-      node.right = NULL;
-
-      unit_node_vector_append(nodes, node);
-    }
-  }
-
-  i = 0;
-  unit_list_iterate(units, punit) {
-    struct unit_node *pnode;
-    int happy_cost = city_unit_unhappiness(nmap, punit, &free_unhappy);
-
-    pnode = unit_node_vector_get(nodes, i);
-    if (pnode) {
-      GtkWidget *cmd, *pix;
-      GtkGesture *gesture;
-      GtkEventController *controller;
-
-      cmd = pnode->cmd;
-      pix = pnode->pix;
-
-      put_unit_picture_city_overlays(punit, GTK_PICTURE(pix), pnode->height,
-                                     punit->upkeep, happy_cost);
-
-      if (pnode->left != NULL) {
-        gtk_widget_remove_controller(cmd, pnode->left);
-        gtk_widget_remove_controller(cmd, pnode->middle);
-        gtk_widget_remove_controller(cmd, pnode->right);
-      }
-
-      gtk_widget_set_tooltip_text(cmd, unit_description(punit));
-
-      controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-      g_signal_connect(controller, "pressed",
-                       G_CALLBACK(supported_unit_callback),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->left = controller;
-      gesture = gtk_gesture_click_new();
-      gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 2);
-      controller = GTK_EVENT_CONTROLLER(gesture);
-      g_signal_connect(controller, "released",
-                       G_CALLBACK(middle_supported_unit_release),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->middle = controller;
-      gesture = gtk_gesture_click_new();
-      gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-      controller = GTK_EVENT_CONTROLLER(gesture);
-      g_signal_connect(controller, "released",
-                       G_CALLBACK(right_unit_release),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->right = controller;
-
-      if (city_owner(pdialog->pcity) != client.conn.playing) {
-        gtk_widget_set_sensitive(cmd, FALSE);
-      } else {
-        gtk_widget_set_sensitive(cmd, TRUE);
-      }
-
-      gtk_widget_set_visible(pix, TRUE);
-      gtk_widget_set_visible(cmd, TRUE);
-    }
-    i++;
-  } unit_list_iterate_end;
-
-  buf = g_strdup_printf(_("Supported units %d"), n);
-  gtk_frame_set_label(GTK_FRAME(pdialog->overview.supported_units_frame), buf);
-  g_free(buf);
-}
-
-/***********************************************************************//**
-  Update list of present units in city dialog
-***************************************************************************/
-static void city_dialog_update_present_units(struct city_dialog *pdialog)
-{
-  struct unit_list *units;
-  struct unit_node_vector *nodes;
-  int n, m, i;
-  gchar *buf;
-
-  if (NULL != client.conn.playing
-      && city_owner(pdialog->pcity) != client.conn.playing) {
-    units = pdialog->pcity->client.info_units_present;
-  } else {
-    units = pdialog->pcity->tile->units;
-  }
-
-  nodes = &pdialog->overview.present_units;
-
-  n = unit_list_size(units);
-  m = unit_node_vector_size(nodes);
-
-  if (m > n) {
-    i = 0;
-    unit_node_vector_iterate(nodes, elt) {
-      if (i++ >= n) {
-        gtk_box_remove(GTK_BOX(pdialog->overview.present_unit_table),
-                       elt->cmd);
-      }
-    } unit_node_vector_iterate_end;
-
-    unit_node_vector_reserve(nodes, n);
-  } else {
-    for (i = m; i < n; i++) {
-      GtkWidget *cmd, *pix;
-      struct unit_node node;
-
-      cmd = gtk_button_new();
-      node.cmd = cmd;
-
-      gtk_button_set_has_frame(GTK_BUTTON(cmd), FALSE);
-
-      pix = gtk_picture_new();
-      node.pix = pix;
-      node.height = tileset_full_tile_height(tileset);
-
-      gtk_button_set_child(GTK_BUTTON(cmd), pix);
-
-      gtk_box_append(GTK_BOX(pdialog->overview.present_unit_table),
-                     cmd);
-
-      node.left = NULL;
-      node.middle = NULL;
-      node.right = NULL;
-
-      unit_node_vector_append(nodes, node);
-    }
-  }
-
-  i = 0;
-  unit_list_iterate(units, punit) {
-    struct unit_node *pnode;
-
-    pnode = unit_node_vector_get(nodes, i);
-    if (pnode) {
-      GtkWidget *cmd, *pix;
-      GtkEventController *controller;
-      GtkGesture *gesture;
-
-      cmd = pnode->cmd;
-      pix = pnode->pix;
-
-      put_unit_picture(punit, GTK_PICTURE(pix), pnode->height);
-
-      if (pnode->left != NULL) {
-        gtk_widget_remove_controller(cmd, pnode->left);
-        gtk_widget_remove_controller(cmd, pnode->middle);
-        gtk_widget_remove_controller(cmd, pnode->right);
-      }
-
-      gtk_widget_set_tooltip_text(cmd, unit_description(punit));
-
-      controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-      g_signal_connect(controller, "pressed",
-                       G_CALLBACK(present_unit_callback),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->left = controller;
-      gesture = gtk_gesture_click_new();
-      gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 2);
-      controller = GTK_EVENT_CONTROLLER(gesture);
-      g_signal_connect(controller, "released",
-                       G_CALLBACK(middle_present_unit_release),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->middle = controller;
-      gesture = gtk_gesture_click_new();
-      gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-      controller = GTK_EVENT_CONTROLLER(gesture);
-      g_signal_connect(controller, "released",
-                       G_CALLBACK(right_unit_release),
-                       GINT_TO_POINTER(punit->id));
-      gtk_widget_add_controller(cmd, controller);
-      pnode->right = controller;
-
-      if (city_owner(pdialog->pcity) != client.conn.playing) {
-        gtk_widget_set_sensitive(cmd, FALSE);
-      } else {
-        gtk_widget_set_sensitive(cmd, TRUE);
-      }
-
-      gtk_widget_set_visible(pix, TRUE);
-      gtk_widget_set_visible(cmd, TRUE);
-    }
-    i++;
-  } unit_list_iterate_end;
-
-  buf = g_strdup_printf(_("Present units %d"), n);
-  gtk_frame_set_label(GTK_FRAME(pdialog->overview.present_units_frame), buf);
-  g_free(buf);
-}
-
-/***********************************************************************//**
-  Updates the sensitivity of the prev and next buttons.
-  this does not need pdialog as a parameter, since it iterates
-  over all the open dialogs.
-  note: we still need the sensitivity code in create_city_dialog()
-  for the spied dialogs.
-***************************************************************************/
-static void city_dialog_update_prev_next(void)
-{
-  int count = 0;
-  int city_number;
-
-  if (NULL != client.conn.playing) {
-    city_number = city_list_size(client.conn.playing->cities);
-  } else {
-    city_number = FC_INFINITY; /* ? */
-  }
-
-  /* The first time, we see if all the city dialogs are open */
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (city_owner(pdialog->pcity) == client.conn.playing) {
-      count++;
-    }
-  } dialog_list_iterate_end;
-
-  if (count == city_number) {   /* All are open, shouldn't prev/next */
-    dialog_list_iterate(dialog_list, pdialog) {
-      gtk_widget_set_sensitive(GTK_WIDGET(pdialog->prev_command), FALSE);
-      gtk_widget_set_sensitive(GTK_WIDGET(pdialog->next_command), FALSE);
-    } dialog_list_iterate_end;
-  } else {
-    dialog_list_iterate(dialog_list, pdialog) {
-      if (city_owner(pdialog->pcity) == client.conn.playing) {
-        gtk_widget_set_sensitive(GTK_WIDGET(pdialog->prev_command), TRUE);
-        gtk_widget_set_sensitive(GTK_WIDGET(pdialog->next_command), TRUE);
-      }
-    } dialog_list_iterate_end;
-  }
-}
-
-/***********************************************************************//**
-  User clicked button from action area.
-***************************************************************************/
-static void citydlg_response_callback(GtkDialog *dlg, gint response,
-                                      void *data)
-{
-  switch (response) {
-  case CDLGR_UNITS:
-    show_units_response(data);
-    break;
-  }
-}
-
-/***********************************************************************//**
-  User has clicked show units
-***************************************************************************/
-static void show_units_response(void *data)
-{
-  struct city_dialog *pdialog = (struct city_dialog *) data;
-  struct tile *ptile = pdialog->pcity->tile;
-
-  if (unit_list_size(ptile->units)) {
-    unit_select_dialog_popup(ptile);
-  }
-}
-
-/***********************************************************************//**
-  Create menu for the unit in citydlg
-
-  @param pdialog   Dialog to create menu to
-  @param punit     Unit to create menu for
-  @param wdg       Widget to attach menu to
-  @param supported Is this supported units menu (not present units)
-
-  @return whether menu was really created
-***************************************************************************/
-static bool create_unit_menu(struct city_dialog *pdialog, struct unit *punit,
-                             GtkWidget *wdg, bool supported)
-{
-  GMenu *menu;
-  GActionGroup *group;
-  GSimpleAction *act;
-
-  if (!can_client_issue_orders()) {
-    return FALSE;
-  }
-
-  if (pdialog->popover != NULL) {
-    close_citydlg_unit_popover(pdialog);
-  }
-
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-  menu = g_menu_new();
-
-  if (supported) {
-    act = g_simple_action_new("center", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_center_callback),
-                     GINT_TO_POINTER(punit->id));
-    menu_item_append_unref(menu, g_menu_item_new(_("Cen_ter"), "win.center"));
-  }
-
-  act = g_simple_action_new("activate", NULL);
-  g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(unit_activate_callback),
-                   GINT_TO_POINTER(punit->id));
-  menu_item_append_unref(menu, g_menu_item_new(_("_Activate unit"),
-                                               "win.activate"));
-
-  act = g_simple_action_new("activate_close", NULL);
-  g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-
-  if (supported) {
-    g_signal_connect(act, "activate",
-                     G_CALLBACK(supported_unit_activate_close_callback),
-                     GINT_TO_POINTER(punit->id));
-  } else {
-    g_signal_connect(act, "activate",
-                     G_CALLBACK(present_unit_activate_close_callback),
-                     GINT_TO_POINTER(punit->id));
-  }
-
-  menu_item_append_unref(menu,
-                         g_menu_item_new(_("Activate unit, _close dialog"),
-                                         "win.activate_close"));
-
-  if (!supported) {
-    act = g_simple_action_new("load", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_load_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act), unit_can_load(punit));
-    menu_item_append_unref(menu, g_menu_item_new(_("_Load unit"), "win.load"));
-
-    act = g_simple_action_new("unload", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_unload_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                can_unit_unload(punit,
-                                                unit_transport_get(punit))
-                                && can_unit_exist_at_tile(&(wld.map), punit,
-                                                          unit_tile(punit)));
-    menu_item_append_unref(menu, g_menu_item_new(_("_Unload unit"),
-                                                 "win.unload"));
-
-    act = g_simple_action_new("sentry", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_sentry_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                punit->activity != ACTIVITY_SENTRY
-                                && can_unit_do_activity_client(punit,
-                                                               ACTIVITY_SENTRY));
-    menu_item_append_unref(menu, g_menu_item_new(_("_Sentry unit"),
-                                                 "win.sentry"));
-
-    act = g_simple_action_new("fortify", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_fortify_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                punit->activity != ACTIVITY_FORTIFYING
-                                && can_unit_do_activity_client(punit,
-                                                               ACTIVITY_FORTIFYING));
-    menu_item_append_unref(menu, g_menu_item_new(_("_Fortify unit"),
-                                                 "win.fortify"));
-  }
-
-  act = g_simple_action_new("disband", NULL);
-  g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(unit_disband_callback),
-                   GINT_TO_POINTER(punit->id));
-  g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                              unit_can_do_action(punit, ACTION_DISBAND_UNIT));
-  menu_item_append_unref(menu, g_menu_item_new(_("_Disband unit"),
-                                               "win.disband"));
-
-  if (!supported) {
-    act = g_simple_action_new("rehome", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_homecity_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                can_unit_change_homecity_to(&(wld.map), punit,
-                                                            pdialog->pcity));
-    menu_item_append_unref(menu,
-                           g_menu_item_new(action_id_name_translation(ACTION_HOME_CITY),
-                                           "win.rehome"));
-
-    act = g_simple_action_new("upgrade", NULL);
-    g_object_set_data(G_OBJECT(act), "dlg", pdialog);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(unit_upgrade_callback),
-                     GINT_TO_POINTER(punit->id));
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                action_ever_possible(ACTION_UPGRADE_UNIT)
-                                && can_client_issue_orders()
-                                && can_upgrade_unittype(client_player(),
-                                                        unit_type_get(punit))
-                                   != NULL);
-    menu_item_append_unref(menu, g_menu_item_new(_("U_pgrade unit"),
-                                                 "win.upgrade"));
-  }
-
-  pdialog->popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
-  g_object_ref(pdialog->popover);
-  gtk_widget_insert_action_group(pdialog->popover, "win", group);
-  gtk_widget_set_parent(pdialog->popover, wdg);
-
-
-  gtk_popover_popup(GTK_POPOVER(pdialog->popover));
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Pop-up menu to change attributes of supported units
-***************************************************************************/
-static gboolean supported_unit_callback(GtkGestureClick *gesture, int n_press,
-                                        double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog;
-  struct city *pcity;
-  struct unit *punit =
-    player_unit_by_number(client_player(), (size_t) data);
-
-  if (NULL != punit
-      && NULL != (pcity = game_city_by_number(punit->homecity))
-      && NULL != (pdialog = get_city_dialog(pcity))) {
-
-    return create_unit_menu(pdialog, punit,
-                            gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture)),
-                            TRUE);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Pop-up menu to change attributes of units, ex. change homecity.
-***************************************************************************/
-static gboolean present_unit_callback(GtkGestureClick *gesture, int n_press,
-                                      double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog;
-  struct city *pcity;
-  struct unit *punit =
-    player_unit_by_number(client_player(), (size_t) data);
-
-  if (NULL != punit
-      && NULL != (pcity = tile_city(unit_tile(punit)))
-      && NULL != (pdialog = get_city_dialog(pcity))) {
-
-    return create_unit_menu(pdialog, punit,
-                            gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture)),
-                            FALSE);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  If user middle-clicked on a unit, activate it and close dialog.
-  Dialog to close is that of city where unit currently is.
-***************************************************************************/
-static gboolean middle_present_unit_release(GtkGestureClick *gesture,
-                                            int n_press, double x, double y,
-                                            gpointer data)
-{
-  struct city_dialog *pdialog;
-  struct city *pcity;
-  struct unit *punit =
-    player_unit_by_number(client_player(), (size_t) data);
-
-  if (NULL != punit
-      && NULL != (pcity = tile_city(unit_tile(punit)))
-      && NULL != (pdialog = get_city_dialog(pcity))
-      && can_client_issue_orders()) {
-    unit_focus_set(punit);
-    close_city_dialog(pdialog);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  If user middle-clicked on a unit, activate it and close dialog.
-  Dialog to close is that of unit's home city.
-***************************************************************************/
-static gboolean middle_supported_unit_release(GtkGestureClick *gesture, int n_press,
-                                              double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog;
-  struct city *pcity;
-  struct unit *punit =
-    player_unit_by_number(client_player(), (size_t) data);
-
-  if (NULL != punit
-      && NULL != (pcity = game_city_by_number(punit->homecity))
-      && NULL != (pdialog = get_city_dialog(pcity))
-      && can_client_issue_orders()) {
-    unit_focus_set(punit);
-    close_city_dialog(pdialog);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  If user right-clicked on a unit, activate it
-***************************************************************************/
-static gboolean right_unit_release(GtkGestureClick *gesture, int n_press,
-                                   double x, double y, gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), (size_t) data);
-
-  if (NULL != punit
-      && can_client_issue_orders()) {
-    unit_focus_set(punit);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Close unit menu
-
-  @param pdialog Dialog where the menu should be closed from
-***************************************************************************/
-static void close_citydlg_unit_popover(struct city_dialog *pdialog)
-{
-  if (pdialog->popover != NULL) {
-    gtk_widget_unparent(pdialog->popover);
-    g_object_unref(pdialog->popover);
-    pdialog->popover = NULL;
-  }
-}
-
-/***********************************************************************//**
-  User has requested centering to unit
-***************************************************************************/
-static void unit_center_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    center_tile_mapcanvas(unit_tile(punit));
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit activation
-***************************************************************************/
-static void unit_activate_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    unit_focus_set(punit);
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested some supported unit to be activated and
-  city dialog to be closed
-***************************************************************************/
-static void supported_unit_activate_close_callback(GSimpleAction *action,
-                                                   GVariant *parameter,
-                                                   gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    struct city *pcity =
-      player_city_by_number(client_player(), punit->homecity);
-
-    unit_focus_set(punit);
-    if (NULL != pcity) {
-      struct city_dialog *pdialog = get_city_dialog(pcity);
-
-      if (NULL != pdialog) {
-        close_city_dialog(pdialog);
-      }
-    }
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested some present unit to be activated and
-  city dialog to be closed
-***************************************************************************/
-static void present_unit_activate_close_callback(GSimpleAction *action,
-                                                 GVariant *parameter,
-                                                 gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    struct city *pcity = tile_city(unit_tile(punit));
-
-    unit_focus_set(punit);
-    if (NULL != pcity) {
-      struct city_dialog *pdialog = get_city_dialog(pcity);
-
-      if (NULL != pdialog) {
-        close_city_dialog(pdialog);
-      }
-    }
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be loaded to transport
-***************************************************************************/
-static void unit_load_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    request_transport(punit, unit_tile(punit));
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be unloaded from transport
-***************************************************************************/
-static void unit_unload_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    request_unit_unload(punit);
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be sentried
-***************************************************************************/
-static void unit_sentry_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    request_unit_sentry(punit);
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be fortified
-***************************************************************************/
-static void unit_fortify_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    request_unit_fortify(punit);
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be disbanded
-***************************************************************************/
-static void unit_disband_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct unit_list *punits;
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL == punit) {
-    return;
-  }
-
-  punits = unit_list_new();
-  unit_list_append(punits, punit);
-  popup_disband_dialog(punits);
-  unit_list_destroy(punits);
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to change homecity to city where it
-  currently is
-***************************************************************************/
-static void unit_homecity_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL != punit) {
-    request_unit_change_homecity(punit);
-  }
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/***********************************************************************//**
-  User has requested unit to be upgraded
-***************************************************************************/
-static void unit_upgrade_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct unit_list *punits;
-  struct unit *punit =
-    player_unit_by_number(client_player(), GPOINTER_TO_INT(data));
-
-  if (NULL == punit) {
-    return;
-  }
-
-  punits = unit_list_new();
-  unit_list_append(punits, punit);
-  popup_upgrade_dialog(punits);
-  unit_list_destroy(punits);
-
-  close_citydlg_unit_popover(g_object_get_data(G_OBJECT(action), "dlg"));
-}
-
-/******** Callbacks for citizen bar, map funcs that are not update ********/
-
-/***********************************************************************//**
-  User clicked the list of citizens. If they clicked a specialist
-  then change its type, else do nothing.
-***************************************************************************/
-static gboolean citizens_callback(GtkGestureClick *gesture, int n_press,
-                                  double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog = data;
-  struct city *pcity = pdialog->pcity;
-  int citnum, tlen, len;
-
-  if (!can_client_issue_orders()) {
-    return FALSE;
-  }
-
-  tlen = tileset_small_sprite_width(tileset);
-  len = (city_size_get(pcity) - 1) * pdialog->cwidth + tlen;
-
-  if (x > len) {
-    /* No citizen that far to the right */
-    return FALSE;
-  }
-  citnum = MIN(city_size_get(pcity) - 1, x / pdialog->cwidth);
-
-  city_rotate_specialist(pcity, citnum);
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Set requested workertask
-***************************************************************************/
-static void set_city_workertask(GtkWidget *w, gpointer data)
-{
-  enum unit_activity act = (enum unit_activity)GPOINTER_TO_INT(data);
-  struct city *pcity = workertask_req.owner;
-  struct tile *ptile = workertask_req.loc;
-  struct packet_worker_task task;
-
-  task.city_id = pcity->id;
-
-  if (act == ACTIVITY_LAST) {
-    task.tgt = -1;
-    task.want = 0;
-  } else {
-    enum extra_cause cause = activity_to_extra_cause(act);
-    enum extra_rmcause rmcause = activity_to_extra_rmcause(act);
-    struct extra_type *tgt;
-
-    if (cause != EC_NONE) {
-      tgt = next_extra_for_tile(ptile, cause, city_owner(pcity), NULL);
-    } else if (rmcause != ERM_NONE) {
-      tgt = prev_extra_in_tile(ptile, rmcause, city_owner(pcity), NULL);
-    } else {
-      tgt = NULL;
-    }
-
-    if (tgt == NULL) {
-      struct terrain *pterr = tile_terrain(ptile);
-
-      if ((act != ACTIVITY_TRANSFORM
-           || pterr->transform_result == NULL || pterr->transform_result == pterr)
-          && (act != ACTIVITY_CULTIVATE || pterr->cultivate_result == NULL)
-          && (act != ACTIVITY_PLANT || pterr->plant_result == NULL)) {
-        /* No extra to order */
-        output_window_append(ftc_client, _("There's no suitable extra to order."));
-
-        return;
-      }
-
-      task.tgt = -1;
-    } else {
-      task.tgt = extra_index(tgt);
-    }
-
-    task.want = 100;
-  }
-
-  task.tile_id = ptile->index;
-  task.activity = act;
-
-  send_packet_worker_task(&client.conn, &task);
-}
-
-/***********************************************************************//**
-  Destroy workertask dlg
-***************************************************************************/
-static void workertask_dlg_destroy(GtkWidget *w, gpointer data)
-{
-  is_showing_workertask_dialog = FALSE;
-}
-
-/***********************************************************************//**
-  Open dialog for setting worker task
-***************************************************************************/
-static void popup_workertask_dlg(struct city *pcity, struct tile *ptile)
-{
-  if (!is_showing_workertask_dialog) {
-    GtkWidget *shl;
-    struct terrain *pterr = tile_terrain(ptile);
-    struct universal for_terr = { .kind = VUT_TERRAIN,
-                                  .value = { .terrain = pterr }};
-    struct worker_task *ptask;
-
-    is_showing_workertask_dialog = TRUE;
-    workertask_req.owner = pcity;
-    workertask_req.loc = ptile;
-
-    shl = choice_dialog_start(GTK_WINDOW(toplevel),
-                              _("What Action to Request"),
-                              _("Select autoworker activity:"));
-
-    ptask = worker_task_list_get(pcity->task_reqs, 0);
-    if (ptask != NULL) {
-      choice_dialog_add(shl, _("Clear request"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_LAST), FALSE, NULL);
-    }
-
-    if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) {
-      choice_dialog_add(shl, Q_("?act:Mine"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_MINE), FALSE, NULL);
-    }
-    if (pterr->plant_result != NULL
-        && action_id_univs_not_blocking(ACTION_PLANT,
-                                        NULL, &for_terr)) {
-      choice_dialog_add(shl, _("Plant"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_PLANT), FALSE, NULL);
-    }
-    if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) {
-      choice_dialog_add(shl, _("Irrigate"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_IRRIGATE), FALSE, NULL);
-    }
-    if (pterr->cultivate_result != NULL
-        && action_id_univs_not_blocking(ACTION_CULTIVATE,
-                                        NULL, &for_terr)) {
-      choice_dialog_add(shl, _("Cultivate"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_CULTIVATE), FALSE, NULL);
-    }
-    if (next_extra_for_tile(ptile, EC_ROAD, city_owner(pcity), NULL) != NULL) {
-      choice_dialog_add(shl, _("Road"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_GEN_ROAD), FALSE, NULL);
-    }
-    if (pterr->transform_result != pterr && pterr->transform_result != NULL
-        && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN,
-                                        NULL, &for_terr)) {
-      choice_dialog_add(shl, _("Transform"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_TRANSFORM), FALSE, NULL);
-    }
-    if (prev_extra_in_tile(ptile, ERM_CLEAN,
-                           city_owner(pcity), NULL) != NULL) {
-      choice_dialog_add(shl, _("Clean"),
-                        G_CALLBACK(set_city_workertask),
-                        GINT_TO_POINTER(ACTIVITY_CLEAN), FALSE, NULL);
-    }
-
-    choice_dialog_add(shl, _("_Cancel"), 0, 0, FALSE, NULL);
-    choice_dialog_end(shl);
-
-    g_signal_connect(shl, "destroy", G_CALLBACK(workertask_dlg_destroy),
-                     NULL);
-  }
-}
-
-/***********************************************************************//**
-  User has pressed left button on citymap
-***************************************************************************/
-static gboolean left_button_down_citymap(GtkGestureClick *gesture, int n_press,
-                                         double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog = data;
-  int canvas_x, canvas_y, city_x, city_y;
-
-  if (!can_client_issue_orders()) {
-    return FALSE;
-  }
-
-  if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-    return FALSE;
-  }
-
-  canvas_x = x * (double)canvas_width / (double)CITYMAP_WIDTH;
-  canvas_y = y * (double)canvas_height / (double)CITYMAP_HEIGHT;
-
-  if (canvas_to_city_pos(&city_x, &city_y,
-                         city_map_radius_sq_get(pdialog->pcity),
-                         canvas_x, canvas_y)) {
-    city_toggle_worker(pdialog->pcity, city_x, city_y);
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  User has pressed right button on citymap
-***************************************************************************/
-static gboolean right_button_down_citymap(GtkGestureClick *gesture, int n_press,
-                                          double x, double y, gpointer data)
-{
-  struct city_dialog *pdialog = data;
-  int canvas_x, canvas_y, city_x, city_y;
-
-  if (!can_client_issue_orders()) {
-    return FALSE;
-  }
-
-  canvas_x = x * (double)canvas_width / (double)CITYMAP_WIDTH;
-  canvas_y = y * (double)canvas_height / (double)CITYMAP_HEIGHT;
-
-  if (canvas_to_city_pos(&city_x, &city_y,
-                         city_map_radius_sq_get(pdialog->pcity),
-                         canvas_x, canvas_y)) {
-    struct city *pcity = pdialog->pcity;
-
-    popup_workertask_dlg(pdialog->pcity,
-                         city_map_to_tile(&(wld.map), pcity->tile,
-                                          city_map_radius_sq_get(pcity),
-                                          city_x, city_y));
-  }
-
-  return TRUE;
-}
-
-/***********************************************************************//**
-  Set map canvas to be drawn
-***************************************************************************/
-static void draw_map_canvas(struct city_dialog *pdialog)
-{
-  gtk_widget_queue_draw(pdialog->overview.map_canvas.darea);
-  if (pdialog->happiness.map_canvas.darea) { /* in case of spy */
-    gtk_widget_queue_draw(pdialog->happiness.map_canvas.darea);
-  }
-}
-
-/************** Callbacks for Buy, Change, Sell, Worklist *****************/
-
-/***********************************************************************//**
-  User has answered buy cost dialog
-***************************************************************************/
-static void buy_callback_response(GObject *dialog, GAsyncResult *result,
-                                  gpointer data)
-{
-  int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
-                                              result, NULL);
-
-  if (button == 0) {
-    struct city_dialog *pdialog = data;
-
-    city_buy_production(pdialog->pcity);
-  }
-}
-
-/***********************************************************************//**
-  User has clicked buy-button
-***************************************************************************/
-static void buy_callback(GtkWidget *w, gpointer data)
-{
-  GtkAlertDialog *shell;
-  struct city_dialog *pdialog = data;
-  const char *name = city_production_name_translation(pdialog->pcity);
-  int value = pdialog->pcity->client.buy_cost;
-  char buf[1024];
-
-  if (!can_client_issue_orders()) {
-    return;
-  }
-
-  fc_snprintf(buf, ARRAY_SIZE(buf), PL_("Treasury contains %d gold.",
-                                        "Treasury contains %d gold.",
-                                        client_player()->economic.gold),
-              client_player()->economic.gold);
-
-  if (value <= client_player()->economic.gold) {
-    const char *buttons[] = { _("Yes"), _("No"), NULL };
-
-    shell = gtk_alert_dialog_new(
-        /* TRANS: Last %s is pre-pluralised "Treasury contains %d gold." */
-        PL_("Buy %s for %d gold?\n%s",
-            "Buy %s for %d gold?\n%s", value),
-        name, value, buf);
-    gtk_alert_dialog_set_buttons(shell, buttons);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Buy It!"));
-    gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_NO);
-
-    gtk_alert_dialog_choose(shell, GTK_WINDOW(toplevel), NULL,
-                            buy_callback_response, pdialog);
-  } else {
-    const char *buttons[] = { _("Close"), NULL };
-
-    shell = gtk_alert_dialog_new(
-        /* TRANS: Last %s is pre-pluralised "Treasury contains %d gold." */
-        PL_("%s costs %d gold.\n%s",
-            "%s costs %d gold.\n%s", value),
-        name, value, buf);
-    gtk_alert_dialog_set_buttons(shell, buttons);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Buy It!"));
-    gtk_alert_dialog_choose(shell, GTK_WINDOW(toplevel), NULL,
-                            alert_close_response, NULL);
-  }
-}
-
-/***********************************************************************//**
-  Callback for the production list.
-***************************************************************************/
-static void change_production_callback(GtkSelectionModel *self,
-                                      guint position,
-                                      guint n_items,
-                                      gpointer data)
-{
-  if (can_client_issue_orders()) {
-    FcProdRow *row = gtk_single_selection_get_selected_item(
-                                          GTK_SINGLE_SELECTION(self));
-    struct universal univ = cid_production(row->id);
-
-    city_change_production(((struct city_dialog *)data)->pcity, &univ);
-  }
-}
-
-/***********************************************************************//**
-  User has clicked sell-button
-***************************************************************************/
-static void sell_callback(const struct impr_type *pimprove, gpointer data)
-{
-  GtkWidget *shl;
-  struct city_dialog *pdialog = (struct city_dialog *) data;
-  pdialog->sell_id = improvement_number(pimprove);
-  int price;
-
-  if (!can_client_issue_orders()) {
-    return;
-  }
-
-  if (test_player_sell_building_now(client.conn.playing, pdialog->pcity,
-                                    pimprove) != TR_SUCCESS) {
-    return;
-  }
-
-  price = impr_sell_gold(pimprove);
-  shl = gtk_message_dialog_new(NULL,
-    GTK_DIALOG_DESTROY_WITH_PARENT,
-    GTK_MESSAGE_QUESTION,
-    GTK_BUTTONS_YES_NO,
-    PL_("Sell %s for %d gold?",
-        "Sell %s for %d gold?", price),
-    city_improvement_name_translation(pdialog->pcity, pimprove), price);
-  setup_dialog(shl, pdialog->shell);
-  pdialog->sell_shell = shl;
-
-  gtk_window_set_title(GTK_WINDOW(shl), _("Sell It!"));
-
-  g_signal_connect(shl, "response",
-                   G_CALLBACK(sell_callback_response), pdialog);
-
-  gtk_window_present(GTK_WINDOW(shl));
-}
-
-/***********************************************************************//**
-  User has responded to sell price dialog
-***************************************************************************/
-static void sell_callback_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct city_dialog *pdialog = data;
-
-  if (response == GTK_RESPONSE_YES) {
-    city_sell_improvement(pdialog->pcity, pdialog->sell_id);
-  }
-  gtk_window_destroy(GTK_WINDOW(w));
-
-  pdialog->sell_shell = NULL;
-}
-
-/***********************************************************************//**
-  This is here because it's closely related to the sell stuff
-***************************************************************************/
-static void impr_callback(GtkColumnView *self, guint position,
-                          gpointer data)
-{
-  GdkSeat *seat;
-  GdkModifierType mask;
-  GListStore *store = ((struct city_dialog *)data)->overview.improvement_list;
-  FcImprRow *row = g_list_model_get_item(G_LIST_MODEL(store), position);
-  const struct impr_type *pimpr = row->impr;
-  GtkWidget *wdg = ((struct city_dialog *)data)->shell;
-
-  seat = gdk_display_get_default_seat(gtk_widget_get_display(wdg));
-  mask = gdk_device_get_modifier_state(gdk_seat_get_keyboard(seat));
-
-  if (!(mask & GDK_CONTROL_MASK)) {
-    sell_callback(pimpr, data);
-  } else {
-    if (is_great_wonder(pimpr)) {
-      popup_help_dialog_typed(improvement_name_translation(pimpr), HELP_WONDER);
-    } else {
-      popup_help_dialog_typed(improvement_name_translation(pimpr), HELP_IMPROVEMENT);
-    }
-  }
-}
-
-/************ Callbacks for stuff on the Misc. Settings page **************/
-
-/***********************************************************************//**
-  Called when Rename button pressed
-***************************************************************************/
-static void rename_callback(GtkWidget *w, gpointer data)
-{
-  struct city_dialog *pdialog;
-
-  pdialog = (struct city_dialog *) data;
-
-  pdialog->rename_shell = input_dialog_create(GTK_WINDOW(pdialog->shell),
-                                              /* "shellrenamecity" */
-                                              _("Rename City"),
-                                              _("What should we rename the city to?"),
-                                              city_name_get(pdialog->pcity),
-                                              rename_popup_callback, pdialog);
-}
-
-/***********************************************************************//**
-  Called when user has finished with "Rename City" popup
-***************************************************************************/
-static void rename_popup_callback(gpointer data, gint response,
-                                  const char *input)
-{
-  struct city_dialog *pdialog = data;
-
-  if (pdialog) {
-    if (response == GTK_RESPONSE_OK) {
-      city_rename(pdialog->pcity, input);
-    } /* else CANCEL or DELETE_EVENT */
-
-    pdialog->rename_shell = NULL;
-  }
-}
-
-/***********************************************************************//**
-  Sets which page will be set on reopen of dialog
-***************************************************************************/
-static void misc_whichtab_callback(GtkWidget *w, gpointer data)
-{
-  new_dialog_def_page = GPOINTER_TO_INT(data);
-}
-
-/***********************************************************************//**
-  City options callbacks
-***************************************************************************/
-static void cityopt_callback(GtkWidget *w, gpointer data)
-{
-  struct city_dialog *pdialog = (struct city_dialog *) data;
-
-  if (!can_client_issue_orders()) {
-    return;
-  }
-
-  if (!pdialog->misc.block_signal) {
-    struct city *pcity = pdialog->pcity;
-    bv_city_options new_options;
-
-    fc_assert(CITYO_LAST == 3);
-
-    BV_CLR_ALL(new_options);
-    if (gtk_check_button_get_active(GTK_CHECK_BUTTON(pdialog->misc.disband_on_settler))) {
-      BV_SET(new_options, CITYO_DISBAND);
-    }
-    if (gtk_check_button_get_active(GTK_CHECK_BUTTON(pdialog->misc.new_citizens_radio[1]))) {
-      BV_SET(new_options, CITYO_SCIENCE_SPECIALISTS);
-    }
-    if (gtk_check_button_get_active(GTK_CHECK_BUTTON(pdialog->misc.new_citizens_radio[2]))) {
-      BV_SET(new_options, CITYO_GOLD_SPECIALISTS);
-    }
-
-    dsend_packet_city_options_req(&client.conn, pcity->id, new_options,
-                                  pcity->wlcb);
-  }
-}
-
-/***********************************************************************//**
-  Refresh the city options (auto_[land, air, sea, helicopter] and
-  disband-is-size-1) in the misc page.
-***************************************************************************/
-static void set_cityopt_values(struct city_dialog *pdialog)
-{
-  struct city *pcity = pdialog->pcity;
-
-  pdialog->misc.block_signal = 1;
-
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(pdialog->misc.disband_on_settler),
-                              is_city_option_set(pcity, CITYO_DISBAND));
-
-  if (is_city_option_set(pcity, CITYO_SCIENCE_SPECIALISTS)) {
-    gtk_check_button_set_active(GTK_CHECK_BUTTON
-                                (pdialog->misc.new_citizens_radio[1]), TRUE);
-  } else if (is_city_option_set(pcity, CITYO_GOLD_SPECIALISTS)) {
-    gtk_check_button_set_active(GTK_CHECK_BUTTON
-                                (pdialog->misc.new_citizens_radio[2]), TRUE);
-  } else {
-    gtk_check_button_set_active(GTK_CHECK_BUTTON
-                                (pdialog->misc.new_citizens_radio[0]), TRUE);
-  }
-  pdialog->misc.block_signal = 0;
-}
-
-/******************** Callbacks for: Close, Prev, Next. *******************/
-
-/***********************************************************************//**
-  User has closed city dialog
-***************************************************************************/
-static void close_callback(GtkWidget *w, gpointer data)
-{
-  close_city_dialog((struct city_dialog *) data);
-}
-
-/***********************************************************************//**
-  User has closed city dialog
-***************************************************************************/
-static void city_destroy_callback(GtkWidget *w, gpointer data)
-{
-  struct city_dialog *pdialog;
-  int width, height;
-
-  /* Save size of the city dialog. */
-  gtk_window_get_default_size(GTK_WINDOW(w), &width, &height);
-
-  pdialog = (struct city_dialog *) data;
-  gtk_widget_set_visible(pdialog->shell, FALSE);
-
-  if (game.info.citizen_nationality) {
-    citizens_dialog_close(pdialog->pcity);
-  }
-  close_happiness_dialog(pdialog->pcity);
-  close_cma_dialog(pdialog->pcity);
-
-  /* Save size of the city dialog. */
-  GUI_GTK_OPTION(citydlg_xsize)
-    = CLIP(GUI_GTK5_CITYDLG_MIN_XSIZE,
-           width,
-           GUI_GTK5_CITYDLG_MAX_XSIZE);
-  GUI_GTK_OPTION(citydlg_ysize)
-    = CLIP(GUI_GTK5_CITYDLG_MIN_YSIZE,
-           height,
-           GUI_GTK5_CITYDLG_MAX_YSIZE);
-
-  last_page
-    = gtk_notebook_get_current_page(GTK_NOTEBOOK(pdialog->notebook));
-
-  close_citydlg_unit_popover(pdialog);
-  dialog_list_remove(dialog_list, pdialog);
-
-  unit_node_vector_free(&pdialog->overview.supported_units);
-  unit_node_vector_free(&pdialog->overview.present_units);
-
-  if (pdialog->sell_shell) {
-    gtk_window_destroy(GTK_WINDOW(pdialog->sell_shell));
-  }
-  if (pdialog->rename_shell) {
-    gtk_window_destroy(GTK_WINDOW(pdialog->rename_shell));
-  }
-
-  cairo_surface_destroy(pdialog->map_canvas_store_unscaled);
-  cairo_surface_destroy(pdialog->citizen_surface);
-
-  free(pdialog);
-
-  /* Need to do this every time a new dialog is closed. */
-  city_dialog_update_prev_next();
-}
-
-/***********************************************************************//**
-  Close city dialog
-***************************************************************************/
-static void close_city_dialog(struct city_dialog *pdialog)
-{
-  gtk_window_destroy(GTK_WINDOW(pdialog->shell));
-}
-
-/***********************************************************************//**
-  Callback for the prev/next buttons. Switches to the previous/next
-  city.
-***************************************************************************/
-static void switch_city_callback(GtkWidget *w, gpointer data)
-{
-  struct city_dialog *pdialog = (struct city_dialog *) data;
-  int i, j, dir, size;
-  struct city *new_pcity = NULL;
-
-  if (client_is_global_observer()) {
-    return;
-  }
-
-  size = city_list_size(client.conn.playing->cities);
-
-  fc_assert_ret(city_dialogs_have_been_initialised);
-  fc_assert_ret(size >= 1);
-  fc_assert_ret(city_owner(pdialog->pcity) == client.conn.playing);
-
-  if (size == 1) {
-    return;
-  }
-
-  /* dir = 1 will advance to the city, dir = -1 will get previous */
-  if (w == GTK_WIDGET(pdialog->next_command)) {
-    dir = 1;
-  } else if (w == GTK_WIDGET(pdialog->prev_command)) {
-    dir = -1;
-  } else {
-    /* Always fails. */
-    fc_assert_ret(w == GTK_WIDGET(pdialog->next_command)
-                  || w == GTK_WIDGET(pdialog->prev_command));
-    dir = 1;
-  }
-
-  for (i = 0; i < size; i++) {
-    if (pdialog->pcity == city_list_get(client.conn.playing->cities, i)) {
-      break;
-    }
-  }
-
-  fc_assert_ret(i < size);
-
-  for (j = 1; j < size; j++) {
-    struct city *other_pcity = city_list_get(client.conn.playing->cities,
-                                             (i + dir * j + size) % size);
-    struct city_dialog *other_pdialog = get_city_dialog(other_pcity);
-
-    fc_assert_ret(other_pdialog != pdialog);
-    if (!other_pdialog) {
-      new_pcity = other_pcity;
-      break;
-    }
-  }
-
-  if (!new_pcity) {
-    /* Every other city has an open city dialog. */
-    return;
-  }
-
-  /* cleanup happiness dialog */
-  if (game.info.citizen_nationality) {
-    citizens_dialog_close(pdialog->pcity);
-  }
-  close_happiness_dialog(pdialog->pcity);
-
-  pdialog->pcity = new_pcity;
-
-  /* reinitialize happiness, and cma dialogs */
-  if (game.info.citizen_nationality) {
-    gtk_box_append(GTK_BOX(pdialog->happiness.citizens),
-                   citizens_dialog_display(pdialog->pcity));
-  }
-  gtk_box_append(GTK_BOX(pdialog->happiness.widget),
-                 get_top_happiness_display(pdialog->pcity, low_citydlg, pdialog->shell));
-  if (!client_is_observer()) {
-    fc_assert(pdialog->cma_editor != NULL);
-    pdialog->cma_editor->pcity = new_pcity;
-  }
-
-  reset_city_worklist(pdialog->production.worklist, pdialog->pcity);
-
-  can_slide = FALSE;
-  center_tile_mapcanvas(pdialog->pcity->tile);
-  can_slide = TRUE;
-  if (!client_is_observer()) {
-    set_cityopt_values(pdialog);  /* Need not be in real_city_dialog_refresh */
-  }
-
-  real_city_dialog_refresh(pdialog->pcity);
-
-  /* Recenter the city map(s) */
-  city_dialog_map_recenter(pdialog->overview.map_canvas.sw);
-  if (pdialog->happiness.map_canvas.sw) {
-    city_dialog_map_recenter(pdialog->happiness.map_canvas.sw);
-  }
-}
-
-/***********************************************************************//**
-  Refresh worklist editor for all city dialogs.
-***************************************************************************/
-void refresh_all_city_worklists(void)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    refresh_worklist(pdialog->production.worklist);
-  } dialog_list_iterate_end;
-}
diff --git a/client/gui-gtk-5.0/citydlg.h b/client/gui-gtk-5.0/citydlg.h
deleted file mode 100644
index 45892306cd..0000000000
--- a/client/gui-gtk-5.0/citydlg.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CITYDLG_H
-#define FC__CITYDLG_H
-
-/* client */
-#include "citydlg_g.h"
-
-void reset_city_dialogs(void);
-void refresh_all_city_worklists(void);
-
-#endif /* FC__CITYDLG_H */
diff --git a/client/gui-gtk-5.0/cityrep.c b/client/gui-gtk-5.0/cityrep.c
deleted file mode 100644
index d27ab820e1..0000000000
--- a/client/gui-gtk-5.0/cityrep.c
+++ /dev/null
@@ -1,2244 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "city.h"
-#include "game.h"
-#include "packets.h"
-#include "unit.h"
-
-/* client/agents */
-#include "cma_fec.h"
-
-/* client */
-#include "citydlg_common.h"
-#include "cityrepdata.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "global_worklist.h"
-#include "mapctrl_common.h"    /* is_city_hilited() */
-#include "mapview_common.h"
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "citydlg.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-#include "optiondlg.h"
-#include "repodlgs.h"
-
-#include "cityrep.h"
-
-#define NEG_VAL(x)  ((x)<0 ? (x) : (-x))
-
-/* Some versions of gcc have problems with negative values here (PR#39722). */
-#define CMA_NONE        (10000)
-#define CMA_CUSTOM      (10001)
-
-struct sell_data {
-  int count;                    /* Number of cities. */
-  int gold;                     /* Amount of gold. */
-  const struct impr_type *target;     /* The target for selling. */
-};
-
-enum city_operation_type {
-  CO_CHANGE, CO_LAST, CO_NEXT, CO_FIRST, CO_NEXT_TO_LAST, CO_SELL, CO_NONE
-};
-
-/******************************************************************/
-static void create_city_report_dialog(bool make_modal);
-
-static void city_activated_callback(GtkTreeView *view, GtkTreePath *path,
-                                    GtkTreeViewColumn *col, gpointer data);
-
-static void city_command_callback(struct gui_dialog *dlg, int response,
-                                  gpointer data);
-
-static void city_selection_changed_callback(GtkTreeSelection *selection);
-static void city_clear_worklist_callback(GSimpleAction *action, GVariant *parameter,
-                                         gpointer data);
-static void update_total_buy_cost(void);
-
-static GMenu *create_production_menu(GActionGroup *group);
-static GMenu *create_select_menu(GActionGroup *group);
-
-static GMenu *create_change_menu(GActionGroup *group, const char *mname,
-                                 const char *human_mname,
-                                 enum city_operation_type oper);
-
-static struct gui_dialog *city_dialog_shell = NULL;
-
-enum {
-  CITY_CENTER = 1, CITY_POPUP, CITY_BUY
-};
-
-static GtkWidget *city_view_depr;
-static GtkTreeSelection *city_selection_depr;
-static GtkListStore *city_model_depr;
-static GtkWidget *city_view;
-static GtkMultiSelection *city_selection;
-static GListStore *city_store;
-#define CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS)
-
-#ifdef MENUS_GTK3
-static void popup_select_menu(GtkMenuShell *menu, gpointer data);
-#endif /* MENUS_GTK3 */
-
-static void recreate_production_menu(GActionGroup *group);
-static void recreate_select_menu(GActionGroup *group);
-static void recreate_sell_menu(GActionGroup *group);
-
-static GtkWidget *city_center_command;
-static GtkWidget *city_popup_command;
-static GtkWidget *city_buy_command;
-#ifdef MENUS_GTK3
-static GtkWidget *city_sell_command;
-#endif /* MENUS_GTK3 */
-static GtkWidget *city_total_buy_cost_label;
-
-static GMenu *prod_menu = NULL;
-static GMenu *change_menu;
-static GMenu *add_first_menu;
-static GMenu *add_last_menu;
-static GMenu *add_next_menu;
-static GMenu *add_2ndlast_menu;
-static GMenu *wl_set_menu;
-static GMenu *wl_append_menu;
-
-static GMenu *select_menu;
-static GMenu *unit_b_select_menu = NULL;
-static GMenu *impr_b_select_menu;
-static GMenu *wndr_b_select_menu;
-static GMenu *unit_s_select_menu;
-static GMenu *unit_p_select_menu;
-static GMenu *impr_p_select_menu;
-static GMenu *wndr_p_select_menu;
-static GMenu *unit_a_select_menu;
-static GMenu *impr_a_select_menu;
-static GMenu *wndr_a_select_menu;
-static GMenu *governor_select_menu;
-
-static int city_dialog_shell_is_modal;
-
-static GMenu *cityrep_menu;
-static GActionGroup *cityrep_group;
-static GMenu *display_menu;
-
-#define FC_TYPE_CITY_ROW (fc_city_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcCityRow, fc_city_row, FC, CITY_ROW, GObject)
-
-struct _FcCityRow
-{
-  GObject parent_instance;
-
-  char **columns;
-  int city_id;
-};
-
-struct _FcCityClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcCityRow, fc_city_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Finalizing method for FcCityRow class
-**************************************************************************/
-static void fc_city_row_finalize(GObject *gobject)
-{
-  FcCityRow *row = FC_CITY_ROW(gobject);
-
-  free(row->columns);
-  row->columns = nullptr;
-
-  G_OBJECT_CLASS(fc_city_row_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcCityRow class
-**************************************************************************/
-static void
-fc_city_row_class_init(FcCityRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_city_row_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcCityRow
-**************************************************************************/
-static void
-fc_city_row_init(FcCityRow *self)
-{
-  self->columns = fc_malloc(sizeof(char *) * NUM_CREPORT_COLS);
-}
-
-/**********************************************************************//**
-  FcCityRow creation method
-**************************************************************************/
-static FcCityRow *fc_city_row_new(void)
-{
-  FcCityRow *result;
-
-  result = g_object_new(FC_TYPE_CITY_ROW, nullptr);
-
-  return result;
-}
-
-/************************************************************************//**
-  Return text line for the column headers for the city report
-****************************************************************************/
-static void get_city_table_header(char **text, int n)
-{
-  struct city_report_spec *spec;
-  int i;
-
-  for (i = 0, spec = city_report_specs; i < NUM_CREPORT_COLS; i++, spec++) {
-    fc_snprintf(text[i], n, "%*s\n%*s",
-                NEG_VAL(spec->width), spec->title1 ? spec->title1 : "",
-                NEG_VAL(spec->width), spec->title2 ? spec->title2 : "");
-  }
-}
-
-/****************************************************************************
-                        CITY REPORT DIALOG
-****************************************************************************/
-
-/**********************************************************************//**
-  City table cell bind function
-**************************************************************************/
-static void city_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcCityRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(child), row->columns[GPOINTER_TO_INT(user_data)]);
-}
-
-/**********************************************************************//**
-  City table cell setup function
-**************************************************************************/
-static void city_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/************************************************************************//**
-  Returns a new tree model for the city report.
-****************************************************************************/
-static GtkListStore *city_report_dialog_store_new_depr(void)
-{
-  GType model_types[NUM_CREPORT_COLS + 1];
-  gint i;
-
-  /* City report data. */
-  for (i = 0; i < NUM_CREPORT_COLS; i++) {
-    model_types[i] = G_TYPE_STRING;
-  }
-
-  /* Specific gtk client data. */
-  model_types[i++] = G_TYPE_INT;        /* CRD_COL_CITY_ID */
-
-  return gtk_list_store_newv(i, model_types);
-}
-
-/************************************************************************//**
-  Set the values of the iterator.
-****************************************************************************/
-static void city_model_set_depr(GtkListStore *store, GtkTreeIter *iter,
-                                struct city *pcity)
-{
-  struct city_report_spec *spec;
-  char buf[64];
-  gint i;
-
-  for (i = 0; i < NUM_CREPORT_COLS; i++) {
-    spec = city_report_specs + i;
-    fc_snprintf(buf, sizeof(buf), "%*s", NEG_VAL(spec->width),
-                spec->func(pcity, spec->data));
-    gtk_list_store_set(store, iter, i, buf, -1);
-  }
-  gtk_list_store_set(store, iter, CRD_COL_CITY_ID, pcity->id, -1);
-}
-
-/************************************************************************//**
-  Set the values of the city.
-****************************************************************************/
-static void city_store_set(FcCityRow *row, struct city *pcity)
-{
-  struct city_report_spec *spec;
-  char buf[64];
-  gint i;
-
-  row->city_id = pcity->id;
-
-  for (i = 0; i < NUM_CREPORT_COLS; i++) {
-    spec = city_report_specs + i;
-    fc_snprintf(buf, sizeof(buf), "%*s", NEG_VAL(spec->width),
-                spec->func(pcity, spec->data));
-    row->columns[i] = fc_strdup(buf);
-  }
-}
-
-/************************************************************************//**
-  Set the values of the iterator.
-****************************************************************************/
-static struct city *city_model_get(GtkTreeModel *model, GtkTreeIter *iter)
-{
-  struct city *pcity;
-  int id;
-
-  gtk_tree_model_get(model, iter, CRD_COL_CITY_ID, &id, -1);
-  pcity = game_city_by_number(id);
-  return ((NULL != pcity
-           && client_has_player()
-           && city_owner(pcity) != client_player())
-          ? NULL : pcity);
-}
-
-/************************************************************************//**
-  Return TRUE if 'iter' has been set to the city row.
-****************************************************************************/
-static gboolean city_model_find(GtkTreeModel *model, GtkTreeIter *iter,
-                                const struct city *pcity)
-{
-  const int searched = pcity->id;
-  int id;
-
-  if (gtk_tree_model_get_iter_first(model, iter)) {
-    do {
-      gtk_tree_model_get(model, iter, CRD_COL_CITY_ID, &id, -1);
-      if (searched == id) {
-        return TRUE;
-      }
-    } while (gtk_tree_model_iter_next(model, iter));
-  }
-  return FALSE;
-}
-
-/************************************************************************//**
-  Fill the model with the current configuration.
-****************************************************************************/
-static void city_model_fill_depr(GtkListStore *store,
-                                 GtkTreeSelection *selection, GHashTable *select)
-{
-  GtkTreeIter iter;
-
-  if (client_has_player()) {
-    city_list_iterate(client_player()->cities, pcity) {
-      gtk_list_store_append(store, &iter);
-      city_model_set_depr(store, &iter, pcity);
-      if (NULL != select
-          && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
-        gtk_tree_selection_select_iter(selection, &iter);
-      }
-    } city_list_iterate_end;
-  } else {
-    /* Global observer case. */
-    cities_iterate(pcity) {
-      gtk_list_store_append(store, &iter);
-      city_model_set_depr(store, &iter, pcity);
-      if (NULL != select
-          && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
-        gtk_tree_selection_select_iter(selection, &iter);
-      }
-    } cities_iterate_end;
-  }
-}
-
-/************************************************************************//**
-  Fill the model with the current configuration.
-****************************************************************************/
-static void city_store_fill(GListStore *store,
-                            GtkMultiSelection *selection, GHashTable *select)
-{
-  if (client_has_player()) {
-    city_list_iterate(client_player()->cities, pcity) {
-      FcCityRow *row = fc_city_row_new();
-
-      city_store_set(row, pcity);
-      g_list_store_append(G_LIST_STORE(store), row);
-      g_object_unref(row);
-      if (NULL != select
-          && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
-        gtk_selection_model_select_item(GTK_SELECTION_MODEL(selection),
-                                        g_list_model_get_n_items(G_LIST_MODEL(store)) - 1,
-                                        FALSE);
-      }
-    } city_list_iterate_end;
-  } else {
-    /* Global observer case. */
-    cities_iterate(pcity) {
-      FcCityRow *row = fc_city_row_new();
-
-      city_store_set(row, pcity);
-      g_list_store_append(G_LIST_STORE(store), row);
-      g_object_unref(row);
-      if (NULL != select
-          && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
-        gtk_selection_model_select_item(GTK_SELECTION_MODEL(selection),
-                                        g_list_model_get_n_items(G_LIST_MODEL(store)) - 1,
-                                        FALSE);
-      }
-    } cities_iterate_end;
-  }
-}
-
-/************************************************************************//**
-  Popup the city report dialog, and optionally raise it.
-****************************************************************************/
-void city_report_dialog_popup(bool raise)
-{
-  if (!city_dialog_shell) {
-    city_dialog_shell_is_modal = FALSE;
-
-    create_city_report_dialog(FALSE);
-  }
-
-  gui_dialog_present(city_dialog_shell);
-  hilite_cities_from_canvas();
-  if (raise) {
-    gui_dialog_raise(city_dialog_shell);
-  }
-}
-
-/************************************************************************//**
-  Closes the city report dialog.
-****************************************************************************/
-void city_report_dialog_popdown(void)
-{
-  if (city_dialog_shell) {
-    gui_dialog_destroy(city_dialog_shell);
-  }
-}
-
-/************************************************************************//**
-  Make submenu listing possible build targets
-****************************************************************************/
-static void append_impr_or_unit_to_menu(GMenu *menu,
-                                        GActionGroup *act_group,
-                                        const char *act_pfx,
-                                        const char *act_pfx2,
-                                        bool append_units,
-                                        bool append_wonders,
-                                        enum city_operation_type
-                                        city_operation,
-                                        TestCityFunc test_func,
-                                        GCallback callback,
-                                        int size)
-{
-  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
-  struct item items[MAX_NUM_PRODUCTION_TARGETS];
-  int i, item, targets_used;
-  char *row[4];
-  char buf[4][64];
-
-  GtkSizeGroup *size_group[3];
-
-#ifdef MENUS_GTK3
-  const char *markup[3] = {
-    "weight=\"bold\"",
-    "",
-    ""
-  };
-#endif
-
-  if (city_operation != CO_NONE) {
-    GPtrArray *selected;
-    ITree it;
-    int num_selected = 0;
-    GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-    struct city **data;
-
-    selected = g_ptr_array_sized_new(size);
-
-    for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-      struct city *pcity;
-
-      if (!itree_is_selected(city_selection_depr, &it)
-          || !(pcity = city_model_get(model, TREE_ITER_PTR(it)))) {
-        continue;
-      }
-
-      g_ptr_array_add(selected, pcity);
-      num_selected++;
-    }
-
-    data = (struct city **)g_ptr_array_free(selected, FALSE);
-    targets_used
-      = collect_production_targets(targets, data, num_selected, append_units,
-                                   append_wonders, TRUE, test_func);
-    g_free(data);
-  } else {
-    targets_used = collect_production_targets(targets, NULL, 0, append_units,
-                                              append_wonders, FALSE,
-                                              test_func);
-  }
-
-  name_and_sort_items(targets, targets_used, items,
-                      city_operation != CO_NONE, NULL);
-
-  for (i = 0; i < 4; i++) {
-    row[i] = buf[i];
-  }
-
-
-  for (i = 0; i < 3; i++) {
-    size_group[i] = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-  }
-
-  for (item = 0; item < targets_used; item++) {
-    struct universal target = items[item].item;
-    GMenuItem *menu_item;
-    char actbuf[256];
-    GSimpleAction *act;
-#ifdef MENUS_GTK3
-    char txt[256];
-    GtkWidget *hgrid, *label;
-    int grid_col = 0;
-#endif /* MENUS_GTK3 */
-
-    get_city_dialog_production_row(row, sizeof(buf[0]), &target, NULL);
-
-    fc_snprintf(actbuf, sizeof(actbuf), "win.%s%s%d", act_pfx, act_pfx2, item);
-
-    menu_item = g_menu_item_new(buf[0], actbuf);
-
-    fc_snprintf(actbuf, sizeof(actbuf), "%s%s%d", act_pfx, act_pfx2, item);
-    act = g_simple_action_new(actbuf, NULL);
-    g_object_set_data(G_OBJECT(act), "freeciv_test_func", test_func);
-    g_object_set_data(G_OBJECT(act), "freeciv_city_operation",
-                      GINT_TO_POINTER(city_operation));
-    g_action_map_add_action(G_ACTION_MAP(act_group), G_ACTION(act));
-    g_signal_connect(act, "activate", callback,
-                     GINT_TO_POINTER(cid_encode(target)));
-    menu_item_append_unref(menu, menu_item);
-
-#ifdef MENUS_GTK3
-    hgrid = gtk_grid_new();
-    gtk_grid_set_column_spacing(GTK_GRID(hgrid), 18);
-    gtk_container_add(GTK_CONTAINER(menu_item), hgrid);
-
-    for (i = 0; i < 3; i++) {
-      if (row[i][0] == '\0') {
-        continue;
-      }
-
-      if (city_operation == CO_SELL && i != 0) {
-        continue;
-      }
-
-      fc_snprintf(txt, ARRAY_SIZE(txt), "<span %s>%s</span>",
-                  markup[i], row[i]);
-
-      label = gtk_label_new(NULL);
-      gtk_label_set_markup(GTK_LABEL(label), txt);
-
-      switch (i) {
-        case 0:
-          gtk_widget_set_halign(label, GTK_ALIGN_START);
-          gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-        break;
-        case 2:
-          gtk_widget_set_halign(label, GTK_ALIGN_END);
-          gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-          break;
-        default:
-          break;
-      }
-
-      gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-      gtk_size_group_add_widget(size_group[i], label);
-    }
-
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
-    g_signal_connect(menu_item, "activate", callback,
-                     GINT_TO_POINTER(cid_encode(target)));
-#endif /* MENUS_GTK3 */
-  }
-
-  for (i = 0; i < 3; i++) {
-    g_object_unref(size_group[i]);
-  }
-
-#ifdef MENUS_GTK3
-  gtk_widget_set_sensitive(GTK_WIDGET(parent_item), (targets_used > 0));
-#endif
-}
-
-/************************************************************************//**
-  Change the production of one single selected city.
-****************************************************************************/
-static void impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path,
-                                 GtkTreeIter *iter, gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    city_change_production(pcity, &target);
-  }
-}
-
-/************************************************************************//**
-  Called by select_impr_or_unit_callback() for each city that is selected in
-  the city list dialog to have a object appended to the worklist. Sends a
-  packet adding the item to the end of the worklist.
-****************************************************************************/
-static void worklist_last_impr_or_unit_iterate(GtkTreeModel *model,
-                                               GtkTreePath *path,
-                                               GtkTreeIter *iter,
-                                               gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    (void) city_queue_insert(pcity, -1, &target);
-  }
-  /* Perhaps should warn the user if not successful? */
-}
-
-/************************************************************************//**
-  Called by select_impr_or_unit_callback() for each city that is selected in
-  the city list dialog to have a object inserted first to the worklist.
-  Sends a packet adding the current production to the first place after the
-  current production of the worklist. Then changes the production to the
-  requested item.
-****************************************************************************/
-static void worklist_first_impr_or_unit_iterate(GtkTreeModel *model,
-                                                GtkTreePath *path,
-                                                GtkTreeIter *iter,
-                                                gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    (void) city_queue_insert(pcity, 0, &target);
-  }
-  /* Perhaps should warn the user if not successful? */
-}
-
-/************************************************************************//**
-  Called by select_impr_or_unit_callback() for each city that is selected in
-  the city list dialog to have a object added next to the worklist. Sends a
-  packet adding the item to the first place after the current production of
-  the worklist.
-****************************************************************************/
-static void worklist_next_impr_or_unit_iterate(GtkTreeModel *model,
-                                               GtkTreePath *path,
-                                               GtkTreeIter *iter,
-                                               gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    (void) city_queue_insert(pcity, 1, &target);
-  }
-  /* Perhaps should warn the user if not successful? */
-}
-
-/************************************************************************//**
-  Called by select_impr_or_unit_callback() for each city that is selected in
-  the city list dialog to have an object added before the last position in
-  the worklist.
-****************************************************************************/
-static void worklist_next_to_last_impr_or_unit_iterate(GtkTreeModel *model,
-                                                       GtkTreePath *path,
-                                                       GtkTreeIter *iter,
-                                                       gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    city_queue_insert(pcity, worklist_length(&pcity->worklist), &target);
-  }
-}
-
-/************************************************************************//**
-  Iterate the cities going to sell.
-****************************************************************************/
-static void sell_impr_iterate(GtkTreeModel *model, GtkTreePath *path,
-                              GtkTreeIter *iter, gpointer data)
-{
-  struct sell_data *sd = (struct sell_data *) data;
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity
-      && !pcity->did_sell
-      && city_has_building(pcity, sd->target)) {
-    sd->count++;
-    sd->gold += impr_sell_gold(sd->target);
-    city_sell_improvement(pcity, improvement_number(sd->target));
-  }
-}
-
-struct scbs_data {
-  const struct impr_type *building;
-  const char *imprname;
-};
-
-/************************************************************************//**
-  Callback for sell dialog response.
-****************************************************************************/
-static void sell_callback_response(GObject *dialog, GAsyncResult *result,
-                                   gpointer data)
-{
-  int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
-                                              result, NULL);
-
-  if (button == 0) {
-    struct scbs_data *scbs = (struct scbs_data *)data;
-    struct sell_data sd = { 0, 0, scbs->building };
-    GtkWidget *w;
-
-    gtk_tree_selection_selected_foreach(city_selection_depr,
-                                        sell_impr_iterate, &sd);
-    if (sd.count > 0) {
-      /* FIXME: plurality of sd.count is ignored! */
-      /* TRANS: "Sold 3 Harbor for 90 gold." (Pluralisation is in gold --
-       * second %d -- not in buildings.) */
-      w = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
-                                 GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-                                 PL_("Sold %d %s for %d gold.",
-                                     "Sold %d %s for %d gold.",
-                                     sd.gold),
-                                 sd.count, scbs->imprname, sd.gold);
-    } else {
-      w = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
-                                 GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-                                 _("No %s could be sold."),
-                                 scbs->imprname);
-    }
-
-    g_signal_connect(w, "response",
-                     G_CALLBACK(gtk_window_destroy), NULL);
-    gtk_window_present(GTK_WINDOW(w));      /* Asynchron. */
-  }
-
-  free(data);
-}
-
-/************************************************************************//**
-  Some build target, either improvement or unit, has been selected from
-  some menu.
-****************************************************************************/
-static void select_impr_or_unit_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data)
-{
-  struct universal target = cid_decode(GPOINTER_TO_INT(data));
-  TestCityFunc test_func = g_object_get_data(G_OBJECT(action), "freeciv_test_func");
-  enum city_operation_type city_operation =
-    GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "freeciv_city_operation"));
-
-  /* If this is not a city operation: */
-  if (city_operation == CO_NONE) {
-    GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-    ITree it;
-
-    gtk_tree_selection_unselect_all(city_selection_depr);
-    for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-      struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-
-      if (NULL != pcity && test_func(pcity, &target)) {
-        itree_select(city_selection_depr, &it);
-      }
-    }
-  } else {
-    GtkTreeSelectionForeachFunc foreach_func;
-
-    connection_do_buffer(&client.conn);
-    switch (city_operation) {
-    case CO_LAST:
-      gtk_tree_selection_selected_foreach(city_selection_depr,
-                                          worklist_last_impr_or_unit_iterate,
-                                          GINT_TO_POINTER(cid_encode(target)));
-      break;
-    case CO_CHANGE:
-      gtk_tree_selection_selected_foreach(city_selection_depr,
-                                          impr_or_unit_iterate,
-                                          GINT_TO_POINTER(cid_encode(target)));
-      break;
-    case CO_FIRST:
-      gtk_tree_selection_selected_foreach(city_selection_depr,
-                                          worklist_first_impr_or_unit_iterate,
-                                          GINT_TO_POINTER(cid_encode(target)));
-      break;
-    case CO_NEXT:
-      gtk_tree_selection_selected_foreach(city_selection_depr,
-                                          worklist_next_impr_or_unit_iterate,
-                                          GINT_TO_POINTER(cid_encode(target)));
-      break;
-    case CO_NEXT_TO_LAST:
-      foreach_func = worklist_next_to_last_impr_or_unit_iterate;
-      gtk_tree_selection_selected_foreach(city_selection_depr, foreach_func,
-                                          GINT_TO_POINTER(cid_encode(target)));
-      break;
-    case CO_SELL:
-      fc_assert_action(target.kind == VUT_IMPROVEMENT, break);
-      {
-        struct scbs_data *scbs = fc_malloc(sizeof(struct scbs_data));
-        GtkAlertDialog *w;
-        gchar *buf;
-        const char *buttons[] = { _("Yes"), _("No"), NULL };
-
-        scbs->building = target.value.building;
-        scbs->imprname = improvement_name_translation(scbs->building);
-
-        /* Ask confirmation */
-        buf = g_strdup_printf(_("Are you sure you want to sell those %s?"), scbs->imprname);
-        w = gtk_alert_dialog_new("%s", buf);
-        g_free(buf);
-        gtk_alert_dialog_set_buttons(w, buttons);
-        gtk_alert_dialog_set_modal(w, TRUE);
-        gtk_alert_dialog_choose(w, GTK_WINDOW(toplevel), NULL,
-                                sell_callback_response, scbs);
-      }
-      break;
-    case CO_NONE:
-      break;
-    }
-    connection_do_unbuffer(&client.conn);
-  }
-}
-
-/************************************************************************//**
-  Governors iterating callback.
-****************************************************************************/
-static void governors_iterate(GtkTreeModel *model, GtkTreePath *path,
-                              GtkTreeIter *iter, gpointer data)
-{
-  struct city *pcity = city_model_get(model, iter);
-  int idx = GPOINTER_TO_INT(data);
-
-  if (NULL != pcity) {
-    if (CMA_NONE == idx) {
-      cma_release_city(pcity);
-    } else {
-      cma_put_city_under_agent(pcity, cmafec_preset_get_parameter(idx));
-    }
-    refresh_city_dialog(pcity);
-  }
-}
-
-/************************************************************************//**
-  Called when one clicks on an governor item to make a selection or to
-  change a selection's preset.
-****************************************************************************/
-static void select_governor_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  int idx = GPOINTER_TO_INT(data);
-  bool change_governor =
-    GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "governor"));
-  struct cm_parameter cm;
-
-  /* If this is not the change button but the select cities button. */
-  if (!change_governor) {
-    ITree it;
-    GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-
-    gtk_tree_selection_unselect_all(city_selection_depr);
-    for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-      struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-      int controlled;
-      bool select;
-
-      if (NULL == pcity) {
-        continue;
-      }
-      controlled = cma_is_city_under_agent(pcity, &cm);
-      select = FALSE;
-
-      if (idx == CMA_NONE) {
-        /* CMA_NONE selects not-controlled, all others require controlled */
-        if (!controlled) {
-          select = TRUE;
-        }
-      } else if (controlled) {
-        if (idx == CMA_CUSTOM) {
-          if (cmafec_preset_get_index_of_parameter(&cm) == -1) {
-            select = TRUE;
-          }
-        } else if (cm_are_parameter_equal(&cm,
-                                          cmafec_preset_get_parameter(idx))) {
-          select = TRUE;
-        }
-      }
-
-      if (select) {
-        itree_select(city_selection_depr, &it);
-      }
-    }
-  } else {
-    gtk_tree_selection_selected_foreach(city_selection_depr,
-                                        governors_iterate,
-                                        GINT_TO_POINTER(idx));
-  }
-}
-
-/************************************************************************//**
-  Create the governor entries in the change menu and the select menu.
-  The indices CMA_NONE and CMA_CUSTOM are special.
-  CMA_NONE signifies a preset of "none" and CMA_CUSTOM a
-  "custom" preset.
-****************************************************************************/
-static GMenu *create_governor_menu(GActionGroup *group,
-                                   bool change_governor)
-{
-  GMenu *menu;
-  int i;
-  struct cm_parameter cm;
-
-  menu = g_menu_new();
-
-  if (!can_client_issue_orders()) {
-    return menu;
-  }
-
-  if (change_governor) {
-    GSimpleAction *act;
-
-    act = g_simple_action_new("chg_governor_none", NULL);
-    g_object_set_data(G_OBJECT(act), "governor",
-                      GINT_TO_POINTER(change_governor));
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(select_governor_callback),
-                     GINT_TO_POINTER(CMA_NONE));
-    menu_item_append_unref(menu,
-                           g_menu_item_new(Q_("?cma:none"),
-                                           "win.chg_governor_none"));
-
-    for (i = 0; i < cmafec_preset_num(); i++) {
-      char buf[128];
-
-      fc_snprintf(buf, sizeof(buf), "chg_governor_%d", i);
-      act = g_simple_action_new(buf, NULL);
-      g_object_set_data(G_OBJECT(act), "governor",
-                        GINT_TO_POINTER(change_governor));
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(select_governor_callback),
-                       GINT_TO_POINTER(i));
-      fc_snprintf(buf, sizeof(buf), "win.chg_governor_%d", i);
-      menu_item_append_unref(menu,
-                             g_menu_item_new(cmafec_preset_get_descr(i), buf));
-    }
-  } else {
-    /* Search for a "none" */
-    bool found;
-
-    found = FALSE;
-    city_list_iterate(client.conn.playing->cities, pcity) {
-      if (!cma_is_city_under_agent(pcity, NULL)) {
-        found = TRUE;
-        break;
-      }
-    } city_list_iterate_end;
-
-    if (found) {
-      GSimpleAction *act;
-
-      act = g_simple_action_new("sel_governor_none", NULL);
-      g_object_set_data(G_OBJECT(act), "governor",
-                        GINT_TO_POINTER(change_governor));
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(select_governor_callback),
-                       GINT_TO_POINTER(CMA_NONE));
-      menu_item_append_unref(menu,
-                             g_menu_item_new(Q_("?cma:none"),
-                                             "win.sel_governor_none"));
-    }
-
-    /*
-     * Search for a city that's under custom (not preset) agent. Might
-     * take a lonnggg time.
-     */
-    found = FALSE;
-    city_list_iterate(client.conn.playing->cities, pcity) {
-      if (cma_is_city_under_agent(pcity, &cm)
-          && cmafec_preset_get_index_of_parameter(&cm) == -1) {
-        found = TRUE;
-        break;
-      }
-    } city_list_iterate_end;
-
-    if (found) {
-      /* We found city that's under agent but not a preset */
-      GSimpleAction *act;
-
-      act = g_simple_action_new("sel_governor_custom", NULL);
-      g_object_set_data(G_OBJECT(act), "governor",
-                        GINT_TO_POINTER(change_governor));
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(select_governor_callback),
-                       GINT_TO_POINTER(CMA_CUSTOM));
-      menu_item_append_unref(menu,
-                             g_menu_item_new(Q_("?cma:custom"),
-                                             "win.sel_governor_custom"));
-    }
-
-    /* Only fill in presets that are being used. */
-    for (i = 0; i < cmafec_preset_num(); i++) {
-      found = FALSE;
-      city_list_iterate(client.conn.playing->cities, pcity) {
-        if (cma_is_city_under_agent(pcity, &cm)
-            && cm_are_parameter_equal(&cm,
-                                      cmafec_preset_get_parameter(i))) {
-          found = TRUE;
-          break;
-        }
-      } city_list_iterate_end;
-
-      if (found) {
-        GSimpleAction *act;
-        char buf[128];
-
-        fc_snprintf(buf, sizeof(buf), "sel_governor_%d", i);
-
-        act = g_simple_action_new(buf, NULL);
-        g_object_set_data(G_OBJECT(act), "governor",
-                          GINT_TO_POINTER(change_governor));
-        g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-        g_signal_connect(act, "activate", G_CALLBACK(select_governor_callback),
-                         GINT_TO_POINTER(i));
-        fc_snprintf(buf, sizeof(buf), "win.sel_governor_%d", i);
-        menu_item_append_unref(menu,
-                               g_menu_item_new(cmafec_preset_get_descr(i),
-                                               buf));
-      }
-    }
-  }
-
-  return menu;
-}
-
-/************************************************************************//**
-  Recreate governor menu
-****************************************************************************/
-static void update_governor_menu(void)
-{
-  g_menu_remove(cityrep_menu, 1);
-  submenu_insert_unref(cityrep_menu, 1, _("Gover_nor"),
-                       G_MENU_MODEL(create_governor_menu(cityrep_group, TRUE)));
-}
-
-/************************************************************************//**
-  Helper function to append a worklist to the current work list of one city
-  in the city report. This function is called over all selected rows in the
-  list view.
-****************************************************************************/
-static void append_worklist_foreach(GtkTreeModel *model, GtkTreePath *path,
-                                    GtkTreeIter *iter, gpointer data)
-{
-  const struct worklist *pwl = data;
-  struct city *pcity = city_model_get(model, iter);
-
-  fc_assert_ret(pwl != NULL);
-
-  if (NULL != pcity) {
-    city_queue_insert_worklist(pcity, -1, pwl);
-  }
-}
-
-/************************************************************************//**
-  Menu item callback to append the global worklist associated with this
-  item to the worklists of all selected cities. The worklist pointer is
-  passed in 'data'.
-****************************************************************************/
-static void append_worklist_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  struct global_worklist *pgwl =
-    global_worklist_by_id(GPOINTER_TO_INT(data));
-
-  fc_assert_ret(city_selection_depr != NULL);
-
-  if (!pgwl) {
-    /* Maybe removed by an other way, not an error. */
-    return;
-  }
-
-  gtk_tree_selection_selected_foreach(city_selection_depr,
-                                      append_worklist_foreach,
-                                      (gpointer) global_worklist_get(pgwl));
-}
-
-/************************************************************************//**
-  Helper function to set a worklist for one city in the city report. This
-  function is called over all selected rows in the list view.
-****************************************************************************/
-static void set_worklist_foreach(GtkTreeModel *model, GtkTreePath *path,
-                                 GtkTreeIter *iter, gpointer data)
-{
-  const struct worklist *pwl = data;
-  struct city *pcity = city_model_get(model, iter);
-
-  fc_assert_ret(pwl != NULL);
-
-  if (NULL != pcity) {
-    city_set_queue(pcity, pwl);
-  }
-}
-
-/************************************************************************//**
-  Menu item callback to set a city's worklist to the global worklist
-  associated with this menu item. The worklist pointer is passed in 'data'.
-****************************************************************************/
-static void set_worklist_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  struct global_worklist *pgwl =
-    global_worklist_by_id(GPOINTER_TO_INT(data));
-
-  fc_assert_ret(city_selection_depr != NULL);
-  gtk_tree_selection_selected_foreach(city_selection_depr, set_worklist_foreach,
-                                      (gpointer) global_worklist_get(pgwl));
-
-  if (!pgwl) {
-    /* Maybe removed by an other way, not an error. */
-    return;
-  }
-
-  gtk_tree_selection_selected_foreach(city_selection_depr,
-                                      set_worklist_foreach,
-                                      (gpointer) global_worklist_get(pgwl));
-}
-
-/************************************************************************//**
-  Create submenu based on global worklist.
-****************************************************************************/
-static GMenu *create_wl_menu(GActionGroup *group, const char *act_pfx,
-                             GCallback cb)
-{
-  GMenu *menu;
-  GSimpleAction *act;
-  int count = 0;
-
-  menu = g_menu_new();
-
-  if (!can_client_issue_orders()) {
-    return NULL;
-  }
-
-  global_worklists_iterate(pgwl) {
-    char buf[128];
-
-    fc_snprintf(buf, sizeof(buf), "wl%s%d", act_pfx, count);
-    act = g_simple_action_new(buf, NULL);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", cb,
-                     GINT_TO_POINTER(global_worklist_id(pgwl)));
-    fc_snprintf(buf, sizeof(buf), "win.wl%s%d", act_pfx, count);
-    menu_item_append_unref(menu,
-                           g_menu_item_new(global_worklist_name(pgwl),
-                                           buf));
-    count++;
-  } global_worklists_iterate_end;
-
-  if (count == 0) {
-    char buf[64];
-
-    fc_snprintf(buf, sizeof(buf), "win.wl%s_dummy", act_pfx);
-    menu_item_append_unref(menu,
-                           g_menu_item_new(_("(no worklists defined)"), buf));
-  }
-
-  return menu;
-}
-
-/************************************************************************//**
-  Update city report views
-****************************************************************************/
-static void city_report_update_views(void)
-{
-  struct city_report_spec *spec;
-  GtkTreeView *view;
-  GtkTreeViewColumn *col;
-  GList *columns, *p;
-
-  view = GTK_TREE_VIEW(city_view_depr);
-  fc_assert_ret(view != NULL);
-
-  columns = gtk_tree_view_get_columns(view);
-
-  for (p = columns; p != NULL; p = p->next) {
-    col = p->data;
-    spec = g_object_get_data(G_OBJECT(col), "city_report_spec");
-    gtk_tree_view_column_set_visible(col, spec->show);
-  }
-
-  g_list_free(columns);
-}
-
-/************************************************************************//**
-  Create up-to-date menu item for the display menu.
-  Caller need to g_object_unref() returned item.
-****************************************************************************/
-static GMenuItem *create_display_menu_item(int pos)
-{
-  GMenuItem *item;
-  char act_name[50];
-  struct city_report_spec *spec = city_report_specs + pos;
-
-  fc_snprintf(act_name, sizeof(act_name), "win.display%d(%s)",
-              pos, spec->show ? "true" : "false");
-  item = g_menu_item_new(spec->explanation, NULL);
-  g_menu_item_set_detailed_action(item, act_name);
-
-  return item;
-}
-
-/************************************************************************//**
-  User has toggled some column viewing option
-****************************************************************************/
-static void toggle_view(GSimpleAction *act, GVariant *value, gpointer data)
-{
-  struct city_report_spec *spec = data;
-  int idx = spec - city_report_specs;
-
-  spec->show ^= 1;
-  city_report_update_views();
-
-  g_menu_remove(display_menu, idx);
-  menu_item_insert_unref(display_menu, idx, create_display_menu_item(idx));
-}
-
-/************************************************************************//**
-  Create columns selection menu for the city report.
-****************************************************************************/
-static GMenu *create_display_menu(GActionGroup *group)
-{
-  struct city_report_spec *spec;
-  int i;
-  GVariantType *bvart = g_variant_type_new("b");
-
-  display_menu = g_menu_new();
-  for (i = 0, spec = city_report_specs; i < NUM_CREPORT_COLS; i++, spec++) {
-    GSimpleAction *act;
-    char act_name[50];
-    GVariant *var = g_variant_new("b", TRUE);
-
-    fc_snprintf(act_name, sizeof(act_name), "display%d", i);
-    act = g_simple_action_new_stateful(act_name, bvart, var);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "change-state", G_CALLBACK(toggle_view), (gpointer)spec);
-
-    menu_item_insert_unref(display_menu, i, create_display_menu_item(i));
-  }
-
-  g_variant_type_free(bvart);
-
-  return display_menu;
-}
-
-/************************************************************************//**
-  Create menu for city report
-****************************************************************************/
-static GtkWidget *create_city_report_menu(void)
-{
-  GtkWidget *vbox, *sep;
-  GtkWidget *aux_menu;
-  GMenu *submenu;
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_append(GTK_BOX(vbox), sep);
-
-  aux_menu = aux_menu_new();
-  cityrep_group = G_ACTION_GROUP(g_simple_action_group_new());
-
-  cityrep_menu = g_menu_new();
-
-  /* Placeholder */
-  submenu_append_unref(cityrep_menu, _("_Production"),
-                       G_MENU_MODEL(g_menu_new()));
-
-  submenu_append_unref(cityrep_menu, _("Gover_nor"),
-                       G_MENU_MODEL(create_governor_menu(cityrep_group, TRUE)));
-
-  /* Placeholders */
-  submenu_append_unref(cityrep_menu, _("S_ell"), G_MENU_MODEL(g_menu_new()));
-  submenu_append_unref(cityrep_menu, _("_Select"), G_MENU_MODEL(g_menu_new()));
-
-  submenu = create_display_menu(cityrep_group);
-  submenu_append_unref(cityrep_menu, _("_Display"), G_MENU_MODEL(submenu));
-
-  gtk_widget_insert_action_group(aux_menu, "win", cityrep_group);
-  gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(cityrep_menu));
-  gtk_box_append(GTK_BOX(vbox), aux_menu);
-
-  return vbox;
-}
-
-/************************************************************************//**
-  Sort callback.
-****************************************************************************/
-static gint cityrep_sort_func(GtkTreeModel *model, GtkTreeIter *a,
-                              GtkTreeIter *b, gpointer data)
-{
-  gint col = GPOINTER_TO_INT(data);
-  gchar *str1, *str2;
-  int i;
-
-  gtk_tree_model_get(model, a, col, &str1, -1);
-  gtk_tree_model_get(model, b, col, &str2, -1);
-
-  i = cityrepfield_compare(str1, str2);
-  g_free(str1);
-  g_free(str2);
-  return i;
-}
-
-/************************************************************************//**
-  Create city report dialog.
-****************************************************************************/
-static void create_city_report_dialog(bool make_modal)
-{
-  static char **titles;
-  static char (*buf)[128];
-  struct city_report_spec *spec;
-
-  GtkWidget *w, *sw, *aux_menu;
-  int i;
-
-  gui_dialog_new(&city_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL, TRUE);
-  gui_dialog_set_title(city_dialog_shell, _("Cities"));
-
-  gui_dialog_set_default_size(city_dialog_shell, -1, 420);
-
-  gui_dialog_response_set_callback(city_dialog_shell,
-                                   city_command_callback);
-
-  /* Menu */
-  aux_menu = create_city_report_menu();
-  gui_dialog_add_action_widget(city_dialog_shell, aux_menu);
-
-  /* Buttons */
-  city_total_buy_cost_label = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(city_total_buy_cost_label, TRUE);
-  gtk_label_set_ellipsize(GTK_LABEL(city_total_buy_cost_label),
-                          PANGO_ELLIPSIZE_START);
-  gui_dialog_add_action_widget(city_dialog_shell,
-                               city_total_buy_cost_label);
-
-  w = gui_dialog_add_button(city_dialog_shell, NULL,
-                            _("_Buy"), CITY_BUY);
-  city_buy_command = w;
-
-  w = gui_dialog_add_button(city_dialog_shell, NULL,
-                            _("_Inspect"), CITY_POPUP);
-  city_popup_command = w;
-
-  w = gui_dialog_add_button(city_dialog_shell, NULL,
-                            _("Cen_ter"), CITY_CENTER);
-  city_center_command = w;
-
-  city_model_depr = city_report_dialog_store_new_depr();
-
-  city_store = g_list_store_new(FC_TYPE_CITY_ROW);
-  city_selection
-    = gtk_multi_selection_new(G_LIST_MODEL(city_store));
-  city_view = gtk_column_view_new(GTK_SELECTION_MODEL(city_selection));
-
-  /* Tree view */
-  buf = fc_realloc(buf, NUM_CREPORT_COLS * sizeof(buf[0]));
-  titles = fc_realloc(titles, NUM_CREPORT_COLS * sizeof(titles[0]));
-  for (i = 0; i < NUM_CREPORT_COLS; i++) {
-    titles[i] = buf[i];
-  }
-  get_city_table_header(titles, sizeof(buf[0]));
-
-  for (i = 0; i < NUM_CREPORT_COLS; i++) {
-    GtkListItemFactory *factory;
-    GtkColumnViewColumn *column;
-
-    factory = gtk_signal_list_item_factory_new();
-    g_signal_connect(factory, "bind", G_CALLBACK(city_factory_bind),
-                     GINT_TO_POINTER(i));
-    g_signal_connect(factory, "setup", G_CALLBACK(city_factory_setup),
-                     GINT_TO_POINTER(i));
-
-    column = gtk_column_view_column_new(titles[i], factory);
-    gtk_column_view_append_column(GTK_COLUMN_VIEW(city_view), column);
-  }
-
-  city_view_depr = gtk_tree_view_new_with_model(GTK_TREE_MODEL(city_model_depr));
-  gtk_widget_set_hexpand(city_view_depr, TRUE);
-  gtk_widget_set_vexpand(city_view_depr, TRUE);
-  g_object_unref(city_model_depr);
-  gtk_widget_set_name(city_view_depr, "small_font");
-  g_signal_connect(city_view_depr, "row_activated",
-                   G_CALLBACK(city_activated_callback), NULL);
-  city_selection_depr = gtk_tree_view_get_selection(GTK_TREE_VIEW(city_view_depr));
-  gtk_tree_selection_set_mode(city_selection_depr, GTK_SELECTION_MULTIPLE);
-  g_signal_connect(city_selection_depr, "changed",
-                   G_CALLBACK(city_selection_changed_callback), NULL);
-
-  for (i = 0, spec = city_report_specs; i < NUM_CREPORT_COLS; i++, spec++) {
-    GtkWidget *header;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *col;
-
-    renderer = gtk_cell_renderer_text_new();
-    col = gtk_tree_view_column_new_with_attributes(NULL, renderer,
-                                                   "text", i, NULL);
-    header = gtk_label_new(titles[i]);
-    gtk_widget_set_tooltip_text(header, spec->explanation);
-    gtk_widget_set_visible(header, TRUE);
-    gtk_tree_view_column_set_widget(col, header);
-    gtk_tree_view_column_set_visible(col, spec->show);
-    gtk_tree_view_column_set_sort_column_id(col, i);
-    gtk_tree_view_column_set_reorderable(col, TRUE);
-    g_object_set_data(G_OBJECT(col), "city_report_spec", spec);
-    gtk_tree_view_append_column(GTK_TREE_VIEW(city_view_depr), col);
-    gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(city_model_depr), i,
-                                    cityrep_sort_func, GINT_TO_POINTER(i),
-                                    NULL);
-  }
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), city_view_depr);
-
-  gui_dialog_add_content_widget(city_dialog_shell, sw);
-
-  city_model_fill_depr(city_model_depr, NULL, NULL);
-  city_store_fill(city_store, nullptr, nullptr);
-  gui_dialog_show_all(city_dialog_shell);
-
-  /* Real menus */
-  recreate_production_menu(cityrep_group);
-  recreate_select_menu(cityrep_group);
-  recreate_sell_menu(cityrep_group);
-
-  city_selection_changed_callback(city_selection_depr);
-}
-
-/************************************************************************//**
-  User has chosen to select all cities
-****************************************************************************/
-static void city_select_all_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  gtk_tree_selection_select_all(city_selection_depr);
-}
-
-/************************************************************************//**
-  User has chosen to unselect all cities
-****************************************************************************/
-static void city_unselect_all_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  gtk_tree_selection_unselect_all(city_selection_depr);
-}
-
-/************************************************************************//**
-  User has chosen to invert selection
-****************************************************************************/
-static void city_invert_selection_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  ITree it;
-  GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-
-  for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-    if (itree_is_selected(city_selection_depr, &it)) {
-      itree_unselect(city_selection_depr, &it);
-    } else {
-      itree_select(city_selection_depr, &it);
-    }
-  }
-}
-
-/************************************************************************//**
-  User has chosen to select coastal cities
-****************************************************************************/
-static void city_select_coastal_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data)
-{
-  ITree it;
-  GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-
-  gtk_tree_selection_unselect_all(city_selection_depr);
-
-  for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-    struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-
-    if (pcity != NULL
-        && is_terrain_class_near_tile(&(wld.map), pcity->tile, TC_OCEAN)) {
-      itree_select(city_selection_depr, &it);
-    }
-  }
-}
-
-/************************************************************************//**
-  Select all cities on the same continent.
-****************************************************************************/
-static void same_island_iterate(GtkTreeModel *model, GtkTreePath *path,
-                                GtkTreeIter *iter, gpointer data)
-{
-  struct city *selected_pcity = city_model_get(model, iter);
-  ITree it;
-
-  if (NULL == selected_pcity) {
-    return;
-  }
-
-  for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-    struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-
-    if (NULL != pcity
-        && (tile_continent(pcity->tile)
-            == tile_continent(selected_pcity->tile))) {
-      itree_select(city_selection_depr, &it);
-    }
-  }
-}
-
-/************************************************************************//**
-  User has chosen to select all cities on same island
-****************************************************************************/
-static void city_select_island_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  gtk_tree_selection_selected_foreach(city_selection_depr,
-                                      same_island_iterate, NULL);
-}
-
-/************************************************************************//**
-  User has chosen to select cities with certain target in production
-****************************************************************************/
-static void city_select_building_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data)
-{
-  enum production_class_type which = GPOINTER_TO_INT(data);
-  ITree it;
-  GtkTreeModel *model = GTK_TREE_MODEL(city_model_depr);
-
-  gtk_tree_selection_unselect_all(city_selection_depr);
-
-  for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-    struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-
-    if (NULL != pcity
-        && ((which == PCT_UNIT && VUT_UTYPE == pcity->production.kind)
-            || (which == PCT_IMPROVEMENT
-                && VUT_IMPROVEMENT == pcity->production.kind
-                && !is_wonder(pcity->production.value.building))
-            || (which == PCT_WONDER
-                && VUT_IMPROVEMENT == pcity->production.kind
-                && is_wonder(pcity->production.value.building)))) {
-      itree_select(city_selection_depr, &it);
-    }
-  }
-}
-
-/************************************************************************//**
-  Buy the production in one single city.
-****************************************************************************/
-static void buy_iterate(GtkTreeModel *model, GtkTreePath *path,
-                        GtkTreeIter *iter, gpointer data)
-{
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    cityrep_buy(pcity);
-  }
-}
-
-/************************************************************************//**
-  Center to one single city.
-****************************************************************************/
-static void center_iterate(GtkTreeModel *model, GtkTreePath *path,
-                           GtkTreeIter *iter, gpointer data)
-{
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    center_tile_mapcanvas(pcity->tile);
-  }
-}
-
-/************************************************************************//**
-  Popup the dialog of a single city.
-****************************************************************************/
-static void popup_iterate(GtkTreeModel *model, GtkTreePath *path,
-                          GtkTreeIter *iter, gpointer data)
-{
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    if (gui_options.center_when_popup_city) {
-      center_tile_mapcanvas(pcity->tile);
-    }
-    popup_city_dialog(pcity);
-  }
-}
-
-/************************************************************************//**
-  gui_dialog response callback.
-****************************************************************************/
-static void city_command_callback(struct gui_dialog *dlg, int response,
-                                  gpointer data)
-{
-  switch (response) {
-  case CITY_CENTER:
-    if (1 == gtk_tree_selection_count_selected_rows(city_selection_depr)) {
-      /* Center to city doesn't make sense if many city are selected. */
-      gtk_tree_selection_selected_foreach(city_selection_depr, center_iterate,
-                                          NULL);
-    }
-    break;
-  case CITY_POPUP:
-    gtk_tree_selection_selected_foreach(city_selection_depr, popup_iterate, NULL);
-    break;
-  case CITY_BUY:
-    gtk_tree_selection_selected_foreach(city_selection_depr, buy_iterate, NULL);
-    break;
-  default:
-    gui_dialog_destroy(dlg);
-    break;
-  }
-}
-
-/************************************************************************//**
-  User has selected city row from city report.
-****************************************************************************/
-static void city_activated_callback(GtkTreeView *view, GtkTreePath *path,
-                                    GtkTreeViewColumn *col, gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GdkSurface *win;
-  GdkSeat *seat;
-  GdkModifierType mask;
-
-  model = gtk_tree_view_get_model(view);
-
-  if (!gtk_tree_model_get_iter(model, &iter, path)) {
-    return;
-  }
-
-  win = gtk_native_get_surface(gtk_widget_get_native(GTK_WIDGET(view)));
-  seat = gdk_display_get_default_seat(gdk_surface_get_display(win));
-
-  gdk_surface_get_device_position(win, gdk_seat_get_pointer(seat),
-                                  NULL, NULL, &mask);
-
-  if (!(mask & GDK_CONTROL_MASK)) {
-    popup_iterate(model, path, &iter, NULL);
-  } else {
-    center_iterate(model, path, &iter, NULL);
-  }
-}
-
-/************************************************************************//**
-  Update the city report dialog
-****************************************************************************/
-void real_city_report_dialog_update(void *unused)
-{
-  GHashTable *selected;
-  ITree iter;
-  gint city_id;
-
-  if (NULL == city_dialog_shell) {
-    return;
-  }
-
-  /* Save the selection. */
-  selected = g_hash_table_new(NULL, NULL);
-  for (itree_begin(GTK_TREE_MODEL(city_model_depr), &iter);
-       !itree_end(&iter); itree_next(&iter)) {
-    if (itree_is_selected(city_selection_depr, &iter)) {
-      itree_get(&iter, CRD_COL_CITY_ID, &city_id, -1);
-      g_hash_table_insert(selected, GINT_TO_POINTER(city_id), NULL);
-    }
-  }
-
-  /* Update and restore the selection. */
-  gtk_list_store_clear(city_model_depr);
-  city_model_fill_depr(city_model_depr, city_selection_depr, selected);
-
-  g_list_store_remove_all(city_store);
-  city_store_fill(city_store, city_selection, selected);
-  g_hash_table_destroy(selected);
-
-  update_governor_menu();
-}
-
-/************************************************************************//**
-  Update the text for a single city in the city report.
-****************************************************************************/
-void real_city_report_update_city(struct city *pcity)
-{
-  GtkTreeIter iter;
-
-  if (NULL == city_dialog_shell) {
-    return;
-  }
-
-  if (!city_model_find(GTK_TREE_MODEL(city_model_depr), &iter, pcity)) {
-    gtk_list_store_prepend(city_model_depr, &iter);
-  }
-  city_model_set_depr(city_model_depr, &iter, pcity);
-
-  update_total_buy_cost();
-}
-
-/************************************************************************//**
-  Create submenu for changing production target.
-
-  @param group       Group to add actions to
-  @param mname       Menu name part of the action identifier
-  @param human_mname Format of the human visible menu name
-  @param oper        Operation to do when user selects an entry
-  @return Created menu
-****************************************************************************/
-static GMenu *create_change_menu(GActionGroup *group, const char *mname,
-                                 const char *human_mname,
-                                 enum city_operation_type oper)
-{
-  GMenu *menu = g_menu_new();
-  GMenu *submenu;
-  int n;
-  char buf[128];
-
-  n = gtk_tree_selection_count_selected_rows(city_selection_depr);
-
-  submenu = g_menu_new();
-  append_impr_or_unit_to_menu(submenu, group, mname, "_u",
-                              TRUE, FALSE, oper,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), n);
-  fc_snprintf(buf, sizeof(buf), human_mname, _("Unit"));
-  submenu_append_unref(menu, buf, G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-  append_impr_or_unit_to_menu(submenu, group, mname, "_i",
-                              FALSE, FALSE, oper,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), n);
-  fc_snprintf(buf, sizeof(buf), human_mname, _("Improvement"));
-  submenu_append_unref(menu, buf, G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-  append_impr_or_unit_to_menu(submenu, group, mname, "_w",
-                              FALSE, TRUE, oper,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), n);
-  fc_snprintf(buf, sizeof(buf), human_mname, _("Wonder"));
-  submenu_append_unref(menu, buf, G_MENU_MODEL(submenu));
-
-  return menu;
-}
-
-/************************************************************************//**
-  Update the sell menu.
-****************************************************************************/
-static void recreate_sell_menu(GActionGroup *group)
-{
-  int n;
-  GMenu *menu = g_menu_new();
-
-  n = gtk_tree_selection_count_selected_rows(city_selection_depr);
-
-  append_impr_or_unit_to_menu(menu, group, "sell", "",
-                              FALSE, FALSE, CO_SELL,
-                              can_city_sell_universal,
-                              G_CALLBACK(select_impr_or_unit_callback),
-                              n);
-
-  g_menu_remove(cityrep_menu, 2);
-  submenu_insert_unref(cityrep_menu, 2, _("S_ell"), G_MENU_MODEL(menu));
-}
-
-/************************************************************************//**
-  Creates production menu
-****************************************************************************/
-static GMenu *create_production_menu(GActionGroup *group)
-{
-  GSimpleAction *act;
-
-  prod_menu = g_menu_new();
-
-  /* TRANS: Menu name part to be used like "Change to Improvement"
-   *        This is about changing current production. */
-  change_menu = create_change_menu(group, "change", _("Change to %s"), CO_CHANGE);
-  submenu_append_unref(prod_menu, _("Chan_ge"), G_MENU_MODEL(change_menu));
-
-  add_first_menu = g_menu_new();
-
-  /* TRANS: Menu name to be used like "Set Improvement first"
-   *        This is about adding item to the beginning of the worklist. */
-  add_first_menu = create_change_menu(group, "first", _("Set %s first"), CO_FIRST);
-  submenu_append_unref(prod_menu, _("Add _First"),
-                       G_MENU_MODEL(add_first_menu));
-
-  add_last_menu = g_menu_new();
-
-  /* TRANS: Menu name to be used like "Set Improvement last"
-   *        This is about adding item to the end of the worklist. */
-  add_last_menu = create_change_menu(group, "last", _("Set %s last"), CO_LAST);
-  submenu_append_unref(prod_menu, _("Add _Last"),
-                       G_MENU_MODEL(add_last_menu));
-
-  add_next_menu = g_menu_new();
-
-  /* TRANS: Menu name to be used like "Set Improvement next"
-   *        This is about adding item after current one on the worklist. */
-  add_next_menu = create_change_menu(group, "next", _("Set %s next"), CO_NEXT);
-  submenu_append_unref(prod_menu, _("Add _Next"),
-                       G_MENU_MODEL(add_next_menu));
-
-  add_2ndlast_menu = g_menu_new();
-
-  /* TRANS: Menu name to be used like "Set Improvement 2nd last"
-   *        This is about adding item as second last on the worklist. */
-  add_2ndlast_menu = create_change_menu(group, "2ndlast", _("Set %s 2nd last"), CO_NEXT_TO_LAST);
-  submenu_append_unref(prod_menu, _("Add _2nd Last"),
-                       G_MENU_MODEL(add_2ndlast_menu));
-
-  wl_set_menu = create_wl_menu(group, "set", G_CALLBACK(set_worklist_callback));
-  submenu_append_unref(prod_menu, _("Set Worklist"),
-                       G_MENU_MODEL(wl_set_menu));
-
-  wl_append_menu = create_wl_menu(group, "append", G_CALLBACK(append_worklist_callback));
-  submenu_append_unref(prod_menu, _("Append Worklist"),
-                       G_MENU_MODEL(wl_append_menu));
-
-  act = g_simple_action_new("clear_worklist", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_clear_worklist_callback),
-                   NULL);
-  menu_item_append_unref(prod_menu, g_menu_item_new(_("Clear _Worklist"),
-                                                    "win.clear_worklist"));
-
-  return prod_menu;
-}
-
-/************************************************************************//**
-  Recreates production menu
-****************************************************************************/
-static void recreate_production_menu(GActionGroup *group)
-{
-  if (prod_menu != NULL) {
-    g_menu_remove_all(change_menu);
-    g_menu_remove_all(add_first_menu);
-    g_menu_remove_all(add_last_menu);
-    g_menu_remove_all(add_next_menu);
-    g_menu_remove_all(add_2ndlast_menu);
-    g_menu_remove_all(wl_set_menu);
-    g_menu_remove_all(wl_append_menu);
-    g_menu_remove_all(prod_menu);
-  }
-  g_menu_remove(cityrep_menu, 0);
-  submenu_insert_unref(cityrep_menu, 0, _("_Production"),
-                       G_MENU_MODEL(create_production_menu(group)));
-}
-
-/************************************************************************//**
-  Returns whether city is building given target
-****************************************************************************/
-static bool city_building_impr_or_unit(const struct city *pcity,
-                                       const struct universal *target)
-{
-  return are_universals_equal(&pcity->production, target);
-}
-
-/************************************************************************//**
-  Creates select menu
-****************************************************************************/
-static GMenu *create_select_menu(GActionGroup *group)
-{
-  GSimpleAction *act;
-  char buf[128];
-
-  select_menu = g_menu_new();
-
-#if 0
-  gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu);
-  g_signal_connect(menu, "show", G_CALLBACK(popup_select_menu), NULL);
-#endif
-
-  act = g_simple_action_new("select_all", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_all_callback),
-                   NULL);
-  menu_item_append_unref(select_menu, g_menu_item_new(_("All Cities"),
-                                                      "win.select_all"));
-
-  act = g_simple_action_new("select_none", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_unselect_all_callback),
-                   NULL);
-  menu_item_append_unref(select_menu, g_menu_item_new(_("No Cities"),
-                                                      "win.select_none"));
-
-  act = g_simple_action_new("select_invert", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_invert_selection_callback),
-                   NULL);
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Invert Selection"),
-                                                      "win.select_invert"));
-
-  act = g_simple_action_new("select_build_unit", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_building_callback),
-                   GINT_TO_POINTER(PCT_UNIT));
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Building Units"),
-                                                      "win.select_build_unit"));
-
-  act = g_simple_action_new("select_build_impr", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_building_callback),
-                   GINT_TO_POINTER(PCT_IMPROVEMENT));
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Building Improvements"),
-                                                      "win.select_build_impr"));
-
-  act = g_simple_action_new("select_build_wonder", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_building_callback),
-                   GINT_TO_POINTER(PCT_WONDER));
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Building Wonders"),
-                                                      "win.select_build_wonder"));
-
-  unit_b_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(unit_b_select_menu, group, "sel", "_b_u",
-                              TRUE, FALSE, CO_NONE,
-                              city_building_impr_or_unit,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Building %s"), _("Unit"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(unit_b_select_menu));
-
-  impr_b_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(impr_b_select_menu, group, "sel", "_b_b",
-                              FALSE, FALSE, CO_NONE,
-                              city_building_impr_or_unit,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Building %s"), _("Improvement"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(impr_b_select_menu));
-
-  wndr_b_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(wndr_b_select_menu, group, "sel", "_b_w",
-                              FALSE, TRUE, CO_NONE,
-                              city_building_impr_or_unit,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Building %s"), _("Wonder"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(wndr_b_select_menu));
-
-  act = g_simple_action_new("select_coastal", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_coastal_callback),
-                   NULL);
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Coastal Cities"),
-                                                      "win.select_coastal"));
-
-  act = g_simple_action_new("select_island", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(city_select_island_callback),
-                   NULL);
-  menu_item_append_unref(select_menu, g_menu_item_new(_("Same Island"),
-                                                      "win.select_island"));
-
-  unit_s_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(unit_s_select_menu, group, "sel", "_s_u",
-                              TRUE, FALSE, CO_NONE,
-                              city_unit_supported,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Supported %s"), _("Unit"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(unit_s_select_menu));
-
-  unit_p_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(unit_p_select_menu, group, "sel", "_p_u",
-                              TRUE, FALSE, CO_NONE,
-                              city_unit_present,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Present %s"), _("Unit"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(unit_p_select_menu));
-
-  impr_p_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(impr_p_select_menu, group, "sel", "_p_b",
-                              FALSE, FALSE, CO_NONE,
-                              city_building_present,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Present %s"), _("Improvement"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(impr_p_select_menu));
-
-  wndr_p_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(wndr_p_select_menu, group, "sel", "_p_w",
-                              FALSE, TRUE, CO_NONE,
-                              city_building_present,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Present %s"), _("Wonder"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(wndr_p_select_menu));
-
-  unit_a_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(unit_a_select_menu, group, "sel", "_a_u",
-                              TRUE, FALSE, CO_NONE,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Available %s"), _("Unit"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(unit_a_select_menu));
-
-  impr_a_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(impr_a_select_menu, group, "sel", "_a_b",
-                              FALSE, FALSE, CO_NONE,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Available %s"), _("Improvement"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(impr_a_select_menu));
-
-  wndr_a_select_menu = g_menu_new();
-  append_impr_or_unit_to_menu(wndr_a_select_menu, group, "sel", "_a_w",
-                              FALSE, TRUE, CO_NONE,
-                              can_city_build_now_client,
-                              G_CALLBACK(select_impr_or_unit_callback), -1);
-  fc_snprintf(buf, sizeof(buf), _("Available %s"), _("Wonder"));
-  submenu_append_unref(select_menu, buf, G_MENU_MODEL(wndr_a_select_menu));
-
-  governor_select_menu = create_governor_menu(cityrep_group, FALSE);
-  submenu_append_unref(select_menu, _("Citizen Governor"),
-                       G_MENU_MODEL(governor_select_menu));
-
-  return select_menu;
-}
-
-/************************************************************************//**
-  Recreates production menu
-****************************************************************************/
-static void recreate_select_menu(GActionGroup *group)
-{
-  if (unit_b_select_menu != NULL) {
-    g_menu_remove_all(unit_b_select_menu);
-    g_menu_remove_all(impr_b_select_menu);
-    g_menu_remove_all(wndr_b_select_menu);
-    g_menu_remove_all(unit_s_select_menu);
-    g_menu_remove_all(unit_p_select_menu);
-    g_menu_remove_all(impr_p_select_menu);
-    g_menu_remove_all(wndr_p_select_menu);
-    g_menu_remove_all(unit_a_select_menu);
-    g_menu_remove_all(impr_a_select_menu);
-    g_menu_remove_all(wndr_a_select_menu);
-    g_menu_remove_all(governor_select_menu);
-    g_menu_remove_all(select_menu);
-  }
-  g_menu_remove(cityrep_menu, 3);
-  submenu_insert_unref(cityrep_menu, 3, _("_Select"),
-                       G_MENU_MODEL(create_select_menu(group)));
-}
-
-/************************************************************************//**
-  Update the value displayed by the "total buy cost" label in the city
-  report, or make it blank if nothing can be bought.
-****************************************************************************/
-static void update_total_buy_cost(void)
-{
-  GtkWidget *label, *view;
-  GList *rows, *p;
-  GtkTreeModel *model;
-  GtkTreeSelection *sel;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-  struct city *pcity;
-  int total = 0;
-
-  view = city_view_depr;
-  label = city_total_buy_cost_label;
-
-  if (!view || !label) {
-    return;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  rows = gtk_tree_selection_get_selected_rows(sel, &model);
-
-  for (p = rows; p != NULL; p = p->next) {
-    path = p->data;
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      if ((pcity = city_model_get(model, &iter))) {
-        total += pcity->client.buy_cost;
-      }
-    }
-    gtk_tree_path_free(path);
-  }
-  g_list_free(rows);
-
-  if (total > 0) {
-    gchar *buf = g_strdup_printf(_("Total Buy Cost: %d"), total);
-
-    gtk_label_set_text(GTK_LABEL(label), buf);
-    g_free(buf);
-  } else {
-    gtk_label_set_text(GTK_LABEL(label), NULL);
-  }
-}
-
-/************************************************************************//**
-  Update city report button sensitivity and total buy cost label when the
-  user makes a change in the selection of cities.
-****************************************************************************/
-static void city_selection_changed_callback(GtkTreeSelection *selection)
-{
-#ifdef MENUS_GTK3
-  int n;
-  bool obs_may, plr_may;
-
-  n = gtk_tree_selection_count_selected_rows(selection);
-  obs_may = n > 0;
-  plr_may = obs_may && can_client_issue_orders();
-#endif /* MENUS_GTK3 */
-
-  update_governor_menu();
-
-#ifdef MENUS_GTK3
-  gtk_widget_set_sensitive(city_center_command, obs_may);
-  gtk_widget_set_sensitive(city_popup_command, obs_may);
-  gtk_widget_set_sensitive(city_buy_command, plr_may);
-#endif /* MENUS_GTK3 */
-
-  recreate_production_menu(cityrep_group);
-  recreate_select_menu(cityrep_group);
-  recreate_sell_menu(cityrep_group);
-
-#ifdef MENUS_GTK3
-  if (!plr_may) {
-    gtk_widget_set_sensitive(city_sell_command, FALSE);
-  }
-#endif /* MENUS_GTK3 */
-
-  update_total_buy_cost();
-}
-
-/************************************************************************//**
-  Clear the worklist in one selected city in the city report.
-****************************************************************************/
-static void clear_worklist_foreach_func(GtkTreeModel *model,
-                                        GtkTreePath *path,
-                                        GtkTreeIter *iter,
-                                        gpointer data)
-{
-  struct city *pcity = city_model_get(model, iter);
-
-  if (NULL != pcity) {
-    struct worklist empty;
-
-    worklist_init(&empty);
-    city_set_worklist(pcity, &empty);
-  }
-}
-
-/************************************************************************//**
-  Called when the "clear worklist" menu item is activated.
-****************************************************************************/
-static void city_clear_worklist_callback(GSimpleAction *action, GVariant *parameter,
-                                         gpointer data)
-{
-  struct connection *pconn = &client.conn;
-
-  fc_assert_ret(city_selection_depr != NULL);
-
-  connection_do_buffer(pconn);
-  gtk_tree_selection_selected_foreach(city_selection_depr,
-                                      clear_worklist_foreach_func, NULL);
-  connection_do_unbuffer(pconn);
-}
-
-/************************************************************************//**
-  After a selection rectangle is defined, make the cities that
-  are hilited on the canvas exclusively hilited in the
-  City List window.
-****************************************************************************/
-void hilite_cities_from_canvas(void)
-{
-  ITree it;
-  GtkTreeModel *model;
-
-  if (!city_dialog_shell) {
-    return;
-  }
-
-  model = GTK_TREE_MODEL(city_model_depr);
-
-  gtk_tree_selection_unselect_all(city_selection_depr);
-
-  for (itree_begin(model, &it); !itree_end(&it); itree_next(&it)) {
-    struct city *pcity = city_model_get(model, TREE_ITER_PTR(it));
-
-    if (NULL != pcity && is_city_hilited(pcity)) {
-      itree_select(city_selection_depr, &it);
-    }
-  }
-}
-
-/************************************************************************//**
-  Toggle a city's hilited status.
-****************************************************************************/
-void toggle_city_hilite(struct city *pcity, bool on_off)
-{
-  GtkTreeIter iter;
-
-  if (NULL == city_dialog_shell) {
-    return;
-  }
-
-  if (city_model_find(GTK_TREE_MODEL(city_model_depr), &iter, pcity)) {
-    if (on_off) {
-      gtk_tree_selection_select_iter(city_selection_depr, &iter);
-    } else {
-      gtk_tree_selection_unselect_iter(city_selection_depr, &iter);
-    }
-  }
-}
diff --git a/client/gui-gtk-5.0/cityrep.h b/client/gui-gtk-5.0/cityrep.h
deleted file mode 100644
index 278b6a9def..0000000000
--- a/client/gui-gtk-5.0/cityrep.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CITYREP_H
-#define FC__CITYREP_H
-
-/* client */
-#include "cityrep_g.h"
-
-void city_report_dialog_popdown(void);
-
-#endif  /* FC__CITYREP_H */
diff --git a/client/gui-gtk-5.0/cma_fe.c b/client/gui-gtk-5.0/cma_fe.c
deleted file mode 100644
index 4047df6360..0000000000
--- a/client/gui-gtk-5.0/cma_fe.c
+++ /dev/null
@@ -1,847 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2001 - R. Falke, M. Kaufman
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* common */
-#include "events.h"
-#include "game.h"
-
-/* client */
-#include "chatline_g.h"
-#include "citydlg_g.h"
-#include "client_main.h"
-#include "cma_fec.h"
-#include "messagewin_g.h"
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "cityrep.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "helpdlg.h"
-#include "inputdlg.h"
-
-#include "cma_fe.h"
-
-#define BUFFER_SIZE             64
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct cma_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct cma_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-
-static int allow_refreshes = 1;
-
-static struct cma_dialog *get_cma_dialog(struct city *pcity);
-
-static void update_cma_preset_list(struct cma_dialog *pdialog);
-
-static gboolean cma_preset_key_pressed(GtkEventControllerKey *controller,
-                                       guint keyval, guint keycode,
-                                       GdkModifierType state, gpointer data);
-static void cma_del_preset_callback(GtkWidget *w, gpointer data);
-static void cma_preset_remove(struct cma_dialog *pdialog, int preset_index);
-static void cma_preset_remove_response(GtkWidget *w, gint response,
-                                       gpointer data);
-
-static void cma_add_preset_callback(GtkWidget *w, gpointer data);
-static void cma_preset_add_popup_callback(gpointer data, gint response,
-                                          const char *input);
-
-static void cma_active_callback(GtkWidget *w, gpointer data);
-static void cma_activate_preset_callback(GtkSelectionModel *self,
-                                         guint position,
-                                         guint n_items,
-                                         gpointer data);
-
-static void hscale_changed(GtkWidget *get, gpointer data);
-static void set_hscales(const struct cm_parameter *const parameter,
-                        struct cma_dialog *pdialog);
-
-#define FC_TYPE_PRESET_ROW (fc_preset_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcPresetRow, fc_preset_row, FC, PRESET_ROW, GObject)
-
-struct _FcPresetRow
-{
-  GObject parent_instance;
-
-  char *desc;
-};
-
-struct _FcPresetRowClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcPresetRow, fc_preset_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Finalizing method for FcPresetRow class
-**************************************************************************/
-static void fc_preset_row_finalize(GObject *gobject)
-{
-  FcPresetRow *row = FC_PRESET_ROW(gobject);
-
-  if (row->desc != nullptr) {
-    free(row->desc);
-    row->desc = nullptr;
-  }
-
-  G_OBJECT_CLASS(fc_preset_row_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcPresetRow class
-**************************************************************************/
-static void
-fc_preset_row_class_init(FcPresetRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_preset_row_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcPresetRow
-**************************************************************************/
-static void
-fc_preset_row_init(FcPresetRow *self)
-{
-  self->desc = nullptr;
-}
-
-/**********************************************************************//**
-  FcPresetRow creation method
-**************************************************************************/
-static FcPresetRow *fc_preset_row_new(void)
-{
-  FcPresetRow *result;
-
-  result = g_object_new(FC_TYPE_PRESET_ROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  Initialize cma front end system
-**************************************************************************/
-void cma_fe_init(void)
-{
-  dialog_list = dialog_list_new();
-}
-
-/**********************************************************************//**
-  Free resources allocated for cma front end system
-**************************************************************************/
-void cma_fe_done(void)
-{
-  dialog_list_destroy(dialog_list);
-}
-
-/**********************************************************************//**
- only called when the city dialog is closed.
-**************************************************************************/
-void close_cma_dialog(struct city *pcity)
-{
-  struct cma_dialog *pdialog = get_cma_dialog(pcity);
-
-  if (pdialog == NULL) {
-    /* A city which is being investigated doesn't contain cma dialog */
-    return;
-  }
-
-  gtk_box_remove(GTK_BOX(gtk_widget_get_parent(pdialog->shell)),
-                 pdialog->shell);
-}
-
-/**********************************************************************//**
-  Destroy cma dialog
-**************************************************************************/
-static void cma_dialog_destroy_callback(GtkWidget *w, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-
-  dialog_list_remove(dialog_list, pdialog);
-  free(pdialog);
-}
-
-/**********************************************************************//**
-  Return the cma_dialog for a given city.
-**************************************************************************/
-struct cma_dialog *get_cma_dialog(struct city *pcity)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pcity == pcity) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  User has pressed button in cma dialog
-**************************************************************************/
-static gboolean button_press_callback(GtkGestureClick *gesture, int n_press,
-                                      double x, double y)
-{
-  GtkWidget *widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-  struct cma_dialog *pdialog
-    = (struct cma_dialog *) g_object_get_data(G_OBJECT(widget), "dialog");
-  int rnbr = get_column_view_row(pdialog->preset_list, y);
-
-  if (rnbr >= 0) {
-    if (n_press == 1) {
-      const struct cm_parameter *pparam;
-
-      pparam = cmafec_preset_get_parameter(rnbr);
-
-      /* Save the change */
-      cmafec_set_fe_parameter(pdialog->pcity, pparam);
-
-      if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-        cma_release_city(pdialog->pcity);
-        cma_put_city_under_agent(pdialog->pcity, pparam);
-      }
-      refresh_city_dialog(pdialog->pcity);
-    } else if (n_press == 2) {
-      struct cm_parameter param;
-
-      cmafec_get_fe_parameter(pdialog->pcity, &param);
-      cma_put_city_under_agent(pdialog->pcity, &param);
-      refresh_city_dialog(pdialog->pcity);
-    }
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  User has requested help
-**************************************************************************/
-static void help_callback(GtkWidget *w, gpointer data)
-{
-  popup_help_dialog_string(HELP_CMA_ITEM);
-}
-
-/**********************************************************************//**
-  Wlmeta table cell bind function
-**************************************************************************/
-static void preset_factory_bind(GtkSignalListItemFactory *self,
-                                GtkListItem *list_item,
-                                gpointer user_data)
-{
-  FcPresetRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(child), row->desc);
-}
-
-/**********************************************************************//**
-  Wlmeta table cell setup function
-**************************************************************************/
-static void preset_factory_setup(GtkSignalListItemFactory *self,
-                                 GtkListItem *list_item,
-                                 gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Instantiates a new struct for each city_dialog window that is open.
-**************************************************************************/
-struct cma_dialog *create_cma_dialog(struct city *pcity, bool tiny)
-{
-  struct cma_dialog *pdialog;
-  struct cm_parameter param;
-  GtkWidget *frame, *page, *hbox, *vbox, *label, *table;
-  GtkWidget *hscale, *button;
-  GtkListItemFactory *factory;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  gint layout_width;
-  GtkEventController *controller;
-  int shell_row = 0;
-  PangoLayout *layout;
-
-  cmafec_get_fe_parameter(pcity, &param);
-  pdialog = fc_malloc(sizeof(struct cma_dialog));
-  pdialog->pcity = pcity;
-  pdialog->shell = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(pdialog->shell),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(pdialog->shell), 8);
-  gtk_widget_set_margin_start(pdialog->shell, 8);
-  gtk_widget_set_margin_end(pdialog->shell, 8);
-  gtk_widget_set_margin_top(pdialog->shell, 8);
-  gtk_widget_set_margin_bottom(pdialog->shell, 8);
-  g_signal_connect(pdialog->shell, "destroy",
-                   G_CALLBACK(cma_dialog_destroy_callback), pdialog);
-
-  page = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-  gtk_grid_attach(GTK_GRID(pdialog->shell), page, 0, shell_row++, 1, 1);
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_grid_set_row_spacing(GTK_GRID(pdialog->shell), 2);
-  gtk_box_append(GTK_BOX(page), vbox);
-
-  pdialog->store = g_list_store_new(FC_TYPE_PRESET_ROW);
-  pdialog->selection
-    = gtk_single_selection_new(G_LIST_MODEL(pdialog->store));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(pdialog->selection));
-  pdialog->preset_list = list;
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(preset_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(preset_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("Name"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  g_object_set_data(G_OBJECT(pdialog->preset_list), "dialog", pdialog);
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(button_press_callback), NULL);
-  gtk_widget_add_controller(pdialog->preset_list, controller);
-
-  gtk_widget_set_tooltip_text(list,
-                              _("For information on\n"
-                                "the citizen governor and governor presets,\n"
-                                "including sample presets,\n"
-                                "see README.governor."));
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", list,
-                       "label", _("Prese_ts:"),
-                       "xalign", 0.0, "yalign", 0.5, NULL);
-  gtk_box_append(GTK_BOX(vbox), label);
-  gtk_box_append(GTK_BOX(vbox), list);
-
-  g_signal_connect(pdialog->selection, "selection-changed",
-                   G_CALLBACK(cma_activate_preset_callback), pdialog);
-  controller = gtk_event_controller_key_new();
-  g_signal_connect(controller, "key-pressed",
-                   G_CALLBACK(cma_preset_key_pressed), pdialog);
-  gtk_widget_add_controller(list, controller);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_append(GTK_BOX(vbox), hbox);
-
-  button = icon_label_button_new("document-new", _("Ne_w"));
-  gtk_box_append(GTK_BOX(hbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(cma_add_preset_callback), pdialog);
-  pdialog->add_preset_command = button;
-
-  pdialog->del_preset_command = icon_label_button_new("edit-delete",
-                                                      _("_Delete"));
-  gtk_box_append(GTK_BOX(hbox), pdialog->del_preset_command);
-  g_signal_connect(pdialog->del_preset_command, "clicked",
-                   G_CALLBACK(cma_del_preset_callback), pdialog);
-
-  /* The right-hand side */
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_set_margin_bottom(vbox, 2);
-  gtk_widget_set_margin_end(vbox, 2);
-  gtk_widget_set_margin_start(vbox, 2);
-  gtk_widget_set_margin_top(vbox, 2);
-  gtk_box_append(GTK_BOX(page), vbox);
-
-  /* Result */
-  if (!tiny) {
-    frame = gtk_frame_new(_("Results"));
-    gtk_widget_set_vexpand(frame, TRUE);
-    gtk_widget_set_valign(frame, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(vbox), frame);
-
-    pdialog->result_label =
-      gtk_label_new("food\n prod\n trade\n\n people\n grow\n prod\n name");
-    gtk_widget_set_name(pdialog->result_label, "city_label");
-    gtk_frame_set_child(GTK_FRAME(frame), pdialog->result_label);
-    gtk_label_set_justify(GTK_LABEL(pdialog->result_label), GTK_JUSTIFY_LEFT);
-  } else {
-    pdialog->result_label = NULL;
-  }
-
-  /* Minimal Surplus and Factor */
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 2);
-  gtk_widget_set_margin_end(table, 2);
-  gtk_widget_set_margin_start(table, 2);
-  gtk_widget_set_margin_top(table, 2);
-  gtk_box_append(GTK_BOX(vbox), table);
-
-  label = gtk_label_new(_("Minimal Surplus"));
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(table), label, 1, 0, 1, 1);
-  label = gtk_label_new(_("Factor"));
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(table), label, 2, 0, 1, 1);
-
-  output_type_iterate(i) {
-    label = gtk_label_new(get_output_name(i));
-    gtk_grid_attach(GTK_GRID(table), label, 0, i + 1, 1, 1);
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-
-    pdialog->minimal_surplus[i] = hscale =
-        gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, NULL);
-    gtk_range_set_range(GTK_RANGE(hscale),
-                        GUI_GTK_OPTION(governor_range_min),
-                        GUI_GTK_OPTION(governor_range_max));
-    gtk_range_set_increments(GTK_RANGE(hscale), 1, 1);
-    layout = gtk_scale_get_layout(GTK_SCALE(hscale));
-    if (layout != NULL) {
-      pango_layout_get_pixel_size(layout, &layout_width, NULL);
-      gtk_widget_set_size_request(hscale, layout_width + 51 * 2, -1);
-    }
-
-    gtk_grid_attach(GTK_GRID(table), hscale, 1, i + 1, 1, 1);
-    gtk_scale_set_digits(GTK_SCALE(hscale), 0);
-    gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_LEFT);
-
-    g_signal_connect(pdialog->minimal_surplus[i],
-                     "value-changed",
-                     G_CALLBACK(hscale_changed), pdialog);
-
-    pdialog->factor[i] = hscale
-      = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, NULL);
-    gtk_range_set_range(GTK_RANGE(hscale), 0, 25);
-    gtk_range_set_increments(GTK_RANGE(hscale), 1, 1);
-    layout = gtk_scale_get_layout(GTK_SCALE(hscale));
-    if (layout != NULL) {
-      pango_layout_get_pixel_size(layout, &layout_width, NULL);
-    } else {
-      layout_width = 20;
-    }
-    gtk_widget_set_size_request(hscale, layout_width + 26 * 2, -1);
-
-    gtk_grid_attach(GTK_GRID(table), hscale, 2, i + 1, 1, 1);
-    gtk_scale_set_digits(GTK_SCALE(hscale), 0);
-    gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_LEFT);
-
-    g_signal_connect(pdialog->factor[i], "value-changed",
-                     G_CALLBACK(hscale_changed), pdialog);
-  } output_type_iterate_end;
-
-  /* Happy Surplus and Factor */
-  label = gtk_label_new(_("Celebrate"));
-  gtk_grid_attach(GTK_GRID(table), label, 0, O_LAST + 1, 1, 1);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-
-  pdialog->happy_button = gtk_check_button_new();
-  gtk_widget_set_halign(pdialog->happy_button, GTK_ALIGN_END);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(pdialog->happy_button),
-                              FALSE);
-  gtk_grid_attach(GTK_GRID(table), pdialog->happy_button, 1, O_LAST + 1, 1, 1);
-
-  g_signal_connect(pdialog->happy_button, "toggled",
-                   G_CALLBACK(hscale_changed), pdialog);
-
-  pdialog->factor[O_LAST] = hscale
-    = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, NULL);
-  gtk_range_set_range(GTK_RANGE(hscale), 0, 50);
-  gtk_range_set_increments(GTK_RANGE(hscale), 1, 1);
-  layout = gtk_scale_get_layout(GTK_SCALE(hscale));
-  if (layout != NULL) {
-    pango_layout_get_pixel_size(layout, &layout_width, NULL);
-    gtk_widget_set_size_request(hscale, layout_width + 51 * 2, -1);
-  }
-
-  gtk_grid_attach(GTK_GRID(table), hscale, 2, O_LAST + 1, 1, 1);
-  gtk_scale_set_digits(GTK_SCALE(hscale), 0);
-  gtk_scale_set_value_pos(GTK_SCALE(hscale), GTK_POS_LEFT);
-
-  g_signal_connect(pdialog->factor[O_LAST],
-                   "value-changed",
-                   G_CALLBACK(hscale_changed), pdialog);
-
-  /* Maximize Growth */
-  label = gtk_label_new(_("Maximize growth"));
-  gtk_grid_attach(GTK_GRID(table), label, 0, O_LAST + 2, 1, 1);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-
-  pdialog->growth_button = gtk_check_button_new();
-  gtk_widget_set_halign(pdialog->growth_button, GTK_ALIGN_END);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(pdialog->growth_button),
-                              FALSE);
-  gtk_grid_attach(GTK_GRID(table), pdialog->growth_button, 1, O_LAST + 2, 1, 1);
-
-  g_signal_connect(pdialog->growth_button, "toggled",
-                   G_CALLBACK(hscale_changed), pdialog);
-
-  /* Buttons */
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_append(GTK_BOX(vbox), hbox);
-
-  button = icon_label_button_new("help-browser", _("Help"));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(help_callback), NULL);
-  gtk_box_append(GTK_BOX(hbox), button);
-
-  pdialog->active_command = gtk_toggle_button_new();
-  gtk_button_set_use_underline(GTK_BUTTON(pdialog->active_command), TRUE);
-  gtk_widget_set_name(pdialog->active_command, "comment_label");
-  gtk_box_append(GTK_BOX(hbox), pdialog->active_command);
-
-  gtk_widget_set_visible(pdialog->shell, TRUE);
-
-  dialog_list_prepend(dialog_list, pdialog);
-
-  update_cma_preset_list(pdialog);
-
-  /* Refresh is done in refresh_city_dialog() */
-
-  return pdialog;
-}
-
-/**********************************************************************//**
-  Refreshes the cma dialog
-**************************************************************************/
-void refresh_cma_dialog(struct city *pcity, enum cma_refresh refresh)
-{
-  struct cm_result *result = cm_result_new(pcity);
-  struct cm_parameter param;
-  struct cma_dialog *pdialog = get_cma_dialog(pcity);
-  int controlled = cma_is_city_under_agent(pcity, NULL);
-
-  cmafec_get_fe_parameter(pcity, &param);
-
-  if (pdialog->result_label != NULL) {
-    /* Fill in result label */
-    cm_result_from_main_map(result, pcity);
-    gtk_label_set_text(GTK_LABEL(pdialog->result_label),
-                       cmafec_get_result_descr(pcity, result, &param));
-  }
-
-  /* If called from a hscale, we _don't_ want to do this */
-  if (refresh != DONT_REFRESH_HSCALES) {
-    set_hscales(&param, pdialog);
-  }
-
-  gtk_widget_queue_draw(pdialog->preset_list);
-
-  gtk_widget_set_sensitive(pdialog->active_command, can_client_issue_orders());
-
-  g_signal_handlers_disconnect_matched(pdialog->active_command,
-      G_SIGNAL_MATCH_FUNC,
-      0, 0, NULL, cma_active_callback, NULL);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pdialog->active_command),
-      controlled);
-  g_signal_connect(pdialog->active_command, "clicked",
-      G_CALLBACK(cma_active_callback), pdialog);
-
-  if (controlled) {
-    gtk_button_set_label(GTK_BUTTON(pdialog->active_command),
-                         _("Governor Enabl_ed"));
-  } else {
-    gtk_button_set_label(GTK_BUTTON(pdialog->active_command),
-                         _("Governor Disabl_ed"));
-  }
-
-  if (pdialog->result_label != NULL) {
-    gtk_widget_set_sensitive(pdialog->result_label, controlled);
-  }
-
-  cm_result_destroy(result);
-}
-
-/**********************************************************************//**
-  Fills in the preset list
-**************************************************************************/
-static void update_cma_preset_list(struct cma_dialog *pdialog)
-{
-  char buf[BUFFER_SIZE];
-  int i;
-
-  /* Fill preset list */
-  g_list_store_remove_all(pdialog->store);
-
-  /* Append the presets */
-  if (cmafec_preset_num()) {
-    for (i = 0; i < cmafec_preset_num(); i++) {
-      FcPresetRow *row = fc_preset_row_new();
-
-      fc_strlcpy(buf, cmafec_preset_get_descr(i), sizeof(buf));
-      row->desc = fc_strdup(buf);
-      g_list_store_append(pdialog->store, row);
-      g_object_unref(row);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Callback for selecting a preset from the preset view
-**************************************************************************/
-static void cma_activate_preset_callback(GtkSelectionModel *self,
-                                         guint position,
-                                         guint n_items,
-                                         gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-  const struct cm_parameter *pparam;
-  int preset_index = gtk_single_selection_get_selected(GTK_SINGLE_SELECTION(self));
-
-  pparam = cmafec_preset_get_parameter(preset_index);
-
-  /* Save the change */
-  cmafec_set_fe_parameter(pdialog->pcity, pparam);
-
-  if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-    cma_release_city(pdialog->pcity);
-    cma_put_city_under_agent(pdialog->pcity, pparam);
-  }
-  refresh_city_dialog(pdialog->pcity);
-}
-
-/**********************************************************************//**
-  Pops up a dialog to allow to name your new preset
-**************************************************************************/
-static void cma_add_preset_callback(GtkWidget *w, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-  const char *default_name;
-  GtkWidget *parent = gtk_widget_get_ancestor(pdialog->shell, GTK_TYPE_WINDOW);
-  int index;
-
-  if ((index = gtk_single_selection_get_selected(pdialog->selection)) >= 0) {
-    default_name = cmafec_preset_get_descr(index);
-  } else {
-    default_name = _("new preset");
-  }
-
-  pdialog->name_shell = input_dialog_create(GTK_WINDOW(parent),
-                                    _("Name new preset"),
-                                    _("What should we name the preset?"),
-                                    default_name,
-                                    cma_preset_add_popup_callback, pdialog);
-}
-
-/**********************************************************************//**
-  Callback for the add_preset popup
-**************************************************************************/
-static void cma_preset_add_popup_callback(gpointer data, gint response,
-                                          const char *input)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-
-  if (pdialog) {
-    if (response == GTK_RESPONSE_OK) {
-      struct cm_parameter param;
-
-      cmafec_get_fe_parameter(pdialog->pcity, &param);
-      cmafec_preset_add(input, &param);
-      update_cma_preset_list(pdialog);
-      refresh_cma_dialog(pdialog->pcity, DONT_REFRESH_HSCALES);
-      /* If this or other cities have this set as "custom" */
-      city_report_dialog_update();
-    } /* else CANCEL or DELETE_EVENT */
-
-    pdialog->name_shell = NULL;
-  }
-}
-
-/**********************************************************************//**
-  Key pressed in preset list
-**************************************************************************/
-static gboolean cma_preset_key_pressed(GtkEventControllerKey *controller,
-                                       guint keyval, guint keycode,
-                                       GdkModifierType state, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-  int index;
-
-  if ((index = gtk_single_selection_get_selected(pdialog->selection)) < 0) {
-    return FALSE;
-  }
-
-  switch (keyval) {
-  case GDK_KEY_Delete:
-    cma_preset_remove(pdialog, index);
-    break;
-  case GDK_KEY_Insert:
-    cma_add_preset_callback(NULL, pdialog);
-    break;
-  default:
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Callback for del_preset
-**************************************************************************/
-static void cma_del_preset_callback(GtkWidget *w, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-  int index;
-
-  if ((index = gtk_single_selection_get_selected(pdialog->selection)) < 0) {
-    return;
-  }
-
-  cma_preset_remove(pdialog, index);
-}
-
-/**********************************************************************//**
-  Pops up a dialog to remove a preset
-**************************************************************************/
-static void cma_preset_remove(struct cma_dialog *pdialog, int preset_index)
-{
-  GtkWidget *parent = gtk_widget_get_ancestor(pdialog->shell, GTK_TYPE_WINDOW);
-  GtkWidget *shl;
-
-  pdialog->id = preset_index;
-  shl = gtk_message_dialog_new(NULL,
-                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                               GTK_MESSAGE_QUESTION,
-                               GTK_BUTTONS_YES_NO,
-                               _("Remove this preset?"));
-  setup_dialog(shl, parent);
-  pdialog->preset_remove_shell = shl;
-
-  gtk_window_set_title(GTK_WINDOW(shl), cmafec_preset_get_descr(preset_index));
-
-  g_signal_connect(shl, "response",
-                   G_CALLBACK(cma_preset_remove_response), pdialog);
-
-  gtk_window_present(GTK_WINDOW(shl));
-}
-
-/**********************************************************************//**
-  Callback for the remove_preset popup
-**************************************************************************/
-static void cma_preset_remove_response(GtkWidget *w, gint response,
-                                       gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-
-  if (response == GTK_RESPONSE_YES) {
-    cmafec_preset_remove(pdialog->id);
-    pdialog->id = -1;
-    update_cma_preset_list(pdialog);
-    refresh_cma_dialog(pdialog->pcity, DONT_REFRESH_HSCALES);
-    /* if this or other cities have this set, reset to "custom" */
-    city_report_dialog_update();
-  }
-  gtk_window_destroy(GTK_WINDOW(w));
-
-  pdialog->preset_remove_shell = NULL;
-}
-
-/**********************************************************************//**
-  Activates/deactivates agent control.
-**************************************************************************/
-static void cma_active_callback(GtkWidget *w, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-
-  if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-    cma_release_city(pdialog->pcity);
-  } else {
-    struct cm_parameter param;
-
-    cmafec_get_fe_parameter(pdialog->pcity, &param);
-    cma_put_city_under_agent(pdialog->pcity, &param);
-  }
-  refresh_city_dialog(pdialog->pcity);
-}
-
-/**********************************************************************//**
-  Called to adjust the sliders when a preset is selected
-  notice that we don't want to call update_result here.
-**************************************************************************/
-static void set_hscales(const struct cm_parameter *const parameter,
-                        struct cma_dialog *pdialog)
-{
-  allow_refreshes = 0;
-  output_type_iterate(i) {
-    gtk_range_set_value(GTK_RANGE(pdialog->minimal_surplus[i]),
-                        parameter->minimal_surplus[i]);
-    gtk_range_set_value(GTK_RANGE(pdialog->factor[i]), parameter->factor[i]);
-  } output_type_iterate_end;
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(pdialog->happy_button),
-                              parameter->require_happy);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(pdialog->growth_button),
-                              parameter->max_growth);
-  gtk_range_set_value(GTK_RANGE(pdialog->factor[O_LAST]),
-                      parameter->happy_factor);
-  allow_refreshes = 1;
-}
-
-/**********************************************************************//**
-  Callback if we moved the sliders.
-**************************************************************************/
-static void hscale_changed(GtkWidget *get, gpointer data)
-{
-  struct cma_dialog *pdialog = (struct cma_dialog *) data;
-  struct cm_parameter param;
-
-  if (!allow_refreshes) {
-    return;
-  }
-
-  cmafec_get_fe_parameter(pdialog->pcity, &param);
-  output_type_iterate(i) {
-    param.minimal_surplus[i] =
-        (int) (gtk_range_get_value(GTK_RANGE(pdialog->minimal_surplus[i])));
-    param.factor[i] =
-        (int) (gtk_range_get_value(GTK_RANGE(pdialog->factor[i])));
-  } output_type_iterate_end;
-  param.require_happy =
-      (gtk_check_button_get_active(GTK_CHECK_BUTTON(pdialog->happy_button)) ? TRUE : FALSE);
-  param.max_growth =
-      (gtk_check_button_get_active(GTK_CHECK_BUTTON(pdialog->growth_button)) ? TRUE : FALSE);
-  param.happy_factor =
-      (int) (gtk_range_get_value(GTK_RANGE(pdialog->factor[O_LAST])));
-
-  /* Save the change */
-  cmafec_set_fe_parameter(pdialog->pcity, &param);
-
-  /* Refreshes the cma */
-  if (cma_is_city_under_agent(pdialog->pcity, NULL)) {
-    cma_release_city(pdialog->pcity);
-    cma_put_city_under_agent(pdialog->pcity, &param);
-    refresh_city_dialog(pdialog->pcity);
-  } else {
-    refresh_cma_dialog(pdialog->pcity, DONT_REFRESH_HSCALES);
-  }
-}
diff --git a/client/gui-gtk-5.0/cma_fe.h b/client/gui-gtk-5.0/cma_fe.h
deleted file mode 100644
index 98195a14de..0000000000
--- a/client/gui-gtk-5.0/cma_fe.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2001 - R. Falke
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifndef FC__GTK_CMA_H
-#define FC__GTK_CMA_H
-
-#include <gtk/gtk.h>
-
-/* common */
-#include "fc_types.h"
-
-/* client/agents */
-#include "cma_core.h"
-
-enum cma_refresh {
-  REFRESH_ALL,
-  DONT_REFRESH_SELECT,
-  DONT_REFRESH_HSCALES
-};
-
-struct cma_dialog {
-  struct city *pcity;
-  GtkWidget *shell;
-  GtkWidget *name_shell;
-  GtkWidget *preset_remove_shell;
-  GtkWidget *preset_list;
-  GtkWidget *result_label;
-  GtkWidget *add_preset_command;
-  GtkWidget *del_preset_command;
-  GtkWidget *active_command;
-  GtkWidget *minimal_surplus[O_LAST];
-  GtkWidget *happy_button;
-  GtkWidget *growth_button;
-  GtkWidget *factor[O_LAST + 1];
-  GtkSingleSelection *selection;
-  GListStore *store;
-  int id;                       /* Needed to pass a preset_index */
-};
-
-void cma_fe_init(void);
-void cma_fe_done(void);
-struct cma_dialog *create_cma_dialog(struct city *pcity, bool tiny);
-void close_cma_dialog(struct city *pcity);
-void refresh_cma_dialog(struct city *pcity, enum cma_refresh refresh);
-
-#endif /* FC__GTK_CMA_H */
diff --git a/client/gui-gtk-5.0/colors.c b/client/gui-gtk-5.0/colors.c
deleted file mode 100644
index 5f2cfbfdf6..0000000000
--- a/client/gui-gtk-5.0/colors.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "log.h"
-#include "mem.h"
-
-/* common */
-#include "rgbcolor.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-
-#include "colors.h"
-
-/************************************************************************//**
-  Allocate a color (well, sort of)
-  and return a pointer to it.
-****************************************************************************/
-struct color *color_alloc(int r, int g, int b)
-{
-  struct color *color = fc_malloc(sizeof(*color));
-
-  color->color.red = (double)r/255;
-  color->color.green = (double)g/255;
-  color->color.blue = (double)b/255;
-  color->color.alpha = 1.0;
-
-  return color;
-}
-
-/************************************************************************//**
-  Free a previously allocated color.  See color_alloc().
-****************************************************************************/
-void color_free(struct color *color)
-{
-  free(color);
-}
-
-/************************************************************************//**
-  Return a number indicating the perceptual brightness of this color
-  relative to others (larger is brighter).
-****************************************************************************/
-int color_brightness_score(struct color *pcolor)
-{
-  struct rgbcolor *prgb = rgbcolor_new(pcolor->color.red * 255,
-                                       pcolor->color.green * 255,
-                                       pcolor->color.blue * 255);
-  int score = rgbcolor_brightness_score(prgb);
-
-  rgbcolor_destroy(prgb);
-  return score;
-}
diff --git a/client/gui-gtk-5.0/colors.h b/client/gui-gtk-5.0/colors.h
deleted file mode 100644
index 4007610860..0000000000
--- a/client/gui-gtk-5.0/colors.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__COLORS_H
-#define FC__COLORS_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "colors_g.h"
-
-struct color {
-  GdkRGBA color;
-};
-
-#endif /* FC__COLORS_H */
diff --git a/client/gui-gtk-5.0/connectdlg.c b/client/gui-gtk-5.0/connectdlg.c
deleted file mode 100644
index f9be85d749..0000000000
--- a/client/gui-gtk-5.0/connectdlg.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "support.h"
-
-/* common */
-#include "packets.h"
-#include "version.h"
-
-/* client */
-#include "client_main.h"
-#include "connectdlg_common.h"
-#include "options.h"
-#include "packhand.h"
-#include "tilespec.h"
-
-/* gui-gtk-5.0 */
-#include "chatline.h"
-#include "colors.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "connectdlg.h"
-
-
-/**********************************************************************//**
-  Close and destroy the dialog.
-**************************************************************************/
-void close_connection_dialog(void)
-{
-}
-
-/**********************************************************************//**
-  Gtk client does nothing here. This gets called when one is rejected
-  from game.
-**************************************************************************/
-void server_connect(void)
-{
-}
diff --git a/client/gui-gtk-5.0/connectdlg.h b/client/gui-gtk-5.0/connectdlg.h
deleted file mode 100644
index f218996828..0000000000
--- a/client/gui-gtk-5.0/connectdlg.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__CONNECTDLG_H
-#define FC__CONNECTDLG_H
-
-/* client */
-#include "connectdlg_g.h"
-
-#endif  /* FC__CONNECTDLG_H */
diff --git a/client/gui-gtk-5.0/dialogs.c b/client/gui-gtk-5.0/dialogs.c
deleted file mode 100644
index 3a7c960642..0000000000
--- a/client/gui-gtk-5.0/dialogs.c
+++ /dev/null
@@ -1,1696 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "astring.h"
-#include "bitvector.h"
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "rand.h"
-#include "support.h"
-
-/* common */
-#include "game.h"
-#include "government.h"
-#include "map.h"
-#include "packets.h"
-#include "player.h"
-#include "sex.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "connectdlg_common.h"
-#include "control.h"
-#include "helpdata.h"  /* for helptext_nation() */
-#include "goto.h"
-#include "options.h"
-#include "packhand.h"
-#include "text.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "choice_dialog.h"
-#include "citydlg.h"
-#include "editprop.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-#include "plrdlg.h"
-#include "wldlg.h"
-#include "unitselect.h"
-#include "unitselextradlg.h"
-
-#include "dialogs.h"
-
-/******************************************************************/
-static GtkWidget  *races_shell;
-static GtkWidget  *nationsets_chooser;
-struct player *races_player;
-/* One entry per nation group, plus one at the end for 'all nations' */
-static GtkWidget  *races_nation_list[MAX_NUM_NATION_GROUPS + 1];
-static GtkWidget  *races_notebook;
-static GtkWidget  *races_properties;
-static GtkWidget  *races_leader;
-static GtkWidget  *races_sex[2];
-static GtkWidget  *races_style_list;
-static GtkTextBuffer *races_text;
-
-static void create_races_dialog(struct player *pplayer);
-static void races_response(GtkWidget *w, gint response, gpointer data);
-static void races_nation_callback(GtkTreeSelection *select, gpointer data);
-static void races_leader_callback(void);
-static void races_sex_callback(GtkWidget *w, gpointer data);
-static void races_style_callback(GtkTreeSelection *select, gpointer data);
-static gboolean races_selection_func(GtkTreeSelection *select,
-                                     GtkTreeModel *model, GtkTreePath *path,
-                                     gboolean selected, gpointer data);
-
-static int selected_nation;
-static int selected_sex;
-static int selected_style;
-
-static int is_showing_pillage_dialog = FALSE;
-
-/**********************************************************************//**
-  Popup a generic dialog to display some generic information.
-**************************************************************************/
-void popup_notify_dialog(const char *caption, const char *headline,
-                         const char *lines)
-{
-  static struct gui_dialog *shell;
-  GtkWidget *vgrid, *label, *headline_label, *sw;
-  int grid_row = 0;
-
-  gui_dialog_new(&shell, GTK_NOTEBOOK(bottom_notebook), NULL, TRUE);
-  gui_dialog_set_title(shell, caption);
-
-  gui_dialog_add_button(shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 2);
-  gui_dialog_add_content_widget(shell, vgrid);
-
-  headline_label = gtk_label_new(headline);
-  gtk_grid_attach(GTK_GRID(vgrid), headline_label, 0, grid_row++, 1, 1);
-  gtk_widget_set_name(headline_label, "notify_label");
-
-  gtk_label_set_justify(GTK_LABEL(headline_label), GTK_JUSTIFY_LEFT);
-  gtk_widget_set_halign(headline_label, GTK_ALIGN_START);
-  gtk_widget_set_valign(headline_label, GTK_ALIGN_START);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  label = gtk_label_new(lines);
-  gtk_widget_set_hexpand(label, TRUE);
-  gtk_widget_set_vexpand(label, TRUE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), label);
-
-  gtk_widget_set_name(label, "notify_label");
-  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_START);
-
-  gtk_grid_attach(GTK_GRID(vgrid), sw, 0, grid_row++, 1, 1);
-
-  gui_dialog_show_all(shell);
-
-  gui_dialog_set_default_size(shell, -1, 265);
-  gui_dialog_present(shell);
-
-  shell = NULL;
-}
-
-/**********************************************************************//**
-  User has responded to notify dialog with possibility to
-  center (goto) on event location.
-**************************************************************************/
-static void notify_goto_response(GtkWidget *w, gint response)
-{
-  struct city *pcity = NULL;
-  struct tile *ptile = g_object_get_data(G_OBJECT(w), "tile");
-
-  switch (response) {
-  case 1:
-    center_tile_mapcanvas(ptile);
-    break;
-  case 2:
-    pcity = tile_city(ptile);
-
-    if (gui_options.center_when_popup_city) {
-      center_tile_mapcanvas(ptile);
-    }
-
-    if (pcity) {
-      popup_city_dialog(pcity);
-    }
-    break;
-  }
-
-  gtk_window_destroy(GTK_WINDOW(w));
-}
-
-/**********************************************************************//**
-  User clicked close for connect message dialog
-**************************************************************************/
-static void notify_connect_msg_response(GtkWidget *w, gint response)
-{
-  gtk_window_destroy(GTK_WINDOW(w));
-}
-
-/**********************************************************************//**
-  Popup a dialog to display information about an event that has a
-  specific location. The user should be given the option to goto that
-  location.
-**************************************************************************/
-void popup_notify_goto_dialog(const char *headline, const char *lines,
-                              const struct text_tag_list *tags,
-                              struct tile *ptile)
-{
-  GtkWidget *shell, *label;
-
-  if (ptile == NULL) {
-    shell = gtk_dialog_new_with_buttons(headline, NULL, 0,
-                                        _("_Close"), GTK_RESPONSE_CLOSE,
-                                        NULL);
-  } else {
-    struct city *pcity = tile_city(ptile);
-
-    if (pcity != NULL && city_owner(pcity) == client.conn.playing) {
-      shell = gtk_dialog_new_with_buttons(headline, NULL, 0,
-                                          _("Goto _Location"), 1,
-                                          _("I_nspect City"), 2,
-                                          _("_Close"), GTK_RESPONSE_CLOSE,
-                                          NULL);
-    } else {
-      shell = gtk_dialog_new_with_buttons(headline, NULL, 0,
-                                          _("Goto _Location"), 1,
-                                          _("_Close"), GTK_RESPONSE_CLOSE,
-                                          NULL);
-    }
-  }
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
-
-  label = gtk_label_new(lines);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
-                 label);
-  gtk_widget_set_visible(label, TRUE);
-
-  g_object_set_data(G_OBJECT(shell), "tile", ptile);
-
-  g_signal_connect(shell, "response", G_CALLBACK(notify_goto_response), NULL);
-  gtk_widget_set_visible(shell, TRUE);
-}
-
-/**********************************************************************//**
-  Popup a dialog to display connection message from server.
-**************************************************************************/
-void popup_connect_msg(const char *headline, const char *message)
-{
-  GtkWidget *shell, *label;
-
-  shell = gtk_dialog_new();
-  gtk_window_set_title(GTK_WINDOW(shell), headline);
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
-
-  label = gtk_label_new(message);
-  gtk_label_set_selectable(GTK_LABEL(label), 1);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
-                 label);
-  gtk_widget_set_visible(label, TRUE);
-
-  gtk_dialog_add_button(GTK_DIALOG(shell), _("_Close"),GTK_RESPONSE_CLOSE);
-
-  g_signal_connect(shell, "response", G_CALLBACK(notify_connect_msg_response),
-                   nullptr);
-  gtk_widget_set_visible(shell, TRUE);
-}
-
-/**********************************************************************//**
-  User has responded to revolution dialog
-**************************************************************************/
-static void revolution_response(GtkWidget *w, gint response, gpointer data)
-{
-  struct government *government = data;
-
-  if (response == GTK_RESPONSE_YES) {
-    if (!government) {
-      start_revolution();
-    } else {
-      set_government_choice(government);
-    }
-  }
-  if (w) {
-    gtk_window_destroy(GTK_WINDOW(w));
-  }
-}
-
-/**********************************************************************//**
-  Popup revolution dialog for user
-**************************************************************************/
-void popup_revolution_dialog(struct government *government)
-{
-  static GtkWidget *shell = NULL;
-
-  if (0 > client.conn.playing->revolution_finishes) {
-    if (!shell) {
-      shell = gtk_message_dialog_new(NULL,
-                                     0,
-                                     GTK_MESSAGE_WARNING,
-                                     GTK_BUTTONS_YES_NO,
-                                     _("You say you wanna revolution?"));
-      gtk_window_set_title(GTK_WINDOW(shell), _("Revolution!"));
-      setup_dialog(shell, toplevel);
-
-      g_signal_connect(shell, "destroy",
-                       G_CALLBACK(widget_destroyed), &shell);
-    }
-    g_signal_connect(shell, "response",
-                     G_CALLBACK(revolution_response), government);
-
-    gtk_window_present(GTK_WINDOW(shell));
-  } else {
-    revolution_response(shell, GTK_RESPONSE_YES, government);
-  }
-}
-
-/**********************************************************************//**
-  Callback for pillage dialog.
-**************************************************************************/
-static void pillage_callback(GtkWidget *dlg, gint arg)
-{
-  is_showing_pillage_dialog = FALSE;
-
-  if (arg == GTK_RESPONSE_YES) {
-    int au_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
-                                                  "actor"));
-    struct unit *actor = game_unit_by_number(au_id);
-
-    int tgt_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
-                                                   "target"));
-    struct extra_type *tgt_extra = extra_by_number(tgt_id);
-
-    if (actor && tgt_extra) {
-      request_new_unit_activity_targeted(actor, ACTIVITY_PILLAGE,
-                                         tgt_extra);
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/**********************************************************************//**
-  Opens pillage dialog listing possible pillage targets.
-**************************************************************************/
-void popup_pillage_dialog(struct unit *punit, bv_extras extras)
-{
-  if (!is_showing_pillage_dialog) {
-    /* Possibly legal target extras. */
-    bv_extras alternative;
-    /* Selected by default. */
-    struct extra_type *preferred_tgt;
-    /* Current target to check. */
-    struct extra_type *tgt;
-
-    is_showing_pillage_dialog = TRUE;
-
-    BV_CLR_ALL(alternative);
-    preferred_tgt = get_preferred_pillage(extras);
-
-    while ((tgt = get_preferred_pillage(extras))) {
-      int what;
-
-      what = extra_index(tgt);
-      BV_CLR(extras, what);
-      BV_SET(alternative, what);
-    }
-
-    select_tgt_extra(punit, unit_tile(punit), alternative, preferred_tgt,
-                     /* TRANS: Pillage dialog title. */
-                     _("What To Pillage"),
-                     /* TRANS: Pillage dialog actor text. */
-                     _("Looking for target extra:"),
-                     /* TRANS: Pillage dialog target text. */
-                     _("Select what to pillage:"),
-                     /* TRANS: Pillage dialog do button text. */
-                     _("Pillage"), G_CALLBACK(pillage_callback));
-  }
-}
-
-/**********************************************************************//**
-  Popup unit selection dialog. It is a wrapper for the main function; see
-  unitselect.c:unit_select_dialog_popup_main().
-**************************************************************************/
-void unit_select_dialog_popup(struct tile *ptile)
-{
-  unit_select_dialog_popup_main(ptile, TRUE);
-}
-
-/**********************************************************************//**
-  Update unit selection dialog. It is a wrapper for the main function; see
-  unitselect.c:unit_select_dialog_popup_main().
-**************************************************************************/
-void unit_select_dialog_update_real(void *unused)
-{
-  unit_select_dialog_popup_main(NULL, FALSE);
-}
-
-/**************************************************************************
-  NATION SELECTION DIALOG
-**************************************************************************/
-/**********************************************************************//**
-  Return the GtkTreePath for a given nation on the specified list, or NULL
-  if it's not there at all.
-  Caller must free with gtk_tree_path_free().
-**************************************************************************/
-static GtkTreePath *path_to_nation_on_list(Nation_type_id nation,
-                                           GtkTreeView *list)
-{
-  if (nation == -1 || list == NULL) {
-    return NULL;
-  } else {
-    GtkTreeModel *model = gtk_tree_view_get_model(list);
-    GtkTreeIter iter;
-    GtkTreePath *path = NULL;
-
-    gtk_tree_model_get_iter_first(model, &iter);
-    do {
-      int nation_of_row;
-
-      gtk_tree_model_get(model, &iter, 0, &nation_of_row, -1);
-      if (nation == nation_of_row) {
-        path = gtk_tree_model_get_path(model, &iter);
-        break;
-      }
-    } while (gtk_tree_model_iter_next(model, &iter));
-
-    return path;
-  }
-}
-
-/**********************************************************************//**
-  Make sure the given nation is selected in the list on a given groups
-  notebook tab, if it's present on that tab.
-  Intended for synchronising the tabs to the current selection, so does not
-  disturb the controls on the right-hand side.
-**************************************************************************/
-static void select_nation_on_tab(GtkWidget *tab_list, int nation)
-{
-  /* tab_list is a GtkTreeView (not its enclosing GtkScrolledWindow). */
-  GtkTreeView *list = GTK_TREE_VIEW(tab_list);
-  GtkTreeSelection *select = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
-  GtkTreePath *path = path_to_nation_on_list(nation, list);
-
-  /* Suppress normal effects of selection change to avoid loops. */
-  g_signal_handlers_block_by_func(select, races_nation_callback, NULL);
-  if (path) {
-    /* Found nation on this list. */
-    /* Avoid disturbing tabs that already have the correct selection. */
-    if (!gtk_tree_selection_path_is_selected(select, path)) {
-      /* Set cursor -- this will cause the nation to be selected */
-      gtk_tree_view_set_cursor(list, path, NULL, FALSE);
-      /* Make sure selected nation is visible in list */
-      gtk_tree_view_scroll_to_cell(list, path, NULL, FALSE, 0, 0);
-    }
-  } else {
-    /* Either no nation was selected, or the nation is not mentioned in
-     * this tab. Either way we want to end up with no selection. */
-    GtkTreePath *cursorpath;
-
-    /* If there is no cursor, Gtk tends to focus and select the first row
-     * at the first opportunity, disturbing any existing state. We want to
-     * allow the no-rows-selected state, so detect this case and defuse
-     * it by setting a cursor. */
-    gtk_tree_view_get_cursor(list, &cursorpath, NULL);
-    /* Set the cursor in the case above, or if there was a previous
-     * selection */
-    if (!cursorpath || gtk_tree_selection_get_selected(select, NULL, NULL)) {
-      cursorpath = gtk_tree_path_new_first();
-      gtk_tree_view_set_cursor(list, cursorpath, NULL, FALSE);
-    }
-    gtk_tree_selection_unselect_all(select);
-    gtk_tree_path_free(cursorpath);
-  }
-  gtk_tree_path_free(path);
-  /* Re-enable selection change side-effects */
-  g_signal_handlers_unblock_by_func(select, races_nation_callback, NULL);
-}
-
-/**********************************************************************//**
-  Select the given nation in the nation lists in the left-hand-side notebook.
-**************************************************************************/
-static void sync_tabs_to_nation(int nation)
-{
-  /* Ensure that all tabs are in sync with the new selection */
-  int i;
-
-  for (i = 0; i <= nation_group_count(); i++) {
-    if (races_nation_list[i]) {
-      select_nation_on_tab(races_nation_list[i], nation);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Populates leader list.
-  If no nation selected, blanks it.
-**************************************************************************/
-static void populate_leader_list(void)
-{
-  int i;
-  GtkListStore *model =
-      GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(races_leader)));
-
-  i = 0;
-  gtk_list_store_clear(model);
-  if (selected_nation >= 0) {
-    nation_leader_list_iterate(nation_leaders(nation_by_number
-                                              (selected_nation)), pleader) {
-      const char *leader_name = nation_leader_name(pleader);
-      GtkTreeIter iter; /* unused */
-
-      gtk_list_store_insert_with_values(model, &iter, i, 0, leader_name, -1);
-      i++;
-    } nation_leader_list_iterate_end;
-  }
-}
-
-/**********************************************************************//**
-  Update dialog state by selecting a nation and choosing values for its
-  parameters, and update the right-hand side of the dialog accordingly.
-  If 'leadername' is NULL, pick a random leader name and sex from the
-  nation's list (ignoring the 'is_male' parameter).
-**************************************************************************/
-static void select_nation(int nation,
-                          const char *leadername, bool is_male,
-                          int style_id)
-{
-  GtkEntryBuffer *buffer = gtk_entry_get_buffer(GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(races_leader))));
-
-  selected_nation = nation;
-
-  /* Refresh the available leaders. */
-  populate_leader_list();
-
-  if (selected_nation != -1) {
-
-    /* Select leader name and sex. */
-    if (leadername) {
-      gtk_entry_buffer_set_text(buffer, leadername, -1);
-      /* Assume is_male is valid too. */
-      gtk_check_button_set_active(GTK_CHECK_BUTTON(races_sex[is_male]),
-                                  TRUE);
-    } else {
-      int idx = fc_rand(nation_leader_list_size(
-                        nation_leaders(nation_by_number(selected_nation))));
-
-      gtk_combo_box_set_active(GTK_COMBO_BOX(races_leader), idx);
-      /* This also updates the leader sex, eventually. */
-    }
-
-    /* Select the appropriate city style entry. */
-    {
-      int i;
-      int j = 0;
-      GtkTreePath *path;
-
-      styles_iterate(pstyle) {
-        i = basic_city_style_for_style(pstyle);
-
-        if (i >= 0 && i < style_id) {
-          j++;
-        } else {
-          break;
-        }
-      } styles_iterate_end;
-
-      path = gtk_tree_path_new();
-      gtk_tree_path_append_index(path, j);
-      gtk_tree_view_set_cursor(GTK_TREE_VIEW(races_style_list), path,
-                               NULL, FALSE);
-      gtk_tree_path_free(path);
-    }
-
-    /* Update nation description. */
-    {
-      char buf[4096];
-
-      helptext_nation(buf, sizeof(buf),
-                      nation_by_number(selected_nation), NULL);
-      gtk_text_buffer_set_text(races_text, buf, -1);
-    }
-
-    gtk_widget_set_sensitive(races_properties, TRUE);
-    /* Once we've made a nation selection, allow user to ok */
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(races_shell),
-                                      GTK_RESPONSE_ACCEPT, TRUE);
-  } else {
-    /* No nation selected. Blank properties and make controls insensitive. */
-    /* Leader name */
-    gtk_entry_buffer_set_text(buffer, "", -1);
-    /* Leader sex (*shrug*) */
-    gtk_check_button_set_active(GTK_CHECK_BUTTON(races_sex[0]), TRUE);
-    /* City style */
-    {
-      GtkTreeSelection *select
-        = gtk_tree_view_get_selection(GTK_TREE_VIEW(races_style_list));
-
-      gtk_tree_selection_unselect_all(select);
-    }
-    /* Nation description */
-    gtk_text_buffer_set_text(races_text, "", 0);
-
-    gtk_widget_set_sensitive(races_properties, FALSE);
-    /* Don't allow OK without a selection
-     * (user can still do "Random Nation") */
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(races_shell),
-                                      GTK_RESPONSE_ACCEPT, FALSE);
-  }
-
-  /* Update notebook to reflect the current selection */
-  sync_tabs_to_nation(selected_nation);
-}
-
-/**********************************************************************//**
-  Creates a list of currently-pickable nations in the given group
-  Inserts appropriate gtk_tree_view into races_nation_list[index] (or NULL if
-  the group has no nations)
-  If group == NULL, create a list of all nations
-**************************************************************************/
-static GtkWidget *create_list_of_nations_in_group(struct nation_group *group,
-                                                  int index)
-{
-  GtkWidget *sw = NULL;
-  GtkListStore *store = NULL;
-  GtkWidget *list = NULL;
-
-  /* Populate nation list store. */
-  nations_iterate(pnation) {
-    bool used;
-    GdkPixbuf *img;
-    GtkTreeIter it;
-    GValue value = { 0, };
-
-    if (!is_nation_playable(pnation) || !is_nation_pickable(pnation)) {
-      continue;
-    }
-
-    if (NULL != group && !nation_is_in_group(pnation, group)) {
-      continue;
-    }
-
-    /* Only create tab on demand -- we don't want it if there aren't any
-     * currently pickable nations in this group. */
-    if (sw == NULL) {
-      GtkTreeSelection *select;
-      GtkCellRenderer *render;
-      GtkTreeViewColumn *column;
-
-      store = gtk_list_store_new(4, G_TYPE_INT, G_TYPE_BOOLEAN,
-          GDK_TYPE_PIXBUF, G_TYPE_STRING);
-      gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
-          3, GTK_SORT_ASCENDING);
-
-      list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-      gtk_widget_set_hexpand(list, TRUE);
-      gtk_widget_set_vexpand(list, TRUE);
-      gtk_tree_view_set_search_column(GTK_TREE_VIEW(list), 3);
-      gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE);
-      g_object_unref(store);
-
-      select = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
-      g_signal_connect(select, "changed", G_CALLBACK(races_nation_callback),
-                       NULL);
-      gtk_tree_selection_set_select_function(select, races_selection_func,
-          NULL, NULL);
-
-      sw = gtk_scrolled_window_new();
-      gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-      gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-          GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-      gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), list);
-
-      render = gtk_cell_renderer_pixbuf_new();
-      column = gtk_tree_view_column_new_with_attributes("Flag", render,
-          "pixbuf", 2, NULL);
-      gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
-      render = gtk_cell_renderer_text_new();
-      column = gtk_tree_view_column_new_with_attributes("Nation", render,
-          "text", 3, "strikethrough", 1, NULL);
-      gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
-    }
-
-    gtk_list_store_append(store, &it);
-
-    used = (pnation->player != NULL && pnation->player != races_player);
-    gtk_list_store_set(store, &it, 0, nation_number(pnation), 1, used, -1);
-    img = get_flag(pnation);
-    if (img != NULL) {
-      gtk_list_store_set(store, &it, 2, img, -1);
-      g_object_unref(img);
-    }
-
-    g_value_init(&value, G_TYPE_STRING);
-    g_value_set_static_string(&value, nation_adjective_translation(pnation));
-    gtk_list_store_set_value(store, &it, 3, &value);
-    g_value_unset(&value);
-  } nations_iterate_end;
-
-  races_nation_list[index] = list;
-  return sw;
-}
-
-/**********************************************************************//**
-  Creates lists of nations for left side of nation selection dialog
-**************************************************************************/
-static void create_nation_selection_lists(void)
-{
-  GtkWidget *nation_list;
-  GtkWidget *group_name_label;
-  int i;
-
-  for (i = 0; i < nation_group_count(); i++) {
-    struct nation_group *group = (nation_group_by_number(i));
-
-    if (is_nation_group_hidden(group)) {
-      races_nation_list[i] = NULL;
-      continue;
-    }
-    nation_list = create_list_of_nations_in_group(group, i);
-    if (nation_list) {
-      group_name_label = gtk_label_new(nation_group_name_translation(group));
-      gtk_notebook_append_page(GTK_NOTEBOOK(races_notebook), nation_list,
-                               group_name_label);
-    }
-  }
-
-  nation_list = create_list_of_nations_in_group(NULL, nation_group_count());
-  /* Even this list can be empty if there are no pickable nations (due to
-   * a combination of start position and nationset restrictions). */
-  if (nation_list) {
-    group_name_label = gtk_label_new(_("All"));
-    gtk_notebook_append_page(GTK_NOTEBOOK(races_notebook), nation_list,
-                             group_name_label);
-  }
-}
-
-/**********************************************************************//**
-  The server has changed the set of selectable nations.
-  Update any current nations dialog accordingly.
-**************************************************************************/
-void races_update_pickable(bool nationset_change)
-{
-  int tab, groupidx;
-
-  if (!races_shell) {
-    return;
-  }
-
-  /* Save selected tab */
-  tab = gtk_notebook_get_current_page(GTK_NOTEBOOK(races_notebook));
-  if (tab != -1) {
-    int i = 0;
-
-    groupidx = 0;
-    /* Turn tab index into a nation group index (they're not always equal,
-     * as some groups may not currently have tabs). */
-    do {
-      while (groupidx <= nation_group_count()
-             && races_nation_list[groupidx] == NULL) {
-        groupidx++;
-      }
-      fc_assert_action(groupidx <= nation_group_count(), break);
-      /* Nation group 'groupidx' is what's displayed on the i'th tab */
-      if (i == tab) {
-        break;
-      }
-      i++;
-      groupidx++;
-    } while (TRUE);
-  } else {
-    /* No tabs currently */
-    groupidx = -1;
-  }
-
-  /* selected_nation already contains currently selected nation; however,
-   * it may no longer be a valid choice */
-  if (selected_nation != -1
-      && !is_nation_pickable(nation_by_number(selected_nation))) {
-    select_nation(-1, NULL, FALSE, 0);
-  }
-
-  /* Delete all list stores, treeviews, tabs */
-  while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(races_notebook)) > 0) {
-    gtk_notebook_remove_page(GTK_NOTEBOOK(races_notebook), -1);
-  }
-
-  /* (Re)create all of them */
-  create_nation_selection_lists();
-
-  /* Can't set current tab before child widget is visible */
-  gtk_widget_set_visible(GTK_WIDGET(races_notebook), TRUE);
-
-  /* Restore selected tab */
-  if (groupidx != -1 && races_nation_list[groupidx] != nullptr) {
-    int i;
-
-    tab = 0;
-    for (i = 0; i < groupidx; i++) {
-      if (races_nation_list[i] != NULL) {
-        tab++;
-      }
-    }
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(races_notebook), tab);
-  }
-
-  /* Restore selected nation */
-  sync_tabs_to_nation(selected_nation);
-}
-
-/**********************************************************************//**
-  Sync nationset control with the current state of the server.
-**************************************************************************/
-void nationset_sync_to_server(const char *nationset)
-{
-  if (nationsets_chooser) {
-    struct nation_set *set = nation_set_by_setting_value(nationset);
-
-    gtk_combo_box_set_active(GTK_COMBO_BOX(nationsets_chooser),
-                             nation_set_index(set));
-  }
-}
-
-/**********************************************************************//**
-  Called when the nationset control's value has changed.
-**************************************************************************/
-static void nationset_callback(GtkComboBox *b, gpointer data)
-{
-  GtkTreeIter iter;
-
-  if (gtk_combo_box_get_active_iter(b, &iter)) {
-    struct option *poption = optset_option_by_name(server_optset, "nationset");
-    gchar *rule_name;
-
-    gtk_tree_model_get(gtk_combo_box_get_model(b), &iter,
-                       0, &rule_name, -1);
-    /* Suppress propagation of an option value equivalent to the current
-     * server state, after canonicalisation, to avoid loops from
-     * nationset_sync_to_server().
-     * (HACK: relies on local Gtk "changed" signal getting here before
-     * server response.) */
-    if (nation_set_by_setting_value(option_str_get(poption))
-        != nation_set_by_rule_name(rule_name)) {
-      option_str_set(poption, rule_name);
-    }
-    FC_FREE(rule_name);
-  }
-}
-
-/**********************************************************************//**
-  Create nations dialog
-**************************************************************************/
-static void create_races_dialog(struct player *pplayer)
-{
-  GtkWidget *shell;
-  GtkWidget *cmd;
-  GtkWidget *group;
-  GtkWidget *hbox, *table;
-  GtkWidget *frame, *label, *combo;
-  GtkWidget *text;
-  GtkWidget *notebook;
-  GtkWidget *sw;
-  GtkWidget *list;
-  GtkListStore *store;
-  GtkCellRenderer *render;
-  GtkTreeViewColumn *column;
-  int i;
-  char *title;
-
-  /* Init. */
-  selected_nation = -1;
-
-  if (C_S_RUNNING == client_state()) {
-    title = _("Edit Nation");
-  } else if (NULL != pplayer && pplayer == client.conn.playing) {
-    title = _("What Nation Will You Be?");
-  } else {
-    title = _("Pick Nation");
-  }
-
-  shell = gtk_dialog_new_with_buttons(title,
-                                      NULL,
-                                      0,
-                                      _("_Cancel"),
-                                      GTK_RESPONSE_CANCEL,
-                                      _("_Random Nation"),
-                                      GTK_RESPONSE_NO, /* Arbitrary */
-                                      _("_OK"),
-                                      GTK_RESPONSE_ACCEPT,
-                                      NULL);
-  races_shell = shell;
-  races_player = pplayer;
-  setup_dialog(shell, toplevel);
-
-  gtk_window_set_default_size(GTK_WINDOW(shell), -1, 590);
-
-  frame = gtk_frame_new(_("Select a nation"));
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))), frame);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 18);
-  gtk_widget_set_margin_start(hbox, 3);
-  gtk_widget_set_margin_end(hbox, 3);
-  gtk_widget_set_margin_top(hbox, 3);
-  gtk_widget_set_margin_bottom(hbox, 3);
-
-  gtk_frame_set_child(GTK_FRAME(frame), hbox);
-
-  /* Left side: nation list */
-  {
-    GtkWidget *nation_selection_list = gtk_grid_new();
-
-    nationsets_chooser = NULL;
-
-    gtk_grid_set_row_spacing(GTK_GRID(nation_selection_list), 2);
-
-    /* Nationset selector dropdown */
-    /* Only present this if there is more than one choice.
-     * (If ruleset is changed, possibly changing the number of available sets
-     * and invalidating this decision, then dialog will be popped down.) */
-    if (nation_set_count() > 1) {
-      GtkListStore *sets_model = gtk_list_store_new(4, G_TYPE_STRING,
-                                                    G_TYPE_STRING,
-                                                    G_TYPE_STRING,
-                                                    G_TYPE_STRING);
-      GtkCellRenderer *renderer;
-
-      nation_sets_iterate(pset) {
-        /* Index in list store must match nation_set_index(). */
-        gchar *escaped;
-        struct astring s = ASTRING_INIT;
-        int num_nations = 0;
-
-        nations_iterate(pnation) {
-          if (is_nation_playable(pnation) && nation_is_in_set(pnation, pset)) {
-            num_nations++;
-          }
-        } nations_iterate_end;
-        escaped = g_markup_escape_text(nation_set_name_translation(pset), -1);
-        /* TRANS: nation set name followed by number of playable nations;
-         * <b> and </b> are Pango markup and should be left alone */
-        astr_set(&s, PL_("<b>%s</b> (%d nation)",
-                         "<b>%s</b> (%d nations)", num_nations),
-                 escaped, num_nations);
-        g_free(escaped);
-        if (strlen(nation_set_description(pset)) > 0) {
-          /* While in principle it would be better to get Gtk to wrap the
-           * drop-down (e.g. via "wrap-width" property), there's no way
-           * to specify the indentation we want. So we do it ourselves. */
-          char *desc = fc_strdup(_(nation_set_description(pset)));
-          char *p = desc;
-
-          fc_break_lines(desc, 70);
-          astr_add(&s, "\n");
-          while (*p) {
-            int len = strcspn(p, "\n");
-
-            if (p[len] == '\n') {
-              len++;
-            }
-            escaped = g_markup_escape_text(p, len);
-            astr_add(&s, "\t%s", escaped);
-            g_free(escaped);
-            p += len;
-          }
-          FC_FREE(desc);
-        }
-        gtk_list_store_insert_with_values(sets_model, NULL, -1,
-                                          0, nation_set_rule_name(pset),
-                                          1, astr_str(&s),
-                                          2, nation_set_name_translation(pset),
-                                          -1);
-        astr_free(&s);
-      } nation_sets_iterate_end;
-
-      /* We want a combo box where the button displays just the set name,
-       * but the dropdown displays the expanded description. */
-      nationsets_chooser
-        = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(sets_model));
-      g_object_unref(G_OBJECT(sets_model));
-      {
-        /* Do our best to turn the text-entry widget into something more
-         * like a cell-view: disable editing, and focusing (which removes
-         * the caret). */
-        GtkWidget *entry = gtk_combo_box_get_child(GTK_COMBO_BOX(nationsets_chooser));
-
-        gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
-        gtk_widget_set_can_focus(entry, FALSE);
-      }
-      /* The entry displays the set name. */
-      gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(nationsets_chooser),
-                                          2);
-      /* The dropdown displays the marked-up description. */
-      renderer = gtk_cell_renderer_text_new();
-      gtk_cell_layout_clear(GTK_CELL_LAYOUT(nationsets_chooser));
-      gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(nationsets_chooser),
-                                 renderer, TRUE);
-      gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(nationsets_chooser),
-                                     renderer, "markup", 1, NULL);
-      g_signal_connect(nationsets_chooser, "destroy",
-                       G_CALLBACK(widget_destroyed), &nationsets_chooser);
-      g_signal_connect(nationsets_chooser, "changed",
-                       G_CALLBACK(nationset_callback), NULL);
-      {
-        /* Populate initially from client's view of server setting */
-        struct option *poption = optset_option_by_name(server_optset,
-                                                       "nationset");
-        if (poption) {
-          nationset_sync_to_server(option_str_get(poption));
-        }
-      }
-
-      label = g_object_new(GTK_TYPE_LABEL,
-          "use-underline", TRUE,
-          "label", _("_Nation Set:"),
-          "xalign", 0.0,
-          "yalign", 0.5,
-          NULL);
-      gtk_label_set_mnemonic_widget(GTK_LABEL(label), nationsets_chooser);
-
-      gtk_widget_set_hexpand(nationsets_chooser, TRUE);
-      gtk_grid_attach(GTK_GRID(nation_selection_list), label,
-                      0, 0, 1, 1);
-      gtk_grid_attach(GTK_GRID(nation_selection_list), nationsets_chooser,
-                      1, 0, 1, 1);
-    }
-
-    races_notebook = gtk_notebook_new();
-    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(races_notebook), GTK_POS_LEFT);
-    gtk_grid_attach(GTK_GRID(nation_selection_list), races_notebook,
-                    0, 2, 2, 1);
-
-    /* Suppress notebook tabs if there will be only one ("All") */
-    {
-      bool show_groups = FALSE;
-
-      nation_groups_iterate(pgroup) {
-        if (!is_nation_group_hidden(pgroup)) {
-          show_groups = TRUE;
-          break;
-        }
-      } nation_groups_iterate_end;
-      if (!show_groups) {
-        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(races_notebook), FALSE);
-      } else {
-        label = g_object_new(GTK_TYPE_LABEL,
-            "use-underline", TRUE,
-            "label", _("Nation _Groups:"),
-            "xalign", 0.0,
-            "yalign", 0.5,
-            NULL);
-        gtk_label_set_mnemonic_widget(GTK_LABEL(label), races_notebook);
-        gtk_grid_attach(GTK_GRID(nation_selection_list), label,
-                        0, 1, 2, 1);
-        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(races_notebook), TRUE);
-      }
-    }
-
-    /* Populate treeview */
-    create_nation_selection_lists();
-
-    gtk_box_append(GTK_BOX(hbox), nation_selection_list);
-  }
-
-  /* Right side. */
-  notebook = gtk_notebook_new();
-  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_BOTTOM);
-  gtk_box_append(GTK_BOX(hbox), notebook);
-
-  /* Properties pane. */
-  label = gtk_label_new_with_mnemonic(_("_Properties"));
-
-  races_properties = table = gtk_grid_new();
-  g_signal_connect(table, "destroy",
-                   G_CALLBACK(widget_destroyed), &races_properties);
-  gtk_widget_set_margin_bottom(table, 6);
-  gtk_widget_set_margin_end(table, 6);
-  gtk_widget_set_margin_start(table, 6);
-  gtk_widget_set_margin_top(table, 6);
-  gtk_grid_set_row_spacing(GTK_GRID(table), 2);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
-
-  /* Leader. */
-  {
-    GtkListStore *model = gtk_list_store_new(1, G_TYPE_STRING);
-
-    combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(model));
-    gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(combo), 0);
-    g_object_unref(G_OBJECT(model));
-  }
-  races_leader = combo;
-  label = g_object_new(GTK_TYPE_LABEL,
-      "use-underline", TRUE,
-      "mnemonic-widget", GTK_COMBO_BOX(combo),
-      "label", _("_Leader:"),
-      "xalign", 0.0,
-      "yalign", 0.5,
-      NULL);
-  gtk_widget_set_margin_bottom(label, 6);
-  gtk_widget_set_margin_end(label, 12);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 2);
-  gtk_grid_attach(GTK_GRID(table), combo, 1, 0, 2, 1);
-
-  cmd = gtk_check_button_new_with_mnemonic(sex_name_mnemonic(SEX_FEMALE,
-                                                             "_"));
-  gtk_widget_set_margin_bottom(cmd, 6);
-  races_sex[0] = cmd;
-  gtk_grid_attach(GTK_GRID(table), cmd, 1, 1, 1, 1);
-  group = cmd;
-
-  cmd = gtk_check_button_new_with_mnemonic(sex_name_mnemonic(SEX_MALE,
-                                                             "_"));
-  gtk_check_button_set_group(GTK_CHECK_BUTTON(cmd),
-                             GTK_CHECK_BUTTON(group));
-  gtk_widget_set_margin_bottom(cmd, 6);
-  races_sex[1] = cmd;
-  gtk_grid_attach(GTK_GRID(table), cmd, 2, 1, 1, 1);
-
-  /* City style. */
-  store = gtk_list_store_new(3, G_TYPE_INT,
-                             GDK_TYPE_PIXBUF, G_TYPE_STRING);
-
-  list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(list, TRUE);
-  gtk_widget_set_vexpand(list, TRUE);
-  races_style_list = list;
-  g_object_unref(store);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE);
-  g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW(list)), "changed",
-                   G_CALLBACK(races_style_callback), NULL);
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_margin_top(sw, 6);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), list);
-  gtk_grid_attach(GTK_GRID(table), sw, 1, 2, 2, 2);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-      "use-underline", TRUE,
-      "mnemonic-widget", list,
-      "label", _("City _Styles:"),
-      "xalign", 0.0,
-      "yalign", 0.5,
-      NULL);
-  gtk_widget_set_margin_top(label, 6);
-  gtk_widget_set_margin_end(label, 12);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
-
-  render = gtk_cell_renderer_pixbuf_new();
-  column = gtk_tree_view_column_new_with_attributes(NULL, render,
-                                                    "pixbuf", 1, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
-  render = gtk_cell_renderer_text_new();
-  column = gtk_tree_view_column_new_with_attributes(NULL, render,
-                                                    "text", 2, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(list), column);
-
-  /* Populate style store. */
-  styles_iterate(pstyle) {
-    GdkPixbuf *img;
-    struct sprite *s;
-    GtkTreeIter it;
-
-    i = basic_city_style_for_style(pstyle);
-
-    if (i >= 0) {
-      gtk_list_store_append(store, &it);
-
-      s = crop_blankspace(get_sample_city_sprite(tileset, i));
-      img = sprite_get_pixbuf(s);
-      free_sprite(s);
-      gtk_list_store_set(store, &it, 0, i, 1, img, 2,
-                         city_style_name_translation(i), -1);
-      g_object_unref(img);
-    }
-  } styles_iterate_end;
-
-  /* Legend pane. */
-  label = gtk_label_new_with_mnemonic(_("_Description"));
-
-  text = gtk_text_view_new();
-  gtk_widget_set_margin_bottom(text, 6);
-  gtk_widget_set_margin_end(text, 6);
-  gtk_widget_set_margin_start(text, 6);
-  gtk_widget_set_margin_top(text, 6);
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  races_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
-  gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
-
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), text, label);
-
-  /* Signals. */
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(widget_destroyed), &races_shell);
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(races_response), NULL);
-
-  g_signal_connect(GTK_COMBO_BOX(races_leader), "changed",
-                   G_CALLBACK(races_leader_callback), NULL);
-
-  g_signal_connect(races_sex[0], "toggled",
-                   G_CALLBACK(races_sex_callback), GINT_TO_POINTER(SEX_FEMALE));
-  g_signal_connect(races_sex[1], "toggled",
-                   G_CALLBACK(races_sex_callback), GINT_TO_POINTER(SEX_MALE));
-
-  /* Finish up. */
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CANCEL);
-
-  /* You can't assign NO_NATION during a running game. */
-  if (C_S_RUNNING == client_state()) {
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(shell), GTK_RESPONSE_NO,
-                                      FALSE);
-  }
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(shell)),
-                                                     TRUE);
-
-  /* Select player's current nation in UI, if any */
-  if (races_player->nation) {
-    select_nation(nation_number(races_player->nation),
-                  player_name(races_player),
-                  races_player->is_male,
-                  style_number(races_player->style));
-    /* Make sure selected nation is visible
-     * (last page, "All", will certainly contain it) */
-    fc_assert(gtk_notebook_get_n_pages(GTK_NOTEBOOK(races_notebook)) > 0);
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(races_notebook), -1);
-  } else {
-    select_nation(-1, NULL, FALSE, 0);
-  }
-}
-
-/**********************************************************************//**
-  Popup the dialog 10% inside the main-window
-**************************************************************************/
-void popup_races_dialog(struct player *pplayer)
-{
-  if (!pplayer) {
-    return;
-  }
-
-  if (!races_shell) {
-    create_races_dialog(pplayer);
-    gtk_window_present(GTK_WINDOW(races_shell));
-  }
-}
-
-/**********************************************************************//**
-  Close nations dialog
-**************************************************************************/
-void popdown_races_dialog(void)
-{
-  if (races_shell) {
-    gtk_window_destroy(GTK_WINDOW(races_shell));
-  }
-
-  /* We're probably starting a new game, maybe with a new ruleset.
-     So we warn the worklist dialog. */
-  blank_max_unit_size();
-}
-
-/**********************************************************************//**
-  Update which nations are allowed to be selected (due to e.g. another
-  player choosing a nation).
-**************************************************************************/
-void races_toggles_set_sensitive(void)
-{
-  int i;
-
-  if (!races_shell) {
-    return;
-  }
-
-  for (i = 0; i <= nation_group_count(); i++) {
-    if (races_nation_list[i]) {
-      GtkTreeView *list = GTK_TREE_VIEW(races_nation_list[i]);
-      GtkTreeModel *model = gtk_tree_view_get_model(list);
-      GtkTreeSelection* select = gtk_tree_view_get_selection(list);
-      GtkTreeIter it;
-      gboolean chosen;
-
-      /* Update 'chosen' column in model */
-      if (gtk_tree_model_get_iter_first(model, &it)) {
-        do {
-          int nation_no;
-          struct nation_type *nation;
-
-          gtk_tree_model_get(model, &it, 0, &nation_no, -1);
-          nation = nation_by_number(nation_no);
-
-          chosen = !is_nation_pickable(nation)
-            || (nation->player && nation->player != races_player);
-
-          gtk_list_store_set(GTK_LIST_STORE(model), &it, 1, chosen, -1);
-
-        } while (gtk_tree_model_iter_next(model, &it));
-      }
-
-      /* If our selection is now invalid, deselect it */
-      if (gtk_tree_selection_get_selected(select, &model, &it)) {
-        gtk_tree_model_get(model, &it, 1, &chosen, -1);
-
-        if (chosen) {
-          gtk_tree_selection_unselect_all(select);
-        }
-      }
-    }
-  }
-}
-
-/**********************************************************************//**
-  Called whenever a user selects a nation in nation list
-**************************************************************************/
-static void races_nation_callback(GtkTreeSelection *select, gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(select, &model, &it)) {
-    gboolean chosen;
-    int newnation;
-
-    gtk_tree_model_get(model, &it, 0, &newnation, 1, &chosen, -1);
-
-    /* Only allow nations not chosen by another player */
-    if (!chosen) {
-      if (newnation != selected_nation) {
-        /* Choose a random leader */
-        select_nation(newnation, NULL, FALSE,
-                      style_number(style_of_nation(nation_by_number(newnation))));
-      }
-      return;
-    }
-  }
-
-  /* Fall-through if no valid nation selected */
-  select_nation(-1, NULL, FALSE, 0);
-}
-
-/**********************************************************************//**
-  Leader name has been chosen
-**************************************************************************/
-static void races_leader_callback(void)
-{
-  const struct nation_leader *pleader;
-  const gchar *name;
-
-  name =
-    gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(races_leader)))));
-
-  if (selected_nation != -1
-      &&(pleader = nation_leader_by_name(nation_by_number(selected_nation),
-                                         name))) {
-    selected_sex = nation_leader_is_male(pleader);
-    gtk_check_button_set_active(GTK_CHECK_BUTTON(races_sex[selected_sex]),
-                                TRUE);
-  }
-}
-
-/**********************************************************************//**
-  Leader sex has been chosen
-**************************************************************************/
-static void races_sex_callback(GtkWidget *w, gpointer data)
-{
-  selected_sex = GPOINTER_TO_INT(data);
-}
-
-/**********************************************************************//**
-  Determines which nations can be selected in the UI
-**************************************************************************/
-static gboolean races_selection_func(GtkTreeSelection *select,
-                                     GtkTreeModel *model, GtkTreePath *path,
-                                     gboolean selected, gpointer data)
-{
-  GtkTreeIter it;
-  gboolean chosen;
-
-  gtk_tree_model_get_iter(model, &it, path);
-  gtk_tree_model_get(model, &it, 1, &chosen, -1);
-  return (!chosen || selected);
-}
-
-/**********************************************************************//**
-  City style has been chosen
-**************************************************************************/
-static void races_style_callback(GtkTreeSelection *select, gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(select, &model, &it)) {
-    gtk_tree_model_get(model, &it, 0, &selected_style, -1);
-  } else {
-    selected_style = -1;
-  }
-}
-
-/**********************************************************************//**
-  User has selected some of the responses for whole nations dialog
-**************************************************************************/
-static void races_response(GtkWidget *w, gint response, gpointer data)
-{
-  if (response == GTK_RESPONSE_ACCEPT) {
-    const char *s;
-
-    /* This shouldn't be possible but... */
-    if (selected_nation == -1) {
-      return;
-    }
-
-    if (selected_sex == -1) {
-      output_window_append(ftc_client, _("You must select your sex."));
-      return;
-    }
-
-    if (selected_style == -1) {
-      output_window_append(ftc_client, _("You must select your style."));
-      return;
-    }
-
-    s = gtk_entry_buffer_get_text(gtk_entry_get_buffer(
-                                      GTK_ENTRY(gtk_combo_box_get_child(GTK_COMBO_BOX(races_leader)))));
-
-    /* Perform a minimum of sanity test on the name. */
-    /* This could call is_allowed_player_name() if it were available. */
-    if (strlen(s) == 0) {
-      output_window_append(ftc_client, _("You must type a legal name."));
-      return;
-    }
-
-    dsend_packet_nation_select_req(&client.conn,
-                                   player_number(races_player), selected_nation,
-                                   selected_sex, s,
-                                   selected_style);
-  } else if (response == GTK_RESPONSE_NO) {
-    dsend_packet_nation_select_req(&client.conn,
-                                   player_number(races_player),
-                                   -1, FALSE, "", 0);
-  }
-
-  popdown_races_dialog();
-}
-
-/**********************************************************************//**
-  Adjust tax rates from main window
-**************************************************************************/
-gboolean taxrates_callback(GtkGestureClick *gesture, int n_press,
-                           double x, double y)
-{
-  GtkWidget *widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-
-  common_taxrates_callback(GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(widget),
-                                                              "rate_button")), FALSE);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Adjust tax rates from main window
-**************************************************************************/
-gboolean reverse_taxrates_callback(GtkGestureClick *gesture, int n_press,
-				   double x, double y)
-{
-  GtkWidget *widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-
-  common_taxrates_callback(GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(widget),
-                                                              "rate_button")), TRUE);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Pops up a dialog to confirm upgrading of the unit.
-**************************************************************************/
-void popup_upgrade_dialog(struct unit_list *punits)
-{
-  GtkWidget *shell;
-  char buf[512];
-
-  if (!punits || unit_list_size(punits) == 0) {
-    return;
-  }
-
-  if (!get_units_upgrade_info(buf, sizeof(buf), punits)) {
-    shell = gtk_message_dialog_new(NULL, 0,
-                                   GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-                                   "%s", buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Upgrade Unit!"));
-    setup_dialog(shell, toplevel);
-    g_signal_connect(shell, "response", G_CALLBACK(gtk_window_destroy),
-                     NULL);
-    gtk_window_present(GTK_WINDOW(shell));
-  } else {
-    shell = gtk_message_dialog_new(NULL, 0,
-                                   GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-                                   "%s", buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Upgrade Obsolete Units"));
-    setup_dialog(shell, toplevel);
-    gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_YES);
-
-    /* FIXME: Should not block */
-    if (blocking_dialog(shell) == GTK_RESPONSE_YES) {
-      unit_list_iterate(punits, punit) {
-        request_unit_upgrade(punit);
-      } unit_list_iterate_end;
-    }
-    gtk_window_destroy(GTK_WINDOW(shell));
-  }
-}
-
-/**********************************************************************//**
-  Pops up a dialog to confirm disband of the unit(s).
-**************************************************************************/
-void popup_disband_dialog(struct unit_list *punits)
-{
-  GtkWidget *shell;
-  char buf[512];
-
-  if (!punits || unit_list_size(punits) == 0) {
-    return;
-  }
-
-  if (!get_units_disband_info(buf, sizeof(buf), punits)) {
-    shell = gtk_message_dialog_new(NULL, 0,
-                                   GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-                                   "%s", buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Disband Units"));
-    setup_dialog(shell, toplevel);
-    g_signal_connect(shell, "response", G_CALLBACK(gtk_window_destroy),
-                    NULL);
-    gtk_window_present(GTK_WINDOW(shell));
-  } else {
-    shell = gtk_message_dialog_new(NULL, 0,
-                                   GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-                                   "%s", buf);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Disband Units"));
-    setup_dialog(shell, toplevel);
-    gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_YES);
-
-    /* FIXME: Should not block */
-    if (blocking_dialog(shell) == GTK_RESPONSE_YES) {
-      unit_list_iterate(punits, punit) {
-        if (unit_can_do_action(punit, ACTION_DISBAND_UNIT)) {
-          request_unit_disband(punit);
-        }
-      } unit_list_iterate_end;
-    }
-    gtk_window_destroy(GTK_WINDOW(shell));
-  }
-}
-
-/**********************************************************************//**
-  This function is called when the client disconnects or the game is
-  over. It should close all dialog windows for that game.
-**************************************************************************/
-void popdown_all_game_dialogs(void)
-{
-  gui_dialog_destroy_all();
-  property_editor_popdown(editprop_get_property_editor());
-  unit_select_dialog_popdown();
-}
-
-/**********************************************************************//**
-  Player has gained a new tech.
-**************************************************************************/
-void show_tech_gained_dialog(Tech_type_id tech)
-{
-  const struct advance *padvance = valid_advance_by_number(tech);
-
-  if (NULL != padvance
-      && (GUI_GTK_OPTION(popup_tech_help) == GUI_POPUP_TECH_HELP_ENABLED
-          || (GUI_GTK_OPTION(popup_tech_help) == GUI_POPUP_TECH_HELP_RULESET
-              && game.control.popup_tech_help))) {
-    popup_help_dialog_typed(advance_name_translation(padvance), HELP_TECH);
-  }
-}
-
-/**********************************************************************//**
-  Show tileset error dialog. It's blocking as client will
-  shutdown as soon as this function returns.
-**************************************************************************/
-void show_tileset_error(bool fatal, const char *tset_name, const char *msg)
-{
-  if (is_gui_up()) {
-    GtkWidget *dialog;
-
-    if (tset_name != NULL) {
-      dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
-                                      GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
-                                      _("Tileset \"%s\" problem, "
-                                        "it's probably incompatible with "
-                                        "the ruleset:\n%s"),
-                                      tset_name, msg);
-    } else {
-      dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
-                                      GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
-                                      _("Tileset problem, "
-                                        "it's probably incompatible with "
-                                        "the ruleset:\n%s"),
-                                      msg);
-    }
-
-    setup_dialog(dialog, toplevel);
-
-    blocking_dialog(dialog);
-
-    gtk_window_destroy(GTK_WINDOW(dialog));
-  }
-}
-
-/**********************************************************************//**
-  Give a warning when user is about to edit scenario with manually
-  set properties.
-**************************************************************************/
-bool handmade_scenario_warning(void)
-{
-  /* Just tell the client common code to handle this. */
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Popup detailed information about battle or save information for
-  some kind of statistics
-**************************************************************************/
-void popup_combat_info(int attacker_unit_id, int defender_unit_id,
-                       int attacker_hp, int defender_hp,
-                       bool make_att_veteran, bool make_def_veteran)
-{
-}
-
-/**********************************************************************//**
-  This is the response callback for the action confirmation dialog.
-**************************************************************************/
-static void act_conf_response(GtkWidget *dialog, gint response,
-                              gpointer data)
-{
-  gtk_window_destroy(GTK_WINDOW(dialog));
-
-  if (response == GTK_RESPONSE_YES) {
-    action_confirmation(data, TRUE);
-  } else {
-    action_confirmation(data, FALSE);
-  }
-}
-
-/**********************************************************************//**
-  Common code wants confirmation for an action.
-**************************************************************************/
-void request_action_confirmation(const char *expl,
-                                 struct act_confirmation_data *data)
-{
-  GtkWidget *dialog;
-  char buf[1024];
-
-  if (expl != NULL) {
-    fc_snprintf(buf, sizeof(buf), _("Are you sure you want to do %s?\n%s"),
-                action_id_name_translation(data->act), expl);
-  } else {
-    fc_snprintf(buf, sizeof(buf), _("Are you sure you want to do %s?"),
-                action_id_name_translation(data->act));
-  }
-
-  dialog = gtk_message_dialog_new(NULL,
-                                  0,
-                                  GTK_MESSAGE_WARNING,
-                                  GTK_BUTTONS_YES_NO,
-                                  "%s", buf);
-  setup_dialog(dialog, toplevel);
-
-  g_signal_connect(dialog, "response",
-                   G_CALLBACK(act_conf_response), data);
-
-  gtk_window_present(GTK_WINDOW(dialog));
-}
-
-/**********************************************************************//**
-  Popup image window
-**************************************************************************/
-void popup_image(const char *tag)
-{
-  struct sprite *spr = load_popup_sprite(tag);
-
-  if (spr != NULL) {
-    GdkPixbuf *pix = sprite_get_pixbuf(spr);
-    GtkWidget *win = gtk_window_new();
-    GtkWidget *img = gtk_image_new_from_pixbuf(pix);
-    int width, height;
-
-    get_sprite_dimensions(spr, &width, &height);
-    gtk_window_set_default_size(GTK_WINDOW(win), width, height);
-    gtk_window_set_child(GTK_WINDOW(win), img);
-    gtk_widget_show(win);
-
-    unload_popup_sprite(tag);
-  } else {
-    log_error(_("No image for tag \"%s\", requested by the server."), tag);
-  }
-}
diff --git a/client/gui-gtk-5.0/dialogs.h b/client/gui-gtk-5.0/dialogs.h
deleted file mode 100644
index 0299738b61..0000000000
--- a/client/gui-gtk-5.0/dialogs.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__DIALOGS_H
-#define FC__DIALOGS_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "dialogs_g.h"
-
-void popup_revolution_dialog(struct government *government);
-void message_dialog_button_set_sensitive(GtkWidget *shl, int button,
-                                         gboolean state);
-gboolean taxrates_callback(GtkGestureClick *gesture, int n_press,
-                           double x, double y);
-gboolean reverse_taxrates_callback(GtkGestureClick *gesture, int n_press,
-				   double x, double y);
-void nationset_sync_to_server(const char *nationset);
-
-#endif /* FC__DIALOGS_H */
diff --git a/client/gui-gtk-5.0/diplodlg.c b/client/gui-gtk-5.0/diplodlg.c
deleted file mode 100644
index 53e1ec4a52..0000000000
--- a/client/gui-gtk-5.0/diplodlg.c
+++ /dev/null
@@ -1,1396 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "diptreaty.h"
-#include "fcintl.h"
-#include "game.h"
-#include "government.h"
-#include "map.h"
-#include "nation.h"
-#include "packets.h"
-#include "player.h"
-#include "research.h"
-
-/* client */
-#include "chatline.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "diplodlg.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-#include "plrdlg.h"
-
-struct Diplomacy_dialog {
-  struct treaty *treaty;
-  struct gui_dialog *dialog;
-
-  GtkWidget *pic0;
-  GtkWidget *pic1;
-
-  GtkListStore *store;
-};
-
-struct Diplomacy_notebook {
-  struct gui_dialog *dialog;
-  GtkWidget *notebook;
-};
-
-struct city_deal {
-  int giver;
-  int receiver;
-  int id;
-};
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct Diplomacy_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct Diplomacy_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-static struct Diplomacy_notebook *dipl_main;
-
-static struct Diplomacy_dialog *create_diplomacy_dialog(struct treaty *ptreaty,
-                                                        struct player *plr0,
-                                                        struct player *plr1);
-
-static struct Diplomacy_dialog *find_diplomacy_dialog(struct player *they);
-static void popup_diplomacy_dialog(struct treaty *ptreaty, struct player *they,
-                                   struct player *initiator);
-static void diplomacy_dialog_map_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data);
-static void diplomacy_dialog_seamap_callback(GSimpleAction *action,
-                                             GVariant *parameter,
-                                             gpointer data);
-
-static void diplomacy_dialog_tech_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void diplomacy_dialog_city_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void diplomacy_dialog_vision_callback(GSimpleAction *action,
-                                             GVariant *parameter,
-                                             gpointer data);
-static void diplomacy_dialog_embassy_callback(GSimpleAction *action,
-                                              GVariant *parameter,
-                                              gpointer data);
-static void diplomacy_dialog_shared_tiles_callback(GSimpleAction *action,
-                                                   GVariant *parameter,
-                                                   gpointer data);
-static void diplomacy_dialog_ceasefire_callback(GSimpleAction *action,
-                                                GVariant *parameter,
-                                                gpointer data);
-static void diplomacy_dialog_peace_callback(GSimpleAction *action,
-                                            GVariant *parameter,
-                                            gpointer data);
-static void diplomacy_dialog_alliance_callback(GSimpleAction *action,
-                                               GVariant *parameter,
-                                               gpointer data);
-
-static void close_diplomacy_dialog(struct Diplomacy_dialog *pdialog);
-static void update_diplomacy_dialog(struct Diplomacy_dialog *pdialog);
-static void diplo_dialog_returnkey(GtkWidget *w, gpointer data);
-
-static struct Diplomacy_notebook *diplomacy_main_create(void);
-static void diplomacy_main_destroy(void);
-static void diplomacy_main_response(struct gui_dialog *dlg, int response,
-                                    gpointer data);
-
-#define RESPONSE_CANCEL_MEETING 100
-#define RESPONSE_CANCEL_MEETING_ALL 101
-
-
-#define FC_TYPE_CLAUSE_ROW (fc_clause_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcClauseRow, fc_clause_row, FC, CLAUSE_ROW, GObject)
-
-struct _FcClauseRow
-{
-  GObject parent_instance;
-
-  char *clause;
-};
-
-struct _FcClauseClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcClauseRow, fc_clause_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Initialization method for FcClauseRow class
-**************************************************************************/
-static void
-fc_clause_row_class_init(FcClauseRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcClauseRow
-**************************************************************************/
-static void
-fc_clause_row_init(FcClauseRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcClauseRow creation method
-**************************************************************************/
-#if 0
-static FcClauseRow *fc_clause_row_new(void)
-{
-  FcClauseRow *result;
-
-  result = g_object_new(FC_TYPE_CLAUSE_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/************************************************************************//**
-  Server tells us that either party has accepted treaty
-****************************************************************************/
-void gui_recv_accept_treaty(struct treaty *ptreaty, struct player *they)
-{
-  struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(they);
-
-  if (!pdialog) {
-    return;
-  }
-
-  fc_assert(pdialog->treaty == ptreaty);
-
-  update_diplomacy_dialog(pdialog);
-  gui_dialog_alert(pdialog->dialog);
-}
-
-/************************************************************************//**
-  Someone is initiating meeting with us.
-****************************************************************************/
-void gui_init_meeting(struct treaty *ptreaty, struct player *they,
-                      struct player *initiator)
-{
-  popup_diplomacy_dialog(ptreaty, they, initiator);
-}
-
-/************************************************************************//**
-  Meeting has been cancelled.
-****************************************************************************/
-void gui_recv_cancel_meeting(struct treaty *ptreaty, struct player *they,
-                             struct player *initiator)
-{
-  struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(they);
-
-  if (!pdialog) {
-    return;
-  }
-
-  fc_assert(pdialog->treaty == ptreaty);
-
-  close_diplomacy_dialog(pdialog);
-}
-
-/**********************************************************************//**
-  Prepare to clause creation or removal.
-**************************************************************************/
-void gui_prepare_clause_updt(struct treaty *ptreaty, struct player *they)
-{
-  /* Not needed */
-}
-
-/************************************************************************//**
-  Added clause to the meeting
-****************************************************************************/
-void gui_recv_create_clause(struct treaty *ptreaty, struct player *they)
-{
-  struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(they);
-
-  if (!pdialog) {
-    return;
-  }
-
-  fc_assert(pdialog->treaty == ptreaty);
-
-  update_diplomacy_dialog(pdialog);
-  gui_dialog_alert(pdialog->dialog);
-}
-
-/************************************************************************//**
-  Removed clause from meeting.
-****************************************************************************/
-void gui_recv_remove_clause(struct treaty *ptreaty, struct player *they)
-{
-  struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(they);
-
-  if (!pdialog) {
-    return;
-  }
-
-  fc_assert(pdialog->treaty == ptreaty);
-
-  update_diplomacy_dialog(pdialog);
-  gui_dialog_alert(pdialog->dialog);
-}
-
-/************************************************************************//**
-  Popup the dialog 10% inside the main-window
-****************************************************************************/
-static void popup_diplomacy_dialog(struct treaty *ptreaty, struct player *they,
-                                   struct player *initiator)
-{
-  struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(they);
-
-  if (!is_human(client_player())) {
-    return; /* Don't show if we are not human controlled. */
-  }
-
-  if (!pdialog) {
-    pdialog = create_diplomacy_dialog(ptreaty, client_player(), they);
-  }
-
-  gui_dialog_present(pdialog->dialog);
-  /* We initiated the meeting - Make the tab active */
-  if (initiator == client_player()) {
-    /* We have to raise the diplomacy meeting tab as well as the selected
-     * meeting. */
-    fc_assert_ret(dipl_main != NULL);
-    gui_dialog_raise(dipl_main->dialog);
-    gui_dialog_raise(pdialog->dialog);
-
-    if (players_dialog_shell != NULL) {
-      gui_dialog_set_return_dialog(pdialog->dialog, players_dialog_shell);
-    }
-  }
-}
-
-/************************************************************************//**
-  Utility for g_list_sort(). See below.
-****************************************************************************/
-static gint sort_advance_names(gconstpointer a, gconstpointer b)
-{
-  const struct advance *padvance1 = (const struct advance *) a;
-  const struct advance *padvance2 = (const struct advance *) b;
-
-  return fc_strcoll(advance_name_translation(padvance1),
-                    advance_name_translation(padvance2));
-}
-
-/************************************************************************//**
-  Popup menu about adding clauses
-****************************************************************************/
-static GMenu *create_clause_menu(GActionGroup *group,
-                                 struct Diplomacy_dialog *pdialog,
-                                 struct player *partner, bool them)
-{
-  GMenu *topmenu, *submenu;
-  GSimpleAction *act;
-  bool any_map = FALSE;
-  char act_plr_part[20];
-  char act_name[60];
-  struct player *pgiver, *pother;
-
-  if (them) {
-    fc_strlcpy(act_plr_part, "_them", sizeof(act_plr_part));
-    pgiver = partner;
-    pother = client_player();
-  } else {
-    fc_strlcpy(act_plr_part, "_us", sizeof(act_plr_part));
-    pgiver = client_player();
-    pother = partner;
-  }
-
-  topmenu = g_menu_new();
-
-  /* Maps. */
-  if (clause_enabled(CLAUSE_MAP)) {
-    submenu = g_menu_new();
-
-    fc_snprintf(act_name, sizeof(act_name), "worldmap%s", act_plr_part);
-    act = g_simple_action_new(act_name, NULL);
-    g_object_set_data(G_OBJECT(act), "plr", pgiver);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(diplomacy_dialog_map_callback),
-                     pdialog);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.worldmap%s", act_plr_part);
-    menu_item_append_unref(submenu, g_menu_item_new(_("World-map"), act_name));
-
-    any_map = TRUE;
-  }
-
-  if (clause_enabled(CLAUSE_SEAMAP)) {
-    if (!any_map) {
-      submenu = g_menu_new();
-    }
-
-    fc_snprintf(act_name, sizeof(act_name), "seamap%s", act_plr_part);
-    act = g_simple_action_new(act_name, NULL);
-    g_object_set_data(G_OBJECT(act), "plr", pgiver);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(diplomacy_dialog_seamap_callback),
-                     pdialog);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.seamap%s", act_plr_part);
-    menu_item_append_unref(submenu, g_menu_item_new(_("Sea-map"), act_name));
-
-    any_map = TRUE;
-  }
-
-  if (any_map) {
-    submenu_append_unref(topmenu, _("_Maps"), G_MENU_MODEL(submenu));
-  }
-
-  /* Trading: advances */
-  if (clause_enabled(CLAUSE_ADVANCE)) {
-    const struct research *gresearch = research_get(pgiver);
-    const struct research *oresearch = research_get(pother);
-    GList *sorting_list = NULL;
-    bool team_embassy = team_has_embassy(pgiver->team, pother);
-    int i;
-
-    submenu = g_menu_new();
-
-    advance_iterate(padvance) {
-      Tech_type_id tech = advance_number(padvance);
-
-      if (research_invention_state(gresearch, tech) == TECH_KNOWN
-          && (!team_embassy /* We don't know what the other could actually receive */
-              || research_invention_gettable(oresearch, tech,
-                                             game.info.tech_trade_allow_holes))
-          && (research_invention_state(oresearch, tech) == TECH_UNKNOWN
-              || research_invention_state(oresearch, tech)
-                 == TECH_PREREQS_KNOWN)) {
-        sorting_list = g_list_prepend(sorting_list, padvance);
-      }
-    } advance_iterate_end;
-
-    if (NULL != sorting_list) {
-      GList *list_item;
-      const struct advance *padvance;
-
-      sorting_list = g_list_sort(sorting_list, sort_advance_names);
-
-      /* TRANS: All technologies menu item in the diplomatic dialog. */
-      fc_snprintf(act_name, sizeof(act_name), "advance%sall", act_plr_part);
-      act = g_simple_action_new(act_name, NULL);
-
-      g_object_set_data(G_OBJECT(act), "player_from",
-                        GINT_TO_POINTER(player_number(pgiver)));
-      g_object_set_data(G_OBJECT(act), "player_to",
-                        GINT_TO_POINTER(player_number(pother)));
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate",
-                       G_CALLBACK(diplomacy_dialog_tech_callback),
-                       GINT_TO_POINTER(A_LAST));
-
-      fc_snprintf(act_name, sizeof(act_name), "win.advance%sall", act_plr_part);
-      menu_item_append_unref(submenu, g_menu_item_new(_("All advances"), act_name));
-
-      for (list_item = sorting_list, i = 0; NULL != list_item;
-           list_item = g_list_next(list_item), i++) {
-
-        fc_snprintf(act_name, sizeof(act_name), "advance%s%d",
-                    act_plr_part, i);
-        act = g_simple_action_new(act_name, NULL);
-
-        padvance = (const struct advance *) list_item->data;
-        g_object_set_data(G_OBJECT(act), "player_from",
-                          GINT_TO_POINTER(player_number(pgiver)));
-        g_object_set_data(G_OBJECT(act), "player_to",
-                          GINT_TO_POINTER(player_number(pother)));
-        g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-        g_signal_connect(act, "activate",
-                         G_CALLBACK(diplomacy_dialog_tech_callback),
-                         GINT_TO_POINTER(advance_number(padvance)));
-
-        fc_snprintf(act_name, sizeof(act_name), "win.advance%s%d",
-                    act_plr_part, i);
-        menu_item_append_unref(submenu,
-                               g_menu_item_new(advance_name_translation(padvance),
-                                               act_name));
-      }
-
-      g_list_free(sorting_list);
-    }
-
-    submenu_append_unref(topmenu, _("_Advances"), G_MENU_MODEL(submenu));
-  }
-
-  /* Trading: cities. */
-
-  /****************************************************************
-  Creates a sorted list of plr0's cities, excluding the capital and
-  any cities not visible to plr1. This means that you can only trade
-  cities visible to requesting player.
-
-                              - Kris Bubendorfer
-  *****************************************************************/
-  if (clause_enabled(CLAUSE_CITY)) {
-    int i = 0;
-    int n = city_list_size(pgiver->cities);
-
-    submenu = g_menu_new();
-
-    if (n > 0) {
-      struct city **city_list_ptrs;
-
-      city_list_ptrs = fc_malloc(sizeof(struct city *) * n);
-
-      city_list_iterate(pgiver->cities, pcity) {
-        if (!is_capital(pcity)) {
-          city_list_ptrs[i] = pcity;
-          i++;
-        }
-      } city_list_iterate_end;
-
-      if (i > 0) { /* Cities other than capitals */
-        int j;
-
-        qsort(city_list_ptrs, i, sizeof(struct city *), city_name_compare);
-
-        for (j = 0; j < i; j++) {
-          struct city_deal *deal = fc_malloc(sizeof(struct city_deal));
-
-          fc_snprintf(act_name, sizeof(act_name), "city%s%d", act_plr_part, i);
-          act = g_simple_action_new(act_name, NULL);
-
-          deal->giver = player_number(pgiver);
-          deal->receiver = player_number(pother);
-          deal->id = city_list_ptrs[j]->id;
-
-          g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-          g_signal_connect(act, "activate",
-                           G_CALLBACK(diplomacy_dialog_city_callback),
-                           (gpointer)deal);
-
-          fc_snprintf(act_name, sizeof(act_name), "win.city%s%d",
-                      act_plr_part, i);
-          menu_item_append_unref(submenu,
-                                 g_menu_item_new(city_name_get(city_list_ptrs[j]),
-                                                 act_name));
-        }
-      }
-
-      free(city_list_ptrs);
-    }
-
-    submenu_append_unref(topmenu, _("_Cities"), G_MENU_MODEL(submenu));
-  }
-
-  /* Give shared vision. */
-  if (clause_enabled(CLAUSE_VISION)) {
-    fc_snprintf(act_name, sizeof(act_name), "vision%s", act_plr_part);
-    act = g_simple_action_new(act_name, NULL);
-    g_object_set_data(G_OBJECT(act), "plr", pgiver);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(diplomacy_dialog_vision_callback),
-                     pdialog);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.vision%s", act_plr_part);
-    menu_item_append_unref(topmenu, g_menu_item_new(_("_Give shared vision"), act_name));
-
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                !gives_shared_vision(pgiver, pother));
-  }
-
-  /* Give embassy. */
-  if (clause_enabled(CLAUSE_EMBASSY)) {
-    fc_snprintf(act_name, sizeof(act_name), "embassy%s", act_plr_part);
-    act = g_simple_action_new(act_name, NULL);
-    g_object_set_data(G_OBJECT(act), "plr", pgiver);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(diplomacy_dialog_embassy_callback),
-                     pdialog);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.embassy%s", act_plr_part);
-    menu_item_append_unref(topmenu, g_menu_item_new(_("Give _embassy"), act_name));
-
-    /* Don't take in account the embassy effects. */
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                !player_has_real_embassy(pother, pgiver));
-  }
-
-  /* Shared tiles */
-  if (clause_enabled(CLAUSE_SHARED_TILES)) {
-    fc_snprintf(act_name, sizeof(act_name), "tiles%s", act_plr_part);
-    act = g_simple_action_new(act_name, NULL);
-    g_object_set_data(G_OBJECT(act), "plr", pgiver);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(diplomacy_dialog_shared_tiles_callback),
-                     pdialog);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.tiles%s", act_plr_part);
-    menu_item_append_unref(topmenu, g_menu_item_new(_("_Share tiles"), act_name));
-  }
-
-  /* Pacts. */
-  if (pgiver == pdialog->treaty->plr0) {
-    enum diplstate_type ds;
-    int pact_clauses = 0;
-
-    ds = player_diplstate_get(pgiver, pother)->type;
-
-    submenu = g_menu_new();
-
-    if (clause_enabled(CLAUSE_CEASEFIRE)) {
-      fc_snprintf(act_name, sizeof(act_name), "ceasefire%s", act_plr_part);
-      act = g_simple_action_new(act_name, NULL);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate",
-                       G_CALLBACK(diplomacy_dialog_ceasefire_callback), pdialog);
-
-      fc_snprintf(act_name, sizeof(act_name), "win.ceasefire%s", act_plr_part);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(Q_("?diplomatic_state:Cease-fire"),
-                                             act_name));
-
-      g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                  ds != DS_CEASEFIRE && ds != DS_TEAM);
-      pact_clauses++;
-    }
-
-    if (clause_enabled(CLAUSE_PEACE)) {
-      fc_snprintf(act_name, sizeof(act_name), "peace%s", act_plr_part);
-      act = g_simple_action_new(act_name, NULL);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate",
-                       G_CALLBACK(diplomacy_dialog_peace_callback), pdialog);
-
-      fc_snprintf(act_name, sizeof(act_name), "win.peace%s", act_plr_part);
-      menu_item_append_unref(submenu, g_menu_item_new(Q_("?diplomatic_state:Peace"),
-                                                      act_name));
-
-      g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                  ds != DS_PEACE && ds != DS_TEAM);
-      pact_clauses++;
-    }
-
-    if (clause_enabled(CLAUSE_ALLIANCE)) {
-      fc_snprintf(act_name, sizeof(act_name), "alliance%s", act_plr_part);
-      act = g_simple_action_new(act_name, NULL);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate",
-                       G_CALLBACK(diplomacy_dialog_alliance_callback), pdialog);
-
-      fc_snprintf(act_name, sizeof(act_name), "win.alliance%s", act_plr_part);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(Q_("?diplomatic_state:Alliance"),
-                                             act_name));
-
-      g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                  ds != DS_ALLIANCE && ds != DS_TEAM);
-      pact_clauses++;
-    }
-
-    if (pact_clauses > 0) {
-      submenu_append_unref(topmenu, _("_Pacts"), G_MENU_MODEL(submenu));
-    } else {
-      g_object_unref(submenu);
-    }
-  }
-
-  return topmenu;
-}
-
-/************************************************************************//**
-  Some clause activated
-****************************************************************************/
-static void row_callback(GtkTreeView *view, GtkTreePath *path,
-                         GtkTreeViewColumn *col, gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
-  gint i;
-  gint *index;
-
-  index = gtk_tree_path_get_indices(path);
-
-  i = 0;
-  clause_list_iterate(pdialog->treaty->clauses, pclause) {
-    if (i == index[0]) {
-      dsend_packet_diplomacy_remove_clause_req(&client.conn,
-                                               player_number(pdialog->treaty->plr1),
-                                               player_number(pclause->from),
-                                               pclause->type,
-                                               pclause->value);
-      return;
-    }
-    i++;
-  } clause_list_iterate_end;
-}
-
-/************************************************************************//**
-  Create the main tab for diplomatic meetings.
-****************************************************************************/
-static struct Diplomacy_notebook *diplomacy_main_create(void)
-{
-  /* Collect all meetings in one main tab. */
-  if (!dipl_main) {
-    GtkWidget *dipl_sw;
-
-    dipl_main = fc_malloc(sizeof(*dipl_main));
-    gui_dialog_new(&(dipl_main->dialog), GTK_NOTEBOOK(top_notebook),
-                  dipl_main->dialog, TRUE);
-    dipl_main->notebook = gtk_notebook_new();
-    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(dipl_main->notebook),
-                             GTK_POS_RIGHT);
-    gtk_notebook_set_scrollable(GTK_NOTEBOOK(dipl_main->notebook), TRUE);
-
-    dipl_sw = gtk_scrolled_window_new();
-    gtk_widget_set_margin_bottom(dipl_sw, 2);
-    gtk_widget_set_margin_end(dipl_sw, 2);
-    gtk_widget_set_margin_start(dipl_sw, 2);
-    gtk_widget_set_margin_top(dipl_sw, 2);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(dipl_sw),
-                                   GTK_POLICY_AUTOMATIC,
-                                   GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(dipl_sw),
-                                  dipl_main->notebook);
-
-    /* Buttons */
-    gui_dialog_add_button(dipl_main->dialog, NULL,
-                          _("Cancel _all meetings"),
-                          RESPONSE_CANCEL_MEETING_ALL);
-
-    /* Responses for _all_ meetings. */
-    gui_dialog_response_set_callback(dipl_main->dialog,
-                                     diplomacy_main_response);
-
-    gui_dialog_add_content_widget(dipl_main->dialog, dipl_sw);
-
-    gui_dialog_show_all(dipl_main->dialog);
-    gui_dialog_present(dipl_main->dialog);
-  }
-
-  return dipl_main;
-}
-
-/************************************************************************//**
-  Destroy main diplomacy dialog.
-****************************************************************************/
-static void diplomacy_main_destroy(void)
-{
-  if (dipl_main->dialog) {
-    gui_dialog_destroy(dipl_main->dialog);
-  }
-  free(dipl_main);
-  dipl_main = NULL;
-}
-
-/************************************************************************//**
-  User has responded to whole diplomacy dialog (main tab).
-****************************************************************************/
-static void diplomacy_main_response(struct gui_dialog *dlg, int response,
-                                    gpointer data)
-{
-  if (!dipl_main) {
-    return;
-  }
-
-  switch (response) {
-  default:
-    log_error("unhandled response in %s: %d", __FUNCTION__, response);
-    fc__fallthrough; /* No break. */
-  case GTK_RESPONSE_DELETE_EVENT:   /* GTK: delete the widget. */
-  case RESPONSE_CANCEL_MEETING_ALL: /* Cancel all meetings. */
-    dialog_list_iterate(dialog_list, adialog) {
-      /* This will do a round trip to the server and close the dialog in the
-       * client. Closing the last dialog will also close the main tab.*/
-      dsend_packet_diplomacy_cancel_meeting_req(&client.conn,
-                                                player_number(
-                                                  adialog->treaty->plr1));
-    } dialog_list_iterate_end;
-    break;
-  }
-}
-
-/************************************************************************//**
-  Destroy diplomacy dialog
-****************************************************************************/
-static void diplomacy_destroy(struct Diplomacy_dialog *pdialog)
-{
-  if (NULL != pdialog->dialog) {
-    /* pdialog->dialog may be NULL if the tab has been destroyed
-     * by an other way. */
-    gui_dialog_destroy(pdialog->dialog);
-    pdialog->dialog = NULL;
-  }
-  dialog_list_remove(dialog_list, pdialog);
-
-  if (dialog_list) {
-    /* Diplomatic meetings in one main tab. */
-    if (dialog_list_size(dialog_list) > 0) {
-      if (dipl_main && dipl_main->dialog) {
-        gchar *buf;
-
-        buf = g_strdup_printf(_("Diplomacy [%d]"), dialog_list_size(dialog_list));
-        gui_dialog_set_title(dipl_main->dialog, buf);
-        g_free(buf);
-      }
-    } else if (dipl_main) {
-      /* No meeting left - destroy main tab. */
-      diplomacy_main_destroy();
-    }
-  }
-
-  /* Last sub-tab must not be freed before diplomacy_main_destroy() call. */
-  free(pdialog);
-}
-
-/************************************************************************//**
-  User has responded to whole diplomacy dialog (one meeting).
-****************************************************************************/
-static void diplomacy_response(struct gui_dialog *dlg, int response,
-                               gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = NULL;
-
-  fc_assert_ret(data);
-  pdialog = (struct Diplomacy_dialog *)data;
-
-  switch (response) {
-  case GTK_RESPONSE_ACCEPT:         /* Accept treaty. */
-    dsend_packet_diplomacy_accept_treaty_req(&client.conn,
-                                             player_number(
-                                               pdialog->treaty->plr1));
-    break;
-
-  default:
-    log_error("unhandled response in %s: %d", __FUNCTION__, response);
-    fc__fallthrough; /* No break. */
-  case GTK_RESPONSE_DELETE_EVENT:   /* GTK: delete the widget. */
-  case GTK_RESPONSE_CANCEL:         /* GTK: cancel button. */
-  case RESPONSE_CANCEL_MEETING:     /* Cancel meetings. */
-    dsend_packet_diplomacy_cancel_meeting_req(&client.conn,
-                                              player_number(
-                                                pdialog->treaty->plr1));
-    break;
-  }
-}
-
-/************************************************************************//**
-  Setups diplomacy dialog widgets.
-****************************************************************************/
-static struct Diplomacy_dialog *create_diplomacy_dialog(struct treaty *ptreaty,
-                                                        struct player *plr0,
-                                                        struct player *plr1)
-{
-  struct Diplomacy_notebook *dipl_dialog;
-  GtkWidget *vbox, *hgrid, *table, *mainbox;
-  GtkWidget *label, *sw, *view, *pic, *spin;
-  GtkWidget *aux_menu, *notebook;
-  struct sprite *flag_spr;
-  GtkListStore *store;
-  GtkCellRenderer *rend;
-  int i;
-  struct Diplomacy_dialog *pdialog;
-  char plr_buf[4 * MAX_LEN_NAME];
-  gchar *buf;
-  int grid_col = 0;
-  int main_row = 0;
-  GActionGroup *group;
-  GMenu *menu;
-
-  pdialog = fc_malloc(sizeof(*pdialog));
-
-  dialog_list_prepend(dialog_list, pdialog);
-  pdialog->treaty = ptreaty;
-
-  /* Get main diplomacy tab. */
-  dipl_dialog = diplomacy_main_create();
-
-  buf = g_strdup_printf(_("Diplomacy [%d]"), dialog_list_size(dialog_list));
-  gui_dialog_set_title(dipl_dialog->dialog, buf);
-  g_free(buf);
-
-  notebook = dipl_dialog->notebook;
-
-  gui_dialog_new(&(pdialog->dialog), GTK_NOTEBOOK(notebook), pdialog, FALSE);
-
-  /* Buttons */
-  gui_dialog_add_button(pdialog->dialog, NULL,
-                        _("Accept treaty"), GTK_RESPONSE_ACCEPT);
-  gui_dialog_add_button(pdialog->dialog, NULL,
-                        _("Cancel meeting"), RESPONSE_CANCEL_MEETING);
-
-  /* Responses for one meeting. */
-  gui_dialog_response_set_callback(pdialog->dialog, diplomacy_response);
-
-  /* Label for the new meeting. */
-  buf = g_strdup_printf("%s", nation_plural_for_player(plr1));
-  gui_dialog_set_title(pdialog->dialog, buf);
-
-  /* Sort meeting tabs alphabetically by the tab label. */
-  for (i = 0; i < gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)); i++) {
-    GtkWidget *prev_page
-      = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
-    struct gui_dialog *prev_dialog
-      = g_object_get_data(G_OBJECT(prev_page), "gui-dialog-data");
-    const char *prev_label
-      = gtk_label_get_text(GTK_LABEL(prev_dialog->v.tab.label));
-
-    if (fc_strcasecmp(buf, prev_label) < 0) {
-      gtk_notebook_reorder_child(GTK_NOTEBOOK(notebook),
-                                 pdialog->dialog->grid, i);
-      break;
-    }
-  }
-  g_free(buf);
-
-  /* Us. */
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
-  gtk_widget_set_margin_start(vbox, 2);
-  gtk_widget_set_margin_end(vbox, 2);
-  gtk_widget_set_margin_top(vbox, 2);
-  gtk_widget_set_margin_bottom(vbox, 2);
-  gui_dialog_add_content_widget(pdialog->dialog, vbox);
-
-  /* Our nation. */
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>",
-                        nation_plural_for_player(plr0));
-  gtk_label_set_markup(GTK_LABEL(label), buf);
-  g_free(buf);
-  gtk_box_append(GTK_BOX(vbox), label);
-
-  hgrid = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 5);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-
-  /* Our flag */
-  flag_spr = get_nation_flag_sprite(tileset, nation_of_player(plr0));
-
-  pic = gtk_picture_new();
-  picture_set_from_surface(GTK_PICTURE(pic), flag_spr->surface);
-  gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
-
-  /* Our name. */
-  label = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(label, TRUE);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>",
-                        ruler_title_for_player(plr0, plr_buf, sizeof(plr_buf)));
-  gtk_label_set_markup(GTK_LABEL(label), buf);
-  g_free(buf);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-
-  pdialog->pic0 = gtk_picture_new();
-  gtk_grid_attach(GTK_GRID(hgrid), pdialog->pic0, grid_col++, 0, 1, 1);
-
-  /* Menu for clauses: we. */
-  aux_menu = aux_menu_new();
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-
-  menu = create_clause_menu(group, pdialog, plr1, FALSE);
-  gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(menu));
-
-  /* Main table for clauses and (if activated) gold trading: we. */
-  table = gtk_grid_new();
-  gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(table, GTK_ALIGN_CENTER);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 16);
-  gtk_box_append(GTK_BOX(vbox), table);
-
-  if (clause_enabled(CLAUSE_GOLD)) {
-    spin = gtk_spin_button_new_with_range(0.0, plr0->economic.gold + 0.1,
-                                          1.0);
-    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
-    gtk_editable_set_width_chars(GTK_EDITABLE(spin), 16);
-    gtk_grid_attach(GTK_GRID(table), spin, 1, 0, 1, 1);
-    g_object_set_data(G_OBJECT(spin), "plr", plr0);
-    g_signal_connect_after(spin, "value-changed",
-                           G_CALLBACK(diplo_dialog_returnkey), pdialog);
-
-    label = g_object_new(GTK_TYPE_LABEL, "use-underline", TRUE,
-                         "mnemonic-widget", spin, "label", _("Gold:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
-
-    gtk_grid_attach(GTK_GRID(table), aux_menu, 2, 0, 1, 1);
-  } else {
-    gtk_grid_attach(GTK_GRID(table), aux_menu, 0, 0, 1, 1);
-  }
-  gtk_widget_insert_action_group(aux_menu, "win", group);
-
-  /* Them. */
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
-  gtk_widget_set_margin_start(vbox, 2);
-  gtk_widget_set_margin_end(vbox, 2);
-  gtk_widget_set_margin_top(vbox, 2);
-  gtk_widget_set_margin_bottom(vbox, 2);
-  gui_dialog_add_content_widget(pdialog->dialog, vbox);
-
-  /* Their nation. */
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  buf = g_strdup_printf("<span size=\"large\"><u>%s</u></span>",
-                        nation_plural_for_player(plr1));
-  gtk_label_set_markup(GTK_LABEL(label), buf);
-  g_free(buf);
-  gtk_box_append(GTK_BOX(vbox), label);
-
-  hgrid = gtk_grid_new();
-  grid_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 5);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-
-  /* Their flag */
-  flag_spr = get_nation_flag_sprite(tileset, nation_of_player(plr1));
-
-  pic = gtk_picture_new();
-  picture_set_from_surface(GTK_PICTURE(pic), flag_spr->surface);
-  gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
-
-  /* Their name. */
-  label = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(label, TRUE);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  buf = g_strdup_printf("<span size=\"large\" weight=\"bold\">%s</span>",
-                        title_for_player(plr1, plr_buf, sizeof(plr_buf)));
-  gtk_label_set_markup(GTK_LABEL(label), buf);
-  g_free(buf);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-
-  pdialog->pic1 = gtk_picture_new();
-  gtk_grid_attach(GTK_GRID(hgrid), pdialog->pic1, grid_col++, 0, 1, 1);
-
-  /* Menu for clauses: they. */
-  aux_menu = aux_menu_new();
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-
-  menu = create_clause_menu(group, pdialog, plr1, TRUE);
-  gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(menu));
-
-  /* Main table for clauses and (if activated) gold trading: they. */
-  table = gtk_grid_new();
-  gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(table, GTK_ALIGN_CENTER);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 16);
-  gtk_box_append(GTK_BOX(vbox), table);
-
-  if (clause_enabled(CLAUSE_GOLD)) {
-    spin = gtk_spin_button_new_with_range(0.0, plr1->economic.gold + 0.1,
-                                          1.0);
-    gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
-    gtk_editable_set_width_chars(GTK_EDITABLE(spin), 16);
-    gtk_grid_attach(GTK_GRID(table), spin, 1, 0, 1, 1);
-    g_object_set_data(G_OBJECT(spin), "plr", plr1);
-    g_signal_connect_after(spin, "value-changed",
-                           G_CALLBACK(diplo_dialog_returnkey), pdialog);
-
-    label = g_object_new(GTK_TYPE_LABEL, "use-underline", TRUE,
-                         "mnemonic-widget", spin, "label", _("Gold:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
-
-    gtk_grid_attach(GTK_GRID(table), aux_menu, 2, 0, 1, 1);
-  } else {
-    gtk_grid_attach(GTK_GRID(table), aux_menu, 0, 0, 1, 1);
-  }
-  gtk_widget_insert_action_group(aux_menu, "win", group);
-
-  /* Clauses. */
-  mainbox = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(mainbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gui_dialog_add_content_widget(pdialog->dialog, mainbox);
-
-  store = gtk_list_store_new(1, G_TYPE_STRING);
-  pdialog->store = store;
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-  g_object_unref(store);
-  gtk_widget_set_size_request(view, 320, 100);
-
-  rend = gtk_cell_renderer_text_new();
-  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, NULL,
-    rend, "text", 0, NULL);
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_margin_bottom(sw, 2);
-  gtk_widget_set_margin_end(sw, 2);
-  gtk_widget_set_margin_start(sw, 2);
-  gtk_widget_set_margin_top(sw, 2);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "mnemonic-widget", view,
-    "label", _("C_lauses:"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-
-  gtk_grid_attach(GTK_GRID(mainbox), vbox, 0, main_row++, 1, 1);
-  gtk_box_append(GTK_BOX(vbox), label);
-  gtk_box_append(GTK_BOX(vbox), sw);
-
-  gtk_widget_set_visible(mainbox, TRUE);
-
-  g_signal_connect(view, "row_activated", G_CALLBACK(row_callback), pdialog);
-
-  update_diplomacy_dialog(pdialog);
-  gui_dialog_show_all(pdialog->dialog);
-
-  return pdialog;
-}
-
-/************************************************************************//**
-  Update diplomacy dialog
-****************************************************************************/
-static void update_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
-{
-  GtkListStore *store;
-  GtkTreeIter it;
-  bool blank = TRUE;
-  GdkPixbuf *pixbuf;
-
-  store = pdialog->store;
-
-  gtk_list_store_clear(store);
-  clause_list_iterate(pdialog->treaty->clauses, pclause) {
-    char buf[128];
-
-    client_diplomacy_clause_string(buf, sizeof(buf), pclause);
-
-    gtk_list_store_append(store, &it);
-    gtk_list_store_set(store, &it, 0, buf, -1);
-    blank = FALSE;
-  } clause_list_iterate_end;
-
-  if (blank) {
-    gtk_list_store_append(store, &it);
-    gtk_list_store_set(store, &it, 0,
-                       _("--- This treaty is blank. "
-                         "Please add some clauses. ---"), -1);
-  }
-
-  pixbuf = get_thumb_pixbuf(pdialog->treaty->accept0);
-  gtk_picture_set_pixbuf(GTK_PICTURE(pdialog->pic0), pixbuf);
-  g_object_unref(G_OBJECT(pixbuf));
-  pixbuf = get_thumb_pixbuf(pdialog->treaty->accept1);
-  gtk_picture_set_pixbuf(GTK_PICTURE(pdialog->pic1), pixbuf);
-  g_object_unref(G_OBJECT(pixbuf));
-}
-
-/************************************************************************//**
-  Callback for the diplomatic dialog: give tech.
-****************************************************************************/
-static void diplomacy_dialog_tech_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  int giver, dest, other, tech;
-
-  giver = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "player_from"));
-  dest = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(action), "player_to"));
-  tech = GPOINTER_TO_INT(data);
-  if (player_by_number(giver) == client_player()) {
-    other = dest;
-  } else {
-    other = giver;
-  }
-
-  if (A_LAST == tech) {
-    /* All techs. */
-    struct player *pgiver = player_by_number(giver);
-    struct player *pdest = player_by_number(dest);
-    const struct research *dresearch, *gresearch;
-
-    fc_assert_ret(NULL != pgiver);
-    fc_assert_ret(NULL != pdest);
-
-    dresearch = research_get(pdest);
-    gresearch = research_get(pgiver);
-    advance_iterate(padvance) {
-      Tech_type_id i = advance_number(padvance);
-
-      if (research_invention_state(gresearch, i) == TECH_KNOWN
-          && research_invention_gettable(dresearch, i,
-                                         game.info.tech_trade_allow_holes)
-          && (research_invention_state(dresearch, i) == TECH_UNKNOWN
-              || research_invention_state(dresearch, i)
-                 == TECH_PREREQS_KNOWN)) {
-        dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
-                                                 CLAUSE_ADVANCE, i);
-      }
-    } advance_iterate_end;
-  } else {
-    /* Only one tech. */
-    dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
-                                             CLAUSE_ADVANCE, tech);
-  }
-}
-
-/************************************************************************//**
-  Callback for trading cities
-                              - Kris Bubendorfer
-****************************************************************************/
-static void diplomacy_dialog_city_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  struct city_deal *deal_data = (struct city_deal *)data;
-  int other;
-
-  if (player_by_number(deal_data->giver) == client.conn.playing) {
-    other = deal_data->receiver;
-  } else {
-    other = deal_data->giver;
-  }
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn, other, deal_data->giver,
-                                           CLAUSE_CITY, deal_data->id);
-
-  free(deal_data);
-}
-
-/************************************************************************//**
-  Map menu item activated
-****************************************************************************/
-static void diplomacy_dialog_map_callback(GSimpleAction *action, GVariant *parameter,
-                                          gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
-  struct player *pgiver;
-
-  pgiver = (struct player *)g_object_get_data(G_OBJECT(action), "plr");
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pgiver), CLAUSE_MAP, 0);
-}
-
-/************************************************************************//**
-  Seamap menu item activated
-****************************************************************************/
-static void diplomacy_dialog_seamap_callback(GSimpleAction *action, GVariant *parameter,
-                                             gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
-  struct player *pgiver;
-
-  pgiver = (struct player *)g_object_get_data(G_OBJECT(action), "plr");
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pgiver), CLAUSE_SEAMAP,
-                                           0);
-}
-
-/************************************************************************//**
-  Adding pact clause
-****************************************************************************/
-static void diplomacy_dialog_add_pact_clause(gpointer data, int type)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pdialog->treaty->plr0),
-                                           type, 0);
-}
-
-/************************************************************************//**
-  Ceasefire pact menu item activated
-****************************************************************************/
-static void diplomacy_dialog_ceasefire_callback(GSimpleAction *action,
-                                                GVariant *parameter,
-                                                gpointer data)
-{
-  diplomacy_dialog_add_pact_clause(data, CLAUSE_CEASEFIRE);
-}
-
-/************************************************************************//**
-  Peace pact menu item activated
-****************************************************************************/
-static void diplomacy_dialog_peace_callback(GSimpleAction *action,
-                                            GVariant *parameter,
-                                            gpointer data)
-{
-  diplomacy_dialog_add_pact_clause(data, CLAUSE_PEACE);
-}
-
-/************************************************************************//**
-  Alliance pact menu item activated
-****************************************************************************/
-static void diplomacy_dialog_alliance_callback(GSimpleAction *action,
-                                               GVariant *parameter,
-                                               gpointer data)
-{
-  diplomacy_dialog_add_pact_clause(data, CLAUSE_ALLIANCE);
-}
-
-/************************************************************************//**
-  Shared vision menu item activated
-****************************************************************************/
-static void diplomacy_dialog_vision_callback(GSimpleAction *action,
-                                             GVariant *parameter,
-                                             gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *) data;
-  struct player *pgiver;
-
-  pgiver = (struct player *)g_object_get_data(G_OBJECT(action), "plr");
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pgiver), CLAUSE_VISION,
-                                           0);
-}
-
-/************************************************************************//**
-  Embassy menu item activated
-****************************************************************************/
-static void diplomacy_dialog_embassy_callback(GSimpleAction *action,
-                                              GVariant *parameter,
-                                              gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *) data;
-  struct player *pgiver;
-
-  pgiver = (struct player *)g_object_get_data(G_OBJECT(action), "plr");
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pgiver), CLAUSE_EMBASSY,
-                                           0);
-}
-
-/************************************************************************//**
-  Shared tiles menu item activated
-****************************************************************************/
-static void diplomacy_dialog_shared_tiles_callback(GSimpleAction *action,
-                                                   GVariant *parameter,
-                                                   gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *) data;
-  struct player *pgiver;
-
-  pgiver = (struct player *)g_object_get_data(G_OBJECT(action), "plr");
-
-  dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                           player_number(pdialog->treaty->plr1),
-                                           player_number(pgiver),
-                                           CLAUSE_SHARED_TILES,
-                                           0);
-}
-
-/************************************************************************//**
-  Close diplomacy dialog
-****************************************************************************/
-void close_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
-{
-  diplomacy_destroy(pdialog);
-}
-
-/************************************************************************//**
-  Initialize diplomacy dialog
-****************************************************************************/
-void diplomacy_dialog_init(void)
-{
-  dialog_list = dialog_list_new();
-  dipl_main = NULL;
-}
-
-/************************************************************************//**
-  Free resources allocated for diplomacy dialog
-****************************************************************************/
-void diplomacy_dialog_done(void)
-{
-  dialog_list_destroy(dialog_list);
-}
-
-/************************************************************************//**
-  Find diplomacy dialog between player and other player
-****************************************************************************/
-static struct Diplomacy_dialog *find_diplomacy_dialog(struct player *they)
-{
-  struct player *plr0 = client.conn.playing;
-
-  dialog_list_iterate(dialog_list, pdialog) {
-    if ((pdialog->treaty->plr0 == plr0 && pdialog->treaty->plr1 == they)
-        || (pdialog->treaty->plr0 == they && pdialog->treaty->plr1 == plr0)) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/************************************************************************//**
-  User hit enter after entering gold amount
-****************************************************************************/
-static void diplo_dialog_returnkey(GtkWidget *w, gpointer data)
-{
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *) data;
-  struct player *pgiver =
-      (struct player *) g_object_get_data(G_OBJECT(w), "plr");
-  int amount = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w));
-
-  if (amount >= 0 && amount <= pgiver->economic.gold) {
-    dsend_packet_diplomacy_create_clause_req(&client.conn,
-                                             player_number(pdialog->treaty->plr1),
-                                             player_number(pgiver),
-                                             CLAUSE_GOLD, amount);
-  } else {
-    output_window_append(ftc_client, _("Invalid amount of gold specified."));
-  }
-}
-
-/************************************************************************//**
-  Close all dialogs, for when client disconnects from game.
-****************************************************************************/
-void close_all_diplomacy_dialogs(void)
-{
-  while (dialog_list_size(dialog_list) > 0) {
-    close_diplomacy_dialog(dialog_list_get(dialog_list, 0));
-  }
-}
diff --git a/client/gui-gtk-5.0/diplodlg.h b/client/gui-gtk-5.0/diplodlg.h
deleted file mode 100644
index 2170db73d1..0000000000
--- a/client/gui-gtk-5.0/diplodlg.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__DIPLODLG_H
-#define FC__DIPLODLG_H
-
-#include <gtk/gtk.h>
-
-/* client/include */
-#include "diplodlg_g.h"
-
-void diplomacy_dialog_init(void);
-void diplomacy_dialog_done(void);
-
-#endif /* FC__DIPLODLG_H */
diff --git a/client/gui-gtk-5.0/editgui.c b/client/gui-gtk-5.0/editgui.c
deleted file mode 100644
index 696d9d43e4..0000000000
--- a/client/gui-gtk-5.0/editgui.c
+++ /dev/null
@@ -1,1940 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2005 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "connection.h"
-#include "game.h"
-#include "government.h"
-#include "packets.h"
-
-/* client */
-#include "chatline_common.h"
-#include "client_main.h"
-#include "dialogs_g.h"
-#include "editor.h"
-#include "mapview_common.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "editgui.h"
-#include "editprop.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "plrdlg.h"
-#include "sprite.h"
-
-
-enum tool_value_selector_columns {
-  TVS_COL_IMAGE = 0,
-  TVS_COL_ID,
-  TVS_COL_NAME,
-
-  TVS_NUM_COLS
-};
-
-enum player_pov_combo_columns {
-  PPV_COL_FLAG = 0,
-  PPV_COL_NAME,
-  PPV_COL_PLAYER_NO,
-
-  PPV_NUM_COLS
-};
-
-enum tool_applied_player_columns {
-  TAP_COL_FLAG = 0,
-  TAP_COL_NAME,
-  TAP_COL_PLAYER_NO,
-
-  TAP_NUM_COLS
-};
-
-enum spin_button_types {
-  SPIN_BUTTON_SIZE,
-  SPIN_BUTTON_COUNT
-};
-
-struct tool_value_selector {
-  struct editbar *editbar_parent;
-
-  GtkWidget *dialog;
-
-  GtkListStore *store;
-  GtkWidget *view;
-};
-
-static struct tool_value_selector *
-create_tool_value_selector(struct editbar *eb_parent,
-                           enum editor_tool_type ett);
-static void editinfobox_refresh(struct editinfobox *ei);
-static void editbar_player_pov_combobox_changed(GtkComboBox *combo,
-                                                gpointer user_data);
-static void editbar_mode_button_toggled(GtkToggleButton *tb,
-                                        gpointer userdata);
-static void editbar_tool_button_toggled(GtkToggleButton *tb,
-                                        gpointer userdata);
-static void try_to_set_editor_tool(enum editor_tool_type ett);
-
-static struct editbar *editor_toolbar;
-static struct editinfobox *editor_infobox;
-
-/************************************************************************//**
-  Refresh the buttons in the given editbar according to the current
-  editor state.
-****************************************************************************/
-static void refresh_all_buttons(struct editbar *eb)
-{
-  enum editor_tool_type ett;
-  enum editor_tool_mode etm;
-  GtkWidget *tb = NULL;
-  int i;
-
-  if (eb == NULL) {
-    return;
-  }
-
-  ett = editor_get_tool();
-  etm = editor_tool_get_mode(ett);
-
-  for (i = 0; i < NUM_EDITOR_TOOL_MODES; i++) {
-    tb = eb->mode_buttons[i];
-    if (tb == NULL) {
-      continue;
-    }
-    disable_gobject_callback(G_OBJECT(tb),
-                             G_CALLBACK(editbar_mode_button_toggled));
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb), i == etm);
-    enable_gobject_callback(G_OBJECT(tb),
-                            G_CALLBACK(editbar_mode_button_toggled));
-    gtk_widget_set_sensitive(tb, editor_tool_has_mode(ett, i));
-  }
-
-  if (ett < NUM_EDITOR_TOOL_TYPES
-      && eb->tool_buttons[ett] != NULL) {
-    tb = eb->tool_buttons[ett];
-    disable_gobject_callback(G_OBJECT(tb),
-                             G_CALLBACK(editbar_tool_button_toggled));
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb), TRUE);
-    enable_gobject_callback(G_OBJECT(tb),
-                            G_CALLBACK(editbar_tool_button_toggled));
-  }
-}
-
-/************************************************************************//**
-  Callback for all tool mode toggle buttons.
-****************************************************************************/
-static void editbar_mode_button_toggled(GtkToggleButton *tb,
-                                        gpointer userdata)
-{
-  gboolean active;
-  enum editor_tool_mode etm;
-  enum editor_tool_type ett;
-
-  etm = GPOINTER_TO_INT(userdata);
-  if (!(etm < NUM_EDITOR_TOOL_MODES)) {
-    return;
-  }
-
-  active = gtk_toggle_button_get_active(tb);
-  ett = editor_get_tool();
-
-  editor_tool_set_mode(ett, active ? etm : ETM_PAINT);
-  editgui_refresh();
-}
-
-/************************************************************************//**
-  Try to set the given tool as the current editor tool. If the tool is
-  unavailable (editor_tool_is_usable) an error popup is displayed.
-****************************************************************************/
-static void try_to_set_editor_tool(enum editor_tool_type ett)
-{
-  if (!(ett < NUM_EDITOR_TOOL_TYPES)) {
-    return;
-  }
-
-  if (!editor_tool_is_usable(ett)) {
-    GtkWidget *dialog;
-
-    dialog = gtk_message_dialog_new(GTK_WINDOW(toplevel),
-        GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-        GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
-        _("The current ruleset does not define any "
-          "objects corresponding to this editor tool."));
-    gtk_window_set_title(GTK_WINDOW(dialog), editor_tool_get_name(ett));
-    blocking_dialog(dialog);
-    gtk_window_destroy(GTK_WINDOW(dialog));
-  } else {
-    editor_set_tool(ett);
-  }
-}
-
-/************************************************************************//**
-  Callback to handle toggling of any of the tool buttons.
-****************************************************************************/
-static void editbar_tool_button_toggled(GtkToggleButton *tb,
-                                        gpointer userdata)
-{
-  gboolean active;
-  enum editor_tool_type ett;
-
-  active = gtk_toggle_button_get_active(tb);
-  ett = GPOINTER_TO_INT(userdata);
-
-  if (active) {
-    try_to_set_editor_tool(ett);
-    editgui_refresh();
-  }
-}
-
-/************************************************************************//**
-  Refresh the player point-of-view indicator based on the client and
-  editor state.
-
-  NB: The convention is that the first entry (index 0) in the combo box
-  corresponds to the "global observer".
-****************************************************************************/
-static void refresh_player_pov_indicator(struct editbar *eb)
-{
-  GtkListStore *store;
-  GdkPixbuf *flag;
-  GtkTreeIter iter;
-  GtkWidget *combo;
-  int index = -1, i;
-
-  if (eb == NULL || eb->player_pov_store == NULL) {
-    return;
-  }
-
-  store = eb->player_pov_store;
-  gtk_list_store_clear(store);
-
-  gtk_list_store_append(store, &iter);
-  gtk_list_store_set(store, &iter, PPV_COL_NAME, _("Global Observer"),
-                     PPV_COL_PLAYER_NO, -1, -1);
-
-  i = 1;
-  players_iterate(pplayer) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter, PPV_COL_NAME, player_name(pplayer),
-                       PPV_COL_PLAYER_NO, player_number(pplayer), -1);
-
-    if (pplayer->nation != NO_NATION_SELECTED) {
-      flag = get_flag(pplayer->nation);
-
-      if (flag != NULL) {
-        gtk_list_store_set(store, &iter, PPV_COL_FLAG, flag, -1);
-        g_object_unref(flag);
-      }
-    }
-    if (pplayer == client_player()) {
-      index = i;
-    }
-    i++;
-  } players_iterate_end;
-
-  if (client_is_global_observer()) {
-    index = 0;
-  }
-
-  combo = eb->player_pov_combobox;
-  gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
-}
-
-/************************************************************************//**
-  Callback to handle selection of a player/global observer in the
-  player pov indicator.
-
-  NB: The convention is that the first entry (index 0) in the combo box
-  corresponds to the "global observer".
-****************************************************************************/
-static void editbar_player_pov_combobox_changed(GtkComboBox *combo,
-                                                gpointer user_data)
-{
-  struct editbar *eb = user_data;
-  int id;
-  struct player *pplayer;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-
-  if (eb == NULL || eb->widget == NULL
-      || !gtk_widget_get_visible(eb->widget)) {
-    return;
-  }
-
-  if (!gtk_combo_box_get_active_iter(combo, &iter)) {
-    return;
-  }
-
-  model = gtk_combo_box_get_model(combo);
-  gtk_tree_model_get(model, &iter, PPV_COL_PLAYER_NO, &id, -1);
-
-  if ((client_is_global_observer() && id == -1)
-      || client_player_number() == id) {
-    return;
-  }
-
-  /* Ugh... hard-coded server command strings. :( */
-  if (id == -1) {
-    send_chat("/observe");
-    return;
-  }
-
-  pplayer = player_by_number(id);
-  if (pplayer != NULL) {
-    send_chat_printf("/take \"%s\"", pplayer->name);
-  }
-}
-
-/************************************************************************//**
-  Run the tool value selection dialog and return the value ID selected.
-  Returns -1 if cancelled.
-****************************************************************************/
-static int tool_value_selector_run(struct tool_value_selector *tvs)
-{
-  gint res;
-  GtkWidget *dialog;
-  GtkTreeSelection *sel;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  int id;
-
-  if (tvs == nullptr) {
-    return -1;
-  }
-
-  dialog = tvs->dialog;
-  res = blocking_dialog(dialog);
-  gtk_widget_set_visible(dialog, FALSE);
-
-  if (res != GTK_RESPONSE_ACCEPT) {
-    return -1;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tvs->view));
-  if (!gtk_tree_selection_get_selected(sel, &model, &iter)) {
-    return -1;
-  }
-
-  gtk_tree_model_get(model, &iter, TVS_COL_ID, &id, -1);
-
-  return id;
-}
-
-/************************************************************************//**
-  Run the tool value selector for the given tool type. Sets the editor state
-  and refreshes the editor GUI depending on the user's choices.
-
-  Returns FALSE if running the dialog is not possible.
-****************************************************************************/
-static bool editgui_run_tool_selection(enum editor_tool_type ett)
-{
-  struct editbar *eb;
-  struct tool_value_selector *tvs;
-  int res = -1;
-
-  eb = editgui_get_editbar();
-  if (eb == NULL || !(ett < NUM_EDITOR_TOOL_TYPES)) {
-    return FALSE;
-  }
-
-  if (!editor_tool_has_value(ett)) {
-    return FALSE;
-  }
-
-  tvs = eb->tool_selectors[ett];
-  if (!tvs) {
-    return FALSE;
-  }
-
-  res = tool_value_selector_run(tvs);
-
-  if (res >= 0) {
-    editor_tool_set_value(ett, res);
-    editinfobox_refresh(editgui_get_editinfobox());
-  }
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Handle a mouse click on any of the tool buttons.
-****************************************************************************/
-static gboolean editbar_tool_right_button(GtkGestureClick *gesture,
-                                          int n_press,
-                                          double x, double y, gpointer data)
-{
-  return editgui_run_tool_selection(GPOINTER_TO_INT(data));
-}
-
-/************************************************************************//**
-  A helper function to create a toolbar button for the given editor tool.
-  Packs the newly created button into the hbox 'eb->widget'.
-****************************************************************************/
-static void editbar_add_tool_button(struct editbar *eb,
-                                    enum editor_tool_type ett)
-{
-  GdkPixbuf *pixbuf;
-  GtkWidget *pic, *button, *hbox;
-  GtkToggleButton *parent = NULL;
-  struct sprite *sprite;
-  int i;
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  if (!eb || !(ett < NUM_EDITOR_TOOL_TYPES)) {
-    return;
-  }
-
-  for (i = 0; i < NUM_EDITOR_TOOL_TYPES; i++) {
-    if (eb->tool_buttons[i] != NULL) {
-      parent = GTK_TOGGLE_BUTTON(eb->tool_buttons[i]);
-      break;
-    }
-  }
-
-  if (parent == NULL) {
-    button = gtk_toggle_button_new();
-  } else {
-    button = gtk_toggle_button_new();
-    gtk_toggle_button_set_group(GTK_TOGGLE_BUTTON(button),
-                                GTK_TOGGLE_BUTTON(parent));
-  }
-
-  sprite = editor_tool_get_sprite(ett);
-  fc_assert_ret(sprite != NULL);
-  pixbuf = sprite_get_pixbuf(sprite);
-  pic = gtk_picture_new_for_pixbuf(pixbuf);
-  g_object_unref(G_OBJECT(pixbuf));
-
-  gtk_button_set_child(GTK_BUTTON(button), pic);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
-  gtk_widget_set_tooltip_text(button, editor_tool_get_tooltip(ett));
-  gtk_size_group_add_widget(eb->size_group, button);
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_widget_set_focus_on_click(button, FALSE);
-
-  g_signal_connect(button, "toggled",
-                   G_CALLBACK(editbar_tool_button_toggled),
-                   GINT_TO_POINTER(ett));
-
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(editbar_tool_right_button),
-                   GINT_TO_POINTER(ett));
-  gtk_widget_add_controller(button, controller);
-
-  hbox = eb->widget;
-  gtk_box_append(GTK_BOX(hbox), button);
-  eb->tool_buttons[ett] = button;
-
-  if (editor_tool_has_value(ett)) {
-    eb->tool_selectors[ett] = create_tool_value_selector(eb, ett);
-  }
-}
-
-/************************************************************************//**
-  Handle a click on the player properties button in the editor toolbar.
-****************************************************************************/
-static void editbar_player_properties_button_clicked(GtkButton *b,
-                                                     gpointer userdata)
-{
-  struct property_editor *pe;
-
-  pe = editprop_get_property_editor();
-  property_editor_reload(pe, OBJTYPE_GAME);
-  property_editor_reload(pe, OBJTYPE_PLAYER);
-  property_editor_popup(pe, OBJTYPE_PLAYER);
-}
-
-/************************************************************************//**
-  Helper function to add a tool mode button to the editor toolbar. The
-  button will be packed into the start of the hbox 'eb->widget'.
-****************************************************************************/
-static void editbar_add_mode_button(struct editbar *eb,
-                                    enum editor_tool_mode etm)
-{
-  GdkPixbuf *pixbuf;
-  GtkWidget *pic, *button, *hbox;
-  struct sprite *sprite;
-  const char *tooltip;
-
-  if (!eb || !(etm < NUM_EDITOR_TOOL_MODES)) {
-    return;
-  }
-
-  button = gtk_toggle_button_new();
-
-  sprite = editor_get_mode_sprite(etm);
-  fc_assert_ret(sprite != NULL);
-  pixbuf = sprite_get_pixbuf(sprite);
-  pic = gtk_picture_new_for_pixbuf(pixbuf);
-  g_object_unref(G_OBJECT(pixbuf));
-
-  gtk_button_set_child(GTK_BUTTON(button), pic);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
-  tooltip = editor_get_mode_tooltip(etm);
-  if (tooltip != NULL) {
-    gtk_widget_set_tooltip_text(button, tooltip);
-  }
-  gtk_size_group_add_widget(eb->size_group, button);
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_widget_set_focus_on_click(button, FALSE);
-
-  g_signal_connect(button, "toggled",
-                   G_CALLBACK(editbar_mode_button_toggled),
-                   GINT_TO_POINTER(etm));
-
-  hbox = eb->widget;
-  gtk_box_append(GTK_BOX(hbox), button);
-  eb->mode_buttons[etm] = button;
-}
-
-/************************************************************************//**
-  Create and return an editor toolbar.
-****************************************************************************/
-static struct editbar *editbar_create(void)
-{
-  struct editbar *eb;
-  GtkWidget *hbox, *button, *combo, *pic, *separator, *vgrid;
-  GtkListStore *store;
-  GtkCellRenderer *cell;
-  GdkPixbuf *pixbuf;
-  const struct editor_sprites *sprites;
-  int grid_row = 0;
-
-  eb = fc_calloc(1, sizeof(struct editbar));
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-  eb->widget = hbox;
-  eb->size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-
-  sprites = get_editor_sprites(tileset);
-
-  editbar_add_mode_button(eb, ETM_ERASE);
-
-  separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
-  gtk_box_append(GTK_BOX(hbox), separator);
-
-  editbar_add_tool_button(eb, ETT_TERRAIN);
-  editbar_add_tool_button(eb, ETT_TERRAIN_RESOURCE);
-  editbar_add_tool_button(eb, ETT_TERRAIN_SPECIAL);
-  editbar_add_tool_button(eb, ETT_ROAD);
-  editbar_add_tool_button(eb, ETT_MILITARY_BASE);
-  editbar_add_tool_button(eb, ETT_UNIT);
-  editbar_add_tool_button(eb, ETT_CITY);
-  editbar_add_tool_button(eb, ETT_VISION);
-  editbar_add_tool_button(eb, ETT_STARTPOS);
-  editbar_add_tool_button(eb, ETT_COPYPASTE);
-
-  separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
-  gtk_box_append(GTK_BOX(hbox), separator);
-
-  /* Player POV indicator. */
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_box_append(GTK_BOX(hbox), vgrid);
-
-  store = gtk_list_store_new(PPV_NUM_COLS,
-                             GDK_TYPE_PIXBUF,
-                             G_TYPE_STRING,
-                             G_TYPE_INT);
-  eb->player_pov_store = store;
-
-  combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-
-  cell = gtk_cell_renderer_pixbuf_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, FALSE);
-  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
-                                cell, "pixbuf", PPV_COL_FLAG);
-
-  cell = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
-  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
-                                cell, "text", PPV_COL_NAME);
-
-  gtk_widget_set_size_request(combo, 140, -1);
-  g_signal_connect(combo, "changed",
-                   G_CALLBACK(editbar_player_pov_combobox_changed), eb);
-
-  gtk_widget_set_tooltip_text(combo,
-      _("Switch player point-of-view. Use this to edit "
-        "from the perspective of different players, or "
-        "even as a global observer."));
-  gtk_grid_attach(GTK_GRID(vgrid), combo, 0, grid_row++, 1, 1);
-  eb->player_pov_combobox = combo;
-
-  /* Property editor button. */
-  button = gtk_button_new();
-  pixbuf = sprite_get_pixbuf(sprites->properties);
-  pic = gtk_picture_new_for_pixbuf(pixbuf);
-  g_object_unref(G_OBJECT(pixbuf));
-  gtk_button_set_child(GTK_BUTTON(button), pic);
-  gtk_widget_set_tooltip_text(button, _("Show the property editor."));
-  gtk_size_group_add_widget(eb->size_group, button);
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_widget_set_focus_on_click(button, FALSE);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(editbar_player_properties_button_clicked), eb);
-  gtk_box_append(GTK_BOX(hbox), button);
-
-  return eb;
-}
-
-/************************************************************************//**
-  Refresh the tool value selector in the given toolbar for the given tool
-  type with data from the editor state.
-****************************************************************************/
-static void refresh_tool_value_selector(struct editbar *eb,
-                                        enum editor_tool_type ett)
-{
-  GtkTreeSelection *sel;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  int value, store_value;
-  struct tool_value_selector *tvs;
-
-  if (!editor_is_active() || !eb || !editor_tool_has_value(ett)) {
-    return;
-  }
-
-  tvs = eb->tool_selectors[ett];
-
-  if (!tvs) {
-    return;
-  }
-
-  value = editor_tool_get_value(ett);
-  model = GTK_TREE_MODEL(tvs->store);
-  if (!gtk_tree_model_get_iter_first(model, &iter)) {
-    return;
-  }
-
-  do {
-    gtk_tree_model_get(model, &iter, TVS_COL_ID, &store_value, -1);
-    if (value == store_value) {
-      sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tvs->view));
-      gtk_tree_selection_select_iter(sel, &iter);
-      break;
-    }
-  } while (gtk_tree_model_iter_next(model, &iter));
-}
-
-/************************************************************************//**
-  Refresh all tool value selectors in the given toolbar according to the
-  current editor state.
-****************************************************************************/
-static void refresh_all_tool_value_selectors(struct editbar *eb)
-{
-  int ett;
-
-  if (!eb) {
-    return;
-  }
-
-  for (ett = 0; ett < NUM_EDITOR_TOOL_TYPES; ett++) {
-    if (editor_tool_has_value(ett)) {
-      refresh_tool_value_selector(eb, ett);
-    }
-  }
-}
-
-/************************************************************************//**
-  Refresh the given toolbar according to the current editor state.
-****************************************************************************/
-static void editbar_refresh(struct editbar *eb)
-{
-  if (eb == nullptr || eb->widget == nullptr) {
-    return;
-  }
-
-  if (!editor_is_active()) {
-    gtk_widget_set_visible(eb->widget, FALSE);
-    return;
-  }
-
-  refresh_all_buttons(eb);
-  refresh_all_tool_value_selectors(eb);
-  refresh_player_pov_indicator(eb);
-
-  gtk_widget_set_visible(eb->widget, TRUE);
-}
-
-/************************************************************************//**
-  Create a pixbuf containing a representative image for the given terrain
-  type, to be used as an icon in the GUI.
-
-  May return NULL on error.
-
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-static GdkPixbuf *create_terrain_pixbuf(struct terrain *pterrain)
-{
-  int w, h, i;
-  GdkPixbuf *pixbuf;
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  cairo_t *cr;
-
-  w = tileset_tile_width(tileset);
-  h = tileset_tile_height(tileset);
-
-  canvas.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
-
-  cr = cairo_create(canvas.surface);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  for (i = 0; i < 3; i++) {
-    struct drawn_sprite sprs[80];
-    int count = fill_basic_terrain_layer_sprite_array(tileset, sprs,
-                                                      i, pterrain);
-
-    put_drawn_sprites(&canvas, 1.0, 0, 0, count, sprs, FALSE);
-  }
-
-  pixbuf = surface_get_pixbuf(canvas.surface, w, h);
-  cairo_surface_destroy(canvas.surface);
-
-  return pixbuf;
-}
-
-/************************************************************************//**
-  Clear icons from tool store, and the store itself.
-****************************************************************************/
-static void clear_tool_store(GtkListStore *store)
-{
-  GtkTreeIter iter;
-  GtkTreeModel *model = GTK_TREE_MODEL(store);
-
-  if (gtk_tree_model_get_iter_first(model, &iter)) {
-    do {
-      GdkPixbuf *pixbuf;
-
-      gtk_tree_model_get(model, &iter, TVS_COL_IMAGE, &pixbuf, -1);
-      if (pixbuf != NULL) {
-        g_object_unref(pixbuf);
-      }
-    } while (gtk_tree_model_iter_next(model, &iter));
-  }
-
-  gtk_list_store_clear(store);
-}
-
-/************************************************************************//**
-  Clears all stores from the editbar.
-****************************************************************************/
-static void clear_tool_stores(struct editbar *eb)
-{
-  clear_tool_store(eb->tool_selectors[ETT_TERRAIN]->store);
-  clear_tool_store(eb->tool_selectors[ETT_TERRAIN_RESOURCE]->store);
-  clear_tool_store(eb->tool_selectors[ETT_TERRAIN_SPECIAL]->store);
-  clear_tool_store(eb->tool_selectors[ETT_ROAD]->store);
-  clear_tool_store(eb->tool_selectors[ETT_MILITARY_BASE]->store);
-  clear_tool_store(eb->tool_selectors[ETT_UNIT]->store);
-}
-
-/************************************************************************//**
-  Reload all tool value data from the tileset for the given toolbar.
-****************************************************************************/
-static void editbar_reload_tileset(struct editbar *eb)
-{
-  GtkTreeIter iter;
-  GtkListStore *store;
-  GdkPixbuf *pixbuf;
-  struct sprite *sprite;
-  struct tool_value_selector *tvs;
-
-  if (eb == NULL || tileset == NULL) {
-    return;
-  }
-
-  clear_tool_stores(eb);
-
-  /* Reload terrains. */
-
-  tvs = eb->tool_selectors[ETT_TERRAIN];
-  store = tvs->store;
-
-  terrain_type_iterate(pterrain) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, terrain_number(pterrain),
-                       TVS_COL_NAME, terrain_name_translation(pterrain),
-                       -1);
-    pixbuf = create_terrain_pixbuf(pterrain);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(pixbuf);
-    }
-  } terrain_type_iterate_end;
-
-
-  /* Reload terrain resources. */
-
-  tvs = eb->tool_selectors[ETT_TERRAIN_RESOURCE];
-  store = tvs->store;
-
-  extra_type_by_cause_iterate(EC_RESOURCE, pextra) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, extra_index(pextra),
-                       TVS_COL_NAME, extra_name_translation(pextra),
-                       -1);
-    pixbuf = create_extra_pixbuf(pextra);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(pixbuf);
-    }
-  } extra_type_by_cause_iterate_end;
-
-  /* Reload terrain specials. */
-
-  tvs = eb->tool_selectors[ETT_TERRAIN_SPECIAL];
-  store = tvs->store;
-
-  extra_type_by_cause_iterate(EC_SPECIAL, pextra) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, extra_index(pextra),
-                       TVS_COL_NAME, extra_name_translation(pextra),
-                       -1);
-    pixbuf = create_extra_pixbuf(pextra);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(pixbuf);
-    }
-  } extra_type_by_cause_iterate_end;
-
-  /* Reload roads. */
-
-  tvs = eb->tool_selectors[ETT_ROAD];
-  store = tvs->store;
-
-  extra_type_by_cause_iterate(EC_ROAD, pextra) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, extra_index(pextra),
-                       TVS_COL_NAME, extra_name_translation(pextra),
-                       -1);
-    pixbuf = create_extra_pixbuf(pextra);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(pixbuf);
-    }
-  } extra_type_by_cause_iterate_end;
-
-  /* Reload military bases. */
-
-  tvs = eb->tool_selectors[ETT_MILITARY_BASE];
-  store = tvs->store;
-
-  extra_type_by_cause_iterate(EC_BASE, pextra) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, extra_index(pextra),
-                       TVS_COL_NAME, extra_name_translation(pextra),
-                       -1);
-    pixbuf = create_extra_pixbuf(pextra);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(pixbuf);
-    }
-  } extra_type_by_cause_iterate_end;
-
-
-  /* Reload unit types. */
-
-  tvs = eb->tool_selectors[ETT_UNIT];
-  store = tvs->store;
-
-  unit_type_iterate(putype) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TVS_COL_ID, utype_number(putype),
-                       TVS_COL_NAME, utype_name_translation(putype),
-                       -1);
-    sprite = get_unittype_sprite(tileset, putype,
-                                 ACTIVITY_LAST, direction8_invalid());
-    if (sprite == NULL) {
-      continue;
-    }
-    pixbuf = sprite_get_pixbuf(sprite);
-    if (pixbuf != NULL) {
-      gtk_list_store_set(store, &iter, TVS_COL_IMAGE, pixbuf, -1);
-      g_object_unref(G_OBJECT(pixbuf));
-    }
-  } unit_type_iterate_end;
-}
-
-/************************************************************************//**
-  Convert gdk modifier values to editor modifier values.
-****************************************************************************/
-static int convert_modifiers(int gdk_event_state)
-{
-  int modifiers = EKM_NONE;
-
-  if (gdk_event_state & GDK_SHIFT_MASK) {
-    modifiers |= EKM_SHIFT;
-  }
-  if (gdk_event_state & GDK_CONTROL_MASK) {
-    modifiers |= EKM_CTRL;
-  }
-  if (gdk_event_state & GDK_ALT_MASK) {
-    modifiers |= EKM_ALT;
-  }
-
-  return modifiers;
-}
-
-/************************************************************************//**
-  Pass on the gdk mouse event to the editor's handler.
-****************************************************************************/
-gboolean handle_edit_mouse_button_press(GtkGestureClick *gesture,
-                                        int editor_mouse_button,
-                                        double x, double y)
-{
-  GdkModifierType state;
-
-  state = gtk_event_controller_get_current_event_state(
-                            GTK_EVENT_CONTROLLER(gesture));
-  editor_mouse_button_press(x, y, editor_mouse_button,
-                            convert_modifiers(state));
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Pass on the gdk mouse event to the editor's handler.
-****************************************************************************/
-gboolean handle_edit_mouse_button_release(GtkGestureClick *gesture,
-                                          int editor_mouse_button,
-                                          double x, double y)
-{
-  GdkModifierType state;
-
-  state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
-  editor_mouse_button_release(x, y,
-                              editor_mouse_button,
-                              convert_modifiers(state));
-  return TRUE;
-}
-
-/************************************************************************//**
-  Pass on the gdk mouse event to the editor's handler.
-****************************************************************************/
-gboolean handle_edit_mouse_move(GtkEventControllerMotion *controller,
-                                gdouble x, gdouble y)
-{
-  GdkModifierType state;
-
-  state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(controller));
-  editor_mouse_move(x, y, convert_modifiers(state));
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Handle a double-click on the tool value list.
-****************************************************************************/
-static void tool_value_selector_treeview_row_activated(GtkTreeView *view,
-                                                       GtkTreePath *path,
-                                                       GtkTreeViewColumn *col,
-                                                       gpointer user_data)
-{
-  struct tool_value_selector *tvs = user_data;
-
-  gtk_dialog_response(GTK_DIALOG(tvs->dialog), GTK_RESPONSE_ACCEPT);
-}
-
-/************************************************************************//**
-  Create a tool value selection dialog for the given toolbar.
-****************************************************************************/
-static struct tool_value_selector *
-create_tool_value_selector(struct editbar *eb,
-                           enum editor_tool_type ett)
-{
-  struct tool_value_selector *tvs;
-  GtkWidget *vbox, *view, *scrollwin;
-  GtkCellRenderer *cell;
-  GtkListStore *store;
-  GtkTreeViewColumn *col;
-  GtkTreeSelection *sel;
-
-  tvs = fc_calloc(1, sizeof(struct tool_value_selector));
-
-  tvs->editbar_parent = eb;
-
-  tvs->dialog = gtk_dialog_new_with_buttons(_("Select Tool Value"),
-                                            GTK_WINDOW(toplevel),
-                                            GTK_DIALOG_MODAL,
-                                            _("_OK"), GTK_RESPONSE_ACCEPT,
-                                            _("_Cancel"), GTK_RESPONSE_REJECT,
-                                            NULL);
-  vbox = gtk_dialog_get_content_area(GTK_DIALOG(tvs->dialog));
-
-  store = gtk_list_store_new(TVS_NUM_COLS,
-                             GDK_TYPE_PIXBUF,
-                             G_TYPE_INT,
-                             G_TYPE_STRING);
-  tvs->store = store;
-
-  scrollwin = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
-                                 GTK_POLICY_NEVER,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrollwin),
-                                             10 * tileset_tile_height(tileset));
-  gtk_box_insert_child_after(GTK_BOX(vbox), scrollwin, NULL);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(tvs->store));
-  gtk_widget_set_size_request(view, -1, 10 * tileset_tile_height(tileset));
-  gtk_tree_view_set_search_column(GTK_TREE_VIEW(view), TVS_COL_NAME);
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(tool_value_selector_treeview_row_activated), tvs);
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
-
-  cell = gtk_cell_renderer_pixbuf_new();
-  col = gtk_tree_view_column_new_with_attributes(editor_tool_get_name(ett),
-                                                 cell, "pixbuf",
-                                                 TVS_COL_IMAGE, NULL);
-  gtk_tree_view_column_set_resizable(col, FALSE);
-  gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-  gtk_tree_view_column_set_reorderable(col, FALSE);
-  gtk_tree_view_column_set_clickable(col, FALSE);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  cell = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes("ID", cell,
-                                                 "text", TVS_COL_ID, NULL);
-  gtk_tree_view_column_set_resizable(col, FALSE);
-  gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-  gtk_tree_view_column_set_reorderable(col, FALSE);
-  gtk_tree_view_column_set_clickable(col, FALSE);
-  gtk_tree_view_column_set_sort_column_id(col, TVS_COL_ID);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  cell = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes("Name", cell,
-                                                 "text", TVS_COL_NAME, NULL);
-  gtk_tree_view_column_set_resizable(col, FALSE);
-  gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-  gtk_tree_view_column_set_reorderable(col, FALSE);
-  gtk_tree_view_column_set_clickable(col, FALSE);
-  gtk_tree_view_column_set_sort_column_id(col, TVS_COL_NAME);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin), view);
-  tvs->view = view;
-
-  /* Show everything but the window itself. */
-  gtk_widget_set_visible(vbox, TRUE);
-
-  return tvs;
-}
-
-/************************************************************************//**
-  Handle a mouse click on the tool image area in the editor info box.
-****************************************************************************/
-static gboolean editinfobox_handle_tool_image_button_press(
-                                                    GtkGestureClick *gesture,
-                                                    int n_press,
-                                                    double x, double y)
-{
-  editgui_run_tool_selection(editor_get_tool());
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Handle a mouse click on the mode image area in the editor info box.
-****************************************************************************/
-static gboolean editinfobox_handle_mode_image_button_press(
-                                                    GtkGestureClick *gesture,
-                                                    int n_press,
-                                                    double x, double y)
-{
-  editor_tool_cycle_mode(editor_get_tool());
-  editgui_refresh();
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Callback for spin button changes in the editor info box.
-****************************************************************************/
-static void editinfobox_spin_button_value_changed(GtkSpinButton *spinbutton,
-                                                  gpointer userdata)
-{
-  struct editinfobox *ei;
-  int which, value;
-  enum editor_tool_type ett;
-
-  ei = editgui_get_editinfobox();
-
-  if (!ei) {
-    return;
-  }
-
-  value = gtk_spin_button_get_value_as_int(spinbutton);
-  which = GPOINTER_TO_INT(userdata);
-  ett = editor_get_tool();
-
-  switch (which) {
-  case SPIN_BUTTON_SIZE:
-    editor_tool_set_size(ett, value);
-    break;
-  case SPIN_BUTTON_COUNT:
-    editor_tool_set_count(ett, value);
-    break;
-  default:
-    return;
-    break;
-  }
-
-  editinfobox_refresh(ei);
-}
-
-/************************************************************************//**
-  Callback for changes in the applied player combobox in the editor
-  info box.
-****************************************************************************/
-static void editinfobox_tool_applied_player_changed(GtkComboBox *combo,
-                                                    gpointer userdata)
-{
-  struct editinfobox *ei = userdata;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  int player_no = -1;
-
-  if (ei == NULL) {
-    return;
-  }
-
-  if (!gtk_combo_box_get_active_iter(combo, &iter)) {
-    return;
-  }
-
-  model = gtk_combo_box_get_model(combo);
-  gtk_tree_model_get(model, &iter, TAP_COL_PLAYER_NO, &player_no, -1);
-
-  editor_tool_set_applied_player(editor_get_tool(), player_no);
-}
-
-/************************************************************************//**
-  Create and return an editor info box widget bundle.
-****************************************************************************/
-static struct editinfobox *editinfobox_create(void)
-{
-  GtkWidget *label, *vbox, *frame, *hgrid, *vbox2, *pic;
-  GtkWidget *spin, *combo;
-  GtkListStore *store;
-  GtkCellRenderer *cell;
-  GtkEventController *controller;
-  struct editinfobox *ei;
-  char buf[128];
-  int grid_col = 0;
-
-  ei = fc_calloc(1, sizeof(*ei));
-
-  /* If you turn this to something else than GtkFrame, also adjust
-   * editgui.c replace_widget() code that replaces widget in it. */
-  frame = gtk_frame_new(_("Editor Tool"));
-  gtk_widget_set_margin_start(frame, 4);
-  gtk_widget_set_margin_end(frame, 4);
-  gtk_widget_set_margin_top(frame, 4);
-  gtk_widget_set_margin_bottom(frame, 4);
-  ei->widget = frame;
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
-  gtk_widget_set_margin_start(vbox, 4);
-  gtk_widget_set_margin_end(vbox, 4);
-  gtk_widget_set_margin_top(vbox, 4);
-  gtk_widget_set_margin_bottom(vbox, 4);
-  gtk_frame_set_child(GTK_FRAME(frame), vbox);
-
-  /* Tool section */
-  hgrid = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-
-  pic = gtk_picture_new();
-  gtk_widget_set_tooltip_text(pic, _("Click to change value if applicable."));
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(editinfobox_handle_tool_image_button_press),
-                   NULL);
-  gtk_widget_add_controller(pic, controller);
-
-  gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
-  ei->tool_pic = pic;
-
-  vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-  gtk_grid_attach(GTK_GRID(hgrid), vbox2, grid_col++, 0, 1, 1);
-
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(vbox2), label);
-  ei->tool_label = label;
-
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(vbox2), label);
-  ei->tool_value_label = label;
-
-  /* Mode section */
-  hgrid = gtk_grid_new();
-  grid_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-
-  pic = gtk_picture_new();
-  gtk_widget_set_tooltip_text(pic, _("Click to change tool mode."));
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(editinfobox_handle_mode_image_button_press),
-                   NULL);
-  gtk_widget_add_controller(pic, controller);
-
-  gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
-  ei->mode_pic = pic;
-
-  vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-  gtk_grid_attach(GTK_GRID(hgrid), vbox2, grid_col++, 0, 1, 1);
-
-  label = gtk_label_new(NULL);
-  fc_snprintf(buf, sizeof(buf), "<span weight=\"bold\">%s</span>",
-              _("Mode"));
-  gtk_label_set_markup(GTK_LABEL(label), buf);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(vbox2), label);
-
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(vbox2), label);
-  ei->mode_label = label;
-
-  /* Spinner section */
-  hgrid = gtk_grid_new();
-  grid_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-  ei->size_hbox = hgrid;
-  spin = gtk_spin_button_new_with_range(1, 255, 1);
-  gtk_widget_set_tooltip_text(spin,
-      _("Use this to change the \"size\" parameter for the tool. "
-        "This parameter controls for example the half-width "
-        "of the square of tiles that will be affected by the "
-        "tool, or the size of a created city."));
-  g_signal_connect(spin, "value-changed",
-                   G_CALLBACK(editinfobox_spin_button_value_changed),
-                   GINT_TO_POINTER(SPIN_BUTTON_SIZE));
-  gtk_grid_attach(GTK_GRID(hgrid), spin, grid_col++, 0, 1, 1);
-  ei->size_spin_button = spin;
-  label = gtk_label_new(_("Size"));
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-
-  hgrid = gtk_grid_new();
-  grid_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
-  gtk_box_append(GTK_BOX(vbox), hgrid);
-  ei->count_hbox = hgrid;
-  spin = gtk_spin_button_new_with_range(1, 255, 1);
-  gtk_widget_set_tooltip_text(spin,
-      _("Use this to change the tool's \"count\" parameter. "
-        "This controls for example how many units are placed "
-        "at once with the unit tool."));
-  g_signal_connect(spin, "value-changed",
-                   G_CALLBACK(editinfobox_spin_button_value_changed),
-                   GINT_TO_POINTER(SPIN_BUTTON_COUNT));
-  gtk_grid_attach(GTK_GRID(hgrid), spin, grid_col++, 0, 1, 1);
-  ei->count_spin_button = spin;
-  label = gtk_label_new(_("Count"));
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-
-  /* combo section */
-  store = gtk_list_store_new(TAP_NUM_COLS,
-                             GDK_TYPE_PIXBUF,
-                             G_TYPE_STRING,
-                             G_TYPE_INT);
-  ei->tool_applied_player_store = store;
-  combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-
-  cell = gtk_cell_renderer_pixbuf_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, FALSE);
-  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
-                                cell, "pixbuf", TAP_COL_FLAG);
-
-  cell = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
-  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
-                                cell, "text", TAP_COL_NAME);
-
-  gtk_widget_set_size_request(combo, 132, -1);
-  g_signal_connect(combo, "changed",
-                   G_CALLBACK(editinfobox_tool_applied_player_changed), ei);
-
-  gtk_widget_set_tooltip_text(combo,
-      _("Use this to change the \"applied player\" tool parameter. "
-        "This controls for example under which player units and cities "
-        "are created."));
-  gtk_box_append(GTK_BOX(vbox), combo);
-  ei->tool_applied_player_combobox = combo;
-
-  /* We add a ref to the editinfobox widget so that it is
-   * not destroyed when replaced by the unit info box when
-   * we leave edit mode. See editinfobox_refresh() call to replace_widget() */
-  g_object_ref(ei->widget);
-
-  /* The edit info box starts with no parent, so we have to
-   * show its internal widgets manually. */
-  gtk_widget_set_visible(ei->widget, TRUE);
-
-  return ei;
-}
-
-/************************************************************************//**
-  Refresh the given editinfobox's applied player combobox according to the
-  current editor state.
-****************************************************************************/
-static void refresh_tool_applied_player_combo(struct editinfobox *ei)
-{
-  enum editor_tool_type ett;
-  GtkListStore *store;
-  GtkWidget *combo;
-  GtkTreeIter iter;
-  GdkPixbuf *flag;
-  int apno, index, i;
-
-  if (!ei) {
-    return;
-  }
-
-  ett = editor_get_tool();
-  combo = ei->tool_applied_player_combobox;
-  store = ei->tool_applied_player_store;
-
-  if (!combo || !store) {
-    return;
-  }
-
-  if (!editor_tool_has_applied_player(ett)) {
-    gtk_widget_set_visible(combo, FALSE);
-    return;
-  }
-
-  gtk_list_store_clear(store);
-
-  apno = editor_tool_get_applied_player(ett);
-  index = -1;
-  i = 0;
-
-  players_iterate(pplayer) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       TAP_COL_PLAYER_NO, player_number(pplayer),
-                       TAP_COL_NAME, player_name(pplayer), -1);
-
-    if (pplayer->nation != NO_NATION_SELECTED) {
-      flag = get_flag(pplayer->nation);
-
-      if (flag != NULL) {
-        gtk_list_store_set(store, &iter, TAP_COL_FLAG, flag, -1);
-        g_object_unref(flag);
-      }
-    }
-    if (apno == player_number(pplayer)) {
-      index = i;
-    }
-    i++;
-  } players_iterate_end;
-
-  if (index == -1) {
-    if (player_count() > 0) {
-      index = 0;
-    }
-    editor_tool_set_applied_player(ett, index);
-  }
-  gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
-  gtk_widget_set_visible(combo, TRUE);
-}
-
-/************************************************************************//**
-  Return a pixbuf containing an image for the given editor tool sub-value,
-  if one exists.
-
-  NB: Can return NULL. Must call g_object_unref on non-NULL when done.
-****************************************************************************/
-static GdkPixbuf *get_tool_value_pixbuf(enum editor_tool_type ett,
-                                        int value)
-{
-  struct sprite *sprite = NULL;
-  GdkPixbuf *pixbuf = NULL;
-  struct terrain *pterrain;
-  struct unit_type *putype;
-  const struct editor_sprites *sprites;
-
-  sprites = get_editor_sprites(tileset);
-  if (!sprites) {
-    return NULL;
-  }
-
-  switch (ett) {
-  case ETT_TERRAIN:
-    pterrain = terrain_by_number(value);
-    if (pterrain) {
-      pixbuf = create_terrain_pixbuf(pterrain);
-    }
-    break;
-  case ETT_TERRAIN_RESOURCE:
-  case ETT_TERRAIN_SPECIAL:
-  case ETT_ROAD:
-  case ETT_MILITARY_BASE:
-    if (value >= 0) {
-      pixbuf = create_extra_pixbuf(extra_by_number(value));
-    }
-    break;
-  case ETT_UNIT:
-    putype = utype_by_number(value);
-    if (putype) {
-      sprite = get_unittype_sprite(tileset, putype,
-                                   ACTIVITY_LAST, direction8_invalid());
-    }
-    break;
-  case ETT_CITY:
-    sprite = sprites->city;
-    break;
-  case ETT_VISION:
-    sprite = sprites->vision;
-    break;
-  case ETT_STARTPOS:
-    sprite = sprites->startpos;
-    break;
-  case ETT_COPYPASTE:
-    sprite = sprites->copypaste;
-    break;
-  default:
-    break;
-  }
-
-  if (sprite) {
-    pixbuf = sprite_get_pixbuf(sprite);
-    /*
-    if (pixbuf) {
-      g_object_ref(pixbuf);
-    }
-    */
-    sprite = NULL;
-  }
-
-  return pixbuf;
-}
-
-/************************************************************************//**
-  Return a pixbuf containing an image suitable for use as an icon
-  respresenting the given editor tool mode.
-
-  NB: May return NULL. Must call g_object_unref on non-NULL when done.
-****************************************************************************/
-static GdkPixbuf *get_tool_mode_pixbuf(enum editor_tool_mode etm)
-{
-  struct sprite *sprite = NULL;
-  GdkPixbuf *pixbuf = NULL;
-
-  sprite = editor_get_mode_sprite(etm);
-
-  if (sprite) {
-    pixbuf = sprite_get_pixbuf(sprite);
-    /*
-    if (pixbuf) {
-      g_object_ref(pixbuf);
-    }
-    */
-  }
-
-  return pixbuf;
-}
-
-/************************************************************************//**
-  NB: Assumes that widget 'old' has enough references to not be destroyed
-  when removed from its parent container, and that the parent container
-  is a GtkBox (or is descended from it).
-****************************************************************************/
-static void replace_widget(GtkWidget *old, GtkWidget *new)
-{
-  GtkWidget *parent;
-
-  parent = gtk_widget_get_parent(old);
-  if (parent == nullptr) {
-    return;
-  }
-
-  gtk_widget_set_visible(old, FALSE);
-
-  if (GTK_IS_FRAME(parent)) {
-    gtk_frame_set_child(GTK_FRAME(parent), new);
-  } else {
-    fc_assert(GTK_IS_BOX(parent));
-
-    gtk_box_remove(GTK_BOX(parent), old);
-    gtk_box_append(GTK_BOX(parent), new);
-  }
-
-  gtk_widget_set_visible(new, TRUE);
-}
-
-/************************************************************************//**
-  Refresh the given editinfobox according to the current editor state.
-****************************************************************************/
-static void editinfobox_refresh(struct editinfobox *ei)
-{
-  GdkPixbuf *pixbuf = NULL;
-  GtkLabel *label;
-  enum editor_tool_type ett;
-  enum editor_tool_mode etm;
-  int value;
-  char buf[256];
-
-  if (ei == NULL) {
-    return;
-  }
-
-  if (!editor_is_active()) {
-    replace_widget(ei->widget, unit_info_box);
-    return;
-  }
-
-  ett = editor_get_tool();
-  etm = editor_tool_get_mode(ett);
-  value = editor_tool_get_value(ett);
-
-  label = GTK_LABEL(ei->mode_label);
-  gtk_label_set_text(label, editor_tool_get_mode_name(ett, etm));
-
-  pixbuf = get_tool_mode_pixbuf(etm);
-  gtk_picture_set_pixbuf(GTK_PICTURE(ei->mode_pic), pixbuf);
-  if (pixbuf) {
-    g_object_unref(pixbuf);
-    pixbuf = NULL;
-  }
-
-  fc_snprintf(buf, sizeof(buf), "<span weight=\"bold\">%s</span>",
-              editor_tool_get_name(ett));
-  gtk_label_set_markup(GTK_LABEL(ei->tool_label), buf);
-
-  if (etm == ETM_COPY || etm == ETM_PASTE) {
-    struct edit_buffer *ebuf;
-    struct sprite *spr;
-    char status[256];
-
-    ebuf = editor_get_copy_buffer();
-    edit_buffer_get_status_string(ebuf, status, sizeof(status));
-    gtk_label_set_text(GTK_LABEL(ei->tool_value_label), status);
-
-    spr = editor_tool_get_sprite(ett);
-    pixbuf = spr ? sprite_get_pixbuf(spr) : NULL;
-    gtk_picture_set_pixbuf(GTK_PICTURE(ei->tool_pic), pixbuf);
-    if (pixbuf) {
-      g_object_unref(G_OBJECT(pixbuf));
-      pixbuf = NULL;
-    }
-  } else {
-    pixbuf = get_tool_value_pixbuf(ett, value);
-    gtk_picture_set_pixbuf(GTK_PICTURE(ei->tool_pic), pixbuf);
-    if (pixbuf) {
-      g_object_unref(pixbuf);
-      pixbuf = NULL;
-    }
-    gtk_label_set_text(GTK_LABEL(ei->tool_value_label),
-                       editor_tool_get_value_name(ett, value));
-  }
-
-  replace_widget(unit_info_box, ei->widget);
-
-  if (editor_tool_has_size(ett)) {
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(ei->size_spin_button),
-                              editor_tool_get_size(ett));
-    gtk_widget_set_visible(ei->size_hbox, TRUE);
-  } else {
-    gtk_widget_set_visible(ei->size_hbox, FALSE);
-  }
-
-  if (editor_tool_has_count(ett)) {
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(ei->count_spin_button),
-                              editor_tool_get_count(ett));
-    gtk_widget_set_visible(ei->count_hbox, TRUE);
-  } else {
-    gtk_widget_set_visible(ei->count_hbox, FALSE);
-  }
-
-  refresh_tool_applied_player_combo(ei);
-}
-
-/************************************************************************//**
-  Handle ctrl+[key] combinations.
-  Mac only - Handle meta+[key] combinations.
-****************************************************************************/
-static gboolean handle_edit_key_press_with_ctrl(guint keyval)
-{
-  return FALSE; /* Don't gobble. */
-}
-
-/************************************************************************//**
-  Handle shift+[key] combinations.
-****************************************************************************/
-static gboolean handle_edit_key_press_with_shift(guint keyval)
-{
-  enum editor_tool_type ett;
-
-  ett = editor_get_tool();
-  switch (keyval) {
-  case GDK_KEY_D:
-    editor_tool_toggle_mode(ett, ETM_ERASE);
-    break;
-  case GDK_KEY_C:
-    editor_set_tool(ETT_COPYPASTE);
-    editor_tool_toggle_mode(ett, ETM_COPY);
-    break;
-  case GDK_KEY_V:
-    editor_set_tool(ETT_COPYPASTE);
-    editor_tool_toggle_mode(ett, ETM_PASTE);
-    break;
-  case GDK_KEY_T:
-    editgui_run_tool_selection(ETT_TERRAIN);
-    break;
-  case GDK_KEY_R:
-    editgui_run_tool_selection(ETT_TERRAIN_RESOURCE);
-    break;
-  case GDK_KEY_S:
-    editgui_run_tool_selection(ETT_TERRAIN_SPECIAL);
-    break;
-  case GDK_KEY_P:
-    editgui_run_tool_selection(ETT_ROAD);
-    break;
-  case GDK_KEY_M:
-    editgui_run_tool_selection(ETT_MILITARY_BASE);
-    break;
-  case GDK_KEY_U:
-    editgui_run_tool_selection(ETT_UNIT);
-    break;
-  default:
-    return TRUE; /* Gobble? */
-    break;
-  }
-
-  editgui_refresh();
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Handle any kind of key press event.
-****************************************************************************/
-gboolean handle_edit_key_press(guint keyval, GdkModifierType state)
-{
-  enum editor_tool_type ett, new_ett = NUM_EDITOR_TOOL_TYPES;
-
-  /* Check ctrl before shift - this is correct also for the case where
-   * they are both active. */
-  /* ACCL_MOD_MASK is GDK_META_MASK on Mac, else GDK_CONTROL_MASK */
-  if (state & ACCL_MOD_MASK) {
-    return handle_edit_key_press_with_ctrl(keyval);
-  }
-
-  if (state & GDK_SHIFT_MASK) {
-    return handle_edit_key_press_with_shift(keyval);
-  }
-
-  ett = editor_get_tool();
-
-  switch (keyval) {
-  case GDK_KEY_t:
-    new_ett = ETT_TERRAIN;
-    break;
-  case GDK_KEY_r:
-    new_ett = ETT_TERRAIN_RESOURCE;
-    break;
-  case GDK_KEY_s:
-    new_ett = ETT_TERRAIN_SPECIAL;
-    break;
-  case GDK_KEY_p:
-    new_ett = ETT_ROAD;
-    break;
-  case GDK_KEY_m:
-    new_ett = ETT_MILITARY_BASE;
-    break;
-  case GDK_KEY_u:
-    new_ett = ETT_UNIT;
-    break;
-  case GDK_KEY_c:
-    new_ett = ETT_CITY;
-    break;
-  case GDK_KEY_v:
-    new_ett = ETT_VISION;
-    break;
-  case GDK_KEY_b:
-    new_ett = ETT_STARTPOS;
-    break;
-  case GDK_KEY_plus:
-  case GDK_KEY_equal:
-  case GDK_KEY_KP_Add:
-    if (editor_tool_has_size(ett)) {
-      int size = editor_tool_get_size(ett);
-
-      editor_tool_set_size(ett, size + 1);
-    } else if (editor_tool_has_count(ett)) {
-      int count = editor_tool_get_count(ett);
-
-      editor_tool_set_count(ett, count + 1);
-    }
-    break;
-  case GDK_KEY_minus:
-  case GDK_KEY_underscore:
-  case GDK_KEY_KP_Subtract:
-    if (editor_tool_has_size(ett)) {
-      int size = editor_tool_get_size(ett);
-
-      editor_tool_set_size(ett, size - 1);
-    } else if (editor_tool_has_count(ett)) {
-      int count = editor_tool_get_count(ett);
-
-      editor_tool_set_count(ett, count - 1);
-    }
-    break;
-  case GDK_KEY_1:
-  case GDK_KEY_2:
-  case GDK_KEY_3:
-  case GDK_KEY_4:
-  case GDK_KEY_5:
-  case GDK_KEY_6:
-  case GDK_KEY_7:
-  case GDK_KEY_8:
-  case GDK_KEY_9:
-    if (editor_tool_has_size(ett)) {
-      editor_tool_set_size(ett, keyval - GDK_KEY_1 + 1);
-    } else if (editor_tool_has_count(ett)) {
-      editor_tool_set_count(ett, keyval - GDK_KEY_1 + 1);
-    }
-    break;
-  case GDK_KEY_space:
-    editor_apply_tool_to_selection();
-    break;
-  case GDK_KEY_Tab:
-    editgui_run_tool_selection(ett);
-    break;
-  case GDK_KEY_F1:
-  case GDK_KEY_F2:
-  case GDK_KEY_F3:
-  case GDK_KEY_F4:
-  case GDK_KEY_F5:
-  case GDK_KEY_F6:
-  case GDK_KEY_F7:
-  case GDK_KEY_F8:
-  case GDK_KEY_F9:
-  case GDK_KEY_F10:
-  case GDK_KEY_F11:
-  case GDK_KEY_F12:
-    return FALSE; /* Allow default handler. */
-    break;
-  default:
-    return TRUE; /* Gobbled... */
-    break;
-  }
-
-  if (new_ett != NUM_EDITOR_TOOL_TYPES) {
-    try_to_set_editor_tool(new_ett);
-  }
-
-  editgui_refresh();
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Get the pointer for the editbar embedded in the client's GUI.
-****************************************************************************/
-struct editbar *editgui_get_editbar(void)
-{
-  return editor_toolbar;
-}
-
-/************************************************************************//**
-  Refresh all editor GUI widgets according to the current editor state.
-****************************************************************************/
-void editgui_refresh(void)
-{
-  struct property_editor *pe;
-  struct editbar *eb;
-  struct editinfobox *ei;
-
-  eb = editgui_get_editbar();
-  if (eb != NULL) {
-    editbar_refresh(eb);
-  }
-
-  ei = editgui_get_editinfobox();
-  if (ei != NULL) {
-    editinfobox_refresh(ei);
-  }
-
-  pe = editprop_get_property_editor();
-  if (!editor_is_active()) {
-    property_editor_clear(pe);
-    property_editor_popdown(pe);
-  }
-}
-
-/************************************************************************//**
-  Create all editor GUI widgets.
-****************************************************************************/
-void editgui_create_widgets(void)
-{
-  if (editor_toolbar == NULL) {
-    editor_toolbar = editbar_create();
-  }
-  if (editor_infobox == NULL) {
-    editor_infobox = editinfobox_create();
-  }
-}
-
-/************************************************************************//**
-  Free everything allocated for the editgui.
-****************************************************************************/
-void editgui_free(void)
-{
-  struct editbar *eb = editgui_get_editbar();
-  struct editinfobox *ei = editgui_get_editinfobox();
-
-  if (ei != NULL) {
-    /* We have extra ref for ei->widget that has protected
-     * it from getting destroyed when editinfobox_refresh()
-     * moves widgets around. Free that extra ref here. */
-    g_object_unref(ei->widget);
-  }
-
-  clear_tool_stores(eb);
-}
-
-/************************************************************************//**
-  Return a pointer to the editor info box embedded in the client's GUI.
-****************************************************************************/
-struct editinfobox *editgui_get_editinfobox(void)
-{
-  return editor_infobox;
-}
-
-/************************************************************************//**
-  Update all editor widget internal data for the new tileset. Call this
-  after a new tileset has finished loading.
-****************************************************************************/
-void editgui_tileset_changed(void)
-{
-  editbar_reload_tileset(editgui_get_editbar());
-  editinfobox_refresh(editgui_get_editinfobox());
-}
-
-/************************************************************************//**
-  Popup the property editor. If 'tiles' is non-NULL, the tiles, units and
-  cities in those tiles are added to the property editor's object list. If
-  'objtype' is a valid object type, the corresponding page of the property
-  editor notebook is focused. Otherwise which page is focused depends on
-  what was loaded from 'tiles'.
-****************************************************************************/
-void editgui_popup_properties(const struct tile_list *tiles, int objtype)
-{
-  struct property_editor *pe;
-
-  pe = editprop_get_property_editor();
-  property_editor_clear(pe);
-  property_editor_reload(pe, OBJTYPE_PLAYER);
-  property_editor_reload(pe, OBJTYPE_GAME);
-  property_editor_load_tiles(pe, tiles);
-  property_editor_popup(pe, objtype);
-}
-
-/************************************************************************//**
-  Popup all dialog window of the editor.
-****************************************************************************/
-void editgui_popdown_all(void)
-{
-  struct property_editor *pe;
-
-  pe = editprop_get_property_editor();
-  property_editor_popdown(pe);
-  property_editor_clear(pe);    /* And clear it. */
-}
-
-/************************************************************************//**
-  This is called to notify the editor GUI that some object (e.g. tile, unit,
-  etc.) has changed (usually because the corresponding packet was received)
-  and that widgets displaying the object should be updated.
-
-  Currently this is used to notify the property editor that some object
-  has been removed or some property value has changed at the server.
-****************************************************************************/
-void editgui_notify_object_changed(int objtype, int object_id, bool removal)
-{
-  struct property_editor *pe;
-
-  if (!editor_is_active()) {
-    return;
-  }
-
-  pe = editprop_get_property_editor();
-  property_editor_handle_object_changed(pe, objtype, object_id, removal);
-}
-
-/************************************************************************//**
-  Pass on the object creation notification to the property editor.
-****************************************************************************/
-void editgui_notify_object_created(int tag, int id)
-{
-  struct property_editor *pe;
-
-  if (!editor_is_active()) {
-    return;
-  }
-
-  pe = editprop_get_property_editor();
-  property_editor_handle_object_created(pe, tag, id);
-}
diff --git a/client/gui-gtk-5.0/editgui.h b/client/gui-gtk-5.0/editgui.h
deleted file mode 100644
index f4d5c2a5f1..0000000000
--- a/client/gui-gtk-5.0/editgui.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2005 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__EDITGUI_H
-#define FC__EDITGUI_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "editor.h"
-#include "editgui_g.h"
-
-struct tool_value_selector;
-
-struct editbar {
-  /* The widget holding the entire edit bar. */
-  GtkWidget *widget;
-
-  GtkSizeGroup *size_group;
-
-  GtkWidget *mode_buttons[NUM_EDITOR_TOOL_MODES];
-  GtkWidget *tool_buttons[NUM_EDITOR_TOOL_TYPES]; /* TODO: Make these GtkToggleButtons */
-  struct tool_value_selector *tool_selectors[NUM_EDITOR_TOOL_TYPES];
-
-  GtkListStore *player_pov_store;
-  GtkWidget *player_pov_combobox;
-};
-
-gboolean handle_edit_mouse_button_press(GtkGestureClick *gesture,
-                                        int editor_mouse_button,
-                                        double x, double y);
-gboolean handle_edit_mouse_button_release(GtkGestureClick *gesture,
-                                          int editor_mouse_button,
-                                          double x, double y);
-gboolean handle_edit_mouse_move(GtkEventControllerMotion *controller,
-                                gdouble x, gdouble y);
-gboolean handle_edit_key_press(guint keyval, GdkModifierType state);
-
-struct editinfobox {
-  GtkWidget *widget;
-
-  GtkWidget *mode_pic;
-  GtkWidget *mode_label;
-
-  GtkWidget *tool_label;
-  GtkWidget *tool_value_label;
-  GtkWidget *tool_pic;
-
-  GtkWidget *size_hbox;
-  GtkWidget *size_spin_button;
-  GtkWidget *count_hbox;
-  GtkWidget *count_spin_button;
-
-  GtkListStore *tool_applied_player_store;
-  GtkWidget *tool_applied_player_combobox;
-};
-
-void editgui_create_widgets(void);
-void editgui_free(void);
-struct editbar *editgui_get_editbar(void);
-struct editinfobox *editgui_get_editinfobox(void);
-
-#endif  /* FC__EDITGUI_H */
diff --git a/client/gui-gtk-5.0/editprop.c b/client/gui-gtk-5.0/editprop.c
deleted file mode 100644
index 3783de9e14..0000000000
--- a/client/gui-gtk-5.0/editprop.c
+++ /dev/null
@@ -1,6630 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2005 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <limits.h> /* USHRT_MAX */
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "bitvector.h"
-#include "fc_cmdline.h"
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-
-/* common */
-#include "fc_interface.h"
-#include "game.h"
-#include "government.h"
-#include "map.h"
-#include "movement.h"
-#include "nation.h"
-#include "research.h"
-#include "tile.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "editor.h"
-#include "mapview_common.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "plrdlg.h"
-#include "sprite.h"
-
-#include "editprop.h"
-
-
-/* Forward declarations. */
-struct objprop;
-struct objbind;
-struct property_page;
-struct property_editor;
-struct extviewer;
-
-/****************************************************************************
-  Miscellaneous helpers.
-****************************************************************************/
-static GdkPixbuf *create_pixbuf_from_layers(const struct tile *ptile,
-                                            const struct unit *punit,
-                                            const struct city *pcity,
-                                            enum layer_category category);
-static GdkPixbuf *create_tile_pixbuf(const struct tile *ptile);
-static GdkPixbuf *create_unit_pixbuf(const struct unit *punit);
-static GdkPixbuf *create_city_pixbuf(const struct city *pcity);
-
-static void add_column(GtkWidget *view,
-                       int col_id,
-                       const char *name,
-                       GType gtype,
-                       bool editable,
-                       bool is_radio,
-                       GCallback edit_callback,
-                       gpointer callback_userdata);
-
-static bool can_create_unit_at_tile(struct tile *ptile);
-
-static int get_next_unique_tag(void);
-
-/* 'struct stored_tag_hash' and related functions. */
-#define SPECHASH_TAG stored_tag
-#define SPECHASH_INT_KEY_TYPE
-#define SPECHASH_INT_DATA_TYPE
-#include "spechash.h"
-
-/* NB: If packet definitions change, be sure to
- * update objbind_pack_current_values()!!! */
-union packetdata {
-  struct {
-    gpointer v_pointer1;
-    gpointer v_pointer2;
-  } pointers;
-  struct packet_edit_tile *tile;
-  struct packet_edit_startpos_full *startpos;
-  struct packet_edit_city *city;
-  struct packet_edit_unit *unit;
-  struct packet_edit_player *player;
-  struct {
-    struct packet_edit_game *game;
-    struct packet_edit_scenario_desc *desc;
-  } game;
-};
-
-/* Helpers for the OPID_TILE_VISION property. */
-struct tile_vision_data {
-  bv_player tile_known, tile_seen[V_COUNT];
-};
-const char *vision_layer_get_name(enum vision_layer);
-
-#define PF_MAX_CLAUSES 16
-#define PF_DISJUNCTION_SEPARATOR "|"
-#define PF_CONJUNCTION_SEPARATOR "&"
-
-struct pf_pattern {
-  bool negate;
-  char *text;
-};
-
-struct pf_conjunction {
-  struct pf_pattern conjunction[PF_MAX_CLAUSES];
-  int count;
-};
-
-struct property_filter {
-  struct pf_conjunction disjunction[PF_MAX_CLAUSES];
-  int count;
-};
-
-static struct property_filter *property_filter_new(const char *filter);
-static bool property_filter_match(struct property_filter *pf,
-                                  const struct objprop *op);
-static void property_filter_free(struct property_filter *pf);
-
-
-/****************************************************************************
-  Object type declarations.
-
-  To add a new object type:
-  1. Add a value in enum editor_object_type in client/editor.h.
-  2. Add a string name to objtype_get_name.
-  3. Add code in objtype_get_id_from_object.
-  4. Add code in objtype_get_object_from_id.
-  5. Add a case handler in objtype_is_conserved, and if
-     the object type is not conserved, then also in
-     objbind_request_destroy_object and property_page_create_objects.
-  6. Add an if-block in objbind_get_value_from_object.
-  7. Add an if-block in objbind_get_allowed_value_span.
-  9. Add a case handler in property_page_setup_objprops.
-  10. Add a case handler in property_page_add_objbinds_from_tile
-      if applicable.
-
-  Furthermore, if the object type is to be editable:
-  11. Define its edit packet in common/networking/packets.def.
-  12. Add the packet handler in server/edithand.c.
-  13. Add its edit packet type to union packetdata.
-  14. Add an if-block in objbind_pack_current_values.
-  15. Add an if-block in objbind_pack_modified_value.
-  16. Add code in property_page_new_packet.
-  17. Add code in property_page_send_packet.
-  18. Add calls to editgui_notify_object_changed in
-      client/packhand.c or where applicable.
-
-****************************************************************************/
-
-/* OBJTYPE_* enum values defined in client/editor.h */
-
-static const char *objtype_get_name(enum editor_object_type objtype);
-static int objtype_get_id_from_object(enum editor_object_type objtype,
-                                      gpointer object);
-static gpointer objtype_get_object_from_id(enum editor_object_type objtype,
-                                           int id);
-static bool objtype_is_conserved(enum editor_object_type objtype);
-
-
-/****************************************************************************
-  Value type declarations.
-
-  To add a new value type:
-  1. Add a value in enum value_types.
-  2. Add its field in union propval_data.
-  3. Add a case handler in valtype_get_name.
-  4. Add a case handler in propval_copy if needed.
-  5. Add a case handler in propval_free if needed.
-  6. Add a case handler in propval_equal if needed.
-  7. Add a case handler in objprop_get_gtype.
-  8. Add a case handler in property_page_set_store_value.
-  9. Add a case handler in propval_as_string if needed.
-****************************************************************************/
-enum value_types {
-  VALTYPE_NONE = 0,
-  VALTYPE_INT,
-  VALTYPE_BOOL,
-  VALTYPE_STRING,
-  VALTYPE_PIXBUF,
-  VALTYPE_BUILT_ARRAY,        /* struct built_status[B_LAST] */
-  VALTYPE_INVENTIONS_ARRAY,   /* bool[A_LAST] */
-  VALTYPE_BV_SPECIAL,
-  VALTYPE_BV_ROADS,
-  VALTYPE_BV_BASES,
-  VALTYPE_NATION,
-  VALTYPE_NATION_HASH,        /* struct nation_hash */
-  VALTYPE_GOV,
-  VALTYPE_TILE_VISION_DATA    /* struct tile_vision_data */
-};
-
-static const char *valtype_get_name(enum value_types valtype);
-
-
-/****************************************************************************
-  Propstate and propval declarations.
-
-  To add a new member to union propval_data, see the steps for adding a
-  new value type above.
-
-  New property values are "constructed" by objbind_get_value_from_object().
-****************************************************************************/
-union propval_data {
-  gpointer v_pointer;
-  int v_int;
-  bool v_bool;
-  char *v_string;
-  const char *v_const_string;
-  GdkPixbuf *v_pixbuf;
-  struct built_status *v_built;
-  bv_max_extras v_bv_special;
-  bv_max_extras v_bv_roads;
-  bv_max_extras v_bv_bases;
-  struct nation_type *v_nation;
-  struct nation_hash *v_nation_hash;
-  struct government *v_gov;
-  bv_techs v_bv_inventions;
-  struct tile_vision_data *v_tile_vision;
-};
-
-struct propval {
-  union propval_data data;
-  enum value_types valtype;
-  bool must_free;
-};
-
-static void propval_free(struct propval *pv);
-static void propval_free_data(struct propval *pv);
-static struct propval *propval_copy(struct propval *pv);
-static bool propval_equal(struct propval *pva, struct propval *pvb);
-
-struct propstate {
-  int property_id;
-  struct propval *property_value;
-};
-
-static struct propstate *propstate_new(struct objprop *op,
-                                       struct propval *pv);
-static void propstate_destroy(struct propstate *ps);
-static void propstate_clear_value(struct propstate *ps);
-static void propstate_set_value(struct propstate *ps,
-                                struct propval *pv);
-static struct propval *propstate_get_value(struct propstate *ps);
-
-#define SPECHASH_TAG propstate
-#define SPECHASH_INT_KEY_TYPE
-#define SPECHASH_IDATA_TYPE struct propstate *
-#define SPECHASH_IDATA_FREE propstate_destroy
-#include "spechash.h"
-
-
-/****************************************************************************
-  Objprop declarations.
-
-  To add a new object property:
-  1. Add a value in enum object_property_ids (grouped by
-     object type).
-  2. Define the property in property_page_setup_objprops.
-  3. Add a case handler in objbind_get_value_from_object
-     in the appropriate object type block.
-  4. Add a case handler in objprop_setup_widget.
-  5. Add a case handler in objprop_refresh_widget.
-
-  Furthermore, if the property is editable:
-  5. Add a field for this property in the edit
-     packet for this object type in common/networking/packets.def.
-  6. Add a case handler in objbind_pack_modified_value.
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  !!! 7. Add code to set the packet field in  !!!
-  !!!    objbind_pack_current_values().       !!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  8. Add code to handle changes in the packet field in
-     server/edithand.c handle_edit_<objtype>.
-
-  If the property makes use of an extviewer:
-  9. Handle widget creation in extviewer_new.
-  10. Handle refresh in extviewer_refresh_widgets.
-  11. Handle clear in extviewer_clear_widgets.
-  12. Handle any signal callbacks (e.g. toggled) if needed.
-
-  TODO: Add more object properties.
-****************************************************************************/
-enum object_property_ids {
-  OPID_TILE_IMAGE,
-  OPID_TILE_X,
-  OPID_TILE_Y,
-  OPID_TILE_NAT_X,
-  OPID_TILE_NAT_Y,
-  OPID_TILE_CONTINENT,
-#ifdef FREECIV_DEBUG
-  OPID_TILE_ADDRESS,
-#endif /* FREECIV_DEBUG */
-  OPID_TILE_TERRAIN,
-  OPID_TILE_INDEX,
-  OPID_TILE_XY,
-  OPID_TILE_RESOURCE,
-  OPID_TILE_SPECIALS,
-  OPID_TILE_ROADS,
-  OPID_TILE_BASES,
-  OPID_TILE_VISION, /* tile_known and tile_seen */
-  OPID_TILE_LABEL,
-
-  OPID_STARTPOS_IMAGE,
-  OPID_STARTPOS_XY,
-  OPID_STARTPOS_EXCLUDE,
-  OPID_STARTPOS_NATIONS,
-
-  OPID_UNIT_IMAGE,
-#ifdef FREECIV_DEBUG
-  OPID_UNIT_ADDRESS,
-#endif /* FREECIV_DEBUG */
-  OPID_UNIT_TYPE,
-  OPID_UNIT_ID,
-  OPID_UNIT_XY,
-  OPID_UNIT_MOVES_LEFT,
-  OPID_UNIT_FUEL,
-  OPID_UNIT_MOVED,
-  OPID_UNIT_DONE_MOVING,
-  OPID_UNIT_HP,
-  OPID_UNIT_VETERAN,
-  OPID_UNIT_STAY,
-
-  OPID_CITY_IMAGE,
-  OPID_CITY_NAME,
-#ifdef FREECIV_DEBUG
-  OPID_CITY_ADDRESS,
-#endif /* FREECIV_DEBUG */
-  OPID_CITY_ID,
-  OPID_CITY_XY,
-  OPID_CITY_SIZE,
-  OPID_CITY_HISTORY,
-  OPID_CITY_BUILDINGS,
-  OPID_CITY_FOOD_STOCK,
-  OPID_CITY_SHIELD_STOCK,
-
-  OPID_PLAYER_NAME,
-  OPID_PLAYER_NATION,
-  OPID_PLAYER_GOV,
-  OPID_PLAYER_AGE,
-#ifdef FREECIV_DEBUG
-  OPID_PLAYER_ADDRESS,
-#endif /* FREECIV_DEBUG */
-  OPID_PLAYER_INVENTIONS,
-  OPID_PLAYER_SCENARIO_RESERVED,
-  OPID_PLAYER_SELECT_WEIGHT,
-  OPID_PLAYER_SCIENCE,
-  OPID_PLAYER_GOLD,
-  OPID_PLAYER_INFRAPOINTS,
-
-  OPID_GAME_SCENARIO,
-  OPID_GAME_SCENARIO_NAME,
-  OPID_GAME_SCENARIO_AUTHORS,
-  OPID_GAME_SCENARIO_DESC,
-  OPID_GAME_SCENARIO_RANDSTATE,
-  OPID_GAME_SCENARIO_PLAYERS,
-  OPID_GAME_STARTPOS_NATIONS,
-  OPID_GAME_PREVENT_CITIES,
-  OPID_GAME_LAKE_FLOODING,
-  OPID_GAME_RULESET_LOCKED
-};
-
-enum object_property_flags {
-  OPF_NO_FLAGS    = 0,
-  OPF_EDITABLE    = 1 << 0,
-  OPF_IN_LISTVIEW = 1 << 1,
-  OPF_HAS_WIDGET  = 1 << 2
-};
-
-struct objprop {
-  int id;
-  const char *name;
-  const char *tooltip;
-  enum object_property_flags flags;
-  enum value_types valtype;
-  int column_id;
-  GtkTreeViewColumn *view_column;
-  GtkWidget *widget;
-  struct extviewer *extviewer;
-  struct property_page *parent_page;
-};
-
-static struct objprop *objprop_new(int id,
-                                   const char *name,
-                                   const char *tooltip,
-                                   enum object_property_flags flags,
-                                   enum value_types valtype,
-                                   struct property_page *parent);
-static int objprop_get_id(const struct objprop *op);
-static const char *objprop_get_name(const struct objprop *op);
-static const char *objprop_get_tooltip(const struct objprop *op);
-static enum value_types objprop_get_valtype(const struct objprop *op);
-static struct property_page *
-objprop_get_property_page(const struct objprop *op);
-
-static bool objprop_show_in_listview(const struct objprop *op);
-static bool objprop_is_sortable(const struct objprop *op);
-static bool objprop_is_readonly(const struct objprop *op);
-static bool objprop_has_widget(const struct objprop *op);
-
-static GType objprop_get_gtype(const struct objprop *op);
-static const char *objprop_get_attribute_type_string(const struct objprop *op);
-static void objprop_set_column_id(struct objprop *op, int col_id);
-static int objprop_get_column_id(const struct objprop *op);
-static void objprop_set_treeview_column(struct objprop *op,
-                                        GtkTreeViewColumn *col);
-static GtkTreeViewColumn *objprop_get_treeview_column(const struct objprop *op);
-static GtkCellRenderer *objprop_create_cell_renderer(const struct objprop *op);
-
-static void objprop_setup_widget(struct objprop *op);
-static GtkWidget *objprop_get_widget(struct objprop *op);
-static void objprop_set_child_widget(struct objprop *op,
-                                     const char *widget_name,
-                                     GtkWidget *widget);
-static GtkWidget *objprop_get_child_widget(struct objprop *op,
-                                           const char *widget_name);
-static void objprop_set_extviewer(struct objprop *op,
-                                  struct extviewer *ev);
-static struct extviewer *objprop_get_extviewer(struct objprop *op);
-static void objprop_refresh_widget(struct objprop *op,
-                                   struct objbind *ob);
-static void objprop_widget_text_changed(GtkEditable *text, gpointer userdata);
-static void objprop_widget_spin_button_changed(GtkSpinButton *spin,
-                                               gpointer userdata);
-static void objprop_widget_toggle_button_changed(GtkToggleButton *button,
-                                                 gpointer userdata);
-
-#define SPECHASH_TAG objprop
-#define SPECHASH_INT_KEY_TYPE
-#define SPECHASH_IDATA_TYPE struct objprop *
-#include "spechash.h"
-
-
-/****************************************************************************
-  Objbind declarations.
-****************************************************************************/
-struct objbind {
-  enum editor_object_type objtype;
-  int object_id;
-  struct property_page *parent_property_page;
-  struct propstate_hash *propstate_table;
-  GtkTreeRowReference *rowref;
-};
-
-static struct objbind *objbind_new(enum editor_object_type objtype,
-                                   gpointer object);
-static void objbind_destroy(struct objbind *ob);
-static enum editor_object_type objbind_get_objtype(const struct objbind *ob);
-static void objbind_bind_properties(struct objbind *ob,
-                                    struct property_page *pp);
-static gpointer objbind_get_object(struct objbind *ob);
-static int objbind_get_object_id(struct objbind *ob);
-static void objbind_request_destroy_object(struct objbind *ob);
-static struct propval *objbind_get_value_from_object(struct objbind *ob,
-                                                     struct objprop *op);
-static bool objbind_get_allowed_value_span(struct objbind *ob,
-                                           struct objprop *op,
-                                           double *pmin,
-                                           double *pmax,
-                                           double *pstep,
-                                           double *pbig_step);
-static bool objbind_set_modified_value(struct objbind *ob,
-                                       struct objprop *op,
-                                       struct propval *pv);
-static struct propval *objbind_get_modified_value(struct objbind *ob,
-                                                  struct objprop *op);
-static void objbind_clear_modified_value(struct objbind *ob,
-                                         struct objprop *op);
-static bool objbind_property_is_modified(struct objbind *ob,
-                                         struct objprop *op);
-static bool objbind_has_modified_properties(struct objbind *ob);
-static void objbind_clear_all_modified_values(struct objbind *ob);
-static void objbind_pack_current_values(struct objbind *ob,
-                                        union packetdata packet);
-static void objbind_pack_modified_value(struct objbind *ob,
-                                        struct objprop *op,
-                                        union packetdata packet);
-static void objbind_set_rowref(struct objbind *ob,
-                               GtkTreeRowReference *rr);
-static GtkTreeRowReference *objbind_get_rowref(struct objbind *ob);
-
-#define SPECHASH_TAG objbind
-#define SPECHASH_INT_KEY_TYPE
-#define SPECHASH_IDATA_TYPE struct objbind *
-#define SPECHASH_IDATA_FREE objbind_destroy
-#include "spechash.h"
-
-
-/****************************************************************************
-  Extended property viewer declarations. This is a set of widgets used
-  for viewing and/or editing properties with complex values (e.g. arrays).
-****************************************************************************/
-struct extviewer {
-  struct objprop *objprop;
-  struct propval *pv_cached;
-
-  GtkWidget *panel_widget;
-  GtkWidget *panel_label;
-  GtkWidget *panel_button;
-  GtkWidget *panel_image;
-
-  GtkWidget *view_widget;
-  GtkWidget *view_label;
-
-  GtkListStore *store;
-  GtkTextBuffer *textbuf;
-};
-
-static struct extviewer *extviewer_new(struct objprop *op);
-static struct objprop *extviewer_get_objprop(struct extviewer *ev);
-static GtkWidget *extviewer_get_panel_widget(struct extviewer *ev);
-static GtkWidget *extviewer_get_view_widget(struct extviewer *ev);
-static void extviewer_refresh_widgets(struct extviewer *ev,
-                                      struct propval *pv);
-static void extviewer_clear_widgets(struct extviewer *ev);
-static void extviewer_panel_button_clicked(GtkButton *button,
-                                           gpointer userdata);
-static void extviewer_view_cell_toggled(GtkCellRendererToggle *cell,
-                                        gchar *path,
-                                        gpointer userdata);
-static void extviewer_textbuf_changed(GtkTextBuffer *textbuf,
-                                      gpointer userdata);
-
-
-/****************************************************************************
-  Property page declarations.
-****************************************************************************/
-struct property_page {
-  enum editor_object_type objtype;
-
-  GtkWidget *widget;
-  GtkListStore *object_store;
-  GtkWidget *object_view;
-  GtkWidget *extviewer_notebook;
-
-  struct property_editor *pe_parent;
-
-  struct objprop_hash *objprop_table;
-  struct objbind_hash *objbind_table;
-  struct stored_tag_hash *tag_table;
-
-  struct objbind *focused_objbind;
-};
-
-static struct property_page *
-property_page_new(enum editor_object_type objtype,
-                  struct property_editor *parent);
-static void property_page_setup_objprops(struct property_page *pp);
-static const char *property_page_get_name(const struct property_page *pp);
-static enum editor_object_type
-property_page_get_objtype(const struct property_page *pp);
-static void property_page_load_tiles(struct property_page *pp,
-                                     const struct tile_list *tiles);
-static void property_page_add_objbinds_from_tile(struct property_page *pp,
-                                                 const struct tile *ptile);
-static int property_page_get_num_objbinds(const struct property_page *pp);
-static void property_page_clear_objbinds(struct property_page *pp);
-static void property_page_add_objbind(struct property_page *pp,
-                                      gpointer object_data);
-static void property_page_fill_widgets(struct property_page *pp);
-static struct objbind *
-property_page_get_focused_objbind(struct property_page *pp);
-static void property_page_set_focused_objbind(struct property_page *pp,
-                                              struct objbind *ob);
-static struct objbind *property_page_get_objbind(struct property_page *pp,
-                                                 int object_id);
-static void property_page_selection_changed(GtkTreeSelection *sel,
-                                            gpointer userdata);
-static gboolean property_page_selection_func(GtkTreeSelection *sel,
-                                             GtkTreeModel *model,
-                                             GtkTreePath *path,
-                                             gboolean currently_selected,
-                                             gpointer data);
-static void property_page_quick_find_entry_changed(GtkWidget *entry,
-                                                   gpointer userdata);
-static void property_page_change_value(struct property_page *pp,
-                                       struct objprop *op,
-                                       struct propval *pv);
-static void property_page_send_values(struct property_page *pp);
-static void property_page_reset_objbinds(struct property_page *pp);
-static void property_page_destroy_objects(struct property_page *pp);
-static void property_page_create_objects(struct property_page *pp,
-                                         struct tile_list *hint_tiles);
-static union packetdata property_page_new_packet(struct property_page *pp);
-static void property_page_send_packet(struct property_page *pp,
-                                      union packetdata packet);
-static void property_page_free_packet(struct property_page *pp,
-                                      union packetdata packet);
-static void property_page_object_changed(struct property_page *pp,
-                                         int object_id,
-                                         bool remove);
-static void property_page_object_created(struct property_page *pp,
-                                         int tag, int object_id);
-static void property_page_add_extviewer(struct property_page *pp,
-                                        struct extviewer *ev);
-static void property_page_show_extviewer(struct property_page *pp,
-                                         struct extviewer *ev);
-static void property_page_store_creation_tag(struct property_page *pp,
-                                             int tag, int count);
-static void property_page_remove_creation_tag(struct property_page *pp,
-                                              int tag);
-static bool property_page_tag_is_known(struct property_page *pp, int tag);
-static void property_page_clear_tags(struct property_page *pp);
-static void property_page_apply_button_clicked(GtkButton *button,
-                                               gpointer userdata);
-static void property_page_refresh_button_clicked(GtkButton *button,
-                                                 gpointer userdata);
-static void property_page_create_button_clicked(GtkButton *button,
-                                                gpointer userdata);
-static void property_page_destroy_button_clicked(GtkButton *button,
-                                                 gpointer userdata);
-
-
-#define property_page_objprop_iterate(ARG_pp, NAME_op)                      \
-  TYPED_HASH_DATA_ITERATE(struct objprop *, (ARG_pp)->objprop_table, NAME_op)
-#define property_page_objprop_iterate_end HASH_DATA_ITERATE_END
-
-#define property_page_objbind_iterate(ARG_pp, NAME_ob)                      \
-  TYPED_HASH_DATA_ITERATE(struct objbind *, (ARG_pp)->objbind_table, NAME_ob)
-#define property_page_objbind_iterate_end HASH_DATA_ITERATE_END
-
-
-/****************************************************************************
-  Property editor declarations.
-****************************************************************************/
-struct property_editor {
-  GtkWidget *widget;
-  GtkWidget *notebook;
-
-  struct property_page *property_pages[NUM_OBJTYPES];
-};
-
-static struct property_editor *property_editor_new(void);
-static bool property_editor_add_page(struct property_editor *pe,
-                                     enum editor_object_type objtype);
-static struct property_page *
-property_editor_get_page(struct property_editor *pe,
-                         enum editor_object_type objtype);
-
-static struct property_editor *the_property_editor;
-
-
-/************************************************************************//**
-  Returns the translated name for the given object type.
-****************************************************************************/
-static const char *objtype_get_name(enum editor_object_type objtype)
-{
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    return _("Tile");
-  case OBJTYPE_STARTPOS:
-    return _("Start Position");
-  case OBJTYPE_UNIT:
-    return _("Unit");
-  case OBJTYPE_CITY:
-    return _("City");
-  case OBJTYPE_PLAYER:
-    return _("Player");
-  case OBJTYPE_GAME:
-    return Q_("?play:Game");
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s() Unhandled request to get name of object type %d.",
-            __FUNCTION__, objtype);
-  return "Unknown";
-}
-
-/************************************************************************//**
-  Returns the unique identifier value from the given object, assuming it
-  is of the 'objtype' object type. Valid IDs are always greater than or
-  equal to zero.
-****************************************************************************/
-static int objtype_get_id_from_object(enum editor_object_type objtype,
-                                      gpointer object)
-{
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    return tile_index((struct tile *) object);
-  case OBJTYPE_STARTPOS:
-    return startpos_number((struct startpos *) object);
-  case OBJTYPE_UNIT:
-    return ((struct unit *) object)->id;
-  case OBJTYPE_CITY:
-    return ((struct city *) object)->id;
-  case OBJTYPE_PLAYER:
-    return player_number((struct player *) object);
-  case OBJTYPE_GAME:
-    return 1;
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request to get object ID from object %p of "
-            "type %d (%s).", __FUNCTION__, object, objtype,
-            objtype_get_name(objtype));
-  return -1;
-}
-
-/************************************************************************//**
-  Get the object of type 'objtype' uniquely identified by 'id'.
-****************************************************************************/
-static gpointer objtype_get_object_from_id(enum editor_object_type objtype,
-                                           int id)
-{
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    return index_to_tile(&(wld.map), id);
-  case OBJTYPE_STARTPOS:
-    return map_startpos_by_number(id);
-  case OBJTYPE_UNIT:
-    return game_unit_by_number(id);
-  case OBJTYPE_CITY:
-    return game_city_by_number(id);
-  case OBJTYPE_PLAYER:
-    return player_by_number(id);
-  case OBJTYPE_GAME:
-    return &game;
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request to get object of type %d (%s) "
-            "with ID %d.", __FUNCTION__, objtype,
-            objtype_get_name(objtype), id);
-  return NULL;
-}
-
-/************************************************************************//**
-  Returns TRUE if it does not make sense for the object of the given type to
-  be created and destroyed (e.g. tiles, game), as opposed to those that can
-  be (e.g. units, cities, players, etc.).
-****************************************************************************/
-static bool objtype_is_conserved(enum editor_object_type objtype)
-{
-  switch (objtype) {
-  case OBJTYPE_TILE:
-  case OBJTYPE_GAME:
-    return TRUE;
-  case OBJTYPE_STARTPOS:
-  case OBJTYPE_UNIT:
-  case OBJTYPE_CITY:
-  case OBJTYPE_PLAYER:
-    return FALSE;
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request for object type %d (%s)).",
-            __FUNCTION__, objtype, objtype_get_name(objtype));
-  return TRUE;
-}
-
-/************************************************************************//**
-  Returns the untranslated name for the given value type.
-****************************************************************************/
-static const char *valtype_get_name(enum value_types valtype)
-{
-  switch (valtype) {
-  case VALTYPE_NONE:
-    return "none";
-  case VALTYPE_STRING:
-    return "string";
-  case VALTYPE_INT:
-    return "int";
-  case VALTYPE_BOOL:
-    return "bool";
-  case VALTYPE_PIXBUF:
-    return "pixbuf";
-  case VALTYPE_BUILT_ARRAY:
-    return "struct built_status[B_LAST]";
-  case VALTYPE_INVENTIONS_ARRAY:
-    return "bool[A_LAST]";
-  case VALTYPE_BV_SPECIAL:
-    return "bv_special";
-  case VALTYPE_BV_ROADS:
-    return "bv_roads";
-  case VALTYPE_BV_BASES:
-    return "bv_bases";
-  case VALTYPE_NATION:
-    return "nation";
-  case VALTYPE_NATION_HASH:
-    return "struct nation_hash";
-  case VALTYPE_GOV:
-    return "government";
-  case VALTYPE_TILE_VISION_DATA:
-    return "struct tile_vision_data";
-  }
-
-  log_error("%s(): unhandled value type %d.", __FUNCTION__, valtype);
-  return "void";
-}
-
-/************************************************************************//**
-  Convenience function to add a column to a GtkTreeView. Used for the
-  view widget creation in extviewer_new().
-****************************************************************************/
-static void add_column(GtkWidget *view,
-                       int col_id,
-                       const char *name,
-                       GType gtype,
-                       bool editable,
-                       bool is_radio,
-                       GCallback edit_callback,
-                       gpointer userdata)
-{
-  GtkCellRenderer *cell;
-  GtkTreeViewColumn *col;
-  const char *attr = NULL;
-
-  if (gtype == G_TYPE_BOOLEAN) {
-    cell = gtk_cell_renderer_toggle_new();
-    gtk_cell_renderer_toggle_set_radio(GTK_CELL_RENDERER_TOGGLE(cell),
-                                       is_radio);
-    if (editable) {
-      g_signal_connect(cell, "toggled", edit_callback, userdata);
-    }
-    attr = "active";
-  } else if (gtype == GDK_TYPE_PIXBUF) {
-    cell = gtk_cell_renderer_pixbuf_new();
-    attr = "pixbuf";
-  } else {
-    cell = gtk_cell_renderer_text_new();
-    if (editable) {
-      g_object_set(cell, "editable", TRUE, NULL);
-      g_signal_connect(cell, "edited", edit_callback, userdata);
-    }
-    attr = "text";
-  }
-
-  col = gtk_tree_view_column_new_with_attributes(name, cell,
-                                                 attr, col_id, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-}
-
-/************************************************************************//**
-  Fill the supplied buffer with a short string representation of the given
-  value. Returned value is g_strdup'd and must be g_free'd.
-****************************************************************************/
-static gchar *propval_as_string(struct propval *pv)
-{
-  int count = 0;
-
-  fc_assert_ret_val(NULL != pv, 0);
-
-  switch (pv->valtype) {
-  case VALTYPE_NONE:
-    return g_strdup("");
-
-  case VALTYPE_INT:
-    return g_strdup_printf("%d", pv->data.v_int);
-
-  case VALTYPE_BOOL:
-    return g_strdup_printf("%s", pv->data.v_bool ? _("TRUE") : _("FALSE"));
-
-  case VALTYPE_NATION:
-    return g_strdup_printf("%s", nation_adjective_translation(pv->data.v_nation));
-
-  case VALTYPE_GOV:
-    if (pv->data.v_gov != NULL) {
-      return g_strdup_printf("%s", government_name_translation(pv->data.v_gov));
-    } else {
-      return g_strdup_printf("%s", government_name_translation(game.government_during_revolution));
-    }
-
-  case VALTYPE_BUILT_ARRAY:
-    {
-      int great_wonder_count = 0, small_wonder_count = 0, building_count = 0;
-      int id;
-
-      improvement_iterate(pimprove) {
-        id = improvement_index(pimprove);
-        if (pv->data.v_built[id].turn < 0) {
-          continue;
-        }
-        if (is_great_wonder(pimprove)) {
-          great_wonder_count++;
-        } else if (is_small_wonder(pimprove)) {
-          small_wonder_count++;
-        } else {
-          building_count++;
-        }
-      } improvement_iterate_end;
-      /* TRANS: "Number of buildings, number of small
-       * wonders (e.g. palace), number of great wonders." */
-      return g_strdup_printf(_("%db %ds %dW"),
-                             building_count, small_wonder_count,
-                             great_wonder_count);
-    }
-
-  case VALTYPE_INVENTIONS_ARRAY:
-    advance_index_iterate(A_FIRST, tech) {
-      if (BV_ISSET(pv->data.v_bv_inventions, tech)) {
-        count++;
-      }
-    } advance_index_iterate_end;
-    /* TRANS: "Number of technologies known". */
-    return g_strdup_printf(_("%d known"), count);
-
-  case VALTYPE_BV_SPECIAL:
-    extra_type_by_cause_iterate(EC_SPECIAL, spe) {
-      if (BV_ISSET(pv->data.v_bv_special, spe->data.special_idx)) {
-        count++;
-      }
-    } extra_type_by_cause_iterate_end;
-    /* TRANS: "The number of terrain specials (e.g. hut,
-     * river, pollution, etc.) present on a tile." */
-    return g_strdup_printf(_("%d present"), count);
-
-  case VALTYPE_BV_ROADS:
-    extra_type_by_cause_iterate(EC_ROAD, pextra) {
-      struct road_type *proad = extra_road_get(pextra);
-
-      if (BV_ISSET(pv->data.v_bv_roads, road_number(proad))) {
-        count++;
-      }
-    } extra_type_by_cause_iterate_end;
-    return g_strdup_printf(_("%d present"), count);
-
-  case VALTYPE_BV_BASES:
-    extra_type_by_cause_iterate(EC_BASE, pextra) {
-      struct base_type *pbase = extra_base_get(pextra);
-
-      if (BV_ISSET(pv->data.v_bv_bases, base_number(pbase))) {
-        count++;
-      }
-    } extra_type_by_cause_iterate_end;
-    return g_strdup_printf(_("%d present"), count);
-
-  case VALTYPE_NATION_HASH:
-    count = nation_hash_size(pv->data.v_nation_hash);
-    if (0 == count) {
-      return g_strdup(_("All nations"));
-    } else {
-      return g_strdup_printf(PL_("%d nation", "%d nations",
-                                 count), count);
-    }
-
-  case VALTYPE_STRING:
-    /* Assume it is a very long string. */
-    count = strlen(pv->data.v_const_string);
-    return g_strdup_printf(PL_("%d byte", "%d bytes", count),
-                           count);
-
-  case VALTYPE_PIXBUF:
-  case VALTYPE_TILE_VISION_DATA:
-    break;
-  }
-
-  log_error("%s(): Unhandled value type %d for property value %p.",
-            __FUNCTION__, pv->valtype, pv);
-  return g_strdup("");
-}
-
-/************************************************************************//**
-  Convert the built_status information to a user viewable string.
-  Returned value is g_strdup'd and must be g_free'd.
-****************************************************************************/
-static gchar *built_status_to_string(struct built_status *bs)
-{
-  int turn_built;
-
-  turn_built = bs->turn;
-
-  if (turn_built == I_NEVER) {
-    /* TRANS: Improvement never built. */
-    return g_strdup(_("(never)"));
-  } else if (turn_built == I_DESTROYED) {
-    /* TRANS: Improvement was destroyed. */
-    return g_strdup(_("(destroyed)"));
-  } else {
-    return g_strdup_printf("%d", turn_built);
-  }
-}
-
-/************************************************************************//**
-  Returns TRUE if a unit can be created at the given tile based on the
-  state of the editor (see editor_unit_virtual_create).
-****************************************************************************/
-static bool can_create_unit_at_tile(struct tile *ptile)
-{
-  struct unit *vunit;
-  struct city *pcity;
-  struct player *pplayer;
-  bool ret;
-
-  if (!ptile) {
-    return FALSE;
-  }
-
-  vunit = editor_unit_virtual_create();
-  if (!vunit) {
-    return FALSE;
-  }
-
-  pcity = tile_city(ptile);
-  pplayer = unit_owner(vunit);
-
-  ret = (can_unit_exist_at_tile(&(wld.map), vunit, ptile)
-         && !is_non_allied_unit_tile(ptile, pplayer,
-                                     unit_has_type_flag(vunit, UTYF_FLAGLESS))
-         && (pcity == NULL
-             || pplayers_allied(city_owner(pcity),
-                                unit_owner(vunit))));
-  free(vunit);
-
-  return ret;
-}
-
-/************************************************************************//**
-  Return the next tag number in the sequence.
-****************************************************************************/
-static int get_next_unique_tag(void)
-{
-  static int tag_series = 0;
-
-  tag_series++;
-  return tag_series;
-}
-
-/************************************************************************//**
-  Return a newly allocated deep copy of the given value.
-****************************************************************************/
-static struct propval *propval_copy(struct propval *pv)
-{
-  struct propval *pv_copy;
-  size_t size;
-
-  if (!pv) {
-    return NULL;
-  }
-
-  pv_copy = fc_calloc(1, sizeof(*pv));
-  pv_copy->valtype = pv->valtype;
-
-  switch (pv->valtype) {
-  case VALTYPE_NONE:
-    return pv_copy;
-  case VALTYPE_INT:
-    pv_copy->data.v_int = pv->data.v_int;
-    return pv_copy;
-  case VALTYPE_BOOL:
-    pv_copy->data.v_bool = pv->data.v_bool;
-    return pv_copy;
-  case VALTYPE_STRING:
-    pv_copy->data.v_string = fc_strdup(pv->data.v_string);
-    pv_copy->must_free = TRUE;
-    return pv_copy;
-  case VALTYPE_PIXBUF:
-    g_object_ref(pv->data.v_pixbuf);
-    pv_copy->data.v_pixbuf = pv->data.v_pixbuf;
-    pv_copy->must_free = TRUE;
-    return pv_copy;
-  case VALTYPE_BUILT_ARRAY:
-    size = B_LAST * sizeof(struct built_status);
-    pv_copy->data.v_pointer = fc_malloc(size);
-    memcpy(pv_copy->data.v_pointer, pv->data.v_pointer, size);
-    pv_copy->must_free = TRUE;
-    return pv_copy;
-  case VALTYPE_BV_SPECIAL:
-    pv_copy->data.v_bv_special = pv->data.v_bv_special;
-    return pv_copy;
-  case VALTYPE_BV_ROADS:
-    pv_copy->data.v_bv_roads = pv->data.v_bv_roads;
-    return pv_copy;
-  case VALTYPE_BV_BASES:
-    pv_copy->data.v_bv_bases = pv->data.v_bv_bases;
-    return pv_copy;
-  case VALTYPE_NATION:
-    pv_copy->data.v_nation = pv->data.v_nation;
-    return pv_copy;
-  case VALTYPE_GOV:
-    pv_copy->data.v_gov = pv->data.v_gov;
-    return pv_copy;
-  case VALTYPE_NATION_HASH:
-    pv_copy->data.v_nation_hash
-      = nation_hash_copy(pv->data.v_nation_hash);
-    pv_copy->must_free = TRUE;
-    return pv_copy;
-  case VALTYPE_INVENTIONS_ARRAY:
-    pv_copy->data.v_bv_inventions = pv->data.v_bv_inventions;
-    return pv_copy;
-  case VALTYPE_TILE_VISION_DATA:
-    size = sizeof(struct tile_vision_data);
-    pv_copy->data.v_tile_vision = fc_malloc(size);
-    pv_copy->data.v_tile_vision->tile_known
-      = pv->data.v_tile_vision->tile_known;
-    vision_layer_iterate(v) {
-      pv_copy->data.v_tile_vision->tile_seen[v]
-        = pv->data.v_tile_vision->tile_seen[v];
-    } vision_layer_iterate_end;
-    pv_copy->must_free = TRUE;
-    return pv_copy;
-  }
-
-  log_error("%s(): Unhandled value type %d for property value %p.",
-            __FUNCTION__, pv->valtype, pv);
-  pv_copy->data = pv->data;
-  return pv_copy;
-}
-
-/************************************************************************//**
-  Free all allocated memory used by this property value, including calling
-  the appropriate free function on the internal data according to its type.
-****************************************************************************/
-static void propval_free(struct propval *pv)
-{
-  if (!pv) {
-    return;
-  }
-
-  propval_free_data(pv);
-  free(pv);
-}
-
-/************************************************************************//**
-  Frees the internal data held by the propval, without freeing the propval
-  struct itself.
-****************************************************************************/
-static void propval_free_data(struct propval *pv)
-{
-  if (!pv || !pv->must_free) {
-    return;
-  }
-
-  switch (pv->valtype) {
-  case VALTYPE_NONE:
-  case VALTYPE_INT:
-  case VALTYPE_BOOL:
-  case VALTYPE_BV_SPECIAL:
-  case VALTYPE_BV_ROADS:
-  case VALTYPE_BV_BASES:
-  case VALTYPE_NATION:
-  case VALTYPE_GOV:
-    return;
-  case VALTYPE_PIXBUF:
-    g_object_unref(pv->data.v_pixbuf);
-    return;
-  case VALTYPE_STRING:
-  case VALTYPE_BUILT_ARRAY:
-  case VALTYPE_INVENTIONS_ARRAY:
-  case VALTYPE_TILE_VISION_DATA:
-    free(pv->data.v_pointer);
-    return;
-  case VALTYPE_NATION_HASH:
-    nation_hash_destroy(pv->data.v_nation_hash);
-    return;
-  }
-
-  log_error("%s(): Unhandled request to free data %p (type %s).",
-            __FUNCTION__, pv->data.v_pointer, valtype_get_name(pv->valtype));
-}
-
-/************************************************************************//**
-  Returns TRUE if the two values are equal, in a deep sense.
-****************************************************************************/
-static bool propval_equal(struct propval *pva,
-                          struct propval *pvb)
-{
-  if (!pva || !pvb) {
-    return pva == pvb;
-  }
-
-  if (pva->valtype != pvb->valtype) {
-    return FALSE;
-  }
-
-  switch (pva->valtype) {
-  case VALTYPE_NONE:
-    return TRUE;
-  case VALTYPE_INT:
-    return pva->data.v_int == pvb->data.v_int;
-  case VALTYPE_BOOL:
-    return pva->data.v_bool == pvb->data.v_bool;
-  case VALTYPE_STRING:
-    if (pva->data.v_const_string != NULL
-        && pvb->data.v_const_string != NULL) {
-      return !strcmp(pva->data.v_const_string,
-                     pvb->data.v_const_string);
-    }
-    return pva->data.v_const_string == pvb->data.v_const_string;
-  case VALTYPE_PIXBUF:
-    return pva->data.v_pixbuf == pvb->data.v_pixbuf;
-  case VALTYPE_BUILT_ARRAY:
-    if (pva->data.v_pointer == pvb->data.v_pointer) {
-      return TRUE;
-    } else if (!pva->data.v_pointer || !pvb->data.v_pointer) {
-      return FALSE;
-    }
-
-    improvement_iterate(pimprove) {
-      int id, vatb, vbtb;
-
-      id = improvement_index(pimprove);
-      vatb = pva->data.v_built[id].turn;
-      vbtb = pvb->data.v_built[id].turn;
-      if (vatb < 0 && vbtb < 0) {
-        continue;
-      }
-      if (vatb != vbtb) {
-        return FALSE;
-      }
-    } improvement_iterate_end;
-    return TRUE;
-  case VALTYPE_INVENTIONS_ARRAY:
-    return BV_ARE_EQUAL(pva->data.v_bv_inventions, pvb->data.v_bv_inventions);
-  case VALTYPE_BV_SPECIAL:
-    return BV_ARE_EQUAL(pva->data.v_bv_special, pvb->data.v_bv_special);
-  case VALTYPE_BV_ROADS:
-    return BV_ARE_EQUAL(pva->data.v_bv_roads, pvb->data.v_bv_roads);
-  case VALTYPE_BV_BASES:
-    return BV_ARE_EQUAL(pva->data.v_bv_bases, pvb->data.v_bv_bases);
-  case VALTYPE_NATION:
-    return pva->data.v_nation == pvb->data.v_nation;
-  case VALTYPE_NATION_HASH:
-    return nation_hashes_are_equal(pva->data.v_nation_hash,
-                                   pvb->data.v_nation_hash);
-  case VALTYPE_GOV:
-    return pva->data.v_gov == pvb->data.v_gov;
-  case VALTYPE_TILE_VISION_DATA:
-    if (!BV_ARE_EQUAL(pva->data.v_tile_vision->tile_known,
-                      pvb->data.v_tile_vision->tile_known)) {
-      return FALSE;
-    }
-    vision_layer_iterate(v) {
-      if (!BV_ARE_EQUAL(pva->data.v_tile_vision->tile_seen[v],
-                        pvb->data.v_tile_vision->tile_seen[v])) {
-        return FALSE;
-      }
-    } vision_layer_iterate_end;
-    return TRUE;
-  }
-
-  log_error("%s(): Unhandled value type %d for property values %p and %p.",
-            __FUNCTION__, pva->valtype, pva, pvb);
-  return pva->data.v_pointer == pvb->data.v_pointer;
-}
-
-/************************************************************************//**
-  Create a new "property state" record. It keeps track of the modified value
-  of a property bound to an object.
-
-  NB: Does NOT make a copy of 'pv'.
-****************************************************************************/
-static struct propstate *propstate_new(struct objprop *op,
-                                       struct propval *pv)
-{
-  struct propstate *ps;
-
-  if (!op) {
-    return NULL;
-  }
-
-  ps = fc_calloc(1, sizeof(*ps));
-  ps->property_id = objprop_get_id(op);
-  ps->property_value = pv;
-
-  return ps;
-}
-
-/************************************************************************//**
-  Removes the stored value, freeing it if needed.
-****************************************************************************/
-static void propstate_clear_value(struct propstate *ps)
-{
-  if (!ps) {
-    return;
-  }
-
-  propval_free(ps->property_value);
-  ps->property_value = NULL;
-}
-
-/************************************************************************//**
-  Free a property state and any associated resources.
-****************************************************************************/
-static void propstate_destroy(struct propstate *ps)
-{
-  if (!ps) {
-    return;
-  }
-  propstate_clear_value(ps);
-  free(ps);
-}
-
-/************************************************************************//**
-  Replace the stored property value with a new one. The old value will
-  be freed if needed.
-
-  NB: Does NOT make a copy of 'pv'.
-****************************************************************************/
-static void propstate_set_value(struct propstate *ps,
-                                struct propval *pv)
-{
-  if (!ps) {
-    return;
-  }
-  propstate_clear_value(ps);
-  ps->property_value = pv;
-}
-
-/************************************************************************//**
-  Returns the stored value.
-
-  NB: NOT a copy of the value.
-****************************************************************************/
-static struct propval *propstate_get_value(struct propstate *ps)
-{
-  if (!ps) {
-    return NULL;
-  }
-  return ps->property_value;
-}
-
-/************************************************************************//**
-  Create a new object "bind". It serves to bind a set of object properties
-  to an object instance.
-****************************************************************************/
-static struct objbind *objbind_new(enum editor_object_type objtype,
-                                   gpointer object)
-{
-  struct objbind *ob;
-  int id;
-
-  if (object == NULL) {
-    return NULL;
-  }
-
-  id = objtype_get_id_from_object(objtype, object);
-  if (id < 0) {
-    return NULL;
-  }
-
-  ob = fc_calloc(1, sizeof(*ob));
-  ob->object_id = id;
-  ob->objtype = objtype;
-  ob->propstate_table = propstate_hash_new();
-
-  return ob;
-}
-
-/************************************************************************//**
-  Returns the bound object, if it still "exists". Returns NULL on error.
-****************************************************************************/
-static gpointer objbind_get_object(struct objbind *ob)
-{
-  int id;
-
-  if (!ob) {
-    return NULL;
-  }
-
-  id = objbind_get_object_id(ob);
-
-  return objtype_get_object_from_id(ob->objtype, id);
-}
-
-/************************************************************************//**
-  Returns the ID of the bound object, or -1 if invalid.
-****************************************************************************/
-static int objbind_get_object_id(struct objbind *ob)
-{
-  if (NULL == ob) {
-    return -1;
-  }
-  return ob->object_id;
-}
-
-/************************************************************************//**
-  Sends a request to the server to have the bound object erased from
-  existence. Only makes sense for object types for which the function
-  objtype_is_conserved() returns FALSE.
-****************************************************************************/
-static void objbind_request_destroy_object(struct objbind *ob)
-{
-  struct connection *my_conn = &client.conn;
-  enum editor_object_type objtype;
-  int id;
-
-  if (!ob) {
-    return;
-  }
-
-  objtype = objbind_get_objtype(ob);
-  if (objtype_is_conserved(objtype)) {
-    return;
-  }
-
-  id = objbind_get_object_id(ob);
-
-  switch (objtype) {
-  case OBJTYPE_STARTPOS:
-    dsend_packet_edit_startpos(my_conn, id, TRUE, 0);
-    return;
-  case OBJTYPE_UNIT:
-    dsend_packet_edit_unit_remove_by_id(my_conn, id);
-    return;
-  case OBJTYPE_CITY:
-    dsend_packet_edit_city_remove(my_conn, id);
-    return;
-  case OBJTYPE_PLAYER:
-    dsend_packet_edit_player_remove(my_conn, id);
-    return;
-  case OBJTYPE_TILE:
-  case OBJTYPE_GAME:
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request to destroy object %p (ID %d) of type "
-            "%d (%s).", __FUNCTION__, objbind_get_object(ob), id, objtype,
-            objtype_get_name(objtype));
-}
-
-/************************************************************************//**
-  Returns a newly allocated property value for the given object property
-  on the object referenced by the given object bind, or NULL on failure.
-
-  NB: You must call propval_free() on the non-NULL return value when it
-  no longer needed.
-****************************************************************************/
-static struct propval *objbind_get_value_from_object(struct objbind *ob,
-                                                     struct objprop *op)
-{
-  enum editor_object_type objtype;
-  enum object_property_ids propid;
-  struct propval *pv;
-
-  if (!ob || !op) {
-    return NULL;
-  }
-
-  objtype = objbind_get_objtype(ob);
-  propid = objprop_get_id(op);
-
-  pv = fc_calloc(1, sizeof(*pv));
-  pv->valtype = objprop_get_valtype(op);
-
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    {
-      const struct tile *ptile = objbind_get_object(ob);
-      int tile_x, tile_y, nat_x, nat_y;
-
-      if (NULL == ptile) {
-        goto FAILED;
-      }
-
-      index_to_map_pos(&tile_x, &tile_y, tile_index(ptile));
-      index_to_native_pos(&nat_x, &nat_y, tile_index(ptile));
-
-      switch (propid) {
-      case OPID_TILE_IMAGE:
-        pv->data.v_pixbuf = create_tile_pixbuf(ptile);
-        pv->must_free = TRUE;
-        break;
-#ifdef FREECIV_DEBUG
-      case OPID_TILE_ADDRESS:
-        pv->data.v_string = g_strdup_printf("%p", ptile);
-        pv->must_free = TRUE;
-        break;
-#endif /* FREECIV_DEBUG */
-      case OPID_TILE_TERRAIN:
-        {
-          const struct terrain *pterrain = tile_terrain(ptile);
-
-          if (NULL != pterrain) {
-            pv->data.v_const_string = terrain_name_translation(pterrain);
-          } else {
-            pv->data.v_const_string = "";
-          }
-        }
-        break;
-      case OPID_TILE_RESOURCE:
-        {
-          const struct extra_type *presource = tile_resource(ptile);
-
-          if (NULL != presource) {
-            pv->data.v_const_string = extra_name_translation(presource);
-          } else {
-            pv->data.v_const_string = "";
-          }
-        }
-        break;
-      case OPID_TILE_XY:
-        pv->data.v_string = g_strdup_printf("(%d, %d)", tile_x, tile_y);
-        pv->must_free = TRUE;
-        break;
-      case OPID_TILE_INDEX:
-        pv->data.v_int = tile_index(ptile);
-        break;
-      case OPID_TILE_X:
-        pv->data.v_int = tile_x;
-        break;
-      case OPID_TILE_Y:
-        pv->data.v_int = tile_y;
-        break;
-      case OPID_TILE_NAT_X:
-        pv->data.v_int = nat_x;
-        break;
-      case OPID_TILE_NAT_Y:
-        pv->data.v_int = nat_y;
-        break;
-      case OPID_TILE_CONTINENT:
-        pv->data.v_int = ptile->continent;
-        break;
-      case OPID_TILE_SPECIALS:
-        BV_CLR_ALL(pv->data.v_bv_special);
-        extra_type_by_cause_iterate(EC_SPECIAL, pextra) {
-          if (tile_has_extra(ptile, pextra)) {
-            BV_SET(pv->data.v_bv_special, pextra->data.special_idx);
-          }
-        } extra_type_by_cause_iterate_end;
-        break;
-      case OPID_TILE_ROADS:
-        BV_CLR_ALL(pv->data.v_bv_roads);
-        extra_type_by_cause_iterate(EC_ROAD, pextra) {
-          if (tile_has_extra(ptile, pextra)) {
-            BV_SET(pv->data.v_bv_roads, road_number(extra_road_get(pextra)));
-          }
-        } extra_type_by_cause_iterate_end;
-        break;
-      case OPID_TILE_BASES:
-        BV_CLR_ALL(pv->data.v_bv_bases);
-        extra_type_by_cause_iterate(EC_BASE, pextra) {
-          if (tile_has_extra(ptile, pextra)) {
-            BV_SET(pv->data.v_bv_bases, base_number(extra_base_get(pextra)));
-          }
-        } extra_type_by_cause_iterate_end;
-        break;
-      case OPID_TILE_VISION:
-        pv->data.v_tile_vision = fc_malloc(sizeof(struct tile_vision_data));
-
-        /* The server saves the known tiles and the player vision in special
-         * bitvectors with the number of tiles as index. Here we want the
-         * information for one tile. Thus, the data is transformed to
-         * bitvectors with the number of player slots as index. */
-        BV_CLR_ALL(pv->data.v_tile_vision->tile_known);
-        players_iterate(pplayer) {
-          if (dbv_isset(&pplayer->tile_known, tile_index(ptile))) {
-            BV_SET(pv->data.v_tile_vision->tile_known,
-                   player_index(pplayer));
-          }
-        } players_iterate_end;
-
-        vision_layer_iterate(v) {
-          BV_CLR_ALL(pv->data.v_tile_vision->tile_seen[v]);
-          players_iterate(pplayer) {
-            if (fc_funcs->player_tile_vision_get(ptile, pplayer, v)) {
-              BV_SET(pv->data.v_tile_vision->tile_seen[v],
-                     player_index(pplayer));
-            }
-          } players_iterate_end;
-        } vision_layer_iterate_end;
-        pv->must_free = TRUE;
-        break;
-      case OPID_TILE_LABEL:
-        if (ptile->label != NULL) {
-          pv->data.v_const_string = ptile->label;
-        } else {
-          pv->data.v_const_string = "";
-        }
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case OBJTYPE_STARTPOS:
-    {
-      const struct startpos *psp = objbind_get_object(ob);
-      const struct tile *ptile;
-
-      if (NULL == psp) {
-        goto FAILED;
-      }
-
-      switch (propid) {
-      case OPID_STARTPOS_IMAGE:
-        ptile = startpos_tile(psp);
-        pv->data.v_pixbuf = create_tile_pixbuf(ptile);
-        pv->must_free = TRUE;
-        break;
-      case OPID_STARTPOS_XY:
-        ptile = startpos_tile(psp);
-        pv->data.v_string = g_strdup_printf("(%d, %d)", TILE_XY(ptile));
-        pv->must_free = TRUE;
-        break;
-      case OPID_STARTPOS_EXCLUDE:
-        pv->data.v_bool = startpos_is_excluding(psp);
-        break;
-      case OPID_STARTPOS_NATIONS:
-        pv->data.v_nation_hash = nation_hash_copy(startpos_raw_nations(psp));
-        pv->must_free = TRUE;
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case OBJTYPE_UNIT:
-    {
-      struct unit *punit = objbind_get_object(ob);
-
-      if (NULL == punit) {
-        goto FAILED;
-      }
-
-      switch (propid) {
-      case OPID_UNIT_IMAGE:
-        pv->data.v_pixbuf = create_unit_pixbuf(punit);
-        pv->must_free = TRUE;
-        break;
-#ifdef FREECIV_DEBUG
-      case OPID_UNIT_ADDRESS:
-        pv->data.v_string = g_strdup_printf("%p", punit);
-        pv->must_free = TRUE;
-        break;
-#endif /* FREECIV_DEBUG */
-      case OPID_UNIT_XY:
-        {
-          const struct tile *ptile = unit_tile(punit);
-
-          pv->data.v_string = g_strdup_printf("(%d, %d)", TILE_XY(ptile));
-          pv->must_free = TRUE;
-        }
-        break;
-      case OPID_UNIT_ID:
-        pv->data.v_int = punit->id;
-        break;
-      case OPID_UNIT_TYPE:
-        {
-          const struct unit_type *putype = unit_type_get(punit);
-
-          pv->data.v_const_string = utype_name_translation(putype);
-        }
-        break;
-      case OPID_UNIT_MOVES_LEFT:
-        pv->data.v_int = punit->moves_left;
-        break;
-      case OPID_UNIT_FUEL:
-        pv->data.v_int = punit->fuel;
-        break;
-      case OPID_UNIT_MOVED:
-        pv->data.v_bool = punit->moved;
-        break;
-      case OPID_UNIT_DONE_MOVING:
-        pv->data.v_bool = punit->done_moving;
-        break;
-      case OPID_UNIT_HP:
-        pv->data.v_int = punit->hp;
-        break;
-      case OPID_UNIT_VETERAN:
-        pv->data.v_int = punit->veteran;
-        break;
-      case OPID_UNIT_STAY:
-        pv->data.v_bool = punit->stay;
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case OBJTYPE_CITY:
-    {
-      const struct city *pcity = objbind_get_object(ob);
-
-      if (NULL == pcity) {
-        goto FAILED;
-      }
-
-      switch (propid) {
-      case OPID_CITY_IMAGE:
-        pv->data.v_pixbuf = create_city_pixbuf(pcity);
-        pv->must_free = TRUE;
-        break;
-#ifdef FREECIV_DEBUG
-      case OPID_CITY_ADDRESS:
-        pv->data.v_string = g_strdup_printf("%p", pcity);
-        pv->must_free = TRUE;
-        break;
-#endif /* FREECIV_DEBUG */
-      case OPID_CITY_XY:
-        {
-          const struct tile *ptile = city_tile(pcity);
-
-          pv->data.v_string = g_strdup_printf("(%d, %d)", TILE_XY(ptile));
-          pv->must_free = TRUE;
-        }
-        break;
-      case OPID_CITY_ID:
-        pv->data.v_int = pcity->id;
-        break;
-      case OPID_CITY_NAME:
-        pv->data.v_const_string = pcity->name;
-        break;
-      case OPID_CITY_SIZE:
-        pv->data.v_int = city_size_get(pcity);
-        break;
-      case OPID_CITY_HISTORY:
-        pv->data.v_int = pcity->history;
-        break;
-      case OPID_CITY_BUILDINGS:
-        pv->data.v_built = fc_malloc(sizeof(pcity->built));
-        memcpy(pv->data.v_built, pcity->built, sizeof(pcity->built));
-        pv->must_free = TRUE;
-        break;
-      case OPID_CITY_FOOD_STOCK:
-        pv->data.v_int = pcity->food_stock;
-        break;
-      case OPID_CITY_SHIELD_STOCK:
-        pv->data.v_int = pcity->shield_stock;
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case OBJTYPE_PLAYER:
-    {
-      const struct player *pplayer = objbind_get_object(ob);
-      const struct research *presearch;
-
-      if (NULL == pplayer) {
-        goto FAILED;
-      }
-
-      switch (propid) {
-      case OPID_PLAYER_NAME:
-        pv->data.v_const_string = pplayer->name;
-        break;
-      case OPID_PLAYER_NATION:
-        pv->data.v_nation = nation_of_player(pplayer);
-        break;
-      case OPID_PLAYER_GOV:
-        pv->data.v_gov = pplayer->government;
-        break;
-      case OPID_PLAYER_AGE:
-        pv->data.v_int = pplayer->turns_alive;
-        break;
-#ifdef FREECIV_DEBUG
-      case OPID_PLAYER_ADDRESS:
-        pv->data.v_string = g_strdup_printf("%p", pplayer);
-        pv->must_free = TRUE;
-        break;
-#endif /* FREECIV_DEBUG */
-      case OPID_PLAYER_INVENTIONS:
-        presearch = research_get(pplayer);
-        BV_CLR_ALL(pv->data.v_bv_inventions);
-        advance_index_iterate(A_FIRST, tech) {
-          if (TECH_KNOWN == research_invention_state(presearch, tech)) {
-            BV_SET(pv->data.v_bv_inventions, tech);
-          }
-        } advance_index_iterate_end;
-        break;
-      case OPID_PLAYER_SCENARIO_RESERVED:
-        pv->data.v_bool = player_has_flag(pplayer, PLRF_SCENARIO_RESERVED);
-        break;
-      case OPID_PLAYER_SELECT_WEIGHT:
-        pv->data.v_int = pplayer->autoselect_weight;
-        break;
-      case OPID_PLAYER_SCIENCE:
-        presearch = research_get(pplayer);
-        pv->data.v_int = presearch->bulbs_researched;
-        break;
-      case OPID_PLAYER_GOLD:
-        pv->data.v_int = pplayer->economic.gold;
-        break;
-      case OPID_PLAYER_INFRAPOINTS:
-        pv->data.v_int = pplayer->economic.infra_points;
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case OBJTYPE_GAME:
-    {
-      const struct civ_game *pgame = objbind_get_object(ob);
-
-      if (NULL == pgame) {
-        goto FAILED;
-      }
-
-      switch (propid) {
-      case OPID_GAME_SCENARIO:
-        pv->data.v_bool = pgame->scenario.is_scenario;
-        break;
-      case OPID_GAME_SCENARIO_NAME:
-        pv->data.v_const_string = pgame->scenario.name;
-        break;
-      case OPID_GAME_SCENARIO_AUTHORS:
-        pv->data.v_const_string = pgame->scenario.authors;
-        break;
-      case OPID_GAME_SCENARIO_DESC:
-        pv->data.v_const_string = pgame->scenario_desc.description;
-        break;
-      case OPID_GAME_SCENARIO_RANDSTATE:
-        pv->data.v_bool = pgame->scenario.save_random;
-        break;
-      case OPID_GAME_SCENARIO_PLAYERS:
-        pv->data.v_bool = pgame->scenario.players;
-        break;
-      case OPID_GAME_STARTPOS_NATIONS:
-        pv->data.v_bool = pgame->scenario.startpos_nations;
-        break;
-      case OPID_GAME_PREVENT_CITIES:
-        pv->data.v_bool = pgame->scenario.prevent_new_cities;
-        break;
-      case OPID_GAME_LAKE_FLOODING:
-        pv->data.v_bool = pgame->scenario.lake_flooding;
-        break;
-      case OPID_GAME_RULESET_LOCKED:
-        pv->data.v_bool = pgame->scenario.ruleset_locked;
-        break;
-      default:
-        log_error("%s(): Unhandled request for value of property %d "
-                  "(%s) from object of type \"%s\".", __FUNCTION__,
-                  propid, objprop_get_name(op), objtype_get_name(objtype));
-        goto FAILED;
-      }
-    }
-    return pv;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request for object type \"%s\" (nb %d).",
-            __FUNCTION__, objtype_get_name(objtype), objtype);
-
-FAILED:
-  if (NULL != pv) {
-    free(pv);
-  }
-  return NULL;
-}
-
-/************************************************************************//**
-  If applicable, sets the allowed range values of the given object property
-  as applied to the bound object. Returns TRUE if values were set.
-****************************************************************************/
-static bool objbind_get_allowed_value_span(struct objbind *ob,
-                                           struct objprop *op,
-                                           double *pmin,
-                                           double *pmax,
-                                           double *pstep,
-                                           double *pbig_step)
-{
-  enum editor_object_type objtype;
-  enum object_property_ids propid;
-  double dummy;
-
-  /* Fill the values with something. */
-  if (NULL != pmin) {
-    *pmin = 0;
-  } else {
-    pmin = &dummy;
-  }
-  if (NULL != pmax) {
-    *pmax = 1;
-  } else {
-    pmax = &dummy;
-  }
-  if (NULL != pstep) {
-    *pstep = 1;
-  } else {
-    pstep = &dummy;
-  }
-  if (NULL != pbig_step) {
-    *pbig_step = 1;
-  } else {
-    pbig_step = &dummy;
-  }
-
-  if (!ob || !op) {
-    return FALSE;
-  }
-
-  propid = objprop_get_id(op);
-  objtype = objbind_get_objtype(ob);
-
-  switch (objtype) {
-  case OBJTYPE_TILE:
-  case OBJTYPE_STARTPOS:
-    log_error("%s(): Unhandled request for value range of property %d (%s) "
-              "from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return FALSE;
-
-  case OBJTYPE_UNIT:
-    {
-      const struct unit *punit = objbind_get_object(ob);
-      const struct unit_type *putype;
-
-      if (NULL == punit) {
-        return FALSE;
-      }
-
-      putype = unit_type_get(punit);
-
-      switch (propid) {
-      case OPID_UNIT_MOVES_LEFT:
-        *pmin = 0;
-        *pmax = MAX_MOVE_FRAGS;
-        *pstep = 1;
-        *pbig_step = 5;
-        return TRUE;
-      case OPID_UNIT_FUEL:
-        *pmin = 0;
-        *pmax = utype_fuel(putype);
-        *pstep = 1;
-        *pbig_step = 5;
-        return TRUE;
-      case OPID_UNIT_HP:
-        *pmin = 1;
-        *pmax = putype->hp;
-        *pstep = 1;
-        *pbig_step = 10;
-        return TRUE;
-      case OPID_UNIT_VETERAN:
-        *pmin = 0;
-        *pmax = utype_veteran_levels(putype) - 1;
-        *pstep = 1;
-        *pbig_step = 3;
-        return TRUE;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request for value range of property %d (%s) "
-              "from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return FALSE;
-
-  case OBJTYPE_CITY:
-    {
-      const struct city *pcity = objbind_get_object(ob);
-
-      if (NULL == pcity) {
-        return FALSE;
-      }
-
-      switch (propid) {
-      case OPID_CITY_SIZE:
-        *pmin = 1;
-        *pmax = MAX_CITY_SIZE;
-        *pstep = 1;
-        *pbig_step = 5;
-        return TRUE;
-      case OPID_CITY_HISTORY:
-        *pmin = 0;
-        *pmax = USHRT_MAX;
-        *pstep = 1;
-        *pbig_step = 10;
-        return TRUE;
-      case OPID_CITY_FOOD_STOCK:
-        *pmin = 0;
-        *pmax = city_granary_size(city_size_get(pcity));
-        *pstep = 1;
-        *pbig_step = 5;
-        return TRUE;
-      case OPID_CITY_SHIELD_STOCK:
-        *pmin = 0;
-        *pmax = USHRT_MAX; /* Limited to uint16 by city info packet. */
-        *pstep = 1;
-        *pbig_step = 10;
-        return TRUE;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request for value range of property %d (%s) "
-              "from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return FALSE;
-
-  case OBJTYPE_PLAYER:
-    switch (propid) {
-    case OPID_PLAYER_SCIENCE:
-      *pmin = 0;
-      *pmax = 1000000; /* Arbitrary. */
-      *pstep = 1;
-      *pbig_step = 100;
-      return TRUE;
-    case OPID_PLAYER_GOLD:
-      *pmin = 0;
-      *pmax = 1000000; /* Arbitrary. */
-      *pstep = 1;
-      *pbig_step = 100;
-      return TRUE;
-    case OPID_PLAYER_INFRAPOINTS:
-      *pmin = 0;
-      *pmax = 1000000; /* Arbitrary. */
-      *pstep = 1;
-      *pbig_step = 100;
-      return TRUE;
-    case OPID_PLAYER_SELECT_WEIGHT:
-      *pmin = -1;
-      *pmax = 10000; /* Keep it under SINT16 */
-      *pstep = 1;
-      *pbig_step = 10;
-      return TRUE;
-    default:
-      break;
-    }
-    log_error("%s(): Unhandled request for value range of property %d (%s) "
-              "from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return FALSE;
-
-  case OBJTYPE_GAME:
-    log_error("%s(): Unhandled request for value range of property %d (%s) "
-              "from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return FALSE;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request for object type \"%s\" (nb %d).",
-            __FUNCTION__, objtype_get_name(objtype), objtype);
-  return FALSE;
-}
-
-/************************************************************************//**
-  Remove a stored modified value, if it exists.
-****************************************************************************/
-static void objbind_clear_modified_value(struct objbind *ob,
-                                         struct objprop *op)
-{
-  if (!ob || !op || !ob->propstate_table) {
-    return;
-  }
-
-  propstate_hash_remove(ob->propstate_table, objprop_get_id(op));
-}
-
-/************************************************************************//**
-  Returns TRUE if a stored modified property value exists for this bound
-  object for the given property.
-****************************************************************************/
-static bool objbind_property_is_modified(struct objbind *ob,
-                                         struct objprop *op)
-{
-  if (!ob || !op) {
-    return FALSE;
-  }
-
-  if (objprop_is_readonly(op)) {
-    return FALSE;
-  }
-
-  return propstate_hash_lookup(ob->propstate_table,
-                               objprop_get_id(op), NULL);
-}
-
-/************************************************************************//**
-  Returns TRUE if there are any stored modified values of any of the
-  properties of the bound object.
-****************************************************************************/
-static bool objbind_has_modified_properties(struct objbind *ob)
-{
-  if (!ob) {
-    return FALSE;
-  }
-
-  return (0 < propstate_hash_size(ob->propstate_table));
-}
-
-/************************************************************************//**
-  Deletes all stored modified property values.
-****************************************************************************/
-static void objbind_clear_all_modified_values(struct objbind *ob)
-{
-  if (!ob) {
-    return;
-  }
-  propstate_hash_clear(ob->propstate_table);
-}
-
-/************************************************************************//**
-  Store a modified property value, but only if it is different from the
-  current value. Always makes a copy of the given value when storing.
-
-  Returns whether anything changed.
-****************************************************************************/
-static bool objbind_set_modified_value(struct objbind *ob,
-                                       struct objprop *op,
-                                       struct propval *pv)
-{
-  struct propstate *ps;
-  bool equal;
-  struct propval *pv_old, *pv_copy;
-  enum object_property_ids propid;
-
-  if (!ob || !op) {
-    return FALSE;
-  }
-
-  propid = objprop_get_id(op);
-
-  pv_old = objbind_get_value_from_object(ob, op);
-  if (!pv_old) {
-    return FALSE;
-  }
-
-  equal = propval_equal(pv, pv_old);
-  propval_free(pv_old);
-
-  if (equal) {
-    objbind_clear_modified_value(ob, op);
-    return FALSE;
-  }
-
-  pv_copy = propval_copy(pv);
-
-  if (propstate_hash_lookup(ob->propstate_table, propid, &ps)) {
-    propstate_set_value(ps, pv_copy);
-  } else {
-    ps = propstate_new(op, pv_copy);
-    propstate_hash_insert(ob->propstate_table, propid, ps);
-  }
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Retrieve the stored property value for the bound object, or NULL if none
-  exists.
-
-  NB: Does NOT return a copy.
-****************************************************************************/
-static struct propval *objbind_get_modified_value(struct objbind *ob,
-                                                  struct objprop *op)
-{
-  struct propstate *ps;
-
-  if (!ob || !op) {
-    return NULL;
-  }
-
-  if (propstate_hash_lookup(ob->propstate_table, objprop_get_id(op), &ps)) {
-    return propstate_get_value(ps);
-  } else {
-    return NULL;
-  }
-}
-
-/************************************************************************//**
-  Destroy the object bind and free any resources it might have been using.
-****************************************************************************/
-static void objbind_destroy(struct objbind *ob)
-{
-  if (!ob) {
-    return;
-  }
-  if (ob->propstate_table) {
-    propstate_hash_destroy(ob->propstate_table);
-    ob->propstate_table = NULL;
-  }
-  if (ob->rowref) {
-    gtk_tree_row_reference_free(ob->rowref);
-    ob->rowref = NULL;
-  }
-  free(ob);
-}
-
-/************************************************************************//**
-  Returns the object type of the bound object.
-****************************************************************************/
-static enum editor_object_type objbind_get_objtype(const struct objbind *ob)
-{
-  if (!ob) {
-    return NUM_OBJTYPES;
-  }
-  return ob->objtype;
-}
-
-/************************************************************************//**
-  Bind the object in the given objbind to the properties in the page.
-****************************************************************************/
-static void objbind_bind_properties(struct objbind *ob,
-                                    struct property_page *pp)
-{
-  if (!ob) {
-    return;
-  }
-  ob->parent_property_page = pp;
-}
-
-/************************************************************************//**
-  Fill the packet with the bound object's current state.
-
-  NB: This must be updated if the packet_edit_<object> definitions change.
-****************************************************************************/
-static void objbind_pack_current_values(struct objbind *ob,
-                                        union packetdata pd)
-{
-  enum editor_object_type objtype;
-
-  if (!ob || !pd.pointers.v_pointer1) {
-    return;
-  }
-
-  objtype = objbind_get_objtype(ob);
-
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    {
-      struct packet_edit_tile *packet = pd.tile;
-      const struct tile *ptile = objbind_get_object(ob);
-
-      if (NULL == ptile) {
-        return;
-      }
-
-      packet->tile = tile_index(ptile);
-      packet->extras = *tile_extras(ptile);
-      /* TODO: Set more packet fields. */
-    }
-    return;
-
-  case OBJTYPE_STARTPOS:
-    {
-      struct packet_edit_startpos_full *packet = pd.startpos;
-      const struct startpos *psp = objbind_get_object(ob);
-
-      if (NULL != psp) {
-        startpos_pack(psp, packet);
-      }
-    }
-    return;
-
-  case OBJTYPE_UNIT:
-    {
-      struct packet_edit_unit *packet = pd.unit;
-      const struct unit *punit = objbind_get_object(ob);
-
-      if (NULL == punit) {
-        return;
-      }
-
-      packet->id = punit->id;
-      packet->moves_left = punit->moves_left;
-      packet->fuel = punit->fuel;
-      packet->moved = punit->moved;
-      packet->done_moving = punit->done_moving;
-      packet->hp = punit->hp;
-      packet->veteran = punit->veteran;
-      packet->stay = punit->stay;
-      /* TODO: Set more packet fields. */
-    }
-    return;
-
-  case OBJTYPE_CITY:
-    {
-      struct packet_edit_city *packet = pd.city;
-      const struct city *pcity = objbind_get_object(ob);
-      int i;
-
-      if (NULL == pcity) {
-        return;
-      }
-
-      packet->id = pcity->id;
-      sz_strlcpy(packet->name, pcity->name);
-      packet->size = city_size_get(pcity);
-      packet->history = pcity->history;
-      for (i = 0; i < B_LAST; i++) {
-        packet->built[i] = pcity->built[i].turn;
-      }
-      packet->food_stock = pcity->food_stock;
-      packet->shield_stock = pcity->shield_stock;
-      /* TODO: Set more packet fields. */
-    }
-    return;
-
-  case OBJTYPE_PLAYER:
-    {
-      struct packet_edit_player *packet = pd.player;
-      const struct player *pplayer = objbind_get_object(ob);
-      const struct nation_type *pnation;
-      const struct research *presearch;
-
-      if (NULL == pplayer) {
-        return;
-      }
-
-      packet->id = player_number(pplayer);
-      sz_strlcpy(packet->name, pplayer->name);
-      pnation = nation_of_player(pplayer);
-      packet->nation = nation_index(pnation);
-      presearch = research_get(pplayer);
-      advance_index_iterate(A_FIRST, tech) {
-        packet->inventions[tech]
-            = TECH_KNOWN == research_invention_state(presearch, tech);
-      } advance_index_iterate_end;
-      packet->autoselect_weight = pplayer->autoselect_weight;
-      packet->gold = pplayer->economic.gold;
-      packet->infrapoints = pplayer->economic.infra_points;
-      packet->government = government_index(pplayer->government);
-      packet->scenario_reserved = player_has_flag(pplayer, PLRF_SCENARIO_RESERVED);
-      /* TODO: Set more packet fields. */
-    }
-    return;
-
-  case OBJTYPE_GAME:
-    {
-      struct packet_edit_game *packet = pd.game.game;
-      const struct civ_game *pgame = objbind_get_object(ob);
-
-      if (NULL == pgame) {
-        return;
-      }
-
-      packet->scenario = pgame->scenario.is_scenario;
-      sz_strlcpy(packet->scenario_name, pgame->scenario.name);
-      sz_strlcpy(packet->scenario_authors, pgame->scenario.authors);
-      sz_strlcpy(pd.game.desc->scenario_desc, pgame->scenario_desc.description);
-      packet->scenario_random = pgame->scenario.save_random;
-      packet->scenario_players = pgame->scenario.players;
-      packet->startpos_nations = pgame->scenario.startpos_nations;
-      packet->prevent_new_cities = pgame->scenario.prevent_new_cities;
-      packet->lake_flooding = pgame->scenario.lake_flooding;
-    }
-    return;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled object type %s (nb %d).", __FUNCTION__,
-            objtype_get_name(objtype), objtype);
-}
-
-/************************************************************************//**
-  Package the modified property value into the supplied packet.
-****************************************************************************/
-static void objbind_pack_modified_value(struct objbind *ob,
-                                        struct objprop *op,
-                                        union packetdata pd)
-{
-  struct propval *pv;
-  enum editor_object_type objtype;
-  enum object_property_ids propid;
-
-  if (!op || !ob || !pd.pointers.v_pointer1) {
-    return;
-  }
-
-  if (NULL == objbind_get_object(ob)) {
-    return;
-  }
-
-  if (objprop_is_readonly(op) || !objbind_property_is_modified(ob, op)) {
-    return;
-  }
-
-  pv = objbind_get_modified_value(ob, op);
-  if (!pv) {
-    return;
-  }
-
-  objtype = objbind_get_objtype(ob);
-  propid = objprop_get_id(op);
-
-  switch (objtype) {
-  case OBJTYPE_TILE:
-    {
-      struct packet_edit_tile *packet = pd.tile;
-
-      switch (propid) {
-      case OPID_TILE_SPECIALS:
-        extra_type_by_cause_iterate(EC_SPECIAL, pextra) {
-          if (BV_ISSET(pv->data.v_bv_special, pextra->data.special_idx)) {
-            BV_SET(packet->extras, pextra->data.special_idx);
-          } else {
-            BV_CLR(packet->extras, pextra->data.special_idx);
-          }
-        } extra_type_by_cause_iterate_end;
-        return;
-      case OPID_TILE_ROADS:
-        extra_type_by_cause_iterate(EC_ROAD, pextra) {
-          int ridx = road_number(extra_road_get(pextra));
-
-          if (BV_ISSET(pv->data.v_bv_roads, ridx)) {
-            BV_SET(packet->extras, extra_index(pextra));
-          } else {
-            BV_CLR(packet->extras, extra_index(pextra));
-          }
-        } extra_type_by_cause_iterate_end;
-        return;
-      case OPID_TILE_BASES:
-        extra_type_by_cause_iterate(EC_BASE, pextra) {
-          int bidx = base_number(extra_base_get(pextra));
-
-          if (BV_ISSET(pv->data.v_bv_bases, bidx)) {
-            BV_SET(packet->extras, extra_index(pextra));
-          } else {
-            BV_CLR(packet->extras, extra_index(pextra));
-          }
-        } extra_type_by_cause_iterate_end;
-        return;
-      case OPID_TILE_LABEL:
-        sz_strlcpy(packet->label, pv->data.v_string);
-        return;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case OBJTYPE_STARTPOS:
-    {
-      struct packet_edit_startpos_full *packet = pd.startpos;
-
-      switch (propid) {
-      case OPID_STARTPOS_EXCLUDE:
-        packet->exclude = pv->data.v_bool;
-        return;
-      case OPID_STARTPOS_NATIONS:
-        BV_CLR_ALL(packet->nations);
-        nation_hash_iterate(pv->data.v_nation_hash, pnation) {
-          BV_SET(packet->nations, nation_number(pnation));
-        } nation_hash_iterate_end;
-        return;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case OBJTYPE_UNIT:
-    {
-      struct packet_edit_unit *packet = pd.unit;
-
-      switch (propid) {
-      case OPID_UNIT_MOVES_LEFT:
-        packet->moves_left = pv->data.v_int;
-        return;
-      case OPID_UNIT_FUEL:
-        packet->fuel = pv->data.v_int;
-        return;
-      case OPID_UNIT_MOVED:
-        packet->moved = pv->data.v_bool;
-        return;
-      case OPID_UNIT_DONE_MOVING:
-        packet->done_moving = pv->data.v_bool;
-        return;
-      case OPID_UNIT_HP:
-        packet->hp = pv->data.v_int;
-        return;
-      case OPID_UNIT_VETERAN:
-        packet->veteran = pv->data.v_int;
-        return;
-      case OPID_UNIT_STAY:
-        packet->stay = pv->data.v_bool;
-        return;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case OBJTYPE_CITY:
-    {
-      struct packet_edit_city *packet = pd.city;
-
-      switch (propid) {
-      case OPID_CITY_NAME:
-        sz_strlcpy(packet->name, pv->data.v_string);
-        return;
-      case OPID_CITY_SIZE:
-        packet->size = pv->data.v_int;
-        return;
-      case OPID_CITY_HISTORY:
-        packet->history = pv->data.v_int;
-        return;
-      case OPID_CITY_FOOD_STOCK:
-        packet->food_stock = pv->data.v_int;
-        return;
-      case OPID_CITY_SHIELD_STOCK:
-        packet->shield_stock = pv->data.v_int;
-        return;
-      case OPID_CITY_BUILDINGS:
-        {
-          int i;
-
-          for (i = 0; i < B_LAST; i++) {
-            packet->built[i] = pv->data.v_built[i].turn;
-          }
-        }
-        return;
-      default:
-          break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case OBJTYPE_PLAYER:
-    {
-      struct packet_edit_player *packet = pd.player;
-
-      switch (propid) {
-      case OPID_PLAYER_NAME:
-        sz_strlcpy(packet->name, pv->data.v_string);
-        return;
-      case OPID_PLAYER_NATION:
-        packet->nation = nation_index(pv->data.v_nation);
-        return;
-      case OPID_PLAYER_GOV:
-        packet->government = government_index(pv->data.v_gov);
-        return;
-      case OPID_PLAYER_INVENTIONS:
-        advance_index_iterate(A_FIRST, tech) {
-          packet->inventions[tech] = BV_ISSET(pv->data.v_bv_inventions, tech);
-        } advance_index_iterate_end;
-        return;
-      case OPID_PLAYER_SCENARIO_RESERVED:
-        packet->scenario_reserved = pv->data.v_bool;
-        return;
-      case OPID_PLAYER_SELECT_WEIGHT:
-        packet->autoselect_weight = pv->data.v_int;
-        return;
-      case OPID_PLAYER_SCIENCE:
-        packet->bulbs_researched = pv->data.v_int;
-        return;
-      case OPID_PLAYER_GOLD:
-        packet->gold = pv->data.v_int;
-        return;
-      case OPID_PLAYER_INFRAPOINTS:
-        packet->infrapoints = pv->data.v_int;
-        return;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case OBJTYPE_GAME:
-    {
-      struct packet_edit_game *packet = pd.game.game;
-
-      switch (propid) {
-      case OPID_GAME_SCENARIO:
-        packet->scenario = pv->data.v_bool;
-        return;
-      case OPID_GAME_SCENARIO_NAME:
-        sz_strlcpy(packet->scenario_name, pv->data.v_const_string);
-        return;
-      case OPID_GAME_SCENARIO_AUTHORS:
-        sz_strlcpy(packet->scenario_authors, pv->data.v_const_string);
-        return;
-      case OPID_GAME_SCENARIO_DESC:
-        sz_strlcpy(pd.game.desc->scenario_desc, pv->data.v_const_string);
-        return;
-      case OPID_GAME_SCENARIO_RANDSTATE:
-        packet->scenario_random = pv->data.v_bool;
-        return;
-      case OPID_GAME_SCENARIO_PLAYERS:
-        packet->scenario_players = pv->data.v_bool;
-        return;
-      case OPID_GAME_STARTPOS_NATIONS:
-        packet->startpos_nations = pv->data.v_bool;
-        return;
-      case OPID_GAME_PREVENT_CITIES:
-        packet->prevent_new_cities = pv->data.v_bool;
-        return;
-      case OPID_GAME_LAKE_FLOODING:
-        packet->lake_flooding = pv->data.v_bool;
-        return;
-      case OPID_GAME_RULESET_LOCKED:
-        packet->ruleset_locked = pv->data.v_bool;
-        return;
-      default:
-        break;
-      }
-    }
-    log_error("%s(): Unhandled request to pack value of property "
-              "%d (%s) from object of type \"%s\".", __FUNCTION__,
-              propid, objprop_get_name(op), objtype_get_name(objtype));
-    return;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled request for object type \"%s\" (nb %d).",
-            __FUNCTION__, objtype_get_name(objtype), objtype);
-
-}
-
-/************************************************************************//**
-  Sets the row reference in a GtkTreeModel of this objbind.
-****************************************************************************/
-static void objbind_set_rowref(struct objbind *ob,
-                               GtkTreeRowReference *rr)
-{
-  if (!ob) {
-    return;
-  }
-  ob->rowref = rr;
-}
-
-/************************************************************************//**
-  Returns the row reference of this objbind, or NULL if not applicable.
-****************************************************************************/
-static GtkTreeRowReference *objbind_get_rowref(struct objbind *ob)
-{
-  if (!ob) {
-    return NULL;
-  }
-  return ob->rowref;
-}
-
-/************************************************************************//**
-  Returns the unique property identifier for this object property.
-****************************************************************************/
-static int objprop_get_id(const struct objprop *op)
-{
-  if (!op) {
-    return -1;
-  }
-  return op->id;
-}
-
-/************************************************************************//**
-  Returns the GType that this object property renders as in a GtkTreeView.
-  Returning G_TYPE_NONE indicates that this property cannot be viewed
-  in a list.
-
-  NB: This must correspond to the actions in property_page_set_store_value.
-****************************************************************************/
-static GType objprop_get_gtype(const struct objprop *op)
-{
-  fc_assert_ret_val(NULL != op, G_TYPE_NONE);
-
-  switch (op->valtype) {
-  case VALTYPE_NONE:
-  case VALTYPE_TILE_VISION_DATA:
-    return G_TYPE_NONE;
-  case VALTYPE_INT:
-    return G_TYPE_INT;
-  case VALTYPE_BOOL:
-    /* We want to show it as translated string, not as untranslated G_TYPE_BOOLEAN */
-    return G_TYPE_STRING;
-  case VALTYPE_STRING:
-  case VALTYPE_BUILT_ARRAY:
-  case VALTYPE_INVENTIONS_ARRAY:
-  case VALTYPE_BV_SPECIAL:
-  case VALTYPE_BV_ROADS:
-  case VALTYPE_BV_BASES:
-  case VALTYPE_NATION_HASH:
-    return G_TYPE_STRING;
-  case VALTYPE_PIXBUF:
-  case VALTYPE_NATION:
-  case VALTYPE_GOV:
-    return GDK_TYPE_PIXBUF;
-  }
-  log_error("%s(): Unhandled value type %d.", __FUNCTION__, op->valtype);
-  return G_TYPE_NONE;
-}
-
-/************************************************************************//**
-  Returns the value type of this property value (one of enum value_types).
-****************************************************************************/
-static enum value_types objprop_get_valtype(const struct objprop *op)
-{
-  if (!op) {
-    return VALTYPE_NONE;
-  }
-  return op->valtype;
-}
-
-/************************************************************************//**
-  Returns TRUE if this object property can be viewed in a GtkTreeView.
-****************************************************************************/
-static bool objprop_show_in_listview(const struct objprop *op)
-{
-  if (!op) {
-    return FALSE;
-  }
-  return op->flags & OPF_IN_LISTVIEW;
-}
-
-/************************************************************************//**
-  Returns TRUE if this object property can create and use a property widget.
-****************************************************************************/
-static bool objprop_has_widget(const struct objprop *op)
-{
-  if (!op) {
-    return FALSE;
-  }
-  return op->flags & OPF_HAS_WIDGET;
-}
-
-/************************************************************************//**
-  Returns a the string corresponding to the attribute type name required
-  for gtk_tree_view_column_new_with_attributes according to this objprop's
-  GType value. May return NULL if it does not make sense for this
-  object property.
-****************************************************************************/
-static const char *objprop_get_attribute_type_string(const struct objprop *op)
-{
-  GType gtype;
-
-  if (!op) {
-    return NULL;
-  }
-
-  gtype = objprop_get_gtype(op);
-  if (gtype == G_TYPE_INT || gtype == G_TYPE_STRING
-      || gtype == G_TYPE_BOOLEAN) {
-    return "text";
-  } else if (gtype == GDK_TYPE_PIXBUF) {
-    return "pixbuf";
-  }
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Store the column id of the list store that this object property can be
-  viewed in. This should generally only be changed set once, when the
-  object property's associated list view is created.
-  NB: This is the column id in the model, not the view.
-****************************************************************************/
-static void objprop_set_column_id(struct objprop *op, int col_id)
-{
-  if (!op) {
-    return;
-  }
-  op->column_id = col_id;
-}
-
-/************************************************************************//**
-  Returns the column id in the list store for this object property.
-  May return -1 if not applicable or if not yet set.
-  NB: This is the column id in the model, not the view.
-****************************************************************************/
-static int objprop_get_column_id(const struct objprop *op)
-{
-  if (!op) {
-    return -1;
-  }
-  return op->column_id;
-}
-
-/************************************************************************//**
-  Sets the view column reference for later convenience.
-****************************************************************************/
-static void objprop_set_treeview_column(struct objprop *op,
-                                        GtkTreeViewColumn *col)
-{
-  if (!op) {
-    return;
-  }
-  op->view_column = col;
-}
-
-/************************************************************************//**
-  Returns the previously stored tree view column reference, or NULL if none
-  exists.
-****************************************************************************/
-static GtkTreeViewColumn *objprop_get_treeview_column(const struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  return op->view_column;
-}
-
-/************************************************************************//**
-  Returns the string name of this object property.
-****************************************************************************/
-static const char *objprop_get_name(const struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  return op->name;
-}
-
-/************************************************************************//**
-  Return a description (translated) of the property.
-****************************************************************************/
-static const char *objprop_get_tooltip(const struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  return op->tooltip;
-}
-
-/************************************************************************//**
-  Create and return a cell renderer corresponding to this object property,
-  suitable to be used with a tree view. May return NULL if this object
-  property cannot exist in a list store.
-****************************************************************************/
-static GtkCellRenderer *objprop_create_cell_renderer(const struct objprop *op)
-{
-  GtkCellRenderer *cell = NULL;
-  GType gtype;
-
-  gtype = objprop_get_gtype(op);
-
-  if (gtype == G_TYPE_INT || gtype == G_TYPE_STRING
-      || gtype == G_TYPE_BOOLEAN) {
-    cell = gtk_cell_renderer_text_new();
-  } else if (gtype == GDK_TYPE_PIXBUF) {
-    cell = gtk_cell_renderer_pixbuf_new();
-  }
-
-  return cell;
-}
-
-/************************************************************************//**
-  Return TRUE if the given object property can be sorted (i.e. in the list
-  view).
-****************************************************************************/
-static bool objprop_is_sortable(const struct objprop *op)
-{
-  GType gtype;
-  if (!op) {
-    return FALSE;
-  }
-  gtype = objprop_get_gtype(op);
-  return gtype == G_TYPE_INT || gtype == G_TYPE_STRING;
-}
-
-/************************************************************************//**
-  Return TRUE if the given object property cannot be edited (i.e. it is
-  displayed information only).
-****************************************************************************/
-static bool objprop_is_readonly(const struct objprop *op)
-{
-  if (!op) {
-    return TRUE;
-  }
-  return !(op->flags & OPF_EDITABLE);
-}
-
-/************************************************************************//**
-  Callback for text widget 'changed' signal.
-****************************************************************************/
-static void objprop_widget_text_changed(GtkEditable *text, gpointer userdata)
-{
-  struct objprop *op;
-  struct property_page *pp;
-  struct propval value = {{0,}, VALTYPE_STRING, FALSE};
-
-  op = userdata;
-  pp = objprop_get_property_page(op);
-  value.data.v_const_string = gtk_entry_buffer_get_text(gtk_text_get_buffer(GTK_TEXT(text)));
-
-  property_page_change_value(pp, op, &value);
-}
-
-/************************************************************************//**
-  Callback for spin button widget 'value-changed' signal.
-****************************************************************************/
-static void objprop_widget_spin_button_changed(GtkSpinButton *spin,
-                                               gpointer userdata)
-{
-  struct objprop *op;
-  struct property_page *pp;
-  struct propval value = {{0,}, VALTYPE_INT, FALSE};
-
-  op = userdata;
-  pp = objprop_get_property_page(op);
-  value.data.v_int = gtk_spin_button_get_value_as_int(spin);
-
-  property_page_change_value(pp, op, &value);
-}
-
-/************************************************************************//**
-  Callback for toggle type button widget 'toggled' signal.
-****************************************************************************/
-static void objprop_widget_toggle_button_changed(GtkToggleButton *button,
-                                                 gpointer userdata)
-{
-  struct objprop *op;
-  struct property_page *pp;
-  struct propval value = {{0,}, VALTYPE_BOOL, FALSE};
-
-  op = userdata;
-  pp = objprop_get_property_page(op);
-  value.data.v_bool = gtk_toggle_button_get_active(button);
-
-  property_page_change_value(pp, op, &value);
-}
-
-/************************************************************************//**
-  Create the gtk widget used to edit or display this object property.
-****************************************************************************/
-static void objprop_setup_widget(struct objprop *op)
-{
-  GtkWidget *hbox, *hbox2, *label, *image, *text, *spin, *button;
-  struct extviewer *ev = NULL;
-  enum object_property_ids propid;
-
-  if (!op) {
-    return;
-  }
-
-  if (!objprop_has_widget(op)) {
-    return;
-  }
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-  op->widget = hbox;
-
-  label = gtk_label_new(objprop_get_name(op));
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(hbox), label);
-  objprop_set_child_widget(op, "name-label", label);
-
-  propid = objprop_get_id(op);
-
-  switch (propid) {
-  case OPID_TILE_INDEX:
-  case OPID_TILE_X:
-  case OPID_TILE_Y:
-  case OPID_TILE_NAT_X:
-  case OPID_TILE_NAT_Y:
-  case OPID_TILE_CONTINENT:
-  case OPID_TILE_TERRAIN:
-  case OPID_TILE_RESOURCE:
-  case OPID_TILE_XY:
-  case OPID_STARTPOS_XY:
-  case OPID_UNIT_ID:
-  case OPID_UNIT_XY:
-  case OPID_UNIT_TYPE:
-  case OPID_CITY_ID:
-  case OPID_CITY_XY:
-  case OPID_PLAYER_AGE:
-#ifdef FREECIV_DEBUG
-  case OPID_TILE_ADDRESS:
-  case OPID_UNIT_ADDRESS:
-  case OPID_CITY_ADDRESS:
-  case OPID_PLAYER_ADDRESS:
-#endif /* FREECIV_DEBUG */
-    label = gtk_label_new(NULL);
-    gtk_widget_set_hexpand(label, TRUE);
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(hbox), label);
-    objprop_set_child_widget(op, "value-label", label);
-    return;
-
-  case OPID_TILE_IMAGE:
-  case OPID_STARTPOS_IMAGE:
-  case OPID_UNIT_IMAGE:
-  case OPID_CITY_IMAGE:
-    image = gtk_image_new();
-    gtk_widget_set_size_request(image,
-                                tileset_tile_width(tileset),
-                                tileset_tile_height(tileset));
-    gtk_widget_set_hexpand(image, TRUE);
-    gtk_widget_set_halign(image, GTK_ALIGN_START);
-    gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(hbox), image);
-    objprop_set_child_widget(op, "image", image);
-    return;
-
-  case OPID_CITY_NAME:
-  case OPID_PLAYER_NAME:
-  case OPID_GAME_SCENARIO_NAME:
-  case OPID_TILE_LABEL:
-    text = gtk_text_new();
-    gtk_widget_set_hexpand(text, TRUE);
-    gtk_widget_set_halign(text, GTK_ALIGN_END);
-    gtk_editable_set_width_chars(GTK_EDITABLE(text), 8);
-    g_signal_connect(text, "changed",
-                     G_CALLBACK(objprop_widget_text_changed), op);
-    gtk_box_append(GTK_BOX(hbox), text);
-    objprop_set_child_widget(op, "text", text);
-    return;
-
-  case OPID_UNIT_MOVES_LEFT:
-  case OPID_CITY_SIZE:
-  case OPID_CITY_HISTORY:
-  case OPID_CITY_SHIELD_STOCK:
-  case OPID_PLAYER_SELECT_WEIGHT:
-  case OPID_PLAYER_SCIENCE:
-  case OPID_PLAYER_GOLD:
-  case OPID_PLAYER_INFRAPOINTS:
-    spin = gtk_spin_button_new_with_range(0.0, 100.0, 1.0);
-    gtk_widget_set_hexpand(spin, TRUE);
-    gtk_widget_set_halign(spin, GTK_ALIGN_END);
-    g_signal_connect(spin, "value-changed",
-        G_CALLBACK(objprop_widget_spin_button_changed), op);
-    gtk_box_append(GTK_BOX(hbox), spin);
-    objprop_set_child_widget(op, "spin", spin);
-    return;
-
-  case OPID_UNIT_FUEL:
-  case OPID_UNIT_HP:
-  case OPID_UNIT_VETERAN:
-  case OPID_CITY_FOOD_STOCK:
-    hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    gtk_widget_set_hexpand(hbox2, TRUE);
-    gtk_widget_set_halign(hbox2, GTK_ALIGN_END);
-    gtk_box_append(GTK_BOX(hbox), hbox2);
-    spin = gtk_spin_button_new_with_range(0.0, 100.0, 1.0);
-    g_signal_connect(spin, "value-changed",
-        G_CALLBACK(objprop_widget_spin_button_changed), op);
-    gtk_box_append(GTK_BOX(hbox2), spin);
-    objprop_set_child_widget(op, "spin", spin);
-    label = gtk_label_new(NULL);
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(hbox2), label);
-    objprop_set_child_widget(op, "max-value-label", label);
-    return;
-
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-  case OPID_TILE_VISION:
-  case OPID_STARTPOS_NATIONS:
-  case OPID_CITY_BUILDINGS:
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-  case OPID_PLAYER_INVENTIONS:
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    ev = extviewer_new(op);
-    objprop_set_extviewer(op, ev);
-    gtk_widget_set_hexpand(extviewer_get_panel_widget(ev), TRUE);
-    gtk_widget_set_halign(extviewer_get_panel_widget(ev), GTK_ALIGN_END);
-    gtk_box_append(GTK_BOX(hbox), extviewer_get_panel_widget(ev));
-    property_page_add_extviewer(objprop_get_property_page(op), ev);
-    return;
-
-  case OPID_STARTPOS_EXCLUDE:
-  case OPID_UNIT_MOVED:
-  case OPID_UNIT_DONE_MOVING:
-  case OPID_UNIT_STAY:
-  case OPID_GAME_SCENARIO:
-  case OPID_GAME_SCENARIO_RANDSTATE:
-  case OPID_GAME_SCENARIO_PLAYERS:
-  case OPID_GAME_STARTPOS_NATIONS:
-  case OPID_GAME_PREVENT_CITIES:
-  case OPID_GAME_LAKE_FLOODING:
-  case OPID_GAME_RULESET_LOCKED:
-  case OPID_PLAYER_SCENARIO_RESERVED:
-    button = gtk_toggle_button_new();
-    gtk_widget_set_hexpand(button, TRUE);
-    gtk_widget_set_halign(button, GTK_ALIGN_END);
-    g_signal_connect(button, "toggled",
-                     G_CALLBACK(objprop_widget_toggle_button_changed),
-                     op);
-    gtk_box_append(GTK_BOX(hbox), button);
-    objprop_set_child_widget(op, "togglebutton", button);
-    return;
-  }
-
-  log_error("%s(): Unhandled request to create widget for property %d (%s).",
-            __FUNCTION__, propid, objprop_get_name(op));
-}
-
-/************************************************************************//**
-  Refresh the display/edit widget corresponding to this object property
-  according to the value of the bound object. If a stored modified value
-  exists, then check it against the object's current value and remove it
-  if they are equal.
-
-  If 'ob' is NULL, then clear the widget.
-****************************************************************************/
-static void objprop_refresh_widget(struct objprop *op,
-                                   struct objbind *ob)
-{
-  GtkWidget *w, *label, *image, *text, *spin, *button;
-  struct extviewer *ev;
-  struct propval *pv;
-  bool modified;
-  enum object_property_ids propid;
-  double min, max, step, big_step;
-  char buf[256];
-  const char *newtext;
-  GtkEntryBuffer *buffer;
-
-  if (!op || !objprop_has_widget(op)) {
-    return;
-  }
-
-  w = objprop_get_widget(op);
-  if (!w) {
-    return;
-  }
-
-  propid = objprop_get_id(op);
-
-  /* NB: We must take care to propval_free() the return value of
-   * objbind_get_value_from_object(), since it always makes a
-   * copy, but to NOT free the result of objbind_get_modified_value()
-   * since it returns its own stored value. */
-  pv = objbind_get_value_from_object(ob, op);
-  modified = objbind_property_is_modified(ob, op);
-
-  if (pv && modified) {
-    struct propval *pv_mod;
-
-    pv_mod = objbind_get_modified_value(ob, op);
-    if (pv_mod) {
-      if (propval_equal(pv, pv_mod)) {
-        objbind_clear_modified_value(ob, op);
-        modified = FALSE;
-      } else {
-        propval_free(pv);
-        pv = pv_mod;
-        modified = TRUE;
-      }
-    } else {
-      modified = FALSE;
-    }
-  }
-
-  switch (propid) {
-  case OPID_TILE_IMAGE:
-  case OPID_STARTPOS_IMAGE:
-  case OPID_UNIT_IMAGE:
-  case OPID_CITY_IMAGE:
-    image = objprop_get_child_widget(op, "image");
-    if (pv) {
-      gtk_image_set_from_pixbuf(GTK_IMAGE(image), pv->data.v_pixbuf);
-    } else {
-      gtk_image_set_from_pixbuf(GTK_IMAGE(image), NULL);
-    }
-    break;
-
-  case OPID_TILE_XY:
-  case OPID_TILE_TERRAIN:
-  case OPID_TILE_RESOURCE:
-  case OPID_STARTPOS_XY:
-  case OPID_UNIT_XY:
-  case OPID_UNIT_TYPE:
-  case OPID_CITY_XY:
-#ifdef FREECIV_DEBUG
-  case OPID_TILE_ADDRESS:
-  case OPID_UNIT_ADDRESS:
-  case OPID_CITY_ADDRESS:
-  case OPID_PLAYER_ADDRESS:
-#endif /* FREECIV_DEBUG */
-    label = objprop_get_child_widget(op, "value-label");
-    if (pv) {
-      gtk_label_set_text(GTK_LABEL(label), pv->data.v_string);
-    } else {
-      gtk_label_set_text(GTK_LABEL(label), NULL);
-    }
-    break;
-
-  case OPID_TILE_INDEX:
-  case OPID_TILE_X:
-  case OPID_TILE_Y:
-  case OPID_TILE_NAT_X:
-  case OPID_TILE_NAT_Y:
-  case OPID_TILE_CONTINENT:
-  case OPID_UNIT_ID:
-  case OPID_CITY_ID:
-  case OPID_PLAYER_AGE:
-    label = objprop_get_child_widget(op, "value-label");
-    if (pv) {
-      char agebuf[16];
-
-      fc_snprintf(agebuf, sizeof(agebuf), "%d", pv->data.v_int);
-      gtk_label_set_text(GTK_LABEL(label), agebuf);
-    } else {
-      gtk_label_set_text(GTK_LABEL(label), NULL);
-    }
-    break;
-
-  case OPID_CITY_NAME:
-  case OPID_PLAYER_NAME:
-  case OPID_GAME_SCENARIO_NAME:
-  case OPID_TILE_LABEL:
-    text = objprop_get_child_widget(op, "text");
-    if (pv) {
-      /* Most of these are semantically in "v_const_string",
-       * but this works as the address is the same regardless. */
-      newtext = pv->data.v_string;
-    } else {
-      newtext = "";
-    }
-    buffer = gtk_text_get_buffer(GTK_TEXT(text));
-
-    /* Only set the text if it has changed. This breaks
-     * recursive loop. */
-    if (strcmp(newtext, gtk_entry_buffer_get_text(buffer))) {
-      gtk_entry_buffer_set_text(buffer, newtext, -1);
-    }
-    gtk_widget_set_sensitive(text, pv != NULL);
-    break;
-
-  case OPID_UNIT_MOVES_LEFT:
-  case OPID_CITY_SIZE:
-  case OPID_CITY_HISTORY:
-  case OPID_CITY_SHIELD_STOCK:
-  case OPID_PLAYER_SELECT_WEIGHT:
-  case OPID_PLAYER_SCIENCE:
-  case OPID_PLAYER_GOLD:
-  case OPID_PLAYER_INFRAPOINTS:
-    spin = objprop_get_child_widget(op, "spin");
-    if (pv) {
-      disable_gobject_callback(G_OBJECT(spin),
-          G_CALLBACK(objprop_widget_spin_button_changed));
-      if (objbind_get_allowed_value_span(ob, op, &min, &max,
-                                         &step, &big_step)) {
-        gtk_spin_button_set_range(GTK_SPIN_BUTTON(spin), min, max);
-        gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spin),
-                                       step, big_step);
-      }
-      gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), pv->data.v_int);
-      enable_gobject_callback(G_OBJECT(spin),
-                              G_CALLBACK(objprop_widget_spin_button_changed));
-    }
-    gtk_widget_set_sensitive(spin, pv != NULL);
-    break;
-
-  case OPID_UNIT_FUEL:
-  case OPID_UNIT_HP:
-  case OPID_UNIT_VETERAN:
-  case OPID_CITY_FOOD_STOCK:
-    spin = objprop_get_child_widget(op, "spin");
-    label = objprop_get_child_widget(op, "max-value-label");
-    if (pv) {
-      disable_gobject_callback(G_OBJECT(spin),
-          G_CALLBACK(objprop_widget_spin_button_changed));
-      if (objbind_get_allowed_value_span(ob, op, &min, &max,
-                                         &step, &big_step)) {
-        gtk_spin_button_set_range(GTK_SPIN_BUTTON(spin), min, max);
-        gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spin),
-                                       step, big_step);
-        fc_snprintf(buf, sizeof(buf), "/%d", (int) max);
-        gtk_label_set_text(GTK_LABEL(label), buf);
-      } else {
-        gtk_label_set_text(GTK_LABEL(label), NULL);
-      }
-      gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), pv->data.v_int);
-      enable_gobject_callback(G_OBJECT(spin),
-          G_CALLBACK(objprop_widget_spin_button_changed));
-    } else {
-      gtk_label_set_text(GTK_LABEL(label), NULL);
-    }
-    gtk_widget_set_sensitive(spin, pv != NULL);
-    break;
-
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-  case OPID_TILE_VISION:
-  case OPID_STARTPOS_NATIONS:
-  case OPID_CITY_BUILDINGS:
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-  case OPID_PLAYER_INVENTIONS:
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    ev = objprop_get_extviewer(op);
-    if (pv) {
-      extviewer_refresh_widgets(ev, pv);
-    } else {
-      extviewer_clear_widgets(ev);
-    }
-    break;
-
-  case OPID_STARTPOS_EXCLUDE:
-  case OPID_UNIT_MOVED:
-  case OPID_UNIT_DONE_MOVING:
-  case OPID_UNIT_STAY:
-  case OPID_GAME_SCENARIO:
-  case OPID_GAME_SCENARIO_RANDSTATE:
-  case OPID_GAME_SCENARIO_PLAYERS:
-  case OPID_GAME_STARTPOS_NATIONS:
-  case OPID_GAME_PREVENT_CITIES:
-  case OPID_GAME_LAKE_FLOODING:
-  case OPID_GAME_RULESET_LOCKED:
-  case OPID_PLAYER_SCENARIO_RESERVED:
-    button = objprop_get_child_widget(op, "togglebutton");
-    disable_gobject_callback(G_OBJECT(button),
-                             G_CALLBACK(objprop_widget_toggle_button_changed));
-    if (pv) {
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
-                                   pv->data.v_bool);
-    } else {
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
-    }
-    enable_gobject_callback(G_OBJECT(button),
-                            G_CALLBACK(objprop_widget_toggle_button_changed));
-    gtk_widget_set_sensitive(button, pv != NULL);
-    break;
-  }
-
-  if (!modified) {
-    propval_free(pv);
-  }
-
-  label = objprop_get_child_widget(op, "name-label");
-  if (label) {
-    const char *name = objprop_get_name(op);
-    if (modified) {
-      char namebuf[128];
-
-      fc_snprintf(namebuf, sizeof(namebuf),
-                  "<span foreground=\"red\">%s</span>", name);
-      gtk_label_set_markup(GTK_LABEL(label), namebuf);
-    } else {
-      gtk_label_set_text(GTK_LABEL(label), name);
-    }
-  }
-}
-
-/************************************************************************//**
-  Returns the gtk widget used to display or edit this property, or NULL
-  if not applicable.
-****************************************************************************/
-static GtkWidget *objprop_get_widget(struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  if (!op->widget) {
-    objprop_setup_widget(op);
-  }
-  return op->widget;
-}
-
-/************************************************************************//**
-  Stores the given widget under the given name. This function will have no
-  effect if objprop_get_widget does not return a valid GtkWidget instance.
-****************************************************************************/
-static void objprop_set_child_widget(struct objprop *op,
-                                     const char *widget_name,
-                                     GtkWidget *widget)
-{
-  GtkWidget *w;
-
-  if (!op || !widget_name || !widget) {
-    return;
-  }
-
-  w = objprop_get_widget(op);
-  if (!w) {
-    log_error("Cannot store child widget %p under name "
-              "\"%s\" using objprop_set_child_widget for object "
-              "property %d (%s) because objprop_get_widget does "
-              "not return a valid widget.",
-              widget, widget_name, objprop_get_id(op), objprop_get_name(op));
-    return;
-  }
-
-  g_object_set_data(G_OBJECT(w), widget_name, widget);
-}
-
-/************************************************************************//**
-  Retrieves the widget stored under the given name, or returns NULL and
-  logs an error message if not found.
-****************************************************************************/
-static GtkWidget *objprop_get_child_widget(struct objprop *op,
-                                           const char *widget_name)
-{
-  GtkWidget *w, *child;
-
-  if (!op || !widget_name) {
-    return NULL;
-  }
-
-  w = objprop_get_widget(op);
-  if (!w) {
-    log_error("Cannot retrieve child widget under name "
-              "\"%s\" using objprop_get_child_widget for object "
-              "property %d (%s) because objprop_get_widget does "
-              "not return a valid widget.",
-              widget_name, objprop_get_id(op), objprop_get_name(op));
-    return NULL;
-  }
-
-  child = g_object_get_data(G_OBJECT(w), widget_name);
-  if (!child) {
-    log_error("Child widget \"%s\" not found for object "
-              "property %d (%s) via objprop_get_child_widget.",
-              widget_name, objprop_get_id(op), objprop_get_name(op));
-    return NULL;
-  }
-
-  return child;
-}
-
-/************************************************************************//**
-  Store the extviewer struct for later retrieval.
-****************************************************************************/
-static void objprop_set_extviewer(struct objprop *op,
-                                  struct extviewer *ev)
-{
-  if (!op) {
-    return;
-  }
-  op->extviewer = ev;
-}
-
-/************************************************************************//**
-  Return the stored extviewer, or NULL if none exists.
-****************************************************************************/
-static struct extviewer *objprop_get_extviewer(struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  return op->extviewer;
-}
-
-/************************************************************************//**
-  Get the property page in which this property is installed.
-****************************************************************************/
-static struct property_page *objprop_get_property_page(const struct objprop *op)
-{
-  if (!op) {
-    return NULL;
-  }
-  return op->parent_page;
-}
-
-/************************************************************************//**
-  Create a new object property.
-****************************************************************************/
-static struct objprop *objprop_new(int id,
-                                   const char *name,
-                                   const char *tooltip,
-                                   enum object_property_flags flags,
-                                   enum value_types valtype,
-                                   struct property_page *parent)
-{
-  struct objprop *op;
-
-  op = fc_calloc(1, sizeof(*op));
-  op->id = id;
-  op->name = name;
-  op->tooltip = tooltip;
-  op->flags = flags;
-  op->valtype = valtype;
-  op->column_id = -1;
-  op->parent_page = parent;
-
-  return op;
-}
-
-/************************************************************************//**
-  Create "extended property viewer". This is used for viewing/editing
-  complex property values (e.g. arrays, bitvectors, etc.).
-****************************************************************************/
-static struct extviewer *extviewer_new(struct objprop *op)
-{
-  struct extviewer *ev;
-  GtkWidget *hbox, *vbox, *label, *button, *scrollwin, *image;
-  GtkWidget *view = NULL;
-  GtkTreeSelection *sel;
-  GtkListStore *store = NULL;
-  GtkTextBuffer *textbuf = NULL;
-  GType *gtypes;
-  enum object_property_ids propid;
-  int num_cols;
-
-  if (!op) {
-    return NULL;
-  }
-
-  ev = fc_calloc(1, sizeof(*ev));
-  ev->objprop = op;
-
-  propid = objprop_get_id(op);
-
-
-  /* Create the panel widget. */
-
-  switch (propid) {
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-  case OPID_STARTPOS_NATIONS:
-  case OPID_CITY_BUILDINGS:
-  case OPID_PLAYER_INVENTIONS:
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    ev->panel_widget = hbox;
-
-    label = gtk_label_new(NULL);
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(hbox), label);
-    ev->panel_label = label;
-    break;
-
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-    vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-    ev->panel_widget = vbox;
-
-    label = gtk_label_new(NULL);
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(vbox), label);
-    ev->panel_label = label;
-
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    gtk_box_append(GTK_BOX(vbox), hbox);
-
-    image = gtk_image_new();
-    if (propid == OPID_PLAYER_GOV) {
-      gtk_widget_set_size_request(image,
-                                  tileset_small_sprite_width(tileset),
-                                  tileset_small_sprite_height(tileset));
-    } else {
-      /* propid OPID_PLAYER_NATION */
-      gtk_widget_set_size_request(image, 100, 40);
-    }
-    gtk_widget_set_halign(image, GTK_ALIGN_START);
-    gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
-    gtk_box_append(GTK_BOX(hbox), image);
-    ev->panel_image = image;
-    break;
-
-  case OPID_TILE_VISION:
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    ev->panel_widget = hbox;
-    break;
-
-  default:
-    log_error("Unhandled request to create panel widget "
-              "for property %d (%s) in extviewer_new().",
-              propid, objprop_get_name(op));
-    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    ev->panel_widget = hbox;
-    break;
-  }
-
-  if (objprop_is_readonly(op)) {
-    button = gtk_button_new_with_label(Q_("?verb:View"));
-  } else {
-    button = gtk_button_new_with_label(_("Edit"));
-  }
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(extviewer_panel_button_clicked), ev);
-  gtk_box_append(GTK_BOX(hbox), button);
-  ev->panel_button = button;
-
-
-  /* Create the data store. */
-
-  switch (propid) {
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-  case OPID_PLAYER_INVENTIONS:
-    store = gtk_list_store_new(3, G_TYPE_BOOLEAN, G_TYPE_INT,
-                               G_TYPE_STRING);
-    break;
-  case OPID_TILE_VISION:
-    num_cols = 3 + 1 + V_COUNT;
-    gtypes = fc_malloc(num_cols * sizeof(GType));
-    gtypes[0] = G_TYPE_INT;       /* player number */
-    gtypes[1] = GDK_TYPE_PIXBUF;  /* player flag */
-    gtypes[2] = G_TYPE_STRING;    /* player name */
-    gtypes[3] = G_TYPE_BOOLEAN;   /* tile_known */
-    vision_layer_iterate(v) {
-      gtypes[4 + v] = G_TYPE_BOOLEAN; /* tile_seen[v] */
-    } vision_layer_iterate_end;
-    store = gtk_list_store_newv(num_cols, gtypes);
-    free(gtypes);
-    break;
-  case OPID_CITY_BUILDINGS:
-    store = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_INT,
-                               G_TYPE_STRING, G_TYPE_STRING);
-    break;
-  case OPID_STARTPOS_NATIONS:
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-    store = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_INT,
-                               GDK_TYPE_PIXBUF, G_TYPE_STRING);
-    break;
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    textbuf = gtk_text_buffer_new(NULL);
-    break;
-  default:
-    log_error("Unhandled request to create data store "
-              "for property %d (%s) in extviewer_new().",
-              propid, objprop_get_name(op));
-    break;
-  }
-
-  ev->store = store;
-  ev->textbuf = textbuf;
-
-  /* Create the view widget. */
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-  ev->view_widget = vbox;
-
-  label = gtk_label_new(objprop_get_name(op));
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_box_append(GTK_BOX(vbox), label);
-  ev->view_label = label;
-
-  if (store || textbuf) {
-    scrollwin = gtk_scrolled_window_new();
-    gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
-                                      TRUE);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
-                                   GTK_POLICY_AUTOMATIC,
-                                   GTK_POLICY_AUTOMATIC);
-    gtk_box_append(GTK_BOX(vbox), scrollwin);
-
-    if (store) {
-      view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-      sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-      gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
-    } else {
-      const bool editable = !objprop_is_readonly(op);
-
-      view = gtk_text_view_new_with_buffer(textbuf);
-      gtk_text_view_set_editable(GTK_TEXT_VIEW(view), editable);
-      gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), editable);
-    }
-    gtk_widget_set_hexpand(view, TRUE);
-    gtk_widget_set_vexpand(view, TRUE);
-
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin), view);
-  }
-
-  switch (propid) {
-
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-    /* TRANS: As in "this tile special is present". */
-    add_column(view, 0, _("Present"), G_TYPE_BOOLEAN, TRUE, FALSE,
-               G_CALLBACK(extviewer_view_cell_toggled), ev);
-    add_column(view, 1, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    break;
-
-  case OPID_TILE_VISION:
-    add_column(view, 0, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 1, _("Nation"), GDK_TYPE_PIXBUF,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 3, _("Known"), G_TYPE_BOOLEAN,
-               FALSE, FALSE, NULL, NULL);
-    vision_layer_iterate(v) {
-      add_column(view, 4 + v, vision_layer_get_name(v),
-                 G_TYPE_BOOLEAN, FALSE, FALSE, NULL, NULL);
-    } vision_layer_iterate_end;
-    break;
-
-  case OPID_CITY_BUILDINGS:
-    /* TRANS: As in "this building is present". */
-    add_column(view, 0, _("Present"), G_TYPE_BOOLEAN, TRUE, FALSE,
-               G_CALLBACK(extviewer_view_cell_toggled), ev);
-    add_column(view, 1, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    /* TRANS: As in "the turn when this building was built". */
-    add_column(view, 3, _("Turn Built"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    break;
-
-  case OPID_STARTPOS_NATIONS:
-    /* TRANS: As in "the player has set this nation". */
-    add_column(view, 0, _("Set"), G_TYPE_BOOLEAN, TRUE, FALSE,
-               G_CALLBACK(extviewer_view_cell_toggled), ev);
-    add_column(view, 1, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2, _("Flag"), GDK_TYPE_PIXBUF,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 3, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    break;
-
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-    /* TRANS: As in "the player has set this nation". */
-    add_column(view, 0, _("Set"), G_TYPE_BOOLEAN, TRUE, TRUE,
-               G_CALLBACK(extviewer_view_cell_toggled), ev);
-    add_column(view, 1, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2,
-               propid == OPID_PLAYER_GOV ? _("Icon") : _("Flag"),
-               GDK_TYPE_PIXBUF,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 3, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    break;
-
-  case OPID_PLAYER_INVENTIONS:
-    /* TRANS: As in "this invention is known". */
-    add_column(view, 0, _("Known"), G_TYPE_BOOLEAN, TRUE, FALSE,
-               G_CALLBACK(extviewer_view_cell_toggled), ev);
-    add_column(view, 1, _("ID"), G_TYPE_INT,
-               FALSE, FALSE, NULL, NULL);
-    add_column(view, 2, _("Name"), G_TYPE_STRING,
-               FALSE, FALSE, NULL, NULL);
-    break;
-
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    g_signal_connect(textbuf, "changed",
-                     G_CALLBACK(extviewer_textbuf_changed), ev);
-    break;
-
-  default:
-    log_error("Unhandled request to configure view widget "
-              "for property %d (%s) in extviewer_new().",
-              propid, objprop_get_name(op));
-    break;
-  }
-
-  gtk_widget_set_visible(ev->panel_widget, TRUE);
-  gtk_widget_set_visible(ev->view_widget, TRUE);
-
-  return ev;
-}
-
-/************************************************************************//**
-  Returns the object property that is displayed by this extviewer.
-****************************************************************************/
-static struct objprop *extviewer_get_objprop(struct extviewer *ev)
-{
-  if (!ev) {
-    return NULL;
-  }
-  return ev->objprop;
-}
-
-/************************************************************************//**
-  Returns the "panel widget" for this extviewer, i.e. the widget the
-  is to be placed into the properties panel.
-****************************************************************************/
-static GtkWidget *extviewer_get_panel_widget(struct extviewer *ev)
-{
-  if (!ev) {
-    return NULL;
-  }
-  return ev->panel_widget;
-}
-
-/************************************************************************//**
-  Returns the "view widget" for this extviewer, i.e. the widget the
-  is to be used for viewing/editing a complex property.
-****************************************************************************/
-static GtkWidget *extviewer_get_view_widget(struct extviewer *ev)
-{
-  if (!ev) {
-    return NULL;
-  }
-  return ev->view_widget;
-}
-
-/************************************************************************//**
-  Set the widgets in the extended property viewer to display the given value.
-****************************************************************************/
-static void extviewer_refresh_widgets(struct extviewer *ev,
-                                      struct propval *pv)
-{
-  struct objprop *op;
-  enum object_property_ids propid;
-  int id, turn_built;
-  bool present, all;
-  const char *name;
-  GdkPixbuf *pixbuf;
-  GtkListStore *store;
-  GtkTextBuffer *textbuf;
-  GtkTreeIter iter;
-  gchar *buf;
-
-  if (!ev) {
-    return;
-  }
-
-  op = extviewer_get_objprop(ev);
-  propid = objprop_get_id(op);
-
-  if (propval_equal(pv, ev->pv_cached)) {
-    return;
-  }
-  propval_free(ev->pv_cached);
-  ev->pv_cached = propval_copy(pv);
-  store = ev->store;
-  textbuf = ev->textbuf;
-
-
-  /* NB: Remember to have -1 as the last argument to
-   * gtk_list_store_set() and to use the correct column
-   * number when inserting data. :) */
-  switch (propid) {
-
-  case OPID_TILE_SPECIALS:
-    gtk_list_store_clear(store);
-    extra_type_by_cause_iterate(EC_SPECIAL, spe) {
-      id = spe->data.special_idx;
-      name = extra_name_translation(spe);
-      present = BV_ISSET(pv->data.v_bv_special, id);
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, present, 1, id, 2, name, -1);
-    } extra_type_by_cause_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_TILE_ROADS:
-    gtk_list_store_clear(store);
-    extra_type_by_cause_iterate(EC_ROAD, pextra) {
-      struct road_type *proad = extra_road_get(pextra);
-
-      id = road_number(proad);
-      name = extra_name_translation(pextra);
-      present = BV_ISSET(pv->data.v_bv_roads, id);
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, present, 1, id, 2, name, -1);
-    } extra_type_by_cause_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_TILE_BASES:
-    gtk_list_store_clear(store);
-    extra_type_by_cause_iterate(EC_BASE, pextra) {
-      struct base_type *pbase = extra_base_get(pextra);
-
-      id = base_number(pbase);
-      name = extra_name_translation(pextra);
-      present = BV_ISSET(pv->data.v_bv_bases, id);
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, present, 1, id, 2, name, -1);
-    } extra_type_by_cause_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_TILE_VISION:
-    gtk_list_store_clear(store);
-    player_slots_iterate(pslot) {
-      id = player_slot_index(pslot);
-      if (player_slot_is_used(pslot)) {
-        struct player *pplayer = player_slot_get_player(pslot);
-
-        name = player_name(pplayer);
-        pixbuf = get_flag(pplayer->nation);
-      } else {
-        name = "";
-        pixbuf = NULL;
-      }
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, id, 2, name, -1);
-      if (pixbuf) {
-        gtk_list_store_set(store, &iter, 1, pixbuf, -1);
-        g_object_unref(pixbuf);
-        pixbuf = NULL;
-      }
-      present = BV_ISSET(pv->data.v_tile_vision->tile_known, id);
-      gtk_list_store_set(store, &iter, 3, present, -1);
-      vision_layer_iterate(v) {
-        present = BV_ISSET(pv->data.v_tile_vision->tile_seen[v], id);
-        gtk_list_store_set(store, &iter, 4 + v, present, -1);
-      } vision_layer_iterate_end;
-    } player_slots_iterate_end;
-    break;
-
-  case OPID_STARTPOS_NATIONS:
-    gtk_list_store_clear(store);
-    gtk_list_store_append(store, &iter);
-    all = (0 == nation_hash_size(pv->data.v_nation_hash));
-    gtk_list_store_set(store, &iter, 0, all, 1, -1, 3,
-                       _("All nations"), -1);
-    nations_iterate(pnation) {
-      if (client_nation_is_in_current_set(pnation)
-          && is_nation_playable(pnation)) {
-        present = (!all && nation_hash_lookup(pv->data.v_nation_hash,
-                                              pnation, NULL));
-        id = nation_number(pnation);
-        pixbuf = get_flag(pnation);
-        name = nation_adjective_translation(pnation);
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set(store, &iter, 0, present, 1, id,
-                           2, pixbuf, 3, name, -1);
-        if (pixbuf) {
-          g_object_unref(pixbuf);
-        }
-      }
-    } nations_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_CITY_BUILDINGS:
-    gtk_list_store_clear(store);
-    improvement_iterate(pimprove) {
-      if (is_special_improvement(pimprove)) {
-        continue;
-      }
-      id = improvement_index(pimprove);
-      name = improvement_name_translation(pimprove);
-      turn_built = pv->data.v_built[id].turn;
-      present = turn_built >= 0;
-      buf = built_status_to_string(&pv->data.v_built[id]);
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, present, 1, id, 2, name,
-                         3, buf, -1);
-      g_free(buf);
-    } improvement_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_PLAYER_NATION:
-    {
-      enum barbarian_type barbarian_type
-        = nation_barbarian_type(pv->data.v_nation);
-
-      gtk_list_store_clear(store);
-      nations_iterate(pnation) {
-        if (client_nation_is_in_current_set(pnation)
-            && nation_barbarian_type(pnation) == barbarian_type
-            && (barbarian_type != NOT_A_BARBARIAN
-                || is_nation_playable(pnation))) {
-          present = (pnation == pv->data.v_nation);
-          id = nation_index(pnation);
-          pixbuf = get_flag(pnation);
-          name = nation_adjective_translation(pnation);
-          gtk_list_store_append(store, &iter);
-          gtk_list_store_set(store, &iter, 0, present, 1, id,
-                             2, pixbuf, 3, name, -1);
-          if (pixbuf) {
-            g_object_unref(pixbuf);
-          }
-        }
-      } nations_iterate_end;
-      gtk_label_set_text(GTK_LABEL(ev->panel_label),
-                         nation_adjective_translation(pv->data.v_nation));
-      pixbuf = get_flag(pv->data.v_nation);
-      gtk_image_set_from_pixbuf(GTK_IMAGE(ev->panel_image), pixbuf);
-      if (pixbuf) {
-        g_object_unref(pixbuf);
-      }
-    }
-    break;
-
-  case OPID_PLAYER_GOV:
-    {
-      gtk_list_store_clear(store);
-      governments_iterate(pgov) {
-        present = (pgov == pv->data.v_gov);
-        id = government_index(pgov);
-        pixbuf = sprite_get_pixbuf(get_government_sprite(tileset, pgov));
-        name = government_name_translation(pgov);
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set(store, &iter, 0, present, 1, id,
-                           2, pixbuf, 3, name, -1);
-        if (pixbuf) {
-          g_object_unref(pixbuf);
-        }
-      } governments_iterate_end;
-      if (pv->data.v_gov != NULL) {
-        gtk_label_set_text(GTK_LABEL(ev->panel_label),
-                           government_name_translation(pv->data.v_gov));
-        pixbuf = sprite_get_pixbuf(get_government_sprite(tileset, pv->data.v_gov));
-      } else {
-        gtk_label_set_text(GTK_LABEL(ev->panel_label), "?");
-        pixbuf = sprite_get_pixbuf(get_government_sprite(tileset,
-                                                         game.government_during_revolution));
-      }
-
-      gtk_image_set_from_pixbuf(GTK_IMAGE(ev->panel_image), pixbuf);
-      if (pixbuf) {
-        g_object_unref(pixbuf);
-      }
-    }
-    break;
-
-  case OPID_PLAYER_INVENTIONS:
-    gtk_list_store_clear(store);
-    advance_iterate(padvance) {
-      id = advance_index(padvance);
-      present = BV_ISSET(pv->data.v_bv_inventions, id);
-      name = advance_name_translation(padvance);
-      gtk_list_store_append(store, &iter);
-      gtk_list_store_set(store, &iter, 0, present, 1, id, 2, name, -1);
-    } advance_iterate_end;
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    disable_gobject_callback(G_OBJECT(ev->textbuf),
-                             G_CALLBACK(extviewer_textbuf_changed));
-    {
-      GtkTextIter start, end;
-      char *oldtext;
-
-      /* Don't re-set content if unchanged, to avoid moving cursor */
-      gtk_text_buffer_get_bounds(textbuf, &start, &end);
-      oldtext = gtk_text_buffer_get_text(textbuf, &start, &end, TRUE);
-      if (strcmp(oldtext, pv->data.v_const_string) != 0) {
-        gtk_text_buffer_set_text(textbuf, pv->data.v_const_string, -1);
-      }
-    }
-    enable_gobject_callback(G_OBJECT(ev->textbuf),
-                            G_CALLBACK(extviewer_textbuf_changed));
-    gtk_widget_set_sensitive(ev->view_widget, TRUE);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  default:
-    log_error("Unhandled request to refresh widgets "
-              "extviewer_refresh_widgets() for objprop id=%d "
-              "name \"%s\".", propid, objprop_get_name(op));
-    break;
-  }
-}
-
-/************************************************************************//**
-  Clear the display widgets.
-****************************************************************************/
-static void extviewer_clear_widgets(struct extviewer *ev)
-{
-  struct objprop *op;
-  enum object_property_ids propid;
-
-  if (!ev) {
-    return;
-  }
-
-  op = extviewer_get_objprop(ev);
-  propid = objprop_get_id(op);
-
-  propval_free(ev->pv_cached);
-  ev->pv_cached = NULL;
-
-  if (ev->panel_label != NULL) {
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), NULL);
-  }
-
-  switch (propid) {
-  case OPID_TILE_SPECIALS:
-  case OPID_TILE_ROADS:
-  case OPID_TILE_BASES:
-  case OPID_TILE_VISION:
-  case OPID_STARTPOS_NATIONS:
-  case OPID_CITY_BUILDINGS:
-  case OPID_PLAYER_INVENTIONS:
-    gtk_list_store_clear(ev->store);
-    break;
-  case OPID_PLAYER_NATION:
-  case OPID_PLAYER_GOV:
-    gtk_list_store_clear(ev->store);
-    gtk_image_set_from_pixbuf(GTK_IMAGE(ev->panel_image), NULL);
-    break;
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    disable_gobject_callback(G_OBJECT(ev->textbuf),
-                             G_CALLBACK(extviewer_textbuf_changed));
-    gtk_text_buffer_set_text(ev->textbuf, "", -1);
-    enable_gobject_callback(G_OBJECT(ev->textbuf),
-                            G_CALLBACK(extviewer_textbuf_changed));
-    gtk_widget_set_sensitive(ev->view_widget, FALSE);
-    break;
-  default:
-    log_error("Unhandled request to clear widgets "
-              "in extviewer_clear_widgets() for objprop id=%d "
-              "name \"%s\".", propid, objprop_get_name(op));
-    break;
-  }
-}
-
-/************************************************************************//**
-  Handle the extviewer's panel button click. This should set the property
-  page to display the view widget for this complex property.
-****************************************************************************/
-static void extviewer_panel_button_clicked(GtkButton *button,
-                                           gpointer userdata)
-{
-  struct extviewer *ev;
-  struct property_page *pp;
-  struct objprop *op;
-
-  ev = userdata;
-  if (!ev) {
-    return;
-  }
-
-  op = extviewer_get_objprop(ev);
-  pp = objprop_get_property_page(op);
-  property_page_show_extviewer(pp, ev);
-}
-
-/************************************************************************//**
-  Handle toggling of a boolean cell value in the extviewer's tree view.
-****************************************************************************/
-static void extviewer_view_cell_toggled(GtkCellRendererToggle *cell,
-                                        gchar *path,
-                                        gpointer userdata)
-{
-  struct extviewer *ev;
-  struct objprop *op;
-  struct property_page *pp;
-  enum object_property_ids propid;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  int id, old_id, turn_built;
-  struct propval *pv;
-  bool active, present;
-  gchar *buf;
-  GdkPixbuf *pixbuf = NULL;
-
-  ev = userdata;
-  if (!ev) {
-    return;
-  }
-
-  pv = ev->pv_cached;
-  if (!pv) {
-    return;
-  }
-
-  op = extviewer_get_objprop(ev);
-  propid = objprop_get_id(op);
-  active = gtk_cell_renderer_toggle_get_active(cell);
-  pp = objprop_get_property_page(op);
-
-  model = GTK_TREE_MODEL(ev->store);
-  if (!gtk_tree_model_get_iter_from_string(model, &iter, path)) {
-    return;
-  }
-  present = !active;
-
-
-  switch (propid) {
-
-  case OPID_TILE_SPECIALS:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (id < 0 || id >= extra_type_list_size(extra_type_list_by_cause(EC_SPECIAL))) {
-      return;
-    }
-    if (present) {
-      BV_SET(pv->data.v_bv_special, id);
-    } else {
-      BV_CLR(pv->data.v_bv_special, id);
-    }
-    gtk_list_store_set(ev->store, &iter, 0, present, -1);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_TILE_ROADS:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(0 <= id && id < road_count())) {
-      return;
-    }
-    if (present) {
-      BV_SET(pv->data.v_bv_roads, id);
-    } else {
-      BV_CLR(pv->data.v_bv_roads, id);
-    }
-    gtk_list_store_set(ev->store, &iter, 0, present, -1);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_TILE_BASES:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(0 <= id && id < base_count())) {
-      return;
-    }
-    if (present) {
-      BV_SET(pv->data.v_bv_bases, id);
-    } else {
-      BV_CLR(pv->data.v_bv_bases, id);
-    }
-    gtk_list_store_set(ev->store, &iter, 0, present, -1);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_STARTPOS_NATIONS:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (-1 > id && id >= nation_count()) {
-      return;
-    }
-
-    if (-1 == id) {
-      gtk_list_store_set(ev->store, &iter, 0, present, -1);
-      gtk_tree_model_get_iter_first(model, &iter);
-      if (present) {
-        while (gtk_tree_model_iter_next(model, &iter)) {
-          gtk_list_store_set(ev->store, &iter, 0, FALSE, -1);
-        }
-        nation_hash_clear(pv->data.v_nation_hash);
-      } else {
-        const struct nation_type *pnation;
-        int id2;
-
-        gtk_tree_model_iter_next(model, &iter);
-        gtk_tree_model_get(model, &iter, 0, &id2, -1);
-        gtk_list_store_set(ev->store, &iter, 0, TRUE, -1);
-        pnation = nation_by_number(id2);
-        nation_hash_insert(pv->data.v_nation_hash, pnation, NULL);
-      }
-    } else {
-      const struct nation_type *pnation;
-      bool all;
-
-      gtk_list_store_set(ev->store, &iter, 0, present, -1);
-      pnation = nation_by_number(id);
-      if (present) {
-        nation_hash_insert(pv->data.v_nation_hash, pnation, NULL);
-      } else {
-        nation_hash_remove(pv->data.v_nation_hash, pnation);
-      }
-      gtk_tree_model_get_iter_first(model, &iter);
-      all = (0 == nation_hash_size(pv->data.v_nation_hash));
-      gtk_list_store_set(ev->store, &iter, 0, all, -1);
-    }
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_CITY_BUILDINGS:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(0 <= id && id < B_LAST)) {
-      return;
-    }
-    turn_built = present ? game.info.turn : I_NEVER;
-    pv->data.v_built[id].turn = turn_built;
-    buf = built_status_to_string(&pv->data.v_built[id]);
-    gtk_list_store_set(ev->store, &iter, 0, present, 3, buf, -1);
-    g_free(buf);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  case OPID_PLAYER_NATION:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(0 <= id && id < nation_count()) || !present) {
-      return;
-    }
-    old_id = nation_index(pv->data.v_nation);
-    pv->data.v_nation = nation_by_number(id);
-    gtk_list_store_set(ev->store, &iter, 0, TRUE, -1);
-    gtk_tree_model_iter_nth_child(model, &iter, NULL, old_id);
-    gtk_list_store_set(ev->store, &iter, 0, FALSE, -1);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label),
-                       nation_adjective_translation(pv->data.v_nation));
-    pixbuf = get_flag(pv->data.v_nation);
-    gtk_image_set_from_pixbuf(GTK_IMAGE(ev->panel_image), pixbuf);
-    if (pixbuf) {
-      g_object_unref(pixbuf);
-    }
-    break;
-
-  case OPID_PLAYER_GOV:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(0 <= id && id < government_count()) || !present) {
-      return;
-    }
-    if (pv->data.v_gov != NULL) {
-      old_id = government_index(pv->data.v_gov);
-      pv->data.v_gov = government_by_number(id);
-      gtk_list_store_set(ev->store, &iter, 0, TRUE, -1);
-      gtk_tree_model_iter_nth_child(model, &iter, NULL, old_id);
-      gtk_list_store_set(ev->store, &iter, 0, FALSE, -1);
-    } else {
-      pv->data.v_gov = government_by_number(id);
-      gtk_list_store_set(ev->store, &iter, 0, TRUE, -1);
-    }
-
-    gtk_label_set_text(GTK_LABEL(ev->panel_label),
-                       government_name_translation(pv->data.v_gov));
-    pixbuf = sprite_get_pixbuf(get_government_sprite(tileset, pv->data.v_gov));
-    gtk_image_set_from_pixbuf(GTK_IMAGE(ev->panel_image), pixbuf);
-    if (pixbuf) {
-      g_object_unref(pixbuf);
-    }
-    break;
-
-  case OPID_PLAYER_INVENTIONS:
-    gtk_tree_model_get(model, &iter, 1, &id, -1);
-    if (!(A_FIRST <= id && id < advance_count())) {
-      return;
-    }
-    if (present) {
-      BV_SET(pv->data.v_bv_inventions, id);
-    } else {
-      BV_CLR(pv->data.v_bv_inventions, id);
-    }
-    gtk_list_store_set(ev->store, &iter, 0, present, -1);
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-
-  default:
-    log_error("Unhandled widget toggled signal in "
-              "extviewer_view_cell_toggled() for objprop id=%d "
-              "name \"%s\".", propid, objprop_get_name(op));
-    return;
-    break;
-  }
-
-  property_page_change_value(pp, op, pv);
-}
-
-/************************************************************************//**
-  Handle a change in the extviewer's text buffer.
-****************************************************************************/
-static void extviewer_textbuf_changed(GtkTextBuffer *textbuf,
-                                      gpointer userdata)
-{
-  struct extviewer *ev;
-  struct objprop *op;
-  struct property_page *pp;
-  enum object_property_ids propid;
-  struct propval value = {{0,}, VALTYPE_STRING, FALSE}, *pv;
-  GtkTextIter start, end;
-  char *text;
-  gchar *buf;
-
-  ev = userdata;
-  if (!ev) {
-    return;
-  }
-
-  op = extviewer_get_objprop(ev);
-  propid = objprop_get_id(op);
-  pp = objprop_get_property_page(op);
-
-  gtk_text_buffer_get_start_iter(textbuf, &start);
-  gtk_text_buffer_get_end_iter(textbuf, &end);
-  text = gtk_text_buffer_get_text(textbuf, &start, &end, FALSE);
-  value.data.v_const_string = text;
-  pv = &value;
-
-  switch (propid) {
-  case OPID_GAME_SCENARIO_AUTHORS:
-  case OPID_GAME_SCENARIO_DESC:
-    buf = propval_as_string(pv);
-    gtk_label_set_text(GTK_LABEL(ev->panel_label), buf);
-    g_free(buf);
-    break;
-  default:
-    log_error("Unhandled widget modified signal in "
-              "extviewer_textbuf_changed() for objprop id=%d "
-              "name \"%s\".", propid, objprop_get_name(op));
-    return;
-    break;
-  }
-
-  property_page_change_value(pp, op, pv);
-  g_free(text);
-}
-
-/************************************************************************//**
-  Install all object properties that this page type can view/edit.
-****************************************************************************/
-static void property_page_setup_objprops(struct property_page *pp)
-{
-#define ADDPROP(ARG_id, ARG_name, ARG_tooltip, ARG_flags, ARG_valtype) do { \
-  struct objprop *MY_op = objprop_new(ARG_id, ARG_name, ARG_tooltip, \
-                                      ARG_flags, ARG_valtype, pp); \
-  objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op); \
-} while (FALSE)
-
-  switch (property_page_get_objtype(pp)) {
-  case OBJTYPE_TILE:
-    ADDPROP(OPID_TILE_IMAGE, _("Image"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_PIXBUF);
-    ADDPROP(OPID_TILE_TERRAIN, _("Terrain"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_TILE_RESOURCE, _("Resource"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_TILE_INDEX, _("Index"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_TILE_X, Q_("?coordinate:X"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_TILE_Y, Q_("?coordinate:Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    /* TRANS: The coordinate X in native coordinates.
-     * The freeciv coordinate system is described in doc/HACKING. */
-    ADDPROP(OPID_TILE_NAT_X, _("NAT X"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    /* TRANS: The coordinate Y in native coordinates.
-     * The freeciv coordinate system is described in doc/HACKING. */
-    ADDPROP(OPID_TILE_NAT_Y, _("NAT Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_TILE_CONTINENT, _("Continent"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_TILE_XY, Q_("?coordinates:X,Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_TILE_SPECIALS, _("Specials"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_BV_SPECIAL);
-    ADDPROP(OPID_TILE_ROADS, _("Roads"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_BV_ROADS);
-    ADDPROP(OPID_TILE_BASES, _("Bases"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_BV_BASES);
-#ifdef FREECIV_DEBUG
-    ADDPROP(OPID_TILE_ADDRESS, _("Address"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_STRING);
-#endif /* FREECIV_DEBUG */
-#if 0
-    /* Disabled entirely for now as server is not sending other
-     * players' vision information anyway. */
-    ADDPROP(OPID_TILE_VISION, _("Vision"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_TILE_VISION_DATA);
-#endif
-    /* TRANS: Tile property "Label" label in editor */
-    ADDPROP(OPID_TILE_LABEL, Q_("?property:Label"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_STRING);
-    return;
-
-  case OBJTYPE_STARTPOS:
-    ADDPROP(OPID_STARTPOS_IMAGE, _("Image"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_PIXBUF);
-    ADDPROP(OPID_STARTPOS_XY, Q_("?coordinates:X,Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_STARTPOS_EXCLUDE, _("Exclude Nations"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_STARTPOS_NATIONS, _("Nations"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_NATION_HASH);
-    return;
-
-  case OBJTYPE_UNIT:
-    ADDPROP(OPID_UNIT_IMAGE, _("Image"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_PIXBUF);
-#ifdef FREECIV_DEBUG
-    ADDPROP(OPID_UNIT_ADDRESS, _("Address"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_STRING);
-#endif /* FREECIV_DEBUG */
-    ADDPROP(OPID_UNIT_TYPE, _("Type"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_UNIT_ID, _("ID"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_UNIT_XY, Q_("?coordinates:X,Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_UNIT_MOVES_LEFT, _("Moves Left"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_UNIT_FUEL, _("Fuel"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_UNIT_MOVED, _("Moved"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_UNIT_DONE_MOVING, _("Done Moving"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    /* TRANS: HP = Hit Points of a unit. */
-    ADDPROP(OPID_UNIT_HP, _("HP"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_UNIT_VETERAN, _("Veteran"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_UNIT_STAY, _("Stay put"), NULL,
-            OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    return;
-
-  case OBJTYPE_CITY:
-    ADDPROP(OPID_CITY_IMAGE, _("Image"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_PIXBUF);
-    ADDPROP(OPID_CITY_NAME, _("Name"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_STRING);
-#ifdef FREECIV_DEBUG
-    ADDPROP(OPID_CITY_ADDRESS, _("Address"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_STRING);
-#endif /* FREECIV_DEBUG */
-    ADDPROP(OPID_CITY_ID, _("ID"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_CITY_XY, Q_("?coordinates:X,Y"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET, VALTYPE_STRING);
-    ADDPROP(OPID_CITY_SIZE, _("Size"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_CITY_HISTORY, _("History"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_CITY_BUILDINGS, _("Buildings"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_BUILT_ARRAY);
-    ADDPROP(OPID_CITY_FOOD_STOCK, _("Food Stock"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_CITY_SHIELD_STOCK, _("Shield Stock"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    return;
-
-  case OBJTYPE_PLAYER:
-    ADDPROP(OPID_PLAYER_NAME, _("Name"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_STRING);
-#ifdef FREECIV_DEBUG
-    ADDPROP(OPID_PLAYER_ADDRESS, _("Address"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_STRING);
-#endif /* FREECIV_DEBUG */
-    ADDPROP(OPID_PLAYER_NATION, _("Nation"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_NATION);
-    ADDPROP(OPID_PLAYER_GOV, _("Government"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_GOV);
-    ADDPROP(OPID_PLAYER_AGE, _("Age"), NULL,
-            OPF_HAS_WIDGET, VALTYPE_INT);
-    ADDPROP(OPID_PLAYER_INVENTIONS, _("Inventions"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_INVENTIONS_ARRAY);
-    ADDPROP(OPID_PLAYER_SCENARIO_RESERVED, _("Reserved"), NULL,
-            OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_PLAYER_SELECT_WEIGHT, _("Select Weight"),
-            _("How likely user is to get this player by autoselect. '-1' for default behavior."),
-            OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_INT);
-    ADDPROP(OPID_PLAYER_SCIENCE, _("Science"), NULL,
-            OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_INT);
-    ADDPROP(OPID_PLAYER_GOLD, _("Gold"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_INT);
-    ADDPROP(OPID_PLAYER_INFRAPOINTS, _("Infrapoints"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_INT);
-    return;
-
-  case OBJTYPE_GAME:
-    ADDPROP(OPID_GAME_SCENARIO, _("Scenario"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_SCENARIO_NAME,
-            _("Scenario Name"),  NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_STRING);
-    ADDPROP(OPID_GAME_SCENARIO_AUTHORS,
-            _("Scenario Authors"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_STRING);
-    ADDPROP(OPID_GAME_SCENARIO_DESC,
-            _("Scenario Description"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE,
-            VALTYPE_STRING);
-    ADDPROP(OPID_GAME_SCENARIO_RANDSTATE,
-            _("Save Random Number State"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_SCENARIO_PLAYERS,
-            _("Save Players"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_STARTPOS_NATIONS,
-            _("Nation Start Positions"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_PREVENT_CITIES,
-            _("Prevent New Cities"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_LAKE_FLOODING,
-            _("Saltwater Flooding Lakes"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    ADDPROP(OPID_GAME_RULESET_LOCKED,
-            _("Lock to current Ruleset"), NULL,
-            OPF_IN_LISTVIEW | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BOOL);
-    return;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled page object type %s (nb %d).", __FUNCTION__,
-            objtype_get_name(property_page_get_objtype(pp)),
-            property_page_get_objtype(pp));
-#undef ADDPROP
-}
-
-/************************************************************************//**
-  Callback for when a property page's listview's selection changes.
-****************************************************************************/
-static void property_page_selection_changed(GtkTreeSelection *sel,
-                                            gpointer userdata)
-{
-  struct property_page *pp;
-  struct objbind *ob = NULL;
-
-  pp = userdata;
-  if (!pp) {
-    return;
-  }
-
-  if (gtk_tree_selection_count_selected_rows(sel) < 1) {
-    property_page_set_focused_objbind(pp, NULL);
-  }
-
-  ob = property_page_get_focused_objbind(pp);
-  property_page_objprop_iterate(pp, op) {
-    objprop_refresh_widget(op, ob);
-  } property_page_objprop_iterate_end;
-}
-
-/************************************************************************//**
-  Monitor which rows are to be selected, so we know which objbind to display
-  in the properties panel.
-****************************************************************************/
-static gboolean property_page_selection_func(GtkTreeSelection *sel,
-                                             GtkTreeModel *model,
-                                             GtkTreePath *sel_path,
-                                             gboolean currently_selected,
-                                             gpointer data)
-{
-  struct property_page *pp;
-  struct objbind *ob = NULL, *old_ob;
-  GtkTreeIter iter;
-
-  pp = data;
-  if (!pp || !sel_path) {
-    return TRUE;
-  }
-
-  if (!gtk_tree_model_get_iter(model, &iter, sel_path)) {
-    return TRUE;
-  }
-
-  old_ob = property_page_get_focused_objbind(pp);
-  gtk_tree_model_get(model, &iter, 0, &ob, -1);
-  if (currently_selected) {
-    if (ob == old_ob) {
-      GList *rows, *p;
-      GtkTreePath *path;
-      struct objbind *new_ob = NULL;
-
-      rows = gtk_tree_selection_get_selected_rows(sel, NULL);
-      for (p = rows; p != NULL; p = p->next) {
-        path = p->data;
-        if (gtk_tree_model_get_iter(model, &iter, path)) {
-          struct objbind *test_ob = NULL;
-          gtk_tree_model_get(model, &iter, 0, &test_ob, -1);
-          if (test_ob == ob) {
-            continue;
-          }
-          new_ob = test_ob;
-          break;
-        }
-      }
-      g_list_foreach(rows, (GFunc) gtk_tree_path_free, NULL);
-      g_list_free(rows);
-
-      property_page_set_focused_objbind(pp, new_ob);
-    }
-  } else {
-    property_page_set_focused_objbind(pp, ob);
-  }
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Callback to handle text changing in the quick find entry widget.
-****************************************************************************/
-static void property_page_quick_find_entry_changed(GtkWidget *entry,
-                                                   gpointer userdata)
-{
-  struct property_page *pp;
-  const gchar *text;
-  GtkWidget *w;
-  GtkTreeViewColumn *col;
-  struct property_filter *pf;
-  bool matched;
-
-  pp = userdata;
-  text = gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(entry)));
-  pf = property_filter_new(text);
-
-  property_page_objprop_iterate(pp, op) {
-    if (!objprop_has_widget(op)
-        && !objprop_show_in_listview(op)) {
-      continue;
-    }
-    matched = property_filter_match(pf, op);
-    w = objprop_get_widget(op);
-    if (objprop_has_widget(op) && w != nullptr) {
-      gtk_widget_set_visible(w, matched);
-    }
-    col = objprop_get_treeview_column(op);
-    if (objprop_show_in_listview(op) && col != nullptr) {
-      gtk_tree_view_column_set_visible(col, matched);
-    }
-  } property_page_objprop_iterate_end;
-
-  property_filter_free(pf);
-}
-
-/************************************************************************//**
-  Create and return a property page of the given object type.
-  Returns NULL if the page could not be created.
-****************************************************************************/
-static struct property_page *
-property_page_new(enum editor_object_type objtype,
-                  struct property_editor *pe)
-{
-  struct property_page *pp;
-  GtkWidget *vgrid, *vgrid2, *hgrid, *hgrid2, *paned, *frame, *w;
-  GtkWidget *scrollwin, *view, *label, *entry, *notebook;
-  GtkWidget *button, *hsep;
-  GtkTreeSelection *sel;
-  GtkCellRenderer *cell;
-  GtkTreeViewColumn *col;
-  GtkSizeGroup *sizegroup;
-  int num_columns = 0;
-  GType *gtype_array;
-  int col_id = 1;
-  const char *attr_type_str, *name, *tooltip;
-  gchar *title;
-  int grid_row = 0;
-  int grid2_row = 0;
-  int grid_col = 0;
-  int grid2_col = 0;
-
-  if (!(objtype < NUM_OBJTYPES)) {
-    return NULL;
-  }
-
-  pp = fc_calloc(1, sizeof(struct property_page));
-  pp->objtype = objtype;
-  pp->pe_parent = pe;
-
-  sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-
-  pp->objprop_table = objprop_hash_new();
-  property_page_setup_objprops(pp);
-
-  pp->objbind_table = objbind_hash_new();
-
-  pp->tag_table = stored_tag_hash_new();
-
-  property_page_objprop_iterate(pp, op) {
-    if (objprop_show_in_listview(op)) {
-      num_columns++;
-    }
-  } property_page_objprop_iterate_end;
-
-  /* Column zero in the store holds an objbind
-   * pointer and is never displayed. */
-  num_columns++;
-  gtype_array = fc_malloc(num_columns * sizeof(GType));
-  gtype_array[0] = G_TYPE_POINTER;
-
-  property_page_objprop_iterate(pp, op) {
-    if (objprop_show_in_listview(op)) {
-      gtype_array[col_id] = objprop_get_gtype(op);
-      objprop_set_column_id(op, col_id);
-      col_id++;
-    }
-  } property_page_objprop_iterate_end;
-
-  pp->object_store = gtk_list_store_newv(num_columns, gtype_array);
-  free(gtype_array);
-
-  paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_paned_set_position(GTK_PANED(paned), 256);
-  pp->widget = paned;
-
-  /* Left side object list view. */
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 4);
-  gtk_widget_set_margin_start(vgrid, 4);
-  gtk_widget_set_margin_end(vgrid, 4);
-  gtk_widget_set_margin_top(vgrid, 4);
-  gtk_widget_set_margin_bottom(vgrid, 4);
-  gtk_paned_set_start_child(GTK_PANED(paned), vgrid);
-
-  scrollwin = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
-                                    TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_grid_attach(GTK_GRID(vgrid), scrollwin, 0, grid_row++, 1, 1);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pp->object_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-
-  property_page_objprop_iterate(pp, op) {
-    if (!objprop_show_in_listview(op)) {
-      continue;
-    }
-
-    attr_type_str = objprop_get_attribute_type_string(op);
-    if (!attr_type_str) {
-      continue;
-    }
-    col_id = objprop_get_column_id(op);
-    if (col_id < 0) {
-      continue;
-    }
-    name = objprop_get_name(op);
-    if (!name) {
-      continue;
-    }
-    cell = objprop_create_cell_renderer(op);
-    if (!cell) {
-      continue;
-    }
-
-    col = gtk_tree_view_column_new_with_attributes(name, cell,
-                                                   attr_type_str, col_id,
-                                                   NULL);
-
-    gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
-    gtk_tree_view_column_set_resizable(col, TRUE);
-    gtk_tree_view_column_set_reorderable(col, TRUE);
-    if (objprop_is_sortable(op)) {
-      gtk_tree_view_column_set_clickable(col, TRUE);
-      gtk_tree_view_column_set_sort_column_id(col, col_id);
-    } else {
-      gtk_tree_view_column_set_clickable(col, FALSE);
-    }
-    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-    objprop_set_treeview_column(op, col);
-
-  } property_page_objprop_iterate_end;
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
-  g_signal_connect(sel, "changed",
-                   G_CALLBACK(property_page_selection_changed), pp);
-  gtk_tree_selection_set_select_function(sel,
-      property_page_selection_func, pp, NULL);
-
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin), view);
-  pp->object_view = view;
-
-  if (!objtype_is_conserved(objtype)) {
-    hgrid = gtk_grid_new();
-    gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-    gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
-
-    button = gtk_button_new();
-    gtk_button_set_icon_name(GTK_BUTTON(button), "list-add");
-    gtk_button_set_label(GTK_BUTTON(button), _("Create"));
-    gtk_size_group_add_widget(sizegroup, button);
-    gtk_widget_set_tooltip_text(button,
-        _("Pressing this button will create a new object of the "
-          "same type as the current property page and add it to "
-          "the page. The specific type and count of the objects "
-          "is taken from the editor tool state. So for example, "
-          "the \"tool value\" of the unit tool and its \"count\" "
-          "parameter affect unit creation."));
-    g_signal_connect(button, "clicked",
-                     G_CALLBACK(property_page_create_button_clicked), pp);
-    gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-
-    button = gtk_button_new();
-    gtk_button_set_icon_name(GTK_BUTTON(button), "list-remove");
-    gtk_button_set_label(GTK_BUTTON(button), _("Destroy"));
-    gtk_size_group_add_widget(sizegroup, button);
-    gtk_widget_set_tooltip_text(button,
-        _("Pressing this button will send a request to the server "
-          "to destroy (i.e. erase) the objects selected in the object "
-          "list."));
-    g_signal_connect(button, "clicked",
-                     G_CALLBACK(property_page_destroy_button_clicked), pp);
-    gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  }
-
-  /* Right side properties panel. */
-
-  hgrid = gtk_grid_new();
-  grid_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-  gtk_paned_set_end_child(GTK_PANED(paned), hgrid);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 4);
-  gtk_widget_set_margin_start(vgrid, 4);
-  gtk_widget_set_margin_end(vgrid, 4);
-  gtk_widget_set_margin_top(vgrid, 4);
-  gtk_widget_set_margin_bottom(vgrid, 4);
-  gtk_grid_attach(GTK_GRID(hgrid), vgrid, grid_col++, 0, 1, 1);
-
-  /* Extended property viewer to the right of the properties panel.
-   * This needs to be created before property widgets, since some
-   * might try to append themselves to this notebook. */
-
-  vgrid2 = gtk_grid_new();
-  gtk_widget_set_hexpand(vgrid2, TRUE);
-  gtk_widget_set_vexpand(vgrid, TRUE);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
-  gtk_grid_attach(GTK_GRID(hgrid), vgrid2, grid_col++, 0, 1, 1);
-
-  notebook = gtk_notebook_new();
-  gtk_widget_set_vexpand(notebook, TRUE);
-  gtk_widget_set_size_request(notebook, 256, -1);
-  gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
-  gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
-  gtk_grid_attach(GTK_GRID(vgrid2), notebook, 0, grid2_row++, 1, 1);
-  pp->extviewer_notebook = notebook;
-
-  hsep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_grid_attach(GTK_GRID(vgrid2), hsep, 0, grid2_row++, 1, 1);
-
-  hgrid2 = gtk_grid_new();
-  gtk_widget_set_margin_start(hgrid2, 4);
-  gtk_widget_set_margin_end(hgrid2, 4);
-  gtk_widget_set_margin_top(hgrid2, 4);
-  gtk_widget_set_margin_bottom(hgrid2, 4);
-  gtk_grid_attach(GTK_GRID(vgrid2), hgrid2, 0, grid2_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Close"));
-  gtk_size_group_add_widget(sizegroup, button);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(gtk_window_close), pe->widget);
-  gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
-
-  /* Now create the properties panel. */
-
-  /* TRANS: %s is a type of object that can be edited, such as "Tile",
-   * "Unit", "Start Position", etc. */
-  title = g_strdup_printf(_("%s Properties"),
-                          objtype_get_name(objtype));
-  frame = gtk_frame_new(title);
-  g_free(title);
-  gtk_widget_set_size_request(frame, 256, -1);
-  gtk_grid_attach(GTK_GRID(vgrid), frame, 0, grid_row++, 1, 1);
-
-  scrollwin = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
-                                    FALSE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_frame_set_child(GTK_FRAME(frame), scrollwin);
-
-  vgrid2 = gtk_grid_new();
-  grid2_row = 0;
-  gtk_widget_set_vexpand(vgrid2, TRUE);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
-  gtk_widget_set_margin_start(vgrid2, 4);
-  gtk_widget_set_margin_end(vgrid2, 4);
-  gtk_widget_set_margin_top(vgrid2, 4);
-  gtk_widget_set_margin_bottom(vgrid2, 4);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin), vgrid2);
-
-  property_page_objprop_iterate(pp, op) {
-    if (!objprop_has_widget(op)) {
-      continue;
-    }
-    w = objprop_get_widget(op);
-    if (!w) {
-      continue;
-    }
-    gtk_grid_attach(GTK_GRID(vgrid2), w, 0, grid2_row++, 1, 1);
-    tooltip = objprop_get_tooltip(op);
-    if (NULL != tooltip) {
-      gtk_widget_set_tooltip_text(w, tooltip);
-    }
-  } property_page_objprop_iterate_end;
-
-  hgrid2 = gtk_grid_new();
-  grid2_col = 0;
-  gtk_widget_set_margin_top(hgrid2, 4);
-  gtk_widget_set_margin_bottom(hgrid2, 4);
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid2), 4);
-  gtk_grid_attach(GTK_GRID(vgrid), hgrid2, 0, grid_row++, 1, 1);
-
-  label = gtk_label_new(_("Filter:"));
-  gtk_grid_attach(GTK_GRID(hgrid2), label, grid2_col++, 0, 1, 1);
-
-  entry = gtk_entry_new();
-  gtk_widget_set_tooltip_text(entry,
-      _("Enter a filter string to limit which properties are shown. "
-        "The filter is one or more text patterns separated by | "
-        "(\"or\") or & (\"and\"). The symbol & has higher precedence "
-        "than |. A pattern may also be negated by prefixing it with !."));
-  g_signal_connect(entry, "changed",
-      G_CALLBACK(property_page_quick_find_entry_changed), pp);
-  gtk_grid_attach(GTK_GRID(hgrid2), entry, grid2_col++, 0, 1, 1);
-
-  hgrid2 = gtk_grid_new();
-  grid2_col = 0;
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid2), 4);
-  gtk_grid_attach(GTK_GRID(vgrid), hgrid2, 0, grid_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Refresh"));
-  gtk_size_group_add_widget(sizegroup, button);
-  gtk_widget_set_tooltip_text(button,
-      _("Pressing this button will reset all modified properties of "
-        "the selected objects to their current values (the values "
-        "they have on the server)."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(property_page_refresh_button_clicked), pp);
-  gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Apply"));
-  gtk_size_group_add_widget(sizegroup, button);
-  gtk_widget_set_tooltip_text(button,
-      _("Pressing this button will send all modified properties of "
-        "the objects selected in the object list to the server. "
-        "Modified properties' names are shown in red in the properties "
-        "panel."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(property_page_apply_button_clicked), pp);
-  gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
-
-  return pp;
-}
-
-/************************************************************************//**
-  Returns the translated name of the property page's object type.
-****************************************************************************/
-static const char *property_page_get_name(const struct property_page *pp)
-{
-  if (!pp) {
-    return "";
-  }
-  return objtype_get_name(property_page_get_objtype(pp));
-}
-
-/************************************************************************//**
-  Returns the object type for this property page, or -1 if none.
-****************************************************************************/
-static enum editor_object_type
-property_page_get_objtype(const struct property_page *pp)
-{
-  if (!pp) {
-    return -1;
-  }
-  return pp->objtype;
-}
-
-/************************************************************************//**
-  Create a pixbuf containing an image of the given tile. The image will
-  only be of the layers containing terrains, resources and specials.
-
-  May return NULL on error or bad input.
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-static GdkPixbuf *create_tile_pixbuf(const struct tile *ptile)
-{
-  return create_pixbuf_from_layers(ptile, NULL, NULL, LAYER_CATEGORY_TILE);
-}
-
-/************************************************************************//**
-  Create a pixbuf containing an image of the given unit.
-
-  May return NULL on error or bad input.
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-static GdkPixbuf *create_unit_pixbuf(const struct unit *punit)
-{
-  return create_pixbuf_from_layers(NULL, punit, NULL, LAYER_CATEGORY_UNIT);
-}
-
-/************************************************************************//**
-  Create a pixbuf containing an image of the given city.
-
-  May return NULL on error or bad input.
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-static GdkPixbuf *create_city_pixbuf(const struct city *pcity)
-{
-  return create_pixbuf_from_layers(city_tile(pcity), NULL, pcity,
-                                   LAYER_CATEGORY_CITY);
-}
-
-/************************************************************************//**
-  Create a pixbuf containing an image of the given tile, unit or city
-  restricted to the layer category 'cat'.
-
-  May return NULL on error or bad input.
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-static GdkPixbuf *create_pixbuf_from_layers(const struct tile *ptile,
-                                            const struct unit *punit,
-                                            const struct city *pcity,
-                                            enum layer_category category)
-{
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  int h, fh, fw, canvas_x, canvas_y;
-  GdkPixbuf *pixbuf;
-  cairo_t *cr;
-
-  fw = tileset_full_tile_width(tileset);
-  fh = tileset_full_tile_height(tileset);
-  h = tileset_tile_height(tileset);
-
-  canvas.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, fw, fh);
-
-  cr = cairo_create(canvas.surface);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  canvas_x = 0;
-  canvas_y = 0;
-
-  canvas_y += (fh - h);
-
-  mapview_layer_iterate(layer) {
-    if (tileset_layer_in_category(layer, category)) {
-      put_one_element(&canvas, 1.0, layer,
-                      ptile, NULL, NULL, punit, pcity,
-                      canvas_x, canvas_y, NULL, NULL);
-    }
-  } mapview_layer_iterate_end
-  pixbuf = surface_get_pixbuf(canvas.surface, fw, fh);
-  cairo_surface_destroy(canvas.surface);
-
-  return pixbuf;
-}
-
-/************************************************************************//**
-  Remove all object binds (i.e. objects listed) in the property page.
-****************************************************************************/
-static void property_page_clear_objbinds(struct property_page *pp)
-{
-  if (!pp) {
-    return;
-  }
-
-  gtk_list_store_clear(pp->object_store);
-  objbind_hash_clear(pp->objbind_table);
-  property_page_set_focused_objbind(pp, NULL);
-}
-
-/************************************************************************//**
-  Create a new object bind to the given object and register it with the
-  given property page.
-****************************************************************************/
-static void property_page_add_objbind(struct property_page *pp,
-                                      gpointer object_data)
-{
-  struct objbind *ob;
-  enum editor_object_type objtype;
-  int id;
-
-  if (!pp) {
-    return;
-  }
-
-  objtype = property_page_get_objtype(pp);
-  id = objtype_get_id_from_object(objtype, object_data);
-  if (id < 0) {
-    return;
-  }
-
-  if (objbind_hash_lookup(pp->objbind_table, id, NULL)) {
-    /* Object already exists. */
-    return;
-  }
-
-  ob = objbind_new(objtype, object_data);
-  if (!ob) {
-    return;
-  }
-
-  objbind_bind_properties(ob, pp);
-
-  objbind_hash_insert(pp->objbind_table, ob->object_id, ob);
-}
-
-/************************************************************************//**
-  Create zero or more object binds from the objects on the given tile to
-  the properties contained in the given property page.
-****************************************************************************/
-static void property_page_add_objbinds_from_tile(struct property_page *pp,
-                                                 const struct tile *ptile)
-{
-
-  if (!pp || !ptile) {
-    return;
-  }
-
-  switch (property_page_get_objtype(pp)) {
-  case OBJTYPE_TILE:
-    property_page_add_objbind(pp, (gpointer) ptile);
-    return;
-
-  case OBJTYPE_STARTPOS:
-    {
-      struct startpos *psp = map_startpos_get(ptile);
-
-      if (NULL != psp) {
-        property_page_add_objbind(pp, map_startpos_get(ptile));
-      }
-    }
-    return;
-
-  case OBJTYPE_UNIT:
-    unit_list_iterate(ptile->units, punit) {
-      property_page_add_objbind(pp, punit);
-    } unit_list_iterate_end;
-    return;
-
-  case OBJTYPE_CITY:
-    if (tile_city(ptile)) {
-      property_page_add_objbind(pp, tile_city(ptile));
-    }
-    return;
-
-  case OBJTYPE_PLAYER:
-  case OBJTYPE_GAME:
-    return;
-
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled page object type %s (nb %d).", __FUNCTION__,
-            objtype_get_name(property_page_get_objtype(pp)),
-            property_page_get_objtype(pp));
-}
-
-/************************************************************************//**
-  Set the column value in the list store of the property page.
-  Returns TRUE if data was enetered into the store.
-
-  NB: This must match the conversion in objprop_get_gtype.
-****************************************************************************/
-static bool property_page_set_store_value(struct property_page *pp,
-                                          struct objprop *op,
-                                          struct objbind *ob,
-                                          GtkTreeIter *iter)
-{
-  int col_id;
-  struct propval *pv;
-  enum value_types valtype;
-  char buf[128], *p;
-  GdkPixbuf *pixbuf = NULL;
-  GtkListStore *store;
-  gchar *buf2;
-
-  if (!pp || !pp->object_store || !op || !ob) {
-    return FALSE;
-  }
-
-  if (!objprop_show_in_listview(op)) {
-    return FALSE;
-  }
-
-  col_id = objprop_get_column_id(op);
-  if (col_id < 0) {
-    return FALSE;
-  }
-
-  pv = objbind_get_value_from_object(ob, op);
-  if (!pv) {
-    return FALSE;
-  }
-
-  valtype = objprop_get_valtype(op);
-  store = pp->object_store;
-
-  switch (valtype) {
-  case VALTYPE_NONE:
-    break;
-  case VALTYPE_INT:
-    gtk_list_store_set(store, iter, col_id, pv->data.v_int, -1);
-    break;
-  case VALTYPE_BOOL:
-    /* Set as translated string, not as untranslated G_TYPE_BOOLEAN */
-    gtk_list_store_set(store, iter, col_id, propval_as_string(pv), -1);
-    break;
-  case VALTYPE_STRING:
-    if (fc_strlcpy(buf, pv->data.v_string, 28) >= 28) {
-      sz_strlcat(buf, "...");
-    }
-    for (p = buf; *p; p++) {
-      if (*p == '\n' || *p == '\t' || *p == '\r') {
-        *p = ' ';
-      }
-    }
-    gtk_list_store_set(store, iter, col_id, buf, -1);
-    break;
-  case VALTYPE_PIXBUF:
-    gtk_list_store_set(store, iter, col_id, pv->data.v_pixbuf, -1);
-    break;
-  case VALTYPE_BUILT_ARRAY:
-  case VALTYPE_INVENTIONS_ARRAY:
-  case VALTYPE_BV_SPECIAL:
-  case VALTYPE_BV_ROADS:
-  case VALTYPE_BV_BASES:
-  case VALTYPE_NATION_HASH:
-    buf2 = propval_as_string(pv);
-    gtk_list_store_set(store, iter, col_id, buf2, -1);
-    g_free(buf2);
-    break;
-  case VALTYPE_NATION:
-    pixbuf = get_flag(pv->data.v_nation);
-    gtk_list_store_set(store, iter, col_id, pixbuf, -1);
-    if (pixbuf) {
-      g_object_unref(pixbuf);
-    }
-    break;
-  case VALTYPE_GOV:
-    if (pv->data.v_gov != NULL) {
-      pixbuf = sprite_get_pixbuf(get_government_sprite(tileset, pv->data.v_gov));
-    } else {
-      pixbuf = sprite_get_pixbuf(get_government_sprite(tileset,
-                                                       game.government_during_revolution));
-    }
-    gtk_list_store_set(store, iter, col_id, pixbuf, -1);
-    if (pixbuf) {
-      g_object_unref(pixbuf);
-    }
-    break;
-  case VALTYPE_TILE_VISION_DATA:
-    break;
-  }
-
-  propval_free(pv);
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Inserts any objbinds owned by this proprety page into the page's list
-  store if they are not there already and refreshes all property widgets.
-****************************************************************************/
-static void property_page_fill_widgets(struct property_page *pp)
-{
-  struct objbind *focused;
-
-  if (!pp || !pp->objbind_table) {
-    return;
-  }
-
-  if (pp->object_store) {
-    GtkTreeIter iter;
-    GtkTreeRowReference *rr;
-    GtkTreeModel *model;
-    GtkTreePath *path;
-
-    model = GTK_TREE_MODEL(pp->object_store);
-
-    property_page_objbind_iterate(pp, ob) {
-      if (objbind_get_rowref(ob)) {
-        continue;
-      }
-      gtk_list_store_append(pp->object_store, &iter);
-      gtk_list_store_set(pp->object_store, &iter, 0, ob, -1);
-      path = gtk_tree_model_get_path(model, &iter);
-      rr = gtk_tree_row_reference_new(model, path);
-      gtk_tree_path_free(path);
-      objbind_set_rowref(ob, rr);
-
-      property_page_objprop_iterate(pp, op) {
-        property_page_set_store_value(pp, op, ob, &iter);
-      } property_page_objprop_iterate_end;
-    } property_page_objbind_iterate_end;
-
-    if (gtk_tree_model_get_iter_first(model, &iter)) {
-      GtkTreeSelection *sel;
-
-      sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->object_view));
-      gtk_tree_selection_select_iter(sel, &iter);
-    }
-  }
-
-  focused = property_page_get_focused_objbind(pp);
-  property_page_objprop_iterate(pp, op) {
-    objprop_refresh_widget(op, focused);
-  } property_page_objprop_iterate_end;
-}
-
-/************************************************************************//**
-  Get the objbind corresponding to the object that is currently in view
-  (i.e. in the information/properties panels) or NULL if none.
-****************************************************************************/
-static struct objbind *property_page_get_focused_objbind(struct property_page *pp)
-{
-  if (!pp) {
-    return NULL;
-  }
-  return pp->focused_objbind;
-}
-
-/************************************************************************//**
-  Set the objbind that should be shown in the properties panel. Does not
-  refresh property widgets.
-****************************************************************************/
-static void property_page_set_focused_objbind(struct property_page *pp,
-                                              struct objbind *ob)
-{
-  if (!pp) {
-    return;
-  }
-  pp->focused_objbind = ob;
-}
-
-/************************************************************************//**
-  Returns the objbind whose object corresponds to the given id, or NULL
-  if no such objbind exists.
-****************************************************************************/
-static struct objbind *property_page_get_objbind(struct property_page *pp,
-                                                 int object_id)
-{
-  struct objbind *ob;
-
-  if (!pp || !pp->objbind_table) {
-    return NULL;
-  }
-
-  objbind_hash_lookup(pp->objbind_table, object_id, &ob);
-  return ob;
-}
-
-/************************************************************************//**
-  Removes all of the current objbinds and extracts new ones from the
-  supplied list of tiles.
-****************************************************************************/
-static void property_page_load_tiles(struct property_page *pp,
-                                     const struct tile_list *tiles)
-{
-  if (!pp || !tiles) {
-    return;
-  }
-
-  tile_list_iterate(tiles, ptile) {
-    property_page_add_objbinds_from_tile(pp, ptile);
-  } tile_list_iterate_end;
-
-  property_page_fill_widgets(pp);
-}
-
-/************************************************************************//**
-  Return the number of current bound objects to this property page.
-****************************************************************************/
-static int property_page_get_num_objbinds(const struct property_page *pp)
-{
-  if (!pp || !pp->objbind_table) {
-    return 0;
-  }
-  return objbind_hash_size(pp->objbind_table);
-}
-
-/************************************************************************//**
-  Called when a user sets a new value for the given property via the GUI.
-  Refreshes the properties widget if anything changes.
-****************************************************************************/
-static void property_page_change_value(struct property_page *pp,
-                                       struct objprop *op,
-                                       struct propval *pv)
-{
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GList *rows, *p;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-  struct objbind *ob;
-  bool changed = FALSE;
-
-  if (!pp || !op || !pp->object_view) {
-    return;
-  }
-
-  if (objprop_is_readonly(op)) {
-    return;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->object_view));
-  rows = gtk_tree_selection_get_selected_rows(sel, &model);
-
-  for (p = rows; p != NULL; p = p->next) {
-    path = p->data;
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      gtk_tree_model_get(model, &iter, 0, &ob, -1);
-      changed |= objbind_set_modified_value(ob, op, pv);
-    }
-    gtk_tree_path_free(path);
-  }
-  g_list_free(rows);
-
-  if (changed) {
-    ob = property_page_get_focused_objbind(pp);
-    objprop_refresh_widget(op, ob);
-  }
-}
-
-/************************************************************************//**
-  Send all modified values of all selected properties.
-****************************************************************************/
-static void property_page_send_values(struct property_page *pp)
-{
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GList *rows, *p;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-  struct objbind *ob;
-  union packetdata packet;
-  struct connection *my_conn = &client.conn;
-
-  if (!pp || !pp->object_view) {
-    return;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->object_view));
-  if (gtk_tree_selection_count_selected_rows(sel) < 1) {
-    return;
-  }
-
-  packet = property_page_new_packet(pp);
-  if (!packet.pointers.v_pointer1) {
-    return;
-  }
-
-  rows = gtk_tree_selection_get_selected_rows(sel, &model);
-  connection_do_buffer(my_conn);
-  for (p = rows; p != NULL; p = p->next) {
-    path = p->data;
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      gtk_tree_model_get(model, &iter, 0, &ob, -1);
-      if (objbind_has_modified_properties(ob)) {
-        objbind_pack_current_values(ob, packet);
-        property_page_objprop_iterate(pp, op) {
-          if (objprop_is_readonly(op)) {
-            continue;
-          }
-          objbind_pack_modified_value(ob, op, packet);
-        } property_page_objprop_iterate_end;
-        property_page_send_packet(pp, packet);
-      }
-    }
-    gtk_tree_path_free(path);
-  }
-  connection_do_unbuffer(my_conn);
-  g_list_free(rows);
-
-  property_page_free_packet(pp, packet);
-}
-
-/************************************************************************//**
-  Returns pointer to a packet suitable for this page's object type. Result
-  should be freed using property_page_free_packet when no longer needed.
-****************************************************************************/
-static union packetdata property_page_new_packet(struct property_page *pp)
-{
-  union packetdata packet;
-
-  packet.pointers.v_pointer2 = NULL;
-
-  if (!pp) {
-    packet.pointers.v_pointer1 = NULL;
-    return packet;
-  }
-
-  switch (property_page_get_objtype(pp)) {
-  case OBJTYPE_TILE:
-    packet.tile = fc_calloc(1, sizeof(*packet.tile));
-    break;
-  case OBJTYPE_STARTPOS:
-    packet.startpos = fc_calloc(1, sizeof(*packet.startpos));
-    break;
-  case OBJTYPE_UNIT:
-    packet.unit = fc_calloc(1, sizeof(*packet.unit));
-    break;
-  case OBJTYPE_CITY:
-    packet.city = fc_calloc(1, sizeof(*packet.city));
-    break;
-  case OBJTYPE_PLAYER:
-    packet.player = fc_calloc(1, sizeof(*packet.player));
-    break;
-  case OBJTYPE_GAME:
-    packet.game.game = fc_calloc(1, sizeof(*packet.game.game));
-    packet.game.desc = fc_calloc(1, sizeof(*packet.game.desc));
-    break;
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  return packet;
-}
-
-/************************************************************************//**
-  Sends the given packet.
-****************************************************************************/
-static void property_page_send_packet(struct property_page *pp,
-                                      union packetdata packet)
-{
-  struct connection *my_conn = &client.conn;
-
-  if (!pp || !packet.pointers.v_pointer1) {
-    return;
-  }
-
-  switch (property_page_get_objtype(pp)) {
-  case OBJTYPE_TILE:
-    send_packet_edit_tile(my_conn, packet.tile);
-    return;
-  case OBJTYPE_STARTPOS:
-    send_packet_edit_startpos_full(my_conn, packet.startpos);
-    return;
-  case OBJTYPE_UNIT:
-    send_packet_edit_unit(my_conn, packet.unit);
-    return;
-  case OBJTYPE_CITY:
-    send_packet_edit_city(my_conn, packet.city);
-    return;
-  case OBJTYPE_PLAYER:
-    send_packet_edit_player(my_conn, packet.player);
-    return;
-  case OBJTYPE_GAME:
-    send_packet_edit_game(my_conn, packet.game.game);
-    send_packet_edit_scenario_desc(my_conn, packet.game.desc);
-    return;
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  log_error("%s(): Unhandled object type %s (nb %d).",
-            __FUNCTION__, objtype_get_name(property_page_get_objtype(pp)),
-            property_page_get_objtype(pp));
-}
-
-/************************************************************************//**
-  Free any resources being used by the packet.
-****************************************************************************/
-static void property_page_free_packet(struct property_page *pp,
-                                      union packetdata packet)
-{
-  if (!packet.pointers.v_pointer1) {
-    return;
-  }
-
-  free(packet.pointers.v_pointer1);
-  packet.pointers.v_pointer1 = NULL;
-
-  if (packet.pointers.v_pointer2 != NULL) {
-    free(packet.pointers.v_pointer2);
-    packet.pointers.v_pointer2 = NULL;
-  }
-}
-
-/************************************************************************//**
-  Reload the displayed values of all properties for the selected bound
-  objects. Hence, deletes all their stored modified values.
-****************************************************************************/
-static void property_page_reset_objbinds(struct property_page *pp)
-{
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GList *rows, *p;
-  struct objbind *ob;
-
-  if (!pp || !pp->object_view) {
-    return;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->object_view));
-  if (gtk_tree_selection_count_selected_rows(sel) < 1) {
-    return;
-  }
-
-  rows = gtk_tree_selection_get_selected_rows(sel, &model);
-  for (p = rows; p != NULL; p = p->next) {
-    path = p->data;
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      gtk_tree_model_get(model, &iter, 0, &ob, -1);
-      objbind_clear_all_modified_values(ob);
-      property_page_objprop_iterate(pp, op) {
-        property_page_set_store_value(pp, op, ob, &iter);
-      } property_page_objprop_iterate_end;
-    }
-    gtk_tree_path_free(path);
-  }
-  g_list_free(rows);
-
-  ob = property_page_get_focused_objbind(pp);
-  property_page_objprop_iterate(pp, op) {
-    objprop_refresh_widget(op, ob);
-  } property_page_objprop_iterate_end;
-}
-
-/************************************************************************//**
-  Destroy all selected objects in the current property page.
-****************************************************************************/
-static void property_page_destroy_objects(struct property_page *pp)
-{
-  GtkTreeSelection *sel;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GtkTreePath *path;
-  GList *rows, *p;
-  struct objbind *ob;
-  struct connection *my_conn = &client.conn;
-
-  if (!pp || !pp->object_view) {
-    return;
-  }
-
-  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->object_view));
-  if (gtk_tree_selection_count_selected_rows(sel) < 1) {
-    return;
-  }
-
-  rows = gtk_tree_selection_get_selected_rows(sel, &model);
-  connection_do_buffer(my_conn);
-  for (p = rows; p != NULL; p = p->next) {
-    path = p->data;
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      gtk_tree_model_get(model, &iter, 0, &ob, -1);
-      objbind_request_destroy_object(ob);
-    }
-    gtk_tree_path_free(path);
-  }
-  connection_do_unbuffer(my_conn);
-  g_list_free(rows);
-}
-
-/************************************************************************//**
-  Create objects corresponding to the type of this property page. Parameters
-  such as the type, count, size and player owner are taken from the current
-  editor state. The 'hint_tiles' argument is a list of tiles where the
-  objects could be created.
-****************************************************************************/
-static void property_page_create_objects(struct property_page *pp,
-                                         struct tile_list *hint_tiles)
-{
-  enum editor_object_type objtype;
-  int apno, value, count, size;
-  int tag;
-  struct connection *my_conn = &client.conn;
-  struct tile *ptile = NULL;
-  struct player *pplayer;
-
-  if (!pp) {
-    return;
-  }
-
-  objtype = property_page_get_objtype(pp);
-  if (objtype_is_conserved(objtype)) {
-    return;
-  }
-
-  tag = get_next_unique_tag();
-  count = 1;
-
-  switch (objtype) {
-  case OBJTYPE_STARTPOS:
-    if (hint_tiles) {
-      tile_list_iterate(hint_tiles, atile) {
-        if (NULL == map_startpos_get(atile)) {
-          ptile = atile;
-          break;
-        }
-      } tile_list_iterate_end;
-    }
-
-    if (NULL == ptile) {
-      ptile = get_center_tile_mapcanvas();
-    }
-
-    if (NULL == ptile) {
-      break;
-    }
-
-    dsend_packet_edit_startpos(my_conn, tile_index(ptile), FALSE, tag);
-    break;
-
-  case OBJTYPE_UNIT:
-    if (hint_tiles) {
-      tile_list_iterate(hint_tiles, atile) {
-        if (can_create_unit_at_tile(atile)) {
-          ptile = atile;
-          break;
-        }
-      } tile_list_iterate_end;
-    }
-
-    if (!ptile) {
-      struct unit *punit;
-      property_page_objbind_iterate(pp, ob) {
-        punit = objbind_get_object(ob);
-        if (punit && can_create_unit_at_tile(unit_tile(punit))) {
-          ptile = unit_tile(punit);
-          break;
-        }
-      } property_page_objbind_iterate_end;
-    }
-
-    if (!ptile) {
-      ptile = get_center_tile_mapcanvas();
-    }
-
-    if (!ptile) {
-      break;
-    }
-
-    apno = editor_tool_get_applied_player(ETT_UNIT);
-    count = editor_tool_get_count(ETT_UNIT);
-    value = editor_tool_get_value(ETT_UNIT);
-    dsend_packet_edit_unit_create(my_conn, apno, tile_index(ptile),
-                                  value, count, tag);
-    break;
-
-  case OBJTYPE_CITY:
-    apno = editor_tool_get_applied_player(ETT_CITY);
-    pplayer = player_by_number(apno);
-    if (pplayer && hint_tiles) {
-      tile_list_iterate(hint_tiles, atile) {
-        if (!is_enemy_unit_tile(atile, pplayer)
-            && city_can_be_built_here(&(wld.map), atile,
-                                      nullptr, FALSE)) {
-          ptile = atile;
-          break;
-        }
-      } tile_list_iterate_end;
-    }
-
-    if (!ptile) {
-      ptile = get_center_tile_mapcanvas();
-    }
-
-    if (!ptile) {
-      break;
-    }
-
-    size = editor_tool_get_size(ETT_CITY);
-    dsend_packet_edit_city_create(my_conn, apno, tile_index(ptile),
-                                  size, tag);
-    break;
-
-  case OBJTYPE_PLAYER:
-    dsend_packet_edit_player_create(my_conn, tag);
-    break;
-
-  case OBJTYPE_TILE:
-  case OBJTYPE_GAME:
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  property_page_store_creation_tag(pp, tag, count);
-}
-
-/************************************************************************//**
-  Update objbinds and widgets according to how the object given by
-  'object_id' has changed. If the object no longer exists then the
-  objbind is removed from the property page.
-****************************************************************************/
-static void property_page_object_changed(struct property_page *pp,
-                                         int object_id,
-                                         bool removed)
-{
-  struct objbind *ob;
-  GtkTreeRowReference *rr;
-
-  ob = property_page_get_objbind(pp, object_id);
-  if (!ob) {
-    return;
-  }
-
-  rr = objbind_get_rowref(ob);
-  if (rr && gtk_tree_row_reference_valid(rr)) {
-    GtkTreePath *path;
-    GtkTreeIter iter;
-    GtkTreeModel *model;
-
-    model = GTK_TREE_MODEL(pp->object_store);
-    path = gtk_tree_row_reference_get_path(rr);
-
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      if (removed) {
-        gtk_list_store_remove(pp->object_store, &iter);
-      } else {
-        property_page_objprop_iterate(pp, op) {
-          property_page_set_store_value(pp, op, ob, &iter);
-        } property_page_objprop_iterate_end;
-      }
-    }
-
-    gtk_tree_path_free(path);
-  }
-
-  if (removed) {
-    objbind_hash_remove(pp->objbind_table, object_id);
-    return;
-  }
-
-  if (ob == property_page_get_focused_objbind(pp)) {
-    property_page_objprop_iterate(pp, op) {
-      objprop_refresh_widget(op, ob);
-    } property_page_objprop_iterate_end;
-  }
-}
-
-/************************************************************************//**
-  Handle a notification of object creation sent back from the server. If
-  this is something we previously requested, then 'tag' should be found in
-  the tag table. In this case we create a new objbind for the object given
-  by 'object_id' and add it to this page.
-****************************************************************************/
-static void property_page_object_created(struct property_page *pp,
-                                         int tag, int object_id)
-{
-  gpointer object;
-  enum editor_object_type objtype;
-
-  if (!property_page_tag_is_known(pp, tag)) {
-    return;
-  }
-  property_page_remove_creation_tag(pp, tag);
-
-  objtype = property_page_get_objtype(pp);
-  object = objtype_get_object_from_id(objtype, object_id);
-
-  if (!object) {
-    return;
-  }
-
-  property_page_add_objbind(pp, object);
-  property_page_fill_widgets(pp);
-}
-
-/************************************************************************//**
-  Add the extviewer's view widget to the property page so that it can
-  be shown in the extended property view panel.
-****************************************************************************/
-static void property_page_add_extviewer(struct property_page *pp,
-                                        struct extviewer *ev)
-{
-  GtkWidget *w;
-
-  if (!pp || !ev) {
-    return;
-  }
-
-  w = extviewer_get_view_widget(ev);
-  if (!w) {
-    return;
-  }
-  gtk_notebook_append_page(GTK_NOTEBOOK(pp->extviewer_notebook), w, NULL);
-}
-
-/************************************************************************//**
-  Make the given extended property viewer's view widget visible in the
-  property page.
-****************************************************************************/
-static void property_page_show_extviewer(struct property_page *pp,
-                                         struct extviewer *ev)
-{
-  GtkWidget *w;
-  GtkNotebook *notebook;
-  int page;
-
-  if (!pp || !ev) {
-    return;
-  }
-
-  w = extviewer_get_view_widget(ev);
-  if (!w) {
-    return;
-  }
-
-  notebook = GTK_NOTEBOOK(pp->extviewer_notebook);
-  page = gtk_notebook_page_num(notebook, w);
-  gtk_notebook_set_current_page(notebook, page);
-}
-
-/************************************************************************//**
-  Store the given object creation tag so that when the server notifies
-  us about it we know what to do, up to 'count' times.
-****************************************************************************/
-static void property_page_store_creation_tag(struct property_page *pp,
-                                             int tag, int count)
-{
-  if (!pp || !pp->tag_table) {
-    return;
-  }
-
-  if (stored_tag_hash_lookup(pp->tag_table, tag, NULL)) {
-    log_error("Attempted to insert object creation tag %d "
-              "twice into tag table for property page %p (%d %s).",
-              tag, pp, property_page_get_objtype(pp),
-              property_page_get_name(pp));
-    return;
-  }
-
-  stored_tag_hash_insert(pp->tag_table, tag, count);
-}
-
-/************************************************************************//**
-  Decrease the tag count and remove the object creation tag if it is no
-  longer needed.
-****************************************************************************/
-static void property_page_remove_creation_tag(struct property_page *pp,
-                                              int tag)
-{
-  int count;
-
-  if (!pp || !pp->tag_table) {
-    return;
-  }
-
-  if (stored_tag_hash_lookup(pp->tag_table, tag, &count)) {
-    if (0 >= --count) {
-      stored_tag_hash_remove(pp->tag_table, tag);
-    }
-  }
-}
-
-/************************************************************************//**
-  Check if the given tag is one that we previously stored.
-****************************************************************************/
-static bool property_page_tag_is_known(struct property_page *pp, int tag)
-{
-  if (!pp || !pp->tag_table) {
-    return FALSE;
-  }
-  return stored_tag_hash_lookup(pp->tag_table, tag, NULL);
-}
-
-/************************************************************************//**
-  Remove all tags in the tag table.
-****************************************************************************/
-static void property_page_clear_tags(struct property_page *pp)
-{
-  if (!pp || !pp->tag_table) {
-    return;
-  }
-  stored_tag_hash_clear(pp->tag_table);
-}
-
-/************************************************************************//**
-  Handles the 'clicked' signal for the "Apply" button in the property page.
-****************************************************************************/
-static void property_page_apply_button_clicked(GtkButton *button,
-                                               gpointer userdata)
-{
-  struct property_page *pp = userdata;
-  property_page_send_values(pp);
-}
-
-/************************************************************************//**
-  Handles the 'clicked' signal for the "Refresh" button in the
-  property page.
-****************************************************************************/
-static void property_page_refresh_button_clicked(GtkButton *button,
-                                                 gpointer userdata)
-{
-  struct property_page *pp = userdata;
-  property_page_reset_objbinds(pp);
-}
-
-/************************************************************************//**
-  Handle a request to create a new object in the property page.
-****************************************************************************/
-static void property_page_create_button_clicked(GtkButton *button,
-                                                gpointer userdata)
-{
-  struct property_page *pp = userdata, *tile_pp;
-  struct tile_list *tiles = NULL;
-  struct tile *ptile;
-
-  if (!pp) {
-    return;
-  }
-
-  tile_pp = property_editor_get_page(pp->pe_parent, OBJTYPE_TILE);
-  tiles = tile_list_new();
-
-  property_page_objbind_iterate(tile_pp, ob) {
-    ptile = objbind_get_object(ob);
-    if (ptile) {
-      tile_list_append(tiles, ptile);
-    }
-  } property_page_objbind_iterate_end;
-
-  property_page_create_objects(pp, tiles);
-  tile_list_destroy(tiles);
-}
-
-/************************************************************************//**
-  Handle a click on the "destroy" button.
-****************************************************************************/
-static void property_page_destroy_button_clicked(GtkButton *button,
-                                                 gpointer userdata)
-{
-  struct property_page *pp = userdata;
-  property_page_destroy_objects(pp);
-}
-
-/************************************************************************//**
-  Create and add a property page for the given object type
-  to the property editor. Returns TRUE if successful.
-****************************************************************************/
-static bool property_editor_add_page(struct property_editor *pe,
-                                     enum editor_object_type objtype)
-{
-  struct property_page *pp;
-  GtkWidget *label;
-  const char *name;
-
-  if (!pe || !pe->notebook) {
-    return FALSE;
-  }
-
-  if (!(objtype < NUM_OBJTYPES)) {
-    return FALSE;
-  }
-
-  pp = property_page_new(objtype, pe);
-  if (!pp) {
-    return FALSE;
-  }
-
-  name = property_page_get_name(pp);
-  label = gtk_label_new(name);
-  gtk_notebook_append_page(GTK_NOTEBOOK(pe->notebook),
-                           pp->widget, label);
-
-  pe->property_pages[objtype] = pp;
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Returns the property page for the given object type.
-****************************************************************************/
-static struct property_page *
-property_editor_get_page(struct property_editor *pe,
-                         enum editor_object_type objtype)
-{
-  if (!pe || !(objtype < NUM_OBJTYPES)) {
-    return NULL;
-  }
-
-  return pe->property_pages[objtype];
-}
-
-/************************************************************************//**
-  Create and return the property editor widget bundle.
-****************************************************************************/
-static struct property_editor *property_editor_new(void)
-{
-  struct property_editor *pe;
-  GtkWidget *win, *notebook, *vgrid;
-  enum editor_object_type objtype;
-  int grid_row = 0;
-
-  pe = fc_calloc(1, sizeof(*pe));
-
-  /* The property editor dialog window. */
-
-  win = gtk_window_new();
-  gtk_window_set_title(GTK_WINDOW(win), _("Property Editor"));
-  gtk_window_set_resizable(GTK_WINDOW(win), TRUE);
-  gtk_window_set_default_size(GTK_WINDOW(win), 780, 560);
-  gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(toplevel));
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(win), TRUE);
-  gtk_widget_set_margin_start(win, 4);
-  gtk_widget_set_margin_end(win, 4);
-  gtk_widget_set_margin_top(win, 4);
-  gtk_widget_set_margin_bottom(win, 4);
-  gtk_window_set_hide_on_close(GTK_WINDOW(win), TRUE);
-  pe->widget = win;
-
-  vgrid = gtk_grid_new();
-  gtk_window_set_child(GTK_WINDOW(win), vgrid);
-
-  /* Property pages. */
-
-  notebook = gtk_notebook_new();
-  gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), TRUE);
-  gtk_grid_attach(GTK_GRID(vgrid), notebook, 0, grid_row++, 1, 1);
-  pe->notebook = notebook;
-
-  for (objtype = 0; objtype < NUM_OBJTYPES; objtype++) {
-    property_editor_add_page(pe, objtype);
-  }
-
-  return pe;
-}
-
-/************************************************************************//**
-  Get the property editor for the client's GUI.
-****************************************************************************/
-struct property_editor *editprop_get_property_editor(void)
-{
-  if (!the_property_editor) {
-    the_property_editor = property_editor_new();
-  }
-  return the_property_editor;
-}
-
-/************************************************************************//**
-  Refresh the given property editor according to the given list of tiles.
-****************************************************************************/
-void property_editor_load_tiles(struct property_editor *pe,
-                                const struct tile_list *tiles)
-{
-  struct property_page *pp;
-  enum editor_object_type objtype;
-  int i;
-  const enum editor_object_type preferred[] = {
-    OBJTYPE_CITY,
-    OBJTYPE_UNIT,
-    OBJTYPE_STARTPOS,
-    OBJTYPE_TILE
-  };
-
-  if (!pe || !tiles) {
-    return;
-  }
-
-  for (objtype = 0; objtype < NUM_OBJTYPES; objtype++) {
-    pp = property_editor_get_page(pe, objtype);
-    property_page_load_tiles(pp, tiles);
-  }
-
-  for (i = 0; i < ARRAY_SIZE(preferred) - 1; i++) {
-    pp = property_editor_get_page(pe, preferred[i]);
-    if (property_page_get_num_objbinds(pp) > 0) {
-      break;
-    }
-  }
-  objtype = preferred[i];
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(pe->notebook), objtype);
-}
-
-/************************************************************************//**
-  Show the property editor to the user, with given page corresponding to
-  'objtype' in front (if a valid object type).
-****************************************************************************/
-void property_editor_popup(struct property_editor *pe,
-                           enum editor_object_type objtype)
-{
-  if (pe == nullptr || pe->widget == nullptr) {
-    return;
-  }
-
-  gtk_widget_set_visible(pe->widget, TRUE);
-
-  gtk_window_present(GTK_WINDOW(pe->widget));
-  if (objtype < NUM_OBJTYPES) {
-    gtk_notebook_set_current_page(GTK_NOTEBOOK(pe->notebook), objtype);
-  }
-}
-
-/************************************************************************//**
-  Hide the property editor window.
-****************************************************************************/
-void property_editor_popdown(struct property_editor *pe)
-{
-  if (pe == nullptr || pe->widget == nullptr) {
-    return;
-  }
-
-  gtk_widget_set_visible(pe->widget, FALSE);
-}
-
-/************************************************************************//**
-  Handle a notification from the client core that some object has changed
-  state at the server side (including being removed).
-****************************************************************************/
-void property_editor_handle_object_changed(struct property_editor *pe,
-                                           enum editor_object_type objtype,
-                                           int object_id,
-                                           bool remove)
-{
-  struct property_page *pp;
-
-  if (!pe) {
-    return;
-  }
-
-  if (!(objtype < NUM_OBJTYPES)) {
-    return;
-  }
-
-  pp = property_editor_get_page(pe, objtype);
-  property_page_object_changed(pp, object_id, remove);
-}
-
-/************************************************************************//**
-  Handle a notification that an object was created under the given tag.
-****************************************************************************/
-void property_editor_handle_object_created(struct property_editor *pe,
-                                           int tag, int object_id)
-{
-  enum editor_object_type objtype;
-  struct property_page *pp;
-
-  for (objtype = 0; objtype < NUM_OBJTYPES; objtype++) {
-    if (objtype_is_conserved(objtype)) {
-      continue;
-    }
-    pp = property_editor_get_page(pe, objtype);
-    property_page_object_created(pp, tag, object_id);
-  }
-}
-
-/************************************************************************//**
-  Clear all property pages in the given property editor.
-****************************************************************************/
-void property_editor_clear(struct property_editor *pe)
-{
-  enum editor_object_type objtype;
-  struct property_page *pp;
-
-  if (!pe) {
-    return;
-  }
-
-  for (objtype = 0; objtype < NUM_OBJTYPES; objtype++) {
-    pp = property_editor_get_page(pe, objtype);
-    property_page_clear_objbinds(pp);
-    property_page_clear_tags(pp);
-  }
-}
-
-/************************************************************************//**
-  Clear and load objects into the property page corresponding to the given
-  object type. Also, make it the current shown notebook page.
-****************************************************************************/
-void property_editor_reload(struct property_editor *pe,
-                            enum editor_object_type objtype)
-{
-  struct property_page *pp;
-
-  if (!pe) {
-    return;
-  }
-
-  pp = property_editor_get_page(pe, objtype);
-  if (!pp) {
-    return;
-  }
-
-  property_page_clear_objbinds(pp);
-
-  switch (objtype) {
-  case OBJTYPE_PLAYER:
-    players_iterate(pplayer) {
-      property_page_add_objbind(pp, pplayer);
-    } players_iterate_end;
-    break;
-  case OBJTYPE_GAME:
-    property_page_add_objbind(pp, &game);
-    break;
-  case OBJTYPE_TILE:
-  case OBJTYPE_STARTPOS:
-  case OBJTYPE_UNIT:
-  case OBJTYPE_CITY:
-  case NUM_OBJTYPES:
-    break;
-  }
-
-  property_page_fill_widgets(pp);
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(pe->notebook), objtype);
-}
-
-/************************************************************************//**
-  Create a new property filter from the given filter string. Result
-  should be freed by property_filter_free when no longed needed.
-
-  The filter string is '|' ("or") separated list of '&' ("and") separated
-  lists of patterns. A pattern may be preceded by '!' to have its result
-  negated.
-
-  NB: If you change the behavior of this function, be sure to update
-  the filter tooltip in property_page_new().
-****************************************************************************/
-static struct property_filter *property_filter_new(const char *filter)
-{
-  struct property_filter *pf;
-  struct pf_conjunction *pfc;
-  struct pf_pattern *pfp;
-  int or_clause_count, and_clause_count;
-  char *or_clauses[PF_MAX_CLAUSES], *and_clauses[PF_MAX_CLAUSES];
-  const char *pattern;
-  int i, j;
-
-  pf = fc_calloc(1, sizeof(*pf));
-
-  if (!filter || filter[0] == '\0') {
-    return pf;
-  }
-
-  or_clause_count = get_tokens(filter, or_clauses,
-                               PF_MAX_CLAUSES,
-                               PF_DISJUNCTION_SEPARATOR);
-
-  for (i = 0; i < or_clause_count; i++) {
-    if (or_clauses[i][0] == '\0') {
-      continue;
-    }
-    pfc = &pf->disjunction[pf->count];
-
-    and_clause_count = get_tokens(or_clauses[i], and_clauses,
-                                  PF_MAX_CLAUSES,
-                                  PF_CONJUNCTION_SEPARATOR);
-
-    for (j = 0; j < and_clause_count; j++) {
-      if (and_clauses[j][0] == '\0') {
-        continue;
-      }
-      pfp = &pfc->conjunction[pfc->count];
-      pattern = and_clauses[j];
-
-      switch (pattern[0]) {
-      case '!':
-        pfp->negate = TRUE;
-        pfp->text = fc_strdup(pattern + 1);
-        break;
-      default:
-        pfp->text = fc_strdup(pattern);
-        break;
-      }
-      pfc->count++;
-    }
-    free_tokens(and_clauses, and_clause_count);
-    pf->count++;
-  }
-
-  free_tokens(or_clauses, or_clause_count);
-
-  return pf;
-}
-
-/************************************************************************//**
-  Returns TRUE if the filter matches the given object property.
-
-  The filter matches if its truth value is TRUE. That is, it has at least
-  one OR clause in which all AND clauses are TRUE. An AND clause is TRUE
-  if its pattern matches the name of the given object property (case is
-  ignored), or it is negated and does not match. For example:
-
-  a     - Matches all properties whose names contain "a" (or "A").
-  !a    - Matches all properties whose names do not contain "a".
-  a|b   - Matches all properties whose names contain "a" or "b".
-  a|b&c - Matches all properties whose names contain either an "a",
-          or contain both "b" and "c".
-
-  NB: If you change the behavior of this function, be sure to update
-  the filter tooltip in property_page_new().
-****************************************************************************/
-static bool property_filter_match(struct property_filter *pf,
-                                  const struct objprop *op)
-{
-  struct pf_pattern *pfp;
-  struct pf_conjunction *pfc;
-  const char *name;
-  bool match, or_result, and_result;
-  int i, j;
-
-  if (!pf) {
-    return TRUE;
-  }
-  if (!op) {
-    return FALSE;
-  }
-
-  name = objprop_get_name(op);
-  if (!name) {
-    return FALSE;
-  }
-
-  if (pf->count < 1) {
-    return TRUE;
-  }
-
-  or_result = FALSE;
-
-  for (i = 0; i < pf->count; i++) {
-    pfc = &pf->disjunction[i];
-    and_result = TRUE;
-    for (j = 0; j < pfc->count; j++) {
-      pfp = &pfc->conjunction[j];
-      match = (pfp->text[0] == '\0'
-               || fc_strcasestr(name, pfp->text));
-      if (pfp->negate) {
-        match = !match;
-      }
-      and_result = and_result && match;
-      if (!and_result) {
-        break;
-      }
-    }
-    or_result = or_result || and_result;
-    if (or_result) {
-      break;
-    }
-  }
-
-  return or_result;
-}
-
-/************************************************************************//**
-  Frees all memory used by the property filter.
-****************************************************************************/
-static void property_filter_free(struct property_filter *pf)
-{
-  struct pf_pattern *pfp;
-  struct pf_conjunction *pfc;
-  int i, j;
-
-  if (!pf) {
-    return;
-  }
-
-  for (i = 0; i < pf->count; i++) {
-    pfc = &pf->disjunction[i];
-    for (j = 0; j < pfc->count; j++) {
-      pfp = &pfc->conjunction[j];
-      if (pfp->text != NULL) {
-        free(pfp->text);
-        pfp->text = NULL;
-      }
-    }
-    pfc->count = 0;
-  }
-  pf->count = 0;
-  free(pf);
-}
-
-/************************************************************************//**
-  Returns a translated string name for the given "vision layer".
-****************************************************************************/
-const char *vision_layer_get_name(enum vision_layer vl)
-{
-  switch (vl) {
-  case V_MAIN:
-    /* TRANS: Vision layer name. Feel free to leave untranslated. */
-    return _("Seen (Main)");
-  case V_INVIS:
-    /* TRANS: Vision layer name. Feel free to leave untranslated. */
-    return _("Seen (Invis)");
-  case V_SUBSURFACE:
-    /* TRANS: Vision layer name. Feel free to leave untranslated. */
-    return _("Seen (Subsurface)");
-  case V_COUNT:
-    break;
-  }
-
-  log_error("%s(): Unrecognized vision layer %d.", __FUNCTION__, vl);
-  return _("Unknown");
-}
diff --git a/client/gui-gtk-5.0/editprop.h b/client/gui-gtk-5.0/editprop.h
deleted file mode 100644
index 46aeeb22d3..0000000000
--- a/client/gui-gtk-5.0/editprop.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2005 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__EDITPROP_H
-#define FC__EDITPROP_H
-
-/* client */
-#include "editor.h"
-
-/* client/include */
-#include "editgui_g.h"
-
-struct tile_list;
-struct property_editor;
-
-void property_editor_clear(struct property_editor *pe);
-void property_editor_load_tiles(struct property_editor *pe,
-                                const struct tile_list *tiles);
-void property_editor_reload(struct property_editor *pe,
-                            enum editor_object_type objtype);
-void property_editor_popup(struct property_editor *pe,
-                           enum editor_object_type objtype);
-void property_editor_popdown(struct property_editor *pe);
-void property_editor_handle_object_changed(struct property_editor *pe,
-                                           enum editor_object_type objtype,
-                                           int object_id,
-                                           bool remove);
-void property_editor_handle_object_created(struct property_editor *pe,
-                                           int tag, int object_id);
-
-struct property_editor *editprop_get_property_editor(void);
-
-#endif /* FC__EDITPROP_H */
diff --git a/client/gui-gtk-5.0/finddlg.c b/client/gui-gtk-5.0/finddlg.c
deleted file mode 100644
index 9bd271317f..0000000000
--- a/client/gui-gtk-5.0/finddlg.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-
-/* common */
-#include "game.h"
-#include "player.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-
-#include "finddlg.h"
-
-static struct gui_dialog *find_dialog_shell;
-static GtkWidget *find_view;
-
-static void update_find_dialog(GtkListStore *store);
-
-static void find_response(struct gui_dialog *dlg, int response, gpointer data);
-static void find_destroy_callback(GtkWidget *w, gpointer data);
-static void find_selection_callback(GtkTreeSelection *selection,
-                                    GtkTreeModel *model);
-
-static struct tile *pos;
-
-/**********************************************************************//**
-  Popup the dialog 10% inside the main-window
-**************************************************************************/
-void popup_find_dialog(void)
-{
-  if (!find_dialog_shell) {
-    GtkWidget         *label;
-    GtkWidget         *sw;
-    GtkListStore      *store;
-    GtkTreeSelection  *selection;
-    GtkCellRenderer   *renderer;
-    GtkTreeViewColumn *column;
-
-    pos = get_center_tile_mapcanvas();
-
-    gui_dialog_new(&find_dialog_shell, GTK_NOTEBOOK(bottom_notebook), NULL,
-                   TRUE);
-    gui_dialog_set_title(find_dialog_shell, _("Find City"));
-    gui_dialog_set_default_size(find_dialog_shell, -1, 240);
-
-    gui_dialog_add_button(find_dialog_shell, "edit-find", _("_Find"),
-                          GTK_RESPONSE_ACCEPT);
-    gui_dialog_add_button(find_dialog_shell, NULL, _("_Cancel"),
-                          GTK_RESPONSE_CANCEL);
-
-    gui_dialog_response_set_callback(find_dialog_shell, find_response);
-
-    g_signal_connect(find_dialog_shell->grid, "destroy",
-                     G_CALLBACK(find_destroy_callback), NULL);
-
-    store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
-    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
-                                         0, GTK_SORT_ASCENDING);
-
-    find_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(find_view));
-    g_object_unref(store);
-    gtk_tree_view_columns_autosize(GTK_TREE_VIEW(find_view));
-    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(find_view), FALSE);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(NULL, renderer,
-                                                      "text", 0, NULL);
-    gtk_tree_view_column_set_sort_order(column, GTK_SORT_ASCENDING);
-    gtk_tree_view_append_column(GTK_TREE_VIEW(find_view), column);
-
-    sw = gtk_scrolled_window_new();
-    gtk_widget_set_margin_bottom(sw, 2);
-    gtk_widget_set_margin_end(sw, 2);
-    gtk_widget_set_margin_start(sw, 2);
-    gtk_widget_set_margin_top(sw, 2);
-    gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), find_view);
-
-    gtk_widget_set_hexpand(GTK_WIDGET(find_view), TRUE);
-    gtk_widget_set_vexpand(GTK_WIDGET(find_view), TRUE);
-
-    label = g_object_new(GTK_TYPE_LABEL,
-                         "use-underline", TRUE,
-                         "mnemonic-widget", find_view,
-                         "label", _("Ci_ties:"),
-                         "xalign", 0.0, "yalign", 0.5, NULL);
-    gui_dialog_add_content_widget(find_dialog_shell, label);
-    gui_dialog_add_content_widget(find_dialog_shell, sw);
-
-    g_signal_connect(selection, "changed",
-                     G_CALLBACK(find_selection_callback), store);
-
-    update_find_dialog(store);
-    gtk_tree_view_focus(GTK_TREE_VIEW(find_view));
-
-    gui_dialog_show_all(find_dialog_shell);
-  }
-
-  gui_dialog_raise(find_dialog_shell);
-}
-
-/**********************************************************************//**
-  Update find dialog with current cities
-**************************************************************************/
-static void update_find_dialog(GtkListStore *store)
-{
-  GtkTreeIter it;
-
-  gtk_list_store_clear(store);
-
-  players_iterate(pplayer) {
-    city_list_iterate(pplayer->cities, pcity) {
-      GValue value = { 0, };
-
-      gtk_list_store_append(store, &it);
-
-      g_value_init(&value, G_TYPE_STRING);
-      g_value_set_static_string(&value, city_name_get(pcity));
-      gtk_list_store_set_value(store, &it, 0, &value);
-      g_value_unset(&value);
-
-      gtk_list_store_set(store, &it, 1, pcity, -1);
-    } city_list_iterate_end;
-  } players_iterate_end;
-}
-
-/**********************************************************************//**
-  User responded to find dialog
-**************************************************************************/
-static void find_response(struct gui_dialog *dlg, int response, gpointer data)
-{
-  if (response == GTK_RESPONSE_ACCEPT) {
-    GtkTreeSelection *selection;
-    GtkTreeModel *model;
-    GtkTreeIter it;
-
-    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(find_view));
-
-    if (gtk_tree_selection_get_selected(selection, &model, &it)) {
-      struct city *pcity;
-
-      gtk_tree_model_get(model, &it, 1, &pcity, -1);
-
-      if (pcity) {
-        pos = pcity->tile;
-      }
-    }
-  }
-
-  gui_dialog_destroy(dlg);
-}
-
-/**********************************************************************//**
-  Find dialog destroyed
-**************************************************************************/
-static void find_destroy_callback(GtkWidget *w, gpointer data)
-{
-  can_slide = FALSE;
-  center_tile_mapcanvas(pos);
-  can_slide = TRUE;
-}
-
-/**********************************************************************//**
-  User selected city from find dialog
-**************************************************************************/
-static void find_selection_callback(GtkTreeSelection *selection,
-                                    GtkTreeModel *model)
-{
-  GtkTreeIter it;
-  struct city *pcity;
-
-  if (!gtk_tree_selection_get_selected(selection, NULL, &it))
-    return;
-
-  gtk_tree_model_get(model, &it, 1, &pcity, -1);
-
-  if (pcity) {
-    can_slide = FALSE;
-    center_tile_mapcanvas(pcity->tile);
-    can_slide = TRUE;
-  }
-}
diff --git a/client/gui-gtk-5.0/finddlg.h b/client/gui-gtk-5.0/finddlg.h
deleted file mode 100644
index ce41d68164..0000000000
--- a/client/gui-gtk-5.0/finddlg.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2003 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__FINDDLG_H
-#define FC__FINDDLG_H
-
-/* client */
-#include "finddlg_g.h"
-
-/* Nothing to add */
-
-#endif /* FC__FINDDLG_H */
diff --git a/client/gui-gtk-5.0/gamedlgs.c b/client/gui-gtk-5.0/gamedlgs.c
deleted file mode 100644
index 987a0682ce..0000000000
--- a/client/gui-gtk-5.0/gamedlgs.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "log.h"
-#include "shared.h"
-#include "string_vector.h"
-#include "support.h"
-
-/* common */
-#include "events.h"
-#include "fcintl.h"
-#include "government.h"
-#include "multipliers.h"
-
-/* client */
-#include "client_main.h"
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "cityrep.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "ratesdlg.h"
-
-#include "gamedlgs.h"
-
-/*************************************************************************/
-static GtkWidget *rates_dialog_shell;
-static GtkWidget *rates_gov_label;
-static GtkWidget *rates_tax_toggle, *rates_lux_toggle, *rates_sci_toggle;
-static GtkWidget *rates_tax_label, *rates_lux_label, *rates_sci_label;
-static GtkWidget *rates_tax_scale, *rates_lux_scale, *rates_sci_scale;
-
-static GtkWidget *multiplier_dialog_shell;
-static GtkWidget *multipliers_scale[MAX_NUM_MULTIPLIERS];
-
-static gulong     rates_tax_sig, rates_lux_sig, rates_sci_sig;
-/*************************************************************************/
-
-static int rates_tax_value, rates_lux_value, rates_sci_value;
-
-static void rates_changed_callback(GtkWidget *range);
-
-/**********************************************************************//**
-  Set tax values to display
-**************************************************************************/
-static void rates_set_values(int tax, int no_tax_scroll,
-                             int lux, int no_lux_scroll,
-                             int sci, int no_sci_scroll)
-{
-  char buf[64];
-  int tax_lock, lux_lock, sci_lock;
-  int maxrate;
-
-  tax_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rates_tax_toggle));
-  lux_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rates_lux_toggle));
-  sci_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rates_sci_toggle));
-
-  if (NULL != client.conn.playing) {
-    maxrate = get_player_bonus(client.conn.playing, EFT_MAX_RATES);
-  } else {
-    maxrate = 100;
-  }
-
-  /* This's quite a simple-minded "double check".. */
-  tax = MIN(tax, maxrate);
-  lux = MIN(lux, maxrate);
-  sci = MIN(sci, maxrate);
-
-  if (tax + sci + lux != 100) {
-    if (tax != rates_tax_value) {
-      if (!lux_lock) {
-        lux = MIN(MAX(100 - tax - sci, 0), maxrate);
-      }
-      if (!sci_lock) {
-        sci = MIN(MAX(100 - tax - lux, 0), maxrate);
-      }
-    } else if (lux != rates_lux_value) {
-      if (!tax_lock) {
-        tax = MIN(MAX(100 - lux - sci, 0), maxrate);
-      }
-      if (!sci_lock) {
-        sci = MIN(MAX(100 - lux - tax, 0), maxrate);
-      }
-    } else if (sci != rates_sci_value) {
-      if (!lux_lock) {
-        lux = MIN(MAX(100 - tax - sci, 0), maxrate);
-      }
-      if (!tax_lock) {
-        tax = MIN(MAX(100 - lux - sci, 0), maxrate);
-      }
-    }
-
-    if (tax + sci + lux != 100) {
-      tax = rates_tax_value;
-      lux = rates_lux_value;
-      sci = rates_sci_value;
-
-      rates_tax_value = -1;
-      rates_lux_value = -1;
-      rates_sci_value = -1;
-
-      no_tax_scroll = 0;
-      no_lux_scroll = 0;
-      no_sci_scroll = 0;
-    }
-  }
-
-  if (tax != rates_tax_value) {
-    fc_snprintf(buf, sizeof(buf), "%3d%%", tax);
-
-    if (strcmp(buf, gtk_label_get_text(GTK_LABEL(rates_tax_label))) != 0) {
-      gtk_label_set_text(GTK_LABEL(rates_tax_label), buf);
-    }
-    if (!no_tax_scroll) {
-      g_signal_handler_block(rates_tax_scale, rates_tax_sig);
-      gtk_range_set_value(GTK_RANGE(rates_tax_scale), tax / 10);
-      g_signal_handler_unblock(rates_tax_scale, rates_tax_sig);
-    }
-    rates_tax_value = tax;
-  }
-
-  if (lux != rates_lux_value) {
-    fc_snprintf(buf, sizeof(buf), "%3d%%", lux);
-
-    if (strcmp(buf, gtk_label_get_text(GTK_LABEL(rates_lux_label))) != 0) {
-      gtk_label_set_text(GTK_LABEL(rates_lux_label), buf);
-    }
-    if (!no_lux_scroll) {
-      g_signal_handler_block(rates_lux_scale, rates_lux_sig);
-      gtk_range_set_value(GTK_RANGE(rates_lux_scale), lux / 10);
-      g_signal_handler_unblock(rates_lux_scale, rates_lux_sig);
-    }
-    rates_lux_value = lux;
-  }
-
-  if (sci != rates_sci_value) {
-    fc_snprintf(buf, sizeof(buf), "%3d%%", sci);
-
-    if (strcmp(buf, gtk_label_get_text(GTK_LABEL(rates_sci_label))) != 0) {
-      gtk_label_set_text(GTK_LABEL(rates_sci_label), buf);
-    }
-    if (!no_sci_scroll) {
-      g_signal_handler_block(rates_sci_scale, rates_sci_sig);
-      gtk_range_set_value(GTK_RANGE(rates_sci_scale), sci / 10);
-      g_signal_handler_unblock(rates_sci_scale, rates_sci_sig);
-    }
-    rates_sci_value = sci;
-  }
-}
-
-/**********************************************************************//**
-  User changes rates
-**************************************************************************/
-static void rates_changed_callback(GtkWidget *range)
-{
-  int percent = gtk_range_get_value(GTK_RANGE(range));
-
-  if (range == rates_tax_scale) {
-    int tax_value;
-
-    tax_value = 10 * percent;
-    tax_value = MIN(tax_value, 100);
-    rates_set_values(tax_value, 1, rates_lux_value, 0, rates_sci_value, 0);
-  } else if (range == rates_lux_scale) {
-    int lux_value;
-
-    lux_value = 10 * percent;
-    lux_value = MIN(lux_value, 100);
-    rates_set_values(rates_tax_value, 0, lux_value, 1, rates_sci_value, 0);
-  } else {
-    int sci_value;
-
-    sci_value = 10 * percent;
-    sci_value = MIN(sci_value, 100);
-    rates_set_values(rates_tax_value, 0, rates_lux_value, 0, sci_value, 1);
-  }
-}
-
-/**********************************************************************//**
-  User has responded to rates dialog
-**************************************************************************/
-static void rates_command_callback(GtkWidget *w, gint response_id)
-{
-  if (response_id == GTK_RESPONSE_OK) {
-    dsend_packet_player_rates(&client.conn, rates_tax_value, rates_lux_value,
-                              rates_sci_value);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(rates_dialog_shell));
-}
-
-/**********************************************************************//**
-  Convert real multiplier display value to scale value
-**************************************************************************/
-static int mult_to_scale(const struct multiplier *pmul, int val)
-{
-  return (val - pmul->start) / pmul->step;
-}
-
-/**********************************************************************//**
-  Convert scale units to real multiplier display value
-**************************************************************************/
-static int scale_to_mult(const struct multiplier *pmul, int scale)
-{
-  return scale * pmul->step + pmul->start;
-}
-
-/**********************************************************************//**
-  User has responded to multipliers dialog
-**************************************************************************/
-static void multipliers_command_callback(GtkWidget *w, gint response_id)
-{
-  struct packet_player_multiplier mul;
-
-  if (response_id == GTK_RESPONSE_OK && can_client_issue_orders()) {
-    multipliers_iterate(m) {
-      Multiplier_type_id i = multiplier_index(m);
-      int value = gtk_range_get_value(GTK_RANGE(multipliers_scale[i]));
-
-      mul.multipliers[i] = scale_to_mult(m, value);
-    } multipliers_iterate_end;
-    mul.count = multiplier_count();
-    send_packet_player_multiplier(&client.conn, &mul);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(multiplier_dialog_shell));
-}
-
-/**********************************************************************//**
-  Update values in multipliers dialog
-**************************************************************************/
-static void multiplier_dialog_update_values(bool set_positions)
-{
-  multipliers_iterate(pmul) {
-    Multiplier_type_id multiplier = multiplier_index(pmul);
-    int val = player_multiplier_value(client_player(), pmul);
-    int target = player_multiplier_target_value(client_player(), pmul);
-
-    fc_assert(multiplier < ARRAY_SIZE(multipliers_scale));
-    fc_assert(scale_to_mult(pmul, mult_to_scale(pmul, val)) == val);
-    fc_assert(scale_to_mult(pmul, mult_to_scale(pmul, target)) == target);
-
-    gtk_scale_clear_marks(GTK_SCALE(multipliers_scale[multiplier]));
-    gtk_scale_add_mark(GTK_SCALE(multipliers_scale[multiplier]),
-                       mult_to_scale(pmul, val), GTK_POS_BOTTOM,
-                       /* TRANS: current value of policy in force */
-                       Q_("?multiplier:Now"));
-
-    if (set_positions) {
-      gtk_range_set_value(GTK_RANGE(multipliers_scale[multiplier]),
-                          mult_to_scale(pmul, target));
-    }
-  } multipliers_iterate_end;
-}
-
-/**********************************************************************//**
-  Callback when server indicates multiplier values have changed
-**************************************************************************/
-void real_multipliers_dialog_update(void *unused)
-{
-  if (!multiplier_dialog_shell) {
-    return;
-  }
-
-  /* If dialog belongs to a player rather than an observer, we don't
-   * want to lose any local changes made by the player.
-   * This dialog should be the only way the values can change, anyway. */
-  multiplier_dialog_update_values(!can_client_issue_orders());
-}
-
-/**********************************************************************//**
-  Create multipliers dialog
-**************************************************************************/
-static GtkWidget *create_multiplier_dialog(void)
-{
-  GtkWidget *shell, *content;
-  GtkWidget *label, *scale;
-
-  if (can_client_issue_orders()) {
-    shell = gtk_dialog_new_with_buttons(_("Change policies"),
-                                        NULL,
-                                        0,
-                                        _("_Cancel"),
-                                        GTK_RESPONSE_CANCEL,
-                                        _("_OK"),
-                                        GTK_RESPONSE_OK,
-                                        NULL);
-  } else {
-    shell = gtk_dialog_new_with_buttons(_("Policies"),
-                                        NULL,
-                                        0,
-                                        _("_Close"),
-                                        GTK_RESPONSE_CLOSE,
-                                        NULL);
-  }
-  setup_dialog(shell, toplevel);
-
-  content = gtk_dialog_get_content_area(GTK_DIALOG(shell));
-
-  if (can_client_issue_orders()) {
-    label = gtk_label_new(_("Changes will not take effect until next turn."));
-    gtk_box_insert_child_after(GTK_BOX(content), label, NULL);
-  }
-
-  multipliers_iterate(pmul) {
-    Multiplier_type_id multiplier = multiplier_index(pmul);
-    int mscale;
-
-    fc_assert(multiplier < ARRAY_SIZE(multipliers_scale));
-    label = gtk_label_new(multiplier_name_translation(pmul));
-    /* Map each multiplier step to a single step on the UI, to enforce
-     * the step size. */
-    scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,
-                                     mult_to_scale(pmul, pmul->start),
-                                     mult_to_scale(pmul, pmul->stop), 1);
-    multipliers_scale[multiplier] = scale;
-    mscale = mult_to_scale(pmul, pmul->stop) / 10;
-    gtk_range_set_increments(GTK_RANGE(multipliers_scale[multiplier]),
-                             1, MAX(2, mscale));
-    g_signal_connect(multipliers_scale[multiplier], "destroy",
-                     G_CALLBACK(widget_destroyed),
-                     &multipliers_scale[multiplier]);
-    gtk_box_insert_child_after(GTK_BOX(content), label, NULL);
-    gtk_box_insert_child_after(GTK_BOX(content), scale, NULL);
-    gtk_widget_set_sensitive(multipliers_scale[multiplier],
-                             can_client_issue_orders()
-                             && multiplier_can_be_changed(pmul, client_player()));
-  } multipliers_iterate_end;
-
-  multiplier_dialog_update_values(TRUE);
-
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(widget_destroyed), &multiplier_dialog_shell);
-
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(multipliers_command_callback), nullptr);
-
-  gtk_widget_set_visible(content, TRUE);
-
-  return shell;
-}
-
-/**********************************************************************//**
-  Popup multipliers dialog
-**************************************************************************/
-void popup_multiplier_dialog(void)
-{
-  if (!multiplier_dialog_shell) {
-    multiplier_dialog_shell = create_multiplier_dialog();
-  }
-
-  if (!multiplier_dialog_shell) {
-    return;
-  }
-
-  gtk_window_present(GTK_WINDOW(multiplier_dialog_shell));
-}
-
-/**********************************************************************//**
-  Create rates dialog
-**************************************************************************/
-static GtkWidget *create_rates_dialog(void)
-{
-  GtkWidget *shell, *content;
-  GtkWidget *frame, *hbox;
-  int i;
-
-  if (!can_client_issue_orders()) {
-    return NULL;
-  }
-
-  shell = gtk_dialog_new_with_buttons(_("Select tax, luxury and science rates"),
-                                      NULL,
-                                      0,
-                                      _("_Cancel"),
-                                      GTK_RESPONSE_CANCEL,
-                                      _("_OK"),
-                                      GTK_RESPONSE_OK,
-                                      NULL);
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_OK);
-  content = gtk_dialog_get_content_area(GTK_DIALOG(shell));
-
-  rates_gov_label = gtk_label_new("");
-  gtk_box_insert_child_after(GTK_BOX(content), rates_gov_label, NULL);
-
-  frame = gtk_frame_new( _("Tax") );
-  gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
-  gtk_frame_set_child(GTK_FRAME(frame), hbox);
-
-  rates_tax_scale =
-    gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
-  gtk_range_set_increments(GTK_RANGE(rates_tax_scale), 1, 1);
-  for (i = 0; i <= 10; i++) {
-    gtk_scale_add_mark(GTK_SCALE(rates_tax_scale), i, GTK_POS_TOP, NULL);
-  }
-  gtk_widget_set_size_request(rates_tax_scale, 300, 40);
-  gtk_scale_set_digits(GTK_SCALE(rates_tax_scale), 0);
-  gtk_scale_set_draw_value(GTK_SCALE(rates_tax_scale), FALSE);
-  gtk_box_append(GTK_BOX(hbox), rates_tax_scale);
-
-  rates_tax_label = gtk_label_new("  0%");
-  gtk_box_append(GTK_BOX(hbox), rates_tax_label);
-  gtk_widget_set_size_request(rates_tax_label, 40, -1);
-
-  rates_tax_toggle = gtk_toggle_button_new_with_label( _("Lock") );
-  gtk_box_append(GTK_BOX(hbox), rates_tax_toggle);
-
-  frame = gtk_frame_new( _("Luxury") );
-  gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
-  gtk_frame_set_child(GTK_FRAME(frame), hbox);
-
-  rates_lux_scale =
-    gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
-  gtk_range_set_increments(GTK_RANGE(rates_lux_scale), 1, 1);
-  for (i = 0; i <= 10; i++) {
-    gtk_scale_add_mark(GTK_SCALE(rates_lux_scale), i, GTK_POS_TOP, NULL);
-  }
-  gtk_widget_set_size_request(rates_lux_scale, 300, 40);
-  gtk_scale_set_digits(GTK_SCALE(rates_lux_scale), 0);
-  gtk_scale_set_draw_value(GTK_SCALE(rates_lux_scale), FALSE);
-  gtk_box_append(GTK_BOX(hbox), rates_lux_scale);
-
-  rates_lux_label = gtk_label_new("  0%");
-  gtk_box_append(GTK_BOX(hbox), rates_lux_label);
-  gtk_widget_set_size_request(rates_lux_label, 40, -1);
-
-  rates_lux_toggle = gtk_toggle_button_new_with_label( _("Lock") );
-  gtk_box_append(GTK_BOX(hbox), rates_lux_toggle);
-
-  frame = gtk_frame_new( _("Science") );
-  gtk_box_insert_child_after(GTK_BOX(content), frame, NULL);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
-  gtk_frame_set_child(GTK_FRAME(frame), hbox);
-
-  rates_sci_scale =
-    gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
-  gtk_range_set_increments(GTK_RANGE(rates_sci_scale), 1, 1);
-  for (i = 0; i <= 10; i++) {
-    gtk_scale_add_mark(GTK_SCALE(rates_sci_scale), i, GTK_POS_TOP, NULL);
-  }
-  gtk_widget_set_size_request(rates_sci_scale, 300, 40);
-  gtk_scale_set_digits(GTK_SCALE(rates_sci_scale), 0);
-  gtk_scale_set_draw_value(GTK_SCALE(rates_sci_scale), FALSE);
-  gtk_box_append(GTK_BOX(hbox), rates_sci_scale);
-
-  rates_sci_label = gtk_label_new("  0%");
-  gtk_box_append(GTK_BOX(hbox), rates_sci_label);
-  gtk_widget_set_size_request(rates_sci_label, 40, -1);
-
-  rates_sci_toggle = gtk_toggle_button_new_with_label( _("Lock") );
-  gtk_box_append(GTK_BOX(hbox), rates_sci_toggle);
-
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(rates_command_callback), nullptr);
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(widget_destroyed), &rates_dialog_shell);
-
-  gtk_widget_set_visible(shell, TRUE);
-
-  rates_tax_value = -1;
-  rates_lux_value = -1;
-  rates_sci_value = -1;
-
-  rates_tax_sig =
-    g_signal_connect_after(rates_tax_scale, "value-changed",
-                           G_CALLBACK(rates_changed_callback), NULL);
-
-  rates_lux_sig =
-    g_signal_connect_after(rates_lux_scale, "value-changed",
-                           G_CALLBACK(rates_changed_callback), NULL);
-
-  rates_sci_sig =
-    g_signal_connect_after(rates_sci_scale, "value-changed",
-                           G_CALLBACK(rates_changed_callback), NULL);
-
-  rates_set_values(client.conn.playing->economic.tax, 0,
-                   client.conn.playing->economic.luxury, 0,
-                   client.conn.playing->economic.science, 0);
-
-  return shell;
-}
-
-/**********************************************************************//**
-  Popup rates dialog
-**************************************************************************/
-void popup_rates_dialog(void)
-{
-  if (!can_client_issue_orders()) {
-    return;
-  }
-
-  if (!rates_dialog_shell) {
-    rates_dialog_shell = create_rates_dialog();
-  }
-  if (!rates_dialog_shell) {
-    return;
-  }
-
-  gchar *buf = g_strdup_printf(_("%s max rate: %d%%"),
-      government_name_for_player(client.conn.playing),
-      get_player_bonus(client.conn.playing, EFT_MAX_RATES));
-  gtk_label_set_text(GTK_LABEL(rates_gov_label), buf);
-  g_free(buf);
-  gtk_range_set_fill_level(GTK_RANGE(rates_tax_scale),
-                           get_player_bonus(client.conn.playing,
-                                            EFT_MAX_RATES)/10);
-  gtk_range_set_fill_level(GTK_RANGE(rates_lux_scale),
-                           get_player_bonus(client.conn.playing,
-                                            EFT_MAX_RATES)/10);
-  gtk_range_set_fill_level(GTK_RANGE(rates_sci_scale),
-                           get_player_bonus(client.conn.playing,
-                                            EFT_MAX_RATES)/10);
-
-  gtk_window_present(GTK_WINDOW(rates_dialog_shell));
-}
diff --git a/client/gui-gtk-5.0/gamedlgs.h b/client/gui-gtk-5.0/gamedlgs.h
deleted file mode 100644
index 617df982a8..0000000000
--- a/client/gui-gtk-5.0/gamedlgs.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__GAMEDLGS_H
-#define FC__GAMEDLGS_H
-
-void popup_multiplier_dialog(void);
-
-#endif  /* FC__GAMEDLGS_H */
diff --git a/client/gui-gtk-5.0/gotodlg.c b/client/gui-gtk-5.0/gotodlg.c
deleted file mode 100644
index 249ab26168..0000000000
--- a/client/gui-gtk-5.0/gotodlg.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "astring.h"
-#include "fcintl.h"
-#include "log.h"
-#include "support.h"
-
-/* common */
-#include "game.h"
-#include "map.h"
-#include "packets.h"
-#include "player.h"
-#include "unit.h"
-#include "unitlist.h"
-
-/* client */
-#include "client_main.h"
-#include "control.h"
-#include "goto.h"
-#include "options.h"
-#include "text.h"
-
-/* clien/gui-gtk-5.0 */
-#include "plrdlg.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-
-#include "gotodlg.h"
-
-
-static GtkWidget *dshell = NULL;
-static GtkWidget *view;
-static GtkWidget *source;
-static GtkWidget *all_toggle;
-static GtkListStore *goto_list_store;
-static GtkTreeSelection *goto_list_selection;
-struct tile *original_tile;
-static bool gotodlg_updating = FALSE;
-
-static void update_goto_dialog(GtkCheckButton *button);
-static void update_source_label(void);
-static void refresh_airlift_column(void);
-static void refresh_airlift_button(void);
-static void goto_selection_callback(GtkTreeSelection *selection, gpointer data);
-
-static struct city *get_selected_city(void);
-
-enum {
-  CMD_AIRLIFT = 1, CMD_GOTO
-};
-
-enum {
-  GD_COL_CITY_ID = 0,   /* Not shown if not compiled with --enable-debug. */
-  GD_COL_CITY_NAME,
-  GD_COL_FLAG,
-  GD_COL_NATION,
-  GD_COL_AIRLIFT,
-
-  GD_COL_NUM
-};
-
-/**********************************************************************//**
-  User has responded to goto dialog
-**************************************************************************/
-static void goto_cmd_callback(GtkWidget *dlg, gint arg)
-{
-  switch (arg) {
-  case GTK_RESPONSE_CANCEL:
-    center_tile_mapcanvas(original_tile);
-    break;
-
-  case CMD_AIRLIFT:
-    {
-      struct city *pdestcity = get_selected_city();
-
-      if (pdestcity) {
-        unit_list_iterate(get_units_in_focus(), punit) {
-          if (unit_can_airlift_to(&(wld.map), punit, pdestcity)) {
-            request_unit_airlift(punit, pdestcity);
-          }
-        } unit_list_iterate_end;
-      }
-    }
-    break;
-
-  case CMD_GOTO:
-    {
-      struct city *pdestcity = get_selected_city();
-
-      if (pdestcity) {
-        unit_list_iterate(get_units_in_focus(), punit) {
-          send_goto_tile(punit, pdestcity->tile);
-        } unit_list_iterate_end;
-      }
-    }
-    break;
-
-  default:
-    break;
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-  dshell = NULL;
-}
-
-/**********************************************************************//**
-  Create goto -dialog for gotoing or airlifting unit
-**************************************************************************/
-static void create_goto_dialog(void)
-{
-  GtkWidget *sw, *label, *frame, *vbox;
-  GtkCellRenderer *rend;
-  GtkTreeViewColumn *col;
-
-  dshell = gtk_dialog_new_with_buttons(_("Goto/Airlift Unit"),
-                                       NULL,
-                                       0,
-                                       _("_Cancel"),
-                                       GTK_RESPONSE_CANCEL,
-                                       _("Air_lift"),
-                                       CMD_AIRLIFT,
-                                       _("_Goto"),
-                                       CMD_GOTO,
-                                       NULL);
-  setup_dialog(dshell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dshell), CMD_GOTO);
-  g_signal_connect(dshell, "destroy",
-                   G_CALLBACK(widget_destroyed), &dshell);
-  g_signal_connect(dshell, "response",
-                   G_CALLBACK(goto_cmd_callback), NULL);
-
-  source = gtk_label_new("" /* Filled in later */);
-  gtk_label_set_wrap(GTK_LABEL(source), TRUE);
-  gtk_label_set_justify(GTK_LABEL(source), GTK_JUSTIFY_CENTER);
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dshell))),
-                             source, NULL);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "label", _("Select destination ci_ty"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-  frame = gtk_frame_new("");
-  gtk_frame_set_label_widget(GTK_FRAME(frame), label);
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dshell))),
-                             frame, NULL);
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
-  gtk_frame_set_child(GTK_FRAME(frame), vbox);
-
-  goto_list_store = gtk_list_store_new(GD_COL_NUM, G_TYPE_INT, G_TYPE_STRING,
-                                       GDK_TYPE_PIXBUF, G_TYPE_STRING,
-                                       G_TYPE_STRING);
-  gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(goto_list_store),
-                                       GD_COL_CITY_NAME, GTK_SORT_ASCENDING);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(goto_list_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(goto_list_store);
-  goto_list_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
-  gtk_tree_view_set_search_column(GTK_TREE_VIEW(view), GD_COL_CITY_NAME);
-  gtk_tree_view_set_enable_search(GTK_TREE_VIEW(view), TRUE);
-
-  /* Set the mnemonic in the frame label to focus the city list */
-  gtk_label_set_mnemonic_widget(GTK_LABEL(label), view);
-
-#ifdef FREECIV_DEBUG
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(_("Id"), rend,
-    "text", GD_COL_CITY_ID, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_tree_view_column_set_sort_column_id(col, GD_COL_CITY_ID);
-#endif /* FREECIV_DEBUG */
-
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(_("City"), rend,
-    "text", GD_COL_CITY_NAME, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_tree_view_column_set_sort_column_id(col, GD_COL_CITY_NAME);
-
-  rend = gtk_cell_renderer_pixbuf_new();
-  col = gtk_tree_view_column_new_with_attributes(NULL, rend,
-    "pixbuf", GD_COL_FLAG, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(_("Nation"), rend,
-                                                 "text", GD_COL_NATION,
-                                                 NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_tree_view_column_set_sort_column_id(col, GD_COL_NATION);
-
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(_("Airlift"), rend,
-                                                 "text", GD_COL_AIRLIFT,
-                                                 NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_tree_view_column_set_sort_column_id(col, GD_COL_AIRLIFT);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 200);
-
-  gtk_box_append(GTK_BOX(vbox), sw);
-
-  all_toggle = gtk_check_button_new_with_mnemonic(_("Show _All Cities"));
-  gtk_box_append(GTK_BOX(vbox), all_toggle);
-
-  g_signal_connect(all_toggle, "toggled",
-                   G_CALLBACK(update_goto_dialog), NULL);
-
-  g_signal_connect(goto_list_selection, "changed",
-                   G_CALLBACK(goto_selection_callback), NULL);
-
-  gtk_widget_set_visible(dshell, TRUE);
-
-  original_tile = get_center_tile_mapcanvas();
-
-  update_source_label();
-  update_goto_dialog(GTK_CHECK_BUTTON(all_toggle));
-  gtk_tree_view_focus(GTK_TREE_VIEW(view));
-}
-
-/**********************************************************************//**
-  Popup the dialog
-**************************************************************************/
-void popup_goto_dialog(void)
-{
-  if (!can_client_issue_orders() || get_num_units_in_focus() == 0) {
-    return;
-  }
-
-  if (!dshell) {
-    create_goto_dialog();
-  }
-
-  gtk_window_present(GTK_WINDOW(dshell));
-}
-
-/**********************************************************************//**
-  Return currently selected city
-**************************************************************************/
-static struct city *get_selected_city(void)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  int city_id;
-
-  if (!gtk_tree_selection_get_selected(goto_list_selection, NULL, &it)) {
-    return NULL;
-  }
-
-  model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
-
-  gtk_tree_model_get(model, &it, GD_COL_CITY_ID, &city_id, -1);
-
-  return game_city_by_number(city_id);
-}
-
-/**********************************************************************//**
-  Appends the list of the city owned by the player in the goto dialog.
-**************************************************************************/
-static bool list_store_append_player_cities(GtkListStore *store,
-                                            const struct player *pplayer)
-{
-  GtkTreeIter it;
-  struct nation_type *pnation = nation_of_player(pplayer);
-  const char *nation = nation_adjective_translation(pnation);
-  GdkPixbuf *pixbuf;
-
-  if (city_list_size(pplayer->cities) == 0) {
-    return FALSE;
-  }
-
-  pixbuf = get_flag(pnation);
-
-  city_list_iterate(pplayer->cities, pcity) {
-    gtk_list_store_append(store, &it);
-    gtk_list_store_set(store, &it,
-                       GD_COL_CITY_ID, pcity->id,
-                       GD_COL_CITY_NAME, city_name_get(pcity),
-                       GD_COL_FLAG, pixbuf,
-                       GD_COL_NATION, nation,
-                       /* GD_COL_AIRLIFT is populated later */
-                       -1);
-  } city_list_iterate_end;
-  g_object_unref(pixbuf);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Refresh the label that shows where the selected unit(s) currently are
-  (and the relevant cities' airlift capacities, if relevant).
-**************************************************************************/
-static void update_source_label(void)
-{
-  /* Arbitrary limit to stop the label getting ridiculously long */
-  static const int max_cities = 10;
-  struct {
-    const struct city *city;
-    struct unit_list *units;
-  } cities[max_cities];
-  int ncities = 0;
-  bool too_many = FALSE;
-  bool no_city = FALSE; /* any units not in a city? */
-  struct astring strs[max_cities];
-  int nstrs;
-  char *last_str;
-  const char *descriptions[max_cities+1];
-  int i;
-
-  /* Sanity check: if no units selected, give up */
-  if (unit_list_size(get_units_in_focus()) == 0) {
-    gtk_label_set_text(GTK_LABEL(source), _("No units selected."));
-    return;
-  }
-
-  /* Divide selected units up into a list of unique cities */
-  unit_list_iterate(get_units_in_focus(), punit) {
-    const struct city *pcity = tile_city(unit_tile(punit));
-    if (pcity) {
-      /* Inefficient, but it's not a long list */
-      for (i = 0; i < ncities; i++) {
-        if (cities[i].city == pcity) {
-          unit_list_append(cities[i].units, punit);
-          break;
-        }
-      }
-      if (i == ncities) {
-        if (ncities < max_cities) {
-          cities[ncities].city = pcity;
-          cities[ncities].units = unit_list_new();
-          unit_list_append(cities[ncities].units, punit);
-          ncities++;
-        } else {
-          too_many = TRUE;
-          break;
-        }
-      }
-    } else {
-      no_city = TRUE;
-    }
-  } unit_list_iterate_end;
-
-  /* Describe the individual cities. */
-  for (i = 0; i < ncities; i++) {
-    const char *air_text = get_airlift_text(cities[i].units, NULL);
-
-    astr_init(&strs[i]);
-    if (air_text != NULL) {
-      astr_add(&strs[i],
-               /* TRANS: goto/airlift dialog. "Paris (airlift: 2/4)".
-                * A set of these appear in an "and"-separated list. */
-               _("%s (airlift: %s)"),
-               city_name_get(cities[i].city), air_text);
-    } else {
-      astr_add(&strs[i], "%s", city_name_get(cities[i].city));
-    }
-    descriptions[i] = astr_str(&strs[i]);
-    unit_list_destroy(cities[i].units);
-  }
-  if (too_many) {
-    /* TRANS: goto/airlift dialog. Too many cities to list, some omitted.
-     * Appears at the end of an "and"-separated list. */
-    descriptions[ncities] = last_str = fc_strdup(Q_("?gotodlg:more"));
-    nstrs = ncities+1;
-  } else if (no_city) {
-    /* TRANS: goto/airlift dialog. For units not currently in a city.
-     * Appears at the end of an "and"-separated list. */
-    descriptions[ncities] = last_str = fc_strdup(Q_("?gotodlg:no city"));
-    nstrs = ncities+1;
-  } else {
-    last_str = NULL;
-    nstrs = ncities;
-  }
-
-  /* Finally, update the label. */
-  {
-    struct astring label = ASTRING_INIT, list = ASTRING_INIT;
-    astr_set(&label,
-             /* TRANS: goto/airlift dialog. Current location of units; %s is an
-              * "and"-separated list of cities and associated info */
-             _("Currently in: %s"),
-             astr_build_and_list(&list, descriptions, nstrs));
-    astr_free(&list);
-    gtk_label_set_text(GTK_LABEL(source), astr_str(&label));
-    astr_free(&label);
-  }
-
-  /* Clear up. */
-  for (i = 0; i < ncities; i++) {
-    astr_free(&strs[i]);
-  }
-  free(last_str); /* might have been NULL */
-}
-
-/**********************************************************************//**
-  Refresh city list (in response to "all cities" checkbox changing).
-**************************************************************************/
-static void update_goto_dialog(GtkCheckButton *button)
-{
-  bool nonempty = FALSE;
-
-  if (!client_has_player()) {
-    /* Case global observer. */
-    return;
-  }
-
-  gotodlg_updating = TRUE;
-
-  gtk_list_store_clear(goto_list_store);
-
-  if (gtk_check_button_get_active(button)) {
-    players_iterate(pplayer) {
-      nonempty |= list_store_append_player_cities(goto_list_store, pplayer);
-    } players_iterate_end;
-  } else {
-    nonempty |= list_store_append_player_cities(goto_list_store, client_player());
-  }
-
-  gotodlg_updating = FALSE;
-
-  refresh_airlift_column();
-
-  if (!nonempty) {
-    /* No selection causes callbacks to fire, causing also Airlift button
-     * to update. Do it here. */
-    refresh_airlift_button();
-  }
-}
-
-/**********************************************************************//**
-  Refresh airlift column in city list (without tearing everything down).
-**************************************************************************/
-static void refresh_airlift_column(void)
-{
-  GtkTreeIter iter;
-  bool valid;
-
-  valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(goto_list_store), &iter);
-  while (valid) {
-    int city_id;
-    const struct city *pcity;
-    const char *air_text;
-
-    gtk_tree_model_get(GTK_TREE_MODEL(goto_list_store), &iter,
-                       GD_COL_CITY_ID, &city_id, -1);
-    pcity = game_city_by_number(city_id);
-    fc_assert_ret(pcity != NULL);
-    air_text = get_airlift_text(get_units_in_focus(), pcity);
-    gtk_list_store_set(GTK_LIST_STORE(goto_list_store), &iter,
-                       GD_COL_AIRLIFT, air_text ? air_text : "-", -1);
-    valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(goto_list_store), &iter);
-  }
-}
-
-/**********************************************************************//**
-  Refresh the state of the "Airlift" button for the currently selected
-  unit(s) and city.
-**************************************************************************/
-static void refresh_airlift_button(void)
-{
-  struct city *pdestcity = get_selected_city();
-
-  if (NULL != pdestcity) {
-    bool can_airlift = FALSE;
-
-    /* Allow action if any of the selected units can airlift. */
-    unit_list_iterate(get_units_in_focus(), punit) {
-      if (unit_can_airlift_to(&(wld.map), punit, pdestcity)) {
-        can_airlift = TRUE;
-        break;
-      }
-    } unit_list_iterate_end;
-
-    if (can_airlift) {
-      gtk_dialog_set_response_sensitive(GTK_DIALOG(dshell),
-                                        CMD_AIRLIFT, TRUE);
-      return;
-    }
-  }
-  gtk_dialog_set_response_sensitive(GTK_DIALOG(dshell), CMD_AIRLIFT, FALSE);
-}
-
-/**********************************************************************//**
-  Update goto dialog. button tells if cities of all players or just
-  client's player should be listed.
-**************************************************************************/
-static void goto_selection_callback(GtkTreeSelection *selection,
-                                    gpointer data)
-{
-  struct city *pdestcity;
-
-  if (gotodlg_updating) {
-    return;
-  }
-
-  pdestcity = get_selected_city();
-
-  if (NULL != pdestcity) {
-    center_tile_mapcanvas(city_tile(pdestcity));
-  }
-  refresh_airlift_button();
-}
-
-/**********************************************************************//**
-  Called when the set of units in focus has changed; updates airlift info
-**************************************************************************/
-void goto_dialog_focus_units_changed(void)
-{
-  /* Is the dialog currently being displayed? */
-  if (dshell) {
-    /* Location of current units and ability to airlift may have changed */
-    update_source_label();
-    refresh_airlift_column();
-    refresh_airlift_button();
-  }
-}
diff --git a/client/gui-gtk-5.0/gotodlg.h b/client/gui-gtk-5.0/gotodlg.h
deleted file mode 100644
index 403b635e33..0000000000
--- a/client/gui-gtk-5.0/gotodlg.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__GOTODLG_H
-#define FC__GOTODLG_H
-
-/* include */
-#include "gotodlg_g.h"
-
-void goto_dialog_focus_units_changed(void);
-
-#endif  /* FC__GOTODLG_H */
diff --git a/client/gui-gtk-5.0/graphics.c b/client/gui-gtk-5.0/graphics.c
deleted file mode 100644
index ff9016069e..0000000000
--- a/client/gui-gtk-5.0/graphics.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "game.h"
-#include "movement.h"
-#include "unit.h"
-#include "version.h"
-
-/* client */
-#include "climisc.h"
-#include "colors.h"
-#include "mapview_g.h"
-#include "options.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-
-#include "graphics.h"
-
-GdkCursor *fc_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES];
-
-/***********************************************************************//**
-  Loading tileset of the specified type
-***************************************************************************/
-void tileset_type_set(enum ts_type type)
-{
-}
-
-#define COLOR_MOTTO_FACE_R    0x2D
-#define COLOR_MOTTO_FACE_G    0x71
-#define COLOR_MOTTO_FACE_B    0xE3
-
-/***********************************************************************//**
-  Load cursor sprites
-***************************************************************************/
-void load_cursors(void)
-{
-  enum cursor_type cursor;
-  int frame;
-
-  for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
-    for (frame = 0; frame < NUM_CURSOR_FRAMES; frame++) {
-      int hot_x, hot_y;
-      struct sprite *sprite
-        = get_cursor_sprite(tileset, cursor, &hot_x, &hot_y, frame);
-      GdkPixbuf *pixbuf = sprite_get_pixbuf(sprite);
-      GdkTexture *texture = gdk_texture_new_for_pixbuf(pixbuf);
-
-      fc_cursors[cursor][frame] = gdk_cursor_new_from_texture(texture, hot_x, hot_y, NULL);
-      g_object_unref(texture);
-      g_object_unref(G_OBJECT(pixbuf));
-    }
-  }
-}
diff --git a/client/gui-gtk-5.0/graphics.h b/client/gui-gtk-5.0/graphics.h
deleted file mode 100644
index a3c0a03633..0000000000
--- a/client/gui-gtk-5.0/graphics.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__GRAPHICS_H
-#define FC__GRAPHICS_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "graphics_g.h"
-#include "mapview_common.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "sprite.h"
-
-extern struct sprite *intro_gfx_sprite;
-
-/* This name is to avoid a naming conflict with a global 'cursors'
- * variable in GTK+-2.6. See PR#12459. */
-extern GdkCursor *fc_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES];
-
-#endif /* FC__GRAPHICS_H */
diff --git a/client/gui-gtk-5.0/gui_main.c b/client/gui-gtk-5.0/gui_main.c
deleted file mode 100644
index f313805b0a..0000000000
--- a/client/gui-gtk-5.0/gui_main.c
+++ /dev/null
@@ -1,2748 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#ifdef AUDIO_SDL
-/* Though it would happily compile without this include,
- * it is needed for sound to work.
- * It defines "main" macro to rename our main() so that
- * it can install SDL's own. */
-#ifdef SDL2_PLAIN_INCLUDE
-#include <SDL.h>
-#else  /* PLAIN_INCLUDE */
-#include <SDL2/SDL.h>
-#endif /* PLAIN_INCLUDE */
-#endif /* AUDIO_SDL */
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fc_cmdline.h"
-#include "fciconv.h"
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* common */
-#include "dataio.h"
-#include "featured_text.h"
-#include "game.h"
-#include "government.h"
-#include "map.h"
-#include "unitlist.h"
-#include "version.h"
-
-/* client */
-#include "audio.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "clinet.h"
-#include "colors.h"
-#include "connectdlg_common.h"
-#include "control.h"
-#include "editor.h"
-#include "gui_properties.h"
-#include "options.h"
-#include "text.h"
-#include "tilespec.h"
-#include "zoom.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "citizensinfo.h"
-#include "connectdlg.h"
-#include "cma_fe.h"
-#include "dialogs.h"
-#include "diplodlg.h"
-#include "editgui.h"
-#include "gotodlg.h"
-#include "graphics.h"
-#include "gui_stuff.h"
-#include "happiness.h"
-#include "helpdlg.h"
-#include "inteldlg.h"
-#include "mapctrl.h"
-#include "mapview.h"
-#include "menu.h"
-#include "messagewin.h"
-#include "optiondlg.h"
-#include "pages.h"
-#include "plrdlg.h"
-#include "luaconsole.h"
-#include "spaceshipdlg.h"
-#include "repodlgs.h"
-#include "voteinfo_bar.h"
-
-#include "gui_main.h"
-
-const char *client_string = GUI_NAME_FULL;
-
-GtkWidget *map_canvas;                  /* GtkDrawingArea */
-GtkWidget *map_horizontal_scrollbar;
-GtkWidget *map_vertical_scrollbar;
-
-GtkWidget *overview_canvas;             /* GtkDrawingArea */
-GtkWidget *overview_scrolled_window;    /* GtkScrolledWindow */
-/* The two values below define the width and height of the map overview. The
- * first set of values (2*62, 2*46) define the size for a netbook display. For
- * bigger displays the values are doubled (default). */
-#define OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK  (2 * 64)
-#define OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK (2 * 46)
-#define OVERVIEW_CANVAS_STORE_WIDTH \
-  (2 * OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK)
-#define OVERVIEW_CANVAS_STORE_HEIGHT \
-  (2 * OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK)
-int overview_canvas_store_width = OVERVIEW_CANVAS_STORE_WIDTH;
-int overview_canvas_store_height = OVERVIEW_CANVAS_STORE_HEIGHT;
-
-GtkWidget *toplevel;
-GtkWidget *toplevel_tabs;
-GtkWidget *top_vbox;
-GtkWidget *top_notebook, *bottom_notebook, *right_notebook;
-GtkWidget *map_widget;
-static GtkWidget *bottom_hpaned;
-
-PangoFontDescription *city_names_style = NULL;
-PangoFontDescription *city_productions_style = NULL;
-PangoFontDescription *reqtree_text_style = NULL;
-
-GtkWidget *main_frame_civ_name;
-GtkWidget *main_label_info;
-
-GtkWidget *avbox, *ahbox, *conn_box;
-GtkWidget* scroll_panel;
-
-GtkWidget *econ_label[10];
-GtkWidget *bulb_label;
-GtkWidget *sun_label;
-GtkWidget *flake_label;
-GtkWidget *government_label;
-GtkWidget *timeout_label;
-GtkWidget *turn_done_button;
-
-GtkWidget *unit_info_label;
-GtkWidget *unit_info_box;
-GtkWidget *unit_info_frame;
-
-GtkWidget *econ_widget;
-
-const char *const gui_character_encoding = "UTF-8";
-const bool gui_use_transliteration = FALSE;
-
-static GdkPaintable *empty_unit_paintable = NULL;
-static GtkWidget *unit_pic_table;
-static GtkWidget *unit_pic;
-static GtkWidget *unit_below_pic[MAX_NUM_UNITS_BELOW];
-static GtkWidget *more_arrow;
-static GtkWidget *more_arrow_container;
-
-static int unit_id_top;
-static int unit_ids[MAX_NUM_UNITS_BELOW];  /* ids of the units icons in
-                                            * information display: (or 0) */
-GtkTextView *main_message_area;
-GtkTextBuffer *message_buffer = NULL;
-static GtkWidget *allied_chat_toggle_button;
-
-static gint timer_id;                               /*       Ditto        */
-static GIOChannel *srv_channel;
-static guint srv_id;
-gint cur_x, cur_y;
-
-static bool gui_up = FALSE;
-
-static bool audio_paused = FALSE;
-static bool client_focus = TRUE;
-
-static GtkApplication *fc_app;
-static GtkAlertDialog *quit_dialog = NULL;
-
-static struct video_mode vmode = { -1, -1 };
-
-static void set_g_log_callbacks(void);
-
-static gboolean show_info_popup(GtkGestureClick *gesture, int n_press,
-                                double x, double y, gpointer data);
-
-static void end_turn_callback(GtkWidget *w, gpointer data);
-static gboolean get_net_input(GIOChannel *source, GIOCondition condition,
-                              gpointer data);
-static void set_wait_for_writable_socket(struct connection *pc,
-                                         bool socket_writable);
-
-static void print_usage(void);
-static void activate_gui(GtkApplication *app, gpointer data);
-static bool parse_options(int argc, char **argv);
-static gboolean toplevel_key_press_handler(GtkEventControllerKey *controller,
-                                           guint keyval,
-                                           guint keycode,
-                                           GdkModifierType state,
-                                           gpointer data);
-static gboolean mouse_scroll_mapcanvas(GtkEventControllerScroll *controller,
-                                       gdouble dx, gdouble dy,
-                                       gpointer data);
-
-static void tearoff_callback(GtkWidget *b, gpointer data);
-static GtkWidget *detached_widget_new(void);
-static GtkWidget *detached_widget_fill(GtkWidget *tearbox);
-
-static gboolean select_unit_pic_callback(GtkGestureClick *gesture, int n_press,
-                                         double x, double y, gpointer data);
-static gboolean select_more_arrow_callback(GtkGestureClick *gesture, int n_press,
-                                         double x, double y, gpointer data);
-static gboolean quit_dialog_callback(void);
-
-static void allied_chat_button_toggled(GtkToggleButton *button,
-                                       gpointer user_data);
-
-static void free_unit_table(void);
-
-static void adjust_default_options(void);
-
-static float zoom_steps_custom[] = {
-  -1.0, 0.13, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 4.0, -1.0
-};
-
-/**********************************************************************//**
-  Callback for freelog
-**************************************************************************/
-static void log_callback_utf8(enum log_level level, const char *message,
-                              bool file_too)
-{
-  if (!file_too || level <= LOG_FATAL) {
-    fc_fprintf(stderr, "%d: %s\n", level, message);
-  }
-}
-
-/**********************************************************************//**
-  Called while in gtk_main() (which is all of the time)
-  TIMER_INTERVAL is now set by real_timer_callback()
-**************************************************************************/
-static gboolean timer_callback(gpointer data)
-{
-  double seconds = real_timer_callback();
-
-  if (gui_options.silent_when_not_in_focus) {
-    if (!audio_paused && !client_focus) {
-      audio_pause();
-      audio_paused = TRUE;
-    } else if (audio_paused && client_focus) {
-      audio_resume();
-      audio_paused = FALSE;
-    }
-  }
-
-  timer_id = g_timeout_add(seconds * 1000, timer_callback, NULL);
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Print extra usage information, including one line help on each option,
-  to stderr.
-**************************************************************************/
-static void print_usage(void)
-{
-  /* Add client-specific usage information here */
-  fc_fprintf(stderr,
-             _("gtk4x-client gui-specific options are:\n"));
-
-  fc_fprintf(stderr,
-             _("-r, --resolution WIDTHxHEIGHT\tAssume given resolution "
-               "screen\n"));
-  fc_fprintf(stderr,
-             /* TRANS: Keep word 'default' untranslated */
-             _("-z, --zoom LEVEL\tSet zoom level; use value 'default' "
-               "to reset\n\n"));
-
-  /* TRANS: No full stop after the URL, could cause confusion. */
-  fc_fprintf(stderr, _("Report bugs at %s\n"), BUG_URL);
-}
-
-/**********************************************************************//**
-  Search for gui-specific command line options.
-**************************************************************************/
-static bool parse_options(int argc, char **argv)
-{
-  int i = 1;
-
-  while (i < argc) {
-    char *option = NULL;
-
-    if (is_option("--help", argv[i])) {
-      print_usage();
-
-      return FALSE;
-    } else if ((option = get_option_malloc("--zoom", argv, &i, argc, FALSE))) {
-      char *endptr;
-
-      if (strcmp("default", option)) {
-        gui_options.zoom_set = TRUE;
-        gui_options.zoom_default_level = strtof(option, &endptr);
-      } else {
-        gui_options.zoom_set = FALSE;
-      }
-      free(option);
-    } else if ((option = get_option_malloc("--resolution", argv, &i, argc, FALSE))) {
-      if (!string_to_video_mode(option, &vmode)) {
-        fc_fprintf(stderr, _("Illegal video mode '%s'\n"), option);
-        exit(EXIT_FAILURE);
-      }
-      free(option);
-    } else {
-      fc_fprintf(stderr, _("Unknown command-line option \"%s\".\n"),
-                 argv[i]);
-      exit(EXIT_FAILURE);
-    }
-
-    i++;
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Focus on widget. Returns whether focus was really changed.
-**************************************************************************/
-static void toplevel_focus(GtkWidget *w, GtkDirectionType arg,
-                           gpointer data)
-{
-  switch (arg) {
-    case GTK_DIR_TAB_FORWARD:
-    case GTK_DIR_TAB_BACKWARD:
-
-      if (!gtk_widget_get_can_focus(w)) {
-        return;
-      }
-
-      if (!gtk_widget_is_focus(w)) {
-        gtk_widget_grab_focus(w);
-        return;
-      }
-      break;
-
-    default:
-      break;
-  }
-}
-
-/**********************************************************************//**
-  When the chatline text view is resized, scroll it to the bottom. This
-  prevents users from accidentally missing messages when the chatline
-  gets scrolled up a small amount and stops scrolling down automatically.
-**************************************************************************/
-void main_message_area_resize(void *data)
-{
-  if (get_current_client_page() == PAGE_GAME) {
-    static int old_width = 0, old_height = 0;
-    int width = gtk_widget_get_width(GTK_WIDGET(main_message_area));
-    int height = gtk_widget_get_height(GTK_WIDGET(main_message_area));
-
-    if (width != old_width
-        || height != old_height) {
-      chatline_scroll_to_bottom(TRUE);
-      old_width = width;
-      old_height = height;
-    }
-
-    add_idle_callback(main_message_area_resize, NULL);
-  }
-}
-
-/**********************************************************************//**
-  Focus on map canvas
-**************************************************************************/
-gboolean map_canvas_focus(void)
-{
-  gtk_window_present(GTK_WINDOW(toplevel));
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(top_notebook), 0);
-  gtk_widget_grab_focus(map_canvas);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Handle keypress events when map canvas is in focus
-**************************************************************************/
-static gboolean key_press_map_canvas(guint keyval, GdkModifierType state)
-{
-  if ((state & GDK_SHIFT_MASK)) {
-    switch (keyval) {
-
-    case GDK_KEY_Left:
-      scroll_mapview(DIR8_WEST);
-      return TRUE;
-
-    case GDK_KEY_Right:
-      scroll_mapview(DIR8_EAST);
-      return TRUE;
-
-    case GDK_KEY_Up:
-      scroll_mapview(DIR8_NORTH);
-      return TRUE;
-
-    case GDK_KEY_Down:
-      scroll_mapview(DIR8_SOUTH);
-      return TRUE;
-
-    case GDK_KEY_Home:
-      key_center_capital();
-      return TRUE;
-
-    case GDK_KEY_Page_Up:
-      g_signal_emit_by_name(main_message_area, "move_cursor",
-                            GTK_MOVEMENT_PAGES, -1, FALSE);
-      return TRUE;
-
-    case GDK_KEY_Page_Down:
-      g_signal_emit_by_name(main_message_area, "move_cursor",
-                            GTK_MOVEMENT_PAGES, 1, FALSE);
-      return TRUE;
-
-    default:
-      break;
-    }
-  } else if (!(state & GDK_CONTROL_MASK)) {
-    switch (keyval) {
-    default:
-      break;
-    }
-  }
-
-  if (state & GDK_SHIFT_MASK) {
-    bool volchange = FALSE;
-
-    switch (keyval) {
-    case GDK_KEY_plus:
-    case GDK_KEY_KP_Add:
-      gui_options.sound_effects_volume += 10;
-      volchange = TRUE;
-      break;
-
-    case GDK_KEY_minus:
-    case GDK_KEY_KP_Subtract:
-      gui_options.sound_effects_volume -= 10;
-      volchange = TRUE;
-      break;
-
-    default:
-      break;
-    }
-
-    if (volchange) {
-      struct option *poption = optset_option_by_name(client_optset,
-                                                     "sound_effects_volume");
-
-      gui_options.sound_effects_volume = CLIP(0,
-                                              gui_options.sound_effects_volume,
-                                              100);
-      option_changed(poption);
-
-      return TRUE;
-    }
-  } else if (!(state & GDK_CONTROL_MASK)) {
-    switch (keyval) {
-    case GDK_KEY_plus:
-    case GDK_KEY_KP_Add:
-      zoom_step_up();
-      return TRUE;
-
-    case GDK_KEY_minus:
-    case GDK_KEY_KP_Subtract:
-      zoom_step_down();
-      return TRUE;
-
-    default:
-      break;
-    }
-  }
-
-  /* Return here if observer */
-  if (client_is_observer()) {
-    return FALSE;
-  }
-
-  switch (keyval) {
-
-  case GDK_KEY_KP_Up:
-  case GDK_KEY_KP_8:
-  case GDK_KEY_Up:
-  case GDK_KEY_8:
-    key_unit_move(DIR8_NORTH);
-    return TRUE;
-
-  case GDK_KEY_KP_Page_Up:
-  case GDK_KEY_KP_9:
-  case GDK_KEY_Page_Up:
-  case GDK_KEY_9:
-    key_unit_move(DIR8_NORTHEAST);
-    return TRUE;
-
-  case GDK_KEY_KP_Right:
-  case GDK_KEY_KP_6:
-  case GDK_KEY_Right:
-  case GDK_KEY_6:
-    key_unit_move(DIR8_EAST);
-    return TRUE;
-
-  case GDK_KEY_KP_Page_Down:
-  case GDK_KEY_KP_3:
-  case GDK_KEY_Page_Down:
-  case GDK_KEY_3:
-    key_unit_move(DIR8_SOUTHEAST);
-    return TRUE;
-
-  case GDK_KEY_KP_Down:
-  case GDK_KEY_KP_2:
-  case GDK_KEY_Down:
-  case GDK_KEY_2:
-    key_unit_move(DIR8_SOUTH);
-    return TRUE;
-
-  case GDK_KEY_KP_End:
-  case GDK_KEY_KP_1:
-  case GDK_KEY_End:
-  case GDK_KEY_1:
-    key_unit_move(DIR8_SOUTHWEST);
-    return TRUE;
-
-  case GDK_KEY_KP_Left:
-  case GDK_KEY_KP_4:
-  case GDK_KEY_Left:
-  case GDK_KEY_4:
-    key_unit_move(DIR8_WEST);
-    return TRUE;
-
-  case GDK_KEY_KP_Home:
-  case GDK_KEY_KP_7:
-  case GDK_KEY_Home:
-  case GDK_KEY_7:
-    key_unit_move(DIR8_NORTHWEST);
-    return TRUE;
-
-  case GDK_KEY_KP_Begin:
-  case GDK_KEY_KP_5:
-  case GDK_KEY_5:
-    key_recall_previous_focus_unit();
-    return TRUE;
-
-  case GDK_KEY_Escape:
-    key_cancel_action();
-    return TRUE;
-
-  case GDK_KEY_b:
-    if (tiles_hilited_cities) {
-      buy_production_in_selected_cities();
-      return TRUE;
-    }
-    break;
-
-  default:
-    break;
-  };
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Handle a keyboard key press made in the client's toplevel window.
-**************************************************************************/
-static gboolean toplevel_key_press_handler(GtkEventControllerKey *controller,
-                                           guint keyval,
-                                           guint keycode,
-                                           GdkModifierType state,
-                                           gpointer data)
-{
-  if (inputline_has_focus()) {
-    return FALSE;
-  }
-
-  if (keyval == GDK_KEY_apostrophe) {
-    /* Allow this even if not in main map view; chatline is present on
-     * some other pages too */
-
-    /* Make the chatline visible if it's not currently.
-     * FIXME: should find the correct window, even when detached, from any
-     * other window; should scroll to the bottom automatically showing the
-     * latest text from other players; MUST NOT make spurious text windows
-     * at the bottom of other dialogs. */
-    if (gtk_widget_get_mapped(top_vbox)) {
-      /* The main game view is visible. May need to switch notebook. */
-      if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) {
-        gtk_notebook_set_current_page(GTK_NOTEBOOK(top_notebook), 1);
-      } else {
-        gtk_notebook_set_current_page(GTK_NOTEBOOK(bottom_notebook), 0);
-      }
-    }
-
-    /* If the chatline is (now) visible, focus it. */
-    if (inputline_is_visible()) {
-      inputline_grab_focus();
-      return TRUE;
-    }
-  }
-
-  if (!gtk_widget_get_mapped(top_vbox)
-      || !can_client_change_view()) {
-    return FALSE;
-  }
-
-  if (editor_is_active()) {
-    if (handle_edit_key_press(keyval, state)) {
-      return TRUE;
-    }
-  }
-
-  if (state & GDK_SHIFT_MASK) {
-    switch (keyval) {
-
-    case GDK_KEY_Return:
-    case GDK_KEY_KP_Enter:
-      key_end_turn();
-      return TRUE;
-
-    default:
-      break;
-    }
-  }
-
-  if (0 == gtk_notebook_get_current_page(GTK_NOTEBOOK(top_notebook))) {
-    /* 0 means the map view is focused. */
-    return key_press_map_canvas(keyval, state);
-  }
-
-#if 0
-  /* We are focused some other dialog, tab, or widget. */
-  if ((state & GDK_CONTROL_MASK)) {
-  } else if ((state & GDK_SHIFT_MASK)) {
-  } else {
-    switch (keyval) {
-
-    case GDK_KEY_F4:
-      map_canvas_focus();
-      return TRUE;
-
-    default:
-      break;
-    };
-  }
-#endif /* 0 */
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Mouse/touchpad scrolling over the mapview
-**************************************************************************/
-static gboolean mouse_scroll_mapcanvas(GtkEventControllerScroll *controller,
-                                       gdouble dx, gdouble dy,
-                                       gpointer data)
-{
-  int scroll_x, scroll_y, xstep, ystep;
-  gdouble e_x, e_y;
-  GdkModifierType state;
-
-  if (!can_client_change_view()) {
-    return FALSE;
-  }
-
-  get_mapview_scroll_pos(&scroll_x, &scroll_y);
-  get_mapview_scroll_step(&xstep, &ystep);
-
-  scroll_y += ystep * dy;
-  scroll_x += xstep * dx;
-
-  set_mapview_scroll_pos(scroll_x, scroll_y, mouse_zoom);
-
-  /* Emulating mouse move now */
-  if (!gtk_widget_has_focus(map_canvas)) {
-    gtk_widget_grab_focus(map_canvas);
-  }
-
-  gdk_event_get_position(gtk_event_controller_get_current_event(
-                                      GTK_EVENT_CONTROLLER(controller)),
-                         &e_x, &e_y);
-  update_line(e_x, e_y);
-  state = gtk_event_controller_get_current_event_state(
-                                      GTK_EVENT_CONTROLLER(controller));
-  if (rbutton_down && (state & GDK_BUTTON3_MASK)) {
-    update_selection_rectangle(e_x, e_y);
-  }
-
-  if (keyboardless_goto_button_down && hover_state == HOVER_NONE) {
-    maybe_activate_keyboardless_goto(cur_x, cur_y);
-  }
-
-  control_mouse_cursor(canvas_pos_to_tile(cur_x, cur_y, mouse_zoom));
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Move widget from parent to parent
-**************************************************************************/
-static void move_from_container_to_container(GtkWidget *wdg,
-                                             GtkWidget *old_wdg,
-                                             GtkWidget *new_wdg)
-{
-  g_object_ref(wdg); /* Make sure reference count stays above 0
-                      * during the transition to new parent. */
-
-  if (GTK_IS_PANED(old_wdg)) {
-    gtk_paned_set_end_child(GTK_PANED(old_wdg), NULL);
-  } else if (GTK_IS_WINDOW(old_wdg)) {
-    gtk_window_set_child(GTK_WINDOW(old_wdg), NULL);
-  } else {
-    fc_assert(GTK_IS_BOX(old_wdg));
-
-    gtk_box_remove(GTK_BOX(old_wdg), wdg);
-  }
-
-  if (GTK_IS_PANED(new_wdg)) {
-    gtk_paned_set_end_child(GTK_PANED(new_wdg), wdg);
-  } else if (GTK_IS_WINDOW(new_wdg)) {
-    gtk_window_set_child(GTK_WINDOW(new_wdg), wdg);
-  } else {
-    fc_assert(GTK_IS_BOX(new_wdg));
-
-    gtk_box_append(GTK_BOX(new_wdg), wdg);
-  }
-
-  g_object_unref(wdg);
-}
-
-/**********************************************************************//**
-  Freeciv window has lost focus
-**************************************************************************/
-gboolean fc_lost_focus(GtkEventControllerFocus *controller,
-                       gpointer data)
-{
-  client_focus = FALSE;
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Freeciv window has gained focus
-**************************************************************************/
-gboolean fc_gained_focus(GtkEventControllerFocus *controller,
-                         gpointer data)
-{
-  client_focus = TRUE;
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Reattach tearoff to its normal parent and destroy the detach window.
-**************************************************************************/
-static void tearoff_reattach(GtkWidget *box)
-{
-  GtkWidget *aparent, *cparent;
-
-  aparent = g_object_get_data(G_OBJECT(box), "aparent");
-  cparent = gtk_widget_get_parent(box);
-
-  if (aparent != cparent) {
-    move_from_container_to_container(box, cparent, aparent);
-
-    gtk_window_destroy(GTK_WINDOW(cparent));
-  }
-}
-
-/**********************************************************************//**
-  User requested close of the detach window.
-**************************************************************************/
-static void tearoff_close(GtkWidget *w, gpointer data)
-{
-  tearoff_reattach(GTK_WIDGET(data));
-}
-
-/**********************************************************************//**
-  Callback for the toggle button in the detachable widget: causes the
-  widget to detach or reattach.
-**************************************************************************/
-static void tearoff_callback(GtkWidget *b, gpointer data)
-{
-  GtkWidget *box = GTK_WIDGET(data);
-  GtkWidget *old_parent = gtk_widget_get_parent(box);
-
-  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(b))) {
-    GtkWidget *w;
-    GtkWidget *temp_hide;
-
-    w = gtk_window_new();
-    setup_dialog(w, toplevel);
-    gtk_widget_set_name(w, "Freeciv");
-    gtk_window_set_title(GTK_WINDOW(w), _("Freeciv"));
-    g_signal_connect(w, "close-request", G_CALLBACK(tearoff_close), box);
-
-    g_object_set_data(G_OBJECT(box), "aparent", gtk_widget_get_parent(box));
-
-    temp_hide = g_object_get_data(G_OBJECT(box), "hide-over-reparent");
-    if (temp_hide != nullptr) {
-      gtk_widget_set_visible(temp_hide, FALSE);
-    }
-
-    move_from_container_to_container(box, old_parent, w);
-
-    gtk_widget_set_visible(w, TRUE);
-
-    if (temp_hide != nullptr) {
-      gtk_widget_set_visible(temp_hide, TRUE);
-    }
-  } else {
-    tearoff_reattach(box);
-  }
-}
-
-/**********************************************************************//**
-  Create the container for the widget that's able to be detached.
-**************************************************************************/
-static GtkWidget *detached_widget_new(void)
-{
-  GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-
-  return hbox;
-}
-
-/**********************************************************************//**
-  Creates the toggle button necessary to detach and reattach the widget
-  and returns a vbox in which you fill your goodies.
-**************************************************************************/
-static GtkWidget *detached_widget_fill(GtkWidget *tearbox)
-{
-  GtkWidget *b, *fillbox;
-  static GtkCssProvider *detach_button_provider = NULL;
-
-  if (detach_button_provider == NULL) {
-    detach_button_provider = gtk_css_provider_new();
-
-    /* These toggle buttons run vertically down the side of many UI
-     * elements, so they need to be thin horizontally. */
-    gtk_css_provider_load_from_data(detach_button_provider,
-                                    ".detach_button {\n"
-                                    "  padding: 0px 0px 0px 0px;\n"
-                                    "  min-width: 6px;\n"
-                                    "}",
-                                    -1);
-  }
-
-  b = gtk_toggle_button_new();
-  gtk_style_context_add_provider_for_display(
-                                 gtk_widget_get_display(toplevel),
-                                 GTK_STYLE_PROVIDER(detach_button_provider),
-                                 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  gtk_widget_add_css_class(b, "detach_button");
-  gtk_widget_set_tooltip_text(b, _("Detach/Attach the pane."));
-
-  gtk_box_append(GTK_BOX(tearbox), b);
-  g_signal_connect(b, "toggled", G_CALLBACK(tearoff_callback), tearbox);
-
-  fillbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-
-  gtk_box_append(GTK_BOX(tearbox), fillbox);
-
-  return fillbox;
-}
-
-/**********************************************************************//**
-  Called to build the unit_below pixmap table. This is the table on the
-  left of the screen that shows all of the inactive units in the current
-  tile.
-
-  It may be called again if the tileset changes.
-**************************************************************************/
-static void populate_unit_pic_table(void)
-{
-  int i, width;
-  GtkWidget *table = unit_pic_table;
-  GdkPixbuf *pix;
-  int ttw;
-  GtkEventController *controller;
-
-  /* Get width of the overview window */
-  width = (overview_canvas_store_width > GUI_GTK_OVERVIEW_MIN_XSIZE)
-    ? overview_canvas_store_width
-    : GUI_GTK_OVERVIEW_MIN_XSIZE;
-
-  ttw = tileset_tile_width(tileset);
-
-  if (GUI_GTK_OPTION(small_display_layout)) {
-    /* We want arrow to appear if there is other units in addition
-       to active one in tile. Active unit is not counted, so there
-       can be 0 other units to not to display arrow. */
-    num_units_below = 1 - 1;
-  } else {
-    num_units_below = width / ttw;
-    num_units_below = CLIP(1, num_units_below, MAX_NUM_UNITS_BELOW);
-  }
-
-  /* Top row: the active unit. */
-  /* Note, we ref this and other widgets here so that we can unref them
-   * in reset_unit_table. */
-  unit_pic = gtk_picture_new();
-  g_object_ref(unit_pic);
-  gtk_widget_set_size_request(unit_pic, ttw, -1);
-  gtk_grid_attach(GTK_GRID(table), unit_pic, 0, 0, 1, 1);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(select_unit_pic_callback),
-                   GINT_TO_POINTER(-1));
-  gtk_widget_add_controller(unit_pic, controller);
-
-  if (!GUI_GTK_OPTION(small_display_layout)) {
-    /* Bottom row: other units in the same tile. */
-    for (i = 0; i < num_units_below; i++) {
-      unit_below_pic[i] = gtk_picture_new();
-      g_object_ref(unit_below_pic[i]);
-      gtk_widget_set_size_request(unit_below_pic[i], ttw, -1);
-
-      controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-      g_signal_connect(controller, "pressed",
-                       G_CALLBACK(select_unit_pic_callback),
-                       GINT_TO_POINTER(i));
-      gtk_widget_add_controller(unit_below_pic[i], controller);
-
-      gtk_grid_attach(GTK_GRID(table), unit_below_pic[i],
-                      i, 1, 1, 1);
-    }
-  }
-
-  /* Create arrow (popup for all units on the selected tile) */
-  pix = sprite_get_pixbuf(get_arrow_sprite(tileset, ARROW_RIGHT));
-  more_arrow = gtk_image_new_from_pixbuf(pix);
-  g_object_ref(more_arrow);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(select_more_arrow_callback),
-                   NULL);
-  gtk_widget_add_controller(more_arrow, controller);
-
-  /* An extra layer so that we can hide the clickable button but keep
-   * an explicit size request to avoid the layout jumping around */
-  more_arrow_container = gtk_frame_new(NULL);
-  gtk_widget_set_halign(more_arrow_container, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(more_arrow_container, GTK_ALIGN_CENTER);
-  g_object_ref(more_arrow_container);
-  gtk_frame_set_child(GTK_FRAME(more_arrow_container), more_arrow);
-  gtk_widget_set_size_request(more_arrow_container,
-                              gdk_pixbuf_get_width(pix), -1);
-  g_object_unref(G_OBJECT(pix));
-
-  if (!GUI_GTK_OPTION(small_display_layout)) {
-    /* Display on bottom row. */
-    gtk_grid_attach(GTK_GRID(table), more_arrow_container,
-                    num_units_below, 1, 1, 1);
-  } else {
-    /* Display on top row (there is no bottom row). */
-    gtk_grid_attach(GTK_GRID(table), more_arrow_container,
-                    1, 0, 1, 1);
-  }
-
-  gtk_widget_set_visible(table, TRUE);
-}
-
-/**********************************************************************//**
-  Free unit image table.
-**************************************************************************/
-static void free_unit_table(void)
-{
-  if (unit_pic != NULL) {
-    gtk_grid_remove(GTK_GRID(unit_pic_table), unit_pic);
-    g_object_unref(unit_pic);
-    if (!GUI_GTK_OPTION(small_display_layout)) {
-      int i;
-
-      for (i = 0; i < num_units_below; i++) {
-        gtk_grid_remove(GTK_GRID(unit_pic_table),
-                        unit_below_pic[i]);
-        g_object_unref(unit_below_pic[i]);
-      }
-    }
-    gtk_grid_remove(GTK_GRID(unit_pic_table),
-                    more_arrow_container);
-    g_object_unref(more_arrow);
-    g_object_unref(more_arrow_container);
-  }
-}
-
-/**********************************************************************//**
-  Called when the tileset is changed to reset the unit pixmap table.
-**************************************************************************/
-void reset_unit_table(void)
-{
-  /* Unreference all of the widgets that we're about to reallocate, thus
-   * avoiding a memory leak. Remove them from the container first, just
-   * to be safe. Note, the widgets are ref'd in
-   * populate_unit_pic_table(). */
-  free_unit_table();
-
-  populate_unit_pic_table();
-
-  /* We have to force a redraw of the units. And we explicitly have
-   * to force a redraw of the focus unit, which is normally only
-   * redrawn when the focus changes. We also have to force the 'more'
-   * arrow to go away, both by expicitly hiding it and telling it to
-   * do so (this will be reset immediately afterwards if necessary,
-   * but we have to make the *internal* state consistent). */
-  gtk_widget_set_visible(more_arrow, FALSE);
-  set_unit_icons_more_arrow(FALSE);
-  if (get_num_units_in_focus() == 1) {
-    set_unit_icon(-1, head_of_units_in_focus());
-  } else {
-    set_unit_icon(-1, NULL);
-  }
-  update_unit_pix_label(get_units_in_focus());
-}
-
-/**********************************************************************//**
-  Override background color for canvases
-**************************************************************************/
-#if 0
-static void setup_canvas_color_for_state(GtkStateFlags state)
-{
-  gtk_widget_override_background_color(GTK_WIDGET(overview_canvas), state,
-                                       &get_color(tileset, COLOR_OVERVIEW_UNKNOWN)->color);
-  gtk_widget_override_background_color(GTK_WIDGET(map_canvas), state,
-                                       &get_color(tileset, COLOR_OVERVIEW_UNKNOWN)->color);
-}
-#endif
-
-/**********************************************************************//**
-  Callback that just returns TRUE.
-**************************************************************************/
-gboolean terminate_signal_processing(GtkEventControllerFocus *controller,
-                                     gpointer data)
-{
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Update tooltip of the Turn Done button
-**************************************************************************/
-void update_turn_done_tooltip(void)
-{
-  struct option *opt = optset_option_by_name(server_optset, "fixedlength");
-
-  if (opt != NULL && option_bool_get(opt)) {
-    gtk_widget_set_tooltip_text(turn_done_button,
-                                _("Fixed length turns"));
-  } else {
-    char buf[256];
-
-    fc_snprintf(buf, sizeof(buf), "%s:\n%s",
-                _("Turn Done"), _("Shift+Return"));
-    gtk_widget_set_tooltip_text(turn_done_button, buf);
-  }
-}
-
-/**********************************************************************//**
-  Do the heavy lifting for the widget setup.
-**************************************************************************/
-static void setup_widgets(void)
-{
-  GtkWidget *page, *hgrid, *hgrid2, *label;
-  GtkWidget *frame, *table, *table2, *paned, *sw, *text;
-  GtkWidget *button, *view, *mainbox, *vbox, *right_vbox = NULL;
-  int i;
-  GtkWidget *notebook, *statusbar;
-  GtkWidget *dtach_lowbox = NULL;
-  struct sprite *spr;
-  int right_row = 0;
-  int top_row = 0;
-  int grid_col = 0;
-  int grid2_col = 0;
-  GtkGesture *mc_gesture;
-  GtkEventController *mc_controller;
-  GtkWidget *ebar;
-
-  message_buffer = gtk_text_buffer_new(NULL);
-
-  notebook = gtk_notebook_new();
-
-  toplevel_tabs = notebook;
-  gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
-  gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
-  mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-  gtk_window_set_child(GTK_WINDOW(toplevel), mainbox);
-  gtk_box_append(GTK_BOX(mainbox), notebook);
-  statusbar = create_statusbar();
-  gtk_box_append(GTK_BOX(mainbox), statusbar);
-
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-      create_main_page(), NULL);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-      create_start_page(), NULL);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-      create_scenario_page(), NULL);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-      create_load_page(), NULL);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
-      create_network_page(), NULL);
-
-  editgui_create_widgets();
-
-  ingame_votebar = voteinfo_bar_new(FALSE);
-  gtk_widget_set_margin_bottom(ingame_votebar, 2);
-  gtk_widget_set_margin_end(ingame_votebar, 2);
-  gtk_widget_set_margin_start(ingame_votebar, 2);
-  gtk_widget_set_margin_top(ingame_votebar, 2);
-
-  /* *** Everything in the top *** */
-
-  page = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(page),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(page),
-                                    TRUE);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, NULL);
-
-  top_vbox = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(top_vbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(top_vbox), 5);
-  hgrid = gtk_grid_new();
-
-  if (GUI_GTK_OPTION(small_display_layout)) {
-    /* The window is divided into two horizontal panels: overview +
-     * civinfo + unitinfo, main view + message window. */
-    right_vbox = gtk_grid_new();
-    right_row = 0;
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(right_vbox),
-                                   GTK_ORIENTATION_VERTICAL);
-    gtk_grid_attach(GTK_GRID(hgrid), right_vbox, grid_col++, 0, 1, 1);
-
-    paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(page), top_vbox);
-    gtk_grid_attach(GTK_GRID(top_vbox), hgrid, 0, top_row++, 1, 1);
-    gtk_grid_attach(GTK_GRID(right_vbox), paned, 0, right_row++, 1, 1);
-    gtk_grid_attach(GTK_GRID(right_vbox), ingame_votebar, 0, right_row++, 1, 1);
-
-    /* Overview size designed for small displays (netbooks). */
-    overview_canvas_store_width = OVERVIEW_CANVAS_STORE_WIDTH_NETBOOK;
-    overview_canvas_store_height = OVERVIEW_CANVAS_STORE_HEIGHT_NETBOOK;
-  } else {
-    /* The window is divided into two vertical panes: overview +
-     * + civinfo + unitinfo + main view, message window. */
-    paned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(page), paned);
-    gtk_paned_set_start_child(GTK_PANED(paned), top_vbox);
-    gtk_grid_attach(GTK_GRID(top_vbox), hgrid, 0, top_row++, 1, 1);
-
-    /* Overview size designed for big displays (desktops). */
-    overview_canvas_store_width = OVERVIEW_CANVAS_STORE_WIDTH;
-    overview_canvas_store_height = OVERVIEW_CANVAS_STORE_HEIGHT;
-  }
-
-  /* This holds the overview canvas, production info, etc. */
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
-  /* Put vbox to the left of anything else in hgrid -- right_vbox is either
-   * the chat/messages pane, or NULL which is OK */
-  gtk_grid_attach_next_to(GTK_GRID(hgrid), vbox, right_vbox,
-                          GTK_POS_LEFT, 1, 1);
-  grid_col++;
-
-  /* Overview canvas */
-  ahbox = detached_widget_new();
-  gtk_widget_set_hexpand(ahbox, FALSE);
-  gtk_widget_set_vexpand(ahbox, FALSE);
-  gtk_box_append(GTK_BOX(vbox), ahbox);
-  avbox = detached_widget_fill(ahbox);
-
-  overview_scrolled_window = gtk_scrolled_window_new();
-  gtk_widget_set_margin_start(overview_scrolled_window, 1);
-  gtk_widget_set_margin_end(overview_scrolled_window, 1);
-  gtk_widget_set_margin_top(overview_scrolled_window, 1);
-  gtk_widget_set_margin_bottom(overview_scrolled_window, 1);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (overview_scrolled_window),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-  overview_canvas = gtk_drawing_area_new();
-  gtk_widget_set_halign(overview_canvas, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(overview_canvas, GTK_ALIGN_CENTER);
-  gtk_widget_set_size_request(overview_canvas, overview_canvas_store_width,
-                              overview_canvas_store_height);
-  gtk_widget_set_size_request(overview_scrolled_window, overview_canvas_store_width,
-                              overview_canvas_store_height);
-  gtk_widget_set_hexpand(overview_canvas, TRUE);
-  gtk_widget_set_vexpand(overview_canvas, TRUE);
-
-  gtk_box_append(GTK_BOX(avbox), overview_scrolled_window);
-
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(overview_scrolled_window),
-                                overview_canvas);
-
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(overview_canvas),
-                                 overview_canvas_draw, NULL, NULL);
-
-  mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(left_butt_down_overviewcanvas), NULL);
-  gtk_widget_add_controller(overview_canvas, mc_controller);
-  mc_gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
-  mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(right_butt_down_overviewcanvas), NULL);
-  gtk_widget_add_controller(overview_canvas, mc_controller);
-  mc_controller = gtk_event_controller_motion_new();
-  g_signal_connect(mc_controller, "motion",
-                   G_CALLBACK(move_overviewcanvas), NULL);
-  gtk_widget_add_controller(overview_canvas, mc_controller);
-
-  /* The rest */
-  ahbox = detached_widget_new();
-  gtk_box_append(GTK_BOX(vbox), ahbox);
-  gtk_widget_set_hexpand(ahbox, FALSE);
-  avbox = detached_widget_fill(ahbox);
-  gtk_widget_set_vexpand(avbox, TRUE);
-  gtk_widget_set_valign(avbox, GTK_ALIGN_FILL);
-
-  /* Info on player's civilization, when game is running. */
-  frame = gtk_frame_new("");
-  gtk_box_append(GTK_BOX(avbox), frame);
-
-  main_frame_civ_name = frame;
-
-  mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_frame_set_child(GTK_FRAME(frame), mainbox);
-  gtk_widget_set_hexpand(mainbox, TRUE);
-
-  label = gtk_label_new(NULL);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start(label, 2);
-  gtk_widget_set_margin_end(label, 2);
-  gtk_widget_set_margin_top(label, 2);
-  gtk_widget_set_margin_bottom(label, 2);
-
-  mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(show_info_popup), frame);
-  gtk_widget_add_controller(label, mc_controller);
-  gtk_box_append(GTK_BOX(mainbox), label);
-  main_label_info = label;
-
-  /* Production status */
-  table = gtk_grid_new();
-  gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-  gtk_grid_set_column_homogeneous(GTK_GRID(table), TRUE);
-  gtk_box_append(GTK_BOX(avbox), table);
-
-  /* Citizens for taxrates */
-  table2 = gtk_grid_new();
-  gtk_grid_attach(GTK_GRID(table), table2, 0, 0, 10, 1);
-  econ_widget = table2;
-
-  for (i = 0; i < 10; i++) {
-    GtkEventController *controller;
-
-    spr = i < 5 ? get_tax_sprite(tileset, O_SCIENCE) : get_tax_sprite(tileset, O_GOLD);
-    econ_label[i] = picture_new_from_surface(spr->surface);
-
-    g_object_set_data(G_OBJECT(econ_label[i]), "rate_button", GUINT_TO_POINTER(i));
-    controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-    g_signal_connect(controller, "pressed",
-                     G_CALLBACK(taxrates_callback), NULL);
-    gtk_widget_add_controller(econ_label[i], controller);
-    mc_gesture = gtk_gesture_click_new();
-    gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
-    controller = GTK_EVENT_CONTROLLER(mc_gesture);
-    g_signal_connect(controller, "pressed",
-		     G_CALLBACK(reverse_taxrates_callback), NULL);
-    gtk_widget_add_controller(econ_label[i], controller);
-    gtk_grid_attach(GTK_GRID(table2), econ_label[i], i, 0, 1, 1);
-  }
-
-  /* Science, environmental, govt, timeout */
-  spr = client_research_sprite();
-  if (spr != NULL) {
-    bulb_label = picture_new_from_surface(spr->surface);
-  } else {
-    bulb_label = gtk_picture_new();
-  }
-
-  spr = client_warming_sprite();
-  if (spr != NULL) {
-    sun_label = picture_new_from_surface(spr->surface);
-  } else {
-    sun_label = gtk_picture_new();
-  }
-
-  spr = client_cooling_sprite();
-  if (spr != NULL) {
-    flake_label = picture_new_from_surface(spr->surface);
-  } else {
-    flake_label = gtk_picture_new();
-  }
-
-  spr = client_government_sprite();
-  if (spr != NULL) {
-    government_label = picture_new_from_surface(spr->surface);
-  } else {
-    government_label = gtk_picture_new();
-  }
-
-  for (i = 0; i < 4; i++) {
-    GtkWidget *w;
-
-    switch (i) {
-    case 0:
-      w = bulb_label;
-      break;
-    case 1:
-      w = sun_label;
-      break;
-    case 2:
-      w = flake_label;
-      break;
-    default:
-    case 3:
-      w = government_label;
-      break;
-    }
-
-    gtk_widget_set_halign(w, GTK_ALIGN_START);
-    gtk_widget_set_valign(w, GTK_ALIGN_START);
-    gtk_widget_set_margin_start(w, 0);
-    gtk_widget_set_margin_end(w, 0);
-    gtk_widget_set_margin_top(w, 0);
-    gtk_widget_set_margin_bottom(w, 0);
-    gtk_grid_attach(GTK_GRID(table), w, i, 1, 1, 1);
-  }
-
-  timeout_label = gtk_label_new("");
-
-  frame = gtk_frame_new(NULL);
-  gtk_grid_attach(GTK_GRID(table), frame, 4, 1, 6, 1);
-  gtk_frame_set_child(GTK_FRAME(frame), timeout_label);
-
-
-  /* Turn done */
-  turn_done_button = gtk_button_new_with_label(_("Turn Done"));
-
-  gtk_grid_attach(GTK_GRID(table), turn_done_button, 0, 2, 10, 1);
-
-  g_signal_connect(turn_done_button, "clicked",
-                   G_CALLBACK(end_turn_callback), NULL);
-  update_turn_done_tooltip();
-
-  /* Selected unit status */
-
-  /* If you turn this to something else than GtkBox, also adjust
-   * editgui.c replace_widget() code that removes and adds widgets from it. */
-  unit_info_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_set_hexpand(unit_info_box, FALSE);
-  gtk_box_append(GTK_BOX(avbox), unit_info_box);
-
-  /* In edit mode the unit_info_box widget is replaced by the
-   * editinfobox, so we need to add a ref here so that it is
-   * not destroyed when removed from its container.
-   * See editinfobox_refresh() call to replace_widget() */
-  g_object_ref(unit_info_box);
-
-  unit_info_frame = gtk_frame_new("");
-  gtk_box_append(GTK_BOX(unit_info_box), unit_info_frame);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
-  gtk_frame_set_child(GTK_FRAME(unit_info_frame), sw);
-
-  label = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(label, TRUE);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start(label, 2);
-  gtk_widget_set_margin_end(label, 2);
-  gtk_widget_set_margin_top(label, 2);
-  gtk_widget_set_margin_bottom(label, 2);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), label);
-  unit_info_label = label;
-
-  hgrid2 = gtk_grid_new();
-  gtk_box_append(GTK_BOX(unit_info_box), hgrid2);
-
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 5);
-  gtk_widget_set_margin_end(table, 5);
-  gtk_widget_set_margin_start(table, 5);
-  gtk_widget_set_margin_top(table, 5);
-  gtk_grid_attach(GTK_GRID(hgrid2), table, grid2_col++, 0, 1, 1);
-
-  gtk_grid_set_row_spacing(GTK_GRID(table), 2);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 2);
-
-  unit_pic_table = table;
-
-  /* Map canvas, editor toolbar, and scrollbars */
-
-  /* The top notebook containing the map view and dialogs. */
-
-  top_notebook = gtk_notebook_new();
-  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(top_notebook), GTK_POS_BOTTOM);
-  gtk_notebook_set_scrollable(GTK_NOTEBOOK(top_notebook), TRUE);
-
-
-  if (GUI_GTK_OPTION(small_display_layout)) {
-    gtk_paned_set_start_child(GTK_PANED(paned), top_notebook);
-  } else if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) {
-    right_vbox = gtk_grid_new();
-    right_row = 0;
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(right_vbox),
-                                   GTK_ORIENTATION_VERTICAL);
-
-    gtk_grid_attach(GTK_GRID(right_vbox), top_notebook, 0, right_row++, 1, 1);
-    gtk_grid_attach(GTK_GRID(right_vbox), ingame_votebar, 0, right_row++, 1, 1);
-    gtk_grid_attach(GTK_GRID(hgrid), right_vbox, grid_col++, 0, 1, 1);
-  } else {
-    gtk_grid_attach(GTK_GRID(hgrid), top_notebook, grid_col++, 0, 1, 1);
-  }
-
-  map_widget = gtk_grid_new();
-
-  mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(mainbox), map_widget);
-
-  gtk_box_append(GTK_BOX(mainbox), editgui_get_editbar()->widget);
-  ebar = editgui_get_editbar()->widget;
-  gtk_widget_set_margin_bottom(ebar, 4);
-  gtk_widget_set_margin_end(ebar, 4);
-  gtk_widget_set_margin_start(ebar, 4);
-  gtk_widget_set_margin_top(ebar, 4);
-
-  label = gtk_label_new(Q_("?noun:View"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(top_notebook), mainbox, label);
-
-  frame = gtk_frame_new(NULL);
-  gtk_grid_attach(GTK_GRID(map_widget), frame, 0, 0, 1, 1);
-
-  map_canvas = gtk_drawing_area_new();
-  gtk_widget_set_hexpand(map_canvas, TRUE);
-  gtk_widget_set_vexpand(map_canvas, TRUE);
-  gtk_widget_set_size_request(map_canvas, 300, 300);
-  gtk_widget_set_can_focus(map_canvas, TRUE);
-
-  gtk_widget_set_focusable(map_canvas, TRUE);
-
-#if 0
-  setup_canvas_color_for_state(GTK_STATE_FLAG_NORMAL);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_ACTIVE);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_PRELIGHT);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_SELECTED);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_INSENSITIVE);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_INCONSISTENT);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_FOCUSED);
-  setup_canvas_color_for_state(GTK_STATE_FLAG_BACKDROP);
-#endif /* 0 */
-
-  gtk_frame_set_child(GTK_FRAME(frame), map_canvas);
-
-  map_horizontal_scrollbar =
-      gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL);
-  gtk_grid_attach(GTK_GRID(map_widget), map_horizontal_scrollbar, 0, 1, 1, 1);
-
-  map_vertical_scrollbar =
-      gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL);
-  gtk_grid_attach(GTK_GRID(map_widget), map_vertical_scrollbar, 1, 0, 1, 1);
-
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(map_canvas), map_canvas_draw,
-                                 NULL, NULL);
-
-  mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(left_butt_down_mapcanvas), NULL);
-  g_signal_connect(mc_controller, "released",
-                   G_CALLBACK(left_butt_up_mapcanvas), NULL);
-  gtk_widget_add_controller(map_canvas, mc_controller);
-  mc_gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
-  mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(right_butt_down_mapcanvas), NULL);
-  g_signal_connect(mc_controller, "released",
-                   G_CALLBACK(right_butt_up_mapcanvas), NULL);
-  gtk_widget_add_controller(map_canvas, mc_controller);
-  mc_gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 2);
-  mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
-  g_signal_connect(mc_controller, "pressed",
-                   G_CALLBACK(middle_butt_down_mapcanvas), NULL);
-  gtk_widget_add_controller(map_canvas, mc_controller);
-  mc_controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
-  g_signal_connect(mc_controller, "scroll",
-                   G_CALLBACK(mouse_scroll_mapcanvas), NULL);
-  gtk_widget_add_controller(map_canvas, mc_controller);
-  mc_controller = gtk_event_controller_motion_new();
-  g_signal_connect(mc_controller, "motion",
-                   G_CALLBACK(move_mapcanvas), NULL);
-  g_signal_connect(mc_controller, "leave",
-                   G_CALLBACK(leave_mapcanvas), NULL);
-  gtk_widget_add_controller(map_canvas, mc_controller);
-
-  g_signal_connect(map_canvas, "resize",
-                   G_CALLBACK(map_canvas_resize), NULL);
-
-  mc_controller = gtk_event_controller_key_new();
-  g_signal_connect(mc_controller, "key-pressed",
-                   G_CALLBACK(toplevel_key_press_handler), NULL);
-  gtk_widget_add_controller(toplevel, mc_controller);
-
-  /* *** The message window -- this is a detachable widget *** */
-
-  if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) {
-    bottom_hpaned = paned;
-    right_notebook = bottom_notebook = top_notebook;
-  } else {
-    GtkWidget *hpaned;
-
-    dtach_lowbox = detached_widget_new();
-    gtk_paned_set_end_child(GTK_PANED(paned), dtach_lowbox);
-    avbox = detached_widget_fill(dtach_lowbox);
-
-    mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-    if (!GUI_GTK_OPTION(small_display_layout)) {
-      gtk_box_append(GTK_BOX(mainbox), ingame_votebar);
-    }
-    gtk_box_append(GTK_BOX(avbox), mainbox);
-
-    if (GUI_GTK_OPTION(small_display_layout)) {
-      hpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
-    } else {
-      hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
-    }
-    gtk_box_append(GTK_BOX(mainbox), hpaned);
-    gtk_widget_set_margin_bottom(hpaned, 4);
-    gtk_widget_set_margin_end(hpaned, 4);
-    gtk_widget_set_margin_start(hpaned, 4);
-    gtk_widget_set_margin_top(hpaned, 4);
-    bottom_hpaned = hpaned;
-
-    bottom_notebook = gtk_notebook_new();
-    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(bottom_notebook), GTK_POS_TOP);
-    gtk_notebook_set_scrollable(GTK_NOTEBOOK(bottom_notebook), TRUE);
-    gtk_paned_set_start_child(GTK_PANED(hpaned), bottom_notebook);
-
-    right_notebook = gtk_notebook_new();
-    g_object_ref(right_notebook);
-    gtk_notebook_set_tab_pos(GTK_NOTEBOOK(right_notebook), GTK_POS_TOP);
-    gtk_notebook_set_scrollable(GTK_NOTEBOOK(right_notebook), TRUE);
-    if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_SPLIT) {
-      gtk_paned_set_end_child(GTK_PANED(hpaned), right_notebook);
-    }
-  }
-
-  mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
-                                    TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_ALWAYS);
-  gtk_box_append(GTK_BOX(mainbox), sw);
-
-  label = gtk_label_new(_("Chat"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(bottom_notebook), mainbox, label);
-
-  text = gtk_text_view_new_with_buffer(message_buffer);
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  set_message_buffer_view_link_handlers(text);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), text);
-
-  gtk_widget_set_name(text, "chatline");
-
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_widget_realize(text);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
-
-  main_message_area = GTK_TEXT_VIEW(text);
-  if (dtach_lowbox != NULL) {
-    g_object_set_data(G_OBJECT(dtach_lowbox), "hide-over-reparent", main_message_area);
-  }
-
-  chat_welcome_message(TRUE);
-
-  /* The chat line */
-  view = inputline_toolkit_view_new();
-  gtk_box_append(GTK_BOX(mainbox), view);
-  gtk_widget_set_margin_bottom(view, 3);
-  gtk_widget_set_margin_end(view, 3);
-  gtk_widget_set_margin_start(view, 3);
-  gtk_widget_set_margin_top(view, 3);
-
-  button = gtk_check_button_new_with_label(_("Allies Only"));
-  gtk_widget_set_focus_on_click(button, FALSE);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
-                              GUI_GTK_OPTION(allied_chat_only));
-  g_signal_connect(button, "toggled",
-                   G_CALLBACK(allied_chat_button_toggled), NULL);
-  inputline_toolkit_view_append_button(view, button);
-  allied_chat_toggle_button = button;
-
-  button = gtk_button_new_with_label(_("Clear links"));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(link_marks_clear_all), NULL);
-  inputline_toolkit_view_append_button(view, button);
-
-  /* Other things to take care of */
-
-  gtk_widget_set_visible(gtk_window_get_child(GTK_WINDOW(toplevel)),
-                         TRUE);
-
-  if (GUI_GTK_OPTION(enable_tabs)) {
-    meswin_dialog_popup(FALSE);
-  }
-
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(top_notebook), 0);
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(bottom_notebook), 0);
-
-  if (!GUI_GTK_OPTION(map_scrollbars)) {
-    gtk_widget_set_visible(map_horizontal_scrollbar, FALSE);
-    gtk_widget_set_visible(map_vertical_scrollbar, FALSE);
-  }
-}
-
-/**********************************************************************//**
-  g_log callback to log with freelog
-**************************************************************************/
-static void g_log_to_freelog_cb(const gchar *log_domain,
-                                GLogLevelFlags log_level,
-                                const gchar *message,
-                                gpointer user_data)
-{
-  enum log_level fllvl = LOG_ERROR;
-
-  switch (log_level) {
-  case G_LOG_LEVEL_DEBUG:
-    fllvl = LOG_DEBUG;
-    break;
-  case G_LOG_LEVEL_WARNING:
-    fllvl = LOG_WARN;
-    break;
-  default:
-    break;
-  }
-
-  if (log_domain != NULL) {
-    log_base(fllvl, "%s: %s", log_domain, message);
-  } else {
-    log_base(fllvl, "%s", message);
-  }
-}
-
-/**********************************************************************//**
-  g_log callback to log with freelog
-**************************************************************************/
-static GLogWriterOutput g_log_writer_to_freelog_cb(GLogLevelFlags log_level,
-                                                   const GLogField *fields,
-                                                   gsize n_fields,
-                                                   gpointer user_data)
-{
-  /* No need to have formatter of our own - let's use glib's default one. */
-  gchar *out = g_log_writer_format_fields(log_level, fields, n_fields, FALSE);
-
-  g_log_to_freelog_cb(NULL, log_level, out, NULL);
-
-  return G_LOG_WRITER_HANDLED;
-}
-
-/**********************************************************************//**
-  Set up g_log callback for a single domain.
-**************************************************************************/
-static void set_g_log_callback_domain(const char *domain)
-{
-  g_log_set_handler(domain,
-                    G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_LEVEL_WARNING
-                    | G_LOG_LEVEL_MASK
-                    | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
-                    g_log_to_freelog_cb, NULL);
-}
-
-/**********************************************************************//**
-  Set up g_log callbacks.
-**************************************************************************/
-static void set_g_log_callbacks(void)
-{
-  /* Old API, still used by many log producers */
-  g_log_set_default_handler(g_log_to_freelog_cb, NULL);
-
-  set_g_log_callback_domain("Gtk");
-  set_g_log_callback_domain("Gdk");
-  set_g_log_callback_domain("Glib");
-
-  /* glib >= 2.50 API */
-  g_log_set_writer_func(g_log_writer_to_freelog_cb, NULL, NULL);
-}
-
-/**********************************************************************//**
-  Called from main().
-**************************************************************************/
-void ui_init(void)
-{
-  log_set_callback(log_callback_utf8);
-  set_g_log_callbacks();
-  set_frame_by_frame_animation();
-  zoom_phase_set(FALSE);
-  zoom_set_steps(zoom_steps_custom);
-}
-
-/**********************************************************************//**
-  Entry point for whole freeciv client program.
-**************************************************************************/
-int main(int argc, char **argv)
-{
-  return client_main(argc, argv, FALSE);
-}
-
-/**********************************************************************//**
-  Migrate gtk3 client specific options from gtk2 client options.
-**************************************************************************/
-static void migrate_options_from_gtk2(void)
-{
-  log_normal(_("Migrating options from gtk2 to gtk3 client"));
-
-#define MIGRATE_OPTION(opt) gui_options.gui_gtk3_##opt = gui_options.gui_gtk2_##opt;
-#define MIGRATE_STR_OPTION(opt) \
-  strncpy(gui_options.gui_gtk3_##opt, gui_options.gui_gtk2_##opt,      \
-          sizeof(gui_options.gui_gtk3_##opt));
-
-  /* Default theme name is never migrated */
-  /* 'fullscreen', 'small_display_layout', and 'message_chat_location'
-   * not migrated, as (unlike Gtk2), Gtk3-client tries to pick better
-   * defaults for these in fresh installations based on screen size (see
-   * adjust_default_options()); so user is probably better served by
-   * getting these adaptive defaults than whatever they had for Gtk2.
-   * Since 'fullscreen' isn't migrated, we don't need to worry about
-   * preserving gui_gtk2_migrated_from_2_5 either. */
-  MIGRATE_OPTION(map_scrollbars);
-  MIGRATE_OPTION(dialogs_on_top);
-  MIGRATE_OPTION(show_task_icons);
-  MIGRATE_OPTION(enable_tabs);
-  MIGRATE_OPTION(show_chat_message_time);
-  MIGRATE_OPTION(new_messages_go_to_top);
-  MIGRATE_OPTION(show_message_window_buttons);
-  MIGRATE_OPTION(metaserver_tab_first);
-  MIGRATE_OPTION(allied_chat_only);
-  MIGRATE_OPTION(mouse_over_map_focus);
-  MIGRATE_OPTION(chatline_autocompletion);
-  MIGRATE_OPTION(citydlg_xsize);
-  MIGRATE_OPTION(citydlg_ysize);
-  MIGRATE_OPTION(popup_tech_help);
-
-  MIGRATE_STR_OPTION(font_city_label);
-  MIGRATE_STR_OPTION(font_notify_label);
-  MIGRATE_STR_OPTION(font_spaceship_label);
-  MIGRATE_STR_OPTION(font_help_label);
-  MIGRATE_STR_OPTION(font_help_link);
-  MIGRATE_STR_OPTION(font_help_text);
-  MIGRATE_STR_OPTION(font_chatline);
-  MIGRATE_STR_OPTION(font_beta_label);
-  MIGRATE_STR_OPTION(font_small);
-  MIGRATE_STR_OPTION(font_comment_label);
-  MIGRATE_STR_OPTION(font_city_names);
-  MIGRATE_STR_OPTION(font_city_productions);
-  MIGRATE_STR_OPTION(font_reqtree_text);
-
-#undef MIGRATE_OPTION
-#undef MIGRATE_STR_OPTION
-
-  gui_options.gui_gtk3_migrated_from_gtk2 = TRUE;
-}
-
-/**********************************************************************//**
-  Migrate gtk3.22 client specific options from gtk3 client options.
-**************************************************************************/
-static void migrate_options_from_gtk3(void)
-{
-  log_normal(_("Migrating options from gtk3 to gtk3.22 client"));
-
-#define MIGRATE_OPTION(opt) gui_options.gui_gtk3_22_##opt = gui_options.gui_gtk3_##opt;
-#define MIGRATE_STR_OPTION(opt) \
-  strncpy(gui_options.gui_gtk3_22_##opt, gui_options.gui_gtk3_##opt,      \
-          sizeof(gui_options.gui_gtk3_22_##opt));
-
-  /* Default theme name is never migrated */
-
-  /* Simulate gui-gtk3's migrate_options_from_2_5() */
-  if (!gui_options.gui_gtk3_migrated_from_2_5) {
-    log_normal(_("Migrating gtk3-client options from freeciv-2.5 options."));
-    gui_options.gui_gtk3_fullscreen = gui_options.migrate_fullscreen;
-    gui_options.gui_gtk3_migrated_from_2_5 = TRUE;
-  }
-
-  MIGRATE_OPTION(fullscreen);
-  MIGRATE_OPTION(map_scrollbars);
-  MIGRATE_OPTION(dialogs_on_top);
-  MIGRATE_OPTION(show_task_icons);
-  MIGRATE_OPTION(enable_tabs);
-  MIGRATE_OPTION(show_chat_message_time);
-  MIGRATE_OPTION(new_messages_go_to_top);
-  MIGRATE_OPTION(show_message_window_buttons);
-  MIGRATE_OPTION(metaserver_tab_first);
-  MIGRATE_OPTION(allied_chat_only);
-  MIGRATE_OPTION(message_chat_location);
-  MIGRATE_OPTION(small_display_layout);
-  MIGRATE_OPTION(mouse_over_map_focus);
-  MIGRATE_OPTION(chatline_autocompletion);
-  MIGRATE_OPTION(citydlg_xsize);
-  MIGRATE_OPTION(citydlg_ysize);
-  MIGRATE_OPTION(popup_tech_help);
-
-  MIGRATE_STR_OPTION(font_city_label);
-  MIGRATE_STR_OPTION(font_notify_label);
-  MIGRATE_STR_OPTION(font_spaceship_label);
-  MIGRATE_STR_OPTION(font_help_label);
-  MIGRATE_STR_OPTION(font_help_link);
-  MIGRATE_STR_OPTION(font_help_text);
-  MIGRATE_STR_OPTION(font_chatline);
-  MIGRATE_STR_OPTION(font_beta_label);
-  MIGRATE_STR_OPTION(font_small);
-  MIGRATE_STR_OPTION(font_comment_label);
-  MIGRATE_STR_OPTION(font_city_names);
-  MIGRATE_STR_OPTION(font_city_productions);
-  MIGRATE_STR_OPTION(font_reqtree_text);
-
-#undef MIGRATE_OPTION
-#undef MIGRATE_STR_OPTION
-
-  gui_options.gui_gtk3_22_migrated_from_gtk3 = TRUE;
-}
-
-/**********************************************************************//**
-  Migrate gtk4 client specific options from gtk3.22 client options.
-**************************************************************************/
-static void migrate_options_from_gtk3_22(void)
-{
-  log_normal(_("Migrating options from gtk3.22 to gtk4 client"));
-
-#define MIGRATE_OPTION(opt) gui_options.gui_gtk4_##opt = gui_options.gui_gtk3_22_##opt;
-#define MIGRATE_STR_OPTION(opt) \
-  strncpy(gui_options.gui_gtk4_##opt, gui_options.gui_gtk3_22_##opt,      \
-          sizeof(gui_options.gui_gtk4_##opt));
-
-  /* Default theme name is never migrated */
-  MIGRATE_OPTION(fullscreen);
-  MIGRATE_OPTION(map_scrollbars);
-  MIGRATE_OPTION(dialogs_on_top);
-  MIGRATE_OPTION(show_task_icons);
-  MIGRATE_OPTION(enable_tabs);
-  MIGRATE_OPTION(show_chat_message_time);
-  MIGRATE_OPTION(new_messages_go_to_top);
-  MIGRATE_OPTION(show_message_window_buttons);
-  MIGRATE_OPTION(metaserver_tab_first);
-  MIGRATE_OPTION(allied_chat_only);
-  MIGRATE_OPTION(message_chat_location);
-  MIGRATE_OPTION(small_display_layout);
-  MIGRATE_OPTION(mouse_over_map_focus);
-  MIGRATE_OPTION(chatline_autocompletion);
-  MIGRATE_OPTION(citydlg_xsize);
-  MIGRATE_OPTION(citydlg_ysize);
-  MIGRATE_OPTION(helpdlg_xsize);
-  MIGRATE_OPTION(helpdlg_ysize);
-  MIGRATE_OPTION(optionsdlg_xsize);
-  MIGRATE_OPTION(optionsdlg_ysize);
-  MIGRATE_OPTION(popup_tech_help);
-
-  MIGRATE_STR_OPTION(font_city_label);
-  MIGRATE_STR_OPTION(font_notify_label);
-  MIGRATE_STR_OPTION(font_spaceship_label);
-  MIGRATE_STR_OPTION(font_help_label);
-  MIGRATE_STR_OPTION(font_help_link);
-  MIGRATE_STR_OPTION(font_help_text);
-  MIGRATE_STR_OPTION(font_chatline);
-  MIGRATE_STR_OPTION(font_beta_label);
-  MIGRATE_STR_OPTION(font_small);
-  MIGRATE_STR_OPTION(font_comment_label);
-  MIGRATE_STR_OPTION(font_city_names);
-  MIGRATE_STR_OPTION(font_city_productions);
-  MIGRATE_STR_OPTION(font_reqtree_text);
-
-#undef MIGRATE_OPTION
-#undef MIGRATE_STR_OPTION
-
-  gui_options.gui_gtk4_migrated_from_gtk3_22 = TRUE;
-}
-
-/**********************************************************************//**
-  Migrate gtk4x client specific options from gtk4 client options.
-**************************************************************************/
-static void migrate_options_from_gtk4(void)
-{
-  log_normal(_("Migrating options from gtk4 to gtk4x client"));
-
-#define MIGRATE_OPTION(opt) gui_options.gui_gtk5_##opt = gui_options.gui_gtk4_##opt;
-#define MIGRATE_STR_OPTION(opt) \
-  strncpy(gui_options.gui_gtk5_##opt, gui_options.gui_gtk4_##opt,      \
-          sizeof(gui_options.gui_gtk5_##opt));
-
-  /* Default theme name is never migrated */
-  MIGRATE_OPTION(fullscreen);
-  MIGRATE_OPTION(map_scrollbars);
-  MIGRATE_OPTION(dialogs_on_top);
-  MIGRATE_OPTION(show_task_icons);
-  MIGRATE_OPTION(enable_tabs);
-  MIGRATE_OPTION(show_chat_message_time);
-  MIGRATE_OPTION(new_messages_go_to_top);
-  MIGRATE_OPTION(show_message_window_buttons);
-  MIGRATE_OPTION(metaserver_tab_first);
-  MIGRATE_OPTION(allied_chat_only);
-  MIGRATE_OPTION(message_chat_location);
-  MIGRATE_OPTION(small_display_layout);
-  MIGRATE_OPTION(mouse_over_map_focus);
-  MIGRATE_OPTION(chatline_autocompletion);
-  MIGRATE_OPTION(citydlg_xsize);
-  MIGRATE_OPTION(citydlg_ysize);
-  MIGRATE_OPTION(helpdlg_xsize);
-  MIGRATE_OPTION(helpdlg_ysize);
-  MIGRATE_OPTION(optionsdlg_xsize);
-  MIGRATE_OPTION(optionsdlg_ysize);
-  MIGRATE_OPTION(popup_tech_help);
-
-  MIGRATE_STR_OPTION(font_city_label);
-  MIGRATE_STR_OPTION(font_notify_label);
-  MIGRATE_STR_OPTION(font_spaceship_label);
-  MIGRATE_STR_OPTION(font_help_label);
-  MIGRATE_STR_OPTION(font_help_link);
-  MIGRATE_STR_OPTION(font_help_text);
-  MIGRATE_STR_OPTION(font_chatline);
-  MIGRATE_STR_OPTION(font_beta_label);
-  MIGRATE_STR_OPTION(font_small);
-  MIGRATE_STR_OPTION(font_comment_label);
-  MIGRATE_STR_OPTION(font_city_names);
-  MIGRATE_STR_OPTION(font_city_productions);
-  MIGRATE_STR_OPTION(font_reqtree_text);
-
-#undef MIGRATE_OPTION
-#undef MIGRATE_STR_OPTION
-
-  gui_options.gui_gtk5_migrated_from_gtk4 = TRUE;
-}
-
-/**********************************************************************//**
-  Called from client_main(), is what it's named.
-**************************************************************************/
-int ui_main(int argc, char **argv)
-{
-  if (parse_options(argc, argv)) {
-    /* The locale has already been set in init_nls() and the windows-specific
-     * locale logic in gtk_init() causes problems with zh_CN (see PR#39475) */
-    gtk_disable_setlocale();
-
-    if (!gtk_init_check()) {
-      log_fatal(_("Failed to open graphical mode."));
-      return EXIT_FAILURE;
-    }
-
-    menus_set_initial_toggle_values();
-
-    gui_up = TRUE;
-    fc_app = gtk_application_new(NULL, 0);
-    g_signal_connect(fc_app, "activate", G_CALLBACK(activate_gui), NULL);
-    g_application_run(G_APPLICATION(fc_app), 0, NULL);
-    gui_up = FALSE;
-
-    destroy_server_scans();
-    free_mapcanvas_and_overview();
-    spaceship_dialog_done();
-    intel_dialog_done();
-    citizens_dialog_done();
-    luaconsole_dialog_done();
-    happiness_dialog_done();
-    diplomacy_dialog_done();
-    cma_fe_done();
-    free_unit_table();
-
-    /* We have extra ref for unit_info_box that has protected
-     * it from getting destroyed when editinfobox_refresh()
-     * moves widgets around. Free that extra ref here. */
-    g_object_unref(unit_info_box);
-    if (empty_unit_paintable != NULL) {
-      g_object_unref(empty_unit_paintable);
-    }
-
-    editgui_free();
-    gtk_window_destroy(GTK_WINDOW(toplevel));
-    message_buffer = NULL; /* Result of destruction of everything */
-    tileset_free_tiles(tileset);
-  }
-
-  return EXIT_SUCCESS;
-}
-
-/**********************************************************************//**
-  Run the gui
-**************************************************************************/
-static void activate_gui(GtkApplication *app, gpointer data)
-{
-  PangoFontDescription *toplevel_font_name;
-  guint sig;
-  GtkEventController *controller;
-  char window_name[1024];
-
-  toplevel = gtk_application_window_new(app);
-  if (vmode.width > 0 && vmode.height > 0) {
-    gtk_window_set_default_size(GTK_WINDOW(toplevel),
-                                vmode.width, vmode.height);
-  }
-
-  controller = GTK_EVENT_CONTROLLER(gtk_event_controller_focus_new());
-  g_signal_connect(controller, "enter",
-                   G_CALLBACK(fc_gained_focus), NULL);
-  g_signal_connect(controller, "leave",
-                   G_CALLBACK(fc_lost_focus), NULL);
-  gtk_widget_add_controller(toplevel, controller);
-
-  gtk_widget_realize(toplevel);
-  gtk_widget_set_name(toplevel, "Freeciv");
-
-  help_system_init();
-
-  dlg_tab_provider_prepare();
-
-  if (gui_options.first_boot) {
-    adjust_default_options();
-    /* We're using fresh defaults for this version of this client,
-     * so prevent any future migrations from other clients / versions */
-    gui_options.gui_gtk5_migrated_from_gtk4 = TRUE;
-    /* Avoid also marking previous Gtk clients as migrated, so that
-     * they can have their own run of their adjust_default_options() if
-     * they are ever run (as a side effect of Gtk3.22->Gtk4 migration). */
-  } else {
-    if (!gui_options.gui_gtk5_migrated_from_gtk4) {
-      if (!gui_options.gui_gtk4_migrated_from_gtk3_22) {
-        if (!gui_options.gui_gtk3_22_migrated_from_gtk3) {
-          if (!gui_options.gui_gtk3_migrated_from_gtk2) {
-            migrate_options_from_gtk2();
-            /* We want a fresh look at screen-size-related options after Gtk2 */
-            adjust_default_options();
-            /* We don't ever want to consider pre-2.6 fullscreen option again
-             * (even for gui-gtk3) */
-            gui_options.gui_gtk3_migrated_from_2_5 = TRUE;
-          }
-          migrate_options_from_gtk3();
-        }
-        migrate_options_from_gtk3_22();
-      }
-      migrate_options_from_gtk4();
-    }
-  }
-
-  if (GUI_GTK_OPTION(fullscreen)) {
-    gtk_window_fullscreen(GTK_WINDOW(toplevel));
-  }
-
-  fc_snprintf(window_name, sizeof(window_name), _("Freeciv (%s)"), GUI_NAME_SHORT);
-  gtk_window_set_title(GTK_WINDOW(toplevel), window_name);
-
-  g_signal_connect(toplevel, "close-request",
-                   G_CALLBACK(quit_dialog_callback), NULL);
-
-  /* Disable GTK cursor key focus movement */
-  sig = g_signal_lookup("move-focus", GTK_TYPE_WIDGET);
-  g_signal_handlers_disconnect_matched(toplevel, G_SIGNAL_MATCH_ID, sig,
-                                       0, 0, 0, 0);
-  g_signal_connect(toplevel, "move-focus", G_CALLBACK(toplevel_focus), NULL);
-
-  options_iterate(client_optset, poption) {
-    if (OT_FONT == option_type(poption)) {
-      /* Force to call the appropriate callback. */
-      option_changed(poption);
-    }
-  } options_iterate_end;
-
-  toplevel_font_name = pango_context_get_font_description(
-                           gtk_widget_get_pango_context(toplevel));
-
-  if (NULL == city_names_style) {
-    city_names_style = pango_font_description_copy(toplevel_font_name);
-    log_error("city_names_style should have been set by options.");
-  }
-  if (NULL == city_productions_style) {
-    city_productions_style = pango_font_description_copy(toplevel_font_name);
-    log_error("city_productions_style should have been set by options.");
-  }
-  if (NULL == reqtree_text_style) {
-    reqtree_text_style = pango_font_description_copy(toplevel_font_name);
-    log_error("reqtree_text_style should have been set by options.");
-  }
-
-  tileset_init(tileset);
-  tileset_load_tiles(tileset);
-
-  /* Keep the icon of the executable on Windows (see PR#36491) */
-#ifndef FREECIV_MSWINDOWS
-  {
-    /* Only call this after tileset_load_tiles is called. */
-    gtk_window_set_icon_name(GTK_WINDOW(toplevel), "freeciv");
-  }
-#endif /* FREECIV_MSWINDOWS */
-
-  setup_widgets();
-  load_cursors();
-  cma_fe_init();
-  diplomacy_dialog_init();
-  luaconsole_dialog_init();
-  happiness_dialog_init();
-  citizens_dialog_init();
-  intel_dialog_init();
-  spaceship_dialog_init();
-  chatline_init();
-  init_mapcanvas_and_overview();
-
-  tileset_use_preferred_theme(tileset);
-
-  gtk_widget_set_visible(toplevel, TRUE);
-
-  /* Assumes toplevel showing */
-  set_client_state(C_S_DISCONNECTED);
-
-  /* Assumes client_state is set */
-  timer_id = g_timeout_add(TIMER_INTERVAL, timer_callback, NULL);
-}
-
-/**********************************************************************//**
-  Return whether gui is currently running.
-**************************************************************************/
-bool is_gui_up(void)
-{
-  return gui_up;
-}
-
-/**********************************************************************//**
-  Do any necessary UI-specific cleanup
-**************************************************************************/
-void ui_exit(void)
-{
-  if (message_buffer != NULL) {
-    g_object_unref(message_buffer);
-    message_buffer = NULL;
-  }
-}
-
-/**********************************************************************//**
-  Return our GUI type
-**************************************************************************/
-enum gui_type get_gui_type(void)
-{
-  return GUI_GTK5;
-}
-
-/**********************************************************************//**
-  Obvious...
-**************************************************************************/
-void sound_bell(void)
-{
-  gdk_display_beep(gdk_display_get_default());
-}
-
-/**********************************************************************//**
-  Set one of the unit icons in information area based on punit.
-  Use punit == NULL to clear icon.
-  Index 'idx' is -1 for "active unit", or 0 to (num_units_below - 1) for
-  units below.  Also updates unit_ids[idx] for idx >= 0.
-**************************************************************************/
-void set_unit_icon(int idx, struct unit *punit)
-{
-  GtkWidget *w;
-
-  fc_assert_ret(idx >= -1 && idx < num_units_below);
-
-  if (idx == -1) {
-    w = unit_pic;
-    unit_id_top = punit ? punit->id : 0;
-  } else {
-    w = unit_below_pic[idx];
-    unit_ids[idx] = punit ? punit->id : 0;
-  }
-
-  if (!w) {
-    return;
-  }
-
-  if (punit) {
-    put_unit_picture(punit, GTK_PICTURE(w), -1);
-  } else {
-    if (empty_unit_paintable == NULL) {
-      /* FIXME: Use proper icon height instead of hardcoded 50 */
-      empty_unit_paintable = gdk_paintable_new_empty(tileset_tile_width(tileset), 50);
-
-      /* Add ref to avoid it getting destroyed along any single parent widget. */
-      g_object_ref(empty_unit_paintable);
-    }
-    gtk_picture_set_paintable(GTK_PICTURE(w), empty_unit_paintable);
-  }
-}
-
-/**********************************************************************//**
-  Set the "more arrow" for the unit icons to on(1) or off(0).
-  Maintains a static record of current state to avoid unnecessary redraws.
-  Note initial state should match initial gui setup (off).
-**************************************************************************/
-void set_unit_icons_more_arrow(bool onoff)
-{
-  static bool showing = FALSE;
-
-  if (more_arrow == nullptr) {
-    return;
-  }
-
-  if (onoff && !showing) {
-    gtk_widget_set_visible(more_arrow, TRUE);
-    showing = TRUE;
-  } else if (!onoff && showing) {
-    gtk_widget_set_visible(more_arrow, FALSE);
-    showing = FALSE;
-  }
-}
-
-/**********************************************************************//**
-  Called when the set of units in focus (get_units_in_focus()) changes.
-  Standard updates like update_unit_info_label() are handled in the platform-
-  independent code; we use this to keep the goto/airlift dialog up to date,
-  if it's visible.
-**************************************************************************/
-void real_focus_units_changed(void)
-{
-  goto_dialog_focus_units_changed();
-}
-
-/**********************************************************************//**
-  Callback for clicking a unit icon underneath unit info box.
-  these are the units on the same tile as the focus unit.
-**************************************************************************/
-static gboolean select_unit_pic_callback(GtkGestureClick *gesture, int n_press,
-                                         double x, double y, gpointer data)
-{
-  int i = GPOINTER_TO_INT(data);
-  struct unit *punit;
-
-  if (i == -1) {
-    punit = game_unit_by_number(unit_id_top);
-    if (punit && unit_is_in_focus(punit)) {
-      /* Clicking on the currently selected unit will center it. */
-      center_tile_mapcanvas(unit_tile(punit));
-    }
-    return TRUE;
-  }
-
-  if (unit_ids[i] == 0) { /* No unit displayed at this place */
-    return TRUE;
-  }
-
-  punit = game_unit_by_number(unit_ids[i]);
-  if (NULL != punit && unit_owner(punit) == client_player()) {
-    /* Unit shouldn't be NULL but may be owned by an ally. */
-    unit_focus_set(punit);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Callback for clicking a unit icon underneath unit info box.
-  these are the units on the same tile as the focus unit.
-**************************************************************************/
-static gboolean select_more_arrow_callback(GtkGestureClick *gesture, int n_press,
-                                           double x, double y, gpointer data)
-{
-  struct unit *punit = game_unit_by_number(unit_id_top);
-
-  if (punit) {
-    unit_select_dialog_popup(unit_tile(punit));
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  On close of the info popup
-**************************************************************************/
-static void info_popup_closed(GtkWidget *self, gpointer data)
-{
-  gtk_widget_unparent(self);
-}
-
-/**********************************************************************//**
-  Popup info box
-**************************************************************************/
-static gboolean show_info_popup(GtkGestureClick *gesture, int n_press,
-                                double x, double y, gpointer data)
-{
-  GtkWidget *p;
-  GtkWidget *child;
-  GtkWidget *frame = GTK_WIDGET(data);
-
-  p = gtk_popover_new();
-
-  gtk_widget_set_parent(p, frame);
-  child = gtk_label_new(get_info_label_text_popup());
-  gtk_popover_set_child(GTK_POPOVER(p), child);
-  g_signal_connect(p, "closed",
-                   G_CALLBACK(info_popup_closed), NULL);
-  gtk_popover_popup(GTK_POPOVER(p));
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  User clicked "Turn Done" button
-**************************************************************************/
-static void end_turn_callback(GtkWidget *w, gpointer data)
-{
-  gtk_widget_set_sensitive(turn_done_button, FALSE);
-  user_ended_turn();
-}
-
-/**********************************************************************//**
-  Read input from server socket
-**************************************************************************/
-static gboolean get_net_input(GIOChannel *source, GIOCondition condition,
-                              gpointer data)
-{
-  input_from_server(g_io_channel_unix_get_fd(source));
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Set socket writability state
-**************************************************************************/
-static void set_wait_for_writable_socket(struct connection *pc,
-                                         bool socket_writable)
-{
-  static bool previous_state = FALSE;
-
-  fc_assert_ret(pc == &client.conn);
-
-  if (previous_state == socket_writable)
-    return;
-
-  log_debug("set_wait_for_writable_socket(%d)", socket_writable);
-
-  g_source_remove(srv_id);
-  srv_id = g_io_add_watch(srv_channel,
-                          G_IO_IN | (socket_writable ? G_IO_OUT : 0) | G_IO_ERR,
-                          get_net_input,
-                          NULL);
-
-  previous_state = socket_writable;
-}
-
-/**********************************************************************//**
-  This function is called after the client has successfully
-  connected to the server
-**************************************************************************/
-void add_net_input(int sock)
-{
-#ifdef FREECIV_MSWINDOWS
-  srv_channel = g_io_channel_win32_new_socket(sock);
-#else
-  srv_channel = g_io_channel_unix_new(sock);
-#endif
-  srv_id = g_io_add_watch(srv_channel,
-                          G_IO_IN | G_IO_ERR,
-                          get_net_input,
-                          NULL);
-  client.conn.notify_of_writable_data = set_wait_for_writable_socket;
-}
-
-/**********************************************************************//**
-  This function is called if the client disconnects
-  from the server
-**************************************************************************/
-void remove_net_input(void)
-{
-  g_source_remove(srv_id);
-  g_io_channel_unref(srv_channel);
-  gtk_widget_set_cursor(toplevel, NULL);
-}
-
-/**********************************************************************//**
-  This is the response callback for the dialog with the message:
-  Are you sure you want to quit?
-**************************************************************************/
-static void quit_dialog_response(GObject *dialog, GAsyncResult *result,
-                                 gpointer data)
-{
-  int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
-                                              result, NULL);
-
-  if (button == 0) {
-    start_quitting();
-    if (client.conn.used) {
-      disconnect_from_server(FALSE);
-    }
-    quit_gtk_main();
-  }
-
-  quit_dialog = NULL;
-}
-
-/**********************************************************************//**
-  Exit gtk main loop.
-**************************************************************************/
-void quit_gtk_main(void)
-{
-  /* Quit gtk main loop. After this it will return to finish
-   * ui_main() */
-
-  g_application_quit(G_APPLICATION(fc_app));
-}
-
-/**********************************************************************//**
-  Popups the dialog with the message:
-  Are you sure you want to quit?
-**************************************************************************/
-void popup_quit_dialog(void)
-{
-  if (quit_dialog == NULL) {
-    const char *buttons[] = { _("Yes"), _("No"), NULL };
-
-    quit_dialog = gtk_alert_dialog_new(_("Are you sure you want to quit?"));
-    gtk_alert_dialog_set_buttons(GTK_ALERT_DIALOG(quit_dialog), buttons);
-
-    gtk_alert_dialog_choose(GTK_ALERT_DIALOG(quit_dialog),
-                            GTK_WINDOW(toplevel), NULL,
-                            quit_dialog_response, NULL);
-  }
-}
-
-/**********************************************************************//**
-  Popups the quit dialog.
-**************************************************************************/
-static gboolean quit_dialog_callback(void)
-{
-  popup_quit_dialog();
-  /* Stop emission of event. */
-  return TRUE;
-}
-
-struct callback {
-  void (*callback)(void *data);
-  void *data;
-};
-
-/**********************************************************************//**
-  A wrapper for the callback called through add_idle_callback().
-**************************************************************************/
-static gboolean idle_callback_wrapper(gpointer data)
-{
-  struct callback *cb = data;
-
-  (cb->callback)(cb->data);
-  free(cb);
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Enqueue a callback to be called during an idle moment. The 'callback'
-  function should be called sometimes soon, and passed the 'data' pointer
-  as its data.
-**************************************************************************/
-void add_idle_callback(void (callback)(void *), void *data)
-{
-  struct callback *cb = fc_malloc(sizeof(*cb));
-
-  cb->callback = callback;
-  cb->data = data;
-  g_idle_add(idle_callback_wrapper, cb);
-}
-
-/**********************************************************************//**
-  Add idle callback for updating animations.
-**************************************************************************/
-void animation_idle_cb(void *data)
-{
-  if (get_current_client_page() == PAGE_GAME) {
-    update_animation();
-    add_idle_callback(animation_idle_cb, NULL);
-  }
-}
-
-/**********************************************************************//**
-  Option callback for the 'allied_chat_only' gtk-gui option.
-  This updates the state of the associated toggle button.
-**************************************************************************/
-static void allied_chat_only_callback(struct option *poption)
-{
-  GtkWidget *button;
-
-  button = allied_chat_toggle_button;
-  fc_assert_ret(button != NULL);
-  fc_assert_ret(GTK_IS_CHECK_BUTTON(button));
-
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
-                              option_bool_get(poption));
-}
-
-/**********************************************************************//**
-  Option callback for the 'fullscreen' gtk-gui option.
-**************************************************************************/
-void fullscreen_opt_refresh(struct option *poption)
-{
-  if (GUI_GTK_OPTION(fullscreen)) {
-    gtk_window_fullscreen(GTK_WINDOW(toplevel));
-  } else {
-    gtk_window_unfullscreen(GTK_WINDOW(toplevel));
-  }
-}
-
-/**********************************************************************//**
-  Change the city names font.
-**************************************************************************/
-static void apply_city_names_font(struct option *poption)
-{
-  gui_update_font_full(option_font_target(poption),
-                       option_font_get(poption),
-                       &city_names_style);
-  update_city_descriptions();
-}
-
-/**********************************************************************//**
-  Change the city productions font.
-**************************************************************************/
-static void apply_city_productions_font(struct option *poption)
-{
-  gui_update_font_full(option_font_target(poption),
-                       option_font_get(poption),
-                       &city_productions_style);
-  update_city_descriptions();
-}
-
-/**********************************************************************//**
-  Change the city productions font.
-**************************************************************************/
-static void apply_reqtree_text_font(struct option *poption)
-{
-  gui_update_font_full(option_font_target(poption),
-                       option_font_get(poption),
-                       &reqtree_text_style);
-  science_report_dialog_redraw();
-}
-
-/**********************************************************************//**
-  Extra initializers for client options. Here we make set the callback
-  for the specific gui-gtk-5.0 options.
-**************************************************************************/
-void options_extra_init(void)
-{
-  struct option *poption;
-
-#define option_var_set_callback(var, callback)                              \
-  if ((poption = optset_option_by_name(client_optset,                       \
-                                       GUI_GTK_OPTION_STR(var)))) {         \
-    option_set_changed_callback(poption, callback);                         \
-  } else {                                                                  \
-    log_error("Didn't find option %s!", GUI_GTK_OPTION_STR(var));           \
-  }
-
-  option_var_set_callback(allied_chat_only,
-                          allied_chat_only_callback);
-  option_var_set_callback(fullscreen,
-                          fullscreen_opt_refresh);
-
-  option_var_set_callback(font_city_names,
-                          apply_city_names_font);
-  option_var_set_callback(font_city_productions,
-                          apply_city_productions_font);
-  option_var_set_callback(font_reqtree_text,
-                          apply_reqtree_text_font);
-#undef option_var_set_callback
-}
-
-/**********************************************************************//**
-  Set the chatline buttons to reflect the state of the game and current
-  client options. This function should be called on game start.
-**************************************************************************/
-void refresh_chat_buttons(void)
-{
-  GtkWidget *button;
-
-  button = allied_chat_toggle_button;
-  fc_assert_ret(button != nullptr);
-  fc_assert_ret(GTK_IS_CHECK_BUTTON(button));
-
-  /* Hide the "Allies Only" button for local games. */
-  if (is_server_running()) {
-    gtk_widget_set_visible(button, FALSE);
-  } else {
-    gtk_widget_set_visible(button, TRUE);
-    gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
-                                GUI_GTK_OPTION(allied_chat_only));
-  }
-}
-
-/**********************************************************************//**
-  Handle a toggle of the "Allies Only" chat button.
-**************************************************************************/
-static void allied_chat_button_toggled(GtkToggleButton *button,
-                                       gpointer user_data)
-{
-  GUI_GTK_OPTION(allied_chat_only) = gtk_toggle_button_get_active(button);
-}
-
-/**********************************************************************//**
-  Insert build information to help
-**************************************************************************/
-void insert_client_build_info(char *outbuf, size_t outlen)
-{
-  cat_snprintf(outbuf, outlen, _("\nBuilt against gtk %d.%d.%d, using %d.%d.%d"
-                                 "\nBuilt against glib %d.%d.%d, using %d.%d.%d"),
-               GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
-               gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version(),
-               GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
-               glib_major_version, glib_minor_version, glib_micro_version);
-}
-
-/**********************************************************************//**
-  Return dimensions of primary monitor, if any
-  (in 'application pixels')
-**************************************************************************/
-static bool monitor_size(GdkRectangle *rect_p)
-{
-  GdkDisplay *display;
-  GdkMonitor *monitor;
-
-  display = gdk_display_get_default();
-  if (!display) {
-    return FALSE;
-  }
-
-  monitor = g_list_model_get_item(gdk_display_get_monitors(display), 0);
-
-  if (!monitor) {
-    return FALSE;
-  }
-
-  gdk_monitor_get_geometry(monitor, rect_p);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Return width of the primary monitor
-**************************************************************************/
-int screen_width(void)
-{
-  GdkRectangle rect;
-
-  if (vmode.width > 0) {
-    return vmode.width;
-  }
-
-  if (monitor_size(&rect)) {
-    return rect.width;
-  } else {
-    return 0;
-  }
-}
-
-/**********************************************************************//**
-  Return height of the primary monitor
-**************************************************************************/
-int screen_height(void)
-{
-  GdkRectangle rect;
-
-  if (vmode.height > 0) {
-    return vmode.height;
-  }
-
-  if (monitor_size(&rect)) {
-    return rect.height;
-  } else {
-    return 0;
-  }
-}
-
-/**********************************************************************//**
-  Give resolution requested by user, if any.
-**************************************************************************/
-struct video_mode *resolution_request_get(void)
-{
-  if (vmode.width > 0 && vmode.height > 0) {
-    return &vmode;
-  }
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  Make dynamic adjustments to first-launch default options.
-**************************************************************************/
-static void adjust_default_options(void)
-{
-  int scr_height = screen_height();
-
-  if (scr_height > 0) {
-    /* Adjust these options only if we do know the screen height. */
-
-    if (scr_height <= 480) {
-      /* Freeciv is practically unusable outside fullscreen mode in so
-       * small display */
-      log_verbose("Changing default to fullscreen due to very small screen");
-      GUI_GTK_OPTION(fullscreen) = TRUE;
-    }
-    if (scr_height < 1024) {
-      /* This is a small display */
-      log_verbose("Defaulting to small widget layout due to small screen");
-      GUI_GTK_OPTION(small_display_layout) = TRUE;
-      log_verbose("Defaulting to merged messages/chat due to small screen");
-      GUI_GTK_OPTION(message_chat_location) = GUI_GTK_MSGCHAT_MERGED;
-    }
-  }
-}
-
-/**********************************************************************//**
-  Return the client GtkApplication
-**************************************************************************/
-GtkApplication *gui_app(void)
-{
-  return fc_app;
-}
-
-/**********************************************************************//**
-  Define properties of this gui.
-**************************************************************************/
-void setup_gui_properties(void)
-{
-  gui_properties.animations = TRUE;
-  gui_properties.views.isometric = TRUE;
-  gui_properties.views.overhead = TRUE;
-}
diff --git a/client/gui-gtk-5.0/gui_main.h b/client/gui-gtk-5.0/gui_main.h
deleted file mode 100644
index 9348f7b641..0000000000
--- a/client/gui-gtk-5.0/gui_main.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__GUI_MAIN_H
-#define FC__GUI_MAIN_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "gui_main_g.h"
-#include "options.h"
-
-
-/* Mac uses "command"/"meta" key for menu accelerator modifier key */
-#ifdef __APPLE__
-#define ACCL_MOD_KEY "<Meta>"
-#define ACCL_MOD_MASK GDK_META_MASK
-#else
-#define ACCL_MOD_KEY "<ctrl>"
-#define ACCL_MOD_MASK GDK_CONTROL_MASK
-#endif
-
-#define GUI_NAME_FULL "gui-gtk-4.x"
-#define GUI_NAME_SHORT "gtk4x"
-
-#define GUI_GTK_OPTION(optname) gui_options.gui_gtk5_##optname
-#define GUI_GTK_OPTION_STR(optname) "gui_gtk5_" #optname
-#define GUI_GTK_DEFAULT_THEME_NAME FC_GTK5_DEFAULT_THEME_NAME
-
-void main_message_area_resize(void *data);
-void animation_idle_cb(void *data);
-
-/* Network string charset conversion */
-gchar *ntoh_str(const gchar *netstr);
-
-extern PangoFontDescription *city_names_style;
-extern PangoFontDescription *city_productions_style;
-extern PangoFontDescription *reqtree_text_style;
-
-#define single_tile_pixmap (mapview.single_tile->pixmap)
-
-extern GtkTextView *    main_message_area;
-extern GtkWidget *      text_scrollbar;
-extern GtkWidget *      toplevel;
-extern GtkWidget *      top_vbox;
-extern GtkWidget *      main_frame_civ_name;
-extern GtkWidget *      main_label_info;
-extern GtkWidget *      econ_label[10];
-extern GtkWidget *      bulb_label;
-extern GtkWidget *      sun_label;
-extern GtkWidget *      flake_label;
-extern GtkWidget *      government_label;
-extern GtkWidget *      econ_widget;
-extern GtkWidget *      map_canvas;             /* GtkDrawingArea */
-extern GtkWidget *      overview_canvas;        /* GtkDrawingArea */
-extern GtkWidget *      overview_scrolled_window;        /* GtkScrolledWindow */
-extern GtkWidget *      timeout_label;
-extern GtkWidget *      turn_done_button;
-extern GtkWidget *      unit_info_box;
-extern GtkWidget *      unit_info_label;
-extern GtkWidget *      unit_info_frame;
-extern GtkWidget *      map_horizontal_scrollbar;
-extern GtkWidget *      map_vertical_scrollbar;
-
-extern GtkWidget *      toplevel_tabs;
-extern GtkWidget *      top_notebook;
-extern GtkWidget *      map_widget;
-extern GtkWidget *      bottom_notebook;
-extern GtkWidget *      right_notebook;
-extern GtkTextBuffer *  message_buffer;
-
-extern int overview_canvas_store_width;
-extern int overview_canvas_store_height;
-
-gboolean map_canvas_focus(void);
-
-void reset_unit_table(void);
-void popup_quit_dialog(void);
-void quit_gtk_main(void);
-void refresh_chat_buttons(void);
-
-int screen_width(void);
-int screen_height(void);
-struct video_mode *resolution_request_get(void);
-
-void fullscreen_opt_refresh(struct option *poption);
-
-GtkApplication *gui_app(void);
-bool is_gui_up(void);
-
-gboolean terminate_signal_processing(GtkEventControllerFocus *controller,
-                                     gpointer data);
-
-gboolean fc_lost_focus(GtkEventControllerFocus *controller,
-                       gpointer data);
-gboolean fc_gained_focus(GtkEventControllerFocus *controller,
-                         gpointer data);
-
-void update_turn_done_tooltip(void);
-
-#endif /* FC__GUI_MAIN_H */
diff --git a/client/gui-gtk-5.0/gui_stuff.c b/client/gui-gtk-5.0/gui_stuff.c
deleted file mode 100644
index 9b4f51dfcb..0000000000
--- a/client/gui-gtk-5.0/gui_stuff.c
+++ /dev/null
@@ -1,1201 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "gui_main.h"
-
-#include "gui_stuff.h"
-
-
-static GList *dialog_list;
-
-static GtkSizeGroup *gui_action;
-
-static GtkCssProvider *dlg_tab_provider = NULL;
-
-
-/**********************************************************************//**
-  Draw widget now
-**************************************************************************/
-void gtk_expose_now(GtkWidget *w)
-{
-  gtk_widget_queue_draw(w);
-}
-
-/**********************************************************************//**
-  Create new icon button with label.
-
-  Current implementation sets either icon or label, preferring label,
-  never both. Caller should not rely on that, though.
-**************************************************************************/
-GtkWidget *icon_label_button_new(const gchar *icon_name,
-                                 const gchar *label_text)
-{
-  GtkWidget *button;
-
-  fc_assert(icon_name != NULL || label_text != NULL);
-
-  if (label_text != NULL) {
-    button = gtk_button_new_with_mnemonic(label_text);
-  } else if (icon_name != NULL) {
-    button = gtk_button_new_from_icon_name(icon_name);
-  } else {
-    button = NULL;
-  }
-
-  return button;
-}
-
-/**********************************************************************//**
-  Changes the label (with mnemonic) on an existing stockbutton.
-  See gtk_stockbutton_new().
-**************************************************************************/
-void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text)
-{
-  gtk_button_set_label(GTK_BUTTON(button), label_text);
-}
-
-/**********************************************************************//**
-  Returns gettext-converted list of n strings. The individual strings
-  in the list are as returned by gettext(). In case of no NLS, the strings
-  will be the original strings, so caller should ensure that the originals
-  persist for as long as required. (For no NLS, still allocate the
-  list, for consistency.)
-
-  (This is not directly gui/gtk related, but it fits in here
-  because so far it is used for doing i18n for gtk titles...)
-**************************************************************************/
-void intl_slist(int n, const char **s, bool *done)
-{
-  int i;
-
-  if (!*done) {
-    for (i = 0; i < n; i++) {
-      s[i] = Q_(s[i]);
-    }
-
-    *done = TRUE;
-  }
-}
-
-/**********************************************************************//**
-  Set itree to the beginning
-**************************************************************************/
-void itree_begin(GtkTreeModel *model, ITree *it)
-{
-  it->model = model;
-  it->end = !gtk_tree_model_get_iter_first(it->model, &it->it);
-}
-
-/**********************************************************************//**
-  Return whether itree end has been reached
-**************************************************************************/
-gboolean itree_end(ITree *it)
-{
-  return it->end;
-}
-
-/**********************************************************************//**
-  Make itree to go forward one step
-**************************************************************************/
-void itree_next(ITree *it)
-{
-  it->end = !gtk_tree_model_iter_next(it->model, &it->it);
-}
-
-/**********************************************************************//**
-  Store values to itree
-**************************************************************************/
-void itree_set(ITree *it, ...)
-{
-  va_list ap;
-
-  va_start(ap, it);
-  gtk_tree_store_set_valist(GTK_TREE_STORE(it->model), &it->it, ap);
-  va_end(ap);
-}
-
-/**********************************************************************//**
-  Get values from itree
-**************************************************************************/
-void itree_get(ITree *it, ...)
-{
-  va_list ap;
-
-  va_start(ap, it);
-  gtk_tree_model_get_valist(it->model, &it->it, ap);
-  va_end(ap);
-}
-
-/**********************************************************************//**
-  Append one item to the end of tree store
-**************************************************************************/
-void tstore_append(GtkTreeStore *store, ITree *it, ITree *parent)
-{
-  it->model = GTK_TREE_MODEL(store);
-  if (parent)
-    gtk_tree_store_append(GTK_TREE_STORE(it->model), &it->it, &parent->it);
-  else
-    gtk_tree_store_append(GTK_TREE_STORE(it->model), &it->it, NULL);
-  it->end = FALSE;
-}
-
-/**********************************************************************//**
-  Return whether current itree item is selected
-**************************************************************************/
-gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it)
-{
-  return gtk_tree_selection_iter_is_selected(selection, &it->it);
-}
-
-/**********************************************************************//**
-  Add current itree item to selection
-**************************************************************************/
-void itree_select(GtkTreeSelection *selection, ITree *it)
-{
-  gtk_tree_selection_select_iter(selection, &it->it);
-}
-
-/**********************************************************************//**
-  Remove current itree item from selection
-**************************************************************************/
-void itree_unselect(GtkTreeSelection *selection, ITree *it)
-{
-  gtk_tree_selection_unselect_iter(selection, &it->it);
-}
-
-/**********************************************************************//**
-  Return the selected row in a GtkTreeSelection.
-  If no row is selected return -1.
-**************************************************************************/
-gint gtk_tree_selection_get_row(GtkTreeSelection *selection)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  gint row = -1;
-
-  if (gtk_tree_selection_get_selected(selection, &model, &it)) {
-    GtkTreePath *path;
-    gint *idx;
-
-    path = gtk_tree_model_get_path(model, &it);
-    idx = gtk_tree_path_get_indices(path);
-    row = idx[0];
-    gtk_tree_path_free(path);
-  }
-
-  return row;
-}
-
-/**********************************************************************//**
-  Give focus to view
-**************************************************************************/
-void gtk_tree_view_focus(GtkTreeView *view)
-{
-  GtkTreeModel *model;
-  GtkTreePath *path;
-  GtkTreeIter iter;
-
-  if ((model = gtk_tree_view_get_model(view))
-      && gtk_tree_model_get_iter_first(model, &iter)
-      && (path = gtk_tree_model_get_path(model, &iter))) {
-    gtk_tree_view_set_cursor(view, path, NULL, FALSE);
-    gtk_tree_path_free(path);
-    gtk_widget_grab_focus(GTK_WIDGET(view));
-  }
-}
-
-/**********************************************************************//**
-  Create an auxiliary menubar (i.e., not the main menubar at the top of
-  the window).
-**************************************************************************/
-GtkWidget *aux_menu_new(void)
-{
-  GtkWidget *menu_button = gtk_menu_button_new();
-
-  return menu_button;
-}
-
-/**********************************************************************//**
-  Generic close callback for all dialogs
-**************************************************************************/
-static void close_callback(GtkDialog *dialog, gpointer data)
-{
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
-
-/**********************************************************************//**
-  This function handles new windows which are subwindows to the
-  toplevel window. It must be called on every dialog in the game,
-  so fullscreen windows are handled properly by the window manager.
-**************************************************************************/
-void setup_dialog(GtkWidget *shell, GtkWidget *parent)
-{
-  if (GTK_IS_WINDOW(shell)
-      && (GUI_GTK_OPTION(dialogs_on_top) || GUI_GTK_OPTION(fullscreen))) {
-    gtk_window_set_transient_for(GTK_WINDOW(shell),
-                                 GTK_WINDOW(parent));
-  }
-
-  /* Close dialog window on Escape keypress. */
-  if (GTK_IS_DIALOG(shell)) {
-    GtkEventController *controller;
-
-    controller = GTK_EVENT_CONTROLLER(gtk_event_controller_focus_new());
-    g_signal_connect(controller, "enter",
-                     G_CALLBACK(fc_gained_focus), NULL);
-    g_signal_connect(controller, "leave",
-                     G_CALLBACK(fc_lost_focus), NULL);
-    gtk_widget_add_controller(shell, controller);
-
-    g_signal_connect_after(shell, "close", G_CALLBACK(close_callback), shell);
-  }
-}
-
-/**********************************************************************//**
-  Emit a dialog response.
-**************************************************************************/
-static void gui_dialog_response(struct gui_dialog *dlg, int response)
-{
-  if (dlg->response_callback) {
-    (*dlg->response_callback)(dlg, response, dlg->user_data);
-  }
-}
-
-/**********************************************************************//**
-  Default dialog response handler. Destroys the dialog.
-**************************************************************************/
-static void gui_dialog_destroyed(struct gui_dialog *dlg, int response,
-                                 gpointer data)
-{
-  gui_dialog_destroy(dlg);
-}
-
-/**********************************************************************//**
-  Cleanups the leftovers after a dialog is destroyed.
-**************************************************************************/
-static void gui_dialog_destroy_handler(GtkWidget *w, struct gui_dialog *dlg)
-{
-  if (dlg->type == GUI_DIALOG_TAB) {
-    GtkWidget *notebook = dlg->v.tab.notebook;
-    gulong handler_id = dlg->v.tab.handler_id;
-
-    g_signal_handler_disconnect(notebook, handler_id);
-  }
-
-  g_object_unref(dlg->gui_button);
-
-  if (*(dlg->source)) {
-    *(dlg->source) = NULL;
-  }
-
-  dialog_list = g_list_remove(dialog_list, dlg);
-
-  /* Raise the return dialog set by gui_dialog_set_return_dialog() */
-  if (dlg->return_dialog_id != -1) {
-    GList *it;
-
-    for (it = dialog_list; it; it = g_list_next(it)) {
-      struct gui_dialog *adialog = (struct gui_dialog *)it->data;
-
-      if (adialog->id == dlg->return_dialog_id) {
-        gui_dialog_raise(adialog);
-        break;
-      }
-    }
-  }
-
-  if (dlg->title) {
-    free(dlg->title);
-  }
-
-  free(dlg);
-}
-
-/**********************************************************************//**
-  Emit a delete event response on dialog deletion in case the end-user
-  needs to know when a deletion took place.
-  Popup dialog version
-**************************************************************************/
-static gint gui_dialog_delete_handler(GtkWidget *widget, gpointer data)
-{
-  struct gui_dialog *dlg = data;
-
-  /* emit response signal. */
-  gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT);
-
-  /* do the destroy by default. */
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Emit a delete event response on dialog deletion in case the end-user
-  needs to know when a deletion took place.
-  TAB version
-**************************************************************************/
-static gint gui_dialog_delete_tab_handler(struct gui_dialog* dlg)
-{
-  GtkWidget* notebook;
-  int n;
-
-  notebook = dlg->v.tab.notebook;
-  n = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
-  if (gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), n)
-      != dlg->v.tab.child) {
-    gui_dialog_set_return_dialog(dlg, NULL);
-  }
-
-  /* Emit response signal. */
-  gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT);
-
-  /* Do the destroy by default. */
-  return FALSE;
-}
-
-
-/**********************************************************************//**
-  Allow the user to close a dialog using Escape or CTRL+W.
-**************************************************************************/
-static gboolean gui_dialog_key_press_handler(GtkEventControllerKey *controller,
-                                             guint keyval, guint keycode,
-                                             GdkModifierType state,
-                                             gpointer data)
-{
-  struct gui_dialog *dlg = (struct gui_dialog *)data;
-
-  if (keyval == GDK_KEY_Escape
-      || ((state & GDK_CONTROL_MASK) && keyval == GDK_KEY_w)) {
-    /* Emit response signal. */
-    gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT);
-  }
-
-  /* Propagate event further. */
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Resets tab colour on tab activation.
-**************************************************************************/
-static void gui_dialog_switch_page_handler(GtkNotebook *notebook,
-                                           GtkWidget *page,
-                                           guint num,
-                                           struct gui_dialog *dlg)
-{
-  gint n;
-
-  n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid);
-
-  if (n == num) {
-    gtk_widget_remove_css_class(dlg->v.tab.label, "alert");
-    gtk_widget_remove_css_class(dlg->v.tab.label, "notice");
-  }
-}
-
-/**********************************************************************//**
-  Changes a tab into a window.
-**************************************************************************/
-static void gui_dialog_detach(struct gui_dialog *dlg)
-{
-  gint n;
-  GtkWidget *window, *notebook;
-  gulong handler_id;
-
-  if (dlg->type != GUI_DIALOG_TAB) {
-    return;
-  }
-  dlg->type = GUI_DIALOG_WINDOW;
-
-  /* Create a new reference to the main widget, so it won't be
-   * destroyed in gtk_notebook_remove_page() */
-  g_object_ref(dlg->grid);
-
-  /* Remove widget from the notebook */
-  notebook = dlg->v.tab.notebook;
-  handler_id = dlg->v.tab.handler_id;
-  g_signal_handler_disconnect(notebook, handler_id);
-
-  n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid);
-  gtk_notebook_remove_page(GTK_NOTEBOOK(dlg->v.tab.notebook), n);
-
-
-  /* Create window and put the widget inside */
-  window = gtk_window_new();
-  gtk_window_set_title(GTK_WINDOW(window), dlg->title);
-  setup_dialog(window, toplevel);
-
-  gtk_window_set_child(GTK_WINDOW(window), dlg->grid);
-  dlg->v.window = window;
-  g_signal_connect(window, "close-request",
-                   G_CALLBACK(gui_dialog_delete_handler), dlg);
-
-  gtk_window_set_default_size(GTK_WINDOW(dlg->v.window),
-                              dlg->default_width,
-                              dlg->default_height);
-  gtk_widget_set_visible(window, TRUE);
-}
-
-/**********************************************************************//**
-  Someone has clicked on a label in a notebook
-**************************************************************************/
-static gboolean click_on_tab_callback(GtkGestureClick *gesture,
-                                      int n_press,
-                                      double x, double y, gpointer data)
-{
-  if (n_press == 2) {
-    gui_dialog_detach((struct gui_dialog *)data);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Creates a new dialog. It will be a tab or a window depending on the
-  current user setting of 'enable_tabs' gtk-gui option.
-  Sets pdlg to point to the dialog once it is create, Zeroes pdlg on
-  dialog destruction.
-  user_data will be passed through response function
-  check_top indicates if the layout decision should depend on the parent.
-**************************************************************************/
-void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook,
-                    gpointer user_data, bool check_top)
-{
-  struct gui_dialog *dlg;
-  GtkWidget *action_area;
-  static int dialog_id_counter;
-  GtkEventController *controller;
-
-  dlg = fc_malloc(sizeof(*dlg));
-  dialog_list = g_list_prepend(dialog_list, dlg);
-
-  dlg->source = pdlg;
-  *pdlg = dlg;
-  dlg->user_data = user_data;
-  dlg->title = NULL;
-
-  dlg->default_width = 200;
-  dlg->default_height = 300;
-
-  if (GUI_GTK_OPTION(enable_tabs)) {
-    dlg->type = GUI_DIALOG_TAB;
-  } else {
-    dlg->type = GUI_DIALOG_WINDOW;
-  }
-
-  if (!gui_action) {
-    gui_action = gtk_size_group_new(GTK_SIZE_GROUP_VERTICAL);
-  }
-  dlg->gui_button = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-
-  dlg->grid = gtk_grid_new();
-  dlg->content_counter = 0;
-  if (GUI_GTK_OPTION(enable_tabs)
-      && (check_top && notebook != GTK_NOTEBOOK(top_notebook))
-      && !GUI_GTK_OPTION(small_display_layout)) {
-    /* We expect this to be short (as opposed to tall); maximise usable
-     * height by putting buttons down the right hand side */
-    action_area = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
-    dlg->vertical_content = FALSE;
-  } else {
-    /* We expect this to be reasonably tall; maximise usable width by
-     * putting buttons along the bottom */
-    action_area = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(dlg->grid),
-                                   GTK_ORIENTATION_VERTICAL);
-    dlg->vertical_content = TRUE;
-  }
-
-  gtk_widget_set_visible(dlg->grid, TRUE);
-  gui_dialog_add_content_widget(dlg, action_area);
-  gtk_widget_set_visible(action_area, TRUE);
-
-  gtk_widget_set_margin_start(dlg->grid, 2);
-  gtk_widget_set_margin_end(dlg->grid, 2);
-  gtk_widget_set_margin_top(dlg->grid, 2);
-  gtk_widget_set_margin_bottom(dlg->grid, 2);
-
-  gtk_widget_set_margin_start(action_area, 2);
-  gtk_widget_set_margin_end(action_area, 2);
-  gtk_widget_set_margin_top(action_area, 2);
-  gtk_widget_set_margin_bottom(action_area, 2);
-
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    {
-      GtkWidget *window;
-
-      window = gtk_window_new();
-      gtk_widget_set_name(window, "Freeciv");
-      setup_dialog(window, toplevel);
-
-      gtk_window_set_child(GTK_WINDOW(window), dlg->grid);
-      dlg->v.window = window;
-      g_signal_connect(window, "close-request",
-        G_CALLBACK(gui_dialog_delete_handler), dlg);
-
-    }
-    break;
-  case GUI_DIALOG_TAB:
-    {
-      GtkWidget *hbox, *label, *button;
-      gchar *buf;
-
-      hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-
-      label = gtk_label_new(NULL);
-      gtk_widget_set_halign(label, GTK_ALIGN_START);
-      gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-      gtk_widget_set_margin_start(label, 4);
-      gtk_widget_set_margin_end(label, 4);
-      gtk_widget_set_margin_top(label, 0);
-      gtk_widget_set_margin_bottom(label, 0);
-      gtk_box_append(GTK_BOX(hbox), label);
-
-      button = gtk_button_new();
-      gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-      g_signal_connect_swapped(button, "clicked",
-                               G_CALLBACK(gui_dialog_delete_tab_handler), dlg);
-
-      buf = g_strdup_printf(_("Close Tab:\n%s"), _("Ctrl+W"));
-      gtk_widget_set_tooltip_text(button, buf);
-      g_free(buf);
-
-      gtk_button_set_icon_name(GTK_BUTTON(button), "window-close");
-
-      gtk_box_append(GTK_BOX(hbox), button);
-
-      gtk_widget_set_visible(hbox, TRUE);
-
-      gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dlg->grid, hbox);
-      dlg->v.tab.handler_id
-        = g_signal_connect(notebook, "switch-page",
-                           G_CALLBACK(gui_dialog_switch_page_handler), dlg);
-      dlg->v.tab.child = dlg->grid;
-
-      dlg->v.tab.label = label;
-      dlg->v.tab.notebook = GTK_WIDGET(notebook);
-
-      controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-      g_signal_connect(controller, "pressed",
-                       G_CALLBACK(click_on_tab_callback), dlg);
-      gtk_widget_add_controller(hbox, controller);
-    }
-    break;
-  }
-
-  dlg->actions = action_area;
-
-  dlg->response_callback = gui_dialog_destroyed;
-
-  dlg->id = dialog_id_counter;
-  dialog_id_counter++;
-  dlg->return_dialog_id = -1;
-
-  g_signal_connect(dlg->grid, "destroy",
-                   G_CALLBACK(gui_dialog_destroy_handler), dlg);
-  controller = gtk_event_controller_key_new();
-  g_signal_connect(controller, "key-pressed",
-                   G_CALLBACK(gui_dialog_key_press_handler), dlg);
-  gtk_widget_add_controller(dlg->grid, controller);
-
-  g_object_set_data(G_OBJECT(dlg->grid), "gui-dialog-data", dlg);
-}
-
-/**********************************************************************//**
-  Called when a dialog button is activated.
-**************************************************************************/
-static void action_widget_activated(GtkWidget *button, GtkWidget *vbox)
-{
-  struct gui_dialog *dlg =
-    g_object_get_data(G_OBJECT(vbox), "gui-dialog-data");
-  gpointer arg2 =
-    g_object_get_data(G_OBJECT(button), "gui-dialog-response-data");
-
-  gui_dialog_response(dlg, GPOINTER_TO_INT(arg2));
-}
-
-/**********************************************************************//**
-  Places a button into a dialog, taking care of setting up signals, etc.
-**************************************************************************/
-static void gui_dialog_pack_button(struct gui_dialog *dlg, GtkWidget *button,
-                                   int response)
-{
-  gint signal_id;
-
-  fc_assert_ret(GTK_IS_BUTTON(button));
-
-  g_object_set_data(G_OBJECT(button), "gui-dialog-response-data",
-      GINT_TO_POINTER(response));
-
-  if ((signal_id = g_signal_lookup("clicked", GTK_TYPE_BUTTON))) {
-    GClosure *closure;
-
-    closure = g_cclosure_new_object(G_CALLBACK(action_widget_activated),
-                                    G_OBJECT(dlg->grid));
-    g_signal_connect_closure_by_id(button, signal_id, 0, closure, FALSE);
-  }
-
-  gui_dialog_add_action_widget(dlg, button);
-  gtk_size_group_add_widget(dlg->gui_button, button);
-}
-
-/**********************************************************************//**
-  Adds a button to a dialog.
-**************************************************************************/
-GtkWidget *gui_dialog_add_button(struct gui_dialog *dlg,
-                                 const char *icon_name,
-                                 const char *text, int response)
-{
-  GtkWidget *button;
-
-  button = icon_label_button_new(icon_name, text);
-  gui_dialog_pack_button(dlg, button, response);
-
-  return button;
-}
-
-/**********************************************************************//**
-  Adds a widget to a dialog.
-**************************************************************************/
-GtkWidget *gui_dialog_add_action_widget(struct gui_dialog *dlg,
-                                        GtkWidget *widget)
-{
-  gtk_box_append(GTK_BOX(dlg->actions), widget);
-
-  gtk_size_group_add_widget(gui_action, widget);
-
-  return widget;
-}
-
-/**********************************************************************//**
-  Change the sensitivity of a dialog button.
-**************************************************************************/
-void gui_dialog_set_response_sensitive(struct gui_dialog *dlg,
-                                       int response, bool setting)
-{
-  GtkWidget *iter;
-
-  for (iter = gtk_widget_get_first_child(dlg->actions);
-       iter != NULL;
-       iter = gtk_widget_get_next_sibling(iter)) {
-    if (GTK_IS_BUTTON(iter)) {
-      gpointer data = g_object_get_data(G_OBJECT(iter),
-                                        "gui-dialog-response-data");
-
-      if (response == GPOINTER_TO_INT(data)) {
-        gtk_widget_set_sensitive(iter, setting);
-      }
-    }
-  }
-}
-
-/**********************************************************************//**
-  Get the dialog's toplevel window.
-**************************************************************************/
-GtkWidget *gui_dialog_get_toplevel(struct gui_dialog *dlg)
-{
-  return gtk_widget_get_ancestor(dlg->grid, GTK_TYPE_WINDOW);
-}
-
-/**********************************************************************//**
-  Show the dialog contents, but not the dialog per se.
-**************************************************************************/
-void gui_dialog_show_all(struct gui_dialog *dlg)
-{
-  gtk_widget_set_visible(dlg->grid, TRUE);
-
-  if (dlg->type == GUI_DIALOG_TAB) {
-    GtkWidget *iter;
-    gint num_visible = 0;
-
-    for (iter = gtk_widget_get_first_child(dlg->actions);
-         iter != NULL;
-         iter = gtk_widget_get_next_sibling(iter)) {
-      if (!GTK_IS_BUTTON(iter)) {
-        num_visible++;
-      } else {
-        gpointer data = g_object_get_data(G_OBJECT(iter),
-                                          "gui-dialog-response-data");
-        int response = GPOINTER_TO_INT(data);
-
-        if (response != GTK_RESPONSE_CLOSE
-            && response != GTK_RESPONSE_CANCEL) {
-          num_visible++;
-        } else {
-          gtk_widget_set_visible(iter, FALSE);
-        }
-      }
-    }
-
-    if (num_visible == 0) {
-      gtk_widget_set_visible(dlg->actions, FALSE);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Notify the user the dialog has changed.
-**************************************************************************/
-void gui_dialog_present(struct gui_dialog *dlg)
-{
-  fc_assert_ret(nullptr != dlg);
-
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    gtk_widget_set_visible(dlg->v.window, TRUE);
-    break;
-  case GUI_DIALOG_TAB:
-    {
-      GtkNotebook *notebook = GTK_NOTEBOOK(dlg->v.tab.notebook);
-      gint current, n;
-
-      current = gtk_notebook_get_current_page(notebook);
-      n = gtk_notebook_page_num(notebook, dlg->grid);
-
-      if (current != n) {
-        gtk_widget_add_css_class(dlg->v.tab.label, "notice");
-      }
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Raise dialog to top.
-**************************************************************************/
-void gui_dialog_raise(struct gui_dialog *dlg)
-{
-  fc_assert_ret(NULL != dlg);
-
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    gtk_window_present(GTK_WINDOW(dlg->v.window));
-    break;
-  case GUI_DIALOG_TAB:
-    {
-      GtkNotebook *notebook = GTK_NOTEBOOK(dlg->v.tab.notebook);
-      gint n;
-
-      n = gtk_notebook_page_num(notebook, dlg->grid);
-      gtk_notebook_set_current_page(notebook, n);
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Alert the user to an important event.
-**************************************************************************/
-void gui_dialog_alert(struct gui_dialog *dlg)
-{
-  fc_assert_ret(NULL != dlg);
-
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    break;
-  case GUI_DIALOG_TAB:
-    {
-      GtkNotebook *notebook = GTK_NOTEBOOK(dlg->v.tab.notebook);
-      gint current, n;
-
-      current = gtk_notebook_get_current_page(notebook);
-      n = gtk_notebook_page_num(notebook, dlg->grid);
-
-      if (current != n) {
-        /* Have only alert - remove notice if it exist. */
-        gtk_widget_remove_css_class(dlg->v.tab.label, "notice");
-        gtk_widget_add_css_class(dlg->v.tab.label, "alert");
-      }
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Sets the dialog's default size (applies to toplevel windows only).
-**************************************************************************/
-void gui_dialog_set_default_size(struct gui_dialog *dlg, int width, int height)
-{
-  dlg->default_width = width;
-  dlg->default_height = height;
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    gtk_window_set_default_size(GTK_WINDOW(dlg->v.window), width, height);
-    break;
-  case GUI_DIALOG_TAB:
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Changes a dialog's title.
-**************************************************************************/
-void gui_dialog_set_title(struct gui_dialog *dlg, const char *title)
-{
-  if (dlg->title) {
-    free(dlg->title);
-  }
-  dlg->title = fc_strdup(title);
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    gtk_window_set_title(GTK_WINDOW(dlg->v.window), title);
-    break;
-  case GUI_DIALOG_TAB:
-    gtk_label_set_text_with_mnemonic(GTK_LABEL(dlg->v.tab.label), title);
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Destroy a dialog.
-**************************************************************************/
-void gui_dialog_destroy(struct gui_dialog *dlg)
-{
-  switch (dlg->type) {
-  case GUI_DIALOG_WINDOW:
-    gtk_window_destroy(GTK_WINDOW(dlg->v.window));
-    break;
-  case GUI_DIALOG_TAB:
-    {
-      gint n;
-
-      n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid);
-      gtk_notebook_remove_page(GTK_NOTEBOOK(dlg->v.tab.notebook), n);
-    }
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Destroy all dialogs.
-**************************************************************************/
-void gui_dialog_destroy_all(void)
-{
-  GList *it, *it_next;
-
-  for (it = dialog_list; it; it = it_next) {
-    it_next = g_list_next(it);
-
-    gui_dialog_destroy((struct gui_dialog *)it->data);
-  }
-}
-
-/**********************************************************************//**
-  Set the response callback for a dialog.
-**************************************************************************/
-void gui_dialog_response_set_callback(struct gui_dialog *dlg,
-    GUI_DIALOG_RESPONSE_FUN fun)
-{
-  dlg->response_callback = fun;
-}
-
-/**********************************************************************//**
-  When the dlg dialog is destroyed the return_dialog will be raised
-**************************************************************************/
-void gui_dialog_set_return_dialog(struct gui_dialog *dlg,
-                                  struct gui_dialog *return_dialog)
-{
-  if (return_dialog == NULL) {
-    dlg->return_dialog_id = -1;
-  } else {
-    dlg->return_dialog_id = return_dialog->id;
-  }
-}
-
-/**********************************************************************//**
-  Updates a gui font style.
-**************************************************************************/
-void gui_update_font(const char *font_name, const char *font_value)
-{
-  char *str;
-  GtkCssProvider *provider;
-  PangoFontDescription *desc;
-  int size;
-  const char *fam;
-  const char *style;
-  const char *weight;
-
-  desc = pango_font_description_from_string(font_value);
-
-  if (desc == NULL) {
-    return;
-  }
-
-  fam = pango_font_description_get_family(desc);
-
-  if (fam == NULL) {
-    return;
-  }
-
-  if (pango_font_description_get_style(desc) == PANGO_STYLE_ITALIC) {
-    style = "\n font-style: italic;";
-  } else {
-    style = "";
-  }
-
-  if (pango_font_description_get_weight(desc) >= 700) {
-    weight = "\n font-weight: bold;";
-  } else {
-    weight = "";
-  }
-
-  size = pango_font_description_get_size(desc);
-
-  if (size != 0) {
-    if (pango_font_description_get_size_is_absolute(desc)) {
-      str = g_strdup_printf("#Freeciv #%s { font-family: %s; font-size: %dpx;%s%s}",
-                            font_name, fam, size / PANGO_SCALE, style, weight);
-    } else {
-      str = g_strdup_printf("#Freeciv #%s { font-family: %s; font-size: %dpt;%s%s}",
-                            font_name, fam, size / PANGO_SCALE, style, weight);
-    }
-  } else {
-    str = g_strdup_printf("#Freeciv #%s { font-family: %s;%s%s}",
-                          font_name, fam, style, weight);
-  }
-
-  pango_font_description_free(desc);
-
-  provider = gtk_css_provider_new();
-  gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider),
-                                  str, -1);
-  gtk_style_context_add_provider_for_display(
-    gtk_widget_get_display(toplevel), GTK_STYLE_PROVIDER(provider),
-    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  g_free(str);
-}
-
-/**********************************************************************//**
-  Update a font option which is not attached to a widget.
-**************************************************************************/
-void gui_update_font_full(const char *font_name, const char *font_value,
-                          PangoFontDescription **font_desc)
-{
-  PangoFontDescription *f_desc;
-
-  gui_update_font(font_name, font_value);
-
-  f_desc = pango_font_description_from_string(font_value);
-  pango_font_description_free(*font_desc);
-
-  *font_desc = f_desc;
-}
-
-/**********************************************************************//**
-  Temporarily disable signal invocation of the given callback for the given
-  GObject. Re-enable the signal with enable_gobject_callback.
-**************************************************************************/
-void disable_gobject_callback(GObject *obj, GCallback cb)
-{
-  gulong hid;
-
-  if (!obj || !cb) {
-    return;
-  }
-
-  hid = g_signal_handler_find(obj, G_SIGNAL_MATCH_FUNC,
-                              0, 0, NULL, cb, NULL);
-  g_signal_handler_block(obj, hid);
-}
-
-/**********************************************************************//**
-  Re-enable a signal callback blocked by disable_gobject_callback.
-**************************************************************************/
-void enable_gobject_callback(GObject *obj, GCallback cb)
-{
-  gulong hid;
-
-  if (!obj || !cb) {
-    return;
-  }
-
-  hid = g_signal_handler_find(obj, G_SIGNAL_MATCH_FUNC,
-                              0, 0, NULL, cb, NULL);
-  g_signal_handler_unblock(obj, hid);
-}
-
-/**********************************************************************//**
-  Convenience function to add a column to a GtkTreeView. Returns the added
-  column, or NULL if an error occurred.
-**************************************************************************/
-GtkTreeViewColumn *add_treeview_column(GtkWidget *view, const char *title,
-                                       GType gtype, int model_index)
-{
-  GtkTreeViewColumn *col;
-  GtkCellRenderer *rend;
-  const char *attr;
-
-  fc_assert_ret_val(view != NULL, NULL);
-  fc_assert_ret_val(GTK_IS_TREE_VIEW(view), NULL);
-  fc_assert_ret_val(title != NULL, NULL);
-
-  if (gtype == G_TYPE_BOOLEAN) {
-    rend = gtk_cell_renderer_toggle_new();
-    attr = "active";
-  } else if (gtype == GDK_TYPE_PIXBUF) {
-    rend = gtk_cell_renderer_pixbuf_new();
-    attr = "pixbuf";
-  } else {
-    rend = gtk_cell_renderer_text_new();
-    attr = "text";
-  }
-
-  col = gtk_tree_view_column_new_with_attributes(title, rend, attr,
-                                                 model_index, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  return col;
-}
-
-/**********************************************************************//**
-  Prepare dialog tab style provider.
-**************************************************************************/
-void dlg_tab_provider_prepare(void)
-{
-  dlg_tab_provider = gtk_css_provider_new();
-
-  gtk_css_provider_load_from_data(dlg_tab_provider,
-                                  ".alert {\n"
-                                  "color: rgba(255, 0, 0, 255);\n"
-                                  "}\n"
-                                  ".notice {\n"
-                                  "color: rgba(0, 0, 255, 255);\n"
-                                  "}\n",
-                                  -1);
-
-  gtk_style_context_add_provider_for_display(
-                                     gtk_widget_get_display(toplevel),
-                                     GTK_STYLE_PROVIDER(dlg_tab_provider),
-                                     GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-}
-
-/**********************************************************************//**
-  Add widget to the gui_dialog grid
-**************************************************************************/
-void gui_dialog_add_content_widget(struct gui_dialog *dlg, GtkWidget *wdg)
-{
-  if (dlg->vertical_content) {
-    gtk_grid_attach(GTK_GRID(dlg->grid), wdg,
-                    0, dlg->content_counter++, 1, 1);
-  } else {
-    gtk_grid_attach(GTK_GRID(dlg->grid), wdg,
-                    dlg->content_counter++, 0, 1, 1);
-  }
-}
-
-struct blocking_dialog_data {
-  GMainLoop *loop;
-  gint response;
-};
-
-/**********************************************************************//**
-  Received a response to a blocking dialog
-**************************************************************************/
-static void blocking_dialog_response(GtkWidget *dlg, gint response, void *data)
-{
-  struct blocking_dialog_data *bd_data = (struct blocking_dialog_data *)data;
-
-  bd_data->response = response;
-
-  g_main_loop_quit(bd_data->loop);
-}
-
-/**********************************************************************//**
-  Present a blocking dialog and wait for response
-**************************************************************************/
-gint blocking_dialog(GtkWidget *dlg)
-{
-  struct blocking_dialog_data data;
-  GMainLoop *dlg_loop;
-
-  gtk_widget_set_visible(dlg, TRUE);
-  dlg_loop = g_main_loop_new(nullptr, FALSE);
-  data.loop = dlg_loop;
-  g_signal_connect(dlg, "response", G_CALLBACK(blocking_dialog_response),
-                   &data);
-
-  g_main_loop_run(dlg_loop);
-
-  return data.response;
-}
-
-/**********************************************************************//**
-  Nullify GtkWidget pointer when widget is destroyed
-**************************************************************************/
-void widget_destroyed(GtkWidget *wdg, void *data)
-{
-  *(GtkWidget **)data = NULL;
-}
-
-/**********************************************************************//**
-  Get child widget for a widget whose own type is not known
-  (without further GTK_IS_...() checks) in the caller side.
-**************************************************************************/
-GtkWidget *widget_get_child(GtkWidget *wdg)
-{
-  return gtk_widget_get_first_child(wdg);
-}
-
-/**********************************************************************//**
-  Callback for alert dialog that can only be closed.
-**************************************************************************/
-void alert_close_response(GObject *dialog, GAsyncResult *result,
-                          gpointer data)
-{
-  gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog), result, NULL);
-}
-
-/**********************************************************************//**
-  Get GtkColumnView row at given y coordinate
-**************************************************************************/
-int get_column_view_row(GtkWidget *cview, int y)
-{
-  GtkWidget *child = gtk_widget_get_first_child(gtk_widget_get_next_sibling(gtk_widget_get_first_child(cview)));
-  int row_number = -1; /* 0 after header */
-  int curr_y = 0;
-
-  while (GTK_IS_WIDGET(child)) {
-    curr_y += gtk_widget_get_height(GTK_WIDGET(child));
-
-    if (curr_y > y) {
-      return row_number;
-    }
-
-    row_number++;
-
-    child = gtk_widget_get_next_sibling(child);
-  }
-
-  return -1;
-}
diff --git a/client/gui-gtk-5.0/gui_stuff.h b/client/gui-gtk-5.0/gui_stuff.h
deleted file mode 100644
index b6b47c11d9..0000000000
--- a/client/gui-gtk-5.0/gui_stuff.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__GUI_STUFF_H
-#define FC__GUI_STUFF_H
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "shared.h"
-
-GtkWidget *icon_label_button_new(const gchar *icon_name,
-                                 const gchar *label_text);
-void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text);
-void gtk_expose_now(GtkWidget *w);
-
-void intl_slist(int n, const char **s, bool *done);
-
-/* The standard GTK+ 2.0 API is braindamaged. this is slightly better! */
-
-typedef struct
-{
-  GtkTreeModel *model;
-  gboolean end;
-  GtkTreeIter it;
-} ITree;
-
-#define TREE_ITER_PTR(x)        (&(x).it)
-
-void itree_begin(GtkTreeModel *model, ITree *it);
-gboolean itree_end(ITree *it);
-void itree_next(ITree *it);
-void itree_get(ITree *it, ...);
-void itree_set(ITree *it, ...);
-
-void tstore_append(GtkTreeStore *store, ITree *it, ITree *parent);
-
-gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it);
-void itree_select(GtkTreeSelection *selection, ITree *it);
-void itree_unselect(GtkTreeSelection *selection, ITree *it);
-
-gint gtk_tree_selection_get_row(GtkTreeSelection *selection);
-void gtk_tree_view_focus(GtkTreeView *view);
-void setup_dialog(GtkWidget *shell, GtkWidget *parent);
-GtkTreeViewColumn *add_treeview_column(GtkWidget *view, const char *title,
-                                       GType gtype, int model_index);
-
-GtkWidget *aux_menu_new(void);
-
-enum gui_dialog_type {
-  GUI_DIALOG_WINDOW,
-  GUI_DIALOG_TAB
-};
-
-struct gui_dialog;
-
-typedef void (*GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer);
-
-struct gui_dialog
-{
-  /* Public. */
-  GtkWidget *grid;
-  GtkWidget *actions;
-
-  /* Private. */
-  char *title;
-  enum gui_dialog_type type;
-  int id;
-  int return_dialog_id;
-
-  int default_width;
-  int default_height;
-
-  bool vertical_content;
-  int content_counter;
-
-  union {
-    GtkWidget *window;
-    struct {
-      GtkWidget *label;
-      GtkWidget *notebook;
-      gulong handler_id;
-      GtkWidget *child;
-    } tab;
-  } v;
-
-  struct gui_dialog **source;
-
-  GUI_DIALOG_RESPONSE_FUN response_callback;
-  gpointer user_data;
-
-  GtkSizeGroup *gui_button;
-};
-
-void dlg_tab_provider_prepare(void);
-
-void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook,
-                    gpointer user_data, bool check_top);
-GtkWidget *gui_dialog_add_button(struct gui_dialog *dlg,
-                                 const char *icon_name,
-                                 const char *text, int response);
-GtkWidget *gui_dialog_add_action_widget(struct gui_dialog *dlg,
-                                        GtkWidget *widget);
-void gui_dialog_add_content_widget(struct gui_dialog *dlg,
-                                   GtkWidget *wdg);
-void gui_dialog_set_default_size(struct gui_dialog *dlg,
-                                 int width, int height);
-void gui_dialog_set_title(struct gui_dialog *dlg, const char *title);
-void gui_dialog_set_response_sensitive(struct gui_dialog *dlg,
-                                       int response, bool setting);
-void gui_dialog_show_all(struct gui_dialog *dlg);
-void gui_dialog_present(struct gui_dialog *dlg);
-void gui_dialog_raise(struct gui_dialog *dlg);
-void gui_dialog_alert(struct gui_dialog *dlg);
-void gui_dialog_destroy(struct gui_dialog *dlg);
-void gui_dialog_destroy_all(void);
-GtkWidget *gui_dialog_get_toplevel(struct gui_dialog *dlg);
-void gui_dialog_response_set_callback(struct gui_dialog *dlg,
-    GUI_DIALOG_RESPONSE_FUN fun);
-void gui_dialog_set_return_dialog(struct gui_dialog *dlg,
-                                  struct gui_dialog *return_dialog);
-
-void gui_update_font_full(const char *font_name, const char *font_value,
-                          PangoFontDescription **font_desc);
-
-void disable_gobject_callback(GObject *obj, GCallback cb);
-void enable_gobject_callback(GObject *obj, GCallback cb);
-
-gint blocking_dialog(GtkWidget *dlg);
-void widget_destroyed(GtkWidget *wdg, void *data);
-GtkWidget *widget_get_child(GtkWidget *wdg);
-
-void alert_close_response(GObject *dialog, GAsyncResult *result,
-                          gpointer data);
-
-#define menu_item_insert_unref(menu, index, item) \
-{                                                 \
-  GMenuItem *_item_var = item;                    \
-  g_menu_insert_item(menu, index, _item_var);     \
-  g_object_unref(_item_var);                      \
-}
-
-#define menu_item_append_unref(menu, item)        \
-{                                                 \
-  GMenuItem *_item_var = item;                    \
-  g_menu_append_item(menu, _item_var);            \
-  g_object_unref(_item_var);                      \
-}
-
-#define submenu_insert_unref(menu, index, name,    \
-                             submenu)              \
-{                                                  \
-  GMenuModel *_submenu_var = submenu;              \
-  g_menu_insert_submenu(menu, index, name,         \
-                        _submenu_var);             \
-  g_object_unref(_submenu_var);                    \
-}
-
-#define submenu_append_unref(menu, name, submenu)  \
-{                                                  \
-  GMenuModel *_submenu_var = submenu;              \
-  g_menu_append_submenu(menu, name, _submenu_var); \
-  g_object_unref(_submenu_var);                    \
-}
-
-int get_column_view_row(GtkWidget *cview, int y);
-
-#endif /* FC__GUI_STUFF_H */
diff --git a/client/gui-gtk-5.0/happiness.c b/client/gui-gtk-5.0/happiness.c
deleted file mode 100644
index d0bb940b48..0000000000
--- a/client/gui-gtk-5.0/happiness.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* common */
-#include "city.h"
-#include "game.h"
-#include "government.h"
-
-/* client */
-#include "text.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "happiness.h"
-#include "mapview.h"
-
-/* Semi-arbitrary number that controls the width of the happiness widget */
-#define HAPPINESS_PIX_WIDTH 30
-
-#define FEELING_WIDTH   (HAPPINESS_PIX_WIDTH * tileset_small_sprite_width(tileset))
-#define FEELING_HEIGHT  (tileset_small_sprite_height(tileset))
-
-#define NUM_HAPPINESS_MODIFIERS 6
-
-enum { CITIES, LUXURIES, BUILDINGS, NATIONALITY, UNITS, WONDERS };
-
-struct happiness_dialog {
-  struct city *pcity;
-  GtkWidget *win;
-  GtkWidget *shell;
-  GtkWidget *cityname_label;
-  GtkWidget *feeling_pics[NUM_HAPPINESS_MODIFIERS];
-  cairo_surface_t *feeling_surfaces[NUM_HAPPINESS_MODIFIERS];
-  GtkWidget *happiness_label[NUM_HAPPINESS_MODIFIERS];
-  GtkWidget *close;
-};
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct happiness_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct happiness_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-static struct happiness_dialog *get_happiness_dialog(struct city *pcity);
-static struct happiness_dialog *create_happiness_dialog(struct city *pcity,
-                                                        bool low_dlg,
-                                                        GtkWidget *win);
-static gboolean show_happiness_popup(GtkGestureClick *gesture,
-                                     int n_press,
-                                     double x, double y, gpointer data);
-
-/**********************************************************************//**
-  Create happiness dialog
-**************************************************************************/
-void happiness_dialog_init(void)
-{
-  dialog_list = dialog_list_new();
-}
-
-/**********************************************************************//**
-  Remove happiness dialog
-**************************************************************************/
-void happiness_dialog_done(void)
-{
-  dialog_list_destroy(dialog_list);
-}
-
-/**********************************************************************//**
-  Return happiness dialog for a city
-**************************************************************************/
-static struct happiness_dialog *get_happiness_dialog(struct city *pcity)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pcity == pcity) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  Popup for the happiness display.
-**************************************************************************/
-static gboolean show_happiness_popup(GtkGestureClick *gesture,
-                                     int n_press,
-                                     double x, double y, gpointer data)
-{
-  GtkWidget *w = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-  struct happiness_dialog *pdialog = g_object_get_data(G_OBJECT(w),
-                                                       "pdialog");
-  GtkWidget *p, *label;
-  char buf[1024];
-
-  switch (GPOINTER_TO_UINT(data)) {
-  case CITIES:
-    sz_strlcpy(buf, text_happiness_cities(pdialog->pcity));
-    break;
-  case LUXURIES:
-    sz_strlcpy(buf, text_happiness_luxuries(pdialog->pcity));
-    break;
-  case BUILDINGS:
-    sz_strlcpy(buf, text_happiness_buildings(pdialog->pcity));
-    break;
-  case NATIONALITY:
-    sz_strlcpy(buf, text_happiness_nationality(pdialog->pcity));
-    break;
-  case UNITS:
-    sz_strlcpy(buf, text_happiness_units(pdialog->pcity));
-    break;
-  case WONDERS:
-    sz_strlcpy(buf, text_happiness_wonders(pdialog->pcity));
-    break;
-  default:
-    return TRUE;
-  }
-
-  p = gtk_popover_new();
-
-  gtk_widget_set_parent(p, w);
-
-  label = gtk_label_new(buf);
-  /* FIXME: there is no font option corresponding to this style name.
-   * Remove?: */
-  gtk_widget_set_name(label, "city_happiness_label");
-  gtk_widget_set_margin_start(label, 4);
-  gtk_widget_set_margin_end(label, 4);
-  gtk_widget_set_margin_top(label, 4);
-  gtk_widget_set_margin_bottom(label, 4);
-  gtk_popover_set_child(GTK_POPOVER(p), label);
-
-  gtk_popover_popup(GTK_POPOVER(p));
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Create the happiness notebook page.
-**************************************************************************/
-static struct happiness_dialog *create_happiness_dialog(struct city *pcity,
-                                                        bool low_dlg,
-                                                        GtkWidget *win)
-{
-  int i;
-  struct happiness_dialog *pdialog;
-  GtkWidget *label, *table;
-  char buf[700];
-
-  static const char *happiness_label_str[NUM_HAPPINESS_MODIFIERS] = {
-    N_("Cities:"),
-    N_("Luxuries:"),
-    N_("Buildings:"),
-    N_("Nationality:"),
-    N_("Units:"),
-    N_("Wonders:"),
-  };
-  static bool happiness_label_str_done;
-
-  pdialog = fc_malloc(sizeof(struct happiness_dialog));
-  pdialog->pcity = pcity;
-
-  pdialog->shell = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(pdialog->shell),
-                                 GTK_ORIENTATION_VERTICAL);
-
-  pdialog->cityname_label = gtk_frame_new(_("Happiness"));
-  gtk_grid_attach(GTK_GRID(pdialog->shell), pdialog->cityname_label, 0, 0, 1, 1);
-
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 4);
-  gtk_widget_set_margin_end(table, 4);
-  gtk_widget_set_margin_start(table, 4);
-  gtk_widget_set_margin_top(table, 4);
-  gtk_grid_set_row_spacing(GTK_GRID(table), 10);
-
-  intl_slist(ARRAY_SIZE(happiness_label_str), happiness_label_str,
-             &happiness_label_str_done);
-
-  gtk_frame_set_child(GTK_FRAME(pdialog->cityname_label), table);
-
-  for (i = 0; i < NUM_HAPPINESS_MODIFIERS; i++) {
-    GtkWidget *pic;
-    GtkEventController *controller;
-
-    /* Set spacing between lines of citizens */
-
-    /* Happiness labels */
-    label = gtk_label_new(happiness_label_str[i]);
-    pdialog->happiness_label[i] = label;
-    gtk_widget_set_name(label, "city_label");
-    gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-
-    gtk_grid_attach(GTK_GRID(table), label, 0, i, 1, 1);
-
-    /* List of citizens */
-    pdialog->feeling_surfaces[i] = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                                              FEELING_WIDTH,
-                                                              FEELING_HEIGHT);
-    pic = gtk_picture_new();
-    pdialog->feeling_pics[i] = pic;
-    gtk_widget_set_margin_start(pic, 5);
-    g_object_set_data(G_OBJECT(pic), "pdialog", pdialog);
-
-    controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-    g_signal_connect(controller, "pressed",
-                     G_CALLBACK(show_happiness_popup), GUINT_TO_POINTER(i));
-    gtk_widget_add_controller(pic, controller);
-
-    gtk_widget_set_halign(pic, GTK_ALIGN_START);
-    gtk_widget_set_valign(pic, GTK_ALIGN_START);
-
-    gtk_grid_attach(GTK_GRID(table), pic, 1, i, 1, 1);
-  }
-
-  /* TRANS: the width of this text defines the width of the city dialog.
-   *        '%s' is either space or newline depending on screen real estate. */
-  fc_snprintf(buf, sizeof(buf),
-              _("Additional information is available%svia left "
-                "click on the citizens."), low_dlg ? "\n" : " ");
-  label = gtk_label_new(buf);
-  gtk_widget_set_name(label, "city_label");
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(table), label, 0, NUM_HAPPINESS_MODIFIERS, 2, 1);
-
-  gtk_widget_set_visible(pdialog->shell, TRUE);
-  dialog_list_prepend(dialog_list, pdialog);
-  refresh_happiness_dialog(pcity);
-
-  pdialog->win = win;
-
-  return pdialog;
-}
-
-/**********************************************************************//**
-  Refresh citizens surface
-**************************************************************************/
-static void refresh_feeling_surface(GtkWidget *pic,
-                                    cairo_surface_t *dst, struct city *pcity,
-                                    enum citizen_feeling index)
-{
-  enum citizen_category categories[MAX_CITY_SIZE];
-  int i;
-  int num_citizens = get_city_citizen_types(pcity, index, categories);
-  int offset = MIN(tileset_small_sprite_width(tileset), FEELING_WIDTH / num_citizens);
-  cairo_t *cr;
-
-  cr = cairo_create(dst);
-
-  for (i = 0; i < num_citizens; i++) {
-    cairo_set_source_surface(cr,
-                             get_citizen_sprite(tileset, categories[i], i, pcity)->surface,
-                             i * offset, 0);
-    cairo_rectangle(cr, i * offset, 0, offset, FEELING_HEIGHT);
-    cairo_fill(cr);
-  }
-
-  picture_set_from_surface(GTK_PICTURE(pic), dst);
-
-  cairo_destroy(cr);
-}
-
-/**********************************************************************//**
-  Refresh whole happiness dialog
-**************************************************************************/
-void refresh_happiness_dialog(struct city *pcity)
-{
-  int i;
-  struct happiness_dialog *pdialog = get_happiness_dialog(pcity);
-
-  for (i = 0; i < FEELING_LAST; i++) {
-    refresh_feeling_surface(pdialog->feeling_pics[i],
-                            pdialog->feeling_surfaces[i], pdialog->pcity, i);
-  }
-}
-
-/**********************************************************************//**
-  Close happiness dialog of given city
-**************************************************************************/
-void close_happiness_dialog(struct city *pcity)
-{
-  struct happiness_dialog *pdialog = get_happiness_dialog(pcity);
-  int i;
-
-  if (pdialog == nullptr) {
-    /* City which is being investigated doesn't contain happiness tab */
-    return;
-  }
-
-  gtk_widget_set_visible(pdialog->shell, FALSE);
-
-  dialog_list_remove(dialog_list, pdialog);
-
-  gtk_box_remove(GTK_BOX(gtk_widget_get_parent(pdialog->shell)),
-                 pdialog->shell);
-
-  for (i = 0; i < NUM_HAPPINESS_MODIFIERS; i++) {
-    cairo_surface_destroy(pdialog->feeling_surfaces[i]);
-  }
-
-  free(pdialog);
-}
-
-/**********************************************************************//**
-  Create happiness dialog and get its widget
-**************************************************************************/
-GtkWidget *get_top_happiness_display(struct city *pcity, bool low_dlg,
-                                     GtkWidget *win)
-{
-  return create_happiness_dialog(pcity, low_dlg, win)->shell;
-}
diff --git a/client/gui-gtk-5.0/happiness.h b/client/gui-gtk-5.0/happiness.h
deleted file mode 100644
index 4757fcbe27..0000000000
--- a/client/gui-gtk-5.0/happiness.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__HAPPINESS_H
-#define FC__HAPPINESS_H
-
-#include <gtk/gtk.h>
-
-/* client/gui-gtk-5.0 */
-#include "citydlg.h"
-
-void happiness_dialog_init(void);
-void happiness_dialog_done(void);
-GtkWidget *get_top_happiness_display(struct city *pcity,
-                                     bool low_dlg,
-                                     GtkWidget *win);
-void close_happiness_dialog(struct city *pcity);
-void refresh_happiness_dialog(struct city *pcity);
-
-#endif /* FC__HAPPINESS_H */
diff --git a/client/gui-gtk-5.0/helpdlg.c b/client/gui-gtk-5.0/helpdlg.c
deleted file mode 100644
index a68e8a8eba..0000000000
--- a/client/gui-gtk-5.0/helpdlg.c
+++ /dev/null
@@ -1,1817 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h> /* sqrt */
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "city.h"
-#include "game.h"
-#include "government.h"
-#include "movement.h"
-#include "nation.h"
-#include "specialist.h"
-#include "tech.h"
-#include "unit.h"
-#include "map.h"
-#include "research.h"
-#include "version.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "helpdata.h"
-#include "options.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "helpdlg.h"
-
-#define TECH_TREE_DEPTH         20
-
-/*
- * Globals.
- */
-static GtkWidget *help_dialog_shell;
-static GtkWidget *help_view_sw;
-
-static GtkWidget *help_view;
-
-static GtkWidget *help_frame;
-static GtkTextBuffer *help_text;
-static GtkWidget *help_text_sw;
-static GtkWidget *help_vbox;
-static GtkWidget *help_tile;
-static GtkWidget *help_box;
-static GtkWidget *help_itable;
-static GtkWidget *help_wtable;
-static GtkWidget *help_utable;
-static GtkWidget *help_ttable;
-static GtkWidget *help_etable;
-static GtkWidget *help_tree;
-static GtkTreeStore *tstore;
-
-static GtkWidget *help_tree_sw;
-static GtkWidget *help_tree_expand;
-static GtkWidget *help_tree_collapse;
-static GtkWidget *help_tree_buttons_hbox;
-static GtkWidget *help_ilabel[6];
-static GtkWidget *help_wlabel[6];
-static GtkWidget *help_ulabel[5][5];
-static GtkWidget *help_tlabel[2][5];
-static GtkWidget *help_elabel[6];
-
-static bool help_advances[A_LAST];
-
-static GPtrArray *help_history;
-static int        help_history_pos;
-
-struct help_page_selection
-{
-  enum { HPAGE_SRC_ENUM, HPAGE_SRC_REQ } type;
-  union {
-    enum help_page_type page;
-    const struct requirement *req;
-  } u;
-};
-
-static const char *help_ilabel_name[6] =
-{ N_("Base Cost:"), NULL, N_("Upkeep:"), NULL, N_("Requirement:"), NULL };
-static struct help_page_selection help_impr_req;
-
-static const char *help_wlabel_name[6] =
-{ N_("Base Cost:"), NULL, N_("Requirement:"), NULL, N_("Obsolete by:"), NULL };
-static struct help_page_selection help_wndr_req;
-
-static struct help_page_selection page_selections[HELP_LAST];
-
-static const char *help_ulabel_name[5][5] =
-{
-    { N_("Cost:"),              NULL, NULL, N_("Attack:"),      NULL },
-    { N_("Defense:"),           NULL, NULL, N_("Move:"),        NULL },
-    { N_("Firepower:"),         NULL, NULL, N_("Hitpoints:"),   NULL },
-    { N_("Basic Upkeep:"),      NULL, NULL, N_("Vision:"),      NULL },
-    { N_("Requirement:"),       NULL, NULL, N_("Obsolete by:"), NULL }
-};
-
-static const char *help_tlabel_name[2][5] =
-{
-    { N_("Move/Defense:"),      NULL, NULL, N_("Food/Res/Trade:"),      NULL },
-    { N_("Resources:"),         NULL, NULL, NULL,                       NULL }
-};
-
-static const char *help_elabel_name[6] =
-/* TRANS: Label for build cost for extras in help. Will be followed by
- * something like "3 MP" (where MP = Movement Points) */
-{ N_("Build:"), NULL,
-/* TRANS: Extra conflicts in help. Will be followed by a list of extras
- * that can't be built on the same tile as this one. */
-  N_("Conflicts with:"), NULL,
-/* TRANS: Extra bonus in help. Will be followed by food/production/trade
- * stats like "0/0/+1", "0/+50%/0" */
-  N_("Bonus (F/P/T):"), NULL };
-
-#define REQ_LABEL_NONE _("?tech:None")
-#define REQ_LABEL_NEVER _("(Never)")
-
-static void create_help_dialog(void);
-static void help_update_dialog(const struct help_item *pitem);
-
-static void select_help_item_string(const char *item,
-                                    enum help_page_type htype);
-static void help_command_update(void);
-static void help_command_callback(GtkWidget *w, gint response_id);
-
-/**********************************************************************//**
-  Initialize help system.
-**************************************************************************/
-void help_system_init(void)
-{
-  enum help_page_type page;
-
-  for (page = 0; page < HELP_LAST; page++) {
-    page_selections[page].type = HPAGE_SRC_ENUM;
-    page_selections[page].u.page = page;
-  }
-
-  help_impr_req.type = HPAGE_SRC_REQ;
-  help_wndr_req.type = HPAGE_SRC_REQ;
-}
-
-/**********************************************************************//**
-  Set topic specific title for help_frame
-**************************************************************************/
-static void set_title_topic(char *topic)
-{
-  if (strcmp(topic, _(HELP_ABOUT_ITEM)) == 0) {
-    gtk_frame_set_label(GTK_FRAME(help_frame), freeciv_name_version());
-  } else {
-    gtk_frame_set_label(GTK_FRAME(help_frame), topic);
-  }
-}
-
-/**********************************************************************//**
-  Close help dialog.
-**************************************************************************/
-void popdown_help_dialog(void)
-{
-  if (help_dialog_shell) {
-    gtk_window_destroy(GTK_WINDOW(help_dialog_shell));
-  }
-}
-
-/**********************************************************************//**
-  Popup help dialog for given item of given type.
-**************************************************************************/
-void popup_help_dialog_typed(const char *item, enum help_page_type htype)
-{
-  if (!help_dialog_shell) {
-    create_help_dialog();
-  }
-  gtk_window_present(GTK_WINDOW(help_dialog_shell));
-
-  select_help_item_string(item, htype);
-}
-
-/**********************************************************************//**
-  Not sure if this should call Q_(item) as it does, or whether all
-  callers of this function should do so themselves... --dwp
-**************************************************************************/
-void popup_help_dialog_string(const char *item)
-{
-  popup_help_dialog_typed(Q_(item), HELP_ANY);
-}
-
-/**********************************************************************//**
-  Called by help_update_tech and itself
-  Creates a node in the given tree for the given tech, and creates child
-  nodes for any children it has up to levels deep. These are then expanded
-  if they are less than expanded_levels deep. Avoids generating redundant
-  subtrees, so that if Literacy occurs twice in a tech tree, only the first
-  will have children. Color codes the node based on when it will be
-  discovered: red >2 turns, yellow 1 turn, green 0 turns (discovered).
-**************************************************************************/
-static void create_tech_tree(int tech, int levels, GtkTreeIter *parent)
-{
-  const struct research *presearch;
-  int           bg;
-  int           turns_to_tech;
-  bool          original;
-  GtkTreeIter   l;
-  GValue        value = { 0, };
-  enum tech_state state;
-
-  if (advance_required(tech, AR_ONE) == A_LAST
-      && advance_required(tech, AR_TWO) == A_LAST) {
-    bg = COLOR_REQTREE_UNKNOWN;
-
-    gtk_tree_store_append(tstore, &l, parent);
-    help_advances[tech] = TRUE;
-
-    g_value_init(&value, G_TYPE_STRING);
-    g_value_set_static_string(&value, _("Removed"));
-    gtk_tree_store_set_value(tstore, &l, 0, &value);
-    g_value_unset(&value);
-
-    gtk_tree_store_set(tstore, &l,
-                       1, -1,
-                       2, tech,
-                       3, &get_color(tileset, bg)->color
-                       -1);
-    return;
-  }
-
-  presearch = research_get(client_player());
-
-  state = research_invention_state(presearch, tech);
-  if (tech_state_is_valid(state)) {
-    switch (state) {
-    case TECH_UNKNOWN:
-      bg = COLOR_REQTREE_UNKNOWN;
-      break;
-    case TECH_KNOWN:
-      bg = COLOR_REQTREE_KNOWN;
-      break;
-    case TECH_PREREQS_KNOWN:
-      bg = COLOR_REQTREE_PREREQS_KNOWN;
-      break;
-    }
-  } else {
-    bg = COLOR_REQTREE_BACKGROUND;
-  }
-  turns_to_tech = research_goal_unknown_techs(presearch, tech);
-
-  /* l is the original in the tree. */
-  original = !help_advances[tech];
-
-  gtk_tree_store_append(tstore, &l, parent);
-  help_advances[tech] = TRUE;
-
-  g_value_init(&value, G_TYPE_STRING);
-  g_value_set_static_string(&value,
-                            research_advance_name_translation(presearch,
-                                                              tech));
-  gtk_tree_store_set_value(tstore, &l, 0, &value);
-  g_value_unset(&value);
-
-  gtk_tree_store_set(tstore, &l,
-                     1, turns_to_tech,
-                     2, tech,
-                     3, &get_color(tileset, bg)->color,
-                     -1);
-
-  if (--levels <= 0) {
-    return;
-  }
-
-  if (original) {
-    /* Only add children to orginals */
-    if (advance_required(tech, AR_ONE) != A_NONE)
-      create_tech_tree(advance_required(tech, AR_ONE), levels, &l);
-    if (advance_required(tech, AR_TWO) != A_NONE)
-      create_tech_tree(advance_required(tech, AR_TWO), levels, &l);
-  }
-}
-
-/**********************************************************************//**
-  Selects the help page for the tech in the tree that was double clicked.
-**************************************************************************/
-static void help_tech_tree_activated_callback(GtkTreeView *view,
-                                              GtkTreePath *path,
-                                              GtkTreeViewColumn *col,
-                                              gpointer data)
-{
-  GtkTreeIter it;
-  gint tech;
-
-  gtk_tree_model_get_iter(GTK_TREE_MODEL(tstore), &it, path);
-  gtk_tree_model_get(GTK_TREE_MODEL(tstore), &it, 2, &tech, -1);
-  select_help_item_string(advance_name_translation(advance_by_number(tech)),
-                          HELP_TECH);
-}
-
-/**********************************************************************//**
-  Called when "Expand All" button is clicked
-**************************************************************************/
-static void help_tech_tree_expand_callback(GtkWidget *w, gpointer data)
-{
-  gtk_tree_view_expand_all(GTK_TREE_VIEW(data));
-}
-
-/**********************************************************************//**
-  Called when "Collapse All" button is clicked
-**************************************************************************/
-static void help_tech_tree_collapse_callback(GtkWidget *w, gpointer data)
-{
-  gtk_tree_view_collapse_all(GTK_TREE_VIEW(data));
-}
-
-/**********************************************************************//**
-  Hyperlink clicked
-**************************************************************************/
-static void help_hyperlink_callback(GtkWidget *w)
-{
-  const char *s;
-  struct help_page_selection *select;
-  enum help_page_type type = HELP_LAST;
-
-  s = gtk_label_get_text(GTK_LABEL(w));
-  select = (struct help_page_selection *)(g_object_get_data(G_OBJECT(w),
-                                                            "page_type"));
-
-  switch (select->type) {
-  case HPAGE_SRC_ENUM:
-    type = select->u.page;
-    break;
-  case HPAGE_SRC_REQ:
-    type = help_type_by_requirement(select->u.req);
-    break;
-  }
-
-  if (type == HELP_LAST) {
-    return;
-  }
-
-  /* FIXME: May be able to skip, or may need to modify, advances[A_NONE]
-     below, depending on which i18n is done elsewhere.
-  */
-  if (strcmp(s, REQ_LABEL_NEVER) != 0
-      && strcmp(s, skip_intl_qualifier_prefix(REQ_LABEL_NONE)) != 0
-      && strcmp(s, advance_name_translation(advance_by_number(A_NONE))) != 0) {
-    select_help_item_string(s, type);
-  }
-}
-
-/**********************************************************************//**
-  Create new hyperlink button.
-**************************************************************************/
-static GtkWidget *help_hyperlink_new(GtkWidget *label,
-                                     struct help_page_selection *select)
-{
-  GtkWidget *button;
-
-  button = gtk_button_new();
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_name(label, "help_link");
-  gtk_button_set_child(GTK_BUTTON(button), label);
-  gtk_widget_set_visible(button, TRUE);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(help_hyperlink_callback), label);
-  g_object_set_data(G_OBJECT(label), "page_type", select);
-
-  return button;
-}
-
-/**********************************************************************//**
-  Create new hyperlink button for a known page.
-**************************************************************************/
-static GtkWidget *help_hyperlink_new_page(GtkWidget *label,
-                                          enum help_page_type page)
-{
-  return help_hyperlink_new(label, &(page_selections[page]));
-}
-
-/**********************************************************************//**
-  Create new hyperlink button with text.
-**************************************************************************/
-static GtkWidget *help_slink_new(const gchar *txt,
-                                 struct help_page_selection *select)
-{
-  GtkWidget *button, *label;
-
-  label = gtk_label_new(txt);
-  gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  button = help_hyperlink_new(label, select);
-
-  return button;
-}
-
-/**********************************************************************//**
-  Create new hyperlink button with text for known page.
-**************************************************************************/
-static GtkWidget *help_slink_new_page(const gchar *txt,
-                                      enum help_page_type page)
-{
-  return help_slink_new(txt, &(page_selections[page]));
-}
-
-/**********************************************************************//**
-  Hide help box.
-**************************************************************************/
-static void help_box_hide(void)
-{
-  gtk_widget_set_visible(help_box, FALSE);
-
-  gtk_widget_set_visible(help_tile, FALSE);
-
-  gtk_widget_set_visible(help_itable, FALSE);
-  gtk_widget_set_visible(help_wtable, FALSE);
-  gtk_widget_set_visible(help_utable, FALSE);
-  gtk_widget_set_visible(help_ttable, FALSE);
-  gtk_widget_set_visible(help_etable, FALSE);
-
-  gtk_widget_set_visible(help_vbox, FALSE);
-  gtk_widget_set_visible(help_text_sw, FALSE);
-
-  gtk_widget_set_visible(help_tree_sw, FALSE);
-  gtk_widget_set_visible(help_tree_buttons_hbox, FALSE);
-}
-
-/**********************************************************************//**
-  Add widget to help box.
-**************************************************************************/
-static void help_box_add(GtkWidget *wdg)
-{
-  gtk_box_append(GTK_BOX(help_vbox), wdg);
-}
-
-/**********************************************************************//**
-  Clear help box.
-**************************************************************************/
-static void help_box_clear(void)
-{
-  GtkWidget *child = gtk_widget_get_first_child(help_vbox);
-
-  while (child != NULL) {
-    gtk_box_remove(GTK_BOX(help_vbox), child);
-    child = gtk_widget_get_first_child(help_vbox);
-  }
-}
-
-/**********************************************************************//**
-  Completely destroy help dialog.
-**************************************************************************/
-static void help_destroy_callback(GtkWidget *w, gpointer data)
-{
-  g_ptr_array_free(help_history, TRUE);
-  help_dialog_shell = NULL;
-}
-
-/**********************************************************************//**
-  New topic activated from help dialog.
-**************************************************************************/
-static void activated_topic(GtkTreeView *view, gpointer data)
-{
-  GtkTreePath *path;
-  GtkTreeViewColumn *col;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  struct help_item *pitem;
-
-  model = gtk_tree_view_get_model(view);
-
-  if (model == NULL) {
-    return;
-  }
-
-  gtk_tree_view_get_cursor(view, &path, &col);
-  gtk_tree_model_get_iter(model, &it, path);
-  gtk_tree_path_free(path);
-
-  if (path == NULL) {
-    return;
-  }
-
-  gtk_tree_model_get(model, &it, 1, &pitem, -1);
-
-  if (help_history_pos >= 0
-      && g_ptr_array_index(help_history, help_history_pos) == (gpointer) pitem) {
-    return;
-  }
-
-  help_update_dialog(pitem);
-
-  /* Add to history. */
-  if (help_history_pos < help_history->len - 1) {
-    g_ptr_array_set_size(help_history, help_history_pos + 1);
-  }
-  help_history_pos++;
-
-  g_ptr_array_add(help_history, (gpointer)pitem);
-  help_command_update();
-}
-
-/**********************************************************************//**
-  Create help dialog.
-**************************************************************************/
-static void create_help_dialog(void)
-{
-  GtkWidget *hbox;
-  GtkWidget *button;
-  GtkWidget *text;
-  int        i, j;
-  GtkCellRenderer   *rend;
-  GtkTreeViewColumn *col;
-  GArray            *array;
-  GtkTreeStore      *store;
-  GtkTreeSelection  *selection;
-  GtkWidget *tile_sw;
-
-  help_history = g_ptr_array_new();
-  help_history_pos = -1;
-
-  help_dialog_shell = gtk_dialog_new_with_buttons(_("Freeciv Help Browser"),
-                                                  NULL,
-                                                  0,
-                                                  _("_Back"),
-                                                  1,
-                                                  _("_Forward"),
-                                                  2,
-                                                  _("_Close"),
-                                                  GTK_RESPONSE_CLOSE,
-                                                  NULL);
-  setup_dialog(help_dialog_shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(help_dialog_shell),
-                                  GTK_RESPONSE_CLOSE);
-  gtk_widget_set_name(help_dialog_shell, "Freeciv");
-
-  g_signal_connect(help_dialog_shell, "response",
-                   G_CALLBACK(help_command_callback), NULL);
-  g_signal_connect(help_dialog_shell, "destroy",
-                   G_CALLBACK(help_destroy_callback), NULL);
-  gtk_window_set_default_size(GTK_WINDOW(help_dialog_shell),
-                              GUI_GTK_OPTION(helpdlg_xsize),
-                              GUI_GTK_OPTION(helpdlg_ysize));
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(help_dialog_shell))),
-                 hbox);
-  gtk_widget_set_visible(hbox, TRUE);
-
-  /* Build tree store. */
-  store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
-
-  array = g_array_new(FALSE, FALSE, sizeof(GtkTreeIter));
-  help_items_iterate(pitem) {
-    GtkTreeIter *it, *parent;
-    const char *s;
-    int depth;
-
-    for (s = pitem->topic; *s == ' '; s++) {
-      /* Nothing */
-    }
-    depth = s - pitem->topic;
-
-    array = g_array_set_size(array, depth+1);
-
-    if (depth > 0) {
-      parent = &g_array_index(array, GtkTreeIter, depth-1);
-    } else {
-      parent = NULL;
-    }
-
-    it = &g_array_index(array, GtkTreeIter, depth);
-    gtk_tree_store_append(store, it, parent);
-
-    gtk_tree_store_set(store, it, 0, pitem->topic, 1, pitem, -1);
-  } help_items_iterate_end;
-
-  /* Create tree view. */
-  help_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  g_object_unref(store);
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(help_view));
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(help_view), FALSE);
-
-  g_signal_connect(help_view, "cursor-changed",
-                   G_CALLBACK(activated_topic), NULL);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(help_view));
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
-
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(NULL, rend, "text", 0, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(help_view), col);
-
-  help_view_sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(help_view_sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_widget_set_size_request(help_view_sw, 190, -1);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(help_view_sw), help_view);
-  gtk_widget_set_visible(help_view, TRUE);
-  gtk_box_append(GTK_BOX(hbox), help_view_sw);
-  gtk_widget_set_visible(help_view_sw, TRUE);
-
-  help_frame = gtk_frame_new("");
-  gtk_box_append(GTK_BOX(hbox), help_frame);
-  gtk_widget_set_hexpand(help_frame, TRUE);
-  gtk_widget_set_visible(help_frame, TRUE);
-
-  help_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
-  gtk_frame_set_child(GTK_FRAME(help_frame), help_box);
-
-  help_tile = gtk_picture_new();
-  gtk_picture_set_can_shrink(GTK_PICTURE(help_tile), FALSE);
-  gtk_widget_set_valign(help_tile, GTK_ALIGN_CENTER);
-  gtk_widget_set_halign(help_tile, GTK_ALIGN_CENTER);
-  tile_sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(tile_sw),
-                                 GTK_POLICY_NEVER,
-                                 GTK_POLICY_NEVER);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(tile_sw), help_tile);
-  gtk_box_append(GTK_BOX(help_box), tile_sw);
-
-  help_itable = gtk_grid_new();
-  gtk_box_append(GTK_BOX(help_box), help_itable);
-
-  for (i = 0; i < 6; i++) {
-    help_ilabel[i] =
-      gtk_label_new(help_ilabel_name[i] != NULL ? _(help_ilabel_name[i]) : "");
-    gtk_widget_set_hexpand(help_ilabel[i], TRUE);
-
-    if (i == 5) {
-      button = help_hyperlink_new(help_ilabel[i], &help_impr_req);
-      gtk_grid_attach(GTK_GRID(help_itable), button, i, 0, 1, 1);
-    } else {
-      gtk_grid_attach(GTK_GRID(help_itable), help_ilabel[i], i, 0, 1, 1);
-      gtk_widget_set_name(help_ilabel[i], "help_label");
-    }
-
-    gtk_widget_set_visible(help_ilabel[i], TRUE);
-  }
-
-  help_wtable = gtk_grid_new();
-  gtk_box_append(GTK_BOX(help_box), help_wtable);
-
-  for (i = 0; i < 6; i++) {
-    help_wlabel[i] =
-      gtk_label_new(help_wlabel_name[i] ? _(help_wlabel_name[i]) : "");
-    gtk_widget_set_hexpand(help_wlabel[i], TRUE);
-
-    if (i == 3 || i == 5) {
-      button = help_hyperlink_new(help_wlabel[i], &help_wndr_req);
-      gtk_grid_attach(GTK_GRID(help_wtable), button, i, 0, 1, 1);
-    } else {
-      gtk_grid_attach(GTK_GRID(help_wtable), help_wlabel[i], i, 0, 1, 1);
-      gtk_widget_set_name(help_wlabel[i], "help_label");
-    }
-
-    gtk_widget_set_visible(help_wlabel[i], TRUE);
-  }
-
-  help_utable = gtk_grid_new();
-  gtk_box_append(GTK_BOX(help_box), help_utable);
-
-  for (i = 0; i < 5; i++) {
-    for (j = 0; j < 5; j++) {
-      help_ulabel[j][i] =
-        gtk_label_new(help_ulabel_name[j][i] ? _(help_ulabel_name[j][i]) : "");
-      gtk_widget_set_hexpand(help_ulabel[j][i], TRUE);
-
-      if (j == 4 && (i == 1 || i == 4)) {
-        if (i == 1) {
-          button = help_hyperlink_new_page(help_ulabel[j][i], HELP_TECH);
-        } else {
-          button = help_hyperlink_new_page(help_ulabel[j][i], HELP_UNIT);
-        }
-
-        gtk_grid_attach(GTK_GRID(help_utable), button, i, j, 1, 1);
-      } else {
-        gtk_grid_attach(GTK_GRID(help_utable), help_ulabel[j][i],
-                        i, j, 1, 1);
-        gtk_widget_set_name(help_ulabel[j][i], "help_label");
-      }
-
-      gtk_widget_set_visible(help_ulabel[j][i], TRUE);
-    }
-  }
-
-  help_ttable = gtk_grid_new();
-  gtk_box_append(GTK_BOX(help_box), help_ttable);
-
-  for (j = 0; j < 2; j++) {
-    for (i = 0; i < 5; i++) {
-      help_tlabel[j][i] =
-        gtk_label_new(help_tlabel_name[j][i] ? _(help_tlabel_name[j][i]) : "");
-      gtk_widget_set_hexpand(help_tlabel[j][i], TRUE);
-      gtk_widget_set_name(help_tlabel[j][i], "help_label");
-
-      /* Ugly (but these numbers are hardcoded in help_update_terrain() too) */
-      if (j == 1 && i == 1) {
-        /* Extra wide cell for terrain specials */
-        gtk_grid_attach(GTK_GRID(help_ttable), help_tlabel[j][i],
-                        i, j, 4, 1);
-        gtk_widget_set_visible(help_tlabel[j][i], TRUE);
-        break; /* Skip rest of row */
-      } else {
-        gtk_grid_attach(GTK_GRID(help_ttable), help_tlabel[j][i],
-                        i, j, 1, 1);
-        gtk_widget_set_visible(help_tlabel[j][i], TRUE);
-      }
-    }
-  }
-
-  help_etable = gtk_grid_new();
-  gtk_box_append(GTK_BOX(help_box), help_etable);
-
-  for (i = 0; i < 6; i++) {
-    help_elabel[i]
-      = gtk_label_new(help_elabel_name[i] ? _(help_elabel_name[i]) : "");
-    gtk_widget_set_hexpand(help_elabel[i], TRUE);
-    gtk_grid_attach(GTK_GRID(help_etable), help_elabel[i], i % 4, i / 4, 1, 1);
-    gtk_widget_set_name(help_elabel[i], "help_label");
-    gtk_widget_set_visible(help_elabel[i], TRUE);
-  }
-
-  help_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
-  gtk_widget_set_margin_start(help_vbox, 5);
-  gtk_widget_set_margin_end(help_vbox, 5);
-  gtk_widget_set_margin_top(help_vbox, 5);
-  gtk_widget_set_margin_bottom(help_vbox, 5);
-  gtk_box_append(GTK_BOX(help_box), help_vbox);
-
-  text = gtk_text_view_new();
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  gtk_widget_set_margin_start(text, 5);
-  gtk_widget_set_margin_end(text, 5);
-  gtk_widget_set_margin_top(text, 5);
-  gtk_widget_set_margin_bottom(text, 5);
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_widget_set_name(text, "help_text");
-  help_text = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
-  gtk_widget_set_visible(text, TRUE);
-
-  help_text_sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(help_text_sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(help_text_sw), text);
-  gtk_box_append(GTK_BOX(help_box), help_text_sw);
-
-  /* Build tech store. */
-  tstore = gtk_tree_store_new(4,
-                              G_TYPE_STRING,    /* Tech name */
-                              G_TYPE_INT,       /* Turns to tech */
-                              G_TYPE_INT,       /* Tech id */
-                              GDK_TYPE_RGBA);   /* Color */
-  help_tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(tstore));
-  gtk_widget_set_hexpand(help_tree, TRUE);
-  gtk_widget_set_vexpand(help_tree, TRUE);
-  g_object_unref(tstore);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(help_tree), FALSE);
-
-  g_signal_connect(help_tree, "row_activated",
-                   G_CALLBACK(help_tech_tree_activated_callback), NULL);
-
-
-  col = gtk_tree_view_column_new();
-
-  rend = gtk_cell_renderer_text_new();
-  g_object_set(rend, "weight", PANGO_WEIGHT_BOLD, NULL);
-  gtk_tree_view_column_pack_start(col, rend, TRUE);
-  gtk_tree_view_column_set_attributes(col, rend,
-                                      "text", 0,
-                                      "background-rgba", 3,
-                                      NULL);
-  rend = gtk_cell_renderer_text_new();
-  g_object_set(rend, "weight", PANGO_WEIGHT_BOLD, "xalign", 1.0, NULL);
-  gtk_tree_view_column_pack_start(col, rend, FALSE);
-  gtk_tree_view_column_set_attributes(col, rend,
-                                      "text", 1,
-                                      "background-rgba", 3,
-                                      NULL);
-
-  gtk_tree_view_append_column(GTK_TREE_VIEW(help_tree), col);
-
-  help_tree_sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(help_tree_sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(help_tree_sw), help_tree);
-  gtk_widget_set_size_request(help_tree_sw, -1, 200);
-  gtk_widget_set_visible(help_tree, TRUE);
-  gtk_box_append(GTK_BOX(help_box), help_tree_sw);
-
-  help_tree_expand = gtk_button_new_with_label(_("Expand All"));
-  help_tree_collapse = gtk_button_new_with_label(_("Collapse All"));
-
-  g_signal_connect(help_tree_expand, "clicked",
-                   G_CALLBACK(help_tech_tree_expand_callback), help_tree);
-  g_signal_connect(help_tree_collapse, "clicked",
-                   G_CALLBACK(help_tech_tree_collapse_callback), help_tree);
-
-  help_tree_buttons_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_box_append(GTK_BOX(help_tree_buttons_hbox), help_tree_expand);
-  gtk_box_append(GTK_BOX(help_tree_buttons_hbox), help_tree_collapse);
-  gtk_box_append(GTK_BOX(help_box), help_tree_buttons_hbox);
-  gtk_widget_set_visible(help_tree_buttons_hbox, TRUE);
-}
-
-/**********************************************************************//**
-  Set sprite to show for current help item.
-**************************************************************************/
-static void set_help_tile_from_sprite(struct sprite *spr)
-{
-  if (spr == nullptr) {
-    return;
-  }
-
-  picture_set_from_surface(GTK_PICTURE(help_tile), spr->surface);
-  gtk_widget_set_visible(help_tile, TRUE);
-}
-
-/**********************************************************************//**
-  Set sprite to show for current terrain.
-**************************************************************************/
-static void set_help_tile_from_terrain(struct terrain *pterr)
-{
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  cairo_t *cr;
-  int i;
-
-  canvas.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                              tileset_tile_width(tileset),
-                                              tileset_tile_height(tileset));
-
-  cr = cairo_create(canvas.surface);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  for (i = 0; i < 3; i++) {
-    struct drawn_sprite sprs[80];
-    int count = fill_basic_terrain_layer_sprite_array(tileset, sprs,
-                                                      i, pterr);
-
-    put_drawn_sprites(&canvas, 1.0, 0, 0, count, sprs, FALSE);
-  }
-
-  picture_set_from_surface(GTK_PICTURE(help_tile), canvas.surface);
-  gtk_widget_set_visible(help_tile, TRUE);
-  cairo_surface_destroy(canvas.surface);
-}
-
-/**********************************************************************//**
-  Set sprite to show for current extra.
-**************************************************************************/
-static void set_help_tile_from_extra(const struct extra_type *pextra)
-{
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  cairo_t *cr;
-  struct drawn_sprite sprs[80];
-  int count;
-
-  canvas.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                              tileset_tile_width(tileset),
-                                              tileset_tile_height(tileset));
-
-  cr = cairo_create(canvas.surface);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  count = fill_basic_extra_sprite_array(tileset, sprs, pextra);
-
-  put_drawn_sprites(&canvas, 1.0, 0, 0, count, sprs, FALSE);
-
-  picture_set_from_surface(GTK_PICTURE(help_tile), canvas.surface);
-  gtk_widget_set_visible(help_tile, TRUE);
-  cairo_surface_destroy(canvas.surface);
-}
-
-/**********************************************************************//**
-  Display updated help about improvement
-**************************************************************************/
-static void help_update_improvement(const struct help_item *pitem,
-                                    char *title)
-{
-  char buf[8192];
-  struct impr_type *imp = improvement_by_translated_name(title);
-
-  if (imp != NULL && !is_great_wonder(imp)) {
-    const char *req = skip_intl_qualifier_prefix(REQ_LABEL_NONE);
-    char req_buf[512];
-
-    sprintf(buf, "%d", impr_base_build_shield_cost(imp));
-    gtk_label_set_text(GTK_LABEL(help_ilabel[1]), buf);
-    sprintf(buf, "%d", imp->upkeep);
-    gtk_label_set_text(GTK_LABEL(help_ilabel[3]), buf);
-
-    /* FIXME: this should show ranges, negated reqs, and all the reqs.
-     * Currently it's limited to 1 req but this code is partially prepared
-     * to be extended. */
-    help_impr_req.u.req = NULL;
-    requirement_vector_iterate(&imp->reqs, preq) {
-      if (!preq->present) {
-        continue;
-      }
-      req = universal_name_translation(&preq->source, req_buf, sizeof(req_buf));
-      help_impr_req.u.req = preq;
-      break;
-    } requirement_vector_iterate_end;
-    gtk_label_set_text(GTK_LABEL(help_ilabel[5]), req);
-/*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3); */
-  } else {
-    gtk_label_set_text(GTK_LABEL(help_ilabel[1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ilabel[3]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ilabel[5]), REQ_LABEL_NEVER);
-/*    create_tech_tree(help_improvement_tree, 0, advance_count(), 3); */
-  }
-
-  set_help_tile_from_sprite(get_building_sprite(tileset, imp));
-
-  gtk_widget_set_visible(help_itable, TRUE);
-
-  helptext_building(buf, sizeof(buf), client_player(), pitem->text, imp);
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  Display updated help about wonder.
-**************************************************************************/
-static void help_update_wonder(const struct help_item *pitem,
-                               char *title)
-{
-  char buf[8192];
-  struct impr_type *imp = improvement_by_translated_name(title);
-
-  if (imp != NULL && is_great_wonder(imp)) {
-    int i;
-    char req_buf[512];
-
-    sprintf(buf, "%d", impr_base_build_shield_cost(imp));
-    gtk_label_set_text(GTK_LABEL(help_wlabel[1]), buf);
-
-    /* FIXME: this should show ranges, negated reqs, and all the reqs.
-     * Currently it's limited to 1 req but this code is partially prepared
-     * to be extended. */
-    i = 0;
-    help_wndr_req.u.req = NULL;
-    requirement_vector_iterate(&imp->reqs, preq) {
-      if (!preq->present) {
-        continue;
-      }
-      gtk_label_set_text(GTK_LABEL(help_wlabel[3 + i]),
-                         universal_name_translation(&preq->source,
-                                                    req_buf, sizeof(req_buf)));
-      help_wndr_req.u.req = preq;
-      i++;
-      break;
-    } requirement_vector_iterate_end;
-
-    gtk_label_set_text(GTK_LABEL(help_wlabel[5]), REQ_LABEL_NEVER);
-    requirement_vector_iterate(&imp->obsolete_by, pobs) {
-      if (pobs->source.kind == VUT_ADVANCE && pobs->present) {
-        gtk_label_set_text(GTK_LABEL(help_wlabel[5]),
-                           advance_name_translation
-                               (pobs->source.value.advance));
-
-        break;
-      }
-    } requirement_vector_iterate_end;
-
-/*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3); */
-  } else {
-    /* Can't find wonder */
-    gtk_label_set_text(GTK_LABEL(help_wlabel[1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_wlabel[3]), REQ_LABEL_NEVER);
-    gtk_label_set_text(GTK_LABEL(help_wlabel[5]), skip_intl_qualifier_prefix(REQ_LABEL_NONE));
-/*    create_tech_tree(help_improvement_tree, 0, advance_count(), 3); */
-  }
-
-  set_help_tile_from_sprite(get_building_sprite(tileset, imp));
-
-  gtk_widget_set_visible(help_wtable, TRUE);
-
-  helptext_building(buf, sizeof(buf), client_player(), pitem->text, imp);
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  Display updated help about unit type.
-**************************************************************************/
-static void help_update_unit_type(const struct help_item *pitem,
-                                  char *title)
-{
-  char buf[8192];
-  struct unit_type *utype = unit_type_by_translated_name(title);
-
-  if (utype != NULL) {
-    sprintf(buf, "%d", utype_build_shield_cost_base(utype));
-    gtk_label_set_text(GTK_LABEL(help_ulabel[0][1]), buf);
-    sprintf(buf, "%d", utype->attack_strength);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[0][4]), buf);
-    sprintf(buf, "%d", utype->defense_strength);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[1][1]), buf);
-    sprintf(buf, "%s", move_points_text(utype->move_rate, TRUE));
-    gtk_label_set_text(GTK_LABEL(help_ulabel[1][4]), buf);
-    sprintf(buf, "%d", utype->firepower);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[2][1]), buf);
-    sprintf(buf, "%d", utype->hp);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[2][4]), buf);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[3][1]),
-                       helptext_unit_upkeep_str(utype));
-    sprintf(buf, "%d", (int)sqrt((double)utype->vision_radius_sq));
-    gtk_label_set_text(GTK_LABEL(help_ulabel[3][4]), buf);
-    gtk_label_set_text(GTK_LABEL(help_ulabel[4][1]),
-                       advance_name_translation(utype_primary_tech_req(utype)));
-
-#if 0
-    create_tech_tree(help_improvement_tree, 0,
-                     advance_number(utype->require_advance), 3);
-#endif
-
-    if (U_NOT_OBSOLETED == utype->obsoleted_by) {
-      gtk_label_set_text(GTK_LABEL(help_ulabel[4][4]),
-                         skip_intl_qualifier_prefix(REQ_LABEL_NONE));
-    } else {
-      gtk_label_set_text(GTK_LABEL(help_ulabel[4][4]),
-                         utype_name_translation(utype->obsoleted_by));
-    }
-
-    helptext_unit(buf, sizeof(buf), client_player(), pitem->text, utype,
-                  TRUE);
-
-    gtk_text_buffer_set_text(help_text, buf, -1);
-    gtk_widget_set_visible(help_text_sw, TRUE);
-
-    set_help_tile_from_sprite(get_unittype_sprite(tileset, utype,
-                                                  ACTIVITY_LAST,
-                                                  direction8_invalid()));
-  } else {
-    gtk_label_set_text(GTK_LABEL(help_ulabel[0][1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[0][4]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[1][1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[1][4]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[2][1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[2][4]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[3][1]), "0");
-    gtk_label_set_text(GTK_LABEL(help_ulabel[3][4]), "0");
-
-    gtk_label_set_text(GTK_LABEL(help_ulabel[4][1]), REQ_LABEL_NEVER);
-/*    create_tech_tree(help_improvement_tree, 0, A_LAST, 3); */
-    gtk_label_set_text(GTK_LABEL(help_ulabel[4][4]),
-                       skip_intl_qualifier_prefix(REQ_LABEL_NONE));
-
-    gtk_text_buffer_set_text(help_text, buf, -1);
-    gtk_widget_set_visible(help_text_sw, TRUE);
-  }
-
-  gtk_widget_set_visible(help_utable, TRUE);
-}
-
-/**********************************************************************//**
-  Cut str to at max len bytes in a utf8 friendly way.
-**************************************************************************/
-static char *fc_chomp(char *str, size_t len)
-{
-  gchar *i;
-
-  if (str == NULL || !*str) {
-    return str;
-  }
-
-  i = str + len;
-  for (i = g_utf8_find_prev_char(str, i);
-       (i != NULL && g_unichar_isspace(g_utf8_get_char(i)));
-       i = g_utf8_find_prev_char(str, i)) {
-    *i = '\0';
-  }
-
-  return str;
-}
-
-/**********************************************************************//**
-  Display updated help about tech.
-**************************************************************************/
-static void help_update_tech(const struct help_item *pitem, char *title)
-{
-  int j;
-  GtkWidget *w, *hbox;
-  char buf[8192];
-  struct advance *padvance = advance_by_translated_name(title);
-
-  if (is_regular_advance(padvance)) {
-    GtkTextBuffer *txt;
-    size_t len;
-    Tech_type_id i = advance_number(padvance);
-
-    help_box_clear();
-
-    for (j = 0; j < ARRAY_SIZE(help_advances); j++) {
-      help_advances[j] = FALSE;
-    }
-
-    gtk_tree_store_clear(tstore);
-    create_tech_tree(i, TECH_TREE_DEPTH, NULL);
-    gtk_widget_set_visible(help_tree_sw, TRUE);
-    gtk_widget_set_visible(help_tree_buttons_hbox, TRUE);
-
-    helptext_advance(buf, sizeof(buf), client.conn.playing, pitem->text, i);
-    len = strlen(buf);
-    fc_chomp(buf, len);
-
-    set_help_tile_from_sprite(get_tech_sprite(tileset, i));
-
-    w = gtk_text_view_new();
-    gtk_widget_set_hexpand(w, TRUE);
-    gtk_widget_set_vexpand(w, TRUE);
-    gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(w), FALSE);
-    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(w), GTK_WRAP_WORD);
-    gtk_widget_set_name(w, "help_text");
-    gtk_widget_set_margin_start(w, 5);
-    gtk_widget_set_margin_end(w, 5);
-    gtk_widget_set_margin_top(w, 5);
-    gtk_widget_set_margin_bottom(w, 5);
-    gtk_text_view_set_editable(GTK_TEXT_VIEW(w), FALSE);
-    help_box_add(w);
-    gtk_widget_set_visible(w, TRUE);
-
-    txt = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
-    if (txt != nullptr) {
-      gtk_text_buffer_set_text(txt, buf, -1);
-    }
-
-    w = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_widget_set_margin_bottom(w, 5);
-    gtk_widget_set_margin_end(w, 5);
-    gtk_widget_set_margin_start(w, 5);
-    gtk_widget_set_margin_top(w, 5);
-    gtk_widget_set_hexpand(w, TRUE);
-    gtk_widget_set_vexpand(w, TRUE);
-    help_box_add(w);
-    gtk_widget_set_visible(w, TRUE);
-
-    governments_iterate(pgov) {
-      /* FIXME: need a more general mechanism for this, since this
-       * helptext needs to be shown in all possible req source types. */
-      requirement_vector_iterate(&pgov->reqs, preq) {
-        if (VUT_ADVANCE == preq->source.kind
-            && preq->source.value.advance == padvance) {
-          hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-          help_box_add(hbox);
-          w = gtk_label_new(_("Allows"));
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = help_slink_new_page(government_name_translation(pgov),
-                                  HELP_GOVERNMENT);
-          gtk_box_append(GTK_BOX(hbox), w);
-          gtk_widget_set_visible(hbox, TRUE);
-        }
-      } requirement_vector_iterate_end;
-    } governments_iterate_end;
-
-    improvement_iterate(pimprove) {
-      if (valid_improvement(pimprove)) {
-        requirement_vector_iterate(&pimprove->reqs, preq) {
-          if (VUT_ADVANCE == preq->source.kind
-              && preq->source.value.advance == padvance) {
-            hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-            help_box_add(hbox);
-            w = gtk_label_new(_("Allows"));
-            gtk_box_append(GTK_BOX(hbox), w);
-            w = help_slink_new_page(improvement_name_translation(pimprove),
-                                    is_great_wonder(pimprove)
-                                    ? HELP_WONDER
-                                    : HELP_IMPROVEMENT);
-            gtk_box_append(GTK_BOX(hbox), w);
-            gtk_widget_set_visible(hbox, TRUE);
-          }
-        } requirement_vector_iterate_end;
-        requirement_vector_iterate(&pimprove->obsolete_by, pobs) {
-          if (pobs->source.kind == VUT_ADVANCE
-              && pobs->source.value.advance == padvance
-              && pobs->present) {
-            hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-            help_box_add(hbox);
-            w = gtk_label_new(_("Obsoletes"));
-            gtk_box_append(GTK_BOX(hbox), w);
-            w = help_slink_new_page(improvement_name_translation(pimprove),
-                                    is_great_wonder(pimprove)
-                                    ? HELP_WONDER
-                                    : HELP_IMPROVEMENT);
-            gtk_box_append(GTK_BOX(hbox), w);
-            gtk_widget_set_visible(hbox, TRUE);
-          }
-        } requirement_vector_iterate_end;
-      }
-    } improvement_iterate_end;
-
-    unit_type_iterate(punittype) {
-      if (!is_tech_req_for_utype(punittype, padvance)) {
-        continue;
-      }
-
-      hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-      help_box_add(hbox);
-      w = gtk_label_new(_("Allows"));
-      gtk_box_append(GTK_BOX(hbox), w);
-      w = help_slink_new_page(utype_name_translation(punittype), HELP_UNIT);
-      gtk_box_append(GTK_BOX(hbox), w);
-      gtk_widget_set_visible(hbox, TRUE);
-    } unit_type_iterate_end;
-
-    advance_iterate_all(ptest) {
-      if (padvance == advance_requires(ptest, AR_ONE)) {
-        if (advance_by_number(A_NONE) == advance_requires(ptest, AR_TWO)) {
-          hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-          help_box_add(hbox);
-          w = gtk_label_new(_("Allows"));
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = help_slink_new_page(advance_name_translation(ptest), HELP_TECH);
-          gtk_box_append(GTK_BOX(hbox), w);
-          gtk_widget_set_visible(hbox, TRUE);
-        } else {
-          hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-          help_box_add(hbox);
-          w = gtk_label_new(_("Allows"));
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = help_slink_new_page(advance_name_translation(ptest), HELP_TECH);
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = gtk_label_new(_("with"));
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = help_slink_new_page(advance_name_translation(advance_requires(ptest,
-                                                                            AR_TWO)),
-                                  HELP_TECH);
-          gtk_box_append(GTK_BOX(hbox), w);
-          w = gtk_label_new(Q_("?techhelp:"));
-          gtk_box_append(GTK_BOX(hbox), w);
-          gtk_widget_set_visible(hbox, TRUE);
-        }
-      }
-      if (padvance == advance_requires(ptest, AR_TWO)) {
-        hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-        help_box_add(hbox);
-        w = gtk_label_new(_("Allows"));
-        gtk_box_append(GTK_BOX(hbox), w);
-        w = help_slink_new_page(advance_name_translation(ptest), HELP_TECH);
-        gtk_box_append(GTK_BOX(hbox), w);
-        w = gtk_label_new(_("with"));
-        gtk_box_append(GTK_BOX(hbox), w);
-        w = help_slink_new_page(advance_name_translation(advance_requires(ptest,
-                                                                          AR_ONE)),
-                                HELP_TECH);
-        gtk_box_append(GTK_BOX(hbox), w);
-        w = gtk_label_new(Q_("?techhelp:"));
-        gtk_box_append(GTK_BOX(hbox), w);
-        gtk_widget_set_visible(hbox, TRUE);
-      }
-    } advance_iterate_all_end;
-
-    gtk_widget_set_visible(help_vbox, TRUE);
-  }
-}
-
-/**********************************************************************//**
-  Add a line for an activity linking to help for result.
-**************************************************************************/
-static void add_act_help_for_terrain(const char *act_label,
-                                     const char *result_link_label,
-                                     enum help_page_type result_link_type,
-                                     const char *descr_label)
-{
-  GtkWidget *w;
-  GtkWidget *hbox;
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  help_box_add(hbox);
-  w = gtk_label_new(act_label);
-  gtk_box_append(GTK_BOX(hbox), w);
-  w = help_slink_new_page(result_link_label, result_link_type);
-  gtk_box_append(GTK_BOX(hbox), w);
-  w = gtk_label_new(descr_label);
-  gtk_box_append(GTK_BOX(hbox), w);
-
-  gtk_widget_set_visible(hbox, TRUE);
-}
-
-/**********************************************************************//**
-  Create widgets about all extras of one cause activity to the terrain.
-**************************************************************************/
-static void help_extras_of_act_for_terrain(struct terrain *pterr,
-                                           enum unit_activity act,
-                                           char *label)
-{
-  enum extra_cause cause = activity_to_extra_cause(act);
-
-  extra_type_by_cause_iterate(cause, pextra) {
-    if (pextra->buildable
-        && requirement_fulfilled_by_terrain(pterr, &(pextra->reqs))) {
-      add_act_help_for_terrain(label,
-                               extra_name_translation(pextra), HELP_EXTRA,
-                               helptext_extra_for_terrain_str(pextra, pterr,
-                                                              act));
-    }
-  } extra_type_by_cause_iterate_end;
-}
-
-/**********************************************************************//**
-  Display updated help about terrain.
-**************************************************************************/
-static void help_update_terrain(const struct help_item *pitem,
-                                char *title)
-{
-  char buf[8192];
-  struct terrain *pterrain = terrain_by_translated_name(title);
-
-  if (pterrain != NULL) {
-    struct universal for_terr = { .kind = VUT_TERRAIN, .value = { .terrain = pterrain }};
-
-    set_help_tile_from_terrain(pterrain);
-
-    {
-      /* 25 => "1.25"; 50 => "1.5"; 100 => "2.0" */
-      int defbonus = pterrain->defense_bonus + 100;
-      int frac = defbonus % 100;
-
-      if ((frac % 10) == 0) {
-        frac /= 10;
-      }
-      sprintf(buf, "%d/%d.%d",
-              pterrain->movement_cost, defbonus / 100, frac);
-    }
-    gtk_label_set_text(GTK_LABEL(help_tlabel[0][1]), buf);
-
-    sprintf(buf, "%d/%d/%d",
-            pterrain->output[O_FOOD],
-            pterrain->output[O_SHIELD],
-            pterrain->output[O_TRADE]);
-    gtk_label_set_text(GTK_LABEL(help_tlabel[0][4]), buf);
-
-    buf[0] = '\0';
-    if (*(pterrain->resources)) {
-      struct extra_type **r;
-
-      /* TODO: include resource frequency information */
-      for (r = pterrain->resources; *r; r++) {
-        /* TRANS: " Whales (2/1/2)," */
-        sprintf (buf + strlen (buf), " %s (%d/%d/%d),",
-                 extra_name_translation(*r),
-                 pterrain->output[O_FOOD]   + (*r)->data.resource->output[O_FOOD],
-                 pterrain->output[O_SHIELD] + (*r)->data.resource->output[O_SHIELD],
-                 pterrain->output[O_TRADE]  + (*r)->data.resource->output[O_TRADE]);
-      }
-      buf[strlen (buf) - 1] = '.';
-    } else {
-      /* TRANS: "Resources: (none)" */
-      sprintf (buf + strlen (buf), _("(none)"));
-    }
-    gtk_label_set_text(GTK_LABEL(help_tlabel[1][1]), buf);
-
-    help_box_clear();
-
-    if (pterrain->cultivate_result != T_NONE
-        && action_id_univs_not_blocking(ACTION_CULTIVATE,
-                                        NULL, &for_terr)) {
-      fc_snprintf(buf, sizeof(buf),
-                  PL_("%d turn", "%d turns", pterrain->cultivate_time),
-                  pterrain->cultivate_time);
-      add_act_help_for_terrain(_("Cultivate Rslt/Time"),
-                               terrain_name_translation(pterrain->cultivate_result),
-                               HELP_TERRAIN, buf);
-    }
-
-    if (pterrain->plant_result != T_NONE
-        && action_id_univs_not_blocking(ACTION_PLANT, NULL, &for_terr)) {
-      fc_snprintf(buf, sizeof(buf),
-                  PL_("%d turn", "%d turns", pterrain->plant_time),
-                  pterrain->plant_time);
-      add_act_help_for_terrain(_("Plant Rslt/Time"),
-                               terrain_name_translation(pterrain->plant_result),
-                               HELP_TERRAIN, buf);
-    }
-
-    if (pterrain->transform_result != T_NONE
-        && action_id_univs_not_blocking(ACTION_TRANSFORM_TERRAIN,
-                                        NULL, &for_terr)) {
-      fc_snprintf(buf, sizeof(buf),
-                  PL_("%d turn", "%d turns", pterrain->transform_time),
-                  pterrain->transform_time);
-      add_act_help_for_terrain(_("Trans. Rslt/Time"),
-                               terrain_name_translation(pterrain->transform_result),
-                               HELP_TERRAIN, buf);
-    }
-
-    if (action_id_univs_not_blocking(ACTION_IRRIGATE, NULL, &for_terr)) {
-      help_extras_of_act_for_terrain(pterrain, ACTIVITY_IRRIGATE,
-                                     _("Build as irrigation"));
-    }
-    if (action_id_univs_not_blocking(ACTION_MINE, NULL, &for_terr)) {
-      help_extras_of_act_for_terrain(pterrain, ACTIVITY_MINE,
-                                     _("Build as mine"));
-    }
-    if (action_id_univs_not_blocking(ACTION_ROAD, NULL, &for_terr)) {
-      help_extras_of_act_for_terrain(pterrain, ACTIVITY_GEN_ROAD,
-                                     _("Build as road"));
-    }
-    if (action_id_univs_not_blocking(ACTION_BASE, NULL, &for_terr)) {
-      help_extras_of_act_for_terrain(pterrain, ACTIVITY_BASE,
-                                     _("Build as base"));
-    }
-    gtk_widget_set_visible(help_vbox, TRUE);
-  }
-
-  helptext_terrain(buf, sizeof(buf), client.conn.playing,
-                   pitem->text, pterrain);
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-
-  gtk_widget_set_visible(help_ttable, TRUE);
-}
-
-/**********************************************************************//**
-  Help page for extras.
-**************************************************************************/
-static void help_update_extra(const struct help_item *pitem, char *title)
-{
-  char buf[8192];
-  struct extra_type *pextra = extra_type_by_translated_name(title);
-
-  buf[0] = '\0';
-  if (pextra == NULL) {
-    strcat(buf, pitem->text);
-  } else {
-    struct road_type *proad = extra_road_get(pextra);
-    bool is_resource = is_extra_caused_by(pextra, EC_RESOURCE);
-
-    set_help_tile_from_extra(pextra);
-
-    /* Cost to build */
-    if (pextra->buildable) {
-      if (pextra->build_time != 0) {
-        /* TRANS: "MP" = movement points */
-        sprintf(buf, _("%d MP"), pextra->build_time);
-      } else {
-        /* TRANS: Build time depends on terrain. */
-        sprintf(buf, _("Terrain specific"));
-      }
-    } else {
-      sprintf(buf, "-");
-    }
-    gtk_label_set_text(GTK_LABEL(help_elabel[1]), buf);
-    /* Conflicting extras */
-    buf[0] = '\0';
-    if (is_resource) {
-      /* TRANS: (Resource extra) Conflicts with: */
-      strcat(buf, _("Other Resources"));
-    }
-    extra_type_iterate(pextra2) {
-      if (!can_extras_coexist(pextra, pextra2)
-          && (!is_resource || !is_extra_caused_by(pextra2, EC_RESOURCE))) {
-        if (buf[0] != '\0') {
-          strcat(buf, "/");
-        }
-        strcat(buf, extra_name_translation(pextra2));
-      }
-    } extra_type_iterate_end;
-    /* TRANS: "Conflicts with: (none)" (extras) */
-    gtk_label_set_text(GTK_LABEL(help_elabel[3]), buf[0] ? buf : _("(none)"));
-
-    /* Bonus */
-    if (proad != nullptr) {
-      const char *bonus = nullptr;
-
-      output_type_iterate(o) {
-        if (proad->tile_incr[o] > 0) {
-          /* TRANS: Road bonus depends on terrain. */
-          bonus = _("Terrain specific");
-          break;
-        }
-      } output_type_iterate_end;
-      if (bonus == nullptr) {
-        bonus = helptext_road_bonus_str(nullptr, proad);
-
-        if (bonus == nullptr) {
-          /* TRANS: No output bonus from a road */
-          bonus = Q_("?bonus:None");
-        }
-      }
-      gtk_label_set_text(GTK_LABEL(help_elabel[5]), bonus);
-      gtk_widget_set_visible(GTK_WIDGET(help_elabel[4]), TRUE);
-      gtk_widget_set_visible(GTK_WIDGET(help_elabel[5]), TRUE);
-    } else {
-      gtk_widget_set_visible(GTK_WIDGET(help_elabel[4]), FALSE);
-      gtk_widget_set_visible(GTK_WIDGET(help_elabel[5]), FALSE);
-    }
-
-    helptext_extra(buf, sizeof(buf), client.conn.playing, pitem->text, pextra);
-  }
-  gtk_widget_set_visible(help_etable, TRUE);
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  This is currently just a text page, with special text.
-**************************************************************************/
-static void help_update_goods(const struct help_item *pitem,
-                              char *title)
-{
-  char buf[8192];
-  struct goods_type *pgood = goods_by_translated_name(title);
-
-  if (pgood == nullptr) {
-    strcat(buf, pitem->text);
-  } else {
-    helptext_goods(buf, sizeof(buf), client.conn.playing, pitem->text,
-                   pgood);
-  }
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  This is currently just a text page, with special text.
-**************************************************************************/
-static void help_update_specialist(const struct help_item *pitem,
-                                   char *title)
-{
-  char buf[8192];
-  struct specialist *pspec = specialist_by_translated_name(title);
-
-  if (pspec == nullptr) {
-    strcat(buf, pitem->text);
-  } else {
-    helptext_specialist(buf, sizeof(buf), client.conn.playing, pitem->text,
-                        pspec);
-  }
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  This is currently just a text page, with special text.
-**************************************************************************/
-static void help_update_government(const struct help_item *pitem,
-                                   char *title)
-{
-  char buf[8192];
-  struct government *gov = government_by_translated_name(title);
-
-  if (gov == nullptr) {
-    strcat(buf, pitem->text);
-  } else {
-    helptext_government(buf, sizeof(buf), client.conn.playing,
-                        pitem->text, gov);
-  }
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  Show nation flag and legend.
-**************************************************************************/
-static void help_update_nation(const struct help_item *pitem, char *title,
-                               struct nation_type *pnation)
-{
-  char buf[4096];
-
-  if (pnation == nullptr) {
-    strcat(buf, pitem->text);
-  } else {
-    helptext_nation(buf, sizeof(buf), pnation, pitem->text);
-
-    set_help_tile_from_sprite(get_nation_flag_sprite(tileset, pnation));
-  }
-
-  gtk_text_buffer_set_text(help_text, buf, -1);
-  gtk_widget_set_visible(help_text_sw, TRUE);
-}
-
-/**********************************************************************//**
-  Display updated help dialog.
-**************************************************************************/
-static void help_update_dialog(const struct help_item *pitem)
-{
-  char *top;
-
-  /* Figure out what kind of item is required for pitem ingo */
-
-  for (top = pitem->topic; *top == ' '; top++) {
-    /* Nothing */
-  }
-
-  help_box_hide();
-  gtk_text_buffer_set_text(help_text, "", -1);
-
-  switch (pitem->type) {
-  case HELP_IMPROVEMENT:
-    help_update_improvement(pitem, top);
-    break;
-  case HELP_WONDER:
-    help_update_wonder(pitem, top);
-    break;
-  case HELP_UNIT:
-    help_update_unit_type(pitem, top);
-    break;
-  case HELP_TECH:
-    help_update_tech(pitem, top);
-    break;
-  case HELP_TERRAIN:
-    help_update_terrain(pitem, top);
-    break;
-  case HELP_EXTRA:
-    help_update_extra(pitem, top);
-    break;
-  case HELP_GOODS:
-    help_update_goods(pitem, top);
-    break;
-  case HELP_SPECIALIST:
-    help_update_specialist(pitem, top);
-    break;
-  case HELP_GOVERNMENT:
-    help_update_government(pitem, top);
-    break;
-  case HELP_NATIONS:
-    help_update_nation(pitem, top, nation_by_translated_plural(top));
-    break;
-  case HELP_TEXT:
-  default:
-    /* It was a pure text item */
-    gtk_text_buffer_set_text(help_text, pitem->text, -1);
-    gtk_widget_set_visible(help_text_sw, TRUE);
-    break;
-  }
-  set_title_topic(pitem->topic);
-
-  gtk_widget_set_visible(help_box, TRUE);
-}
-
-/**********************************************************************//**
-  Add item at path to selection and scroll to its cell.
-**************************************************************************/
-static void help_item_zoom(GtkTreePath *path)
-{
-  GtkTreeModel *model;
-  GtkTreeIter   it, child, item;
-  GtkTreeSelection *selection;
-
-  model = gtk_tree_view_get_model(GTK_TREE_VIEW(help_view));
-  gtk_tree_model_get_iter(model, &item, path);
-
-  for (child = item; gtk_tree_model_iter_parent(model, &it, &child); child = it) {
-    GtkTreePath *it_path;
-
-    it_path = gtk_tree_model_get_path(model, &it);
-    gtk_tree_view_expand_row(GTK_TREE_VIEW(help_view), it_path, TRUE);
-    gtk_tree_path_free(it_path);
-  }
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(help_view));
-  gtk_tree_selection_select_iter(selection, &item);
-  gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(help_view), path, NULL,
-                               TRUE, 0.0, 0.0);
-}
-
-/**********************************************************************//**
-  Return path to help item.
-**************************************************************************/
-static GtkTreePath *help_item_path(const struct help_item *pitem)
-{
-  GtkTreePath *path;
-  bool next;
-
-  path = gtk_tree_path_new_first();
-  next = FALSE;
-  help_items_iterate(pitem2) {
-    const char *s;
-    int depth;
-
-    for (s = pitem2->topic; *s == ' '; s++) {
-      /* Nothing */
-    }
-    depth = s - pitem2->topic + 1;
-
-    while (depth < gtk_tree_path_get_depth(path)) {
-      gtk_tree_path_up(path);
-      gtk_tree_path_next(path);
-      next = FALSE;
-    }
-    while (depth > gtk_tree_path_get_depth(path)) {
-      gtk_tree_path_down(path);
-      next = FALSE;
-    }
-
-    if (next) {
-      gtk_tree_path_next(path);
-    }
-
-    if (pitem == pitem2) {
-      break;
-    }
-
-    next = TRUE;
-  } help_items_iterate_end;
-
-  return path;
-}
-
-/**********************************************************************//**
-  Add item to selection.
-**************************************************************************/
-static void select_help_item_string(const char *item, enum help_page_type htype)
-{
-  const struct help_item *pitem;
-  int idx;
-  GtkTreePath *path;
-  GtkTreeViewColumn *col;
-
-  if (!(pitem = get_help_item_spec(item, htype, &idx))) {
-    return;
-  }
-
-  path = help_item_path(pitem);
-  help_item_zoom(path);
-
-  col = gtk_tree_view_get_column(GTK_TREE_VIEW(help_view), 0);
-  gtk_tree_view_set_cursor(GTK_TREE_VIEW(help_view), path, col, FALSE);
-  gtk_tree_path_free(path);
-}
-
-/**********************************************************************//**
-  Set sensitivity of help dialog response buttons.
-**************************************************************************/
-static void help_command_update(void)
-{
-  GtkDialog *dialog = GTK_DIALOG(help_dialog_shell);
-
-  if (help_history_pos < 0) {
-    gtk_dialog_set_response_sensitive(dialog, 1, FALSE);
-    gtk_dialog_set_response_sensitive(dialog, 2, FALSE);
-  } else {
-    gtk_dialog_set_response_sensitive(dialog, 1, TRUE);
-    gtk_dialog_set_response_sensitive(dialog, 2, TRUE);
-
-    if (help_history_pos == 0) {
-      gtk_dialog_set_response_sensitive(dialog, 1, FALSE);
-    }
-    if (help_history_pos >= help_history->len - 1) {
-      gtk_dialog_set_response_sensitive(dialog, 2, FALSE);
-    }
-  }
-}
-
-/**********************************************************************//**
-  User gave response to help dialog.
-**************************************************************************/
-static void help_command_callback(GtkWidget *w, gint response_id)
-{
-  GtkTreePath *path;
-  const struct help_item *pitem;
-
-  if (response_id == 1) {
-    if (help_history_pos > 0) {
-      help_history_pos--;
-
-      pitem = g_ptr_array_index(help_history, help_history_pos);
-      path = help_item_path(pitem);
-      help_item_zoom(path);
-      help_update_dialog(pitem);
-      help_command_update();
-    }
-  } else if (response_id == 2) {
-    if (help_history_pos < help_history->len - 1) {
-      help_history_pos++;
-
-      pitem = g_ptr_array_index(help_history, help_history_pos);
-      path = help_item_path(pitem);
-      help_item_zoom(path);
-      help_update_dialog(pitem);
-      help_command_update();
-    }
-  } else {
-    /* Save size of the dialog. */
-    gtk_window_get_default_size(GTK_WINDOW(help_dialog_shell),
-                                &GUI_GTK_OPTION(helpdlg_xsize),
-                                &GUI_GTK_OPTION(helpdlg_ysize));
-    gtk_window_destroy(GTK_WINDOW(help_dialog_shell));
-  }
-}
diff --git a/client/gui-gtk-5.0/helpdlg.h b/client/gui-gtk-5.0/helpdlg.h
deleted file mode 100644
index f9968db9fd..0000000000
--- a/client/gui-gtk-5.0/helpdlg.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__HELPDLG_H
-#define FC__HELPDLG_H
-
-/* client */
-#include "helpdlg_g.h"
-
-void help_system_init(void);
-
-#endif /* FC__HELPDLG_H */
diff --git a/client/gui-gtk-5.0/infradlg.c b/client/gui-gtk-5.0/infradlg.c
deleted file mode 100644
index 2f29f93a17..0000000000
--- a/client/gui-gtk-5.0/infradlg.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "extras.h"
-#include "game.h"
-
-/* client */
-#include "client_main.h"
-#include "dialogs_g.h"
-#include "mapview_common.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "infradlg.h"
-
-static GtkWidget *infra_list_box = NULL;
-static GtkWidget *instruction_label = NULL;
-static GtkWidget *points_label = NULL;
-static int infra_rows = 0;
-
-struct infra_cb_data {
-  struct tile *ptile;
-  struct extra_type *pextra;
-};
-
-/************************************************************************//**
-  Is infra dialog currently open?
-****************************************************************************/
-static bool infra_dialog_open(void)
-{
-  return infra_list_box != NULL;
-}
-
-/************************************************************************//**
-  Handle infra dialog closing.
-****************************************************************************/
-static void infra_response_callback(GtkWidget *dlg, gint arg)
-{
-  infra_list_box = NULL;
-  instruction_label = NULL;
-  points_label = NULL;
-  infra_rows = 0;
-
-  client_infratile_set(NULL);
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/************************************************************************//**
-  Handle user infra selection.
-****************************************************************************/
-static void infra_selected_callback(GtkButton *but, gpointer userdata)
-{
-  struct infra_cb_data *cbdata = (struct infra_cb_data *)userdata;
-
-  dsend_packet_player_place_infra(&client.conn, cbdata->ptile->index,
-                                  cbdata->pextra->id);
-}
-
-/************************************************************************//**
-  Open infra placement dialog
-****************************************************************************/
-void infra_dialog_popup(void)
-{
-  GtkWidget *dlg;
-  GtkWidget *main_box;
-  GtkWidget *sep;
-  int grid_row = 0;
-
-  if (infra_dialog_open()) {
-    /* One infra dialog already open. */
-    return;
-  }
-
-  dlg = gtk_dialog_new_with_buttons(_("Place infrastructure"), NULL, 0,
-                                    _("Close"), GTK_RESPONSE_NO,
-                                    NULL);
-
-  setup_dialog(dlg, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_NO);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dlg), TRUE);
-
-  main_box = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(main_box),
-                                 GTK_ORIENTATION_VERTICAL);
-
-  instruction_label = gtk_label_new(_("First click a tile."));
-  gtk_grid_attach(GTK_GRID(main_box), instruction_label, 0, grid_row++, 1, 1);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_grid_attach(GTK_GRID(main_box), sep, 0, grid_row++, 1, 1);
-
-  points_label = gtk_label_new(_("- infrapoints"));
-  gtk_grid_attach(GTK_GRID(main_box), points_label, 0, grid_row++, 1, 1);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_grid_attach(GTK_GRID(main_box), sep, 0, grid_row++, 1, 1);
-
-  infra_list_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-  gtk_grid_attach(GTK_GRID(main_box), infra_list_box, 0, grid_row++, 1, 1);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dlg))),
-                 main_box);
-
-  g_signal_connect(dlg, "destroy", G_CALLBACK(infra_response_callback), NULL);
-  g_signal_connect(dlg, "response", G_CALLBACK(infra_response_callback), NULL);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(dlg)), TRUE);
-  gtk_widget_set_visible(dlg, TRUE);
-
-  update_infra_dialog();
-}
-
-/************************************************************************//**
-  Refresh infra dialog
-****************************************************************************/
-void update_infra_dialog(void)
-{
-  if (infra_dialog_open()) {
-    char buffer[100];
-
-    fc_snprintf(buffer, sizeof(buffer),
-                PL_("%d infrapoint", "%d infrapoints",
-                    client.conn.playing->economic.infra_points),
-                client.conn.playing->economic.infra_points);
-
-    gtk_label_set_text(GTK_LABEL(points_label), buffer);
-  }
-}
-
-/************************************************************************//**
-  Are we in infra placement mode at the moment?
-****************************************************************************/
-bool infra_placement_mode(void)
-{
-  return infra_list_box != NULL;
-}
-
-/************************************************************************//**
-  Set tile for the infra placement.
-****************************************************************************/
-void infra_placement_set_tile(struct tile *ptile)
-{
-  if (infra_list_box != NULL) {
-    GtkWidget *child = gtk_widget_get_first_child(infra_list_box);
-
-    while (child != NULL) {
-      gtk_box_remove(GTK_BOX(infra_list_box), child);
-      child = gtk_widget_get_first_child(infra_list_box);
-    }
-  }
-  infra_rows = 0;
-
-  if (!client_map_is_known_and_seen(ptile, client.conn.playing, V_MAIN)) {
-    return;
-  }
-
-  client_infratile_set(ptile);
-
-  extra_type_iterate(pextra) {
-    if (player_can_place_extra(pextra, client.conn.playing, ptile)) {
-      GtkWidget *but = gtk_button_new_with_label(extra_name_translation(pextra));
-      struct infra_cb_data *cbdata = fc_malloc(sizeof(struct infra_cb_data));
-
-      cbdata->ptile = ptile;
-      cbdata->pextra = pextra;
-
-      g_signal_connect(but, "clicked",
-                       G_CALLBACK(infra_selected_callback), cbdata);
-      gtk_box_append(GTK_BOX(infra_list_box), but);
-      infra_rows++;
-    }
-  } extra_type_iterate_end;
-
-  if (infra_rows <= 0) {
-    gtk_label_set_text(GTK_LABEL(instruction_label),
-                       _("No infra possible. Select another tile."));
-  } else {
-    gtk_label_set_text(GTK_LABEL(instruction_label),
-                       _("Select infra for the tile, or another tile."));
-  }
-
-  gtk_widget_set_visible(infra_list_box, TRUE);
-}
diff --git a/client/gui-gtk-5.0/infradlg.h b/client/gui-gtk-5.0/infradlg.h
deleted file mode 100644
index 8f413b07a5..0000000000
--- a/client/gui-gtk-5.0/infradlg.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__INFRADLG_H
-#define FC__INFRADLG_H
-
-void infra_dialog_popup(void);
-bool infra_placement_mode(void);
-void infra_placement_set_tile(struct tile *ptile);
-
-#endif  /* FC__INFRADLG_H */
diff --git a/client/gui-gtk-5.0/inputdlg.c b/client/gui-gtk-5.0/inputdlg.c
deleted file mode 100644
index c1e833ec4b..0000000000
--- a/client/gui-gtk-5.0/inputdlg.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "inputdlg.h"
-
-struct input_dialog_data {
-  input_dialog_callback_t response_callback;
-  gpointer response_cli_data;
-};
-
-/**********************************************************************//**
-  Called when user dismisses dialog -- either to accept or to cancel.
-**************************************************************************/
-static void input_dialog_response(GtkDialog *shell, gint response,
-                                  gpointer data)
-{
-  GtkWidget *winput = g_object_get_data(G_OBJECT(shell), "iinput");
-  struct input_dialog_data *cb = data;
-
-  cb->response_callback(cb->response_cli_data,
-                        response,
-                        gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(winput))));
-
-  /* Any response is final */
-  gtk_window_destroy(GTK_WINDOW(shell));
-  FC_FREE(cb);
-}
-
-/**********************************************************************//**
-  Called when user closes dialog with key (Esc).
-**************************************************************************/
-static void input_dialog_close(GtkDialog *shell, gpointer data)
-{
-  input_dialog_response(shell, GTK_RESPONSE_CANCEL, data);
-}
-
-/**********************************************************************//**
-  Create a popup with a text entry box and "OK" and "Cancel" buttons.
-**************************************************************************/
-GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname,
-                               const char *text, const char *postinputtest,
-                               input_dialog_callback_t response_callback,
-                               gpointer response_cli_data)
-{
-  GtkWidget *shell, *label, *input;
-  struct input_dialog_data *cb = fc_malloc(sizeof(struct input_dialog_data));
-
-  cb->response_callback = response_callback;
-  cb->response_cli_data = response_cli_data;
-
-  shell = gtk_dialog_new_with_buttons(dialogname,
-                                      parent,
-                                      GTK_DIALOG_DESTROY_WITH_PARENT,
-                                      _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                      _("_OK"), GTK_RESPONSE_OK,
-                                      NULL);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_OK);
-  setup_dialog(shell, GTK_WIDGET(parent));
-  g_signal_connect(shell, "response", G_CALLBACK(input_dialog_response), cb);
-  g_signal_connect(shell, "close", G_CALLBACK(input_dialog_close), cb);
-
-  label = gtk_frame_new(text);
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
-                             label, NULL);
-
-  input = gtk_entry_new();
-  gtk_frame_set_child(GTK_FRAME(label), input);
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(input)),
-                            postinputtest, -1);
-  gtk_entry_set_activates_default(GTK_ENTRY(input), TRUE);
-  g_object_set_data(G_OBJECT(shell), "iinput", input);
-
-  gtk_widget_set_visible(GTK_WIDGET(shell), TRUE);
-  gtk_window_present(GTK_WINDOW(shell));
-
-  return shell;
-}
diff --git a/client/gui-gtk-5.0/inputdlg.h b/client/gui-gtk-5.0/inputdlg.h
deleted file mode 100644
index 99ec7088d2..0000000000
--- a/client/gui-gtk-5.0/inputdlg.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__INPUTDLG_H
-#define FC__INPUTDLG_H
-
-#include <gtk/gtk.h>
-
-typedef void (*input_dialog_callback_t)(gpointer response_cli_data,
-                                        gint response, const char *input);
-
-GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname,
-                               const char *text, const char *postinputtest,
-                               input_dialog_callback_t response_callback,
-                               gpointer response_cli_data);
-
-#endif  /* FC__INPUTDLG_H */
diff --git a/client/gui-gtk-5.0/inteldlg.c b/client/gui-gtk-5.0/inteldlg.c
deleted file mode 100644
index 49e8e71c16..0000000000
--- a/client/gui-gtk-5.0/inteldlg.c
+++ /dev/null
@@ -1,879 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "government.h"
-#include "nation.h"
-#include "packets.h"
-#include "player.h"
-#include "research.h"
-
-/* client */
-#include "client_main.h"
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-
-#include "inteldlg.h"
-
-/******************************************************************/
-static const char *table_text[] = {
-  N_("Ruler:"),
-  N_("Government:"),
-  N_("Capital:"),
-  N_("Gold:"),
-  NULL,
-  N_("Tax:"),
-  N_("Science:"),
-  N_("Luxury:"),
-  NULL,
-  N_("Researching:"),
-  N_("Culture:")
-};
-
-enum table_label {
-  LABEL_RULER,
-  LABEL_GOVERNMENT,
-  LABEL_CAPITAL,
-  LABEL_GOLD,
-  LABEL_SEP1,
-  LABEL_TAX,
-  LABEL_SCIENCE,
-  LABEL_LUXURY,
-  LABEL_SEP2,
-  LABEL_RESEARCHING,
-  LABEL_CULTURE,
-  LABEL_LAST
-};
-
-/******************************************************************/
-struct intel_dialog {
-  struct player *pplayer;
-  GtkWidget *shell;
-
-  GtkTreeStore *diplstates;
-  GListStore *techs;
-  GtkWidget *table_labels[LABEL_LAST];
-};
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct intel_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct intel_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-struct intel_wonder_dialog {
-  struct player *pplayer;
-  GtkWidget *shell;
-
-  GListStore *wonders;
-  GtkWidget *rule;
-};
-
-#define SPECLIST_TAG wonder_dialog
-#define SPECLIST_TYPE struct intel_wonder_dialog
-#include "speclist.h"
-
-#define wonder_dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct intel_wonder_dialog, dialoglist, pdialog)
-#define wonder_dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-static struct intel_dialog *create_intel_dialog(struct player *p);
-static struct wonder_dialog_list *wonder_dialogs;
-static struct intel_wonder_dialog *create_intel_wonder_dialog(struct player *p);
-
-#define FC_TYPE_TECH_ROW (fc_tech_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcTechRow, fc_tech_row, FC, TECH_ROW, GObject)
-
-struct _FcTechRow
-{
-  GObject parent_instance;
-
-  bool unknown;
-  const char *name;
-};
-
-struct _FcTechRowClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcTechRow, fc_tech_row, G_TYPE_OBJECT)
-
-#define FC_TYPE_WONDER_ROW (fc_wonder_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcWonderRow, fc_wonder_row, FC, WONDER_ROW, GObject)
-
-struct _FcWonderRow
-{
-  GObject parent_instance;
-
-  const char *name;
-  const char *cityname;
-  bool is_lost;
-  int font_weight;
-};
-
-struct _FcWonderRowClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcWonderRow, fc_wonder_row, G_TYPE_OBJECT)
-
-#define TECH_ROW_NAME  0
-#define TECH_ROW_KNOWN 1
-
-#define WONDER_ROW_NAME 0
-#define WONDER_ROW_CITY 1
-
-/**********************************************************************//**
-  Initialization method for FcTechRow class
-**************************************************************************/
-static void
-fc_tech_row_class_init(FcTechRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcTechRow
-**************************************************************************/
-static void
-fc_tech_row_init(FcTechRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcTechRow creation method
-**************************************************************************/
-static FcTechRow *fc_tech_row_new(void)
-{
-  FcTechRow *result;
-
-  result = g_object_new(FC_TYPE_TECH_ROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  Initialization method for FcWonderRow class
-**************************************************************************/
-static void
-fc_wonder_row_class_init(FcWonderRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcWonderRow
-**************************************************************************/
-static void
-fc_wonder_row_init(FcWonderRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcWonderRow creation method
-**************************************************************************/
-static FcWonderRow *fc_wonder_row_new(void)
-{
-  FcWonderRow *result;
-
-  result = g_object_new(FC_TYPE_WONDER_ROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  Initialize intelligence dialogs
-**************************************************************************/
-void intel_dialog_init(void)
-{
-  dialog_list = dialog_list_new();
-  wonder_dialogs = wonder_dialog_list_new();
-}
-
-/**********************************************************************//**
-  Free resources allocated for intelligence dialogs
-**************************************************************************/
-void intel_dialog_done(void)
-{
-  dialog_list_destroy(dialog_list);
-  wonder_dialog_list_destroy(wonder_dialogs);
-}
-
-/**********************************************************************//**
-  Get intelligence dialog between client user and other player
-  passed as parameter.
-**************************************************************************/
-static struct intel_dialog *get_intel_dialog(struct player *pplayer)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pplayer == pplayer) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  Get wonder list dialog between client user and other player
-  passed as parameter.
-**************************************************************************/
-static struct intel_wonder_dialog *get_intel_wonder_dialog(struct player *pplayer)
-{
-  wonder_dialog_list_iterate(wonder_dialogs, pdialog) {
-    if (pdialog->pplayer == pplayer) {
-      return pdialog;
-    }
-  } wonder_dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  Open intelligence dialog
-**************************************************************************/
-void popup_intel_dialog(struct player *p)
-{
-  struct intel_dialog *pdialog;
-
-  if (!(pdialog = get_intel_dialog(p))) {
-    pdialog = create_intel_dialog(p);
-  }
-
-  update_intel_dialog(p);
-
-  gtk_window_present(GTK_WINDOW(pdialog->shell));
-}
-
-/**********************************************************************//**
-  Open wonder list dialog
-**************************************************************************/
-void popup_intel_wonder_dialog(struct player *p)
-{
-  struct intel_wonder_dialog *pdialog;
-
-  if (!(pdialog = get_intel_wonder_dialog(p))) {
-    pdialog = create_intel_wonder_dialog(p);
-  }
-
-  update_intel_wonder_dialog(p);
-
-  gtk_window_present(GTK_WINDOW(pdialog->shell));
-}
-
-/**********************************************************************//**
-  Intelligence dialog destruction requested
-**************************************************************************/
-static void intel_destroy_callback(GtkWidget *w, gpointer data)
-{
-  struct intel_dialog *pdialog = (struct intel_dialog *)data;
-
-  dialog_list_remove(dialog_list, pdialog);
-
-  free(pdialog);
-}
-
-/**********************************************************************//**
-  Wonders list dialog destruction requested
-**************************************************************************/
-static void intel_wonder_destroy_callback(GtkWidget *w, gpointer data)
-{
-  struct intel_wonder_dialog *pdialog = (struct intel_wonder_dialog *)data;
-
-  wonder_dialog_list_remove(wonder_dialogs, pdialog);
-
-  free(pdialog);
-}
-
-/**********************************************************************//**
-  Close an intelligence dialog for the given player.
-**************************************************************************/
-void close_intel_dialog(struct player *p)
-{
-  struct intel_dialog *pdialog = get_intel_dialog(p);
-
-  intel_destroy_callback(NULL, pdialog);
-}
-
-/**********************************************************************//**
-  Close an wonders list dialog for the given player.
-**************************************************************************/
-void close_intel_wonder_dialog(struct player *p)
-{
-  struct intel_wonder_dialog *pdialog = get_intel_wonder_dialog(p);
-
-  intel_wonder_destroy_callback(NULL, pdialog);
-}
-
-/**********************************************************************//**
-  Tech table cell bind function
-**************************************************************************/
-static void tech_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcTechRow *row;
-
-  row = gtk_list_item_get_item(list_item);
-
-  if (GPOINTER_TO_INT(user_data) == TECH_ROW_KNOWN) {
-    gtk_check_button_set_active(GTK_CHECK_BUTTON(gtk_list_item_get_child(list_item)),
-                                row->unknown);
-  } else {
-    gtk_label_set_text(GTK_LABEL(gtk_list_item_get_child(list_item)),
-                                 row->name);
-  }
-}
-
-/**********************************************************************//**
-  Tech table cell setup function
-**************************************************************************/
-static void tech_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  if (GPOINTER_TO_INT(user_data) == TECH_ROW_KNOWN) {
-    gtk_list_item_set_child(list_item, gtk_check_button_new());
-  } else {
-    gtk_list_item_set_child(list_item, gtk_label_new(""));
-  }
-}
-
-/**********************************************************************//**
-  Create new intelligence dialog between client user and player
-  given as parameter.
-**************************************************************************/
-static struct intel_dialog *create_intel_dialog(struct player *p)
-{
-  struct intel_dialog *pdialog;
-
-  GtkWidget *shell, *notebook, *label, *sw, *view, *table;
-  GtkCellRenderer *rend;
-  GtkTreeViewColumn *col;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-  int i;
-
-  pdialog = fc_malloc(sizeof(*pdialog));
-  pdialog->pplayer = p;
-
-  shell = gtk_dialog_new_with_buttons(NULL,
-                                      NULL,
-                                      0,
-                                      _("_Close"),
-                                      GTK_RESPONSE_CLOSE,
-                                      NULL);
-  pdialog->shell = shell;
-  gtk_window_set_default_size(GTK_WINDOW(shell), 350, 350);
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
-
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(intel_destroy_callback), pdialog);
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(gtk_window_destroy), NULL);
-
-  notebook = gtk_notebook_new();
-  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_BOTTOM);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))), notebook);
-
-  /* Overview tab. */
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 6);
-  gtk_widget_set_margin_end(table, 6);
-  gtk_widget_set_margin_start(table, 6);
-  gtk_widget_set_margin_top(table, 6);
-
-  gtk_grid_set_row_spacing(GTK_GRID(table), 2);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 12);
-
-  /* TRANS: Overview tab of foreign intelligence report dialog */
-  label = gtk_label_new_with_mnemonic(_("_Overview"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label);
-
-  for (i = 0; i < ARRAY_SIZE(table_text); i++) {
-    if (table_text[i]) {
-      label = gtk_label_new(_(table_text[i]));
-      gtk_widget_set_halign(label, GTK_ALIGN_START);
-      gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-      gtk_grid_attach(GTK_GRID(table), label, 0, i, 1, 1);
-
-      label = gtk_label_new(NULL);
-      pdialog->table_labels[i] = label;
-      gtk_widget_set_halign(label, GTK_ALIGN_START);
-      gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-      gtk_grid_attach(GTK_GRID(table), label, 1, i, 1, 1);
-    } else {
-      pdialog->table_labels[i] = NULL;
-    }
-  }
-
-  /* Diplomacy tab. */
-  pdialog->diplstates = gtk_tree_store_new(1, G_TYPE_STRING);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(pdialog->diplstates));
-  gtk_widget_set_margin_bottom(view, 6);
-  gtk_widget_set_margin_end(view, 6);
-  gtk_widget_set_margin_start(view, 6);
-  gtk_widget_set_margin_top(view, 6);
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(pdialog->diplstates);
-  gtk_widget_set_margin_start(view, 6);
-  gtk_widget_set_margin_end(view, 6);
-  gtk_widget_set_margin_top(view, 6);
-  gtk_widget_set_margin_bottom(view, 6);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-
-  rend = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(NULL, rend,
-    "text", 0, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-
-  gtk_tree_view_expand_all(GTK_TREE_VIEW(view));
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-  label = gtk_label_new_with_mnemonic(_("_Diplomacy"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
-
-  /* Techs tab. */
-  pdialog->techs = g_list_store_new(FC_TYPE_TECH_ROW);
-
-  selection = gtk_single_selection_new(G_LIST_MODEL(pdialog->techs));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(tech_factory_bind),
-                   GINT_TO_POINTER(TECH_ROW_NAME));
-  g_signal_connect(factory, "setup", G_CALLBACK(tech_factory_setup),
-                   GINT_TO_POINTER(TECH_ROW_NAME));
-
-  column = gtk_column_view_column_new(_("Name"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(tech_factory_bind),
-                   GINT_TO_POINTER(TECH_ROW_KNOWN));
-  g_signal_connect(factory, "setup", G_CALLBACK(tech_factory_setup),
-                   GINT_TO_POINTER(TECH_ROW_KNOWN));
-
-  column = gtk_column_view_column_new(_("Unknown"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), list);
-
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-  label = gtk_label_new_with_mnemonic(_("_Techs"));
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(shell)),
-                         TRUE);
-
-  dialog_list_prepend(dialog_list, pdialog);
-
-  return pdialog;
-}
-
-/**********************************************************************//**
-  Wonder table cell bind function
-**************************************************************************/
-static void wonder_factory_bind(GtkSignalListItemFactory *self,
-                                GtkListItem *list_item,
-                                gpointer user_data)
-{
-  FcWonderRow *row;
-
-  row = gtk_list_item_get_item(list_item);
-
-  if (GPOINTER_TO_INT(user_data) == WONDER_ROW_CITY) {
-    gtk_label_set_text(GTK_LABEL(gtk_list_item_get_child(list_item)),
-                       row->cityname);
-  } else {
-    PangoAttrList *attributes;
-    PangoAttribute *attr;
-    GtkLabel *lbl = GTK_LABEL(gtk_list_item_get_child(list_item));
-
-    fc_assert(GPOINTER_TO_INT(user_data) == WONDER_ROW_NAME);
-
-    attributes = pango_attr_list_new();
-
-    if (row->is_lost) {
-      attr = pango_attr_strikethrough_new(TRUE);
-      pango_attr_list_insert(attributes, attr);
-    }
-
-    attr = pango_attr_weight_new(row->font_weight);
-    pango_attr_list_insert(attributes, attr);
-
-    gtk_label_set_text(lbl, row->name);
-    gtk_label_set_attributes(lbl, attributes);
-  }
-}
-
-/**********************************************************************//**
-  Wonder table cell setup function
-**************************************************************************/
-static void wonder_factory_setup(GtkSignalListItemFactory *self,
-                                 GtkListItem *list_item,
-                                 gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Create new wonders list dialog between client user and player
-  given as parameter.
-**************************************************************************/
-static struct intel_wonder_dialog *create_intel_wonder_dialog(struct player *p)
-{
-  struct intel_wonder_dialog *pdialog;
-  GtkWidget *shell;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-  GtkWidget *box;
-
-  pdialog = fc_malloc(sizeof(*pdialog));
-  pdialog->pplayer = p;
-
-  shell = gtk_dialog_new_with_buttons(NULL,
-                                      NULL,
-                                      0,
-                                      _("_Close"),
-                                      GTK_RESPONSE_CLOSE,
-                                      NULL);
-  pdialog->shell = shell;
-  gtk_window_set_default_size(GTK_WINDOW(shell), 350, 350);
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CLOSE);
-
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(intel_wonder_destroy_callback), pdialog);
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(gtk_window_destroy), NULL);
-
-
-  pdialog->rule = gtk_label_new("-");
-
-  pdialog->wonders = g_list_store_new(FC_TYPE_WONDER_ROW);
-
-  selection = gtk_single_selection_new(G_LIST_MODEL(pdialog->wonders));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(wonder_factory_bind),
-                   GINT_TO_POINTER(WONDER_ROW_NAME));
-  g_signal_connect(factory, "setup", G_CALLBACK(wonder_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("Name"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(wonder_factory_bind),
-                   GINT_TO_POINTER(WONDER_ROW_CITY));
-  g_signal_connect(factory, "setup", G_CALLBACK(wonder_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("City"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(box), pdialog->rule);
-  gtk_box_append(GTK_BOX(box), list);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))), box);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(shell)),
-                         TRUE);
-
-  wonder_dialog_list_prepend(wonder_dialogs, pdialog);
-
-  return pdialog;
-}
-
-/**********************************************************************//**
-  Update the intelligence dialog for the given player. This is called by
-  the core client code when that player's information changes.
-**************************************************************************/
-void update_intel_dialog(struct player *p)
-{
-  struct intel_dialog *pdialog = get_intel_dialog(p);
-
-  if (pdialog) {
-    const struct research *mresearch, *presearch;
-    GtkTreeIter diplstates[DS_LAST];
-    int i;
-    bool global_observer = client_is_global_observer();
-    struct player *me = client_player();
-    bool embassy_knowledge = global_observer || team_has_embassy(me->team, p);
-    bool trade_knowledge = global_observer || p == me || could_intel_with_player(me, p);
-
-    /* Window title. */
-    gchar *title = g_strdup_printf(_("Foreign Intelligence: %s Empire"),
-                                   nation_adjective_for_player(p));
-    gtk_window_set_title(GTK_WINDOW(pdialog->shell), title);
-    g_free(title);
-
-    /* Diplomacy tab. */
-    gtk_tree_store_clear(pdialog->diplstates);
-
-    for (i = 0; i < ARRAY_SIZE(diplstates); i++) {
-      GtkTreeIter it;
-      GValue v = { 0, };
-
-      gtk_tree_store_append(pdialog->diplstates, &it, NULL);
-      g_value_init(&v, G_TYPE_STRING);
-      g_value_set_static_string(&v, diplstate_type_translated_name(i));
-      gtk_tree_store_set_value(pdialog->diplstates, &it, 0, &v);
-      g_value_unset(&v);
-      diplstates[i] = it;
-    }
-
-    players_iterate(other) {
-      const struct player_diplstate *state;
-      GtkTreeIter it;
-      GValue v = { 0, };
-
-      if (other == p || !other->is_alive) {
-        continue;
-      }
-      state = player_diplstate_get(p, other);
-      gtk_tree_store_append(pdialog->diplstates, &it,
-                            &diplstates[state->type]);
-      g_value_init(&v, G_TYPE_STRING);
-      g_value_set_static_string(&v, player_name(other));
-      gtk_tree_store_set_value(pdialog->diplstates, &it, 0, &v);
-      g_value_unset(&v);
-    } players_iterate_end;
-
-    /* Techs tab. */
-    g_list_store_remove_all(pdialog->techs);
-
-    mresearch = research_get(client_player());
-    presearch = research_get(p);
-    advance_index_iterate(A_FIRST, advi) {
-      if (research_invention_state(presearch, advi) == TECH_KNOWN) {
-        FcTechRow *row = fc_tech_row_new();
-
-        row->name = research_advance_name_translation(presearch, advi);
-        row->unknown = research_invention_state(mresearch, advi) != TECH_KNOWN;
-
-        g_list_store_append(pdialog->techs, row);
-        g_object_unref(row);
-      }
-    } advance_index_iterate_end;
-
-    /* Table labels. */
-    for (i = 0; i < ARRAY_SIZE(pdialog->table_labels); i++) {
-      if (pdialog->table_labels[i]) {
-        struct city *pcity;
-        gchar *buf = NULL;
-        char tbuf[256];
-
-        switch (i) {
-        case LABEL_RULER:
-          ruler_title_for_player(p, tbuf, sizeof(tbuf));
-          buf = g_strdup(tbuf);
-          break;
-        case LABEL_GOVERNMENT:
-          if (trade_knowledge) {
-            buf = g_strdup(government_name_for_player(p));
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        case LABEL_CAPITAL:
-          pcity = player_primary_capital(p);
-          /* TRANS: "unknown" location */
-          buf = g_strdup((!pcity) ? _("(Unknown)") : city_name_get(pcity));
-          break;
-        case LABEL_GOLD:
-          if (trade_knowledge) {
-            buf = g_strdup_printf("%d", p->economic.gold);
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        case LABEL_TAX:
-          if (embassy_knowledge) {
-            buf = g_strdup_printf("%d%%", p->economic.tax);
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        case LABEL_SCIENCE:
-          if (embassy_knowledge) {
-            buf = g_strdup_printf("%d%%", p->economic.science);
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        case LABEL_LUXURY:
-          if (embassy_knowledge) {
-            buf = g_strdup_printf("%d%%", p->economic.luxury);
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        case LABEL_RESEARCHING:
-          {
-            struct research *research = research_get(p);
-
-            switch (research->researching) {
-            case A_UNKNOWN:
-              /* TRANS: "Unknown" advance/technology */
-              buf = g_strdup(_("(Unknown)"));
-              break;
-            case A_UNSET:
-              if (embassy_knowledge) {
-                /* TRANS: Missing value */
-                buf = g_strdup(_("(none)"));
-              } else {
-                buf = g_strdup(_("(Unknown)"));
-              }
-              break;
-            default:
-              buf = g_strdup_printf("%s(%d/%d)",
-                                    research_advance_name_translation
-                                        (research, research->researching),
-                                    research->bulbs_researched,
-                                    research->client.researching_cost);
-              break;
-            }
-            break;
-          }
-        case LABEL_CULTURE:
-          if (embassy_knowledge) {
-            buf = g_strdup_printf("%d", p->client.culture);
-          } else {
-            buf = g_strdup(_("(Unknown)"));
-          }
-          break;
-        }
-
-        if (buf) {
-          gtk_label_set_text(GTK_LABEL(pdialog->table_labels[i]), buf);
-          g_free(buf);
-        }
-      }
-    }
-  }
-
-  /* Update also wonders list dialog */
-  update_intel_wonder_dialog(p);
-}
-
-/**********************************************************************//**
-  Update the wonders list dialog for the given player.
-**************************************************************************/
-void update_intel_wonder_dialog(struct player *p)
-{
-  struct intel_wonder_dialog *pdialog = get_intel_wonder_dialog(p);
-
-  if (pdialog != NULL) {
-    gchar *title = g_strdup_printf(_("Wonders of %s Empire"),
-                                   nation_adjective_for_player(p));
-    const char *rule = NULL;
-
-    gtk_window_set_title(GTK_WINDOW(pdialog->shell), title);
-    g_free(title);
-
-    switch (game.info.small_wonder_visibility) {
-    case WV_ALWAYS:
-      rule = _("All Wonders are known");
-      break;
-    case WV_NEVER:
-      rule = _("Small Wonders not known");
-      break;
-    case WV_EMBASSY:
-      rule = _("Small Wonders visible if we have an embassy");
-      break;
-    }
-
-    gtk_label_set_text(GTK_LABEL(pdialog->rule), rule);
-
-    g_list_store_remove_all(pdialog->wonders);
-
-    improvement_iterate(impr) {
-      if (is_wonder(impr)) {
-        const char *cityname;
-        bool is_lost = FALSE;
-        FcWonderRow *row = fc_wonder_row_new();
-
-        if (wonder_is_built(p, impr)) {
-          struct city *pcity = city_from_wonder(p, impr);
-
-          if (pcity) {
-            cityname = city_name_get(pcity);
-          } else {
-            cityname = _("(unknown city)");
-          }
-          if (improvement_obsolete(p, impr, NULL)) {
-            is_lost = TRUE;
-          }
-        } else if (wonder_is_lost(p, impr)) {
-          cityname = _("(lost)");
-          is_lost = TRUE;
-        } else {
-          continue;
-        }
-
-        row->name = improvement_name_translation(impr);
-        row->cityname = cityname;
-        row->is_lost = is_lost;
-        row->font_weight = is_great_wonder(impr) ? 700 : 400;
-
-        g_list_store_append(pdialog->wonders, row);
-        g_object_unref(row);
-      }
-    } improvement_iterate_end;
-  }
-}
diff --git a/client/gui-gtk-5.0/inteldlg.h b/client/gui-gtk-5.0/inteldlg.h
deleted file mode 100644
index 1100d63ab0..0000000000
--- a/client/gui-gtk-5.0/inteldlg.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2003 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__INTELDLG_H
-#define FC__INTELDLG_H
-
-/* client */
-#include "inteldlg_g.h"
-
-void intel_dialog_init(void);
-void intel_dialog_done(void);
-
-void popup_intel_wonder_dialog(struct player *p);
-void update_intel_wonder_dialog(struct player *p);
-void close_intel_wonder_dialog(struct player *p);
-
-#endif /* FC__INTELDLG_H */
diff --git a/client/gui-gtk-5.0/luaconsole.c b/client/gui-gtk-5.0/luaconsole.c
deleted file mode 100644
index 8ae3974bb8..0000000000
--- a/client/gui-gtk-5.0/luaconsole.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-
-/* common */
-#include "featured_text.h"
-#include "game.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-/* client/luascript */
-#include "script_client.h"
-
-#include "luaconsole.h"
-
-enum luaconsole_res {
-  LUACONSOLE_RES_OPEN
-};
-
-#define MAX_LUACONSOLE_HISTORY 20
-
-struct luaconsole_data {
-  struct gui_dialog *shell;
-  GtkTextBuffer *message_buffer;
-  GtkTextView *message_area;
-  GtkWidget *entry;
-
-  struct genlist *history_list;
-  int history_pos;
-};
-
-static struct luaconsole_data *luaconsole = NULL;
-
-
-static struct luaconsole_data *luaconsole_dialog_get(void);
-static void luaconsole_dialog_create(struct luaconsole_data *pdialog);
-static void luaconsole_dialog_refresh(struct luaconsole_data *pdialog);
-static void luaconsole_dialog_destroy(struct luaconsole_data *pdialog);
-
-static void luaconsole_dialog_area_resize(GtkWidget *widget, int width, int height,
-                                          gpointer data);
-static void luaconsole_dialog_scroll_to_bottom(void);
-
-static void luaconsole_input_return(GtkEntry *w, gpointer data);
-static gboolean luaconsole_input_handler(GtkWidget *w, GdkEvent *ev);
-
-static void luaconsole_response_callback(struct gui_dialog *pgui_dialog,
-                                         int response, gpointer data);
-static void luaconsole_load_file_popup(void);
-static void luaconsole_load_file_callback(GtkWidget *widget, gint response,
-                                          gpointer data);
-
-/*************************************************************************//**
-  Create a lua console.
-*****************************************************************************/
-void luaconsole_dialog_init(void)
-{
-  fc_assert_ret(luaconsole == NULL);
-
-  /* Create a container for the dialog. */
-  luaconsole = fc_calloc(1, sizeof(*luaconsole));
-  luaconsole->message_buffer = gtk_text_buffer_new(NULL);
-  luaconsole->shell = NULL;
-
-  luaconsole->history_list = genlist_new();
-  luaconsole->history_pos = -1;
-
-  luaconsole_welcome_message();
-}
-
-/*************************************************************************//**
-  Free a script lua console.
-*****************************************************************************/
-void luaconsole_dialog_done(void)
-{
-  if (luaconsole != NULL) {
-    if (luaconsole->history_list) {
-        genlist_destroy(luaconsole->history_list);
-    }
-
-    luaconsole_dialog_popdown();
-    free(luaconsole);
-
-    luaconsole = NULL;
-  }
-}
-
-/*************************************************************************//**
-  Get the data for the lua console.
-*****************************************************************************/
-static struct luaconsole_data *luaconsole_dialog_get(void)
-{
-  return luaconsole;
-}
-
-/*************************************************************************//**
-  Popup the lua console inside the main-window, and optionally raise it.
-*****************************************************************************/
-void luaconsole_dialog_popup(bool raise)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret(pdialog);
-  if (pdialog->shell == NULL) {
-    luaconsole_dialog_create(pdialog);
-  }
-
-  gui_dialog_present(pdialog->shell);
-  if (raise) {
-    gui_dialog_raise(pdialog->shell);
-  }
-}
-
-/*************************************************************************//**
-  Closes the lua console; the content is saved till the client is done.
-*****************************************************************************/
-void luaconsole_dialog_popdown(void)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret(pdialog);
-  if (pdialog->shell == NULL) {
-    luaconsole_dialog_destroy(pdialog);
-  }
-}
-
-/*************************************************************************//**
-  Return TRUE iff the lua console is open.
-*****************************************************************************/
-bool luaconsole_dialog_is_open(void)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret_val(pdialog, FALSE);
-
-  return (NULL != pdialog->shell);
-}
-
-/*************************************************************************//**
-  Update the lua console.
-*****************************************************************************/
-void real_luaconsole_dialog_update(void)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret(pdialog);
-
-  if (NULL != pdialog->shell) {
-    luaconsole_dialog_refresh(pdialog);
-  }
-}
-
-/*************************************************************************//**
-  Initialize a lua console.
-*****************************************************************************/
-static void luaconsole_dialog_create(struct luaconsole_data *pdialog)
-{
-  GtkWidget *entry, *vgrid, *sw, *text, *notebook;
-  int grid_row = 0;
-
-  fc_assert_ret(NULL != pdialog);
-
-  if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_SPLIT) {
-    notebook = right_notebook;
-  } else {
-    notebook = bottom_notebook;
-  }
-
-  gui_dialog_new(&pdialog->shell, GTK_NOTEBOOK(notebook), pdialog, TRUE);
-  gui_dialog_set_title(pdialog->shell, _("Client Lua Console"));
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gui_dialog_add_content_widget(pdialog->shell, vgrid);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gtk_grid_attach(GTK_GRID(vgrid), sw, 0, grid_row++, 1, 1);
-
-  text = gtk_text_view_new_with_buffer(pdialog->message_buffer);
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  set_message_buffer_view_link_handlers(text);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), text);
-  g_signal_connect(text, "resize",
-                   G_CALLBACK(luaconsole_dialog_area_resize), NULL);
-
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_widget_realize(text);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
-
-  pdialog->message_area = GTK_TEXT_VIEW(text);
-  g_signal_connect(text, "destroy", G_CALLBACK(widget_destroyed),
-                   &pdialog->message_area);
-
-  /* The lua console input line. */
-  entry = gtk_entry_new();
-  gtk_widget_set_margin_bottom(entry, 2);
-  gtk_widget_set_margin_end(entry, 2);
-  gtk_widget_set_margin_start(entry, 2);
-  gtk_widget_set_margin_top(entry, 2);
-  gtk_grid_attach(GTK_GRID(vgrid), entry, 0, grid_row++, 1, 1);
-  g_signal_connect(entry, "activate", G_CALLBACK(luaconsole_input_return),
-                   NULL);
-  g_signal_connect(entry, "key_press_event",
-                   G_CALLBACK(luaconsole_input_handler), NULL);
-  pdialog->entry = entry;
-  g_signal_connect(entry, "destroy", G_CALLBACK(widget_destroyed),
-                   &pdialog->entry);
-
-  /* Load lua script command button. */
-  gui_dialog_add_button(pdialog->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  gui_dialog_add_button(pdialog->shell, "document-open",
-                        _("Load Lua Script"), LUACONSOLE_RES_OPEN);
-  gui_dialog_response_set_callback(pdialog->shell,
-                                   luaconsole_response_callback);
-
-  luaconsole_dialog_refresh(pdialog);
-  gui_dialog_show_all(pdialog->shell);
-}
-
-/*************************************************************************//**
-  Called when the return key is pressed.
-*****************************************************************************/
-static void luaconsole_input_return(GtkEntry *w, gpointer data)
-{
-  const char *theinput;
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-  GtkEntryBuffer *buffer;
-
-  fc_assert_ret(pdialog);
-  fc_assert_ret(pdialog->history_list);
-
-  buffer = gtk_entry_get_buffer(w);
-  theinput = gtk_entry_buffer_get_text(buffer);
-
-  if (*theinput) {
-    luaconsole_printf(ftc_luaconsole_input, "(input)> %s", theinput);
-    script_client_do_string(theinput);
-
-    if (genlist_size(pdialog->history_list) >= MAX_LUACONSOLE_HISTORY) {
-      void *history_data;
-
-      history_data = genlist_get(pdialog->history_list, -1);
-      genlist_remove(pdialog->history_list, history_data);
-      free(history_data);
-    }
-
-    genlist_prepend(pdialog->history_list, fc_strdup(theinput));
-    pdialog->history_pos = -1;
-  }
-
-  gtk_entry_buffer_set_text(buffer, "", -1);
-}
-
-/*************************************************************************//**
-  Dialog response callback.
-*****************************************************************************/
-static void luaconsole_response_callback(struct gui_dialog *pgui_dialog,
-                                         int response, gpointer data)
-{
-  switch (response) {
-  case LUACONSOLE_RES_OPEN:
-    break;
-  default:
-    gui_dialog_destroy(pgui_dialog);
-    return;
-  }
-
-  switch (response) {
-  case LUACONSOLE_RES_OPEN:
-    luaconsole_load_file_popup();
-    break;
-  }
-}
-
-/*************************************************************************//**
-  Create a file selector for loading a lua file..
-*****************************************************************************/
-static void luaconsole_load_file_popup(void)
-{
-  GtkWidget *filesel;
-
-  /* Create the selector */
-  filesel = gtk_file_chooser_dialog_new("Load Lua file", GTK_WINDOW(toplevel),
-                                        GTK_FILE_CHOOSER_ACTION_OPEN,
-                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                        _("_Open"), GTK_RESPONSE_OK,
-                                        NULL);
-  setup_dialog(filesel, toplevel);
-
-  g_signal_connect(filesel, "response",
-                   G_CALLBACK(luaconsole_load_file_callback), NULL);
-
-  /* Display that dialog */
-  gtk_window_present(GTK_WINDOW(filesel));
-}
-
-/*************************************************************************//**
-  Callback for luaconsole_load_file_popup().
-*****************************************************************************/
-static void luaconsole_load_file_callback(GtkWidget *dlg, gint response,
-                                          gpointer data)
-{
-  if (response == GTK_RESPONSE_OK) {
-    GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(dlg));
-
-    if (file != NULL) {
-      gchar *filename = g_file_get_parse_name(file);
-
-      if (NULL != filename) {
-        luaconsole_printf(ftc_luaconsole_input, "(file)> %s", filename);
-        script_client_do_file(filename);
-        g_free(filename);
-      }
-
-      g_object_unref(file);
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/*************************************************************************//**
-  Called when a key is pressed.
-*****************************************************************************/
-static gboolean luaconsole_input_handler(GtkWidget *w, GdkEvent *ev)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-  guint keyval;
-  GtkEntryBuffer *buffer = gtk_entry_get_buffer(GTK_ENTRY(w));
-
-  fc_assert_ret_val(pdialog, FALSE);
-  fc_assert_ret_val(pdialog->history_list, FALSE);
-
-  keyval = gdk_key_event_get_keyval(ev);
-  switch (keyval) {
-  case GDK_KEY_Up:
-    if (pdialog->history_pos < genlist_size(pdialog->history_list) - 1) {
-      gtk_entry_buffer_set_text(buffer, genlist_get(pdialog->history_list,
-                                                    ++pdialog->history_pos), -1);
-      gtk_editable_set_position(GTK_EDITABLE(w), -1);
-    }
-    return TRUE;
-
-  case GDK_KEY_Down:
-    if (pdialog->history_pos >= 0) {
-      pdialog->history_pos--;
-    }
-
-    if (pdialog->history_pos >= 0) {
-      gtk_entry_buffer_set_text(buffer, genlist_get(pdialog->history_list,
-                                                    pdialog->history_pos), -1);
-    } else {
-      gtk_entry_buffer_set_text(buffer, "", -1);
-    }
-    gtk_editable_set_position(GTK_EDITABLE(w), -1);
-    return TRUE;
-
-  default:
-    break;
-  }
-
-  return FALSE;
-}
-
-/*************************************************************************//**
-  When the luaconsole text view is resized, scroll it to the bottom. This
-  prevents users from accidentally missing messages when the chatline
-  gets scrolled up a small amount and stops scrolling down automatically.
-*****************************************************************************/
-static void luaconsole_dialog_area_resize(GtkWidget *widget, int width, int height,
-                                          gpointer data)
-{
-  static int old_width = 0, old_height = 0;
-
-  if (width != old_width
-      || height != old_height) {
-    luaconsole_dialog_scroll_to_bottom();
-    old_width = width;
-    old_height = height;
-  }
-}
-
-/*************************************************************************//**
-  Scrolls the luaconsole all the way to the bottom.
-  If delayed is TRUE, it will be done in a idle_callback.
-
-  Modified copy of chatline_scroll_to_bottom().
-*****************************************************************************/
-static void luaconsole_dialog_scroll_to_bottom(void)
-{
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret(pdialog);
-
-  if (pdialog->shell) {
-    GtkTextIter end;
-
-    fc_assert_ret(NULL != pdialog->message_buffer);
-    fc_assert_ret(NULL != pdialog->message_area);
-
-    gtk_text_buffer_get_end_iter(pdialog->message_buffer, &end);
-    gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(pdialog->message_area),
-                                 &end, 0.0, TRUE, 1.0, 0.0);
-  }
-}
-
-/*************************************************************************//**
-  Refresh a lua console.
-*****************************************************************************/
-static void luaconsole_dialog_refresh(struct luaconsole_data *pdialog)
-{
-  fc_assert_ret(NULL != pdialog);
-}
-
-/*************************************************************************//**
-  Closes a lua console.
-*****************************************************************************/
-static void luaconsole_dialog_destroy(struct luaconsole_data *pdialog)
-{
-  fc_assert_ret(NULL != pdialog);
-
-  if (pdialog->shell) {
-    gui_dialog_destroy(pdialog->shell);
-    fc_assert(NULL == pdialog->shell);
-  }
-  fc_assert(NULL == pdialog->message_area);
-  fc_assert(NULL == pdialog->entry);
-}
-
-/*************************************************************************//**
-  Appends the string to the chat output window.  The string should be
-  inserted on its own line, although it will have no newline.
-*****************************************************************************/
-void real_luaconsole_append(const char *astring,
-                            const struct text_tag_list *tags)
-{
-  GtkTextBuffer *buf;
-  GtkTextIter iter;
-  GtkTextMark *mark;
-  ft_offset_t text_start_offset;
-  struct luaconsole_data *pdialog = luaconsole_dialog_get();
-
-  fc_assert_ret(pdialog);
-
-  buf = pdialog->message_buffer;
-  gtk_text_buffer_get_end_iter(buf, &iter);
-  gtk_text_buffer_insert(buf, &iter, "\n", -1);
-  mark = gtk_text_buffer_create_mark(buf, NULL, &iter, TRUE);
-
-  if (GUI_GTK_OPTION(show_chat_message_time)) {
-    char timebuf[64];
-    time_t now;
-    struct tm now_tm;
-
-    now = time(NULL);
-    fc_localtime(&now, &now_tm);
-    strftime(timebuf, sizeof(timebuf), "[%H:%M:%S] ", &now_tm);
-    gtk_text_buffer_insert(buf, &iter, timebuf, -1);
-  }
-
-  text_start_offset = gtk_text_iter_get_offset(&iter);
-  gtk_text_buffer_insert(buf, &iter, astring, -1);
-  text_tag_list_iterate(tags, ptag) {
-    apply_text_tag(ptag, buf, text_start_offset, astring);
-  } text_tag_list_iterate_end;
-
-  if (pdialog->message_area) {
-    scroll_if_necessary(GTK_TEXT_VIEW(pdialog->message_area), mark);
-  }
-  gtk_text_buffer_delete_mark(buf, mark);
-}
diff --git a/client/gui-gtk-5.0/luaconsole.h b/client/gui-gtk-5.0/luaconsole.h
deleted file mode 100644
index 774cdc5ad9..0000000000
--- a/client/gui-gtk-5.0/luaconsole.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-#ifndef FC__LUACONSOLE_H
-#define FC__LUACONSOLE_H
-
-/* client */
-#include "luaconsole_g.h"
-
-void luaconsole_dialog_init(void);
-void luaconsole_dialog_done(void);
-
-void luaconsole_dialog_popdown(void);
-
-#endif  /* FC__LUACONSOLE_H */
diff --git a/client/gui-gtk-5.0/mapctrl.c b/client/gui-gtk-5.0/mapctrl.c
deleted file mode 100644
index 4f19940214..0000000000
--- a/client/gui-gtk-5.0/mapctrl.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "support.h"
-
-/* common */
-#include "combat.h"
-#include "game.h"
-#include "map.h"
-#include "player.h"
-#include "unit.h"
-
-#include "overview_common.h"
-
-/* client */
-#include "client_main.h"
-#include "climap.h"
-#include "climisc.h"
-#include "control.h"
-#include "editor.h"
-#include "tilespec.h"
-#include "text.h"
-#include "zoom.h"
-
-/* client/agents */
-#include "cma_core.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "citydlg.h"
-#include "colors.h"
-#include "dialogs.h"
-#include "editgui.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "infradlg.h"
-#include "inputdlg.h"
-#include "mapview.h"
-#include "menu.h"
-#include "rallypointdlg.h"
-
-#include "mapctrl.h"
-
-extern gint cur_x, cur_y;
-
-/**********************************************************************//**
-  Popup a label with information about the tile, unit, city, when the user
-  used the middle mouse button on the map.
-**************************************************************************/
-static void popit(struct tile *ptile)
-{
-  if (TILE_UNKNOWN != client_tile_get_known(ptile)) {
-    GtkWidget *p;
-    struct unit *punit;
-    GdkRectangle rect;
-    GtkAllocation alloc;
-    float canvas_x, canvas_y;
-
-    tile_to_canvas_pos(&canvas_x, &canvas_y, map_zoom, ptile);
-    gtk_widget_get_allocation(map_canvas, &alloc);
-    rect.x = (canvas_x * mouse_zoom / map_zoom) - alloc.x;
-    rect.y = (canvas_y * mouse_zoom / map_zoom) - alloc.y;
-    rect.width = tileset_full_tile_width(tileset);
-    rect.height = tileset_tile_height(tileset);
-
-    p = gtk_popover_new();
-
-    gtk_widget_set_parent(p, map_canvas);
-    gtk_popover_set_pointing_to(GTK_POPOVER(p), &rect);
-    gtk_popover_set_child(GTK_POPOVER(p), gtk_label_new(popup_info_text(ptile)));
-
-    punit = find_visible_unit(ptile);
-
-    if (punit) {
-      mapdeco_set_gotoroute(punit);
-      if (punit->goto_tile) {
-        mapdeco_set_crosshair(punit->goto_tile, TRUE);
-      }
-    }
-    mapdeco_set_crosshair(ptile, TRUE);
-
-    g_signal_connect(p, "closed",
-                     G_CALLBACK(popupinfo_popdown_callback), NULL);
-
-    gtk_popover_popup(GTK_POPOVER(p));
-  }
-}
-
-/**********************************************************************//**
-  Information label destruction requested
-**************************************************************************/
-void popupinfo_popdown_callback(GtkWidget *w, gpointer data)
-{
-  mapdeco_clear_crosshairs();
-  mapdeco_clear_gotoroutes();
-}
-
-/**********************************************************************//**
-  Callback from city name dialog for new city.
-**************************************************************************/
-static void name_new_city_popup_callback(gpointer data, gint response,
-                                         const char *input)
-{
-  int idx = GPOINTER_TO_INT(data);
-
-  switch (response) {
-  case GTK_RESPONSE_OK:
-    finish_city(index_to_tile(&(wld.map), idx), input);
-    break;
-  case GTK_RESPONSE_CANCEL:
-  case GTK_RESPONSE_DELETE_EVENT:
-    cancel_city(index_to_tile(&(wld.map), idx));
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Popup dialog where the user choose the name of the new city
-  punit = (settler) unit which builds the city
-  suggestname = suggestion of the new city's name
-**************************************************************************/
-void popup_newcity_dialog(struct unit *punit, const char *suggestname)
-{
-  input_dialog_create(GTK_WINDOW(toplevel), /*"shellnewcityname" */
-                      _("Build New City"),
-                      _("What should we call our new city?"), suggestname,
-                      name_new_city_popup_callback,
-                      GINT_TO_POINTER(tile_index(unit_tile(punit))));
-}
-
-/**********************************************************************//**
-  Enable or disable the turn done button.
-  Should probably some where else.
-**************************************************************************/
-void set_turn_done_button_state(bool state)
-{
-  gtk_widget_set_sensitive(turn_done_button, state);
-
-  update_turn_done_tooltip();
-}
-
-/**********************************************************************//**
-  Handle 'Left mouse button released'. Because of the quickselect feature,
-  the release of both left and right mousebutton can launch the goto.
-**************************************************************************/
-gboolean left_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                double x, double y, gpointer data)
-{
-  if (editor_is_active()) {
-    return handle_edit_mouse_button_release(gesture, MOUSE_BUTTON_LEFT,
-                                            x, y);
-  }
-
-  release_goto_button(x, y);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Handle 'Right mouse button released'. Because of the quickselect feature,
-  the release of both left and right mousebutton can launch the goto.
-**************************************************************************/
-gboolean right_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                 double x, double y, gpointer data)
-{
-  if (editor_is_active()) {
-    return handle_edit_mouse_button_release(gesture, MOUSE_BUTTON_RIGHT,
-                                            x, y);
-  }
-
-  release_goto_button(x, y);
-
-  if (rbutton_down || hover_state != HOVER_NONE)  {
-    GdkModifierType state;
-
-    state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
-    release_right_button(x, y,
-                         (state & GDK_SHIFT_MASK) != 0);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Handle all left mouse button presses on canvas.
-  Future feature: User-configurable mouse clicks.
-**************************************************************************/
-gboolean left_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                  double x, double y, gpointer data)
-{
-  struct tile *ptile = NULL;
-  GdkModifierType state;
-
-  if (editor_is_active()) {
-    return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_LEFT,
-                                          x, y);
-  }
-
-  if (!can_client_change_view()) {
-    return TRUE;
-  }
-
-  gtk_widget_grab_focus(map_canvas);
-  ptile = canvas_pos_to_tile(x, y, mouse_zoom);
-
-  state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
-
-  /* <SHIFT> + <CONTROL> + LMB : Adjust workers. */
-  if ((state & GDK_SHIFT_MASK) && (state & GDK_CONTROL_MASK)) {
-    adjust_workers_button_pressed(x, y);
-  } else if (state & GDK_CONTROL_MASK) {
-    /* <CONTROL> + LMB : Quickselect a sea unit. */
-    action_button_pressed(x, y, SELECT_SEA);
-  } else if (ptile && (state & GDK_SHIFT_MASK)) {
-    /* <SHIFT> + LMB: Append focus unit. */
-    action_button_pressed(x, y, SELECT_APPEND);
-  } else if (ptile && (state & GDK_ALT_MASK)) {
-    /* <ALT> + LMB: popit (same as middle-click) */
-    /* FIXME: we need a general mechanism for letting freeciv work with
-     * 1- or 2-button mice. */
-    popit(ptile);
-  } else if (tiles_hilited_cities) {
-    /* LMB in Area Selection mode. */
-    if (ptile) {
-      toggle_tile_hilite(ptile);
-    }
-  } else if (rally_set_tile(ptile)) {
-    /* Nothing here, rally_set_tile() already did what we wanted */
-  } else if (infra_placement_mode()) {
-    infra_placement_set_tile(ptile);
-  } else {
-    /* Plain LMB click. */
-    action_button_pressed(x, y, SELECT_POPUP);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Handle all right mouse button presses on canvas.
-  Future feature: User-configurable mouse clicks.
-**************************************************************************/
-gboolean right_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                   double x, double y, gpointer data)
-{
-  struct city *pcity = NULL;
-  struct tile *ptile = NULL;
-  GdkModifierType state;
-
-  if (editor_is_active()) {
-    return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_RIGHT,
-                                          x, y);
-  }
-
-  if (!can_client_change_view()) {
-    return TRUE;
-  }
-
-  gtk_widget_grab_focus(map_canvas);
-  ptile = canvas_pos_to_tile(x, y, mouse_zoom);
-  pcity = ptile ? tile_city(ptile) : NULL;
-
-  state = gtk_event_controller_get_current_event_state(
-                                    GTK_EVENT_CONTROLLER(gesture));
-
-  /* <CONTROL> + <ALT> + RMB : insert city or tile chat link. */
-  /* <CONTROL> + <ALT> + <SHIFT> + RMB : insert unit chat link. */
-  if (ptile && (state & GDK_ALT_MASK)
-      && (state & GDK_CONTROL_MASK)) {
-    inputline_make_chat_link(ptile, (state & GDK_SHIFT_MASK) != 0);
-  } else if ((state & GDK_SHIFT_MASK) && (state & GDK_ALT_MASK)) {
-    /* <SHIFT> + <ALT> + RMB : Show/hide workers. */
-    key_city_overlay(x, y);
-  } else if ((state & GDK_SHIFT_MASK) && (state & GDK_CONTROL_MASK)
-             && pcity != NULL) {
-    /* <SHIFT + CONTROL> + RMB: Paste Production. */
-    clipboard_paste_production(pcity);
-    cancel_tile_hiliting();
-  } else if (state & GDK_SHIFT_MASK
-             && clipboard_copy_production(ptile)) {
-    /* <SHIFT> + RMB on city/unit: Copy Production. */
-    /* If nothing to copy, fall through to rectangle selection. */
-
-    /* Already done the copy */
-  } else if (state & GDK_CONTROL_MASK) {
-    /* <CONTROL> + RMB : Quickselect a land unit. */
-    action_button_pressed(x, y, SELECT_LAND);
-  } else {
-    /* Plain RMB click. Area selection. */
-    /*  A foolproof user will depress button on canvas,
-     *  release it on another widget, and return to canvas
-     *  to find rectangle still active.
-     */
-    if (rectangle_active) {
-      release_right_button(x, y,
-                           (state & GDK_SHIFT_MASK) != 0);
-      return TRUE;
-    }
-    if (hover_state == HOVER_NONE) {
-      anchor_selection_rectangle(x, y);
-      rbutton_down = TRUE; /* Causes rectangle updates */
-    }
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Handle all middle mouse button presses on canvas.
-  Future feature: User-configurable mouse clicks.
-**************************************************************************/
-gboolean middle_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                    double x, double y, gpointer data)
-{
-  struct tile *ptile = NULL;
-  GdkModifierType state;
-
-  if (editor_is_active()) {
-    return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_MIDDLE,
-                                          x, y);
-  }
-
-  if (!can_client_change_view()) {
-    return TRUE;
-  }
-
-  gtk_widget_grab_focus(map_canvas);
-  ptile = canvas_pos_to_tile(x, y, mouse_zoom);
-
-  state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
-
-  /* <CONTROL> + MMB: Wake up sentries. */
-  if (state & GDK_CONTROL_MASK) {
-    wakeup_button_pressed(x, y);
-  } else if (ptile) {
-    /* Plain Middle click. */
-    popit(ptile);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Update goto line so that destination is at current mouse pointer location.
-**************************************************************************/
-void create_line_at_mouse_pos(void)
-{
-  double x, y;
-  GdkSeat *seat = gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
-  GdkDevice *pointer = gdk_seat_get_pointer(seat);
-  GdkSurface *window;
-
-  if (!pointer) {
-    return;
-  }
-
-  window = gdk_device_get_surface_at_position(pointer, &x, &y);
-  if (window) {
-    if (window == gtk_native_get_surface(gtk_widget_get_native(map_canvas))) {
-      update_line(x, y);
-    } else if (window == gtk_native_get_surface(gtk_widget_get_native(overview_canvas))) {
-      overview_update_line(x, y);
-    }
-  }
-}
-
-/**********************************************************************//**
-  The Area Selection rectangle. Called by center_tile_mapcanvas() and
-  when the mouse pointer moves.
-**************************************************************************/
-void update_rect_at_mouse_pos(void)
-{
-  double x, y;
-  GdkSurface *window;
-  GdkDevice *pointer;
-  GdkDevice *keyboard;
-  GdkModifierType mask;
-  GdkSeat *seat = gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
-
-  pointer = gdk_seat_get_pointer(seat);
-  if (!pointer) {
-    return;
-  }
-
-  window = gdk_device_get_surface_at_position(pointer, &x, &y);
-  if (window
-      && window == gtk_native_get_surface(gtk_widget_get_native(map_canvas))) {
-    keyboard = gdk_seat_get_keyboard(seat);
-    mask = gdk_device_get_modifier_state(keyboard);
-    if (mask & GDK_BUTTON3_MASK) {
-      update_selection_rectangle(x, y);
-    }
-  }
-}
-
-/**********************************************************************//**
-  Triggered by the mouse moving on the mapcanvas, this function will
-  update the mouse cursor and goto lines.
-**************************************************************************/
-gboolean move_mapcanvas(GtkEventControllerMotion *controller,
-                        gdouble x, gdouble y, gpointer data)
-{
-  GdkModifierType state;
-
-  if (GUI_GTK_OPTION(mouse_over_map_focus)
-      && !gtk_widget_has_focus(map_canvas)) {
-    gtk_widget_grab_focus(map_canvas);
-  }
-
-  if (editor_is_active()) {
-    return handle_edit_mouse_move(controller, x, y);
-  }
-
-  cur_x = x;
-  cur_y = y;
-  update_line(x, y);
-  state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(controller));
-  if (rbutton_down && (state & GDK_BUTTON3_MASK)) {
-    update_selection_rectangle(x, y);
-  }
-
-  if (keyboardless_goto_button_down && hover_state == HOVER_NONE) {
-    maybe_activate_keyboardless_goto(x, y);
-  }
-  control_mouse_cursor(canvas_pos_to_tile(x, y, mouse_zoom));
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  This function will reset the mouse cursor if it leaves the map.
-**************************************************************************/
-gboolean leave_mapcanvas(GtkEventControllerMotion *controller,
-                         gpointer data)
-{
-  update_mouse_cursor(CURSOR_DEFAULT);
-  update_unit_info_label(get_units_in_focus());
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Overview canvas moved
-**************************************************************************/
-gboolean move_overviewcanvas(GtkEventControllerMotion *controller,
-                             gdouble x, gdouble y, gpointer data)
-{
-  overview_update_line(x, y);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Left button pressed at overview
-**************************************************************************/
-gboolean left_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
-                                       double x, double y, gpointer data)
-{
-  int xtile, ytile;
-
-  if (n_press != 1) {
-    return TRUE; /* Double-clicks? Triple-clicks? No thanks! */
-  }
-
-  overview_to_map_pos(&xtile, &ytile, x, y);
-
-  if (can_client_issue_orders()) {
-    GdkModifierType state;
-
-    state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
-    do_map_click(map_pos_to_tile(&(wld.map), xtile, ytile),
-                 (state & GDK_SHIFT_MASK) ? SELECT_APPEND : SELECT_POPUP);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Right button pressed at overview
-**************************************************************************/
-gboolean right_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
-                                        double x, double y, gpointer data)
-{
-  int xtile, ytile;
-
-  if (n_press != 1) {
-    return TRUE; /* Double-clicks? Triple-clicks? No thanks! */
-  }
-
-  overview_to_map_pos(&xtile, &ytile, x, y);
-
-  if (can_client_change_view()) {
-    center_tile_mapcanvas(map_pos_to_tile(&(wld.map), xtile, ytile));
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Best effort to center the map on the currently selected unit(s)
-**************************************************************************/
-void center_on_unit(void)
-{
-  request_center_focus_unit();
-}
diff --git a/client/gui-gtk-5.0/mapctrl.h b/client/gui-gtk-5.0/mapctrl.h
deleted file mode 100644
index 2c94085107..0000000000
--- a/client/gui-gtk-5.0/mapctrl.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__MAPCTRL_H
-#define FC__MAPCTRL_H
-
-#include <gtk/gtk.h>
-
-/* common */
-#include "fc_types.h"
-
-/* client */
-#include "mapctrl_g.h"
-
-gboolean left_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                double x, double y, gpointer data);
-gboolean right_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                 double x, double y, gpointer data);
-gboolean left_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                  double x, double y, gpointer data);
-gboolean right_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                   double x, double y, gpointer data);
-gboolean middle_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
-                                    double x, double y, gpointer data);
-gboolean left_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
-                                       double x, double y, gpointer data);
-gboolean right_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
-                                        double x, double y, gpointer data);
-gboolean move_mapcanvas(GtkEventControllerMotion *controller,
-                        gdouble x, gdouble y, gpointer data);
-gboolean leave_mapcanvas(GtkEventControllerMotion *controller,
-                         gpointer data);
-gboolean move_overviewcanvas(GtkEventControllerMotion *controller,
-                             gdouble x, gdouble y, gpointer data);
-
-void center_on_unit(void);
-
-void popupinfo_popdown_callback(GtkWidget *w, gpointer data);
-
-#endif  /* FC__MAPCTRL_H */
diff --git a/client/gui-gtk-5.0/mapview.c b/client/gui-gtk-5.0/mapview.c
deleted file mode 100644
index 421af01ad7..0000000000
--- a/client/gui-gtk-5.0/mapview.c
+++ /dev/null
@@ -1,800 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "rand.h"
-#include "support.h"
-#include "timing.h"
-
-/* common */
-#include "game.h"
-#include "government.h"         /* government_graphic() */
-#include "map.h"
-#include "nation.h"
-#include "player.h"
-
-/* client */
-#include "client_main.h"
-#include "climap.h"
-#include "climisc.h"
-#include "colors.h"
-#include "control.h" /* get_unit_in_focus() */
-#include "editor.h"
-#include "options.h"
-#include "overview_common.h"
-#include "tilespec.h"
-#include "text.h"
-#include "zoom.h"
-
-/* client/gui-gtk-5.0 */
-#include "citydlg.h" /* For reset_city_dialogs() */
-#include "editgui.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapctrl.h"
-#include "repodlgs.h"
-#include "wldlg.h"
-
-#include "mapview.h"
-
-static GtkAdjustment *map_hadj, *map_vadj;
-static int cursor_timer_id = 0, cursor_type = -1, cursor_frame = 0;
-static int mapview_frozen_level = 0;
-
-static int mc_actual_width = -1;
-static int mc_actual_height = -1;
-
-/**********************************************************************//**
-  If do_restore is FALSE it will invert the turn done button style. If
-  called regularly from a timer this will give a blinking turn done
-  button. If do_restore is TRUE this will reset the turn done button
-  to the default style.
-**************************************************************************/
-void update_turn_done_button(bool do_restore)
-{
-  static bool flip = FALSE;
-
-  if (!get_turn_done_button_state()) {
-    return;
-  }
-
-  if ((do_restore && flip) || !do_restore) {
-    static GtkCssProvider *tdb_provider = NULL;
-
-    if (tdb_provider == NULL) {
-      tdb_provider = gtk_css_provider_new();
-
-      gtk_css_provider_load_from_data(tdb_provider,
-                                      ".td_lighted {\n"
-                                      "color: rgba(235, 127, 235, 255);\n"
-                                      "background-color: rgba(127, 127, 127, 255);\n"
-                                      "}\n",
-                                      -1);
-
-      /* Turn Done button is persistent, so we only need to do this
-       * once too. */
-      gtk_style_context_add_provider_for_display(
-                                     gtk_widget_get_display(toplevel),
-                                     GTK_STYLE_PROVIDER(tdb_provider),
-                                     GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-    }
-
-    if (flip) {
-      gtk_widget_add_css_class(turn_done_button, "td_lighted");
-    } else {
-      gtk_widget_remove_css_class(turn_done_button, "td_lighted");
-    }
-
-    flip = !flip;
-  }
-}
-
-/**********************************************************************//**
-  Timeout label requires refreshing
-**************************************************************************/
-void update_timeout_label(void)
-{
-  gtk_label_set_text(GTK_LABEL(timeout_label), get_timeout_label_text());
-
-  if (current_turn_timeout() > 0) {
-    gtk_widget_set_tooltip_text(timeout_label,
-                                _("Time to forced turn change,\n"
-                                  "or estimated time to finish turn change "
-                                  "processing."));
-  } else {
-    gtk_widget_set_tooltip_text(timeout_label,
-                                _("Turn timeout disabled.\n"
-                                  "Between turns this shows estimated time "
-                                  "to finish turn change processing."));
-  }
-}
-
-/**********************************************************************//**
-  Refresh info label
-**************************************************************************/
-void update_info_label(void)
-{
-  GtkWidget *label;
-  const struct player *pplayer = client_player();
-
-  label = gtk_frame_get_label_widget(GTK_FRAME(main_frame_civ_name));
-  if (pplayer != NULL) {
-    const gchar *name;
-    gunichar c;
-
-    /* Capitalize the first character of the translated nation
-     * plural name so that the frame label looks good. */
-    name = nation_plural_for_player(pplayer);
-    c = g_utf8_get_char_validated(name, -1);
-    if ((gunichar) -1 != c && (gunichar) -2 != c) {
-      const char *obstext = NULL;
-      int obstextlen = 0;
-
-      if (client_is_observer()) {
-        obstext = _(" (observer)");
-        obstextlen = strlen(obstext);
-      }
-
-      {
-        gchar nation[MAX_LEN_NAME + obstextlen];
-        gchar *next;
-        gint len;
-
-        len = g_unichar_to_utf8(g_unichar_toupper(c), nation);
-        nation[len] = '\0';
-        next = g_utf8_find_next_char(name, NULL);
-        if (NULL != next) {
-          sz_strlcat(nation, next);
-        }
-        if (obstext != NULL) {
-          sz_strlcat(nation, obstext);
-        }
-        gtk_label_set_text(GTK_LABEL(label), nation);
-      }
-    } else {
-      gtk_label_set_text(GTK_LABEL(label), name);
-    }
-  } else {
-    gtk_label_set_text(GTK_LABEL(label), "-");
-  }
-
-  gtk_label_set_text(GTK_LABEL(main_label_info),
-                     get_info_label_text(!GUI_GTK_OPTION(small_display_layout)));
-
-  set_indicator_icons(client_research_sprite(),
-                      client_warming_sprite(),
-                      client_cooling_sprite(),
-                      client_government_sprite());
-
-  if (NULL != pplayer) {
-    int d = 0;
-
-    for (; d < pplayer->economic.luxury / 10; d++) {
-      struct sprite *spr = get_tax_sprite(tileset, O_LUXURY);
-
-      picture_set_from_surface(GTK_PICTURE(econ_label[d]), spr->surface);
-    }
-
-    for (; d < (pplayer->economic.science
-                + pplayer->economic.luxury) / 10; d++) {
-      struct sprite *spr = get_tax_sprite(tileset, O_SCIENCE);
-
-      picture_set_from_surface(GTK_PICTURE(econ_label[d]), spr->surface);
-    }
-
-    for (; d < 10; d++) {
-      struct sprite *spr = get_tax_sprite(tileset, O_GOLD);
-
-      picture_set_from_surface(GTK_PICTURE(econ_label[d]), spr->surface);
-    }
-  }
-
-  update_timeout_label();
-
-  /* Update tooltips. */
-  gtk_widget_set_tooltip_text(econ_widget,
-                              _("Shows your current luxury/science/tax rates; "
-                                "click to toggle them."));
-
-  gtk_widget_set_tooltip_text(bulb_label, get_bulb_tooltip());
-  gtk_widget_set_tooltip_text(sun_label, get_global_warming_tooltip());
-  gtk_widget_set_tooltip_text(flake_label, get_nuclear_winter_tooltip());
-  gtk_widget_set_tooltip_text(government_label, get_government_tooltip());
-}
-
-/**********************************************************************//**
-  This function is used to animate the mouse cursor.
-**************************************************************************/
-static gboolean anim_cursor_cb(gpointer data)
-{
-  if (!cursor_timer_id) {
-    return FALSE;
-  }
-
-  cursor_frame++;
-  if (cursor_frame == NUM_CURSOR_FRAMES) {
-    cursor_frame = 0;
-  }
-
-  if (cursor_type == CURSOR_DEFAULT) {
-    gtk_widget_set_cursor(toplevel, NULL);
-    cursor_timer_id = 0;
-    return FALSE;
-  }
-
-  gtk_widget_set_cursor(toplevel,
-                        fc_cursors[cursor_type][cursor_frame]);
-  control_mouse_cursor(NULL);
-  return TRUE;
-}
-
-/**********************************************************************//**
-  This function will change the current mouse cursor.
-**************************************************************************/
-void update_mouse_cursor(enum cursor_type new_cursor_type)
-{
-  cursor_type = new_cursor_type;
-  if (!cursor_timer_id) {
-    cursor_timer_id = g_timeout_add(CURSOR_INTERVAL, anim_cursor_cb, NULL);
-  }
-}
-
-/**********************************************************************//**
-  Update the information label which gives info on the current unit and the
-  square under the current unit, for specified unit. Note that in practice
-  punit is always the focus unit.
-  Clears label if punit is NULL.
-  Also updates the cursor for the map_canvas (this is related because the
-  info label includes a "select destination" prompt etc).
-  Also calls update_unit_pix_label() to update the icons for units on this
-  square.
-**************************************************************************/
-void update_unit_info_label(struct unit_list *punits)
-{
-  GtkWidget *label;
-
-  label = gtk_frame_get_label_widget(GTK_FRAME(unit_info_frame));
-  gtk_label_set_text(GTK_LABEL(label),
-                     get_unit_info_label_text1(punits));
-
-  gtk_label_set_text(GTK_LABEL(unit_info_label),
-                     get_unit_info_label_text2(punits, 0));
-
-  update_unit_pix_label(punits);
-}
-
-/**********************************************************************//**
-  Get sprite for treaty acceptance or rejection.
-**************************************************************************/
-GdkPixbuf *get_thumb_pixbuf(int onoff)
-{
-  return sprite_get_pixbuf(get_treaty_thumb_sprite(tileset, BOOL_VAL(onoff)));
-}
-
-/**********************************************************************//**
-  Set information for the indicator icons typically shown in the main
-  client window. The parameters tell which sprite to use for the
-  indicator.
-**************************************************************************/
-void set_indicator_icons(struct sprite *bulb, struct sprite *sol,
-                         struct sprite *flake, struct sprite *gov)
-{
-  picture_set_from_surface(GTK_PICTURE(bulb_label), bulb->surface);
-  picture_set_from_surface(GTK_PICTURE(sun_label), sol->surface);
-  picture_set_from_surface(GTK_PICTURE(flake_label), flake->surface);
-  picture_set_from_surface(GTK_PICTURE(government_label), gov->surface);
-}
-
-/**********************************************************************//**
-  Return the maximum dimensions of the area (container widget) for the
-  overview. Due to the fact that the scaling factor is at least 1, the real
-  size could be larger. The calculation in calculate_overview_dimensions()
-  limit it to the smallest possible size.
-**************************************************************************/
-void get_overview_area_dimensions(int *width, int *height)
-{
-  *width = GUI_GTK_OVERVIEW_MIN_XSIZE;
-  *height = GUI_GTK_OVERVIEW_MIN_YSIZE;
-}
-
-/**********************************************************************//**
-  Size of overview changed
-**************************************************************************/
-void overview_size_changed(void)
-{
-  gtk_widget_set_size_request(overview_canvas,
-                              gui_options.overview.width,
-                              gui_options.overview.height);
-  update_map_canvas_scrollbars_size();
-}
-
-/**********************************************************************//**
-  Return a canvas that is the overview window.
-**************************************************************************/
-struct canvas *get_overview_window(void)
-{
-#if 0
-  static struct canvas store;
-  GtkNative *nat = gtk_widget_get_native(overview_canvas);
-
-  store.surface = NULL;
-  store.drawable = gdk_cairo_create(gtk_native_get_surface(nat));
-
-  return &store;
-#endif /* 0 */
-  if (can_client_change_view()) {
-    gtk_widget_queue_draw(overview_canvas);
-  }
-
-  return NULL;
-}
-
-/**********************************************************************//**
-  Redraw overview canvas
-**************************************************************************/
-void overview_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
-                          int width, int height, gpointer data)
-{
-  gpointer source = (can_client_change_view()) ?
-                     (gpointer)gui_options.overview.window : NULL;
-
-  if (source) {
-    cairo_surface_t *surface = gui_options.overview.window->surface;
-
-    cairo_set_source_surface(cr, surface, 0, 0);
-    cairo_paint(cr);
-  }
-}
-
-/**********************************************************************//**
-  Freeze the drawing of the map.
-**************************************************************************/
-void mapview_freeze(void)
-{
-  mapview_frozen_level++;
-}
-
-/**********************************************************************//**
-  Thaw the drawing of the map.
-**************************************************************************/
-void mapview_thaw(void)
-{
-  if (1 < mapview_frozen_level) {
-    mapview_frozen_level--;
-  } else {
-    fc_assert(0 < mapview_frozen_level);
-    mapview_frozen_level = 0;
-    dirty_all();
-  }
-}
-
-/**********************************************************************//**
-  Return whether the map should be drawn or not.
-**************************************************************************/
-bool mapview_is_frozen(void)
-{
-  return (0 < mapview_frozen_level);
-}
-
-/**********************************************************************//**
-  Update on canvas widget size change
-**************************************************************************/
-void map_canvas_resize(GtkWidget *w, int width, int height,
-                       gpointer data)
-{
-  mc_actual_width = width;
-  mc_actual_height = height;
-
-  map_canvas_size_refresh();
-}
-
-/**********************************************************************//**
-  Refresh map canvas size information
-**************************************************************************/
-void map_canvas_size_refresh(void)
-{
-  map_canvas_resized(mc_actual_width / mouse_zoom,
-                     mc_actual_height / mouse_zoom);
-}
-
-/**********************************************************************//**
-  Redraw map canvas.
-**************************************************************************/
-void map_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
-                     int width, int height, gpointer data)
-{
-  if (can_client_change_view() && !map_is_empty() && !mapview_is_frozen()) {
-    /* First we mark the area to be updated as dirty. Then we unqueue
-     * any pending updates, to make sure only the most up-to-date data
-     * is written (otherwise drawing bugs happen when old data is copied
-     * to screen). Then we draw all changed areas to the screen. */
-    unqueue_mapview_updates(FALSE);
-    cairo_scale(cr, mouse_zoom, mouse_zoom);
-    cairo_set_source_surface(cr, mapview.store->surface, 0, 0);
-    cairo_paint(cr);
-  }
-}
-
-/**********************************************************************//**
-  Mark the rectangular region as "dirty" so that we know to flush it
-  later.
-**************************************************************************/
-void dirty_rect(int canvas_x, int canvas_y,
-                int pixel_width, int pixel_height)
-{
-  dirty_all();
-}
-
-/**********************************************************************//**
-  Mark the entire screen area as "dirty" so that we can flush it later.
-**************************************************************************/
-void dirty_all(void)
-{
-  if (gtk_widget_get_realized(map_canvas)) {
-    gtk_widget_queue_draw(map_canvas);
-  }
-}
-
-/**********************************************************************//**
-  Flush all regions that have been previously marked as dirty. See
-  dirty_rect() and dirty_all(). This function is generally called after we've
-  processed a batch of drawing operations.
-**************************************************************************/
-void flush_dirty(void)
-{
-}
-
-/**********************************************************************//**
-  Do any necessary synchronization to make sure the screen is up-to-date.
-  The canvas should have already been flushed to screen via flush_dirty -
-  all this function does is make sure the hardware has caught up.
-**************************************************************************/
-void gui_flush(void)
-{
-  cairo_surface_flush(mapview.store->surface);
-}
-
-/**********************************************************************//**
- Update display of descriptions associated with cities on the main map.
-**************************************************************************/
-void update_city_descriptions(void)
-{
-  update_map_canvas_visible();
-}
-
-/**********************************************************************//**
-  Fill picture with unit gfx
-**************************************************************************/
-void put_unit_picture(struct unit *punit, GtkPicture *p, int height)
-{
-  struct canvas store = FC_STATIC_CANVAS_INIT;
-  int width;
-
-  if (height <= 0) {
-    height = tileset_full_tile_height(tileset);
-  }
-  width = tileset_full_tile_width(tileset);
-
-  store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                             width, height);
-
-  put_unit(punit, &store, 1.0, 0, 0);
-
-  picture_set_from_surface(p, store.surface);
-  cairo_surface_destroy(store.surface);
-}
-
-/**********************************************************************//**
-  FIXME:
-  For now only two food, two gold one shield and two masks can be drawn per
-  unit, the proper way to do this is probably something like what Civ II does.
-  (One food/shield/mask drawn N times, possibly one top of itself. -- SKi
-**************************************************************************/
-void put_unit_picture_city_overlays(struct unit *punit, GtkPicture *p,
-                                    int height,
-                                    int *upkeep_cost, int happy_cost)
-{
-  struct canvas store = FC_STATIC_CANVAS_INIT;
-  int width = tileset_full_tile_width(tileset);
-
-  store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                             width, height);
-
-  put_unit(punit, &store, 1.0, 0, 0);
-
-  put_unit_city_overlays(punit, &store, 0, tileset_unit_layout_offset_y(tileset),
-                         upkeep_cost, happy_cost);
-
-  picture_set_from_surface(p, store.surface);
-  cairo_surface_destroy(store.surface);
-}
-
-/**********************************************************************//**
-  Put overlay tile to pixmap
-**************************************************************************/
-void pixmap_put_overlay_tile(GdkSurface *pixmap, float zoom,
-                             int canvas_x, int canvas_y,
-                             struct sprite *ssprite)
-{
-#if 0
-  cairo_t *cr;
-  GdkDrawingContext *ctx;
-
-  if (!ssprite) {
-    return;
-  }
-
-  ctx = gdk_window_begin_draw_frame(pixmap, NULL,
-                                    gdk_window_get_clip_region(pixmap));
-  cr = gdk_drawing_context_get_cairo_context(ctx);
-  cairo_scale(cr, zoom, zoom);
-  cairo_set_source_surface(cr, ssprite->surface, canvas_x, canvas_y);
-  cairo_paint(cr);
-  gdk_window_end_draw_frame(pixmap, ctx);
-#endif
-}
-
-/**********************************************************************//**
-  Only used for isometric view.
-**************************************************************************/
-void pixmap_put_overlay_tile_draw(struct canvas *pcanvas,
-                                  int canvas_x, int canvas_y,
-                                  struct sprite *ssprite,
-                                  bool fog)
-{
-  cairo_t *cr;
-  int sswidth, ssheight;
-  const double bright = 0.65; /* Fogged brightness compared to unfogged */
-
-  if (!ssprite) {
-    return;
-  }
-
-  get_sprite_dimensions(ssprite, &sswidth, &ssheight);
-
-  if (fog) {
-    struct color *fogcol = color_alloc(0.0, 0.0, 0.0); /* black */
-    cairo_surface_t *fog_surface;
-    struct sprite *fogged;
-    unsigned char *mask_in;
-    unsigned char *mask_out;
-    int i, j;
-
-    /* Create sprites initially fully transparent */
-    fogcol->color.alpha = 0.0;
-    fogged = create_sprite(sswidth, ssheight, fogcol);
-    fog_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, sswidth, ssheight);
-
-    /* Calculate black fog mask from the original sprite's alpha channel;
-     * we don't want to blacken transparent parts of the sprite. */
-    mask_in = cairo_image_surface_get_data(ssprite->surface);
-    mask_out = cairo_image_surface_get_data(fog_surface);
-
-    for (i = 0; i < sswidth; i++) {
-      for (j = 0; j < ssheight; j++) {
-        /* In order to darken pixels of ssprite to 'bright' fraction of
-         * their original value, we need to overlay blackness of
-         * (1-bright) transparency. */
-        if (!is_bigendian()) {
-          mask_out[(j * sswidth + i) * 4 + 3]
-            = (1-bright) * mask_in[(j * sswidth + i) * 4 + 3];
-        } else {
-          mask_out[(j * sswidth + i) * 4 + 0]
-            = (1-bright) * mask_in[(j * sswidth + i) * 4 + 0];
-        }
-      }
-    }
-
-    cairo_surface_mark_dirty(fog_surface);
-
-    /* First copy original sprite canvas to intermediate sprite canvas */
-    cr = cairo_create(fogged->surface);
-    cairo_set_source_surface(cr, ssprite->surface, 0, 0);
-    cairo_paint(cr);
-
-    /* Then apply created fog to the intermediate sprite to darken it */
-    cairo_set_source_surface(cr, fog_surface, 0, 0);
-    cairo_paint(cr);
-    cairo_destroy(cr);
-
-    /* Put intermediate sprite to the target canvas */
-    canvas_put_sprite(pcanvas, canvas_x, canvas_y,
-                      fogged, 0, 0, sswidth, ssheight);
-
-    /* Free intermediate stuff */
-    cairo_surface_destroy(fog_surface);
-    free_sprite(fogged);
-    color_free(fogcol);
-  } else {
-    canvas_put_sprite(pcanvas, canvas_x, canvas_y,
-                      ssprite, 0, 0, sswidth, ssheight);
-  }
-}
-
-/**********************************************************************//**
-  Draws a cross-hair overlay on a tile
-**************************************************************************/
-void put_cross_overlay_tile(struct tile *ptile)
-{
-  float canvas_x, canvas_y;
-
-  if (tile_to_canvas_pos(&canvas_x, &canvas_y, map_zoom, ptile)) {
-    GtkNative *nat = gtk_widget_get_native(map_canvas);
-
-    pixmap_put_overlay_tile(gtk_native_get_surface(nat), map_zoom,
-                            canvas_x / map_zoom, canvas_y / map_zoom,
-                            get_attention_crosshair_sprite(tileset));
-  }
-}
-
-/**********************************************************************//**
-  Sets the position of the overview scroll window based on mapview position.
-**************************************************************************/
-void update_overview_scroll_window_pos(int x, int y)
-{
-  gdouble ov_scroll_x, ov_scroll_y;
-  GtkAdjustment *ov_hadj, *ov_vadj;
-
-  ov_hadj = gtk_scrolled_window_get_hadjustment(
-    GTK_SCROLLED_WINDOW(overview_scrolled_window));
-  ov_vadj = gtk_scrolled_window_get_vadjustment(
-    GTK_SCROLLED_WINDOW(overview_scrolled_window));
-
-  ov_scroll_x = MIN(x - (overview_canvas_store_width / 2),
-                    gtk_adjustment_get_upper(ov_hadj)
-                    - gtk_adjustment_get_page_size(ov_hadj));
-  ov_scroll_y = MIN(y - (overview_canvas_store_height / 2),
-                    gtk_adjustment_get_upper(ov_vadj)
-                    - gtk_adjustment_get_page_size(ov_vadj));
-
-  gtk_adjustment_set_value(ov_hadj, ov_scroll_x);
-  gtk_adjustment_set_value(ov_vadj, ov_scroll_y);
-}
-
-/**********************************************************************//**
-  Refresh map canvas scrollbars
-**************************************************************************/
-void update_map_canvas_scrollbars(void)
-{
-  int scroll_x, scroll_y;
-
-  get_mapview_scroll_pos(&scroll_x, &scroll_y);
-  gtk_adjustment_set_value(map_hadj, scroll_x);
-  gtk_adjustment_set_value(map_vadj, scroll_y);
-  if (can_client_change_view()) {
-    gtk_widget_queue_draw(overview_canvas);
-  }
-}
-
-/**********************************************************************//**
-  Refresh map canvas scrollbar as canvas size changes
-**************************************************************************/
-void update_map_canvas_scrollbars_size(void)
-{
-  float xmin, ymin, xmax, ymax;
-  int xsize, ysize, xstep, ystep;
-
-  get_mapview_scroll_window(&xmin, &ymin, &xmax, &ymax, &xsize, &ysize);
-  get_mapview_scroll_step(&xstep, &ystep);
-
-  map_hadj = gtk_adjustment_new(-1, xmin, xmax, xstep, xsize, xsize);
-  map_vadj = gtk_adjustment_new(-1, ymin, ymax, ystep, ysize, ysize);
-
-  gtk_scrollbar_set_adjustment(GTK_SCROLLBAR(map_horizontal_scrollbar),
-                               map_hadj);
-  gtk_scrollbar_set_adjustment(GTK_SCROLLBAR(map_vertical_scrollbar),
-                               map_vadj);
-
-  g_signal_connect(map_hadj, "value_changed",
-                   G_CALLBACK(scrollbar_jump_callback),
-                   GINT_TO_POINTER(TRUE));
-  g_signal_connect(map_vadj, "value_changed",
-                   G_CALLBACK(scrollbar_jump_callback),
-                   GINT_TO_POINTER(FALSE));
-}
-
-/**********************************************************************//**
-  Scrollbar has moved
-**************************************************************************/
-void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar)
-{
-  int scroll_x, scroll_y;
-
-  if (!can_client_change_view()) {
-    return;
-  }
-
-  get_mapview_scroll_pos(&scroll_x, &scroll_y);
-
-  if (hscrollbar) {
-    scroll_x = gtk_adjustment_get_value(adj);
-  } else {
-    scroll_y = gtk_adjustment_get_value(adj);
-  }
-
-  set_mapview_scroll_pos(scroll_x, scroll_y, mouse_zoom);
-}
-
-/**********************************************************************//**
-  Draws a rectangle with top left corner at (canvas_x, canvas_y), and
-  width 'w' and height 'h'. It is drawn using the 'selection_gc' context,
-  so the pixel combining function is XOR. This means that drawing twice
-  in the same place will restore the image to its original state.
-
-  NB: A side effect of this function is to set the 'selection_gc' color
-  to COLOR_MAPVIEW_SELECTION.
-**************************************************************************/
-void draw_selection_rectangle(int canvas_x, int canvas_y, int w, int h)
-{
-  struct color *pcolor;
-
-  if (w == 0 || h == 0) {
-    return;
-  }
-
-  pcolor = get_color(tileset, COLOR_MAPVIEW_SELECTION);
-  if (!pcolor) {
-    return;
-  }
-
-  canvas_put_line(mapview.store, pcolor, LINE_SELECT_RECT,
-                  canvas_x, canvas_y, w, 0);
-  canvas_put_line(mapview.store, pcolor, LINE_SELECT_RECT,
-                  canvas_x, canvas_y, 0, h);
-  canvas_put_line(mapview.store, pcolor, LINE_SELECT_RECT,
-                  canvas_x, canvas_y + h, w, 0);
-  canvas_put_line(mapview.store, pcolor, LINE_SELECT_RECT,
-                  canvas_x + w, canvas_y, 0, h);
-}
-
-/**********************************************************************//**
-  This function is called when the tileset has changed.
-**************************************************************************/
-void tileset_changed(void)
-{
-  science_report_dialog_redraw();
-  reset_city_dialogs();
-  reset_unit_table();
-  blank_max_unit_size();
-  editgui_tileset_changed();
-
-  /* Keep the icon of the executable on Windows (see PR#36491) */
-#ifndef FREECIV_MSWINDOWS
-  {
-    /* Only call this after tileset_load_tiles is called. */
-    gtk_window_set_icon_name(GTK_WINDOW(toplevel), "freeciv");
-  }
-#endif /* FREECIV_MSWINDOWS */
-}
-
-/**********************************************************************//**
-  New turn callback
-**************************************************************************/
-void start_turn(void)
-{}
diff --git a/client/gui-gtk-5.0/mapview.h b/client/gui-gtk-5.0/mapview.h
deleted file mode 100644
index 87bbf8d45f..0000000000
--- a/client/gui-gtk-5.0/mapview.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__MAPVIEW_H
-#define FC__MAPVIEW_H
-
-#include <gtk/gtk.h>
-
-/* common */
-#include "fc_types.h"
-
-/* client */
-#include "citydlg_common.h"
-#include "mapview_g.h"
-#include "mapview_common.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "graphics.h"
-
-GdkPixbuf *get_thumb_pixbuf(int onoff);
-
-#define CURSOR_INTERVAL 200 /* milliseconds */
-
-void overview_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
-                          int width, int height, gpointer data);
-void map_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
-                     int width, int height, gpointer data);
-void map_canvas_resize(GtkWidget *w, int width, int height,
-                       gpointer data);
-
-void put_unit_picture(struct unit *punit, GtkPicture *p, int height);
-
-void put_unit_picture_city_overlays(struct unit *punit, GtkPicture *p,
-                                    int height, int *upkeep_cost, int happy_cost);
-
-void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar);
-void update_map_canvas_scrollbars_size(void);
-
-void pixmap_put_overlay_tile(GdkSurface *pixmap, float zoom,
-                             int canvas_x, int canvas_y,
-                             struct sprite *ssprite);
-
-void pixmap_put_overlay_tile_draw(struct canvas *pcanvas,
-                                  int canvas_x, int canvas_y,
-                                  struct sprite *ssprite,
-                                  bool fog);
-
-void mapview_freeze(void);
-void mapview_thaw(void);
-bool mapview_is_frozen(void);
-
-#endif /* FC__MAPVIEW_H */
diff --git a/client/gui-gtk-5.0/menu.c b/client/gui-gtk-5.0/menu.c
deleted file mode 100644
index 5e30a7a88d..0000000000
--- a/client/gui-gtk-5.0/menu.c
+++ /dev/null
@@ -1,4171 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "game.h"
-#include "government.h"
-#include "road.h"
-#include "unit.h"
-
-/* client */
-#include "client_main.h"
-#include "clinet.h"
-#include "connectdlg_common.h"
-#include "control.h"
-#include "mapview_common.h"
-#include "options.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "cityrep.h"
-#include "dialogs.h"
-#include "editgui.h"
-#include "editprop.h"
-#include "finddlg.h"
-#include "gamedlgs.h"
-#include "gotodlg.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "helpdlg.h"
-#include "infradlg.h"
-#include "luaconsole.h"
-#include "mapctrl.h"            /* center_on_unit(). */
-#include "messagedlg.h"
-#include "messagewin.h"
-#include "optiondlg.h"
-#include "pages.h"
-#include "plrdlg.h"
-#include "rallypointdlg.h"
-#include "ratesdlg.h"
-#include "repodlgs.h"
-#include "sprite.h"
-#include "spaceshipdlg.h"
-#include "unitselect.h"
-#include "wldlg.h"
-
-#include "menu.h"
-
-static GMenu *main_menubar = NULL;
-static bool menus_built = FALSE;
-
-static GMenu *setup_menus(GtkApplication *app);
-
-static void view_menu_update_sensitivity(GActionMap *map);
-
-enum menu_entry_grouping { MGROUP_SAFE, MGROUP_EDIT, MGROUP_PLAYING,
-                           MGROUP_UNIT, MGROUP_PLAYER, MGROUP_ALL };
-
-static GMenu *options_menu = NULL;
-static GMenu *edit_menu = NULL;
-static GMenu *view_menu = NULL;
-static GMenu *gov_menu = NULL;
-static GMenu *unit_menu = NULL;
-static GMenu *work_menu = NULL;
-static GMenu *combat_menu = NULL;
-
-struct menu_entry_info {
-  const char *key;
-  const char *name;
-  const char *action;
-  const char *accl;
-  enum menu_entry_grouping grouping;
-  void (*toggle)(GSimpleAction *act, GVariant *value, gpointer data);
-  bool state; /* Only for toggle actions */
-};
-
-static void setup_app_actions(GApplication *fc_app);
-static GMenuItem *create_toggle_menu_item(struct menu_entry_info *info);
-static GMenuItem *create_toggle_menu_item_for_key(const char *key);
-
-/* Menu entry callbacks */
-static void clear_chat_logs_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void save_chat_logs_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void local_options_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void message_options_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void server_options_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void save_options_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void save_options_on_exit_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data);
-static void save_game_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void save_game_as_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-
-#ifdef FREECIV_DEBUG
-static void reload_tileset_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-#endif /* FREECIV_DEBUG */
-
-static void save_mapimg_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void save_mapimg_as_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void find_city_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void worklists_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void client_lua_script_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void leave_callback(GSimpleAction *action,
-                           GVariant *parameter,
-                           gpointer data);
-static void quit_callback(GSimpleAction *action,
-                          GVariant *parameter,
-                          gpointer data);
-static void map_view_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data);
-static void report_units_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void report_nations_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void report_cities_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void report_wow_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void report_top_cities_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void report_messages_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void report_demographic_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void help_overview_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_playing_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_policies_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_terrain_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_economy_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_cities_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void help_improvements_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void help_wonders_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_units_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void help_combat_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void help_zoc_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data);
-static void help_government_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void help_diplomacy_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void help_tech_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void help_space_race_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void help_ruleset_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_tileset_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_musicset_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_nations_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_connecting_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void help_controls_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_governor_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_chatline_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_worklist_editor_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data);
-static void help_language_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void help_copying_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void help_about_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void edit_mode_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void show_city_outlines_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void show_city_output_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data);
-static void show_map_grid_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void show_national_borders_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void show_native_tiles_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void show_city_full_bar_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void show_city_names_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void show_city_growth_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data);
-static void show_city_productions_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void show_city_buy_cost_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void show_city_trade_routes_callback(GSimpleAction *action,
-                                            GVariant *parameter,
-                                            gpointer data);
-static void show_terrain_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void show_coastline_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void show_paths_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void show_irrigation_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void show_mines_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void show_bases_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void show_resources_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void show_huts_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void show_pollution_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void show_cities_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void show_units_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void show_unit_solid_bg_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void show_unit_shields_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void show_stack_size_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void show_focus_unit_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void show_fog_of_war_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void toggle_fog_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void scenario_properties_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data);
-static void save_scenario_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void full_screen_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void center_view_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void report_economy_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void report_research_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data);
-static void multiplier_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void report_spaceship_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data);
-static void report_achievements_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data);
-
-static void government_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void revolution_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void tax_rate_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data);
-static void select_single_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void select_all_on_tile_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void select_same_type_tile_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void select_same_type_cont_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data);
-static void select_same_type_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data);
-static void select_dialog_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void rally_dialog_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void infra_dialog_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unit_wait_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void unit_done_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void unit_goto_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void unit_goto_city_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void unit_return_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void unit_explore_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unit_patrol_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void unit_teleport_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void unit_sentry_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data);
-static void fortify_callback(GSimpleAction *action,
-                             GVariant *parameter,
-                             gpointer data);
-static void unit_homecity_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-static void unit_upgrade_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unit_convert_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unit_disband_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unsentry_all_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void unit_unload_transporter_callback(GSimpleAction *action,
-                                             GVariant *parameter,
-                                             gpointer data);
-static void unit_board_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void unit_deboard_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void build_city_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void auto_work_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void cultivate_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void plant_callback(GSimpleAction *action,
-                           GVariant *parameter,
-                           gpointer data);
-
-static void paradrop_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data);
-static void pillage_callback(GSimpleAction *action,
-                             GVariant *parameter,
-                             gpointer data);
-static void transform_terrain_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data);
-static void clean_callback(GSimpleAction *action,
-                           GVariant *parameter,
-                           gpointer data);
-static void build_road_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void build_irrigation_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data);
-static void build_mine_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data);
-static void connect_road_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void connect_rail_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data);
-static void connect_maglev_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void connect_irrigation_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data);
-static void do_action_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void build_fortress_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data);
-static void build_airbase_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data);
-
-static void bg_select_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void bg_assign_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-static void bg_append_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data);
-
-static struct menu_entry_info menu_entries[] =
-{
-  /* Game menu */
-  { "CLEAR_CHAT_LOGS", N_("_Clear Chat Log"),
-    "clear_chat", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "SAVE_CHAT_LOGS", N_("Save Chat _Log"),
-    "save_chat", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-
-  { "LOCAL_OPTIONS", N_("_Local Client"),
-    "local_options", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "MESSAGE_OPTIONS", N_("_Message"),
-    "message_options", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "SERVER_OPTIONS", N_("_Remote Server"),
-    "server_options", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "SAVE_OPTIONS", N_("Save Options _Now"),
-    "save_options", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "SAVE_OPTIONS_ON_EXIT", N_("Save Options on _Exit"),
-    "save_options_on_exit", NULL, MGROUP_SAFE,
-    save_options_on_exit_callback, FALSE },
-
-#ifdef FREECIV_DEBUG
-  { "RELOAD_TILESET", N_("_Reload Tileset"),
-    "reload_tileset", ACCL_MOD_KEY"<alt>r", MGROUP_SAFE,
-    NULL, FALSE },
-#endif /* FREECIV_DEBUG */
-
-  { "GAME_SAVE", N_("_Save Game"),
-    "game_save", ACCL_MOD_KEY"s", MGROUP_SAFE,
-    NULL, FALSE },
-  { "GAME_SAVE_AS", N_("Save Game _As..."),
-    "game_save_as", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "MAPIMG_SAVE", N_("Save Map _Image"),
-    "save_mapimg", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "MAPIMG_SAVE_AS", N_("Save _Map Image As..."),
-    "save_mapimg_as", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "LEAVE", N_("_Leave"),
-    "leave", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "QUIT", N_("_Quit"),
-    "quit", ACCL_MOD_KEY"q", MGROUP_SAFE,
-    NULL, FALSE },
-
-  /* Edit menu */
-  { "FIND_CITY", N_("_Find City"),
-    "find_city", ACCL_MOD_KEY"f", MGROUP_SAFE,
-    NULL, FALSE },
-  { "WORKLISTS", N_("Work_lists"),
-    "worklists", ACCL_MOD_KEY"<shift>l", MGROUP_SAFE,
-    NULL, FALSE },
-  { "RALLY_DLG", N_("Rally point dialog"),
-    "rally_dlg", ACCL_MOD_KEY"<shift>r", MGROUP_SAFE,
-    NULL, FALSE },
-  { "INFRA_DLG", N_("Infra dialog"),
-    "infra_dlg", ACCL_MOD_KEY"<shift>f", MGROUP_SAFE,
-    NULL, FALSE },
-  { "EDIT_MODE", N_("_Editing Mode"),
-    "edit_mode", ACCL_MOD_KEY"e", MGROUP_SAFE,
-    edit_mode_callback, FALSE },
-  { "TOGGLE_FOG", N_("Toggle Fog of _War"),
-    "toggle_fog", ACCL_MOD_KEY"<shift>w", MGROUP_EDIT,
-    toggle_fog_callback, FALSE },
-  { "SCENARIO_PROPERTIES", N_("Game/Scenario Properties"),
-    "scenario_props", NULL, MGROUP_EDIT,
-    NULL, FALSE },
-  { "SCENARIO_SAVE", N_("Save Scenario"),
-    "scenario_save", NULL, MGROUP_EDIT,
-    NULL, FALSE },
-  { "CLIENT_LUA_SCRIPT", N_("Client _Lua Script"),
-    "lua_script", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-
-  /* View menu */
-  { "SHOW_CITY_OUTLINES", N_("Cit_y Outlines"),
-    "show_city_outlines", ACCL_MOD_KEY"y", MGROUP_SAFE,
-    show_city_outlines_callback, FALSE },
-  { "SHOW_CITY_OUTPUT", N_("City Output"),
-    "show_city_output", ACCL_MOD_KEY"v", MGROUP_SAFE,
-    show_city_output_callback, FALSE },
-  { "SHOW_MAP_GRID", N_("Map _Grid"),
-    "show_map_grid", ACCL_MOD_KEY"g", MGROUP_SAFE,
-    show_map_grid_callback, FALSE },
-  { "SHOW_NAT_BORDERS", N_("National _Borders"),
-    "show_nat_borders", ACCL_MOD_KEY"b", MGROUP_SAFE,
-    show_national_borders_callback, FALSE },
-  { "SHOW_NATIVE_TILES", N_("Native Tiles"),
-    "show_native_tiles", ACCL_MOD_KEY"<shift>n", MGROUP_SAFE,
-    show_native_tiles_callback, FALSE },
-  { "SHOW_CITY_FULL_BAR", N_("City Full Bar"),
-    "show_city_full_bar", NULL, MGROUP_SAFE,
-    show_city_full_bar_callback, FALSE },
-  { "SHOW_CITY_NAMES", N_("City _Names"),
-    "show_city_names", ACCL_MOD_KEY"n", MGROUP_SAFE,
-    show_city_names_callback, FALSE },
-  { "SHOW_CITY_GROWTH", N_("City G_rowth"),
-    "show_city_growth", ACCL_MOD_KEY"o", MGROUP_SAFE,
-    show_city_growth_callback, FALSE },
-  { "SHOW_CITY_PRODUCTIONS", N_("City _Production"),
-    "show_city_productions", ACCL_MOD_KEY"p", MGROUP_SAFE,
-    show_city_productions_callback, FALSE },
-  { "SHOW_CITY_BUY_COST", N_("City Buy Cost"),
-    "show_city_buy_cost", NULL, MGROUP_SAFE,
-    show_city_buy_cost_callback, FALSE },
-  { "SHOW_CITY_TRADE_ROUTES", N_("City Tra_deroutes"),
-    "show_trade_routes", ACCL_MOD_KEY"d", MGROUP_SAFE,
-    show_city_trade_routes_callback, FALSE },
-  { "SHOW_TERRAIN", N_("_Terrain"),
-    "show_terrain", NULL, MGROUP_SAFE,
-    show_terrain_callback, FALSE },
-  { "SHOW_COASTLINE", N_("C_oastline"),
-    "show_coastline", NULL, MGROUP_SAFE,
-    show_coastline_callback, FALSE },
-  { "SHOW_PATHS", N_("_Paths"),
-    "show_paths", NULL, MGROUP_SAFE,
-    show_paths_callback, FALSE },
-  { "SHOW_IRRIGATION", N_("_Irrigation"),
-    "show_irrigation", NULL, MGROUP_SAFE,
-    show_irrigation_callback, FALSE },
-  { "SHOW_MINES", N_("_Mines"),
-    "show_mines", NULL, MGROUP_SAFE,
-    show_mines_callback, FALSE },
-  { "SHOW_BASES", N_("_Bases"),
-    "show_bases", NULL, MGROUP_SAFE,
-    show_bases_callback, FALSE },
-  { "SHOW_RESOURCES", N_("_Resources"),
-    "show_resources", NULL, MGROUP_SAFE,
-    show_resources_callback, FALSE },
-  { "SHOW_HUTS", N_("_Huts"),
-    "show_huts", NULL, MGROUP_SAFE,
-    show_huts_callback, FALSE },
-  { "SHOW_POLLUTION", N_("Po_llution & Fallout"),
-    "show_pollution", NULL, MGROUP_SAFE,
-    show_pollution_callback, FALSE },
-  { "SHOW_CITIES", N_("Citi_es"),
-    "show_cities", NULL, MGROUP_SAFE,
-    show_cities_callback, FALSE },
-  { "SHOW_UNITS", N_("_Units"),
-    "show_units", NULL, MGROUP_SAFE,
-    show_units_callback, FALSE },
-  { "SHOW_UNIT_SOLID_BG", N_("Unit Solid Background"),
-    "show_unit_solid_bg", NULL, MGROUP_SAFE,
-    show_unit_solid_bg_callback, FALSE },
-  { "SHOW_UNIT_SHIELDS", N_("Unit shields"),
-    "show_unit_shields", NULL, MGROUP_SAFE,
-    show_unit_shields_callback, FALSE },
-  { "SHOW_STACK_SIZE", N_("Unit Stack Size"),
-    "show_stack_size", ACCL_MOD_KEY"plus", MGROUP_SAFE,
-    show_stack_size_callback, FALSE },
-  { "SHOW_FOCUS_UNIT", N_("Focu_s Unit"),
-    "show_focus_unit", NULL, MGROUP_SAFE,
-    show_focus_unit_callback, FALSE },
-  { "SHOW_FOG_OF_WAR", N_("Fog of _War"),
-    "show_fow", NULL, MGROUP_SAFE,
-    show_fog_of_war_callback, FALSE },
-
-  { "FULL_SCREEN", N_("_Fullscreen"),
-    "full_screen", ACCL_MOD_KEY"F11", MGROUP_SAFE,
-    full_screen_callback, FALSE },
-  { "CENTER_VIEW", N_("_Center View"),
-    "center_view", "c", MGROUP_PLAYER,
-    NULL, FALSE },
-
-  /* Select menu */
-  { "SELECT_SINGLE", N_("_Single Unit (Unselect Others)"),
-    "select_single", "z", MGROUP_UNIT,
-    NULL, FALSE },
-  { "SELECT_ALL_ON_TILE", N_("_All On Tile"),
-    "select_all_tile", "v", MGROUP_UNIT,
-    NULL, FALSE },
-  { "SELECT_SAME_TYPE_TILE", N_("Same Type on _Tile"),
-    "select_same_type_tile", "<shift>v", MGROUP_UNIT,
-    NULL, FALSE },
-  { "SELECT_SAME_TYPE_CONT", N_("Same Type on _Continent"),
-    "select_same_type_cont", "<shift>c", MGROUP_UNIT,
-    NULL, FALSE },
-  { "SELECT_SAME_TYPE", N_("Same Type _Everywhere"),
-    "select_same_type", "<shift>x", MGROUP_UNIT,
-    NULL, FALSE },
-  { "SELECT_DLG", N_("Unit Selection Dialog"),
-    "select_dlg", NULL, MGROUP_UNIT,
-    NULL, FALSE },
-
-  /* Unit menu */
-  { "UNIT_GOTO", N_("_Go to"),
-    "goto", "g", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_GOTO_CITY", N_("Go _to/Airlift to City..."),
-    "goto_city", "t", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_RETURN", N_("_Return to Nearest City"),
-    "return", "<shift>g", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_EXPLORE", N_("Auto E_xplore"),
-    "explore", "x", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_PATROL", N_("_Patrol"),
-    "patrol", "q", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_TELEPORT", N_("_Teleport"),
-    "teleport", NULL, MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_SENTRY", N_("_Sentry"),
-    "sentry", "s", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNSENTRY_ALL", N_("Uns_entry All On Tile"),
-    "unsentry_all", "<shift>s", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_BOARD", N_("_Load"),
-    "board", "l", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_DEBOARD", N_("_Unload"),
-    "deboard", "u", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_UNLOAD_TRANSPORTER", N_("U_nload All From Transporter"),
-    "unload_transporter", "<shift>t", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_HOMECITY", N_("Set _Home City"),
-    "homecity", "h", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_UPGRADE", N_("Upgr_ade"),
-    "upgrade", "<shift>u", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_CONVERT", N_("C_onvert"),
-    "convert", "<shift>o", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_DISBAND", N_("_Disband"),
-    "disband", "<shift>d", MGROUP_UNIT,
-    NULL, FALSE },
-  { "DO_ACTION", N_("_Do..."),
-    "do_action", "d", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_WAIT", N_("_Wait"),
-    "wait", "w", MGROUP_UNIT,
-    NULL, FALSE },
-  { "UNIT_DONE", N_("_Done"),
-    "done", "space", MGROUP_UNIT,
-    NULL, FALSE },
-
-  /* Work menu */
-  { "BUILD_CITY", N_("_Build City"),
-    "build_city", "b", MGROUP_UNIT,
-    NULL, FALSE },
-  { "AUTO_WORKER", N_("_Auto Worker"),
-    "auto_work", "a", MGROUP_UNIT,
-    NULL, FALSE },
-  { "BUILD_ROAD", N_("Build _Road"),
-    "build_road", "r", MGROUP_UNIT,
-    NULL, FALSE },
-  { "BUILD_IRRIGATION", N_("Build _Irrigation"),
-    "build_irrigation", "i", MGROUP_UNIT,
-    NULL, FALSE },
-  { "BUILD_MINE", N_("Build _Mine"),
-    "build_mine", "m", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CULTIVATE", N_("Cultivate"),
-    "cultivate", "<shift>i", MGROUP_UNIT,
-    NULL, FALSE },
-  { "PLANT", N_("Plant"),
-    "plant", "<shift>m", MGROUP_UNIT,
-    NULL, FALSE },
-  { "TRANSFORM_TERRAIN", N_("Transf_orm Terrain"),
-    "transform_terrain", "o", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CONNECT_ROAD", N_("Connect With Roa_d"),
-    "connect_road", ACCL_MOD_KEY"r", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CONNECT_RAIL", N_("Connect With Rai_l"),
-    "connect_rail", ACCL_MOD_KEY"l", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CONNECT_MAGLEV", N_("Connect With _Maglev"),
-    "connect_maglev", ACCL_MOD_KEY"m", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CONNECT_IRRIGATION", N_("Connect With Irri_gation"),
-    "connect_irrigation", ACCL_MOD_KEY"i", MGROUP_UNIT,
-    NULL, FALSE },
-  { "CLEAN", N_("_Clean"),
-    "clean", "p", MGROUP_UNIT,
-    NULL, FALSE },
-
-  /* Combat menu */
-  { "FORTIFY", N_("Fortify"),
-    "fortify", "f", MGROUP_UNIT,
-    NULL, FALSE },
-  { "BUILD_FORTRESS", N_("Build Fortress"),
-    "build_base_fortress", "<shift>f", MGROUP_UNIT,
-    NULL, FALSE },
-  { "BUILD_AIRBASE", N_("Build Airbase"),
-    "build_base_airbase", "<shift>e", MGROUP_UNIT,
-    NULL, FALSE },
-  { "PARADROP", N_("P_aradrop"),
-    "paradrop", "j", MGROUP_UNIT,
-    NULL, FALSE },
-  { "PILLAGE", N_("_Pillage"),
-    "pillage", "<shift>p", MGROUP_UNIT,
-    NULL, FALSE },
-
-  /* Civilization */
-  { "MAP_VIEW", N_("?noun:_View"),
-    "map_view", "F1", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_UNITS", N_("_Units"),
-    "report_units", "F2", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_NATIONS", N_("_Nations"),
-    "report_nations", "F3", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_CITIES", N_("_Cities"),
-    "report_cities", "F4", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_ECONOMY", N_("_Economy"),
-    "report_economy", "F5", MGROUP_PLAYER,
-    NULL, FALSE },
-  { "REPORT_RESEARCH", N_("_Research"),
-    "report_research", "F6", MGROUP_PLAYER,
-    NULL, FALSE },
-
-  { "TAX_RATES", N_("_Tax Rates..."),
-    "tax_rates", ACCL_MOD_KEY"t", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "POLICIES", N_("_Policies..."),
-    "policies", "<shift><ctrl>p", MGROUP_PLAYER,
-    NULL, FALSE },
-  { "START_REVOLUTION", N_("_Revolution..."),
-    "revolution", "<shift><ctrl>g", MGROUP_PLAYING,
-    NULL, FALSE },
-
-  { "REPORT_WOW", N_("_Wonders of the World"),
-    "report_wow", "F7", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_TOP_CITIES", N_("Top Cities"),
-    "report_top_cities", "F8", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_MESSAGES", N_("_Messages"),
-    "report_messages", "F9", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_DEMOGRAPHIC", N_("_Demographics"),
-    "report_demographics", "F11", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_SPACESHIP", N_("_Spaceship"),
-    "report_spaceship", "F12", MGROUP_SAFE,
-    NULL, FALSE },
-  { "REPORT_ACHIEVEMENTS", N_("_Achievements"),
-    "report_achievements", "asterisk", MGROUP_SAFE,
-    NULL, FALSE },
-
-  /* Battle Groups menu */
-  /* Note that user view: 1 - 4, internal: 0 - 3 */
-  { "BG_SELECT_1", N_("Select Battle Group 1"),
-    "bg_select_0", "<shift>F1", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_ASSIGN_1", N_("Assign Battle Group 1"),
-    "bg_assign_0", ACCL_MOD_KEY"F1", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_APPEND_1", N_("Append to Battle Group 1"),
-    "bg_append_0", "<shift><ctrl>F1", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_SELECT_2", N_("Select Battle Group 2"),
-    "bg_select_1", "<shift>F2", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_ASSIGN_2", N_("Assign Battle Group 2"),
-    "bg_assign_1", ACCL_MOD_KEY"F2", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_APPEND_2", N_("Append to Battle Group 2"),
-    "bg_append_1", "<shift><ctrl>F2", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_SELECT_3", N_("Select Battle Group 3"),
-    "bg_select_2", "<shift>F3", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_ASSIGN_3", N_("Assign Battle Group 3"),
-    "bg_assign_2", ACCL_MOD_KEY"F3", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_APPEND_3", N_("Append to Battle Group 3"),
-    "bg_append_2", "<shift><ctrl>F3", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_SELECT_4", N_("Select Battle Group 4"),
-    "bg_select_3", "<shift>F4", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_ASSIGN_4", N_("Assign Battle Group 4"),
-    "bg_assign_3", ACCL_MOD_KEY"F4", MGROUP_PLAYING,
-    NULL, FALSE },
-  { "BG_APPEND_4", N_("Append to Battle Group 4"),
-    "bg_append_3", "<shift><ctrl>F4", MGROUP_PLAYING,
-    NULL, FALSE },
-
-  /* Help menu */
-  { "HELP_OVERVIEW", N_("?help:Overview"),
-    "help_overview", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_PLAYING", N_("Strategy and Tactics"),
-    "help_playing", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_POLICIES", N_("Policies"),
-    "help_policies", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_TERRAIN", N_("Terrain"),
-    "help_terrains", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_ECONOMY", N_("Economy"),
-    "help_economy", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_CITIES", N_("Cities"),
-    "help_cities", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_IMPROVEMENTS", N_("City Improvements"),
-    "help_improvements", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_WONDERS", N_("Wonders of the World"),
-    "help_wonders", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_UNITS", N_("Units"),
-    "help_units", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_COMBAT", N_("Combat"),
-    "help_combat", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_ZOC", N_("Zones of Control"),
-    "help_zoc", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_GOVERNMENT", N_("Government"),
-    "help_government", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_DIPLOMACY", N_("Diplomacy"),
-    "help_diplomacy", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_TECH", N_("Technology"),
-    "help_tech", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_SPACE_RACE", N_("Space Race"),
-    "help_space_race", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_RULESET", N_("About Current Ruleset"),
-    "help_ruleset", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_TILESET", N_("About Current Tileset"),
-    "help_tileset", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_MUSICSET", N_("About Current Musicset"),
-    "help_musicset", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_NATIONS", N_("About Nations"),
-    "help_nations", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_CONNECTING", N_("Connecting"),
-    "help_connecting", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_CONTROLS", N_("Controls"),
-    "help_controls", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_GOVERNOR", N_("Citizen Governor"),
-    "help_governor", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_CHATLINE", N_("Chatline"),
-    "help_chatline", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_WORKLIST_EDITOR", N_("Worklist Editor"),
-    "help_worklist_editor", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_LANGUAGES", N_("Languages"),
-    "help_languages", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_COPYING", N_("Copying"),
-    "help_copying", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { "HELP_ABOUT", N_("About Freeciv"),
-    "help_about", NULL, MGROUP_SAFE,
-    NULL, FALSE },
-  { NULL }
-};
-
-enum {
-  VMENU_CITY_OUTLINES = 0,
-  VMENU_CITY_OUTPUT,
-  VMENU_MAP_GRID,
-  VMENU_NAT_BORDERS,
-  VMENU_NATIVE_TILES,
-  VMENU_CITY_FULL_BAR,
-  VMENU_CITY_NAMES,
-  VMENU_CITY_GROWTH,
-  VMENU_CITY_PRODUCTIONS,
-  VMENU_CITY_BUY_COST,
-  VMENU_CITY_TRADE_ROUTES,
-  VMENU_TERRAIN,
-  VMENU_COASTLINE,
-  VMENU_PATHS,
-  VMENU_IRRIGATION,
-  VMENU_MINES,
-  VMENU_BASES,
-  VMENU_RESOURCES,
-  VMENU_HUTS,
-  VMENU_POLLUTION,
-  VMENU_CITIES,
-  VMENU_UNITS,
-  VMENU_UNIT_SOLID_BG,
-  VMENU_UNIT_SHIELDS,
-  VMENU_STACK_SIZE,
-  VMENU_FOCUS_UNIT,
-  VMENU_FOW,
-  VMENU_FULL_SCREEN
-};
-
-const GActionEntry acts[] = {
-  { "clear_chat", clear_chat_logs_callback },
-  { "save_chat", save_chat_logs_callback },
-  { "local_options", local_options_callback },
-  { "message_options", message_options_callback },
-  { "server_options", server_options_callback },
-  { "save_options", save_options_callback },
-
-#ifdef FREECIV_DEBUG
-  { "reload_tileset", reload_tileset_callback },
-#endif /* FREECIV_DEBUG */
-
-  { "game_save", save_game_callback },
-  { "game_save_as", save_game_as_callback },
-  { "save_mapimg", save_mapimg_callback },
-  { "save_mapimg_as", save_mapimg_as_callback },
-  { "leave", leave_callback },
-  { "quit", quit_callback },
-
-  { "find_city", find_city_callback },
-  { "worklists", worklists_callback },
-  { "rally_dlg", rally_dialog_callback },
-  { "infra_dlg", infra_dialog_callback },
-  { "scenario_props", scenario_properties_callback },
-  { "scenario_save", save_scenario_callback },
-  { "lua_script", client_lua_script_callback },
-
-  { "center_view", center_view_callback },
-
-  { "select_single", select_single_callback },
-  { "select_all_tile", select_all_on_tile_callback },
-  { "select_same_type_tile", select_same_type_tile_callback },
-  { "select_same_type_cont", select_same_type_cont_callback },
-  { "select_same_type", select_same_type_callback },
-  { "select_dlg", select_dialog_callback },
-
-  { "goto", unit_goto_callback },
-  { "goto_city", unit_goto_city_callback },
-  { "return", unit_return_callback },
-  { "explore", unit_explore_callback },
-  { "patrol", unit_patrol_callback },
-  { "teleport", unit_teleport_callback },
-  { "sentry", unit_sentry_callback },
-  { "unsentry_all", unsentry_all_callback },
-  { "board", unit_board_callback },
-  { "deboard", unit_deboard_callback },
-  { "unload_transporter", unit_unload_transporter_callback },
-  { "homecity", unit_homecity_callback },
-  { "upgrade", unit_upgrade_callback },
-  { "convert", unit_convert_callback },
-  { "disband", unit_disband_callback },
-  { "do_action", do_action_callback },
-  { "wait", unit_wait_callback },
-  { "done", unit_done_callback },
-
-  { "build_city", build_city_callback },
-  { "auto_work", auto_work_callback },
-  { "build_road", build_road_callback },
-  { "build_irrigation", build_irrigation_callback },
-  { "build_mine", build_mine_callback },
-  { "cultivate", cultivate_callback },
-  { "plant", plant_callback },
-  { "transform_terrain", transform_terrain_callback },
-  { "connect_road", connect_road_callback },
-  { "connect_rail", connect_rail_callback },
-  { "connect_maglev", connect_maglev_callback },
-  { "connect_irrigation", connect_irrigation_callback },
-  { "clean", clean_callback },
-
-  { "fortify", fortify_callback },
-  { "build_base_fortress", build_fortress_callback },
-  { "build_base_airbase", build_airbase_callback },
-  { "paradrop", paradrop_callback },
-  { "pillage", pillage_callback },
-
-  { "revolution", revolution_callback },
-
-  { "map_view", map_view_callback },
-  { "report_units", report_units_callback },
-  { "report_nations", report_nations_callback },
-  { "report_cities", report_cities_callback },
-  { "report_economy", report_economy_callback },
-  { "report_research", report_research_callback },
-  { "tax_rates", tax_rate_callback },
-  { "policies", multiplier_callback },
-  { "report_wow", report_wow_callback },
-  { "report_top_cities", report_top_cities_callback },
-  { "report_messages", report_messages_callback },
-  { "report_demographics", report_demographic_callback },
-  { "report_spaceship", report_spaceship_callback },
-  { "report_achievements", report_achievements_callback },
-
-  { "help_overview", help_overview_callback },
-  { "help_playing", help_playing_callback },
-  { "help_policies", help_policies_callback },
-  { "help_terrains", help_terrain_callback },
-  { "help_economy", help_economy_callback },
-  { "help_cities", help_cities_callback },
-  { "help_improvements", help_improvements_callback },
-  { "help_wonders", help_wonders_callback },
-  { "help_units", help_units_callback },
-  { "help_combat", help_combat_callback },
-  { "help_zoc", help_zoc_callback },
-  { "help_government", help_government_callback },
-  { "help_diplomacy", help_diplomacy_callback },
-  { "help_tech", help_tech_callback },
-  { "help_space_race", help_space_race_callback },
-  { "help_ruleset", help_ruleset_callback },
-  { "help_tileset", help_tileset_callback },
-  { "help_musicset", help_musicset_callback },
-  { "help_nations", help_nations_callback },
-  { "help_connecting", help_connecting_callback },
-  { "help_controls", help_controls_callback },
-  { "help_governor", help_governor_callback },
-  { "help_chatline", help_chatline_callback },
-  { "help_worklist_editor", help_worklist_editor_callback },
-  { "help_languages", help_language_callback },
-  { "help_copying", help_copying_callback },
-  { "help_about", help_about_callback }
-};
-
-static struct menu_entry_info *menu_entry_info_find(const char *key);
-
-/************************************************************************//**
-  Item "CLEAR_CHAT_LOGS" callback.
-****************************************************************************/
-static void clear_chat_logs_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  clear_output_window();
-}
-
-/************************************************************************//**
-  Item "SAVE_CHAT_LOGS" callback.
-****************************************************************************/
-static void save_chat_logs_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  log_output_window();
-}
-
-/************************************************************************//**
-  Item "LOCAL_OPTIONS" callback.
-****************************************************************************/
-static void local_options_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  option_dialog_popup(_("Set local options"), client_optset);
-}
-
-/************************************************************************//**
-  Item "MESSAGE_OPTIONS" callback.
-****************************************************************************/
-static void message_options_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  popup_messageopt_dialog();
-}
-
-/************************************************************************//**
-  Item "SERVER_OPTIONS" callback.
-****************************************************************************/
-static void server_options_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  option_dialog_popup(_("Game Settings"), server_optset);
-}
-
-/************************************************************************//**
-  Item "SAVE_OPTIONS" callback.
-****************************************************************************/
-static void save_options_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  options_save(NULL);
-}
-
-/************************************************************************//**
-  Item "SAVE_OPTIONS_ON_EXIT" callback.
-****************************************************************************/
-static void save_options_on_exit_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data)
-{
-  struct menu_entry_info *info = (struct menu_entry_info *)data;
-
-  info->state ^= 1;
-  gui_options.save_options_on_exit = info->state;
-
-  g_menu_remove(options_menu, 4);
-
-  menu_item_insert_unref(options_menu, 4,
-                         create_toggle_menu_item(info));
-}
-
-#ifdef FREECIV_DEBUG
-/************************************************************************//**
-  Item "RELOAD_TILESET" callback.
-****************************************************************************/
-static void reload_tileset_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  tilespec_reread(NULL, TRUE, 1.0);
-}
-#endif /* FREECIV_DEBUG */
-
-/************************************************************************//**
-  Item "SAVE_GAME" callback.
-****************************************************************************/
-static void save_game_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data)
-{
-  send_save_game(NULL);
-}
-
-/************************************************************************//**
-  Item "SAVE_GAME_AS" callback.
-****************************************************************************/
-static void save_game_as_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  save_game_dialog_popup();
-}
-
-/************************************************************************//**
-  Item "SAVE_MAPIMG" callback.
-****************************************************************************/
-static void save_mapimg_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  mapimg_client_save(NULL);
-}
-
-/************************************************************************//**
-  Item "SAVE_MAPIMG_AS" callback.
-****************************************************************************/
-static void save_mapimg_as_callback(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data)
-{
-  save_mapimg_dialog_popup();
-}
-
-/************************************************************************//**
-  This is the response callback for the dialog with the message:
-  Leaving a local game will end it!
-****************************************************************************/
-static void leave_local_game_response(GObject *dialog, GAsyncResult *result,
-                                      gpointer data)
-{
-  int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
-                                              result, NULL);
-
-  if (button == 0) {
-    /* It might be killed already */
-    if (client.conn.used) {
-      /* It will also kill the server */
-      disconnect_from_server(TRUE);
-    }
-  }
-}
-
-/************************************************************************//**
-  Item "LEAVE" callback.
-****************************************************************************/
-static void leave_callback(GSimpleAction *action,
-                           GVariant *parameter,
-                           gpointer data)
-{
-  if (is_server_running()) {
-    const char *buttons[] = { _("Leave"), _("Cancel"), NULL };
-    GtkAlertDialog *dialog
-      = gtk_alert_dialog_new(_("Leaving a local game will end it!"));
-
-    gtk_alert_dialog_set_buttons(GTK_ALERT_DIALOG(dialog), buttons);
-    setup_dialog(GTK_WIDGET(dialog), toplevel);
-    gtk_alert_dialog_choose(GTK_ALERT_DIALOG(dialog),
-                            GTK_WINDOW(toplevel), NULL,
-                            leave_local_game_response, NULL);
-  } else {
-    disconnect_from_server(TRUE);
-  }
-}
-
-/************************************************************************//**
-  Item "QUIT" callback.
-****************************************************************************/
-static void quit_callback(GSimpleAction *action,
-                          GVariant *parameter,
-                          gpointer data)
-{
-  popup_quit_dialog();
-}
-
-/************************************************************************//**
-  Item "FIND_CITY" callback.
-****************************************************************************/
-static void find_city_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  popup_find_dialog();
-}
-
-/************************************************************************//**
-  Item "WORKLISTS" callback.
-****************************************************************************/
-static void worklists_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  popup_worklists_report();
-}
-
-/************************************************************************//**
-  Item "MAP_VIEW" callback.
-****************************************************************************/
-static void map_view_callback(GSimpleAction *action,
-                              GVariant *parameter, gpointer data)
-{
-  map_canvas_focus();
-}
-
-/************************************************************************//**
-  Item "REPORT_NATIONS" callback.
-****************************************************************************/
-static void report_nations_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  popup_players_dialog(TRUE);
-}
-
-/************************************************************************//**
-  Item "REPORT_WOW" callback.
-****************************************************************************/
-static void report_wow_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) {
-    send_report_request(REPORT_WONDERS_OF_THE_WORLD_LONG);
-  } else {
-    send_report_request(REPORT_WONDERS_OF_THE_WORLD);
-  }
-}
-
-/************************************************************************//**
-  Item "REPORT_TOP_CITIES" callback.
-****************************************************************************/
-static void report_top_cities_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  send_report_request(REPORT_TOP_CITIES);
-}
-
-/************************************************************************//**
-  Item "REPORT_MESSAGES" callback.
-****************************************************************************/
-static void report_messages_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  meswin_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Item "CLIENT_LUA_SCRIPT" callback.
-****************************************************************************/
-static void client_lua_script_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  luaconsole_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Item "REPORT_DEMOGRAPHIC" callback.
-****************************************************************************/
-static void report_demographic_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  send_report_request(REPORT_DEMOGRAPHIC);
-}
-
-/************************************************************************//**
-  Item "REPORT_ACHIEVEMENTS" callback.
-****************************************************************************/
-static void report_achievements_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data)
-{
-  send_report_request(REPORT_ACHIEVEMENTS);
-}
-
-/************************************************************************//**
-  Item "HELP_OVERVIEW" callback.
-****************************************************************************/
-static void help_overview_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_OVERVIEW_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_PLAYING" callback.
-****************************************************************************/
-static void help_playing_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_PLAYING_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_POLICIES" callback.
-****************************************************************************/
-static void help_policies_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_MULTIPLIER_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_TERRAIN" callback.
-****************************************************************************/
-static void help_terrain_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_TERRAIN_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_ECONOMY" callback.
-****************************************************************************/
-static void help_economy_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_ECONOMY_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_CITIES" callback.
-****************************************************************************/
-static void help_cities_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data)
-{
-  popup_help_dialog_string(HELP_CITIES_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_IMPROVEMENTS" callback.
-****************************************************************************/
-static void help_improvements_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  popup_help_dialog_string(HELP_IMPROVEMENTS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_WONDERS" callback.
-****************************************************************************/
-static void help_wonders_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_WONDERS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_UNITS" callback.
-****************************************************************************/
-static void help_units_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  popup_help_dialog_string(HELP_UNITS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_COMBAT" callback.
-****************************************************************************/
-static void help_combat_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data)
-{
-  popup_help_dialog_string(HELP_COMBAT_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_ZOC" callback.
-****************************************************************************/
-static void help_zoc_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data)
-{
-  popup_help_dialog_string(HELP_ZOC_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_GOVERNMENT" callback.
-****************************************************************************/
-static void help_government_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  popup_help_dialog_string(HELP_GOVERNMENT_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_DIPLOMACY" callback.
-****************************************************************************/
-static void help_diplomacy_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  popup_help_dialog_string(HELP_DIPLOMACY_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_TECH" callback.
-****************************************************************************/
-static void help_tech_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  popup_help_dialog_string(HELP_TECHS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_SPACE_RACE" callback.
-****************************************************************************/
-static void help_space_race_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  popup_help_dialog_string(HELP_SPACE_RACE_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_RULESET" callback.
-****************************************************************************/
-static void help_ruleset_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_RULESET_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_TILESET" callback.
-****************************************************************************/
-static void help_tileset_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_TILESET_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_MUSICSET" callback.
-****************************************************************************/
-static void help_musicset_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_MUSICSET_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_NATIONS" callback.
-****************************************************************************/
-static void help_nations_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_NATIONS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_CONNECTING" callback.
-****************************************************************************/
-static void help_connecting_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  popup_help_dialog_string(HELP_CONNECTING_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_CONTROLS" callback.
-****************************************************************************/
-static void help_controls_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_CONTROLS_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_GOVERNOR" callback.
-****************************************************************************/
-static void help_governor_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_CMA_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_CHATLINE" callback.
-****************************************************************************/
-static void help_chatline_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_CHATLINE_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_WORKLIST_EDITOR" callback.
-****************************************************************************/
-static void help_worklist_editor_callback(GSimpleAction *action,
-                                          GVariant *parameter,
-                                          gpointer data)
-{
-  popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_LANGUAGE" callback.
-****************************************************************************/
-static void help_language_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  popup_help_dialog_string(HELP_LANGUAGES_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_COPYING" callback.
-****************************************************************************/
-static void help_copying_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_help_dialog_string(HELP_COPYING_ITEM);
-}
-
-/************************************************************************//**
-  Item "HELP_ABOUT" callback.
-****************************************************************************/
-static void help_about_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  popup_help_dialog_string(HELP_ABOUT_ITEM);
-}
-
-/************************************************************************//**
-  Item "EDIT_MODE" callback.
-****************************************************************************/
-static void edit_mode_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_editor_toggle();
-
-  /* Unreachable techs in reqtree on/off */
-  science_report_dialog_popdown();
-}
-
-struct menu_entry_option_map {
-  const char *menu_entry;
-  bool *option;
-  int menu_pos;
-};
-
-const struct menu_entry_option_map meoms[] = {
-  { "SAVE_OPTIONS_ON_EXIT", &gui_options.save_options_on_exit, -1 },
-  { "FULL_SCREEN", &(GUI_GTK_OPTION(fullscreen)), -1 },
-  { "EDIT_MODE", &game.info.is_edit_mode, -1 },
-  { "TOGGLE_FOG", &game.client.fog_of_war, -1 },
-  { "SHOW_CITY_OUTLINES", &gui_options.draw_city_outlines, VMENU_CITY_OUTLINES },
-  { "SHOW_CITY_OUTPUT", &gui_options.draw_city_output, VMENU_CITY_OUTPUT },
-  { "SHOW_MAP_GRID", &gui_options.draw_map_grid, VMENU_MAP_GRID },
-  { "SHOW_NAT_BORDERS", &gui_options.draw_borders, VMENU_NAT_BORDERS },
-  { "SHOW_NATIVE_TILES", &gui_options.draw_native, VMENU_NATIVE_TILES },
-  { "SHOW_CITY_FULL_BAR", &gui_options.draw_full_citybar, VMENU_CITY_FULL_BAR },
-  { "SHOW_CITY_NAMES", &gui_options.draw_city_names, VMENU_CITY_NAMES },
-  { "SHOW_CITY_GROWTH", &gui_options.draw_city_growth, VMENU_CITY_GROWTH },
-  { "SHOW_CITY_PRODUCTIONS", &gui_options.draw_city_productions,
-    VMENU_CITY_PRODUCTIONS },
-  { "SHOW_CITY_BUY_COST", &gui_options.draw_city_buycost, VMENU_CITY_BUY_COST },
-  { "SHOW_CITY_TRADE_ROUTES", &gui_options.draw_city_trade_routes,
-    VMENU_CITY_TRADE_ROUTES },
-  { "SHOW_TERRAIN", &gui_options.draw_terrain, VMENU_TERRAIN },
-  { "SHOW_COASTLINE", &gui_options.draw_coastline, VMENU_COASTLINE },
-  { "SHOW_PATHS", &gui_options.draw_paths, VMENU_PATHS },
-  { "SHOW_IRRIGATION", &gui_options.draw_irrigation, VMENU_IRRIGATION },
-  { "SHOW_MINES", &gui_options.draw_mines, VMENU_MINES },
-  { "SHOW_BASES", &gui_options.draw_fortress_airbase, VMENU_BASES },
-  { "SHOW_RESOURCES", &gui_options.draw_specials, VMENU_RESOURCES },
-  { "SHOW_HUTS", &gui_options.draw_huts, VMENU_HUTS },
-  { "SHOW_POLLUTION", &gui_options.draw_pollution, VMENU_POLLUTION },
-  { "SHOW_CITIES", &gui_options.draw_cities, VMENU_CITIES },
-  { "SHOW_UNITS", &gui_options.draw_units, VMENU_UNITS },
-  { "SHOW_UNIT_SOLID_BG", &gui_options.solid_color_behind_units, VMENU_UNIT_SOLID_BG },
-  { "SHOW_UNIT_SHIELDS", &gui_options.draw_unit_shields , VMENU_UNIT_SHIELDS },
-  { "SHOW_STACK_SIZE", &gui_options.draw_unit_stack_size, VMENU_STACK_SIZE },
-  { "SHOW_FOCUS_UNIT", &gui_options.draw_focus_unit, VMENU_FOCUS_UNIT },
-  { "SHOW_FOG_OF_WAR", &gui_options.draw_fog_of_war, VMENU_FOW },
-
-  { NULL, NULL, -1 }
-};
-
-/************************************************************************//**
-  Common handling of view menu entry toggles.
-****************************************************************************/
-static void view_menu_item_toggle(void (*cb)(void),
-                                  bool updt_sensitivity,
-                                  gpointer data)
-{
-  int i;
-  struct menu_entry_info *info = (struct menu_entry_info *)data;
-
-  info->state ^= 1;
-
-  cb();
-
-  if (updt_sensitivity) {
-    view_menu_update_sensitivity(G_ACTION_MAP(gui_app()));
-  }
-
-  /* TODO: Make the information available directly from menu_entry_info,
-   *       se we don't need to do this search for it */
-  for (i = 0; meoms[i].menu_entry != NULL; i++) {
-    if (!strcmp(meoms[i].menu_entry, info->key)) {
-      g_menu_remove(view_menu, meoms[i].menu_pos);
-      menu_item_insert_unref(view_menu, meoms[i].menu_pos,
-                             create_toggle_menu_item_for_key(info->key));
-      return;
-    }
-  }
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_OUTLINES" callback.
-****************************************************************************/
-static void show_city_outlines_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  view_menu_item_toggle(key_city_outlines_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_OUTPUT" callback.
-****************************************************************************/
-static void show_city_output_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  view_menu_item_toggle(key_city_output_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_MAP_GRID" callback.
-****************************************************************************/
-static void show_map_grid_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  view_menu_item_toggle(key_map_grid_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_NAT_BORDERS" callback.
-****************************************************************************/
-static void show_national_borders_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  view_menu_item_toggle(key_map_borders_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_NATIVE_TILES" callback.
-****************************************************************************/
-static void show_native_tiles_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  view_menu_item_toggle(key_map_native_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_FULL_BAR" callback.
-****************************************************************************/
-static void show_city_full_bar_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  view_menu_item_toggle(key_city_full_bar_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_NAMES" callback.
-****************************************************************************/
-static void show_city_names_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  view_menu_item_toggle(key_city_names_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_GROWTH" callback.
-****************************************************************************/
-static void show_city_growth_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  view_menu_item_toggle(key_city_growth_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_PRODUCTIONS" callback.
-****************************************************************************/
-static void show_city_productions_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  view_menu_item_toggle(key_city_productions_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_BUY_COST" callback.
-****************************************************************************/
-static void show_city_buy_cost_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  view_menu_item_toggle(key_city_buycost_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITY_TRADE_ROUTES" callback.
-****************************************************************************/
-static void show_city_trade_routes_callback(GSimpleAction *action,
-                                            GVariant *parameter,
-                                            gpointer data)
-{
-  view_menu_item_toggle(key_city_trade_routes_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_TERRAIN" callback.
-****************************************************************************/
-static void show_terrain_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  view_menu_item_toggle(key_terrain_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_COASTLINE" callback.
-****************************************************************************/
-static void show_coastline_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  view_menu_item_toggle(key_coastline_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_PATHS" callback.
-****************************************************************************/
-static void show_paths_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  view_menu_item_toggle(key_paths_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_IRRIGATION" callback.
-****************************************************************************/
-static void show_irrigation_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  view_menu_item_toggle(key_irrigation_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_MINES" callback.
-****************************************************************************/
-static void show_mines_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  view_menu_item_toggle(key_mines_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_BASES" callback.
-****************************************************************************/
-static void show_bases_callback(GSimpleAction *action, GVariant *parameter,
-                                gpointer data)
-{
-  view_menu_item_toggle(key_bases_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_RESOURCES" callback.
-****************************************************************************/
-static void show_resources_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  view_menu_item_toggle(key_resources_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_HUTS" callback.
-****************************************************************************/
-static void show_huts_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data)
-{
-  view_menu_item_toggle(key_huts_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_POLLUTION" callback.
-****************************************************************************/
-static void show_pollution_callback(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data)
-{
-  view_menu_item_toggle(key_pollution_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_CITIES" callback.
-****************************************************************************/
-static void show_cities_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  view_menu_item_toggle(key_cities_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_UNITS" callback.
-****************************************************************************/
-static void show_units_callback(GSimpleAction *action, GVariant *parameter,
-                                gpointer data)
-{
-  view_menu_item_toggle(key_units_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_UNIT_SOLID_BG" callback.
-****************************************************************************/
-static void show_unit_solid_bg_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  view_menu_item_toggle(key_unit_solid_bg_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_UNIT_SHIELDS" callback.
-****************************************************************************/
-static void show_unit_shields_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  view_menu_item_toggle(key_unit_shields_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_STACK_SIZE" callback.
-****************************************************************************/
-static void show_stack_size_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  view_menu_item_toggle(key_unit_stack_size_toggle, FALSE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_FOCUS_UNIT" callback.
-****************************************************************************/
-static void show_focus_unit_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  view_menu_item_toggle(key_focus_unit_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "SHOW_FOG_OF_WAR" callback.
-****************************************************************************/
-static void show_fog_of_war_callback(GSimpleAction *action, GVariant *parameter,
-                                     gpointer data)
-{
-  view_menu_item_toggle(key_fog_of_war_toggle, TRUE, data);
-}
-
-/************************************************************************//**
-  Item "FULL_SCREEN" callback.
-****************************************************************************/
-static void full_screen_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  struct menu_entry_info *info = (struct menu_entry_info *)data;
-
-  info->state ^= 1;
-  GUI_GTK_OPTION(fullscreen) = info->state;
-
-  fullscreen_opt_refresh(NULL);
-
-  g_menu_remove(view_menu, VMENU_FULL_SCREEN);
-
-  menu_item_insert_unref(view_menu, VMENU_FULL_SCREEN,
-                         create_toggle_menu_item(info));
-}
-
-/************************************************************************//**
-  Item "TOGGLE_FOG" callback.
-****************************************************************************/
-static void toggle_fog_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  struct menu_entry_info *info = (struct menu_entry_info *)data;
-
-  info->state ^= 1;
-
-  key_editor_toggle_fogofwar();
-
-  g_menu_remove(edit_menu, 5);
-
-  menu_item_insert_unref(edit_menu, 5,
-                         create_toggle_menu_item(info));
-}
-
-/************************************************************************//**
-  Item "SCENARIO_PROPERTIES" callback.
-****************************************************************************/
-static void scenario_properties_callback(GSimpleAction *action,
-                                         GVariant *parameter,
-                                         gpointer data)
-{
-  struct property_editor *pe;
-
-  pe = editprop_get_property_editor();
-  property_editor_reload(pe, OBJTYPE_GAME);
-  property_editor_popup(pe, OBJTYPE_GAME);
-}
-
-/************************************************************************//**
-  Item "SAVE_SCENARIO" callback.
-****************************************************************************/
-static void save_scenario_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  save_scenario_dialog_popup();
-}
-
-/************************************************************************//**
-  Item "SELECT_SINGLE" callback.
-****************************************************************************/
-static void select_single_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  request_unit_select(get_units_in_focus(), SELTYPE_SINGLE, SELLOC_TILE);
-}
-
-/************************************************************************//**
-  Item "SELECT_ALL_ON_TILE" callback.
-****************************************************************************/
-static void select_all_on_tile_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  request_unit_select(get_units_in_focus(), SELTYPE_ALL, SELLOC_TILE);
-}
-
-/************************************************************************//**
-  Item "SELECT_SAME_TYPE_TILE" callback.
-****************************************************************************/
-static void select_same_type_tile_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_TILE);
-}
-
-/************************************************************************//**
-  Item "SELECT_SAME_TYPE_CONT" callback.
-****************************************************************************/
-static void select_same_type_cont_callback(GSimpleAction *action,
-                                           GVariant *parameter,
-                                           gpointer data)
-{
-  request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_CONT);
-}
-
-/************************************************************************//**
-  Item "SELECT_SAME_TYPE" callback.
-****************************************************************************/
-static void select_same_type_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  request_unit_select(get_units_in_focus(), SELTYPE_SAME, SELLOC_WORLD);
-}
-
-/************************************************************************//**
-  Open unit selection dialog.
-****************************************************************************/
-static void select_dialog_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  unit_select_dialog_popup(NULL);
-}
-
-/************************************************************************//**
-  Open rally point dialog.
-****************************************************************************/
-static void rally_dialog_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  rally_dialog_popup();
-}
-
-/************************************************************************//**
-  Open infra placement dialog.
-****************************************************************************/
-static void infra_dialog_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  infra_dialog_popup();
-}
-
-/************************************************************************//**
-  Item "UNIT_WAIT" callback.
-****************************************************************************/
-static void unit_wait_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_wait();
-}
-
-/************************************************************************//**
-  Item "UNIT_DONE" callback.
-****************************************************************************/
-static void unit_done_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_done();
-}
-
-/************************************************************************//**
-  Item "UNIT_GOTO" callback.
-****************************************************************************/
-static void unit_goto_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_goto();
-}
-
-/************************************************************************//**
-  Activate the goto system with an action to perform once there.
-****************************************************************************/
-static void unit_goto_and_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  int sub_target = NO_TARGET;
-  struct action *paction = (struct action *)data;
-
-  fc_assert_ret(paction != NULL);
-
-  switch (action_get_sub_target_kind(paction)) {
-  case ASTK_BUILDING:
-    {
-      struct impr_type *pbuilding = g_object_get_data(G_OBJECT(action),
-                                                      "end_building");
-      fc_assert_ret(pbuilding != NULL);
-      sub_target = improvement_number(pbuilding);
-    }
-    break;
-  case ASTK_TECH:
-    {
-      struct advance *ptech = g_object_get_data(G_OBJECT(action),
-                                                "end_tech");
-      fc_assert_ret(ptech != NULL);
-      sub_target = advance_number(ptech);
-    }
-    break;
-  case ASTK_EXTRA:
-  case ASTK_EXTRA_NOT_THERE:
-    {
-      struct extra_type *pextra = g_object_get_data(G_OBJECT(action),
-                                                    "end_extra");
-      fc_assert_ret(pextra != NULL);
-      sub_target = extra_number(pextra);
-    }
-    break;
-  case ASTK_NONE:
-    sub_target = NO_TARGET;
-    break;
-  case ASTK_COUNT:
-    /* Should not exits */
-    fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
-    break;
-  }
-
-  request_unit_goto(ORDER_PERFORM_ACTION, paction->id, sub_target);
-}
-
-/************************************************************************//**
-  Item "UNIT_GOTO_CITY" callback.
-****************************************************************************/
-static void unit_goto_city_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  if (get_num_units_in_focus() > 0) {
-    popup_goto_dialog();
-  }
-}
-
-/************************************************************************//**
-  Item "UNIT_RETURN" callback.
-****************************************************************************/
-static void unit_return_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_unit_return(punit);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Item "UNIT_EXPLORE" callback.
-****************************************************************************/
-static void unit_explore_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  key_unit_auto_explore();
-}
-
-/************************************************************************//**
-  Item "UNIT_PATROL" callback.
-****************************************************************************/
-static void unit_patrol_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data)
-{
-  key_unit_patrol();
-}
-
-/************************************************************************//**
-  Item "UNIT_TELEPORT" callback.
-****************************************************************************/
-static void unit_teleport_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  key_unit_teleport();
-}
-
-/************************************************************************//**
-  Item "UNIT_SENTRY" callback.
-****************************************************************************/
-static void unit_sentry_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data)
-{
-  key_unit_sentry();
-}
-
-/************************************************************************//**
-  Item "UNSENTRY_ALL" callback.
-****************************************************************************/
-static void unsentry_all_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  key_unit_wakeup_others();
-}
-
-/************************************************************************//**
-  Action "FORTIFY" callback.
-****************************************************************************/
-static void fortify_callback(GSimpleAction *action,
-                             GVariant *parameter,
-                             gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_unit_fortify(punit);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Item "UNIT_BOARD" callback.
-****************************************************************************/
-static void unit_board_callback(GSimpleAction *action, GVariant *parameter,
-                                gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_transport(punit, unit_tile(punit));
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Item "UNIT_DEBOARD" callback.
-****************************************************************************/
-static void unit_deboard_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_unit_unload(punit);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Item "UNIT_UNLOAD_TRANSPORTER" callback.
-****************************************************************************/
-static void unit_unload_transporter_callback(GSimpleAction *action,
-                                             GVariant *parameter,
-                                             gpointer data)
-{
-  key_unit_unload_all();
-}
-
-/************************************************************************//**
-  Item "UNIT_HOMECITY" callback.
-****************************************************************************/
-static void unit_homecity_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-{
-  key_unit_homecity();
-}
-
-/************************************************************************//**
-  Item "UNIT_UPGRADE" callback.
-****************************************************************************/
-static void unit_upgrade_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_upgrade_dialog(get_units_in_focus());
-}
-
-/************************************************************************//**
-  Item "UNIT_CONVERT" callback.
-****************************************************************************/
-static void unit_convert_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  key_unit_convert();
-}
-
-/************************************************************************//**
-  Item "UNIT_DISBAND" callback.
-****************************************************************************/
-static void unit_disband_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  popup_disband_dialog(get_units_in_focus());
-}
-
-/************************************************************************//**
-  Item "BUILD_CITY" callback.
-****************************************************************************/
-static void build_city_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    /* FIXME: this can provide different items for different units...
-     * not good! */
-    /* Enable the button for adding to a city in all cases, so we
-       get an eventual error message from the server if we try. */
-    if (unit_can_add_or_build_city(&(wld.map), punit)) {
-      request_unit_build_city(punit);
-    } else if (utype_can_do_action(unit_type_get(punit),
-                                   ACTION_HELP_WONDER)) {
-      request_unit_caravan_action(punit, ACTION_HELP_WONDER);
-    }
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Action "AUTO_WORK" callback.
-****************************************************************************/
-static void auto_work_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_auto_work();
-}
-
-/************************************************************************//**
-  Action "BUILD_ROAD" callback.
-****************************************************************************/
-static void build_road_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  unit_list_iterate(get_units_in_focus(), punit) {
-    /* FIXME: this can provide different actions for different units...
-     * not good! */
-    struct extra_type *tgt = next_extra_for_tile(unit_tile(punit),
-                                                 EC_ROAD,
-                                                 unit_owner(punit),
-                                                 punit);
-    bool building_road = FALSE;
-
-    if (tgt != NULL
-        && can_unit_do_activity_targeted_client(punit, ACTIVITY_GEN_ROAD, tgt)) {
-      request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, tgt);
-      building_road = TRUE;
-    }
-
-    if (!building_road && unit_can_est_trade_route_here(punit)) {
-      request_unit_caravan_action(punit, ACTION_TRADE_ROUTE);
-    }
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Action "BUILD_IRRIGATION" callback.
-****************************************************************************/
-static void build_irrigation_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  key_unit_irrigate();
-}
-
-/************************************************************************//**
-  Action "CULTIVATE" callback.
-****************************************************************************/
-static void cultivate_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_cultivate();
-}
-
-/************************************************************************//**
-  Action "PLANT" callback.
-****************************************************************************/
-static void plant_callback(GSimpleAction *action,
-                           GVariant *parameter,
-                           gpointer data)
-{
-  key_unit_plant();
-}
-
-/************************************************************************//**
-  Action "BUILD_MINE" callback.
-****************************************************************************/
-static void build_mine_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  key_unit_mine();
-}
-
-/************************************************************************//**
-  Action "CONNECT_ROAD" callback.
-****************************************************************************/
-static void connect_road_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  struct road_type *proad = road_by_gui_type(ROAD_GUI_ROAD);
-
-  if (proad != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(proad);
-
-    key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
-  }
-}
-
-/************************************************************************//**
-  Action "CONNECT_RAIL" callback.
-****************************************************************************/
-static void connect_rail_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  struct road_type *prail = road_by_gui_type(ROAD_GUI_RAILROAD);
-
-  if (prail != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(prail);
-
-    key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
-  }
-}
-
-/************************************************************************//**
-  Action "CONNECT_MAGLEV" callback.
-****************************************************************************/
-static void connect_maglev_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  struct road_type *pmaglev = road_by_gui_type(ROAD_GUI_MAGLEV);
-
-  if (pmaglev != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(pmaglev);
-
-    key_unit_connect(ACTIVITY_GEN_ROAD, tgt);
-  }
-}
-
-/************************************************************************//**
-  Action "CONNECT_IRRIGATION" callback.
-****************************************************************************/
-static void connect_irrigation_callback(GSimpleAction *action,
-                                        GVariant *parameter,
-                                        gpointer data)
-{
-  struct extra_type_list *extras = extra_type_list_by_cause(EC_IRRIGATION);
-
-  if (extra_type_list_size(extras) > 0) {
-    struct extra_type *pextra;
-
-    pextra = extra_type_list_get(extra_type_list_by_cause(EC_IRRIGATION), 0);
-
-    key_unit_connect(ACTIVITY_IRRIGATE, pextra);
-  }
-}
-
-/************************************************************************//**
-  Action "TRANSFORM_TERRAIN" callback.
-****************************************************************************/
-static void transform_terrain_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  key_unit_transform();
-}
-
-/************************************************************************//**
-  Action "CLEAN" callback.
-****************************************************************************/
-static void clean_callback(GSimpleAction *action, GVariant *parameter,
-                           gpointer data)
-{
-  key_unit_clean();
-}
-
-/************************************************************************//**
-  Action "BUILD_FORTRESS" callback.
-****************************************************************************/
-static void build_fortress_callback(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data)
-{
-  key_unit_fortress();
-}
-
-/************************************************************************//**
-  Action "BUILD_AIRBASE" callback.
-****************************************************************************/
-static void build_airbase_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  key_unit_airbase();
-}
-
-/************************************************************************//**
-  Action "PARADROP" callback.
-****************************************************************************/
-static void paradrop_callback(GSimpleAction *action,
-                              GVariant *parameter,
-                              gpointer data)
-{
-  key_unit_paradrop();
-}
-
-/************************************************************************//**
-  Action "PILLAGE" callback.
-****************************************************************************/
-static void pillage_callback(GSimpleAction *action,
-                             GVariant *parameter,
-                             gpointer data)
-{
-  key_unit_pillage();
-}
-
-/************************************************************************//**
-  Action "DO_ACTION" callback.
-****************************************************************************/
-static void do_action_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_action_select_tgt();
-}
-
-/************************************************************************//**
-  Action "TAX_RATES" callback.
-****************************************************************************/
-static void tax_rate_callback(GSimpleAction *action, GVariant *parameter,
-                              gpointer data)
-{
-  popup_rates_dialog();
-}
-
-/************************************************************************//**
-  Action "MULTIPLIERS" callback.
-****************************************************************************/
-static void multiplier_callback(GSimpleAction *action, GVariant *parameter,
-                                gpointer data)
-{
-  popup_multiplier_dialog();
-}
-
-/************************************************************************//**
-  The player has chosen a government from the menu.
-****************************************************************************/
-static void government_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  popup_revolution_dialog((struct government *) data);
-}
-
-/************************************************************************//**
-  The player has chosen targetless revolution from the menu.
-****************************************************************************/
-static void revolution_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  popup_revolution_dialog(NULL);
-}
-
-/************************************************************************//**
-  The player has chosen a base to build from the menu.
-****************************************************************************/
-static void base_callback(GSimpleAction *action,
-                          GVariant *parameter,
-                          gpointer data)
-{
-  struct extra_type *pextra = data;
-
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_new_unit_activity_targeted(punit, ACTIVITY_BASE, pextra);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  The player has chosen a road to build from the menu.
-****************************************************************************/
-static void road_callback(GSimpleAction *action,
-                          GVariant *parameter,
-                          gpointer data)
-{
-  struct extra_type *pextra = data;
-
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_new_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD,
-                                       pextra);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  The player has chosen an irrigation to build from the menu.
-****************************************************************************/
-static void irrigation_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  struct extra_type *pextra = data;
-
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_new_unit_activity_targeted(punit, ACTIVITY_IRRIGATE,
-                                       pextra);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  The player has chosen a mine to build from the menu.
-****************************************************************************/
-static void mine_callback(GSimpleAction *action,
-                          GVariant *parameter,
-                          gpointer data)
-{
-  struct extra_type *pextra = data;
-
-  unit_list_iterate(get_units_in_focus(), punit) {
-    request_new_unit_activity_targeted(punit, ACTIVITY_MINE,
-                                       pextra);
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  The player has chosen an extra to clean from the menu.
-****************************************************************************/
-static void clean_menu_callback(GSimpleAction *action,
-                                GVariant *parameter,
-                                gpointer data)
-{
-  struct extra_type *pextra = data;
-
-  unit_list_iterate(get_units_in_focus(), punit) {
-    if (can_unit_do_activity_targeted_client(punit, ACTIVITY_CLEAN, pextra)) {
-      request_new_unit_activity_targeted(punit, ACTIVITY_CLEAN,
-                                         pextra);
-    }
-  } unit_list_iterate_end;
-}
-
-/************************************************************************//**
-  Action "CENTER_VIEW" callback.
-****************************************************************************/
-static void center_view_callback(GSimpleAction *action,
-                                 GVariant *parameter,
-                                 gpointer data)
-{
-  center_on_unit();
-}
-
-/************************************************************************//**
-  Action "REPORT_UNITS" callback.
-****************************************************************************/
-static void report_units_callback(GSimpleAction *action,
-                                  GVariant *parameter,
-                                  gpointer data)
-{
-  units_report_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Action "REPORT_CITIES" callback.
-****************************************************************************/
-static void report_cities_callback(GSimpleAction *action,
-                                   GVariant *parameter,
-                                   gpointer data)
-
-{
-  city_report_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Action "REPORT_ECONOMY" callback.
-****************************************************************************/
-static void report_economy_callback(GSimpleAction *action,
-                                    GVariant *parameter,
-                                    gpointer data)
-{
-  economy_report_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Action "REPORT_RESEARCH" callback.
-****************************************************************************/
-static void report_research_callback(GSimpleAction *action,
-                                     GVariant *parameter,
-                                     gpointer data)
-{
-  science_report_dialog_popup(TRUE);
-}
-
-/************************************************************************//**
-  Action "REPORT_SPACESHIP" callback.
-****************************************************************************/
-static void report_spaceship_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  if (NULL != client.conn.playing) {
-    popup_spaceship_dialog(client.conn.playing);
-  }
-}
-
-/************************************************************************//**
-  Select battle group
-****************************************************************************/
-static void bg_select_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_select_battlegroup(GPOINTER_TO_INT(data), FALSE);
-}
-
-/************************************************************************//**
-  Assign units to battle group
-****************************************************************************/
-static void bg_assign_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_assign_battlegroup(GPOINTER_TO_INT(data), FALSE);
-}
-
-/************************************************************************//**
-  Append units to battle group
-****************************************************************************/
-static void bg_append_callback(GSimpleAction *action,
-                               GVariant *parameter,
-                               gpointer data)
-{
-  key_unit_assign_battlegroup(GPOINTER_TO_INT(data), TRUE);
-}
-
-/************************************************************************//**
-  Create toggle menu entry by info.
-  Caller need to g_object_unref() returned item.
-****************************************************************************/
-static GMenuItem *create_toggle_menu_item(struct menu_entry_info *info)
-{
-  char actname[150];
-  GMenuItem *item;
-
-  fc_snprintf(actname, sizeof(actname), "app.%s(%s)",
-              info->action, info->state ? "true" : "false");
-  item = g_menu_item_new(Q_(info->name), NULL);
-  g_menu_item_set_detailed_action(item, actname);
-
-  if (info->accl != NULL) {
-    const char *accls[2] = { info->accl, NULL };
-
-    gtk_application_set_accels_for_action(gui_app(), actname, accls);
-  }
-
-  return item;
-}
-
-/************************************************************************//**
-  Create toggle menu entry by key
-  Caller need to g_object_unref() returned item.
-****************************************************************************/
-static GMenuItem *create_toggle_menu_item_for_key(const char *key)
-{
-  return create_toggle_menu_item(menu_entry_info_find(key));
-}
-
-/************************************************************************//**
-  Set name of the menu item.
-****************************************************************************/
-static void menu_entry_init(GMenu *sub, const char *key)
-{
-  struct menu_entry_info *info = menu_entry_info_find(key);
-
-  if (info != NULL) {
-    GMenuItem *item;
-
-    if (info->toggle != NULL) {
-      item = create_toggle_menu_item(info);
-    } else {
-      char actname[150];
-
-      fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
-      item = g_menu_item_new(Q_(info->name), actname);
-    }
-
-    /* Should be menu_item_append_unref()? */
-    g_menu_append_item(sub, item);
-    g_object_unref(item);
-  }
-}
-
-/************************************************************************//**
-  Registers menu actions for the application.
-****************************************************************************/
-void menus_set_initial_toggle_values(void)
-{
-  int i;
-
-  for (i = 0; meoms[i].menu_entry != NULL; i++) {
-    struct menu_entry_info *info = menu_entry_info_find(meoms[i].menu_entry);
-
-    if (meoms[i].option != NULL) {
-      info->state = *meoms[i].option;
-    } else {
-      info->state = FALSE; /* Best guess we have */
-    }
-  }
-}
-
-/************************************************************************//**
-  Registers menu actions for the application.
-****************************************************************************/
-static void setup_app_actions(GApplication *fc_app)
-{
-  int i;
-  GVariantType *bvart = g_variant_type_new("b");
-
-  /* Simple entries */
-  g_action_map_add_action_entries(G_ACTION_MAP(fc_app), acts,
-                                  G_N_ELEMENTS(acts), fc_app);
-
-  /* Toggles */
-  for (i = 0; menu_entries[i].key != NULL; i++) {
-    if (menu_entries[i].toggle != NULL) {
-      GSimpleAction *act;
-      GVariant *var = g_variant_new("b", TRUE);
-
-      act = g_simple_action_new_stateful(menu_entries[i].action, bvart, var);
-      g_action_map_add_action(G_ACTION_MAP(fc_app), G_ACTION(act));
-      g_signal_connect(act, "change-state",
-                       G_CALLBACK(menu_entries[i].toggle),
-                       (gpointer)&(menu_entries[i]));
-    }
-  }
-
-  g_variant_type_free(bvart);
-
-  for (i = 0; menu_entries[i].key != NULL; i++) {
-    if (menu_entries[i].accl != NULL && menu_entries[i].toggle == NULL) {
-      const char *accls[2] = { menu_entries[i].accl, NULL };
-      char actname[150];
-
-      fc_snprintf(actname, sizeof(actname), "app.%s", menu_entries[i].action);
-
-      gtk_application_set_accels_for_action(GTK_APPLICATION(fc_app), actname, accls);
-    }
-  }
-}
-
-/************************************************************************//**
-  Registers menu actions for Battle Groups actions
-****************************************************************************/
-static void register_bg_actions(GActionMap *map, int bg)
-{
-  GSimpleAction *act;
-  char actname[256];
-
-  fc_snprintf(actname, sizeof(actname), "bg_select_%d", bg);
-  act = g_simple_action_new(actname, NULL);
-  g_action_map_add_action(map, G_ACTION(act));
-  g_signal_connect(act, "activate",
-                   G_CALLBACK(bg_select_callback), GINT_TO_POINTER(bg));
-
-  fc_snprintf(actname, sizeof(actname), "bg_assign_%d", bg);
-  act = g_simple_action_new(actname, NULL);
-  g_action_map_add_action(map, G_ACTION(act));
-  g_signal_connect(act, "activate",
-                   G_CALLBACK(bg_assign_callback), GINT_TO_POINTER(bg));
-
-  fc_snprintf(actname, sizeof(actname), "bg_append_%d", bg);
-  act = g_simple_action_new(actname, NULL);
-  g_action_map_add_action(map, G_ACTION(act));
-  g_signal_connect(act, "activate",
-                   G_CALLBACK(bg_append_callback), GINT_TO_POINTER(bg));
-}
-
-/************************************************************************//**
-  Creates the menu bar.
-****************************************************************************/
-static GMenu *setup_menus(GtkApplication *app)
-{
-  GMenu *menubar;
-  GMenu *topmenu;
-  GMenu *submenu;
-  int i;
-
-  fc_assert(!menus_built);
-
-  menubar = g_menu_new();
-
-  topmenu = g_menu_new();
-  menu_entry_init(topmenu, "CLEAR_CHAT_LOGS");
-  menu_entry_init(topmenu, "SAVE_CHAT_LOGS");
-
-  options_menu = g_menu_new();
-  menu_entry_init(options_menu, "LOCAL_OPTIONS");
-  menu_entry_init(options_menu, "MESSAGE_OPTIONS");
-  menu_entry_init(options_menu, "SERVER_OPTIONS");
-  menu_entry_init(options_menu, "SAVE_OPTIONS");
-  menu_entry_init(options_menu, "SAVE_OPTIONS_ON_EXIT");
-
-  submenu_append_unref(topmenu, _("_Options"), G_MENU_MODEL(options_menu));
-
-#ifdef FREECIV_DEBUG
-  menu_entry_init(topmenu, "RELOAD_TILESET");
-#endif /* FREECIV_DEBUG */
-
-  menu_entry_init(topmenu, "GAME_SAVE");
-  menu_entry_init(topmenu, "GAME_SAVE_AS");
-  menu_entry_init(topmenu, "MAPIMG_SAVE");
-  menu_entry_init(topmenu, "MAPIMG_SAVE_AS");
-  menu_entry_init(topmenu, "LEAVE");
-  menu_entry_init(topmenu, "QUIT");
-
-  submenu_append_unref(menubar, _("_Game"), G_MENU_MODEL(topmenu));
-
-  edit_menu = g_menu_new();
-
-  menu_entry_init(edit_menu, "FIND_CITY");
-  menu_entry_init(edit_menu, "WORKLISTS");
-  menu_entry_init(edit_menu, "RALLY_DLG");
-  menu_entry_init(edit_menu, "INFRA_DLG");
-  menu_entry_init(edit_menu, "EDIT_MODE");
-  menu_entry_init(edit_menu, "TOGGLE_FOG");
-  menu_entry_init(edit_menu, "SCENARIO_PROPERTIES");
-  menu_entry_init(edit_menu, "SCENARIO_SAVE");
-  menu_entry_init(edit_menu, "CLIENT_LUA_SCRIPT");
-
-  submenu_append_unref(menubar, _("_Edit"), G_MENU_MODEL(edit_menu));
-
-  view_menu = g_menu_new();
-
-  menu_entry_init(view_menu, "SHOW_CITY_OUTLINES");
-  menu_entry_init(view_menu, "SHOW_CITY_OUTPUT");
-  menu_entry_init(view_menu, "SHOW_MAP_GRID");
-  menu_entry_init(view_menu, "SHOW_NAT_BORDERS");
-  menu_entry_init(view_menu, "SHOW_NATIVE_TILES");
-  menu_entry_init(view_menu, "SHOW_CITY_FULL_BAR");
-  menu_entry_init(view_menu, "SHOW_CITY_NAMES");
-  menu_entry_init(view_menu, "SHOW_CITY_GROWTH");
-  menu_entry_init(view_menu, "SHOW_CITY_PRODUCTIONS");
-  menu_entry_init(view_menu, "SHOW_CITY_BUY_COST");
-  menu_entry_init(view_menu, "SHOW_CITY_TRADE_ROUTES");
-  menu_entry_init(view_menu, "SHOW_TERRAIN");
-  menu_entry_init(view_menu, "SHOW_COASTLINE");
-  menu_entry_init(view_menu, "SHOW_PATHS");
-  menu_entry_init(view_menu, "SHOW_IRRIGATION");
-  menu_entry_init(view_menu, "SHOW_MINES");
-  menu_entry_init(view_menu, "SHOW_BASES");
-  menu_entry_init(view_menu, "SHOW_RESOURCES");
-  menu_entry_init(view_menu, "SHOW_HUTS");
-  menu_entry_init(view_menu, "SHOW_POLLUTION");
-  menu_entry_init(view_menu, "SHOW_CITIES");
-  menu_entry_init(view_menu, "SHOW_UNITS");
-  menu_entry_init(view_menu, "SHOW_UNIT_SOLID_BG");
-  menu_entry_init(view_menu, "SHOW_UNIT_SHIELDS");
-  menu_entry_init(view_menu, "SHOW_STACK_SIZE");
-  menu_entry_init(view_menu, "SHOW_FOCUS_UNIT");
-
-  menu_entry_init(view_menu, "SHOW_FOG_OF_WAR");
-
-  menu_entry_init(view_menu, "FULL_SCREEN");
-  menu_entry_init(view_menu, "CENTER_VIEW");
-
-  submenu_append_unref(menubar, Q_("?verb:_View"), G_MENU_MODEL(view_menu));
-
-  topmenu = g_menu_new();
-
-  menu_entry_init(topmenu, "SELECT_SINGLE");
-  menu_entry_init(topmenu, "SELECT_ALL_ON_TILE");
-  menu_entry_init(topmenu, "SELECT_SAME_TYPE_TILE");
-  menu_entry_init(topmenu, "SELECT_SAME_TYPE_CONT");
-  menu_entry_init(topmenu, "SELECT_SAME_TYPE");
-  menu_entry_init(topmenu, "SELECT_DLG");
-
-  submenu_append_unref(menubar, _("_Select"), G_MENU_MODEL(topmenu));
-
-  unit_menu = g_menu_new();
-
-  menu_entry_init(unit_menu, "UNIT_GOTO");
-
-  /* Placeholder submenu (so that menu update has something to replace) */
-  submenu = g_menu_new();
-  submenu_append_unref(unit_menu, N_("Go to a_nd..."), G_MENU_MODEL(submenu));
-
-  menu_entry_init(unit_menu, "UNIT_GOTO_CITY");
-  menu_entry_init(unit_menu, "UNIT_RETURN");
-  menu_entry_init(unit_menu, "UNIT_EXPLORE");
-  menu_entry_init(unit_menu, "UNIT_PATROL");
-  menu_entry_init(unit_menu, "UNIT_TELEPORT");
-  menu_entry_init(unit_menu, "UNIT_SENTRY");
-  menu_entry_init(unit_menu, "UNSENTRY_ALL");
-  menu_entry_init(unit_menu, "UNIT_BOARD");
-  menu_entry_init(unit_menu, "UNIT_DEBOARD");
-  menu_entry_init(unit_menu, "UNIT_UNLOAD_TRANSPORTER");
-  menu_entry_init(unit_menu, "UNIT_HOMECITY");
-  menu_entry_init(unit_menu, "UNIT_UPGRADE");
-  menu_entry_init(unit_menu, "UNIT_CONVERT");
-  menu_entry_init(unit_menu, "UNIT_DISBAND");
-  menu_entry_init(unit_menu, "DO_ACTION");
-  menu_entry_init(unit_menu, "UNIT_WAIT");
-  menu_entry_init(unit_menu, "UNIT_DONE");
-
-  submenu_append_unref(menubar, _("_Unit"), G_MENU_MODEL(unit_menu));
-
-  work_menu = g_menu_new();
-  menu_entry_init(work_menu, "BUILD_CITY");
-  menu_entry_init(work_menu, "AUTO_WORKER");
-
-  /* Placeholder submenus (so that menu update has something to replace) */
-  submenu = g_menu_new();
-  submenu_append_unref(work_menu, _("Build _Path"), G_MENU_MODEL(submenu));
-  submenu = g_menu_new();
-  submenu_append_unref(work_menu, _("Build _Irrigation"), G_MENU_MODEL(submenu));
-  submenu = g_menu_new();
-  submenu_append_unref(work_menu, _("Build _Mine"), G_MENU_MODEL(submenu));
-  submenu = g_menu_new();
-  submenu_append_unref(work_menu, _("_Clean Nuisance"), G_MENU_MODEL(submenu));
-
-  menu_entry_init(work_menu, "BUILD_ROAD");
-  menu_entry_init(work_menu, "BUILD_IRRIGATION");
-  menu_entry_init(work_menu, "BUILD_MINE");
-  menu_entry_init(work_menu, "CULTIVATE");
-  menu_entry_init(work_menu, "PLANT");
-  menu_entry_init(work_menu, "TRANSFORM_TERRAIN");
-  menu_entry_init(work_menu, "CONNECT_ROAD");
-  menu_entry_init(work_menu, "CONNECT_RAIL");
-  menu_entry_init(work_menu, "CONNECT_MAGLEV");
-  menu_entry_init(work_menu, "CONNECT_IRRIGATION");
-  menu_entry_init(work_menu, "CLEAN");
-
-  submenu_append_unref(menubar, _("_Work"), G_MENU_MODEL(work_menu));
-
-  combat_menu = g_menu_new();
-  menu_entry_init(combat_menu, "FORTIFY");
-  menu_entry_init(combat_menu, "BUILD_FORTRESS");
-  menu_entry_init(combat_menu, "BUILD_AIRBASE");
-
-  /* Placeholder submenu (so that menu update has something to replace) */
-  submenu = g_menu_new();
-  submenu_append_unref(combat_menu, _("Build _Base"), G_MENU_MODEL(submenu));
-
-  submenu_append_unref(menubar, _("_Combat"), G_MENU_MODEL(combat_menu));
-
-  menu_entry_init(combat_menu, "PARADROP");
-  menu_entry_init(combat_menu, "PILLAGE");
-
-  gov_menu = g_menu_new();
-
-  menu_entry_init(gov_menu, "MAP_VIEW");
-  menu_entry_init(gov_menu, "REPORT_UNITS");
-  menu_entry_init(gov_menu, "REPORT_NATIONS");
-  menu_entry_init(gov_menu, "REPORT_CITIES");
-  menu_entry_init(gov_menu, "REPORT_ECONOMY");
-  menu_entry_init(gov_menu, "REPORT_RESEARCH");
-  menu_entry_init(gov_menu, "TAX_RATES");
-  menu_entry_init(gov_menu, "POLICIES");
-
-  /* Placeholder submenu (so that menu update has something to replace) */
-  submenu = g_menu_new();
-  submenu_append_unref(gov_menu, _("_Government"), G_MENU_MODEL(submenu));
-
-  menu_entry_init(gov_menu, "REPORT_WOW");
-  menu_entry_init(gov_menu, "REPORT_TOP_CITIES");
-  menu_entry_init(gov_menu, "REPORT_MESSAGES");
-  menu_entry_init(gov_menu, "REPORT_DEMOGRAPHIC");
-  menu_entry_init(gov_menu, "REPORT_SPACESHIP");
-  menu_entry_init(gov_menu, "REPORT_ACHIEVEMENTS");
-
-  submenu_append_unref(menubar, _("C_ivilization"), G_MENU_MODEL(gov_menu));
-
-  topmenu = g_menu_new();
-
-  /* Keys exist for 4 battle groups */
-  FC_STATIC_ASSERT(MAX_NUM_BATTLEGROUPS == 4, incompatible_bg_count);
-
-  for (i = 0; i < MAX_NUM_BATTLEGROUPS; i++) {
-    char key[128];
-
-    /* User side battle group numbers start from 1 */
-    fc_snprintf(key, sizeof(key), "BG_SELECT_%d", i + 1);
-    menu_entry_init(topmenu, key);
-    fc_snprintf(key, sizeof(key), "BG_ASSIGN_%d", i + 1);
-    menu_entry_init(topmenu, key);
-    fc_snprintf(key, sizeof(key), "BG_APPEND_%d", i + 1);
-    menu_entry_init(topmenu, key);
-
-    register_bg_actions(G_ACTION_MAP(app), i);
-  }
-
-  submenu_append_unref(menubar, _("_Battle Groups"), G_MENU_MODEL(topmenu));
-
-  topmenu = g_menu_new();
-
-  menu_entry_init(topmenu, "HELP_OVERVIEW");
-  menu_entry_init(topmenu, "HELP_PLAYING");
-  menu_entry_init(topmenu, "HELP_POLICIES");
-  menu_entry_init(topmenu, "HELP_TERRAIN");
-  menu_entry_init(topmenu, "HELP_ECONOMY");
-  menu_entry_init(topmenu, "HELP_CITIES");
-  menu_entry_init(topmenu, "HELP_IMPROVEMENTS");
-  menu_entry_init(topmenu, "HELP_WONDERS");
-  menu_entry_init(topmenu, "HELP_UNITS");
-  menu_entry_init(topmenu, "HELP_COMBAT");
-  menu_entry_init(topmenu, "HELP_ZOC");
-  menu_entry_init(topmenu, "HELP_GOVERNMENT");
-  menu_entry_init(topmenu, "HELP_DIPLOMACY");
-  menu_entry_init(topmenu, "HELP_TECH");
-  menu_entry_init(topmenu, "HELP_SPACE_RACE");
-  menu_entry_init(topmenu, "HELP_RULESET");
-  menu_entry_init(topmenu, "HELP_TILESET");
-  menu_entry_init(topmenu, "HELP_MUSICSET");
-  menu_entry_init(topmenu, "HELP_NATIONS");
-  menu_entry_init(topmenu, "HELP_CONNECTING");
-  menu_entry_init(topmenu, "HELP_CONTROLS");
-  menu_entry_init(topmenu, "HELP_GOVERNOR");
-  menu_entry_init(topmenu, "HELP_CHATLINE");
-  menu_entry_init(topmenu, "HELP_WORKLIST_EDITOR");
-  menu_entry_init(topmenu, "HELP_LANGUAGES");
-  menu_entry_init(topmenu, "HELP_COPYING");
-  menu_entry_init(topmenu, "HELP_ABOUT");
-
-  submenu_append_unref(menubar, _("_Help"), G_MENU_MODEL(topmenu));
-
-  menus_built = TRUE;
-
-  real_menus_update();
-
-  return menubar;
-}
-
-/************************************************************************//**
-  Find menu entry construction data
-****************************************************************************/
-static struct menu_entry_info *menu_entry_info_find(const char *key)
-{
-  int i;
-
-  for (i = 0; menu_entries[i].key != NULL; i++) {
-    if (!strcmp(key, menu_entries[i].key)) {
-      return &(menu_entries[i]);
-    }
-  }
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Sets sensitivity of an menu entry, found by info.
-****************************************************************************/
-static void menu_entry_set_sensitive_info(GActionMap *map,
-                                          struct menu_entry_info *info,
-                                          gboolean is_enabled)
-{
-  GAction *act = g_action_map_lookup_action(map, info->action);
-
-  if (act != NULL) {
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act), is_enabled);
-  }
-}
-
-/************************************************************************//**
-  Sets sensitivity of an menu entry.
-****************************************************************************/
-static void menu_entry_set_sensitive(GActionMap *map,
-                                     const char *key,
-                                     gboolean is_enabled)
-{
-  struct menu_entry_info *info = menu_entry_info_find(key);
-
-  if (info != NULL) {
-    menu_entry_set_sensitive_info(map, info, is_enabled);
-  }
-}
-
-/************************************************************************//**
-  Set sensitivity of all entries in the group.
-****************************************************************************/
-static void menu_entry_group_set_sensitive(GActionMap *map,
-                                           enum menu_entry_grouping group,
-                                           gboolean is_enabled)
-{
-  int i;
-
-  for (i = 0; menu_entries[i].key != NULL; i++) {
-    if (menu_entries[i].grouping == group || group == MGROUP_ALL) {
-      menu_entry_set_sensitive_info(map, &(menu_entries[i]), is_enabled);
-    }
-  }
-}
-
-/************************************************************************//**
-  Renames an action.
-****************************************************************************/
-static void menus_rename(GMenu *parent, int index, const char *key,
-                         const char *new_name)
-{
-  struct menu_entry_info *info = menu_entry_info_find(key);
-
-  if (info != NULL) {
-    char actname[150];
-    GMenuItem *item;
-
-    fc_snprintf(actname, sizeof(actname), "app.%s", info->action);
-    g_menu_remove(parent, index);
-
-    item = g_menu_item_new(new_name, actname);
-    menu_item_insert_unref(parent, index, item);
-  }
-}
-
-/************************************************************************//**
-  Update the sensitivity of the items in the view menu.
-****************************************************************************/
-static void view_menu_update_sensitivity(GActionMap *map)
-{
-  /* The "full" city bar (i.e. the new way of drawing the
-   * city name), can draw the city growth even without drawing
-   * the city name. But the old method cannot. */
-  if (gui_options.draw_full_citybar) {
-    menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", TRUE);
-    menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES", TRUE);
-  } else {
-    menu_entry_set_sensitive(map, "SHOW_CITY_GROWTH", gui_options.draw_city_names);
-    menu_entry_set_sensitive(map, "SHOW_CITY_TRADE_ROUTES",
-                             gui_options.draw_city_names);
-  }
-
-  menu_entry_set_sensitive(map, "SHOW_CITY_BUY_COST",
-                           gui_options.draw_city_productions);
-  menu_entry_set_sensitive(map, "SHOW_COASTLINE", !gui_options.draw_terrain);
-  menu_entry_set_sensitive(map, "SHOW_UNIT_SOLID_BG",
-                           gui_options.draw_units || gui_options.draw_focus_unit);
-  menu_entry_set_sensitive(map, "SHOW_UNIT_SHIELDS",
-                           gui_options.draw_units || gui_options.draw_focus_unit);
-  menu_entry_set_sensitive(map, "SHOW_FOCUS_UNIT", !gui_options.draw_units);
-}
-
-/************************************************************************//**
-  Return the text for the tile, changed by the activity.
-
-  Should only be called for irrigation, mining, or transformation, and
-  only when the activity changes the base terrain type.
-****************************************************************************/
-static const char *get_tile_change_menu_text(struct tile *ptile,
-                                             enum unit_activity activity)
-{
-  struct tile *newtile = tile_virtual_new(ptile);
-  const char *text;
-
-  tile_apply_activity(newtile, activity, NULL);
-  text = tile_get_info_text(newtile, FALSE, 0);
-  tile_virtual_destroy(newtile);
-
-  return text;
-}
-
-/************************************************************************//**
-  Updates the menus.
-****************************************************************************/
-void real_menus_update(void)
-{
-  GtkApplication *fc_app = gui_app();
-  GActionMap *map = G_ACTION_MAP(fc_app);
-  GMenu *submenu;
-  int i, j;
-  int tgt_kind_group;
-  struct unit_list *punits;
-  unsigned num_units;
-  struct menu_entry_info *info;
-  struct road_type *proad;
-  struct extra_type_list *extras;
-  bool conn_possible;
-
-  if (!menus_built || client_state() == C_S_DISCONNECTED) {
-    return;
-  }
-
-  punits = get_units_in_focus();
-
-  submenu = g_menu_new();
-
-  i = 0;
-  j = 0;
-
-  /* Add the new action entries grouped by target kind. */
-  for (tgt_kind_group = 0; tgt_kind_group < ATK_COUNT; tgt_kind_group++) {
-    action_noninternal_iterate(act_id) {
-      struct action *paction = action_by_number(act_id);
-      GSimpleAction *act;
-      char actname[256];
-      char name[256];
-
-      if (action_id_get_actor_kind(act_id) != AAK_UNIT) {
-        /* This action isn't performed by a unit. */
-        continue;
-      }
-
-      if (action_id_get_target_kind(act_id) != tgt_kind_group) {
-        /* Wrong group. */
-        continue;
-      }
-
-      if (!units_can_do_action(punits, act_id, TRUE)) {
-        continue;
-      }
-
-      /* Create and add the menu item. */
-      fc_snprintf(actname, sizeof(actname), "action_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_action_map_add_action(map, G_ACTION(act));
-
-      fc_snprintf(name, sizeof(name), "%s",
-                  action_get_ui_name_mnemonic(act_id, "_"));
-      fc_snprintf(actname, sizeof(actname), "app.action_%d", i++);
-
-      if (action_id_has_complex_target(act_id)) {
-        GMenu *sub_target_menu = g_menu_new();
-        char subname[256];
-
-#define CREATE_SUB_ITEM(_sub_target_, _sub_target_key_, _sub_target_name_) \
-{                                                                          \
-  fc_snprintf(actname, sizeof(actname), "subtgt_%d", j);                   \
-  act = g_simple_action_new(actname, NULL);                                \
-  g_action_map_add_action(map, G_ACTION(act));                             \
-  g_object_set_data(G_OBJECT(act), _sub_target_key_, _sub_target_);        \
-  g_signal_connect(act, "activate", G_CALLBACK(unit_goto_and_callback),    \
-                   paction);                                               \
-  fc_snprintf(subname, sizeof(subname), "%s", _sub_target_name_);          \
-  fc_snprintf(actname, sizeof(actname), "app.subtgt_%d", j++);             \
-  menu_item_append_unref(sub_target_menu,                                  \
-                         g_menu_item_new(subname, actname));               \
-}
-
-        switch (action_get_sub_target_kind(paction)) {
-        case ASTK_BUILDING:
-          improvement_iterate(pimpr) {
-            CREATE_SUB_ITEM(pimpr, "end_building",
-                            improvement_name_translation(pimpr));
-          } improvement_iterate_end;
-          break;
-        case ASTK_TECH:
-          advance_iterate(ptech) {
-            CREATE_SUB_ITEM(ptech, "end_tech",
-                            advance_name_translation(ptech));
-          } advance_iterate_end;
-          break;
-        case ASTK_EXTRA:
-        case ASTK_EXTRA_NOT_THERE:
-          extra_type_iterate(pextra) {
-            if (!actres_creates_extra(paction->result, pextra)
-                && !actres_removes_extra(paction->result, pextra)) {
-              /* Not relevant */
-              continue;
-            }
-            CREATE_SUB_ITEM(pextra, "end_extra",
-                            extra_name_translation(pextra));
-          } extra_type_iterate_end;
-          break;
-        case ASTK_NONE:
-          /* Should not be here. */
-          fc_assert(action_get_sub_target_kind(paction) != ASTK_NONE);
-          break;
-        case ASTK_COUNT:
-          /* Should not exits */
-          fc_assert(action_get_sub_target_kind(paction) != ASTK_COUNT);
-          break;
-        }
-
-#undef CREATE_SUB_ITEM
-
-        submenu_append_unref(submenu, name, G_MENU_MODEL(sub_target_menu));
-      } else {
-        g_signal_connect(act, "activate",
-                         G_CALLBACK(unit_goto_and_callback), paction);
-        menu_item_append_unref(submenu, g_menu_item_new(name, actname));
-      }
-    } action_noninternal_iterate_end;
-  }
-  g_menu_remove(unit_menu, 1);
-  g_menu_insert_submenu(unit_menu, 1, _("Go to a_nd..."), G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  if (untargeted_revolution_allowed()) {
-    menu_entry_init(submenu, "START_REVOLUTION");
-  }
-
-  i = 0;
-  governments_iterate(g) {
-    if (g != game.government_during_revolution) {
-      char name[256];
-      char actname[256];
-      GSimpleAction *act;
-
-      fc_snprintf(actname, sizeof(actname), "government_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_simple_action_set_enabled(act, can_change_to_government(client_player(), g));
-      g_action_map_add_action(map, G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(government_callback), g);
-
-      /* TRANS: %s is a government name */
-      fc_snprintf(name, sizeof(name), _("%s..."),
-                  government_name_translation(g));
-      fc_snprintf(actname, sizeof(actname), "app.government_%d", i++);
-      menu_item_append_unref(submenu, g_menu_item_new(name, actname));
-    }
-  } governments_iterate_end;
-  g_menu_remove(gov_menu, 8);
-  g_menu_insert_submenu(gov_menu, 8, _("_Government"), G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  extra_type_by_cause_iterate(EC_ROAD, pextra) {
-    if (pextra->buildable) {
-      char actname[256];
-      GSimpleAction *act;
-
-      fc_snprintf(actname, sizeof(actname), "path_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_simple_action_set_enabled(act,
-                                  can_units_do_activity_targeted_client(punits,
-                                                                        ACTIVITY_GEN_ROAD,
-                                                                        pextra));
-      g_action_map_add_action(map, G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(road_callback), pextra);
-
-      fc_snprintf(actname, sizeof(actname), "app.path_%d", i++);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(extra_name_translation(pextra), actname));
-    }
-  } extra_type_by_cause_iterate_end;
-
-  g_menu_remove(work_menu, 2);
-  g_menu_insert_submenu(work_menu, 2, _("Build _Path"), G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  extra_type_by_cause_iterate(EC_IRRIGATION, pextra) {
-    if (pextra->buildable) {
-      char actname[256];
-      GSimpleAction *act;
-
-      fc_snprintf(actname, sizeof(actname), "irrig_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_simple_action_set_enabled(act,
-                                  can_units_do_activity_targeted_client(punits,
-                                                                        ACTIVITY_IRRIGATE,
-                                                                        pextra));
-      g_action_map_add_action(map, G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(irrigation_callback), pextra);
-
-      fc_snprintf(actname, sizeof(actname), "app.irrig_%d", i++);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(extra_name_translation(pextra), actname));
-    }
-  } extra_type_by_cause_iterate_end;
-
-  g_menu_remove(work_menu, 3);
-  g_menu_insert_submenu(work_menu, 3, _("Build _Irrigation"), G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  extra_type_by_cause_iterate(EC_MINE, pextra) {
-    if (pextra->buildable) {
-      char actname[256];
-      GSimpleAction *act;
-
-      fc_snprintf(actname, sizeof(actname), "mine_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_simple_action_set_enabled(act,
-                                  can_units_do_activity_targeted_client(punits,
-                                                                        ACTIVITY_MINE,
-                                                                        pextra));
-      g_action_map_add_action(map, G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(mine_callback), pextra);
-
-      fc_snprintf(actname, sizeof(actname), "app.mine_%d", i++);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(extra_name_translation(pextra), actname));
-    }
-  } extra_type_by_cause_iterate_end;
-
-  g_menu_remove(work_menu, 4);
-  g_menu_insert_submenu(work_menu, 4, _("Build _Mine"), G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  extra_type_by_rmcause_iterate(ERM_CLEAN, pextra) {
-    char actname[256];
-    GSimpleAction *act;
-
-    fc_snprintf(actname, sizeof(actname), "clean_%d", i);
-    act = g_simple_action_new(actname, NULL);
-    g_simple_action_set_enabled(act,
-                                can_units_do_activity_targeted_client(punits,
-                                                                      ACTIVITY_CLEAN,
-                                                                      pextra));
-    g_action_map_add_action(map, G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(clean_menu_callback), pextra);
-
-    fc_snprintf(actname, sizeof(actname), "app.clean_%d", i++);
-    menu_item_append_unref(submenu,
-                           g_menu_item_new(extra_name_translation(pextra), actname));
-  } extra_type_by_rmcause_iterate_end;
-
-  g_menu_remove(work_menu, 5);
-  g_menu_insert_submenu(work_menu, 5, _("_Clean Nuisance"),
-                        G_MENU_MODEL(submenu));
-
-  submenu = g_menu_new();
-
-  extra_type_by_cause_iterate(EC_BASE, pextra) {
-    if (pextra->buildable) {
-      char actname[256];
-      GSimpleAction *act;
-
-      fc_snprintf(actname, sizeof(actname), "base_%d", i);
-      act = g_simple_action_new(actname, NULL);
-      g_simple_action_set_enabled(act,
-                                  can_units_do_activity_targeted_client(punits,
-                                                                        ACTIVITY_BASE,
-                                                                        pextra));
-      g_action_map_add_action(map, G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(base_callback), pextra);
-
-      fc_snprintf(actname, sizeof(actname), "app.base_%d", i++);
-      menu_item_append_unref(submenu,
-                             g_menu_item_new(extra_name_translation(pextra), actname));
-    }
-  } extra_type_by_cause_iterate_end;
-
-  g_menu_remove(combat_menu, 3);
-  g_menu_insert_submenu(combat_menu, 3, _("Build _Base"), G_MENU_MODEL(submenu));
-
-  bool units_all_same_tile = TRUE, units_all_same_type = TRUE;
-  char acttext[128], irrtext[128], mintext[128], transtext[128];
-  char cultext[128], plantext[128];
-  struct terrain *pterrain;
-
-  if (!can_client_change_view()) {
-    return;
-  }
-
-  num_units = get_num_units_in_focus();
-
-  if (num_units > 0) {
-    const struct tile *ptile = NULL;
-    const struct unit_type *ptype = NULL;
-
-    unit_list_iterate(punits, punit) {
-      fc_assert((ptile == NULL) == (ptype == NULL));
-
-      if (ptile || ptype) {
-        if (unit_tile(punit) != ptile) {
-          units_all_same_tile = FALSE;
-        }
-        if (unit_type_get(punit) != ptype) {
-          units_all_same_type = FALSE;
-        }
-      } else {
-        ptile = unit_tile(punit);
-        ptype = unit_type_get(punit);
-      }
-    } unit_list_iterate_end;
-  }
-
-  menu_entry_group_set_sensitive(map, MGROUP_EDIT, editor_is_active());
-  menu_entry_group_set_sensitive(map, MGROUP_PLAYING,
-                                 can_client_issue_orders() && !editor_is_active());
-  menu_entry_group_set_sensitive(map, MGROUP_UNIT,
-                                 num_units > 0
-                                 && can_client_issue_orders()
-                                 && !editor_is_active());
-
-  menu_entry_set_sensitive(map, "GAME_SAVE_AS",
-                           can_client_access_hack() && C_S_RUNNING <= client_state());
-  menu_entry_set_sensitive(map, "GAME_SAVE",
-                           can_client_access_hack() && C_S_RUNNING <= client_state());
-
-  menu_entry_set_sensitive(map, "SERVER_OPTIONS", client.conn.established);
-
-  menu_entry_set_sensitive(map, "LEAVE",
-                           client.conn.established);
-
-  menu_entry_set_sensitive(map, "RALLY_DLG", can_client_issue_orders());
-  menu_entry_set_sensitive(map, "INFRA_DLG", terrain_control.infrapoints);
-
-  menu_entry_set_sensitive(map, "POLICIES", multiplier_count() > 0);
-  menu_entry_set_sensitive(map, "REPORT_TOP_CITIES", game.info.top_cities_count > 0);
-  menu_entry_set_sensitive(map, "REPORT_SPACESHIP",
-                           client_player() != NULL && client_player()->spaceship.state != SSHIP_NONE);
-
-  info = menu_entry_info_find("EDIT_MODE");
-  if (info->state != game.info.is_edit_mode) {
-    info->state = game.info.is_edit_mode;
-    g_menu_remove(edit_menu, 4);
-    menu_item_insert_unref(edit_menu, 4,
-                           create_toggle_menu_item(info));
-
-    menu_entry_set_sensitive(map, "EDIT_MODE",
-                             can_conn_enable_editing(&client.conn));
-    editgui_refresh();
-  }
-
-  info = menu_entry_info_find("TOGGLE_FOG");
-  if (info->state != game.client.fog_of_war) {
-    info->state = game.client.fog_of_war;
-
-    g_menu_remove(edit_menu, 5);
-    menu_item_insert_unref(edit_menu, 5,
-                           create_toggle_menu_item(info));
-  }
-
-  {
-    char road_buf[500];
-
-    proad = road_by_gui_type(ROAD_GUI_ROAD);
-    if (proad != NULL) {
-      /* TRANS: Connect with some road type (Road/Railroad) */
-      snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
-               extra_name_translation(road_extra_get(proad)));
-      menus_rename(work_menu, 12, "CONNECT_ROAD", road_buf);
-    }
-
-    proad = road_by_gui_type(ROAD_GUI_RAILROAD);
-    if (proad != NULL) {
-      snprintf(road_buf, sizeof(road_buf), _("Connect With %s"),
-               extra_name_translation(road_extra_get(proad)));
-      menus_rename(work_menu, 13, "CONNECT_RAIL", road_buf);
-    }
-  }
-
-  if (!can_client_issue_orders()) {
-    return;
-  }
-
-  if (!punits) {
-    return;
-  }
-
-  /* Remaining part of this function: Update Unit, Work, and Combat menus */
-
-  /* Enable the button for adding to a city in all cases, so we
-   * get an eventual error message from the server if we try. */
-  menu_entry_set_sensitive(map, "BUILD_CITY",
-                           (can_units_do_on_map(&(wld.map), punits,
-                                                unit_can_add_or_build_city)
-                            || can_units_do_on_map(&(wld.map), punits,
-                                                   unit_can_help_build_wonder_here)));
-
-  menu_entry_set_sensitive(map, "DO_ACTION",
-                           units_can_do_action(punits, ACTION_ANY, TRUE));
-
-  menu_entry_set_sensitive(map, "UNIT_TELEPORT",
-                           can_units_do_on_map(&(wld.map), punits, can_unit_teleport));
-
-  menu_entry_set_sensitive(map, "BUILD_ROAD",
-                           (can_units_do_any_road(&(wld.map), punits)
-                            || can_units_do(punits,
-                                            unit_can_est_trade_route_here)));
-  menu_entry_set_sensitive(map, "BUILD_IRRIGATION",
-                           can_units_do_activity_client(punits, ACTIVITY_IRRIGATE));
-  menu_entry_set_sensitive(map, "BUILD_MINE",
-                           can_units_do_activity_client(punits, ACTIVITY_MINE));
-  menu_entry_set_sensitive(map, "CULTIVATE",
-                           can_units_do_activity_client(punits, ACTIVITY_CULTIVATE));
-  menu_entry_set_sensitive(map, "PLANT",
-                           can_units_do_activity_client(punits, ACTIVITY_PLANT));
-  menu_entry_set_sensitive(map, "TRANSFORM_TERRAIN",
-                           can_units_do_activity_client(punits, ACTIVITY_TRANSFORM));
-  menu_entry_set_sensitive(map, "FORTIFY",
-                           can_units_do_activity_client(punits,
-                                                        ACTIVITY_FORTIFYING));
-  menu_entry_set_sensitive(map, "PARADROP",
-                           can_units_do_on_map(&(wld.map), punits, can_unit_paradrop));
-  menu_entry_set_sensitive(map, "PILLAGE",
-                           can_units_do_activity_client(punits, ACTIVITY_PILLAGE));
-  menu_entry_set_sensitive(map, "CLEAN",
-                           can_units_do_activity_client(punits, ACTIVITY_CLEAN));
-  menu_entry_set_sensitive(map, "BUILD_FORTRESS",
-                           can_units_do_base_gui(punits, BASE_GUI_FORTRESS));
-  menu_entry_set_sensitive(map, "BUILD_AIRBASE",
-                           can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
-  menu_entry_set_sensitive(map, "UNIT_SENTRY",
-                           can_units_do_activity_client(punits, ACTIVITY_SENTRY));
-  menu_entry_set_sensitive(map, "UNSENTRY_ALL",
-                           units_have_activity_on_tile(punits,
-                                                       ACTIVITY_SENTRY));
-  menu_entry_set_sensitive(map, "UNIT_HOMECITY",
-                           can_units_do_on_map(&(wld.map), punits, can_unit_change_homecity));
-  menu_entry_set_sensitive(map, "UNIT_UPGRADE", units_can_upgrade(&(wld.map), punits));
-  menu_entry_set_sensitive(map, "UNIT_CONVERT", units_can_convert(&(wld.map), punits));
-  menu_entry_set_sensitive(map, "UNIT_DISBAND",
-                           units_can_do_action(punits, ACTION_DISBAND_UNIT,
-                                               TRUE));
-
-  menu_entry_set_sensitive(map, "AUTO_WORKER",
-                           can_units_do(punits, can_unit_do_autoworker));
-  menu_entry_set_sensitive(map, "UNIT_EXPLORE",
-                           can_units_do_activity_client(punits, ACTIVITY_EXPLORE));
-  menu_entry_set_sensitive(map, "UNIT_BOARD",
-                           units_can_load(punits));
-  menu_entry_set_sensitive(map, "UNIT_DEBOARD",
-                           units_can_unload(&(wld.map), punits));
-  menu_entry_set_sensitive(map, "UNIT_UNLOAD_TRANSPORTER",
-                           units_are_occupied(punits));
-
-  proad = road_by_gui_type(ROAD_GUI_ROAD);
-  if (proad != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(proad);
-
-    conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
-  } else {
-    conn_possible = FALSE;
-  }
-  menu_entry_set_sensitive(map, "CONNECT_ROAD", conn_possible);
-
-  proad = road_by_gui_type(ROAD_GUI_RAILROAD);
-  if (proad != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(proad);
-
-    conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
-  } else {
-    conn_possible = FALSE;
-  }
-  menu_entry_set_sensitive(map, "CONNECT_RAIL", conn_possible);
-
-  proad = road_by_gui_type(ROAD_GUI_MAGLEV);
-  if (proad != NULL) {
-    struct extra_type *tgt;
-
-    tgt = road_extra_get(proad);
-
-    conn_possible = can_units_do_connect(punits, ACTIVITY_GEN_ROAD, tgt);
-  } else {
-    conn_possible = FALSE;
-  }
-  menu_entry_set_sensitive(map, "CONNECT_MAGLEV", conn_possible);
-
-  extras = extra_type_list_by_cause(EC_IRRIGATION);
-
-  if (extra_type_list_size(extras) > 0) {
-    struct extra_type *tgt;
-
-    tgt = extra_type_list_get(extras, 0);
-    conn_possible = can_units_do_connect(punits, ACTIVITY_IRRIGATE, tgt);
-  } else {
-    conn_possible = FALSE;
-  }
-  menu_entry_set_sensitive(map, "CONNECT_IRRIGATION", conn_possible);
-
-  menu_entry_set_sensitive(map, "TAX_RATES",
-                           game.info.changable_tax
-                           && can_client_issue_orders());
-
-  if (units_can_do_action(punits, ACTION_HELP_WONDER, TRUE)) {
-    menus_rename(work_menu, 0, "BUILD_CITY",
-                 action_get_ui_name_mnemonic(ACTION_HELP_WONDER, "_"));
-  } else {
-    bool city_on_tile = FALSE;
-
-    /* FIXME: This overloading doesn't work well with multiple focus
-     * units. */
-    unit_list_iterate(punits, punit) {
-      if (tile_city(unit_tile(punit))) {
-        city_on_tile = TRUE;
-        break;
-      }
-    } unit_list_iterate_end;
-
-    if (city_on_tile && units_can_do_action(punits, ACTION_JOIN_CITY,
-                                            TRUE)) {
-      menus_rename(work_menu, 0, "BUILD_CITY",
-                   action_get_ui_name_mnemonic(ACTION_JOIN_CITY, "_"));
-    } else {
-      /* Refresh default order */
-      menus_rename(work_menu, 0, "BUILD_CITY",
-                   action_get_ui_name_mnemonic(ACTION_FOUND_CITY, "_"));
-    }
-  }
-
-  if (units_can_do_action(punits, ACTION_TRADE_ROUTE, TRUE)) {
-    menus_rename(work_menu, 6, "BUILD_ROAD",
-                 action_get_ui_name_mnemonic(ACTION_TRADE_ROUTE, "_"));
-  } else if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
-    char road_item[500];
-    struct extra_type *pextra = NULL;
-
-    /* FIXME: This overloading doesn't work well with multiple focus
-     * units. */
-    unit_list_iterate(punits, punit) {
-      pextra = next_extra_for_tile(unit_tile(punit), EC_ROAD,
-                                   unit_owner(punit), punit);
-      if (pextra != NULL) {
-        break;
-      }
-    } unit_list_iterate_end;
-
-    if (pextra != NULL) {
-      /* TRANS: Build road of specific type (Road/Railroad) */
-      snprintf(road_item, sizeof(road_item), _("Build %s"),
-               extra_name_translation(pextra));
-      menus_rename(work_menu, 6, "BUILD_ROAD", road_item);
-    }
-  } else {
-    menus_rename(work_menu, 6, "BUILD_ROAD", _("Build _Road"));
-  }
-
-  if (units_all_same_type && num_units > 0) {
-    struct unit *punit = unit_list_get(punits, 0);
-    const struct unit_type *to_unittype
-      = can_upgrade_unittype(client_player(), unit_type_get(punit));
-
-    if (to_unittype) {
-      /* TRANS: %s is a unit type. */
-      fc_snprintf(acttext, sizeof(acttext), _("Upgr_ade to %s"),
-                  utype_name_translation(
-                    can_upgrade_unittype(client_player(),
-                                         unit_type_get(punit))));
-    } else {
-      acttext[0] = '\0';
-    }
-  } else {
-    acttext[0] = '\0';
-  }
-  if ('\0' != acttext[0]) {
-    menus_rename(unit_menu, 13, "UNIT_UPGRADE", acttext);
-  } else {
-    menus_rename(unit_menu, 13, "UNIT_UPGRADE", _("Upgr_ade"));
-  }
-
-  if (units_can_convert(&(wld.map), punits)) {
-    if (units_all_same_type && num_units > 0) {
-      struct unit *punit = unit_list_get(punits, 0);
-
-      /* TRANS: %s is a unit type. */
-      fc_snprintf(acttext, sizeof(acttext), _("C_onvert to %s"),
-                  utype_name_translation(unit_type_get(punit)->converted_to));
-    } else {
-      acttext[0] = '\0';
-    }
-  } else {
-    menu_entry_set_sensitive(map, "UNIT_CONVERT", FALSE);
-    acttext[0] = '\0';
-  }
-  if ('\0' != acttext[0]) {
-    menus_rename(unit_menu, 14, "UNIT_CONVERT", acttext);
-  } else {
-    menus_rename(unit_menu, 14, "UNIT_CONVERT", _("C_onvert"));
-  }
-
-  if (units_all_same_tile && num_units > 0) {
-    struct unit *first = unit_list_get(punits, 0);
-
-    pterrain = tile_terrain(unit_tile(first));
-
-    if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
-      struct extra_type *pextra = NULL;
-
-      /* FIXME: this overloading doesn't work well with multiple focus
-       * units. */
-      unit_list_iterate(punits, punit) {
-        pextra = next_extra_for_tile(unit_tile(punit), EC_IRRIGATION,
-                                     unit_owner(punit), punit);
-        if (pextra != NULL) {
-          break;
-        }
-      } unit_list_iterate_end;
-
-      if (pextra != NULL) {
-        /* TRANS: Build irrigation of specific type */
-        snprintf(irrtext, sizeof(irrtext), _("Build %s"),
-                 extra_name_translation(pextra));
-      } else {
-        sz_strlcpy(irrtext, _("Build _Irrigation"));
-      }
-    } else {
-      sz_strlcpy(irrtext, _("Build _Irrigation"));
-    }
-
-    if (pterrain->cultivate_result != T_NONE) {
-      fc_snprintf(cultext, sizeof(cultext), _("Change to %s"),
-                  get_tile_change_menu_text(unit_tile(first),
-                                            ACTIVITY_CULTIVATE));
-    } else {
-      sz_strlcpy(cultext, _("_Cultivate"));
-    }
-
-    if (units_have_type_flag(punits, UTYF_WORKERS, TRUE)) {
-      struct extra_type *pextra = NULL;
-
-      /* FIXME: this overloading doesn't work well with multiple focus
-       * units. */
-      unit_list_iterate(punits, punit) {
-        pextra = next_extra_for_tile(unit_tile(punit), EC_MINE,
-                                     unit_owner(punit), punit);
-        if (pextra != NULL) {
-          break;
-        }
-      } unit_list_iterate_end;
-
-      if (pextra != NULL) {
-        /* TRANS: Build mine of specific type */
-        snprintf(mintext, sizeof(mintext), _("Build %s"),
-                 extra_name_translation(pextra));
-      } else {
-        sz_strlcpy(mintext, _("Build _Mine"));
-      }
-    } else {
-      sz_strlcpy(mintext, _("Build _Mine"));
-    }
-
-    if (pterrain->plant_result != T_NONE) {
-      fc_snprintf(plantext, sizeof(plantext), _("Change to %s"),
-                  get_tile_change_menu_text(unit_tile(first), ACTIVITY_PLANT));
-    } else {
-      sz_strlcpy(plantext, _("_Plant"));
-    }
-
-    if (pterrain->transform_result != T_NONE
-        && pterrain->transform_result != pterrain) {
-      fc_snprintf(transtext, sizeof(transtext), _("Transf_orm to %s"),
-                  get_tile_change_menu_text(unit_tile(first),
-                                            ACTIVITY_TRANSFORM));
-    } else {
-      sz_strlcpy(transtext, _("Transf_orm Terrain"));
-    }
-  } else {
-    sz_strlcpy(irrtext, _("Build _Irrigation"));
-    sz_strlcpy(cultext, _("_Cultivate"));
-    sz_strlcpy(mintext, _("Build _Mine"));
-    sz_strlcpy(plantext, _("_Plant"));
-    sz_strlcpy(transtext, _("Transf_orm Terrain"));
-  }
-
-  menus_rename(work_menu, 7, "BUILD_IRRIGATION", irrtext);
-  menus_rename(work_menu, 9, "CULTIVATE", cultext);
-  menus_rename(work_menu, 8, "BUILD_MINE", mintext);
-  menus_rename(work_menu, 10, "PLANT", plantext);
-  menus_rename(work_menu, 11, "TRANSFORM_TERRAIN", transtext);
-
-  menus_rename(unit_menu, 12, "UNIT_HOMECITY",
-               action_get_ui_name_mnemonic(ACTION_HOME_CITY, "_"));
-
-  menus_rename(combat_menu, 1, "BUILD_FORTRESS",
-               Q_(terrain_control.gui_type_base0));
-  menus_rename(combat_menu, 2, "BUILD_AIRBASE",
-               Q_(terrain_control.gui_type_base1));
-}
-
-/************************************************************************//**
-  Initialize menus (sensitivity, name, etc.) based on the
-  current state and current ruleset, etc. Call menus_update().
-****************************************************************************/
-void real_menus_init(void)
-{
-  if (!menus_built) {
-    return;
-  }
-
-#ifdef MENUS_GTK3
-
-  if (!can_client_change_view()) {
-    menu_entry_group_set_sensitive(MGROUP_ALL, FALSE);
-
-    return;
-  }
-
-  menu_entry_group_set_sensitive(MGROUP_SAFE, TRUE);
-  menu_entry_group_set_sensitive(MGROUP_PLAYER, client_has_player());
-
-  menu_entry_set_sensitive("SHOW_NATIONAL_BORDERS",
-                           BORDERS_DISABLED != game.info.borders);
-
-  view_menu_update_sensitivity();
-#endif /* MENUS_GTK3 */
-}
-
-/**********************************************************************//**
-  Enable/Disable the game page menu bar.
-**************************************************************************/
-void enable_menus(bool enable)
-{
-  GtkApplication *fc_app = gui_app();
-
-  if (enable) {
-    if (main_menubar == NULL) {
-      setup_app_actions(G_APPLICATION(fc_app));
-      main_menubar = setup_menus(fc_app);
-      /* Ensure the menus are really created before performing any operations
-       * on them. */
-      while (g_main_context_pending(NULL)) {
-        g_main_context_iteration(NULL, FALSE);
-      }
-    }
-
-    gtk_application_window_set_show_menubar(GTK_APPLICATION_WINDOW(toplevel), TRUE);
-    gtk_application_set_menubar(fc_app, G_MENU_MODEL(main_menubar));
-
-  } else {
-    gtk_application_window_set_show_menubar(GTK_APPLICATION_WINDOW(toplevel), FALSE);
-    gtk_application_set_menubar(fc_app, NULL);
-  }
-
-  /* Workaround for gtk bug that (re)setting the menubar after the window has
-   * been already created is not noticed. */
-  g_object_notify(G_OBJECT(gtk_settings_get_default()), "gtk-shell-shows-menubar");
-}
-
-/**********************************************************************//**
-  Disable all unit related commands.
-**************************************************************************/
-void menus_disable_unit_commands(void)
-{
-  menu_entry_group_set_sensitive(G_ACTION_MAP(gui_app()), MGROUP_UNIT, FALSE);
-}
diff --git a/client/gui-gtk-5.0/menu.h b/client/gui-gtk-5.0/menu.h
deleted file mode 100644
index 88a5029369..0000000000
--- a/client/gui-gtk-5.0/menu.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__MENU_H
-#define FC__MENU_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "menu_g.h"
-
-void enable_menus(bool enable);
-
-void menus_set_initial_toggle_values(void);
-void menus_disable_unit_commands(void);
-
-#endif /* FC__MENU_H */
diff --git a/client/gui-gtk-5.0/messagedlg.c b/client/gui-gtk-5.0/messagedlg.c
deleted file mode 100644
index 30a8abad36..0000000000
--- a/client/gui-gtk-5.0/messagedlg.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "events.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "messagedlg.h"
-
-#define NUM_LISTS 1
-
-/*************************************************************************/
-static struct gui_dialog *shell;
-static GtkListStore *models[NUM_LISTS];
-
-static void create_messageopt_dialog(void);
-static void messageopt_response(struct gui_dialog *dlg, int response,
-                                gpointer data);
-static void item_toggled(GtkCellRendererToggle *cell,
-                         gchar *spath, gpointer data);
-
-/**********************************************************************//**
-  Open messageoptions dialog
-**************************************************************************/
-void popup_messageopt_dialog(void)
-{
-  if (shell == NULL) {
-    create_messageopt_dialog();
-  }
-
-  gui_dialog_raise(shell);
-}
-
-/**********************************************************************//**
-  Create messageoptions dialog
-**************************************************************************/
-static void create_messageopt_dialog(void)
-{
-  GtkWidget *form, *explanation;
-  int n, i = 0, j;
-  int form_col = 0;
-
-  gui_dialog_new(&shell, GTK_NOTEBOOK(top_notebook), NULL, TRUE);
-  gui_dialog_set_title(shell, _("Message Options"));
-
-  gui_dialog_set_default_size(shell, -1, 450);
-
-  gui_dialog_add_button(shell, NULL, _("_OK"), GTK_RESPONSE_OK);
-  gui_dialog_add_button(shell, NULL, _("_Cancel"), GTK_RESPONSE_CANCEL);
-
-  explanation = gtk_label_new(NULL);
-  gtk_widget_set_margin_bottom(explanation, 4);
-  gtk_widget_set_margin_end(explanation, 4);
-  gtk_widget_set_margin_start(explanation, 4);
-  gtk_widget_set_margin_top(explanation, 4);
-  gtk_label_set_markup(GTK_LABEL(explanation),
-    _("Where to display messages?\n"
-      "<b>Out</b>put window ; "
-      "<b>Mes</b>sages window ; "
-      "<b>Pop</b>up individual window"));
-  gtk_widget_set_name(explanation, "comment_label");
-  gui_dialog_add_content_widget(shell, explanation);
-  gtk_widget_set_visible(explanation, TRUE);
-
-  form = gtk_grid_new();
-  gui_dialog_add_content_widget(shell, form);
-
-  for (n = 0; n < NUM_LISTS; n++) {
-    models[n] = gtk_list_store_new(5, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-                                   G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_INT);
-  }
-
-  sorted_event_iterate(ev) {
-    GtkTreeIter it;
-    GValue value = { 0, };
-
-    n = (i++ % NUM_LISTS);
-
-    gtk_list_store_append(models[n], &it);
-
-    g_value_init(&value, G_TYPE_STRING);
-    g_value_set_static_string(&value, get_event_message_text(ev));
-    gtk_list_store_set_value(models[n], &it, 3, &value);
-    g_value_unset(&value);
-
-    gtk_list_store_set(models[n], &it, 4, ev, -1);
-
-    for (j = 0; j < NUM_MW; j++) {
-      gtk_list_store_set(models[n], &it, j, messages_where[ev] & (1<<j), -1);
-    }
-  } sorted_event_iterate_end;
-
-  for (n = 0; n < NUM_LISTS; n++) {
-    GtkWidget *view, *sw;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *column;
-
-    view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(models[n]));
-    gtk_widget_set_hexpand(view, TRUE);
-    gtk_widget_set_vexpand(view, TRUE);
-    g_object_unref(models[n]);
-
-    renderer = gtk_cell_renderer_text_new();
-    column = gtk_tree_view_column_new_with_attributes(_("Event"),
-        renderer, "text", 3, NULL);
-    gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
-    gtk_tree_view_column_set_expand(column, TRUE);
-
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set_data(G_OBJECT(renderer), "column", GINT_TO_POINTER(0));
-    g_signal_connect(renderer, "toggled", G_CALLBACK(item_toggled), models[n]);
-
-    gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-                                                -1, _("Out"), renderer,
-                                                "active", 0, NULL);
-
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set_data(G_OBJECT(renderer), "column", GINT_TO_POINTER(1));
-    g_signal_connect(renderer, "toggled", G_CALLBACK(item_toggled), models[n]);
-
-    gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-                                                -1, _("Mes"), renderer,
-                                                "active", 1, NULL);
-
-    renderer = gtk_cell_renderer_toggle_new();
-    g_object_set_data(G_OBJECT(renderer), "column", GINT_TO_POINTER(2));
-    g_signal_connect(renderer, "toggled", G_CALLBACK(item_toggled), models[n]);
-
-    gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-                                                -1, _("Pop"), renderer,
-                                                "active", 2, NULL);
-
-    sw = gtk_scrolled_window_new();
-    gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-    gtk_grid_attach(GTK_GRID(form), sw, form_col++, 0, 1, 1);
-
-    gtk_tree_view_focus(GTK_TREE_VIEW(view));
-  }
-
-  gui_dialog_response_set_callback(shell, messageopt_response);
-  gui_dialog_show_all(shell);
-}
-
-/**********************************************************************//**
-  User responded to messageoptions dialog
-**************************************************************************/
-static void messageopt_response(struct gui_dialog *dlg, int response,
-                                gpointer data)
-{
-  if (response == GTK_RESPONSE_OK) {
-    ITree it;
-    gint n, j, i;
-    gboolean toggle;
-
-    for (i = 0; i <= event_type_max(); i++) {
-      /* Include possible undefined messages. */
-      messages_where[i] = 0;
-    }
-
-    for (n = 0; n < NUM_LISTS; n++) {
-      GtkTreeModel *pmodel = GTK_TREE_MODEL(models[n]);
-
-      for (itree_begin(pmodel, &it); !itree_end(&it); itree_next(&it)) {
-        for (j = 0; j < NUM_MW; j++) {
-          itree_get(&it, j, &toggle, 4, &i, -1);
-
-          if (toggle) {
-            messages_where[i] |= (1<<j);
-          }
-        }
-      }
-    }
-  }
-  gui_dialog_destroy(dlg);
-}
-
-/**********************************************************************//**
-  User toggled item
-**************************************************************************/
-static void item_toggled(GtkCellRendererToggle *cell,
-                         gchar *spath, gpointer data)
-{
-  GtkTreeModel *model = GTK_TREE_MODEL(data);
-  GtkTreePath *path;
-  GtkTreeIter it;
-  gboolean toggle;
-  gint column;
-
-  path = gtk_tree_path_new_from_string(spath);
-
-  column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell), "column"));
-
-  gtk_tree_model_get_iter(model, &it, path);
-  gtk_tree_model_get(model, &it, column, &toggle, -1);
-  toggle ^= 1;
-  gtk_list_store_set(GTK_LIST_STORE(model), &it, column, toggle, -1);
-
-  gtk_tree_path_free(path);
-}
diff --git a/client/gui-gtk-5.0/messagedlg.h b/client/gui-gtk-5.0/messagedlg.h
deleted file mode 100644
index 5401444f1e..0000000000
--- a/client/gui-gtk-5.0/messagedlg.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2003 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__MESSAGEDLG_H
-#define FC__MESSAGEDLG_H
-
-void popup_messageopt_dialog(void);
-
-#endif /* FC__MESSAGEDLG_H */
diff --git a/client/gui-gtk-5.0/messagewin.c b/client/gui-gtk-5.0/messagewin.c
deleted file mode 100644
index dc9d39d545..0000000000
--- a/client/gui-gtk-5.0/messagewin.c
+++ /dev/null
@@ -1,459 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-
-/* common */
-#include "events.h"
-#include "game.h"
-#include "map.h"
-#include "player.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "citydlg.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-
-#include "messagewin.h"
-
-
-struct meswin_dialog {
-  struct gui_dialog *shell;
-  GtkTreeView *tree_view;
-};
-
-/* Those values must match meswin_dialog_store_new(). */
-enum meswin_columns {
-  MESWIN_COL_ICON,
-  MESWIN_COL_MESSAGE,
-
-  /* Not visible. */
-  MESWIN_COL_WEIGHT,
-  MESWIN_COL_STYLE,
-  MESWIN_COL_ID,
-
-  MESWIN_COL_NUM
-};
-
-enum meswin_responses {
-  MESWIN_RES_GOTO = 1,
-  MESWIN_RES_POPUP_CITY
-};
-
-static struct meswin_dialog meswin = { NULL, };
-
-/************************************************************************//**
-  Create a tree model for the message window.
-****************************************************************************/
-static GtkListStore *meswin_dialog_store_new(void)
-{
-  return gtk_list_store_new(MESWIN_COL_NUM,
-                            GDK_TYPE_PIXBUF,    /* MESWIN_COL_ICON */
-                            G_TYPE_STRING,      /* MESWIN_COL_MESSAGE */
-                            G_TYPE_INT,         /* MESWIN_COL_WEIGHT */
-                            G_TYPE_INT,         /* MESWIN_COL_STYLE */
-                            G_TYPE_INT);        /* MESWIN_COL_ID */
-}
-
-/************************************************************************//**
-  Get the pango attributes for the visited state.
-****************************************************************************/
-static void meswin_dialog_visited_get_attr(bool visited, gint *weight,
-                                           gint *style)
-{
-  if (NULL != weight) {
-    *weight = (visited ? PANGO_WEIGHT_NORMAL : PANGO_WEIGHT_BOLD);
-  }
-  if (NULL != style) {
-    *style = (visited ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
-  }
-}
-
-/************************************************************************//**
-  Set the visited state of the store.
-****************************************************************************/
-static void meswin_dialog_set_visited(GtkTreeModel *model,
-                                      GtkTreeIter *iter, bool visited)
-{
-  gint row, weight, style;
-
-  gtk_tree_model_get(model, iter, MESWIN_COL_ID, &row, -1);
-  meswin_dialog_visited_get_attr(visited, &weight, &style);
-  gtk_list_store_set(GTK_LIST_STORE(model), iter,
-                     MESWIN_COL_WEIGHT, weight,
-                     MESWIN_COL_STYLE, style,
-                     -1);
-  meswin_set_visited_state(row, visited);
-}
-
-/************************************************************************//**
-  Refresh a message window dialog.
-****************************************************************************/
-static void meswin_dialog_refresh(struct meswin_dialog *pdialog)
-{
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  const struct message *pmsg;
-  gint weight, style;
-  int selected, i, num;
-  bool need_alert = FALSE;
-
-  fc_assert_ret(NULL != pdialog);
-
-  /* Save the selection. */
-  selection = gtk_tree_view_get_selection(pdialog->tree_view);
-  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter, MESWIN_COL_ID, &selected, -1);
-  } else {
-    selected = -1;
-  }
-
-  model = gtk_tree_view_get_model(pdialog->tree_view);
-  store = GTK_LIST_STORE(model);
-  num = meswin_get_num_messages();
-
-  gtk_list_store_clear(store);
-  for (i = 0; i < num; i++) {
-    GdkPixbuf *pb;
-    struct sprite *icon;
-    int x0, y0, x1, y1, w, h;
-    GdkPixbuf *pixbuf;
-
-    pmsg = meswin_get_message(i);
-
-    if (GUI_GTK_OPTION(new_messages_go_to_top)) {
-      gtk_list_store_prepend(store, &iter);
-    } else {
-      gtk_list_store_append(store, &iter);
-    }
-
-    icon = get_event_sprite(tileset, pmsg->event);
-    sprite_get_bounding_box(icon, &x0, &y0, &x1, &y1);
-    w = (x1 - x0) + 1;
-    h = (y1 - y0) + 1;
-    pb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
-    pixbuf = sprite_get_pixbuf(icon);
-    gdk_pixbuf_copy_area(pixbuf, x0, y0, w, h,
-                         pb, 0, 0);
-    g_object_unref(G_OBJECT(pixbuf));
-
-    meswin_dialog_visited_get_attr(pmsg->visited, &weight, &style);
-    gtk_list_store_set(store, &iter,
-                       MESWIN_COL_ICON, pb,
-                       MESWIN_COL_MESSAGE, pmsg->descr,
-                       MESWIN_COL_WEIGHT, weight,
-                       MESWIN_COL_STYLE, style,
-                       MESWIN_COL_ID, i,
-                       -1);
-    g_object_unref(pb);
-    if (i == selected) {
-      /* Restore the selection. */
-      gtk_tree_selection_select_iter(selection, &iter);
-    }
-
-    if (!pmsg->visited) {
-      need_alert = TRUE;
-    }
-  }
-
-  if (need_alert) {
-    gui_dialog_alert(pdialog->shell);
-  }
-}
-
-/************************************************************************//**
-  Selection changed callback.
-****************************************************************************/
-static void meswin_dialog_selection_callback(GtkTreeSelection *selection,
-                                             gpointer data)
-{
-  struct meswin_dialog *pdialog = data;
-  const struct message *pmsg;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gint row;
-
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    return;
-  }
-
-  gtk_tree_model_get(model, &iter, MESWIN_COL_ID, &row, -1);
-  pmsg = meswin_get_message(row);
-
-  gui_dialog_set_response_sensitive(pdialog->shell, MESWIN_RES_GOTO,
-                                    NULL != pmsg && pmsg->location_ok);
-  gui_dialog_set_response_sensitive(pdialog->shell, MESWIN_RES_POPUP_CITY,
-                                    NULL != pmsg && pmsg->city_ok);
-}
-
-/************************************************************************//**
-  A row has been activated by the user.
-****************************************************************************/
-static void meswin_dialog_row_activated_callback(GtkTreeView *view,
-                                                 GtkTreePath *path,
-                                                 GtkTreeViewColumn *col,
-                                                 gpointer data)
-{
-  GtkTreeModel *model = gtk_tree_view_get_model(view);
-  GtkTreeIter iter;
-  gint row;
-
-  if (!gtk_tree_model_get_iter(model, &iter, path)) {
-    return;
-  }
-
-  gtk_tree_model_get(model, &iter, MESWIN_COL_ID, &row, -1);
-
-  if (NULL != meswin_get_message(row)) {
-    meswin_double_click(row);
-    meswin_dialog_set_visited(model, &iter, TRUE);
-  }
-}
-
-/************************************************************************//**
-  Mouse button press handler for the message window treeview. We only
-  care about right clicks on a row; this action centers on the tile
-  associated with the event at that row (if applicable).
-****************************************************************************/
-static gboolean meswin_dialog_button_press_callback(GtkGestureClick *gesture,
-                                                    int n_press,
-                                                    double x, double y)
-{
-  GtkWidget *widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-  GtkTreePath *path = NULL;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gint row;
-
-  fc_assert_ret_val(GTK_IS_TREE_VIEW(widget), FALSE);
-
-  if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), x, y,
-                                     &path, NULL, NULL, NULL)) {
-    return TRUE;
-  }
-
-  model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
-  if (gtk_tree_model_get_iter(model, &iter, path)) {
-    gtk_tree_model_get(model, &iter, MESWIN_COL_ID, &row, -1);
-    meswin_goto(row);
-  }
-
-  gtk_tree_path_free(path);
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Dialog response callback.
-****************************************************************************/
-static void meswin_dialog_response_callback(struct gui_dialog *pgui_dialog,
-                                            int response, gpointer data)
-{
-  struct meswin_dialog *pdialog = data;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  gint row;
-
-  switch (response) {
-  case MESWIN_RES_GOTO:
-  case MESWIN_RES_POPUP_CITY:
-    break;
-  default:
-    gui_dialog_destroy(pgui_dialog);
-    return;
-  }
-
-  selection = gtk_tree_view_get_selection(pdialog->tree_view);
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    return;
-  }
-
-  gtk_tree_model_get(model, &iter, MESWIN_COL_ID, &row, -1);
-
-  switch (response) {
-  case MESWIN_RES_GOTO:
-    meswin_goto(row);
-    break;
-  case MESWIN_RES_POPUP_CITY:
-    meswin_popup_city(row);
-    break;
-  }
-  meswin_dialog_set_visited(model, &iter, TRUE);
-}
-
-/************************************************************************//**
-  Initialize a message window dialog.
-****************************************************************************/
-static void meswin_dialog_init(struct meswin_dialog *pdialog)
-{
-  GtkWidget *view, *sw, *cmd, *notebook;
-  GtkListStore *store;
-  GtkTreeSelection *selection;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *col;
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  fc_assert_ret(NULL != pdialog);
-
-  if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_SPLIT) {
-    notebook = right_notebook;
-  } else {
-    notebook = bottom_notebook;
-  }
-
-  gui_dialog_new(&pdialog->shell, GTK_NOTEBOOK(notebook), pdialog, TRUE);
-  gui_dialog_set_title(pdialog->shell, _("Messages"));
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gui_dialog_add_content_widget(pdialog->shell, sw);
-
-  store = meswin_dialog_store_new();
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(store);
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-  g_signal_connect(view, "row_activated",
-                   G_CALLBACK(meswin_dialog_row_activated_callback), NULL);
-
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(meswin_dialog_button_press_callback), NULL);
-  gtk_widget_add_controller(view, controller);
-
-  pdialog->tree_view = GTK_TREE_VIEW(view);
-
-  renderer = gtk_cell_renderer_pixbuf_new();
-  col = gtk_tree_view_column_new_with_attributes(NULL, renderer,
-                                                 "pixbuf", MESWIN_COL_ICON, NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_tree_view_column_set_visible(col, !GUI_GTK_OPTION(small_display_layout));
-
-  renderer = gtk_cell_renderer_text_new();
-  col = gtk_tree_view_column_new_with_attributes(NULL, renderer,
-                                                 "text", MESWIN_COL_MESSAGE,
-                                                 "weight", MESWIN_COL_WEIGHT,
-                                                 "style", MESWIN_COL_STYLE,
-                                                 NULL);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(meswin_dialog_selection_callback), pdialog);
-
-  gui_dialog_add_button(pdialog->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  if (GUI_GTK_OPTION(show_message_window_buttons)) {
-    cmd = gui_dialog_add_button(pdialog->shell, "zoom-in",
-                                _("I_nspect City"),
-                                MESWIN_RES_POPUP_CITY);
-    gtk_widget_set_sensitive(cmd, FALSE);
-
-    cmd = gui_dialog_add_button(pdialog->shell, "go-jump",
-                                _("Goto _Location"), MESWIN_RES_GOTO);
-    gtk_widget_set_sensitive(cmd, FALSE);
-  }
-
-  gui_dialog_response_set_callback(pdialog->shell,
-                                   meswin_dialog_response_callback);
-  gui_dialog_set_default_size(pdialog->shell, 520, 300);
-
-  meswin_dialog_refresh(pdialog);
-  gui_dialog_show_all(pdialog->shell);
-}
-
-/************************************************************************//**
-  Closes a message window dialog.
-****************************************************************************/
-static void meswin_dialog_free(struct meswin_dialog *pdialog)
-{
-  fc_assert_ret(NULL != pdialog);
-
-  gui_dialog_destroy(pdialog->shell);
-  fc_assert(NULL == pdialog->shell);
-
-  memset(pdialog, 0, sizeof(*pdialog));
-}
-
-/************************************************************************//**
-  Popup the dialog inside the main-window, and optionally raise it.
-****************************************************************************/
-void meswin_dialog_popup(bool raise)
-{
-  if (NULL == meswin.shell) {
-    meswin_dialog_init(&meswin);
-  }
-
-  gui_dialog_present(meswin.shell);
-  if (raise) {
-    gui_dialog_raise(meswin.shell);
-  }
-}
-
-/************************************************************************//**
-  Closes the message window dialog.
-****************************************************************************/
-void meswin_dialog_popdown(void)
-{
-  if (NULL != meswin.shell) {
-    meswin_dialog_free(&meswin);
-    fc_assert(NULL == meswin.shell);
-  }
-}
-
-/************************************************************************//**
-  Return TRUE iff the message window is open.
-****************************************************************************/
-bool meswin_dialog_is_open(void)
-{
-  return (NULL != meswin.shell);
-}
-
-/************************************************************************//**
-  Update the message window dialog.
-****************************************************************************/
-void real_meswin_dialog_update(void *unused)
-{
-  if (NULL != meswin.shell) {
-    meswin_dialog_refresh(&meswin);
-  }
-}
diff --git a/client/gui-gtk-5.0/messagewin.h b/client/gui-gtk-5.0/messagewin.h
deleted file mode 100644
index 6242977a33..0000000000
--- a/client/gui-gtk-5.0/messagewin.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__MESSAGEWIN_H
-#define FC__MESSAGEWIN_H
-
-/* client */
-#include "messagewin_g.h"
-
-void meswin_dialog_popdown(void);
-
-#endif  /* FC__MESSAGEWIN_H */
diff --git a/client/gui-gtk-5.0/optiondlg.c b/client/gui-gtk-5.0/optiondlg.c
deleted file mode 100644
index 31f65c10e3..0000000000
--- a/client/gui-gtk-5.0/optiondlg.c
+++ /dev/null
@@ -1,1099 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "log.h"
-#include "mem.h"
-#include "string_vector.h"
-
-/* client */
-#include "options.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "pages.h"
-
-#include "optiondlg.h"
-
-
-/* The option dialog data. */
-struct option_dialog {
-  const struct option_set *poptset;     /* The option set. */
-  GtkWidget *shell;                     /* The main widget. */
-  GtkWidget *notebook;                  /* The notebook. */
-  GtkWidget **vboxes;                   /* Category boxes. */
-  int *box_children;                    /* The number of children for
-                                         * each category. */
-};
-
-#define SPECLIST_TAG option_dialog
-#define SPECLIST_TYPE struct option_dialog
-#include "speclist.h"
-#define option_dialogs_iterate(pdialog) \
-  TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog)
-#define option_dialogs_iterate_end  LIST_ITERATE_END
-
-/* All option dialog are set on this list. */
-static struct option_dialog_list *option_dialogs = NULL;
-
-enum {
-  RESPONSE_CANCEL,
-  RESPONSE_OK,
-  RESPONSE_APPLY,
-  RESPONSE_RESET,
-  RESPONSE_REFRESH,
-  RESPONSE_SAVE
-};
-
-static GtkWidget *opt_popover = NULL;
-
-
-/* Option dialog main functions. */
-static struct option_dialog *
-option_dialog_get(const struct option_set *poptset);
-static struct option_dialog *
-option_dialog_new(const char *name, const struct option_set *poptset);
-static void option_dialog_destroy(struct option_dialog *pdialog);
-
-static void option_dialog_reorder_notebook(struct option_dialog *pdialog);
-static inline void option_dialog_foreach(struct option_dialog *pdialog,
-                                         void (*option_action)
-                                         (struct option *));
-
-/* Option dialog option-specific functions. */
-static void option_dialog_option_add(struct option_dialog *pdialog,
-                                     struct option *poption,
-                                     bool reorder_notebook);
-static void option_dialog_option_remove(struct option_dialog *pdialog,
-                                        struct option *poption);
-
-static void option_dialog_option_refresh(struct option *poption);
-static void option_dialog_option_reset(struct option *poption);
-static void option_dialog_option_apply(struct option *poption);
-
-
-/************************************************************************//**
-  Option dialog widget response callback.
-****************************************************************************/
-static void option_dialog_reponse_callback(GtkDialog *dialog,
-                                           gint response_id, gpointer data)
-{
-  struct option_dialog *pdialog = (struct option_dialog *) data;
-
-  switch (response_id) {
-  case RESPONSE_CANCEL:
-    gtk_window_destroy(GTK_WINDOW(dialog));
-    break;
-  case RESPONSE_OK:
-    option_dialog_foreach(pdialog, option_dialog_option_apply);
-    gtk_window_destroy(GTK_WINDOW(dialog));
-    break;
-  case RESPONSE_APPLY:
-    option_dialog_foreach(pdialog, option_dialog_option_apply);
-    break;
-  case RESPONSE_RESET:
-    option_dialog_foreach(pdialog, option_dialog_option_reset);
-    break;
-  case RESPONSE_REFRESH:
-    option_dialog_foreach(pdialog, option_dialog_option_refresh);
-    break;
-  case RESPONSE_SAVE:
-    option_dialog_foreach(pdialog, option_dialog_option_apply);
-    queue_options_save(NULL);
-    break;
-  }
-}
-
-/************************************************************************//**
-  Option dialog widget destroyed callback.
-****************************************************************************/
-static void option_dialog_destroy_callback(GtkWidget *object, gpointer data)
-{
-  struct option_dialog *pdialog = (struct option_dialog *) data;
-
-  /* Save size of the dialog. */
-  gtk_window_get_default_size(GTK_WINDOW(object),
-                              &GUI_GTK_OPTION(optionsdlg_xsize),
-                              &GUI_GTK_OPTION(optionsdlg_ysize));
-
-  if (NULL != pdialog->shell) {
-    /* Mark as destroyed, see also option_dialog_destroy(). */
-    pdialog->shell = NULL;
-    option_dialog_destroy(pdialog);
-  }
-}
-
-/************************************************************************//**
-  Option refresh requested from menu.
-****************************************************************************/
-static void option_refresh_callback(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data)
-{
-  struct option *poption = (struct option *)data;
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_refresh(poption);
-  }
-
-  gtk_widget_unparent(opt_popover);
-  g_object_unref(opt_popover);
-}
-
-/************************************************************************//**
-  Option reset requested from menu.
-****************************************************************************/
-static void option_reset_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct option *poption = (struct option *) data;
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_reset(poption);
-  }
-
-  gtk_widget_unparent(opt_popover);
-  g_object_unref(opt_popover);
-}
-
-/************************************************************************//**
-  Option apply requested from menu.
-****************************************************************************/
-static void option_apply_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct option *poption = (struct option *) data;
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_apply(poption);
-  }
-
-  gtk_widget_unparent(opt_popover);
-  g_object_unref(opt_popover);
-}
-
-/************************************************************************//**
-  Called when a button is pressed on an option.
-****************************************************************************/
-static gboolean option_button_press_callback(GtkGestureClick *gesture,
-                                             int n_press,
-                                             double x, double y,
-                                             gpointer data)
-{
-  struct option *poption = (struct option *) data;
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkWidget *parent = gtk_event_controller_get_widget(controller);
-  GMenu *menu;
-  GActionGroup *group;
-  GSimpleAction *act;
-  GdkRectangle rect = { .x = x, .y = y, .width = 1, .height = 1};
-
-  if (!option_is_changeable(poption)) {
-    return FALSE;
-  }
-
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-
-  menu = g_menu_new();
-
-  act = g_simple_action_new("refresh", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(option_refresh_callback), poption);
-  menu_item_append_unref(menu, g_menu_item_new(_("Refresh this option"),
-                                               "win.refresh"));
-
-  act = g_simple_action_new("unit_reset", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(option_reset_callback), poption);
-  menu_item_append_unref(menu, g_menu_item_new(_("Reset this option"),
-                                               "win.unit_reset"));
-
-  act = g_simple_action_new("units_apply", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(option_apply_callback), poption);
-  menu_item_append_unref(menu,
-                         g_menu_item_new(_("Apply the changes for this option"),
-                                         "win.units_apply"));
-
-  opt_popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
-  g_object_ref(opt_popover);
-  gtk_widget_insert_action_group(opt_popover, "win", group);
-
-  gtk_widget_set_parent(opt_popover, parent);
-  gtk_popover_set_pointing_to(GTK_POPOVER(opt_popover), &rect);
-
-  gtk_popover_popup(GTK_POPOVER(opt_popover));
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Returns the option dialog which fit the option set.
-****************************************************************************/
-static struct option_dialog *
-option_dialog_get(const struct option_set *poptset)
-{
-  if (NULL != option_dialogs) {
-    option_dialogs_iterate(pdialog) {
-      if (pdialog->poptset == poptset) {
-        return pdialog;
-      }
-    } option_dialogs_iterate_end;
-  }
-  return NULL;
-}
-
-/************************************************************************//**
-  GDestroyNotify callback.
-****************************************************************************/
-static void option_color_destroy_notify(gpointer data)
-{
-  GdkRGBA *color = (GdkRGBA *) data;
-
-  if (NULL != color) {
-    gdk_rgba_free(color);
-  }
-}
-
-/************************************************************************//**
-  Set the color of a button.
-****************************************************************************/
-static void option_color_set_button_color(GtkButton *button,
-                                          const GdkRGBA *new_color)
-{
-  GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
-  GtkWidget *child;
-
-  if (NULL == new_color) {
-    if (NULL != current_color) {
-      g_object_set_data(G_OBJECT(button), "color", NULL);
-      gtk_button_set_child(button, NULL);
-    }
-  } else {
-    GdkPixbuf *pixbuf;
-
-    /* Apply the new color. */
-    if (NULL != current_color) {
-      /* We already have a GdkRGBA pointer. */
-      *current_color = *new_color;
-    } else {
-      /* We need to make a GdkRGBA pointer. */
-      current_color = gdk_rgba_copy(new_color);
-      g_object_set_data_full(G_OBJECT(button), "color", current_color,
-                             option_color_destroy_notify);
-    }
-    gtk_button_set_child(button, nullptr);
-
-    /* Update the button. */
-    {
-      cairo_surface_t *surface = cairo_image_surface_create(
-          CAIRO_FORMAT_RGB24, 16, 16);
-      cairo_t *cr = cairo_create(surface);
-
-      gdk_cairo_set_source_rgba(cr, current_color);
-      cairo_paint(cr);
-      cairo_destroy(cr);
-      pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
-      cairo_surface_destroy(surface);
-    }
-
-    child = gtk_image_new_from_pixbuf(pixbuf);
-    gtk_button_set_child(GTK_BUTTON(button), child);
-    gtk_widget_set_visible(child, TRUE);
-    g_object_unref(G_OBJECT(pixbuf));
-  }
-}
-
-/************************************************************************//**
-  "response" signal callback.
-****************************************************************************/
-static void color_selector_response_callback(GtkDialog *dialog,
-                                             gint res, gpointer data)
-{
-  if (res == GTK_RESPONSE_REJECT) {
-    /* Clears the current color. */
-    option_color_set_button_color(GTK_BUTTON(data), NULL);
-  } else if (res == GTK_RESPONSE_OK) {
-    /* Apply the new color. */
-    GtkColorChooser *chooser =
-      GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
-    GdkRGBA new_color;
-
-    gtk_color_chooser_get_rgba(chooser, &new_color);
-    option_color_set_button_color(GTK_BUTTON(data), &new_color);
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
-
-/************************************************************************//**
-  Called when the user press a color button.
-****************************************************************************/
-static void option_color_select_callback(GtkButton *button, gpointer data)
-{
-  GtkWidget *dialog, *chooser;
-  GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
-
-  dialog = gtk_dialog_new_with_buttons(_("Select a color"), NULL,
-                                       GTK_DIALOG_MODAL,
-                                       _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                       _("C_lear"), GTK_RESPONSE_REJECT,
-                                       _("_OK"), GTK_RESPONSE_OK, NULL);
-  setup_dialog(dialog, toplevel);
-  g_signal_connect(dialog, "response",
-                   G_CALLBACK(color_selector_response_callback), button);
-
-  chooser = gtk_color_chooser_widget_new();
-  g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                             chooser, nullptr);
-  if (current_color != nullptr) {
-    gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(chooser), current_color);
-  }
-
-  gtk_widget_set_visible(dialog, TRUE);
-}
-
-/************************************************************************//**
-  Creates a new option dialog.
-****************************************************************************/
-static struct option_dialog *
-option_dialog_new(const char *name, const struct option_set *poptset)
-{
-  struct option_dialog *pdialog;
-  const int CATEGORY_NUM = optset_category_number(poptset);
-
-  /* Create the dialog structure. */
-  pdialog = fc_malloc(sizeof(*pdialog));
-  pdialog->poptset = poptset;
-  pdialog->shell = gtk_dialog_new_with_buttons(name, NULL, 0,
-                                               _("_Cancel"), RESPONSE_CANCEL,
-                                               _("_Save"), RESPONSE_SAVE,
-                                               _("_Refresh"), RESPONSE_REFRESH,
-                                               _("Reset"), RESPONSE_RESET,
-                                               _("_Apply"), RESPONSE_APPLY,
-                                               _("_OK"), RESPONSE_OK, NULL);
-  pdialog->notebook = gtk_notebook_new();
-  pdialog->vboxes = fc_calloc(CATEGORY_NUM, sizeof(*pdialog->vboxes));
-  pdialog->box_children = fc_calloc(CATEGORY_NUM,
-                                    sizeof(*pdialog->box_children));
-
-  /* Append to the option dialog list. */
-  if (NULL == option_dialogs) {
-    option_dialogs = option_dialog_list_new();
-  }
-  option_dialog_list_append(option_dialogs, pdialog);
-
-  /* Shell */
-  setup_dialog(pdialog->shell, toplevel);
-  gtk_window_set_default_size(GTK_WINDOW(pdialog->shell),
-                              GUI_GTK_OPTION(optionsdlg_xsize),
-                              GUI_GTK_OPTION(optionsdlg_ysize));
-  g_signal_connect(pdialog->shell, "response",
-                   G_CALLBACK(option_dialog_reponse_callback), pdialog);
-  g_signal_connect(pdialog->shell, "destroy",
-                   G_CALLBACK(option_dialog_destroy_callback), pdialog);
-
-  gtk_box_insert_child_after(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(pdialog->shell))),
-                             pdialog->notebook, NULL);
-
-  /* Add the options. */
-  options_iterate(poptset, poption) {
-    option_dialog_option_add(pdialog, poption, FALSE);
-  } options_iterate_end;
-
-  option_dialog_reorder_notebook(pdialog);
-
-  /* Show the widgets. */
-  gtk_widget_set_visible(pdialog->shell, TRUE);
-
-  return pdialog;
-}
-
-/************************************************************************//**
-  Destroys an option dialog.
-****************************************************************************/
-static void option_dialog_destroy(struct option_dialog *pdialog)
-{
-  GtkWidget *shell = pdialog->shell;
-
-  if (NULL != option_dialogs) {
-    option_dialog_list_remove(option_dialogs, pdialog);
-  }
-
-  options_iterate(pdialog->poptset, poption) {
-    option_set_gui_data(poption, NULL);
-  } options_iterate_end;
-
-  if (NULL != shell) {
-    /* Maybe already destroyed, see also option_dialog_destroy_callback(). */
-    pdialog->shell = NULL;
-    gtk_window_destroy(GTK_WINDOW(shell));
-  }
-
-  free(pdialog->vboxes);
-  free(pdialog->box_children);
-  free(pdialog);
-}
-
-/************************************************************************//**
-  Utility for sorting the pages of an option dialog.
-****************************************************************************/
-static int option_dialog_pages_sort_func(const void *w1, const void *w2)
-{
-  GObject *obj1 = G_OBJECT(*(GtkWidget **) w1);
-  GObject *obj2 = G_OBJECT(*(GtkWidget **) w2);
-
-  return (GPOINTER_TO_INT(g_object_get_data(obj1, "category"))
-          - GPOINTER_TO_INT(g_object_get_data(obj2, "category")));
-}
-
-/************************************************************************//**
-  Reorder the pages of the notebook of the option dialog.
-****************************************************************************/
-static void option_dialog_reorder_notebook(struct option_dialog *pdialog)
-{
-  GtkNotebook *notebook = GTK_NOTEBOOK(pdialog->notebook);
-  const int pages_num = gtk_notebook_get_n_pages(notebook);
-
-  if (0 < pages_num) {
-    GtkWidget *pages[pages_num];
-    int i;
-
-    for (i = 0; i < pages_num; i++) {
-      pages[i] = gtk_notebook_get_nth_page(notebook, i);
-    }
-    qsort(pages, pages_num, sizeof(*pages), option_dialog_pages_sort_func);
-    for (i = 0; i < pages_num; i++) {
-      gtk_notebook_reorder_child(notebook, pages[i], i);
-    }
-  }
-}
-
-/************************************************************************//**
-  Do an action for all options of the option dialog.
-****************************************************************************/
-static inline void option_dialog_foreach(struct option_dialog *pdialog,
-                                         void (*option_action)
-                                         (struct option *))
-{
-  fc_assert_ret(NULL != pdialog);
-
-  options_iterate(pdialog->poptset, poption) {
-    option_action(poption);
-  } options_iterate_end;
-}
-
-/************************************************************************//**
-  Add an option to the option dialog.
-****************************************************************************/
-static void option_dialog_option_add(struct option_dialog *pdialog,
-                                     struct option *poption,
-                                     bool reorder_notebook)
-{
-  const int category = option_category(poption);
-  GtkWidget *main_hbox, *label, *w = NULL;
-  int main_col = 0;
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  fc_assert(NULL == option_get_gui_data(poption));
-
-  /* Add category if needed. */
-  if (NULL == pdialog->vboxes[category]) {
-    GtkWidget *sw;
-
-    sw = gtk_scrolled_window_new();
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                   GTK_POLICY_NEVER,
-                                   GTK_POLICY_AUTOMATIC);
-    gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(sw), TRUE);
-    g_object_set_data(G_OBJECT(sw), "category", GINT_TO_POINTER(category));
-    gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), sw,
-                             gtk_label_new_with_mnemonic
-                             (option_category_name(poption)));
-
-    if (reorder_notebook) {
-      option_dialog_reorder_notebook(pdialog);
-    }
-
-    pdialog->vboxes[category] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-    gtk_widget_set_margin_bottom(pdialog->vboxes[category], 8);
-    gtk_widget_set_margin_end(pdialog->vboxes[category], 8);
-    gtk_widget_set_margin_start(pdialog->vboxes[category], 8);
-    gtk_widget_set_margin_top(pdialog->vboxes[category], 8);
-    gtk_widget_set_hexpand(pdialog->vboxes[category], TRUE);
-    gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw),
-                                  pdialog->vboxes[category]);
-
-    gtk_widget_set_visible(sw, TRUE);
-  }
-  pdialog->box_children[category]++;
-
-  main_hbox = gtk_grid_new();
-  label = gtk_label_new(option_description(poption));
-  gtk_widget_set_margin_bottom(label, 2);
-  gtk_widget_set_margin_end(label, 2);
-  gtk_widget_set_margin_start(label, 2);
-  gtk_widget_set_margin_top(label, 2);
-  gtk_grid_attach(GTK_GRID(main_hbox), label, main_col++, 0, 1, 1);
-  gtk_widget_set_tooltip_text(main_hbox, option_help_text(poption));
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(option_button_press_callback), poption);
-  gtk_widget_add_controller(main_hbox, controller);
-  gtk_box_append(GTK_BOX(pdialog->vboxes[category]), main_hbox);
-
-  switch (option_type(poption)) {
-  case OT_BOOLEAN:
-    w = gtk_check_button_new();
-    break;
-
-  case OT_INTEGER:
-    {
-      int min = option_int_min(poption), max = option_int_max(poption);
-
-      w = gtk_spin_button_new_with_range(min, max, MAX((max - min) / 50, 1));
-    }
-    break;
-
-  case OT_STRING:
-    {
-      const struct strvec *values = option_str_values(poption);
-
-      if (NULL != values) {
-        w = gtk_combo_box_text_new_with_entry();
-        strvec_iterate(values, value) {
-          gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(w), value);
-        } strvec_iterate_end;
-      } else {
-        w = gtk_entry_new();
-      }
-    }
-    break;
-
-  case OT_ENUM:
-    {
-      int i;
-      const char *str;
-      GtkListStore *model;
-      GtkCellRenderer *renderer;
-      GtkTreeIter iter;
-
-      /* 0: enum index, 1: translated enum name. */
-      model = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
-      w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
-      g_object_unref(model);
-
-      renderer = gtk_cell_renderer_text_new();
-      gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer, FALSE);
-      gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer,
-                                     "text", 1, NULL);
-      for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) {
-        gtk_list_store_append(model, &iter);
-        gtk_list_store_set(model, &iter, 0, i, 1, _(str), -1);
-      }
-    }
-    break;
-
-  case OT_BITWISE:
-    {
-      GList *list = NULL;
-      GtkWidget *grid, *check;
-      const struct strvec *values = option_bitwise_values(poption);
-      int i;
-
-      w = gtk_frame_new(NULL);
-      grid = gtk_grid_new();
-      gtk_grid_set_column_spacing(GTK_GRID(grid), 4);
-      gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE);
-      gtk_frame_set_child(GTK_FRAME(w), grid);
-      for (i = 0; i < strvec_size(values); i++) {
-        check = gtk_check_button_new();
-        gtk_grid_attach(GTK_GRID(grid), check, 0, i, 1, 1);
-        label = gtk_label_new(_(strvec_get(values, i)));
-        gtk_grid_attach(GTK_GRID(grid), label, 1, i, 1, 1);
-        list = g_list_append(list, check);
-      }
-      g_object_set_data_full(G_OBJECT(w), "check_buttons", list,
-                             (GDestroyNotify) g_list_free);
-    }
-    break;
-
-  case OT_FONT:
-    w = gtk_font_button_new();
-    g_object_set(G_OBJECT(w), "use-font", TRUE, NULL);
-    break;
-
-  case OT_COLOR:
-    {
-      GtkWidget *button;
-      int grid_col = 0;
-
-      w = gtk_grid_new();
-      gtk_grid_set_column_spacing(GTK_GRID(w), 4);
-      gtk_grid_set_row_homogeneous(GTK_GRID(w), TRUE);
-
-      /* Foreground color selector button. */
-      button = gtk_button_new();
-      gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
-      gtk_widget_set_tooltip_text(GTK_WIDGET(button),
-                                  _("Select the text color"));
-      g_object_set_data(G_OBJECT(w), "fg_button", button);
-      g_signal_connect(button, "clicked",
-                       G_CALLBACK(option_color_select_callback), NULL);
-
-      /* Background color selector button. */
-      button = gtk_button_new();
-      gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
-      gtk_widget_set_tooltip_text(GTK_WIDGET(button),
-                                  _("Select the background color"));
-      g_object_set_data(G_OBJECT(w), "bg_button", button);
-      g_signal_connect(button, "clicked",
-                       G_CALLBACK(option_color_select_callback), NULL);
-    }
-    break;
-
-  case OT_VIDEO_MODE:
-    log_error("Option type %s (%d) not supported yet.",
-              option_type_name(option_type(poption)),
-              option_type(poption));
-    break;
-  }
-
-  option_set_gui_data(poption, w);
-  if (NULL == w) {
-    log_error("Failed to create a widget for option %d \"%s\".",
-              option_number(poption), option_name(poption));
-  } else {
-    g_object_set_data(G_OBJECT(w), "main_widget", main_hbox);
-    g_object_set_data(G_OBJECT(w), "parent_of_main", pdialog->vboxes[category]);
-    gtk_widget_set_hexpand(w, TRUE);
-    gtk_widget_set_halign(w, GTK_ALIGN_END);
-    gtk_grid_attach(GTK_GRID(main_hbox), w, main_col++, 0, 1, 1);
-  }
-
-  gtk_widget_set_visible(main_hbox, TRUE);
-
-  /* Set as current value. */
-  option_dialog_option_refresh(poption);
-}
-
-/************************************************************************//**
-  Remove an option from the option dialog.
-****************************************************************************/
-static void option_dialog_option_remove(struct option_dialog *pdialog,
-                                        struct option *poption)
-{
-  GObject *object = G_OBJECT(option_get_gui_data(poption));
-
-  if (NULL != object) {
-    const int category = option_category(poption);
-
-    option_set_gui_data(poption, NULL);
-    gtk_box_remove(GTK_BOX(g_object_get_data(object, "parent_of_main")),
-                   GTK_WIDGET(g_object_get_data(object, "main_widget")));
-
-    /* Remove category if needed. */
-    if (0 == --pdialog->box_children[category]) {
-      gtk_notebook_remove_page(GTK_NOTEBOOK(pdialog->notebook), category);
-      pdialog->vboxes[category] = NULL;
-    }
-  }
-}
-
-/************************************************************************//**
-  Set the boolean value of the option.
-****************************************************************************/
-static inline void option_dialog_option_bool_set(struct option *poption,
-                                                 bool value)
-{
-  gtk_check_button_set_active(GTK_CHECK_BUTTON
-                              (option_get_gui_data(poption)),
-                              value);
-}
-
-/************************************************************************//**
-  Set the integer value of the option.
-****************************************************************************/
-static inline void option_dialog_option_int_set(struct option *poption,
-                                                int value)
-{
-  gtk_spin_button_set_value(GTK_SPIN_BUTTON(option_get_gui_data(poption)),
-                            value);
-}
-
-/************************************************************************//**
-  Set the string value of the option.
-****************************************************************************/
-static inline void option_dialog_option_str_set(struct option *poption,
-                                                const char *string)
-{
-  GtkWidget *wdg = option_get_gui_data(poption);
-
-  if (NULL != option_str_values(poption)) {
-    GtkWidget *child = gtk_combo_box_get_child(GTK_COMBO_BOX(wdg));
-
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(child)), string, -1);
-  } else {
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(wdg)), string, -1);
-  }
-}
-
-/************************************************************************//**
-  Set the enum value of the option.
-****************************************************************************/
-static inline void option_dialog_option_enum_set(struct option *poption,
-                                                 int value)
-{
-  GtkComboBox *combo = GTK_COMBO_BOX(option_get_gui_data(poption));
-  GtkTreeModel *model = gtk_combo_box_get_model(combo);
-  GtkTreeIter iter;
-  int i;
-
-  if (gtk_tree_model_get_iter_first(model, &iter)) {
-    do {
-      gtk_tree_model_get(model, &iter, 0, &i, -1);
-      if (i == value) {
-        gtk_combo_box_set_active_iter(combo, &iter);
-        return;
-      }
-    } while (gtk_tree_model_iter_next(model, &iter));
-  }
-
-  log_error("Didn't find the value %d for option \"%s\" (nb %d).",
-            value, option_name(poption), option_number(poption));
-}
-
-/************************************************************************//**
-  Set the enum value of the option.
-****************************************************************************/
-static inline void option_dialog_option_bitwise_set(struct option *poption,
-                                                    unsigned value)
-{
-  GObject *data = option_get_gui_data(poption);
-  GList *iter = g_object_get_data(data, "check_buttons");
-  int bit;
-
-  for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
-    gtk_check_button_set_active(GTK_CHECK_BUTTON(iter->data),
-                                value & (1 << bit));
-  }
-}
-
-/************************************************************************//**
-  Set the font value of the option.
-****************************************************************************/
-static inline void option_dialog_option_font_set(struct option *poption,
-                                                 const char *font)
-{
-  gtk_font_chooser_set_font(GTK_FONT_CHOOSER
-                            (option_get_gui_data(poption)), font);
-}
-
-/************************************************************************//**
-  Set the font value of the option.
-****************************************************************************/
-static inline void option_dialog_option_color_set(struct option *poption,
-                                                  struct ft_color color)
-{
-  GtkWidget *w = option_get_gui_data(poption);
-  GdkRGBA gdk_color;
-
-  /* Update the foreground button. */
-  if (NULL != color.foreground
-      && '\0' != color.foreground[0]
-      && gdk_rgba_parse(&gdk_color, color.foreground)) {
-    option_color_set_button_color(g_object_get_data(G_OBJECT(w),
-                                                    "fg_button"),
-                                  &gdk_color);
-  } else {
-    option_color_set_button_color(g_object_get_data(G_OBJECT(w),
-                                                    "fg_button"), NULL);
-  }
-
-  /* Update the background button. */
-  if (NULL != color.background
-      && '\0' != color.background[0]
-      && gdk_rgba_parse(&gdk_color, color.background)) {
-    option_color_set_button_color(g_object_get_data(G_OBJECT(w),
-                                                    "bg_button"),
-                                  &gdk_color);
-  } else {
-    option_color_set_button_color(g_object_get_data(G_OBJECT(w),
-                                                    "bg_button"), NULL);
-  }
-}
-
-/************************************************************************//**
-  Update an option in the option dialog.
-****************************************************************************/
-static void option_dialog_option_refresh(struct option *poption)
-{
-  switch (option_type(poption)) {
-  case OT_BOOLEAN:
-    option_dialog_option_bool_set(poption, option_bool_get(poption));
-    break;
-  case OT_INTEGER:
-    option_dialog_option_int_set(poption, option_int_get(poption));
-    break;
-  case OT_STRING:
-    option_dialog_option_str_set(poption, option_str_get(poption));
-    break;
-  case OT_ENUM:
-    option_dialog_option_enum_set(poption, option_enum_get_int(poption));
-    break;
-  case OT_BITWISE:
-    option_dialog_option_bitwise_set(poption, option_bitwise_get(poption));
-    break;
-  case OT_FONT:
-    option_dialog_option_font_set(poption, option_font_get(poption));
-    break;
-  case OT_COLOR:
-    option_dialog_option_color_set(poption, option_color_get(poption));
-    break;
-  case OT_VIDEO_MODE:
-    log_error("Option type %s (%d) not supported yet.",
-              option_type_name(option_type(poption)),
-              option_type(poption));
-    break;
-  }
-
-  gtk_widget_set_sensitive(option_get_gui_data(poption),
-                           option_is_changeable(poption));
-}
-
-/************************************************************************//**
-  Reset the option.
-****************************************************************************/
-static void option_dialog_option_reset(struct option *poption)
-{
-  switch (option_type(poption)) {
-  case OT_BOOLEAN:
-    option_dialog_option_bool_set(poption, option_bool_def(poption));
-    break;
-  case OT_INTEGER:
-    option_dialog_option_int_set(poption, option_int_def(poption));
-    break;
-  case OT_STRING:
-    option_dialog_option_str_set(poption, option_str_def(poption));
-    break;
-  case OT_ENUM:
-    option_dialog_option_enum_set(poption, option_enum_def_int(poption));
-    break;
-  case OT_BITWISE:
-    option_dialog_option_bitwise_set(poption, option_bitwise_def(poption));
-    break;
-  case OT_FONT:
-    option_dialog_option_font_set(poption, option_font_def(poption));
-    break;
-  case OT_COLOR:
-    option_dialog_option_color_set(poption, option_color_def(poption));
-    break;
-  case OT_VIDEO_MODE:
-    log_error("Option type %s (%d) not supported yet.",
-              option_type_name(option_type(poption)),
-              option_type(poption));
-    break;
-  }
-}
-
-/************************************************************************//**
-  Apply the option change.
-****************************************************************************/
-static void option_dialog_option_apply(struct option *poption)
-{
-  GtkWidget *w = GTK_WIDGET(option_get_gui_data(poption));
-
-  switch (option_type(poption)) {
-  case OT_BOOLEAN:
-    (void) option_bool_set(poption, gtk_check_button_get_active
-                           (GTK_CHECK_BUTTON(w)));
-    break;
-
-  case OT_INTEGER:
-    (void) option_int_set(poption, gtk_spin_button_get_value_as_int
-                          (GTK_SPIN_BUTTON(w)));
-    break;
-
-  case OT_STRING:
-    if (NULL != option_str_values(poption)) {
-      (void) option_str_set(poption,
-                            gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(w)));
-    } else {
-      (void) option_str_set(poption, gtk_entry_buffer_get_text(
-                                                 gtk_entry_get_buffer(GTK_ENTRY(w))));
-    }
-    break;
-
-  case OT_ENUM:
-    {
-      GtkTreeIter iter;
-      int value;
-
-      if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(w), &iter)) {
-        break;
-      }
-
-      gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(w)),
-                         &iter, 0, &value, -1);
-      (void) option_enum_set_int(poption, value);
-    }
-    break;
-
-  case OT_BITWISE:
-    {
-      GList *iter = g_object_get_data(G_OBJECT(w), "check_buttons");
-      unsigned value = 0;
-      int bit;
-
-      for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
-        if (gtk_check_button_get_active(GTK_CHECK_BUTTON(iter->data))) {
-          value |= 1 << bit;
-        }
-      }
-      (void) option_bitwise_set(poption, value);
-    }
-    break;
-
-  case OT_FONT:
-    (void) option_font_set(poption, gtk_font_chooser_get_font
-                           (GTK_FONT_CHOOSER(w)));
-    break;
-
-  case OT_COLOR:
-    {
-      gchar *fg_color_text = NULL, *bg_color_text = NULL;
-      GObject *button;
-      GdkRGBA *color;
-
-      /* Get foreground color. */
-      button = g_object_get_data(G_OBJECT(w), "fg_button");
-      color = g_object_get_data(button, "color");
-      if (color) fg_color_text = gdk_rgba_to_string(color);
-
-      /* Get background color. */
-      button = g_object_get_data(G_OBJECT(w), "bg_button");
-      color = g_object_get_data(button, "color");
-      if (color) bg_color_text = gdk_rgba_to_string(color);
-
-      (void) option_color_set(poption,
-                              ft_color_construct(fg_color_text, bg_color_text));
-      g_free(fg_color_text);
-      g_free(bg_color_text);
-    }
-    break;
-
-  case OT_VIDEO_MODE:
-    log_error("Option type %s (%d) not supported yet.",
-              option_type_name(option_type(poption)),
-              option_type(poption));
-    break;
-  }
-}
-
-/************************************************************************//**
-  Popup the option dialog for the option set.
-****************************************************************************/
-void option_dialog_popup(const char *name, const struct option_set *poptset)
-{
-  struct option_dialog *pdialog = option_dialog_get(poptset);
-
-  if (NULL != pdialog) {
-    option_dialog_foreach(pdialog, option_dialog_option_refresh);
-  } else {
-    (void) option_dialog_new(name, poptset);
-  }
-}
-
-/************************************************************************//**
-  Popdown the option dialog for the option set.
-****************************************************************************/
-void option_dialog_popdown(const struct option_set *poptset)
-{
-  struct option_dialog *pdialog = option_dialog_get(poptset);
-
-  if (NULL != pdialog) {
-    option_dialog_destroy(pdialog);
-  }
-}
-
-/************************************************************************//**
-  Pass on updated option values to controls outside the main option
-  dialogs.
-****************************************************************************/
-static void option_gui_update_extra(struct option *poption)
-{
-  if (option_optset(poption) == server_optset) {
-    if (strcmp(option_name(poption), "aifill") == 0) {
-      ai_fill_changed_by_server(option_int_get(poption));
-    } else if (strcmp(option_name(poption), "nationset") == 0) {
-      nationset_sync_to_server(option_str_get(poption));
-    }
-  }
-}
-
-/************************************************************************//**
-  Update the GUI for the option.
-****************************************************************************/
-void option_gui_update(struct option *poption)
-{
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_refresh(poption);
-  }
-
-  option_gui_update_extra(poption);
-}
-
-/************************************************************************//**
-  Add the GUI for the option.
-****************************************************************************/
-void option_gui_add(struct option *poption)
-{
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_add(pdialog, poption, TRUE);
-  }
-
-  option_gui_update_extra(poption);
-}
-
-/************************************************************************//**
-  Remove the GUI for the option.
-****************************************************************************/
-void option_gui_remove(struct option *poption)
-{
-  struct option_dialog *pdialog = option_dialog_get(option_optset(poption));
-
-  if (NULL != pdialog) {
-    option_dialog_option_remove(pdialog, poption);
-  }
-}
diff --git a/client/gui-gtk-5.0/optiondlg.h b/client/gui-gtk-5.0/optiondlg.h
deleted file mode 100644
index ba7e11efa3..0000000000
--- a/client/gui-gtk-5.0/optiondlg.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__OPTIONDLG_H
-#define FC__OPTIONDLG_H
-
-/* client */
-#include "optiondlg_g.h"
-
-void option_dialog_popup(const char *name, const struct option_set *poptset);
-
-#endif /* FC__OPTIONDLG_H */
diff --git a/client/gui-gtk-5.0/pages.c b/client/gui-gtk-5.0/pages.c
deleted file mode 100644
index 32030ae8b7..0000000000
--- a/client/gui-gtk-5.0/pages.c
+++ /dev/null
@@ -1,4145 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <time.h>
-
-#include <sys/stat.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "chat.h"
-#include "dataio.h"
-#include "game.h"
-#include "mapimg.h"
-#include "version.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "clinet.h"
-#include "connectdlg_common.h"
-#include "packhand.h"
-#include "servers.h"
-#include "update_queue.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "connectdlg.h"
-#include "dialogs.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "mapview.h"
-#include "menu.h"
-#include "optiondlg.h"
-#include "plrdlg.h"             /* get_flag() */
-#include "repodlgs.h"
-#include "voteinfo_bar.h"
-
-#include "pages.h"
-
-
-static GtkWidget *scenario_description;
-static GtkWidget *scenario_authors;
-static GtkWidget *scenario_filename;
-static GtkWidget *scenario_version;
-
-static GtkListStore *load_store, *scenario_store, *meta_store, *lan_store;
-
-static GtkListStore *server_playerlist_store;
-static GtkWidget *server_playerlist_view;
-
-static GtkTreeSelection *load_selection, *scenario_selection;
-static GtkTreeSelection *meta_selection, *lan_selection;
-
-/* This is the current page. Invalid value at start, to be sure that it won't
- * be caught through a switch() statement. */
-static enum client_pages current_page = -1;
-
-struct server_scan_timer_data
-{
-  struct server_scan *scan;
-  guint timer;
-};
-
-static struct server_scan_timer_data meta_scan = { NULL, 0 };
-static struct server_scan_timer_data lan_scan = { NULL, 0 };
-
-static GtkWidget *statusbar, *statusbar_frame;
-static GQueue *statusbar_queue;
-static guint statusbar_timer = 0;
-
-static GtkWidget *ruleset_combo;
-
-static GtkWidget *conn_popover = NULL;
-
-static bool holding_srv_list_mutex = FALSE;
-
-static void connection_state_reset(void);
-
-#define FC_TYPE_HOST_ROW (fc_host_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcHostRow, fc_host_row, FC, HOST_ROW, GObject)
-
-struct _FcHostRow
-{
-  GObject parent_instance;
-
-  char *host;
-  int port;
-  char *version;
-  char *state;
-  int nplayers;
-  char *humans;
-  char *message;
-};
-
-struct _FcHostClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcHostRow, fc_host_row, G_TYPE_OBJECT)
-
-enum host_rows {
-  host_row_host,
-  host_row_port,
-  host_row_version,
-  host_row_state,
-  host_row_nplayers,
-  host_row_humans,
-  host_row_message
-};
-
-
-#define FC_TYPE_PLR_ROW (fc_plr_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcPlrRow, fc_plr_row, FC, PLR_ROW, GObject)
-
-struct _FcPlrRow
-{
-  GObject parent_instance;
-
-  char *name;
-  char *type;
-  char *host;
-  char *nation;
-};
-
-struct _FcPlrClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcPlrRow, fc_plr_row, G_TYPE_OBJECT)
-
-enum plr_rows {
-  plr_row_name,
-  plr_row_type,
-  plr_row_host,
-  plr_row_nation
-};
-
-
-#define FC_TYPE_SCEN_ROW (fc_scen_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcScenRow, fc_scen_row, FC, SCEN_ROW, GObject)
-
-struct _FcScenRow
-{
-  GObject parent_instance;
-
-  char *name;
-  char *desc;
-  char *authors;
-  char *filename;
-  int ver;
-};
-
-struct _FcScenClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcScenRow, fc_scen_row, G_TYPE_OBJECT)
-
-
-#define FC_TYPE_SAVE_ROW (fc_save_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcSaveRow, fc_save_row, FC, SAVE_ROW, GObject)
-
-struct _FcSaveRow
-{
-  GObject parent_instance;
-
-  char *pretty_name;
-  char *full_path;
-};
-
-struct _FcSaveClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcSaveRow, fc_save_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Initialization method for FcHostRow class
-**************************************************************************/
-static void
-fc_host_row_class_init(FcHostRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcHostRow
-**************************************************************************/
-static void
-fc_host_row_init(FcHostRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcHostRow creation method
-**************************************************************************/
-#if 0
-static FcHostRow *fc_host_row_new(void)
-{
-  FcHostRow *result;
-
-  result = g_object_new(FC_TYPE_HOST_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/**********************************************************************//**
-  Initialization method for FcPlrRow class
-**************************************************************************/
-static void
-fc_plr_row_class_init(FcPlrRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcPlrRow
-**************************************************************************/
-static void
-fc_plr_row_init(FcPlrRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcPlrRow creation method
-**************************************************************************/
-#if 0
-static FcPlrRow *fc_plr_row_new(void)
-{
-  FcPlrRow *result;
-
-  result = g_object_new(FC_TYPE_PLR_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/**********************************************************************//**
-  Initialization method for FcScenRow class
-**************************************************************************/
-static void
-fc_scen_row_class_init(FcScenRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcScenRow
-**************************************************************************/
-static void
-fc_scen_row_init(FcScenRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcScenRow creation method
-**************************************************************************/
-#if 0
-static FcScenRow *fc_scen_row_new(void)
-{
-  FcScenRow *result;
-
-  result = g_object_new(FC_TYPE_SCEN_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/**********************************************************************//**
-  Initialization method for FcSaveRow class
-**************************************************************************/
-static void
-fc_save_row_class_init(FcSaveRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcSaveRow
-**************************************************************************/
-static void
-fc_save_row_init(FcSaveRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcSaveRow creation method
-**************************************************************************/
-#if 0
-static FcSaveRow *fc_save_row_new(void)
-{
-  FcSaveRow *result;
-
-  result = g_object_new(FC_TYPE_SAVE_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/**********************************************************************//**
-  Spawn a server, if there isn't one, using the default settings.
-**************************************************************************/
-static void start_new_game_callback(GtkWidget *w, gpointer data)
-{
-  if (!is_server_running()) {
-    client_start_server();
-
-    /* Saved settings are sent in client/options.c
-     * resend_desired_settable_options() */
-  }
-}
-
-/**********************************************************************//**
-  Go to the scenario page, spawning a server.
-**************************************************************************/
-static void start_scenario_callback(GtkWidget *w, gpointer data)
-{
-  output_window_append(ftc_client, _("Compiling scenario list."));
-  client_start_server_and_set_page(PAGE_SCENARIO);
-}
-
-/**********************************************************************//**
-  Go to the load page, spawning a server.
-**************************************************************************/
-static void load_saved_game_callback(GtkWidget *w, gpointer data)
-{
-  client_start_server_and_set_page(PAGE_LOAD);
-}
-
-/**********************************************************************//**
-  Reset the connection status and switch to network page.
-**************************************************************************/
-static void connect_network_game_callback(GtkWidget *w, gpointer data)
-{
-  connection_state_reset();
-  set_client_page(PAGE_NETWORK);
-}
-
-/**********************************************************************//**
-  Callback to open settings dialog.
-**************************************************************************/
-static void open_settings(void)
-{
-  option_dialog_popup(_("Set local options"), client_optset);
-}
-
-/**********************************************************************//**
-  Cancel, by terminating the connection and going back to main page.
-**************************************************************************/
-static void main_callback(GtkWidget *w, gpointer data)
-{
-  enum client_pages page = PAGE_MAIN;
-
-  if (client.conn.used) {
-    disconnect_from_server(TRUE);
-  }
-  if (page != get_client_page()) {
-    set_client_page(page);
-  }
-}
-
-/**********************************************************************//**
-  This is called whenever the intro graphic needs a graphics refresh.
-**************************************************************************/
-static void intro_expose(GtkDrawingArea *w, cairo_t *cr,
-                         int width, int height, gpointer data)
-{
-  static PangoLayout *layout;
-  PangoFontDescription* desc;
-  static int pwidth, pheight;
-  static bool left = FALSE;
-  GtkAllocation allocation;
-  struct sprite *intro = (struct sprite *)data;
-
-  cairo_set_source_surface(cr, intro->surface, 0, 0);
-  cairo_paint(cr);
-
-  if (!layout) {
-    char msgbuf[128];
-    const char *rev_ver;
-
-    layout = pango_layout_new(gtk_widget_create_pango_context(GTK_WIDGET(w)));
-    desc = pango_font_description_from_string("Sans Bold 10");
-    pango_layout_set_font_description(layout, desc);
-    pango_font_description_free(desc);
-
-    rev_ver = fc_git_revision();
-
-    if (rev_ver == NULL) {
-      /* TRANS: "version 2.6.0, gui-gtk-3.22 client" */
-      fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s, %s client"),
-                  word_version(), VERSION_STRING, client_string);
-    } else {
-      /* TRANS: "version 2.6.0
-       *         commit: [modified] <git commit id>
-       *         gui-gtk-3.22 client" */
-      fc_snprintf(msgbuf, sizeof(msgbuf), _("%s%s\ncommit: %s\n%s client"),
-                  word_version(), VERSION_STRING, rev_ver, client_string);
-      left = TRUE;
-    }
-    pango_layout_set_text(layout, msgbuf, -1);
-
-    pango_layout_get_pixel_size(layout, &pwidth, &pheight);
-  }
-  gtk_widget_get_allocation(GTK_WIDGET(w), &allocation);
-
-  cairo_set_source_rgb(cr, 0, 0, 0);
-  cairo_move_to(cr, left ? 4 : allocation.width - pwidth - 3,
-                allocation.height - pheight - 3);
-  pango_cairo_show_layout(cr, layout);
-
-  cairo_set_source_rgb(cr, 1, 1, 1);
-  cairo_move_to(cr, left ? 3 : allocation.width - pwidth - 4,
-                 allocation.height - pheight - 4);
-  pango_cairo_show_layout(cr, layout);
-}
-
-/**********************************************************************//**
-  This is called when main page is getting destroyed.
-**************************************************************************/
-static void intro_free(GtkWidget *w, gpointer *data)
-{
-  struct sprite *intro = (struct sprite *)data;
-
-  free_sprite(intro);
-}
-
-/**********************************************************************//**
-  Create the main page.
-**************************************************************************/
-GtkWidget *create_main_page(void)
-{
-  GtkWidget *widget, *vgrid, *frame, *darea, *button, *table;
-  GtkSizeGroup *size;
-  struct sprite *intro_in, *intro;
-  int width, height;
-  int sh;
-  int space_needed;
-  int grid_row = 0;
-
-  size = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  widget = vgrid;
-
-  frame = gtk_frame_new(NULL);
-  gtk_widget_set_margin_bottom(frame, 18);
-  gtk_widget_set_margin_end(frame, 18);
-  gtk_widget_set_margin_start(frame, 18);
-  gtk_widget_set_margin_top(frame, 18);
-  gtk_widget_set_halign(frame, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(vgrid), frame, 0, grid_row++, 1, 1);
-
-  intro_in = load_gfxfile(tileset_main_intro_filename(tileset), FALSE);
-  get_sprite_dimensions(intro_in, &width, &height);
-  sh = screen_height();
-
-  if (sh <= 0) {
-    /* Assume some minimum height */
-    sh = 600;
-  }
-
-  space_needed = 250;
-#if IS_BETA_VERSION || IS_DEVEL_VERSION
-  /* Alpha or Beta notice takes extra space */
-  space_needed += 50;
-#endif
-
-  if (sh - height < space_needed) {
-    float scale;
-
-    if (sh < (space_needed + 0.2 * height)) {
-      /* Screen is simply too small, use minimum scale */
-      scale = 0.2;
-    } else  {
-      scale = (double)(sh - space_needed) / height;
-    }
-    height *= scale;
-    width *= scale;
-    intro = sprite_scale(intro_in, width, height);
-    free_sprite(intro_in);
-  } else {
-    intro = intro_in;
-  }
-  darea = gtk_drawing_area_new();
-  gtk_widget_set_size_request(darea, width, height);
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(darea),
-                                 intro_expose, intro, NULL);
-  g_signal_connect(widget, "destroy",
-                   G_CALLBACK(intro_free), intro);
-  gtk_frame_set_child(GTK_FRAME(frame), darea);
-
-#if IS_BETA_VERSION || IS_DEVEL_VERSION
-  {
-    GtkWidget *label;
-
-    label = gtk_label_new(unstable_message());
-    gtk_widget_set_name(label, "beta_label");
-    gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
-    gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-    gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-    gtk_grid_attach(GTK_GRID(vgrid), label, 0, grid_row++, 1, 1);
-  }
-#endif /* IS_BETA_VERSION || IS_DEVEL_VERSION */
-
-  table = gtk_grid_new();
-  gtk_widget_set_margin_bottom(table, 12);
-  gtk_widget_set_margin_end(table, 12);
-  gtk_widget_set_margin_start(table, 12);
-  gtk_widget_set_margin_top(table, 12);
-  gtk_widget_set_hexpand(table, TRUE);
-  gtk_widget_set_vexpand(table, TRUE);
-  gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(table, GTK_ALIGN_CENTER);
-
-  gtk_grid_set_row_spacing(GTK_GRID(table), 8);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 18);
-  gtk_grid_attach(GTK_GRID(vgrid), table, 0, grid_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("Start _New Game"));
-  gtk_size_group_add_widget(size, button);
-  gtk_grid_attach(GTK_GRID(table), button, 0, 0, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-     _("Launches local server, and connects to it for a single-player game."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(start_new_game_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("Start _Scenario Game"));
-  gtk_size_group_add_widget(size, button);
-  gtk_grid_attach(GTK_GRID(table), button, 0, 1, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-     _("Loads one of the scenarios for a single-player game. "
-       "Tutorial is one of the scenarios."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(start_scenario_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_Load Saved Game"));
-  gtk_size_group_add_widget(size, button);
-  gtk_grid_attach(GTK_GRID(table), button, 0, 2, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-     _("Continues previously saved single-player game."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(load_saved_game_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("C_onnect to Network Game"));
-  gtk_size_group_add_widget(size, button);
-  gtk_grid_attach(GTK_GRID(table), button, 1, 0, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-     _("Connects to outside server. "
-       "Sometimes you want to launch a separate server even for local games."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(connect_network_game_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("Client Settings"));
-  gtk_size_group_add_widget(size, button);
-  gtk_grid_attach(GTK_GRID(table), button, 1, 1, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-                              _("Adjusting client-side options."));
-  g_signal_connect(button, "clicked", open_settings, NULL);
-
-  button = icon_label_button_new("application-exit", _("E_xit"));
-  gtk_size_group_add_widget(size, button);
-  g_object_unref(size);
-  gtk_grid_attach(GTK_GRID(table), button, 1, 2, 1, 1);
-  gtk_widget_set_tooltip_text(button,
-                              _("Gives you a break from playing freeciv."));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(quit_gtk_main), NULL);
-
-  return widget;
-}
-
-/****************************************************************************
-                            GENERIC SAVE DIALOG
-****************************************************************************/
-typedef void (*save_dialog_action_fn_t) (const char *filename);
-typedef struct fileinfo_list * (*save_dialog_files_fn_t) (void);
-
-struct save_dialog {
-  GtkDialog *shell;
-  GtkTreeView *tree_view;
-  GtkEntry *entry;
-  save_dialog_action_fn_t action;
-  save_dialog_files_fn_t files;
-};
-
-enum save_dialog_columns {
-  SD_COL_PRETTY_NAME = 0,
-  SD_COL_FULL_PATH,
-
-  SD_COL_NUM
-};
-
-enum save_dialog_response {
-  SD_RES_BROWSE,
-  SD_RES_DELETE,
-  SD_RES_SAVE
-};
-
-/**********************************************************************//**
-  Create a new file list store.
-**************************************************************************/
-static inline GtkListStore *save_dialog_store_new(void)
-{
-  return gtk_list_store_new(SD_COL_NUM,
-                            G_TYPE_STRING,      /* SD_COL_PRETTY_NAME */
-                            G_TYPE_STRING);     /* SD_COL_FULL_PATH */
-}
-
-/**********************************************************************//**
-  Fill a file list store with 'files'.
-**************************************************************************/
-static void save_dialog_store_update(GtkListStore *store,
-                                     const struct fileinfo_list *files)
-{
-  GtkTreeIter iter;
-
-  gtk_list_store_clear(store);
-  fileinfo_list_iterate(files, pfile) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       SD_COL_PRETTY_NAME, pfile->name,
-                       SD_COL_FULL_PATH, pfile->fullname,
-                       -1);
-  } fileinfo_list_iterate_end;
-}
-
-/**********************************************************************//**
-  Update a save dialog.
-**************************************************************************/
-static void save_dialog_update(struct save_dialog *pdialog)
-{
-  struct fileinfo_list *files;
-
-  fc_assert_ret(NULL != pdialog);
-
-  /* Update the store. */
-  files = pdialog->files();
-  save_dialog_store_update(GTK_LIST_STORE
-                           (gtk_tree_view_get_model(pdialog->tree_view)),
-                           files);
-  fileinfo_list_destroy(files);
-}
-
-/**********************************************************************//**
-  Callback for save_dialog_file_chooser_new().
-**************************************************************************/
-static void save_dialog_file_chooser_callback(GtkWidget *widget,
-                                              gint response, gpointer data)
-{
-  if (response == GTK_RESPONSE_OK) {
-    save_dialog_action_fn_t action = data;
-    GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(widget));
-
-    if (file != NULL) {
-      gchar *filename = g_file_get_parse_name(file);
-
-      if (NULL != filename) {
-        action(filename);
-        g_free(filename);
-      }
-
-      g_object_unref(file);
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(widget));
-}
-
-/**********************************************************************//**
-  Create a file chooser for both the load and save commands.
-**************************************************************************/
-static void save_dialog_file_chooser_popup(const char *title,
-                                           GtkFileChooserAction action,
-                                           save_dialog_action_fn_t cb)
-{
-  GtkWidget *filechoose;
-
-  /* Create the chooser */
-  filechoose = gtk_file_chooser_dialog_new(title, GTK_WINDOW(toplevel), action,
-                                           _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                           (action == GTK_FILE_CHOOSER_ACTION_SAVE) ?
-                                           _("_Save") : _("_Open"),
-                                           GTK_RESPONSE_OK, NULL);
-  setup_dialog(filechoose, toplevel);
-
-  g_signal_connect(filechoose, "response",
-                   G_CALLBACK(save_dialog_file_chooser_callback), cb);
-
-  /* Display that dialog */
-  gtk_window_present(GTK_WINDOW(filechoose));
-}
-
-/**********************************************************************//**
-  Handle save dialog response.
-**************************************************************************/
-static void save_dialog_response_callback(GtkWidget *w, gint response,
-                                          gpointer data)
-{
-  struct save_dialog *pdialog = data;
-
-  switch (response) {
-  case SD_RES_BROWSE:
-    save_dialog_file_chooser_popup(_("Select Location to Save"),
-                                   GTK_FILE_CHOOSER_ACTION_SAVE,
-                                   pdialog->action);
-    break;
-  case SD_RES_DELETE:
-    {
-      GtkTreeSelection *selection;
-      GtkTreeModel *model;
-      GtkTreeIter iter;
-      const gchar *full_path;
-
-      selection = gtk_tree_view_get_selection(pdialog->tree_view);
-      if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
-        return;
-      }
-
-      gtk_tree_model_get(model, &iter, SD_COL_FULL_PATH, &full_path, -1);
-      fc_remove(full_path);
-      save_dialog_update(pdialog);
-    }
-    return;
-  case SD_RES_SAVE:
-    {
-      const char *text = gtk_entry_buffer_get_text(gtk_entry_get_buffer(pdialog->entry));
-      gchar *filename = g_filename_from_utf8(text, -1, NULL, NULL, NULL);
-
-      if (NULL == filename) {
-        return;
-      }
-      pdialog->action(filename);
-      g_free(filename);
-    }
-    break;
-  default:
-    break;
-  }
-
-  gtk_window_destroy(GTK_WINDOW(pdialog->shell));
-}
-
-/**********************************************************************//**
-  Handle save list double click.
-**************************************************************************/
-static void save_dialog_row_callback(GtkTreeView *tree_view,
-                                     GtkTreePath *path,
-                                     GtkTreeViewColumn *column,
-                                     gpointer data)
-{
-  save_dialog_response_callback(NULL, SD_RES_SAVE, data);
-}
-
-/**********************************************************************//**
-  Handle save filename entry activation.
-**************************************************************************/
-static void save_dialog_entry_callback(GtkEntry *entry, gpointer data)
-{
-  save_dialog_response_callback(NULL, SD_RES_SAVE, data);
-}
-
-/**********************************************************************//**
-  Handle the save list selection changes.
-**************************************************************************/
-static void save_dialog_list_callback(GtkTreeSelection *selection,
-                                      gpointer data)
-{
-  struct save_dialog *pdialog = data;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  const gchar *filename;
-
-  if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_dialog_set_response_sensitive(pdialog->shell, SD_RES_DELETE, FALSE);
-    return;
-  }
-
-  gtk_dialog_set_response_sensitive(pdialog->shell, SD_RES_DELETE, TRUE);
-  gtk_tree_model_get(model, &iter, SD_COL_PRETTY_NAME, &filename, -1);
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(pdialog->entry), filename, -1);
-}
-
-/**********************************************************************//**
-  Save table cell bind function
-**************************************************************************/
-static void save_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcSaveRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(child), row->pretty_name);
-}
-
-/**********************************************************************//**
-  Save table cell setup function
-**************************************************************************/
-static void save_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Create a new save dialog.
-**************************************************************************/
-static GtkWidget *save_dialog_new(const char *title, const char *savelabel,
-                                  const char *savefilelabel,
-                                  save_dialog_action_fn_t action,
-                                  save_dialog_files_fn_t files)
-{
-  GtkWidget *shell, *sbox, *sw, *label, *view, *entry;
-  GtkBox *vbox;
-  GtkListStore *store;
-  GtkCellRenderer *rend;
-  GtkListItemFactory *factory;
-  GtkTreeSelection *selection;
-  struct save_dialog *pdialog;
-
-  fc_assert_ret_val(NULL != action, NULL);
-  fc_assert_ret_val(NULL != files, NULL);
-
-  /* Save dialog structure. */
-  pdialog = fc_malloc(sizeof(*pdialog));
-  pdialog->action = action;
-  pdialog->files = files;
-
-  /* Shell. */
-  shell = gtk_dialog_new_with_buttons(title, NULL, 0,
-                                      _("_Browse..."), SD_RES_BROWSE,
-                                      _("_Delete"), SD_RES_DELETE,
-                                      _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                      _("_Save"), SD_RES_SAVE,
-                                      NULL);
-  g_object_set_data_full(G_OBJECT(shell), "save_dialog", pdialog,
-                         (GDestroyNotify) free);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_CANCEL);
-  gtk_dialog_set_response_sensitive(GTK_DIALOG(shell), SD_RES_DELETE, FALSE);
-  setup_dialog(shell, toplevel);
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(save_dialog_response_callback), pdialog);
-  pdialog->shell = GTK_DIALOG(shell);
-  vbox = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell)));
-
-  /* Tree view. */
-  store = save_dialog_store_new();
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(save_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(save_factory_setup),
-                   nullptr);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(store);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(save_dialog_row_callback), pdialog);
-  pdialog->tree_view = GTK_TREE_VIEW(view);
-
-  sbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(vbox, sbox);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", view,
-                       "label", savelabel,
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_box_append(GTK_BOX(sbox), label);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW(sw), 300);
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 300);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_box_append(GTK_BOX(sbox), sw);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(save_dialog_list_callback), pdialog);
-
-  rend = gtk_cell_renderer_text_new();
-  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-                                              -1, NULL, rend, "text",
-                                              SD_COL_PRETTY_NAME, NULL);
-
-  /* Entry. */
-  entry = gtk_entry_new();
-  gtk_widget_set_hexpand(entry, TRUE);
-  g_signal_connect(entry, "activate",
-                   G_CALLBACK(save_dialog_entry_callback), pdialog);
-  pdialog->entry = GTK_ENTRY(entry);
-
-  sbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_set_margin_bottom(sbox, 12);
-  gtk_widget_set_margin_end(sbox, 12);
-  gtk_widget_set_margin_start(sbox, 12);
-  gtk_widget_set_margin_top(sbox, 12);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", entry,
-                       "label", savefilelabel,
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_box_append(GTK_BOX(sbox), label);
-
-  gtk_box_append(GTK_BOX(sbox), entry);
-  gtk_box_append(vbox, sbox);
-
-  save_dialog_update(pdialog);
-  gtk_window_set_focus(GTK_WINDOW(shell), entry);
-  gtk_widget_set_visible(GTK_WIDGET(vbox), TRUE);
-
-  return shell;
-}
-
-/****************************************************************************
-                                 NETWORK PAGE
-****************************************************************************/
-static GtkWidget *network_login_label, *network_login;
-static GtkWidget *network_host_label, *network_host;
-static GtkWidget *network_port_label, *network_port;
-static GtkWidget *network_password_label, *network_password;
-static GtkWidget *network_confirm_password_label, *network_confirm_password;
-
-/**********************************************************************//**
-  Update a server list.
-**************************************************************************/
-static void update_server_list(enum server_scan_type sstype,
-                               const struct server_list *list)
-{
-  GtkTreeSelection *sel = NULL;
-  GtkTreeView *view;
-  GtkTreeIter it;
-  GtkListStore *store;
-  const gchar *host, *portstr;
-  int port;
-
-  switch (sstype) {
-  case SERVER_SCAN_LOCAL:
-    sel = lan_selection;
-    break;
-  case SERVER_SCAN_GLOBAL:
-    sel = meta_selection;
-    break;
-  default:
-    break;
-  }
-
-  if (!sel) {
-    return;
-  }
-
-  view = gtk_tree_selection_get_tree_view(sel);
-  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
-  gtk_list_store_clear(store);
-
-  if (!list) {
-    return;
-  }
-
-  host = gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_host)));
-  portstr = gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_port)));
-  port = atoi(portstr);
-
-  server_list_iterate(list, pserver) {
-    char buf[35];
-
-    if (pserver->humans >= 0) {
-      fc_snprintf(buf, sizeof(buf), "%d", pserver->humans);
-    } else {
-      sz_strlcpy(buf, _("Unknown"));
-    }
-    gtk_list_store_append(store, &it);
-    gtk_list_store_set(store, &it,
-                       0, pserver->host,
-                       1, pserver->port,
-                       2, pserver->version,
-                       3, _(pserver->state),
-                       4, pserver->nplayers,
-                       5, buf,
-                       6, pserver->message,
-                       -1);
-    if (strcmp(host, pserver->host) == 0 && port == pserver->port) {
-      gtk_tree_selection_select_iter(sel, &it);
-    }
-  } server_list_iterate_end;
-}
-
-/**********************************************************************//**
-  Free the server scans.
-**************************************************************************/
-void destroy_server_scans(void)
-{
-  if (meta_scan.scan) {
-    server_scan_finish(meta_scan.scan);
-    meta_scan.scan = NULL;
-  }
-  if (meta_scan.timer != 0) {
-    g_source_remove(meta_scan.timer);
-    meta_scan.timer = 0;
-  }
-  if (lan_scan.scan) {
-    server_scan_finish(lan_scan.scan);
-    lan_scan.scan = NULL;
-  }
-  if (lan_scan.timer != 0) {
-    g_source_remove(lan_scan.timer);
-    lan_scan.timer = 0;
-  }
-}
-
-/**********************************************************************//**
-  This function updates the list of servers every so often.
-**************************************************************************/
-static gboolean check_server_scan(gpointer data)
-{
-  struct server_scan_timer_data *scan_data = data;
-  struct server_scan *scan = scan_data->scan;
-  enum server_scan_status stat;
-
-  if (!scan) {
-    return FALSE;
-  }
-
-  stat = server_scan_poll(scan);
-  if (stat >= SCAN_STATUS_PARTIAL) {
-    enum server_scan_type type;
-    struct srv_list *srvrs;
-
-    type = server_scan_get_type(scan);
-    srvrs = server_scan_get_list(scan);
-    fc_mutex_allocate(&srvrs->mutex);
-    holding_srv_list_mutex = TRUE;
-    update_server_list(type, srvrs->servers);
-    holding_srv_list_mutex = FALSE;
-    fc_mutex_release(&srvrs->mutex);
-  }
-
-  if (stat == SCAN_STATUS_ERROR || stat == SCAN_STATUS_DONE) {
-    scan_data->timer = 0;
-    return FALSE;
-  }
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Callback function for when there's an error in the server scan.
-**************************************************************************/
-static void server_scan_error(struct server_scan *scan,
-                              const char *message)
-{
-  output_window_append(ftc_client, message);
-  log_error("%s", message);
-
-  /* Main thread will finalize the scan later (or even concurrently) -
-   * do not do anything here to cause double free or raze condition. */
-}
-
-/**********************************************************************//**
-  Stop and restart the metaserver and lan server scans.
-**************************************************************************/
-static void update_network_lists(void)
-{
-  destroy_server_scans();
-
-  meta_scan.scan = server_scan_begin(SERVER_SCAN_GLOBAL, server_scan_error);
-  meta_scan.timer = g_timeout_add(200, check_server_scan, &meta_scan);
-
-  lan_scan.scan = server_scan_begin(SERVER_SCAN_LOCAL, server_scan_error);
-  lan_scan.timer = g_timeout_add(500, check_server_scan, &lan_scan);
-}
-
-/**************************************************************************
-  Network connection state defines.
-**************************************************************************/
-enum connection_state {
-  LOGIN_TYPE,
-  NEW_PASSWORD_TYPE,
-  ENTER_PASSWORD_TYPE,
-  WAITING_TYPE
-};
-
-static enum connection_state connection_status;
-
-/**********************************************************************//**
-  Update statusbar label text.
-**************************************************************************/
-static gboolean update_network_statusbar(gpointer data)
-{
-  if (!g_queue_is_empty(statusbar_queue)) {
-    char *txt;
-
-    txt = g_queue_pop_head(statusbar_queue);
-    gtk_label_set_text(GTK_LABEL(statusbar), txt);
-    free(txt);
-  }
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Clear statusbar queue.
-**************************************************************************/
-static void clear_network_statusbar(void)
-{
-  while (!g_queue_is_empty(statusbar_queue)) {
-    char *txt;
-
-    txt = g_queue_pop_head(statusbar_queue);
-    free(txt);
-  }
-
-  gtk_label_set_text(GTK_LABEL(statusbar), "");
-}
-
-/**********************************************************************//**
-  Queue statusbar label text change.
-**************************************************************************/
-void append_network_statusbar(const char *text, bool force)
-{
-  if (gtk_widget_get_visible(statusbar_frame)) {
-    if (force) {
-      clear_network_statusbar();
-      gtk_label_set_text(GTK_LABEL(statusbar), text);
-    } else {
-      g_queue_push_tail(statusbar_queue, fc_strdup(text));
-    }
-  }
-}
-
-/**********************************************************************//**
-  Create statusbar.
-**************************************************************************/
-GtkWidget *create_statusbar(void)
-{
-  statusbar_frame = gtk_frame_new(NULL);
-
-  statusbar = gtk_label_new("");
-  gtk_widget_set_margin_start(statusbar, 2);
-  gtk_widget_set_margin_end(statusbar, 2);
-  gtk_widget_set_margin_top(statusbar, 2);
-  gtk_widget_set_margin_bottom(statusbar, 2);
-  gtk_frame_set_child(GTK_FRAME(statusbar_frame), statusbar);
-
-  statusbar_queue = g_queue_new();
-  statusbar_timer = g_timeout_add(2000, update_network_statusbar, NULL);
-
-  return statusbar_frame;
-}
-
-/**********************************************************************//**
-  Update network page connection state.
-**************************************************************************/
-static void set_connection_state(enum connection_state state)
-{
-  switch (state) {
-  case LOGIN_TYPE:
-    append_network_statusbar("", FALSE);
-
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_password)),
-                              "", -1);
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_confirm_password)),
-                              "", -1);
-
-    gtk_widget_set_sensitive(network_host, TRUE);
-    gtk_widget_set_sensitive(network_port, TRUE);
-    gtk_widget_set_sensitive(network_login, TRUE);
-    gtk_widget_set_sensitive(network_password_label, FALSE);
-    gtk_label_set_markup_with_mnemonic(GTK_LABEL(network_password_label), _("Pass_word:"));
-    gtk_widget_set_sensitive(network_password, FALSE);
-    gtk_widget_set_sensitive(network_confirm_password_label, FALSE);
-    gtk_widget_set_sensitive(network_confirm_password, FALSE);
-    break;
-  case NEW_PASSWORD_TYPE:
-    set_client_page(PAGE_NETWORK);
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_password)), "", -1);
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_confirm_password)),
-                              "", -1);
-
-    gtk_widget_set_sensitive(network_host, FALSE);
-    gtk_widget_set_sensitive(network_port, FALSE);
-    gtk_widget_set_sensitive(network_login, FALSE);
-    gtk_widget_set_sensitive(network_password_label, TRUE);
-    gtk_label_set_markup_with_mnemonic(GTK_LABEL(network_password_label), _("New Pass_word:"));
-    gtk_widget_set_sensitive(network_password, TRUE);
-    gtk_widget_set_sensitive(network_confirm_password_label, TRUE);
-    gtk_widget_set_sensitive(network_confirm_password, TRUE);
-
-    gtk_widget_grab_focus(network_password);
-    break;
-  case ENTER_PASSWORD_TYPE:
-    set_client_page(PAGE_NETWORK);
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_password)), "", -1);
-    gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_confirm_password)),
-                              "", -1);
-
-    gtk_widget_set_sensitive(network_host, FALSE);
-    gtk_widget_set_sensitive(network_port, FALSE);
-    gtk_widget_set_sensitive(network_login, FALSE);
-    gtk_widget_set_sensitive(network_password_label, TRUE);
-    gtk_label_set_markup_with_mnemonic(GTK_LABEL(network_password_label), _("Pass_word:"));
-    gtk_widget_set_sensitive(network_password, TRUE);
-    gtk_widget_set_sensitive(network_confirm_password_label, FALSE);
-    gtk_widget_set_sensitive(network_confirm_password, FALSE);
-
-    gtk_widget_grab_focus(network_password);
-    break;
-  case WAITING_TYPE:
-    append_network_statusbar("", TRUE);
-
-    gtk_widget_set_sensitive(network_login, FALSE);
-    gtk_widget_set_sensitive(network_password_label, FALSE);
-    gtk_label_set_markup_with_mnemonic(GTK_LABEL(network_password_label), _("Pass_word:"));
-    gtk_widget_set_sensitive(network_password, FALSE);
-    gtk_widget_set_sensitive(network_confirm_password_label, FALSE);
-    gtk_widget_set_sensitive(network_confirm_password, FALSE);
-    break;
-  }
-
-  connection_status = state;
-}
-
-/**********************************************************************//**
-  Reset the connection state.
-**************************************************************************/
-static void connection_state_reset(void)
-{
-  set_connection_state(LOGIN_TYPE);
-}
-
-/**********************************************************************//**
-  Configure the dialog depending on what type of authentication request the
-  server is making.
-**************************************************************************/
-void handle_authentication_req(enum authentication_type type,
-                               const char *message)
-{
-  append_network_statusbar(message, TRUE);
-
-  switch (type) {
-  case AUTH_NEWUSER_FIRST:
-  case AUTH_NEWUSER_RETRY:
-    set_connection_state(NEW_PASSWORD_TYPE);
-    return;
-  case AUTH_LOGIN_FIRST:
-    /* if we magically have a password already present in 'fc_password'
-     * then, use that and skip the password entry dialog */
-    if (fc_password[0] != '\0') {
-      struct packet_authentication_reply reply;
-
-      sz_strlcpy(reply.password, fc_password);
-      send_packet_authentication_reply(&client.conn, &reply);
-      return;
-    } else {
-      set_connection_state(ENTER_PASSWORD_TYPE);
-    }
-    return;
-  case AUTH_LOGIN_RETRY:
-    set_connection_state(ENTER_PASSWORD_TYPE);
-    return;
-  }
-
-  log_error("Unsupported authentication type %d: %s.", type, message);
-}
-
-/**********************************************************************//**
-  If on the network page, switch page to the login page (with new server
-  and port). if on the login page, send connect and/or authentication
-  requests to the server.
-**************************************************************************/
-static void connect_callback(GtkWidget *w, gpointer data)
-{
-  char errbuf [512];
-  struct packet_authentication_reply reply;
-
-  switch (connection_status) {
-  case LOGIN_TYPE:
-    sz_strlcpy(user_name,
-               gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_login))));
-    sz_strlcpy(server_host,
-               gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_host))));
-    server_port = atoi(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_port))));
-
-    if (connect_to_server(user_name, server_host, server_port,
-                          errbuf, sizeof(errbuf)) != -1) {
-    } else {
-      append_network_statusbar(errbuf, TRUE);
-
-      output_window_append(ftc_client, errbuf);
-    }
-    return;
-  case NEW_PASSWORD_TYPE:
-    if (w != network_password) {
-      sz_strlcpy(fc_password,
-          gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_password))));
-      sz_strlcpy(reply.password,
-          gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_confirm_password))));
-      if (!fc_strncmp(reply.password, fc_password, MAX_LEN_NAME)) {
-        fc_password[0] = '\0';
-        send_packet_authentication_reply(&client.conn, &reply);
-
-        set_connection_state(WAITING_TYPE);
-      } else {
-        append_network_statusbar(_("Passwords don't match, enter password."),
-                                 TRUE);
-
-        set_connection_state(NEW_PASSWORD_TYPE);
-      }
-    }
-    return;
-  case ENTER_PASSWORD_TYPE:
-    sz_strlcpy(reply.password,
-               gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_password))));
-    send_packet_authentication_reply(&client.conn, &reply);
-
-    set_connection_state(WAITING_TYPE);
-    return;
-  case WAITING_TYPE:
-    return;
-  }
-
-  log_error("Unsupported connection status: %d", connection_status);
-}
-
-/**********************************************************************//**
-  Connect on list item double-click.
-**************************************************************************/
-static void network_activate_callback(GtkTreeView *view,
-                                      GtkTreePath *arg1,
-                                      GtkTreeViewColumn *arg2,
-                                      gpointer data)
-{
-  connect_callback(NULL, data);
-}
-
-/**********************************************************************//**
-  Fills the server player list with the players in the given server, or
-  clears it if there is no player data.
-**************************************************************************/
-static void update_server_playerlist(const struct server *pserver)
-{
-  GtkListStore *store;
-  GtkTreeIter iter;
-  int n, i;
-
-  store = server_playerlist_store;
-  fc_assert_ret(store != NULL);
-
-  gtk_list_store_clear(store);
-  if (!pserver || !pserver->players) {
-    return;
-  }
-
-  n = pserver->nplayers;
-  for (i = 0; i < n; i++) {
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       0, pserver->players[i].name,
-                       1, pserver->players[i].type,
-                       2, pserver->players[i].host,
-                       3, pserver->players[i].nation,
-                       -1);
-  }
-}
-
-/**********************************************************************//**
-  Sets the host, port and player list of the selected server.
-**************************************************************************/
-static void network_list_callback(GtkTreeSelection *select, gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  const char *host;
-  int port;
-  char portstr[32];
-  const struct server *pserver = NULL;
-
-  if (!gtk_tree_selection_get_selected(select, &model, &it)) {
-    return;
-  }
-
-  if (select == meta_selection) {
-    GtkTreePath *path;
-    struct srv_list *srvrs;
-
-    srvrs = server_scan_get_list(meta_scan.scan);
-    path = gtk_tree_model_get_path(model, &it);
-    if (!holding_srv_list_mutex) {
-      /* We are not yet inside mutex protected block */
-      fc_mutex_allocate(&srvrs->mutex);
-    }
-    if (srvrs->servers && path) {
-      gint pos = gtk_tree_path_get_indices(path)[0];
-
-      pserver = server_list_get(srvrs->servers, pos);
-    }
-    if (!holding_srv_list_mutex) {
-      /* We are not yet inside mutex protected block */
-      fc_mutex_release(&srvrs->mutex);
-    }
-    gtk_tree_path_free(path);
-  }
-  update_server_playerlist(pserver);
-
-  gtk_tree_model_get(model, &it, 0, &host, 1, &port, -1);
-
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_host)), host, -1);
-  fc_snprintf(portstr, sizeof(portstr), "%d", port);
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_port)), portstr, -1);
-}
-
-/**********************************************************************//**
-  Update the network page.
-**************************************************************************/
-static void update_network_page(void)
-{
-  char buf[256];
-
-  gtk_tree_selection_unselect_all(lan_selection);
-  gtk_tree_selection_unselect_all(meta_selection);
-
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_login)), user_name, -1);
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_host)), server_host, -1);
-  fc_snprintf(buf, sizeof(buf), "%d", server_port);
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(network_port)), buf, -1);
-}
-
-/**********************************************************************//**
-  Host table cell bind function
-**************************************************************************/
-static void host_factory_bind(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  FcHostRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-  char buf[512];
-
-  row = gtk_list_item_get_item(list_item);
-
-  switch (GPOINTER_TO_INT(user_data)) {
-  case host_row_host:
-    gtk_label_set_text(GTK_LABEL(child), row->host);
-    break;
-  case host_row_port:
-    fc_snprintf(buf, sizeof(buf), "%d", row->port);
-    gtk_label_set_text(GTK_LABEL(child), buf);
-    break;
-  case host_row_version:
-    gtk_label_set_text(GTK_LABEL(child), row->version);
-    break;
-  case host_row_state:
-    gtk_label_set_text(GTK_LABEL(child), row->state);
-    break;
-  case host_row_nplayers:
-    fc_snprintf(buf, sizeof(buf), "%d", row->nplayers);
-    gtk_label_set_text(GTK_LABEL(child), buf);
-    break;
-  case host_row_humans:
-    gtk_label_set_text(GTK_LABEL(child), row->humans);
-    break;
-  case host_row_message:
-    gtk_label_set_text(GTK_LABEL(child), row->message);
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Host table cell setup function
-**************************************************************************/
-static void host_factory_setup(GtkSignalListItemFactory *self,
-                               GtkListItem *list_item,
-                               gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Player table cell bind function
-**************************************************************************/
-static void plr_factory_bind(GtkSignalListItemFactory *self,
-                             GtkListItem *list_item,
-                             gpointer user_data)
-{
-  FcPlrRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  switch (GPOINTER_TO_INT(user_data)) {
-  case plr_row_name:
-    gtk_label_set_text(GTK_LABEL(child), row->name);
-    break;
-  case plr_row_type:
-    gtk_label_set_text(GTK_LABEL(child), row->type);
-    break;
-  case plr_row_host:
-    gtk_label_set_text(GTK_LABEL(child), row->host);
-    break;
-  case plr_row_nation:
-    gtk_label_set_text(GTK_LABEL(child), row->nation);
-    break;
-  }
-}
-
-/**********************************************************************//**
-  Player table cell setup function
-**************************************************************************/
-static void plr_factory_setup(GtkSignalListItemFactory *self,
-                              GtkListItem *list_item,
-                              gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Create the network page.
-**************************************************************************/
-GtkWidget *create_network_page(void)
-{
-  GtkWidget *box, *sbox, *bbox, *hbox, *notebook;
-  GtkWidget *button, *label, *view, *sw, *table;
-  GtkTreeSelection *selection;
-  GtkListStore *store;
-  GtkEventController *controller;
-  GtkListItemFactory *factory;
-
-  box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_widget_set_margin_start(box, 4);
-  gtk_widget_set_margin_end(box, 4);
-  gtk_widget_set_margin_top(box, 4);
-  gtk_widget_set_margin_bottom(box, 4);
-
-  notebook = gtk_notebook_new();
-  gtk_box_append(GTK_BOX(box), notebook);
-
-  /* LAN pane. */
-  lan_store = gtk_list_store_new(7, G_TYPE_STRING, /* host */
-                                 G_TYPE_INT,       /* port */
-                                 G_TYPE_STRING,    /* version */
-                                 G_TYPE_STRING,    /* state */
-                                 G_TYPE_INT,       /* nplayers */
-                                 G_TYPE_STRING,    /* humans */
-                                 G_TYPE_STRING);   /* message */
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(host_factory_bind),
-                   GINT_TO_POINTER(host_row_host));
-  g_signal_connect(factory, "setup", G_CALLBACK(host_factory_setup),
-                   nullptr);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(lan_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(lan_store);
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  lan_selection = selection;
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-
-  controller = gtk_event_controller_focus_new();
-  g_signal_connect(controller, "enter",
-                   G_CALLBACK(terminate_signal_processing), NULL);
-  gtk_widget_add_controller(view, controller);
-
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(network_activate_callback), NULL);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(network_list_callback), NULL);
-
-  add_treeview_column(view, _("Server Name"), G_TYPE_STRING, 0);
-  add_treeview_column(view, _("Port"), G_TYPE_INT, 1);
-  add_treeview_column(view, _("Version"), G_TYPE_STRING, 2);
-  add_treeview_column(view, _("Status"), G_TYPE_STRING, 3);
-  add_treeview_column(view, _("Players"), G_TYPE_INT, 4);
-  add_treeview_column(view, _("Humans"), G_TYPE_STRING, 5);
-  add_treeview_column(view, _("Comment"), G_TYPE_STRING, 6);
-
-  label = gtk_label_new_with_mnemonic(_("Local _Area Network"));
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_margin_start(sw, 4);
-  gtk_widget_set_margin_end(sw, 4);
-  gtk_widget_set_margin_top(sw, 4);
-  gtk_widget_set_margin_bottom(sw, 4);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
-
-
-  /* Metaserver pane. */
-  meta_store = gtk_list_store_new(7, G_TYPE_STRING, /* host */
-                                  G_TYPE_INT,       /* port */
-                                  G_TYPE_STRING,    /* version */
-                                  G_TYPE_STRING,    /* state */
-                                  G_TYPE_INT,       /* nplayers */
-                                  G_TYPE_STRING,    /* humans */
-                                  G_TYPE_STRING);   /* message */
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(meta_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(meta_store);
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  meta_selection = selection;
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-
-  controller = gtk_event_controller_focus_new();
-  g_signal_connect(controller, "enter",
-                   G_CALLBACK(terminate_signal_processing), NULL);
-  gtk_widget_add_controller(view, controller);
-
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(network_activate_callback), NULL);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(network_list_callback), NULL);
-
-  add_treeview_column(view, _("Server Name"), G_TYPE_STRING, 0);
-  add_treeview_column(view, _("Port"), G_TYPE_INT, 1);
-  add_treeview_column(view, _("Version"), G_TYPE_STRING, 2);
-  add_treeview_column(view, _("Status"), G_TYPE_STRING, 3);
-  add_treeview_column(view, _("Players"), G_TYPE_INT, 4);
-  add_treeview_column(view, _("Humans"), G_TYPE_STRING, 5);
-  add_treeview_column(view, _("Comment"), G_TYPE_STRING, 6);
-
-  label = gtk_label_new_with_mnemonic(_("Internet _Metaserver"));
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_margin_start(sw, 4);
-  gtk_widget_set_margin_end(sw, 4);
-  gtk_widget_set_margin_top(sw, 4);
-  gtk_widget_set_margin_bottom(sw, 4);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  if (GUI_GTK_OPTION(metaserver_tab_first)) {
-    gtk_notebook_prepend_page(GTK_NOTEBOOK(notebook), sw, label);
-  } else {
-    gtk_notebook_append_page(GTK_NOTEBOOK(notebook), sw, label);
-  }
-
-  /* Bottom part of the page, outside the inner notebook. */
-  sbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(box), sbox);
-
-  hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
-  gtk_widget_set_margin_bottom(hbox, 8);
-  gtk_widget_set_margin_end(hbox, 8);
-  gtk_widget_set_margin_start(hbox, 8);
-  gtk_widget_set_margin_top(hbox, 8);
-  gtk_box_append(GTK_BOX(sbox), hbox);
-
-  table = gtk_grid_new();
-  gtk_grid_set_row_spacing(GTK_GRID(table), 2);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 12);
-  gtk_box_append(GTK_BOX(hbox), table);
-
-  network_host = gtk_entry_new();
-  g_signal_connect(network_host, "activate",
-      G_CALLBACK(connect_callback), NULL);
-  gtk_grid_attach(GTK_GRID(table), network_host, 1, 0, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", network_host,
-                       "label", _("_Host:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  network_host_label = label;
-  gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
-
-  network_port = gtk_entry_new();
-  g_signal_connect(network_port, "activate",
-      G_CALLBACK(connect_callback), NULL);
-  gtk_grid_attach(GTK_GRID(table), network_port, 1, 1, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", network_port,
-                       "label", _("_Port:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  network_port_label = label;
-  gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
-
-  network_login = gtk_entry_new();
-  gtk_widget_set_margin_top(network_login, 10);
-  g_signal_connect(network_login, "activate",
-      G_CALLBACK(connect_callback), NULL);
-  gtk_grid_attach(GTK_GRID(table), network_login, 1, 3, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", network_login,
-                       "label", _("_Login:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_widget_set_margin_top(label, 10);
-  network_login_label = label;
-  gtk_grid_attach(GTK_GRID(table), label, 0, 3, 1, 1);
-
-  network_password = gtk_entry_new();
-  g_signal_connect(network_password, "activate",
-      G_CALLBACK(connect_callback), NULL);
-  gtk_entry_set_visibility(GTK_ENTRY(network_password), FALSE);
-  gtk_grid_attach(GTK_GRID(table), network_password, 1, 4, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", network_password,
-                       "label", _("Pass_word:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  network_password_label = label;
-  gtk_grid_attach(GTK_GRID(table), label, 0, 4, 1, 1);
-
-  network_confirm_password = gtk_entry_new();
-  g_signal_connect(network_confirm_password, "activate",
-      G_CALLBACK(connect_callback), NULL);
-  gtk_entry_set_visibility(GTK_ENTRY(network_confirm_password), FALSE);
-  gtk_grid_attach(GTK_GRID(table), network_confirm_password, 1, 5, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", network_confirm_password,
-                       "label", _("Conf_irm Password:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  network_confirm_password_label = label;
-  gtk_grid_attach(GTK_GRID(table), label, 0, 5, 1, 1);
-
-  /* Server player list. */
-  store = gtk_list_store_new(4, G_TYPE_STRING,
-                             G_TYPE_STRING,
-                             G_TYPE_STRING,
-                             G_TYPE_STRING);
-  server_playerlist_store = store;
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(plr_factory_bind),
-                   GINT_TO_POINTER(plr_row_name));
-  g_signal_connect(factory, "setup", G_CALLBACK(plr_factory_setup),
-                   nullptr);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(view, TRUE);
-  add_treeview_column(view, _("Name"), G_TYPE_STRING, 0);
-  add_treeview_column(view, _("Type"), G_TYPE_STRING, 1);
-  add_treeview_column(view, _("Host"), G_TYPE_STRING, 2);
-  add_treeview_column(view, _("Nation"), G_TYPE_STRING, 3);
-  server_playerlist_view = view;
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_box_append(GTK_BOX(hbox), sw);
-
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_widget_set_margin_bottom(bbox, 2);
-  gtk_widget_set_margin_end(bbox, 2);
-  gtk_widget_set_margin_start(bbox, 2);
-  gtk_widget_set_margin_top(bbox, 2);
-  gtk_box_set_spacing(GTK_BOX(bbox), 12);
-  gtk_box_append(GTK_BOX(sbox), bbox);
-
-  button = gtk_button_new_from_icon_name("view-refresh");
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(update_network_lists), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_Cancel"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(main_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("C_onnect"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(connect_callback), NULL);
-
-  return box;
-}
-
-/****************************************************************************
-                                  START PAGE
-****************************************************************************/
-GtkWidget *start_message_area;
-
-static GtkWidget *start_options_table;
-static GtkWidget *observe_button, *ready_button, *nation_button;
-static GtkTreeStore *connection_list_store;
-static GtkTreeView *connection_list_view;
-static GtkWidget *start_aifill_spin = NULL;
-static GtkWidget *ai_lvl_combobox = NULL;
-
-
-/* NB: Must match creation arguments in connection_list_store_new(). */
-enum connection_list_columns {
-  CL_COL_PLAYER_NUMBER = 0,
-  CL_COL_USER_NAME,
-  CL_COL_READY_STATE,
-  CL_COL_PLAYER_NAME,
-  CL_COL_FLAG,
-  CL_COL_COLOR,
-  CL_COL_NATION,
-  CL_COL_TEAM,
-  CL_COL_CONN_ID,
-  CL_COL_STYLE,
-  CL_COL_WEIGHT,
-  CL_COL_COLLAPSED,
-
-  CL_NUM_COLUMNS
-};
-
-/**********************************************************************//**
-  Create a new tree store for connection list.
-**************************************************************************/
-static inline GtkTreeStore *connection_list_store_new(void)
-{
-  return gtk_tree_store_new(CL_NUM_COLUMNS,
-                            G_TYPE_INT,         /* CL_COL_PLAYER_NUMBER */
-                            G_TYPE_STRING,      /* CL_COL_USER_NAME */
-                            G_TYPE_BOOLEAN,     /* CL_COL_READY_STATE */
-                            G_TYPE_STRING,      /* CL_COL_PLAYER_NAME */
-                            GDK_TYPE_PIXBUF,    /* CL_COL_FLAG */
-                            GDK_TYPE_PIXBUF,    /* CL_COL_COLOR */
-                            G_TYPE_STRING,      /* CL_COL_NATION */
-                            G_TYPE_STRING,      /* CL_COL_TEAM */
-                            G_TYPE_INT,         /* CL_COL_CONN_ID */
-                            G_TYPE_INT,         /* CL_COL_STYLE */
-                            G_TYPE_INT,         /* CL_COL_WEIGHT */
-                            G_TYPE_BOOLEAN);    /* CL_COL_COLLAPSED */
-}
-
-/**********************************************************************//**
-  Maybe toggle AI of the player if the client could take the player. This
-  function shouldn't be used directly, see in client_take_player().
-**************************************************************************/
-static void client_aitoggle_player(void *data)
-{
-  struct player *pplayer = player_by_number(FC_PTR_TO_INT(data));
-
-  if (NULL != pplayer
-      && pplayer == client_player()
-      && !is_human(pplayer)) {
-    send_chat("/away");
-  }
-}
-
-/**********************************************************************//**
-  Send the /take command by chat and toggle AI if needed (after that).
-**************************************************************************/
-static void client_take_player(struct player *pplayer)
-{
-  int request_id = send_chat_printf("/take \"%s\"", player_name(pplayer));
-  void *data = FC_INT_TO_PTR(player_number(pplayer));
-
-  update_queue_connect_processing_finished(request_id,
-                                           client_aitoggle_player, data);
-}
-
-/**********************************************************************//**
-  Connect the object to the player and the connection.
-**************************************************************************/
-static void object_put(GObject *object, struct player *pplayer,
-                       struct connection *pconn)
-{
-  /* Note that passing -1 to GINT_TO_POINTER() is buggy with some versions
-   * of gcc. player_slot_count() is not a valid player number. 0 is not
-   * a valid connection id (see comment in server/sernet.c:
-   * makeup_connection_name()). */
-  g_object_set_data(object, "player_id",
-                    GINT_TO_POINTER(NULL != pplayer
-                                    ? player_number(pplayer)
-                                    : player_slot_count()));
-  g_object_set_data(object, "connection_id",
-                    GINT_TO_POINTER(NULL != pconn ? pconn->id : 0));
-}
-
-/**********************************************************************//**
-  Extract the player and the connection set with object_put(). Returns TRUE
-  if at least one of them isn't NULL.
-**************************************************************************/
-static bool object_extract(GObject *object, struct player **ppplayer,
-                           struct connection **ppconn)
-{
-  bool ret = FALSE;
-  int id;
-
-  if (NULL != ppplayer) {
-    id = GPOINTER_TO_INT(g_object_get_data(object, "player_id"));
-    *ppplayer = player_by_number(id);
-    if (NULL != *ppplayer) {
-      ret = TRUE;
-    }
-  }
-  if (NULL != ppconn) {
-    id = GPOINTER_TO_INT(g_object_get_data(object, "connection_id"));
-    *ppconn = conn_by_number(id);
-    if (NULL != *ppconn) {
-      ret = TRUE;
-    }
-  }
-
-  return ret;
-}
-
-/**********************************************************************//**
-  Request the game options dialog.
-**************************************************************************/
-static void game_options_callback(GtkWidget *w, gpointer data)
-{
-  option_dialog_popup(_("Game Settings"), server_optset);
-}
-
-/**********************************************************************//**
-  AI skill setting callback.
-**************************************************************************/
-static void ai_skill_callback(GtkWidget *w, gpointer data)
-{
-  enum ai_level *levels = (enum ai_level *)data;
-  const char *name;
-  int i;
-
-  i = gtk_combo_box_get_active(GTK_COMBO_BOX(w));
-
-  if (i != -1) {
-    enum ai_level level = levels[i];
-
-    /* Suppress changes provoked by server rather than local user */
-    if (server_ai_level() != level) {
-      name = ai_level_cmd(level);
-      send_chat_printf("/%s", name);
-    }
-  }
-}
-
-/* HACK: sometimes when creating the ruleset combo the value is set without
- * the user's control. In this case we don't want to do a /read. */
-static bool no_ruleset_callback = FALSE;
-
-/**********************************************************************//**
-  Ruleset name has been given
-**************************************************************************/
-static void ruleset_selected(const char *name)
-{
-  if (name && name[0] != '\0' && !no_ruleset_callback) {
-    set_ruleset(name);
-  }
-}
-
-/**********************************************************************//**
-  Ruleset selection callback. Note that this gets also called when ever
-  user types to entry box. In that case we don't want to set_ruleset()
-  after each letter.
-**************************************************************************/
-static void ruleset_entry_changed(GtkWidget *w, gpointer data)
-{
-  const char *name = NULL;
-
-  name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(ruleset_combo));
-
-  if (name != NULL) {
-    ruleset_selected(name);
-  }
-}
-
-/**********************************************************************//**
-  User changed AI fill setting.
-**************************************************************************/
-static bool send_new_aifill_to_server = TRUE;
-static void ai_fill_changed_by_user(GtkWidget *w, gpointer data)
-{
-  if (send_new_aifill_to_server) {
-    option_int_set(optset_option_by_name(server_optset, "aifill"),
-                   gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w)));
-  }
-}
-
-/**********************************************************************//**
-  Server changed AI fill setting.
-**************************************************************************/
-void ai_fill_changed_by_server(int aifill)
-{
-  if (start_aifill_spin) {
-    bool old = send_new_aifill_to_server;
-    /* Suppress callback from this change to avoid a loop. */
-    send_new_aifill_to_server = FALSE;
-    /* HACK: this GUI control doesn't have quite the same semantics as the
-     * server 'aifill' option, in that it claims to represent the minimum
-     * number of players _including humans_. The GUI control has a minimum
-     * value of 1, so aifill == 0 will not be represented correctly.
-     * But there's generally exactly one human player because the control
-     * only shows up for a locally spawned server, so we more or less
-     * get away with this. */
-    gtk_spin_button_set_value(GTK_SPIN_BUTTON(start_aifill_spin), aifill);
-    send_new_aifill_to_server = old;
-  }
-}
-
-/**********************************************************************//**
-  Update the start page.
-**************************************************************************/
-void update_start_page(void)
-{
-  conn_list_dialog_update();
-}
-
-/**********************************************************************//**
-  Close connection menu.
-**************************************************************************/
-static void close_conn_menu_popover(void)
-{
-  if (conn_popover != NULL){
-    gtk_widget_unparent(conn_popover);
-    g_object_unref(conn_popover);
-
-    conn_popover = NULL;
-  }
-}
-
-/**********************************************************************//**
-  Callback for when a team is chosen from the conn menu.
-**************************************************************************/
-static void conn_menu_team_chosen(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct player *pplayer;
-  struct team_slot *tslot = g_object_get_data(G_OBJECT(action), "slot");
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, NULL)
-      && NULL != tslot
-      && team_slot_index(tslot) != team_number(pplayer->team)) {
-    send_chat_printf("/team \"%s\" \"%s\"",
-                     player_name(pplayer),
-                     team_slot_rule_name(tslot));
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Callback for when the "ready" entry is chosen from the conn menu.
-**************************************************************************/
-static void conn_menu_ready_chosen(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  struct player *pplayer;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, NULL)) {
-    dsend_packet_player_ready(&client.conn,
-                              player_number(pplayer), !pplayer->is_ready);
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Callback for when the pick-nation entry is chosen from the conn menu.
-**************************************************************************/
-static void conn_menu_nation_chosen(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data)
-{
-  struct player *pplayer;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, NULL)) {
-    popup_races_dialog(pplayer);
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Miscellaneous callback for the conn menu that allows an arbitrary command
-  (/observe, /remove, /hard, etc.) to be run on the player.
-**************************************************************************/
-static void conn_menu_player_command(GSimpleAction *action, GVariant *parameter,
-                                     gpointer data)
-{
-  struct player *pplayer;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, NULL)) {
-    send_chat_printf("/%s \"%s\"",
-                     (char *) g_object_get_data(G_OBJECT(action), "command"),
-                     player_name(pplayer));
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Take command in the conn menu.
-**************************************************************************/
-static void conn_menu_player_take(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct player *pplayer;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, NULL)) {
-    client_take_player(pplayer);
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Miscellaneous callback for the conn menu that allows an arbitrary command
-  (/cmdlevel, /cut, etc.) to be run on the connection.
-**************************************************************************/
-static void conn_menu_connection_command(GSimpleAction *action,
-                                         GVariant *parameter, gpointer data)
-{
-  struct connection *pconn;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), NULL, &pconn)) {
-    send_chat_printf(SERVER_COMMAND_PREFIX_STR "%s \"%s\"",
-                     (char *) g_object_get_data(G_OBJECT(action), "command"),
-                     pconn->username);
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Show details about a user in the Connected Users dialog in a popup.
-**************************************************************************/
-static void show_conn_popup(struct player *pplayer, struct connection *pconn)
-{
-  GtkWidget *popup;
-  char buf[4096] = "";
-
-  if (pconn) {
-    cat_snprintf(buf, sizeof(buf), _("Connection name: %s"),
-                 pconn->username);
-  } else {
-    cat_snprintf(buf, sizeof(buf), _("Player name: %s"),
-                 player_name(pplayer));
-  }
-  cat_snprintf(buf, sizeof(buf), "\n");
-  if (pconn) {
-    cat_snprintf(buf, sizeof(buf), _("Host: %s"), pconn->addr);
-  }
-  cat_snprintf(buf, sizeof(buf), "\n");
-
-  /* Show popup. */
-  popup = gtk_message_dialog_new(NULL, 0,
-                                 GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-                                 "%s", buf);
-  gtk_window_set_title(GTK_WINDOW(popup), _("Player/conn info"));
-  setup_dialog(popup, toplevel);
-  g_signal_connect(popup, "response", G_CALLBACK(gtk_window_destroy), NULL);
-  gtk_window_present(GTK_WINDOW(popup));
-}
-
-/**********************************************************************//**
-  Callback for when the "info" entry is chosen from the conn menu.
-**************************************************************************/
-static void conn_menu_info_chosen(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data)
-{
-  struct player *pplayer;
-  struct connection *pconn;
-  GMenu *menu = data;
-
-  if (object_extract(G_OBJECT(menu), &pplayer, &pconn)) {
-    show_conn_popup(pplayer, pconn);
-  }
-
-  close_conn_menu_popover();
-}
-
-/**********************************************************************//**
-  Called when you click on a player; this function pops up a menu
-  to allow changing the team.
-**************************************************************************/
-static GtkWidget *create_conn_menu(struct player *pplayer,
-                                   struct connection *pconn)
-{
-  GMenu *menu;
-  gchar *buf;
-  GSimpleAction *act;
-  GActionGroup *group;
-
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-
-  menu = g_menu_new();
-
-  object_put(G_OBJECT(menu), pplayer, pconn);
-
-  buf = g_strdup_printf(_("%s info"),
-                        pconn ? pconn->username : player_name(pplayer));
-
-  act = g_simple_action_new("info", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(conn_menu_info_chosen), menu);
-  menu_item_append_unref(menu, g_menu_item_new(buf, "win.info"));
-
-  if (NULL != pplayer) {
-    act = g_simple_action_new("toggle_ready", NULL);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_ready_chosen), menu);
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act), is_human(pplayer));
-    menu_item_append_unref(menu, g_menu_item_new(_("Toggle player ready"),
-                                                 "win.toggle_ready"));
-
-    act = g_simple_action_new("pick_nation", NULL);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_nation_chosen), menu);
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(act),
-                                can_conn_edit_players_nation(&client.conn,
-                                                             pplayer));
-    menu_item_append_unref(menu, g_menu_item_new(_("Pick nation"), "win.pick_nation"));
-
-    act = g_simple_action_new("observe", NULL);
-    g_object_set_data_full(G_OBJECT(act), "command", g_strdup("observe"),
-                           (GDestroyNotify) g_free);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_player_command), menu);
-    menu_item_append_unref(menu, g_menu_item_new(_("Observe this player"),
-                                                 "win.observe"));
-
-    act = g_simple_action_new("take_plr", NULL);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_player_take), menu);
-    menu_item_append_unref(menu, g_menu_item_new(_("Take this player"),
-                                                 "win.take_plr"));
-  }
-
-  if (ALLOW_CTRL <= client.conn.access_level && NULL != pconn
-      && pconn->id != client.conn.id) {
-    act = g_simple_action_new("cut_conn", NULL);
-    g_object_set_data_full(G_OBJECT(act), "command", g_strdup("cut"),
-                           (GDestroyNotify) g_free);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_connection_command), menu);
-    menu_item_append_unref(menu, g_menu_item_new(_("Cut connection"), "win.cut_conn"));
-  }
-
-  if (ALLOW_CTRL <= client.conn.access_level && NULL != pplayer) {
-    act = g_simple_action_new("aitoggle", NULL);
-    g_object_set_data_full(G_OBJECT(act), "command", g_strdup("aitoggle"),
-                           (GDestroyNotify) g_free);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(conn_menu_connection_command), menu);
-    menu_item_append_unref(menu, g_menu_item_new(_("Aitoggle player"), "win.aitoggle"));
-
-    if (pplayer != client.conn.playing && game.info.is_new_game) {
-      act = g_simple_action_new("remove", NULL);
-      g_object_set_data_full(G_OBJECT(act), "command", g_strdup("remove"),
-                             (GDestroyNotify) g_free);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(conn_menu_connection_command), menu);
-      menu_item_append_unref(menu, g_menu_item_new(_("Remove player"), "win.remove"));
-    }
-  }
-
-  if (ALLOW_ADMIN <= client.conn.access_level && NULL != pconn
-      && pconn->id != client.conn.id) {
-    enum cmdlevel level;
-
-    /* No item for hack access; that would be a serious security hole. */
-    for (level = cmdlevel_min(); level < client.conn.access_level; level++) {
-      char actbuf[128];
-
-      buf = g_strdup_printf(_("Give %s access"), cmdlevel_name(level));
-      fc_snprintf(actbuf, sizeof(actbuf), "cmdlevel_%d", level);
-
-      act = g_simple_action_new(actbuf, NULL);
-      g_object_set_data_full(G_OBJECT(act), "command",
-                             g_strdup_printf("cmdlevel %s",
-                                             cmdlevel_name(level)),
-                             (GDestroyNotify) g_free);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(conn_menu_connection_command), menu);
-      fc_snprintf(actbuf, sizeof(actbuf), "win.cmdlevel_%d", level);
-      menu_item_append_unref(menu, g_menu_item_new(buf, actbuf));
-      g_free(buf);
-    }
-  }
-
-  if (ALLOW_CTRL <= client.conn.access_level
-      && NULL != pplayer && is_ai(pplayer)) {
-    enum ai_level level;
-
-    for (level = 0; level < AI_LEVEL_COUNT; level++) {
-      if (is_settable_ai_level(level)) {
-        char actbuf[128];
-
-        buf = g_strdup_printf(_("Difficulty: %s"), ai_level_translated_name(level));
-        fc_snprintf(actbuf, sizeof(actbuf), "ailevel_%d", level);
-
-        act = g_simple_action_new(actbuf, NULL);
-        g_object_set_data_full(G_OBJECT(act), "command",
-                               g_strdup(ai_level_cmd(level)),
-                               (GDestroyNotify) g_free);
-        g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-        g_signal_connect(act, "activate", G_CALLBACK(conn_menu_player_command), menu);
-        fc_snprintf(actbuf, sizeof(actbuf), "win.ailevel_%d", level);
-        menu_item_append_unref(menu, g_menu_item_new(buf, actbuf));
-        g_free(buf);
-      }
-    }
-  }
-
-  if (pplayer != NULL /* && game.info.is_new_game */) {
-    const int count = pplayer->team
-      ? player_list_size(team_members(pplayer->team)) : 0;
-    bool need_empty_team = (count != 1);
-
-    /* Can't use team_iterate here since it skips empty teams. */
-    team_slots_iterate(tslot) {
-      char actbuf[128];
-      int id;
-
-      if (!team_slot_is_used(tslot)) {
-        if (!need_empty_team) {
-          continue;
-        }
-        need_empty_team = FALSE;
-      }
-
-      id = team_number(team_slot_get_team(tslot));
-
-      /* TRANS: e.g., "Put on Team 5" */
-      buf = g_strdup_printf(_("Put on %s"),
-                            team_slot_name_translation(tslot));
-      fc_snprintf(actbuf, sizeof(actbuf), "team_%d", id);
-
-      act = g_simple_action_new(actbuf, NULL);
-      g_object_set_data(G_OBJECT(act), "slot", tslot);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate", G_CALLBACK(conn_menu_team_chosen), menu);
-      fc_snprintf(actbuf, sizeof(actbuf), "win.team_%d", id);
-      menu_item_append_unref(menu, g_menu_item_new(buf, actbuf));
-      g_free(buf);
-    } team_slots_iterate_end;
-  }
-
-  close_conn_menu_popover();
-  conn_popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
-  g_object_ref(conn_popover);
-  gtk_widget_insert_action_group(conn_popover, "win", group);
-
-  return conn_popover;
-}
-
-/**********************************************************************//**
-  Unselect a tree path.
-**************************************************************************/
-static gboolean delayed_unselect_path(gpointer data)
-{
-  if (NULL != connection_list_view) {
-    GtkTreeSelection *selection =
-        gtk_tree_view_get_selection(connection_list_view);
-    GtkTreePath *path = data;
-
-    gtk_tree_selection_unselect_path(selection, path);
-    gtk_tree_path_free(path);
-  }
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Called on a left button click on the pregame player list.
-**************************************************************************/
-static gboolean connect_list_left_button(GtkGestureClick *gesture,
-                                         int n_press,
-                                         double x, double y, gpointer data)
-{
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkTreeView *tree = GTK_TREE_VIEW(gtk_event_controller_get_widget(controller));
-  GtkTreePath *path = NULL;
-  GtkTreeSelection *selection = gtk_tree_view_get_selection(tree);
-
-  if (!gtk_tree_view_get_path_at_pos(tree,
-                                     x, y,
-                                     &path, NULL, NULL, NULL)) {
-    return FALSE;
-  }
-
-  if (gtk_tree_selection_path_is_selected(selection, path)) {
-    /* Need to delay to avoid problem with the expander. */
-    g_idle_add(delayed_unselect_path, path);
-    return FALSE;     /* Return now, don't free the path. */
-  }
-
-  gtk_tree_path_free(path);
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Called on a right button click on the pregame player list.
-**************************************************************************/
-static gboolean connect_list_right_button(GtkGestureClick *gesture,
-                                          int n_press,
-                                          double x, double y, gpointer data)
-{
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkWidget *tree = gtk_event_controller_get_widget(controller);
-  GtkWidget *parent = data;
-  GtkTreePath *path = NULL;
-  GtkWidget *menu;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  int player_no, conn_id;
-  struct player *pplayer;
-  struct connection *pconn;
-  int bx, by;
-  GdkRectangle rect = { .x = x, .y = y, .width = 1, .height = 1};
-
-  gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(tree), x, y, &bx, &by);
-
-  if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree), bx, by,
-                                     &path, NULL, NULL, NULL)) {
-    return FALSE;
-  }
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
-  model = gtk_tree_view_get_model(GTK_TREE_VIEW(tree));
-
-  if (!gtk_tree_selection_path_is_selected(selection, path)) {
-    gtk_tree_selection_select_path(selection, path);
-  }
-  gtk_tree_model_get_iter(model, &iter, path);
-
-  gtk_tree_model_get(model, &iter, CL_COL_PLAYER_NUMBER, &player_no, -1);
-  pplayer = player_by_number(player_no);
-
-  gtk_tree_model_get(model, &iter, CL_COL_CONN_ID, &conn_id, -1);
-  pconn = conn_by_number(conn_id);
-
-  menu = create_conn_menu(pplayer, pconn);
-  gtk_widget_set_parent(menu, parent); /* Gtk bug prevents tree view parenting */
-  gtk_popover_set_pointing_to(GTK_POPOVER(menu), &rect);
-
-  gtk_popover_popup(GTK_POPOVER(menu));
-
-  gtk_tree_path_free(path);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Mark a row as collapsed or expanded.
-**************************************************************************/
-static void connection_list_row_callback(GtkTreeView *tree_view,
-                                         GtkTreeIter *iter,
-                                         GtkTreePath *path,
-                                         gpointer data)
-{
-  GtkTreeStore *store = GTK_TREE_STORE(gtk_tree_view_get_model(tree_view));
-
-  gtk_tree_store_set(store, iter,
-                     CL_COL_COLLAPSED, GPOINTER_TO_INT(data), -1);
-}
-
-/**********************************************************************//**
-  Returns TRUE if a row is selected in the connection/player list. Fills
-  the not null data.
-**************************************************************************/
-static bool conn_list_selection(struct player **ppplayer,
-                                struct connection **ppconn)
-{
-  if (NULL != connection_list_view) {
-    GtkTreeIter iter;
-    GtkTreeModel *model;
-    GtkTreeSelection *selection =
-        gtk_tree_view_get_selection(connection_list_view);
-
-    if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-      int id;
-
-      if (NULL != ppplayer) {
-        gtk_tree_model_get(model, &iter, CL_COL_PLAYER_NUMBER, &id, -1);
-        *ppplayer = player_by_number(id);
-      }
-      if (NULL != ppconn) {
-        gtk_tree_model_get(model, &iter, CL_COL_CONN_ID, &id, -1);
-        *ppconn = conn_by_number(id);
-      }
-      return TRUE;
-    }
-  }
-
-  if (NULL != ppplayer) {
-    *ppplayer = NULL;
-  }
-  if (NULL != ppconn) {
-    *ppconn = NULL;
-  }
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Selects connection's row in the connection/player list.
-**************************************************************************/
-static void conn_list_select_conn(struct connection *pconn)
-{
-  GtkTreeModel *model;
-  GtkTreeIter parent, child, *iter = NULL;
-  GtkTreeSelection *selection;
-  gboolean valid;
-  const int search_id = pconn->id;
-  int id;
-
-  if (NULL == connection_list_view) {
-    return;
-  }
-
-  model = gtk_tree_view_get_model(connection_list_view);
-  selection = gtk_tree_view_get_selection(connection_list_view);
-
-  /* Main iteration. */
-  valid = gtk_tree_model_get_iter_first(model, &parent);
-  while (valid && NULL == iter) {
-    gtk_tree_model_get(model, &parent, CL_COL_CONN_ID, &id, -1);
-    if (search_id == id) {
-      iter = &parent;
-      break;
-    }
-
-    /* Node children iteration. */
-    valid = gtk_tree_model_iter_children(model, &child, &parent);
-    while (valid && NULL == iter) {
-      gtk_tree_model_get(model, &child, CL_COL_CONN_ID, &id, -1);
-      if (search_id == id) {
-        iter = &child;
-        break;
-      }
-      valid = gtk_tree_model_iter_next(model, &child);
-    }
-
-    valid = gtk_tree_model_iter_next(model, &parent);
-  }
-
-  /* Select iterator. */
-  if (NULL != iter) {
-    gtk_tree_selection_select_iter(selection, iter);
-  } else {
-    log_error("%s(): connection %s not found.",
-              __FUNCTION__, conn_description(pconn));
-  }
-}
-
-/**********************************************************************//**
-  'ready_button' clicked callback.
-**************************************************************************/
-static void ready_button_callback(GtkWidget *w, gpointer data)
-{
-  if (can_client_control()) {
-    dsend_packet_player_ready(&client.conn,
-                              player_number(client_player()),
-                              !client_player()->is_ready);
-  } else {
-    dsend_packet_player_ready(&client.conn, 0, TRUE);
-  }
-}
-
-/**********************************************************************//**
-  'nation_button' clicked callback.
-**************************************************************************/
-static void nation_button_callback(GtkWidget *w, gpointer data)
-{
-  struct player *selected_plr;
-  bool row_selected = conn_list_selection(&selected_plr, NULL);
-
-  if (row_selected && NULL != selected_plr) {
-    /* "Take <player_name>" */
-    client_take_player(selected_plr);
-  } else if (can_client_control()) {
-    /* "Pick Nation" */
-    popup_races_dialog(client_player());
-  } else {
-    /* "Take a Player" */
-    send_chat("/take -");
-  }
-}
-
-/**********************************************************************//**
-  'observe_button' clicked callback.
-**************************************************************************/
-static void observe_button_callback(GtkWidget *w, gpointer data)
-{
-  struct player *selected_plr;
-  bool row_selected = conn_list_selection(&selected_plr, NULL);
-
-  if (row_selected && NULL != selected_plr) {
-    /* "Observe <player_name>" */
-    send_chat_printf("/observe \"%s\"", player_name(selected_plr));
-  } else if (!client_is_global_observer()) {
-    /* "Observe" */
-    send_chat("/observe");
-  } else {
-    /* "Do not observe" */
-    send_chat("/detach");
-  }
-}
-
-/**********************************************************************//**
-  Update the buttons of the start page.
-**************************************************************************/
-static void update_start_page_buttons(void)
-{
-  char buf[2 * MAX_LEN_NAME];
-  const char *text;
-  struct player *selected_plr;
-  bool row_selected = conn_list_selection(&selected_plr, NULL);
-  bool sensitive;
-
-  /*** Ready button. ***/
-  if (can_client_control()) {
-    sensitive = client_player()->is_alive;
-    if (client_player()->is_ready) {
-      text = _("Not _ready");
-    } else {
-      int num_unready = 0;
-
-      players_iterate_alive(pplayer) {
-        if (is_human(pplayer) && !pplayer->is_ready) {
-          num_unready++;
-        }
-      } players_iterate_alive_end;
-
-      if (num_unready > 1) {
-        text = _("_Ready");
-      } else {
-        /* We are the last unready player so clicking here will
-         * immediately start the game. */
-        text = _("_Start");
-      }
-    }
-  } else {
-    text = _("_Start");
-    if (can_client_access_hack()) {
-      sensitive = TRUE;
-      players_iterate_alive(plr) {
-        if (is_human(plr)) {
-          /* There's human controlled player(s) in game, so it's their
-           * job to start the game. */
-          sensitive = FALSE;
-          break;
-        }
-      } players_iterate_alive_end;
-    } else {
-      sensitive = FALSE;
-    }
-  }
-  gtk_stockbutton_set_label(ready_button, text);
-  gtk_widget_set_sensitive(ready_button, sensitive);
-
-  /*** Nation button. ***/
-  if (row_selected && NULL != selected_plr) {
-    fc_snprintf(buf, sizeof(buf), _("_Take %s"), player_name(selected_plr));
-    text = buf;
-    sensitive = (client_is_observer() || selected_plr != client_player());
-  } else if (can_client_control()) {
-    text = _("Pick _Nation");
-    sensitive = game.info.is_new_game;
-  } else {
-    text = _("_Take a Player");
-    sensitive = game.info.is_new_game;
-  }
-  gtk_stockbutton_set_label(nation_button, text);
-  gtk_widget_set_sensitive(nation_button, sensitive);
-
-  /*** Observe button. ***/
-  if (row_selected && NULL != selected_plr) {
-    fc_snprintf(buf, sizeof(buf), _("_Observe %s"),
-                player_name(selected_plr));
-    text = buf;
-    sensitive = (!client_is_observer() || selected_plr != client_player());
-  } else if (!client_is_global_observer()) {
-    text = _("_Observe");
-    sensitive = TRUE;
-  } else {
-    text = _("Do not _observe");
-    sensitive = TRUE;
-  }
-  gtk_stockbutton_set_label(observe_button, text);
-  gtk_widget_set_sensitive(observe_button, sensitive);
-}
-
-/**********************************************************************//**
-  Search a player iterator in the model. Begin the iteration at 'start' or
-  at the start of the model if 'start' is set to NULL.
-**************************************************************************/
-static bool model_get_player_iter(GtkTreeModel *model,
-                                  GtkTreeIter *iter,
-                                  GtkTreeIter *start,
-                                  const struct player *pplayer)
-{
-  const int search_id = player_number(pplayer);
-  int id;
-
-  if (NULL != start) {
-    *iter = *start;
-    if (!gtk_tree_model_iter_next(model, iter)) {
-      return FALSE;
-    }
-  } else if (!gtk_tree_model_get_iter_first(model, iter)) {
-    return FALSE;
-  }
-
-  do {
-    gtk_tree_model_get(model, iter, CL_COL_PLAYER_NUMBER, &id, -1);
-    if (id == search_id) {
-      return TRUE;
-    }
-  } while (gtk_tree_model_iter_next(model, iter));
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Search a connection iterator in the model. Begin the iteration at 'start'
-  or at the start of the model if 'start' is set to NULL.
-**************************************************************************/
-static bool model_get_conn_iter(GtkTreeModel *model, GtkTreeIter *iter,
-                                GtkTreeIter *parent, GtkTreeIter *start,
-                                const struct connection *pconn)
-{
-  const int search_id = pconn->id;
-  int id;
-
-  if (NULL != start) {
-    *iter = *start;
-    if (!gtk_tree_model_iter_next(model, iter)) {
-      return FALSE;
-    }
-  } else if (!gtk_tree_model_iter_children(model, iter, parent)) {
-    return FALSE;
-  }
-
-  do {
-    gtk_tree_model_get(model, iter, CL_COL_CONN_ID, &id, -1);
-    if (id == search_id) {
-      return TRUE;
-    }
-  } while (gtk_tree_model_iter_next(model, iter));
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Update the connected users list at pregame state.
-**************************************************************************/
-void real_conn_list_dialog_update(void *unused)
-{
-  if (client_state() == C_S_PREPARING
-      && get_client_page() == PAGE_START
-      && connection_list_store != NULL) {
-    GtkTreeStore *store = connection_list_store;
-    GtkTreeModel *model = GTK_TREE_MODEL(store);
-    GtkTreePath *path;
-    GtkTreeIter child, prev_child, *pprev_child;
-    GtkTreeIter parent, prev_parent, *pprev_parent = NULL;
-    GdkPixbuf *flag, *color;
-    gboolean collapsed;
-    struct player *pselected_player;
-    struct connection *pselected_conn;
-    bool is_ready;
-    const char *nation, *plr_name, *team;
-    char name[MAX_LEN_NAME + 8];
-    enum cmdlevel access_level;
-    int conn_id;
-
-    /* Refresh the AI skill level control */
-    if (ai_lvl_combobox) {
-      enum ai_level new_level = server_ai_level(), level;
-      int i = 0;
-
-      for (level = 0; level < AI_LEVEL_COUNT; level++) {
-        if (is_settable_ai_level(level)) {
-          if (level == new_level) {
-            gtk_combo_box_set_active(GTK_COMBO_BOX(ai_lvl_combobox), i);
-            break;
-          }
-          i++;
-        }
-      }
-      if (level == AI_LEVEL_COUNT) {
-        /* Probably ai_level_invalid() */
-        gtk_combo_box_set_active(GTK_COMBO_BOX(ai_lvl_combobox), -1);
-      }
-    }
-
-    /* Save the selected connection. */
-    (void) conn_list_selection(&pselected_player, &pselected_conn);
-
-    /* Insert players into the connection list. */
-    players_iterate(pplayer) {
-      if (!player_has_flag(pplayer, PLRF_SCENARIO_RESERVED)) {
-        conn_id = -1;
-        access_level = ALLOW_NONE;
-        flag = pplayer->nation ? get_flag(pplayer->nation) : NULL;
-        color = create_player_icon(pplayer);
-
-        conn_list_iterate(pplayer->connections, pconn) {
-          if (pconn->playing == pplayer && !pconn->observer) {
-            conn_id = pconn->id;
-            access_level = pconn->access_level;
-            break;
-          }
-        } conn_list_iterate_end;
-
-        if (is_ai(pplayer) && !pplayer->was_created
-            && !pplayer->is_connected) {
-          /* TRANS: "<Novice AI>" */
-          fc_snprintf(name, sizeof(name), _("<%s AI>"),
-                      ai_level_translated_name(pplayer->ai_common.skill_level));
-        } else {
-          sz_strlcpy(name, pplayer->username);
-          if (access_level > ALLOW_BASIC) {
-            sz_strlcat(name, "*");
-          }
-        }
-
-        is_ready = !is_human(pplayer) ? TRUE : pplayer->is_ready;
-
-        if (pplayer->nation == NO_NATION_SELECTED) {
-          nation = _("Random");
-          if (pplayer->was_created) {
-            plr_name = player_name(pplayer);
-          } else {
-            plr_name = "";
-          }
-        } else {
-          nation = nation_adjective_for_player(pplayer);
-          plr_name = player_name(pplayer);
-        }
-
-        team = pplayer->team ? team_name_translation(pplayer->team) : "";
-
-        if (model_get_player_iter(model, &parent, pprev_parent, pplayer)) {
-          gtk_tree_store_move_after(store, &parent, pprev_parent);
-        } else {
-          gtk_tree_store_insert_after(store, &parent, NULL, pprev_parent);
-        }
-
-        gtk_tree_store_set(store, &parent,
-                           CL_COL_PLAYER_NUMBER, player_number(pplayer),
-                           CL_COL_USER_NAME, name,
-                           CL_COL_READY_STATE, is_ready,
-                           CL_COL_PLAYER_NAME, plr_name,
-                           CL_COL_FLAG, flag,
-                           CL_COL_COLOR, color,
-                           CL_COL_NATION, nation,
-                           CL_COL_TEAM, team,
-                           CL_COL_CONN_ID, conn_id,
-                           CL_COL_STYLE, PANGO_STYLE_NORMAL,
-                           CL_COL_WEIGHT, PANGO_WEIGHT_BOLD,
-                           -1);
-
-        /* Insert observers of this player as child nodes. */
-        pprev_child = NULL;
-        conn_list_iterate(pplayer->connections, pconn) {
-          if (pconn->id == conn_id) {
-            continue;
-          }
-          if (model_get_conn_iter(model, &child, &parent,
-                                  pprev_child, pconn)) {
-            gtk_tree_store_move_after(store, &child, pprev_child);
-          } else {
-            gtk_tree_store_insert_after(store, &child, &parent, pprev_child);
-          }
-
-          gtk_tree_store_set(store, &child,
-                             CL_COL_PLAYER_NUMBER, -1,
-                             CL_COL_USER_NAME, pconn->username,
-                             CL_COL_TEAM, _("Observer"),
-                             CL_COL_CONN_ID, pconn->id,
-                             CL_COL_STYLE, PANGO_STYLE_NORMAL,
-                             CL_COL_WEIGHT, PANGO_WEIGHT_NORMAL,
-                             -1);
-
-          prev_child = child;
-          pprev_child = &prev_child;
-        } conn_list_iterate_end;
-
-        /* Expand node? */
-        if (NULL != pprev_child) {
-          gtk_tree_model_get(model, &parent, CL_COL_COLLAPSED, &collapsed, -1);
-          if (!collapsed) {
-            path = gtk_tree_model_get_path(model, &parent);
-            gtk_tree_view_expand_row(GTK_TREE_VIEW(connection_list_view),
-                                     path, FALSE);
-            gtk_tree_path_free(path);
-          }
-        }
-
-        /* Remove trailing rows. */
-        if (NULL != pprev_child) {
-          child = prev_child;
-          if (gtk_tree_model_iter_next(model, &child)) {
-            while (gtk_tree_store_remove(store, &child)) {
-              /* Do nothing more. */
-            }
-          }
-        } else if (gtk_tree_model_iter_children(model, &child, &parent)) {
-          while (gtk_tree_store_remove(store, &child)) {
-            /* Do nothing more. */
-          }
-        }
-
-        prev_parent = parent;
-        pprev_parent = &prev_parent;
-        if (flag) {
-          g_object_unref(flag);
-        }
-        if (color) {
-          g_object_unref(color);
-        }
-      }
-    } players_iterate_end;
-
-    /* Finally, insert global observers... */
-    conn_list_iterate(game.est_connections, pconn) {
-      if (NULL != pconn->playing || !pconn->observer) {
-        continue;
-      }
-
-      if (model_get_conn_iter(model, &parent, NULL, pprev_parent, pconn)) {
-        gtk_tree_store_move_after(store, &parent, pprev_parent);
-      } else {
-        gtk_tree_store_insert_after(store, &parent, NULL, pprev_parent);
-      }
-
-      gtk_tree_store_set(store, &parent,
-                         CL_COL_PLAYER_NUMBER, -1,
-                         CL_COL_USER_NAME, pconn->username,
-                         CL_COL_TEAM, _("Observer"),
-                         CL_COL_CONN_ID, pconn->id,
-                         CL_COL_STYLE, PANGO_STYLE_NORMAL,
-                         CL_COL_WEIGHT, PANGO_WEIGHT_NORMAL,
-                         -1);
-
-      prev_parent = parent;
-      pprev_parent = &prev_parent;
-    } conn_list_iterate_end;
-
-    /* ...and detached connections. */
-    conn_list_iterate(game.est_connections, pconn) {
-      if (NULL != pconn->playing || pconn->observer) {
-        continue;
-      }
-
-      if (model_get_conn_iter(model, &parent, NULL, pprev_parent, pconn)) {
-        gtk_tree_store_move_after(store, &parent, pprev_parent);
-      } else {
-        gtk_tree_store_insert_after(store, &parent, NULL, pprev_parent);
-      }
-
-      gtk_tree_store_set(store, &parent,
-                         CL_COL_PLAYER_NUMBER, -1,
-                         CL_COL_USER_NAME, pconn->username,
-                         CL_COL_TEAM, _("Detached"),
-                         CL_COL_CONN_ID, pconn->id,
-                         CL_COL_STYLE, PANGO_STYLE_ITALIC,
-                         CL_COL_WEIGHT, PANGO_WEIGHT_NORMAL,
-                         -1);
-
-      prev_parent = parent;
-      pprev_parent = &prev_parent;
-    } conn_list_iterate_end;
-
-    /* Remove trailing rows. */
-    if (NULL != pprev_parent) {
-      parent = prev_parent;
-      if (gtk_tree_model_iter_next(model, &parent)) {
-        while (gtk_tree_store_remove(store, &parent)) {
-          /* Do nothing more. */
-        }
-      }
-    } else {
-      gtk_tree_store_clear(store);
-    }
-
-    /* If we were selecting a single connection, let's try to reselect it. */
-    if (NULL == pselected_player && NULL != pselected_conn) {
-      conn_list_select_conn(pselected_conn);
-    }
-  }
-
-  update_start_page_buttons();
-}
-
-/**********************************************************************//**
-  Helper function for adding columns to a tree view. If 'key' is not NULL
-  then the added column is added to the object data of the treeview using
-  g_object_set_data() under 'key'.
-**************************************************************************/
-static void add_tree_col(GtkWidget *treeview, GType gtype,
-                         const char *title, int colnum, const char *key)
-{
-  GtkCellRenderer *rend;
-  GtkTreeViewColumn *col;
-
-  if (gtype == G_TYPE_BOOLEAN) {
-    rend = gtk_cell_renderer_toggle_new();
-    col = gtk_tree_view_column_new_with_attributes(title, rend,
-                                                   "active", colnum, NULL);
-  } else if (gtype == GDK_TYPE_PIXBUF) {
-    rend = gtk_cell_renderer_pixbuf_new();
-    col = gtk_tree_view_column_new_with_attributes(title, rend,
-                                                   "pixbuf", colnum, NULL);
-  } else {
-    rend = gtk_cell_renderer_text_new();
-    col = gtk_tree_view_column_new_with_attributes(title, rend,
-                                                   "text", colnum,
-                                                   "style", CL_COL_STYLE,
-                                                   "weight", CL_COL_WEIGHT,
-                                                   NULL);
-  }
-
-  gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col);
-
-  if (key != NULL) {
-    g_object_set_data(G_OBJECT(treeview), key, col);
-  }
-}
-
-/**********************************************************************//**
-  Create start page.
-**************************************************************************/
-GtkWidget *create_start_page(void)
-{
-  GtkWidget *box, *sbox, *table, *vgrid;
-  GtkWidget *view, *sw, *text, *toolkit_view, *button, *spin;
-  GtkWidget *label;
-  GtkTreeSelection *selection;
-  enum ai_level level;
-  /* There's less than AI_LEVEL_COUNT entries as not all levels have
-     entries (that's the whole point of this array: index != value),
-     but this is set safely to the max */
-  static enum ai_level levels[AI_LEVEL_COUNT];
-  int i = 0;
-  int box_row = 0;
-  int sbox_col = 0;
-  int grid_row = 0;
-  GtkGesture *gesture;
-  GtkEventController *controller;
-
-  box = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(box),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(box), 8);
-  gtk_widget_set_margin_start(box, 4);
-  gtk_widget_set_margin_end(box, 4);
-  gtk_widget_set_margin_top(box, 4);
-  gtk_widget_set_margin_bottom(box, 4);
-
-  sbox = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(sbox), 12);
-  gtk_grid_attach(GTK_GRID(box), sbox, 0, box_row++, 1, 1);
-
-  vgrid = gtk_grid_new();
-  gtk_widget_set_margin_bottom(vgrid, 12);
-  gtk_widget_set_margin_end(vgrid, 12);
-  gtk_widget_set_margin_start(vgrid, 12);
-  gtk_widget_set_margin_top(vgrid, 12);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 2);
-  gtk_widget_set_halign(vgrid, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(vgrid, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(sbox), vgrid, sbox_col++, 0, 1, 1);
-
-  table = gtk_grid_new();
-  start_options_table = table;
-  gtk_grid_set_row_spacing(GTK_GRID(table), 2);
-  gtk_grid_set_column_spacing(GTK_GRID(table), 12);
-  gtk_grid_attach(GTK_GRID(vgrid), table, 0, grid_row++, 1, 1);
-
-  spin = gtk_spin_button_new_with_range(1, MAX_NUM_PLAYERS, 1);
-  start_aifill_spin = spin;
-  gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
-  gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin),
-                                    GTK_UPDATE_IF_VALID);
-  if (server_optset != NULL) {
-    struct option *paifill = optset_option_by_name(server_optset, "aifill");
-
-    if (paifill) {
-      gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin),
-                                option_int_get(paifill));
-    } /* else it'll be updated later */
-  }
-  g_signal_connect_after(spin, "value_changed",
-                         G_CALLBACK(ai_fill_changed_by_user), NULL);
-
-  gtk_grid_attach(GTK_GRID(table), spin, 1, 0, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", spin,
-                       /* TRANS: Keep individual lines short */
-                       "label", _("Number of _Players\n(including AI):"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
-
-  ai_lvl_combobox = gtk_combo_box_text_new();
-
-  for (level = 0; level < AI_LEVEL_COUNT; level++) {
-    if (is_settable_ai_level(level)) {
-      const char *level_name = ai_level_translated_name(level);
-
-      gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(ai_lvl_combobox), i, level_name);
-      levels[i] = level;
-      i++;
-    }
-  }
-  gtk_combo_box_set_active(GTK_COMBO_BOX(ai_lvl_combobox), -1);
-  g_signal_connect(ai_lvl_combobox, "changed",
-                   G_CALLBACK(ai_skill_callback), levels);
-
-  gtk_grid_attach(GTK_GRID(table), ai_lvl_combobox, 1, 1, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", ai_lvl_combobox,
-                       "label", _("AI Skill _Level:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
-
-  ruleset_combo = gtk_combo_box_text_new();
-  g_signal_connect(G_OBJECT(ruleset_combo), "changed",
-                   G_CALLBACK(ruleset_entry_changed), NULL);
-
-  gtk_grid_attach(GTK_GRID(table), ruleset_combo, 1, 2, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", GTK_COMBO_BOX_TEXT(ruleset_combo),
-                       "label", _("Ruleset:"),
-                       "xalign", 0.0,
-                       "yalign", 0.5,
-                       NULL);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
-
-  button = icon_label_button_new("preferences-system",
-                                 _("_More Game Options..."));
-  gtk_widget_set_margin_bottom(button, 8);
-  gtk_widget_set_margin_end(button, 8);
-  gtk_widget_set_margin_start(button, 8);
-  gtk_widget_set_margin_top(button, 8);
-  gtk_widget_set_halign(button, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(button, GTK_ALIGN_CENTER);
-  g_signal_connect(button, "clicked",
-      G_CALLBACK(game_options_callback), NULL);
-  gtk_grid_attach(GTK_GRID(vgrid), button, 0, grid_row++, 1, 1);
-
-  connection_list_store = connection_list_store_new();
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(connection_list_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  g_object_unref(G_OBJECT(connection_list_store));
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
-  connection_list_view = GTK_TREE_VIEW(view);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(update_start_page_buttons), NULL);
-
-  add_tree_col(view, G_TYPE_STRING, _("Name"),
-               CL_COL_USER_NAME, NULL);
-  add_tree_col(view, G_TYPE_BOOLEAN, _("Ready"),
-               CL_COL_READY_STATE, NULL);
-  add_tree_col(view, G_TYPE_STRING, Q_("?player:Leader"),
-               CL_COL_PLAYER_NAME, NULL);
-  add_tree_col(view, GDK_TYPE_PIXBUF, _("Flag"),
-               CL_COL_FLAG, NULL);
-  add_tree_col(view, GDK_TYPE_PIXBUF, _("Border"),
-               CL_COL_COLOR, NULL);
-  add_tree_col(view, G_TYPE_STRING, _("Nation"),
-               CL_COL_NATION, NULL);
-  add_tree_col(view, G_TYPE_STRING, _("Team"),
-               CL_COL_TEAM, NULL);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(connect_list_left_button), NULL);
-  gtk_widget_add_controller(view, controller);
-
-  g_signal_connect(view, "row-collapsed",
-                   G_CALLBACK(connection_list_row_callback),
-                   GINT_TO_POINTER(TRUE));
-  g_signal_connect(view, "row-expanded",
-                   G_CALLBACK(connection_list_row_callback),
-                   GINT_TO_POINTER(FALSE));
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 200);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-
-  /* This is for a workaround against gtk bug that we can't parent
-   * popup to the tree view - we have to parent it all the way to sw */
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(connect_list_right_button), sw);
-  gtk_widget_add_controller(view, controller);
-
-  gtk_grid_attach(GTK_GRID(sbox), sw, sbox_col++, 0, 1, 1);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_ALWAYS);
-  gtk_grid_attach(GTK_GRID(box), sw, 0, box_row++, 1, 1);
-
-  text = gtk_text_view_new_with_buffer(message_buffer);
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  start_message_area = text;
-  gtk_widget_set_name(text, "chatline");
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), text);
-
-
-  /* Vote widgets. */
-  if (pregame_votebar == NULL) {
-    pregame_votebar = voteinfo_bar_new(TRUE);
-  }
-  gtk_grid_attach(GTK_GRID(box), pregame_votebar, 0, box_row++, 1, 1);
-
-  toolkit_view = inputline_toolkit_view_new();
-  gtk_grid_attach(GTK_GRID(box), toolkit_view, 0, box_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Cancel"));
-  inputline_toolkit_view_append_button(toolkit_view, button);
-  g_signal_connect(button, "clicked", G_CALLBACK(main_callback), NULL);
-
-  nation_button = icon_label_button_new("document-properties",
-                                        _("Pick _Nation"));
-  inputline_toolkit_view_append_button(toolkit_view, nation_button);
-  g_signal_connect(nation_button, "clicked",
-                   G_CALLBACK(nation_button_callback), NULL);
-
-  observe_button = icon_label_button_new("zoom-in", _("_Observe"));
-  inputline_toolkit_view_append_button(toolkit_view, observe_button);
-  g_signal_connect(observe_button, "clicked",
-                   G_CALLBACK(observe_button_callback), NULL);
-
-  ready_button = icon_label_button_new("system-run", _("_Ready"));
-  inputline_toolkit_view_append_button(toolkit_view, ready_button);
-  g_signal_connect(ready_button, "clicked",
-                   G_CALLBACK(ready_button_callback), NULL);
-
-  return box;
-}
-
-
-/**********************************************************************//**
-  This regenerates the player information from a loaded game on the server.
-**************************************************************************/
-void handle_game_load(bool load_successful, const char *filename)
-{
-  if (load_successful) {
-    set_client_page(PAGE_START);
-
-    if (game.info.is_new_game) {
-      /* It's pregame. Create a player and connect to it */
-      send_chat("/take -");
-    }
-  }
-}
-
-/**********************************************************************//**
-  Load a savegame/scenario.
-**************************************************************************/
-static void load_filename(const char *filename)
-{
-  send_chat_printf("/load %s", filename);
-}
-
-/**********************************************************************//**
-  Loads the currently selected game.
-**************************************************************************/
-static void load_callback(void)
-{
-  GtkTreeIter it;
-  const gchar *filename;
-
-  if (!gtk_tree_selection_get_selected(load_selection, NULL, &it)) {
-    return;
-  }
-
-  gtk_tree_model_get(GTK_TREE_MODEL(load_store), &it,
-                     SD_COL_FULL_PATH, &filename, -1);
-  load_filename(filename);
-}
-
-/**********************************************************************//**
-  Call the default GTK requester for saved game loading.
-**************************************************************************/
-static void load_browse_callback(GtkWidget *w, gpointer data)
-{
-  save_dialog_file_chooser_popup(_("Choose Saved Game to Load"),
-                                 GTK_FILE_CHOOSER_ACTION_OPEN,
-                                 load_filename);
-}
-
-/**********************************************************************//**
-  Update the load page.
-**************************************************************************/
-static void update_load_page(void)
-{
-  /* Search for user saved games. */
-  struct fileinfo_list *files = fileinfolist_infix(get_save_dirs(),
-                                                   ".sav", FALSE);
-
-  save_dialog_store_update(load_store, files);
-  fileinfo_list_destroy(files);
-}
-
-/**********************************************************************//**
-  Create the load page.
-**************************************************************************/
-GtkWidget *create_load_page(void)
-{
-  GtkWidget *box, *sbox, *bbox;
-
-  GtkWidget *button, *label, *view, *sw;
-  GtkCellRenderer *rend;
-  int box_row = 0;
-  int sbox_row = 0;
-
-  box = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(box),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(box), 18);
-  gtk_widget_set_margin_start(box, 4);
-  gtk_widget_set_margin_end(box, 4);
-  gtk_widget_set_margin_top(box, 4);
-  gtk_widget_set_margin_bottom(box, 4);
-
-  load_store = save_dialog_store_new();
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(load_store));
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(load_store);
-
-  rend = gtk_cell_renderer_text_new();
-  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-      -1, NULL, rend, "text", 0, NULL);
-
-  load_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-
-  gtk_tree_selection_set_mode(load_selection, GTK_SELECTION_SINGLE);
-
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(load_callback), NULL);
-
-  sbox = gtk_grid_new();
-  gtk_widget_set_halign(sbox, GTK_ALIGN_CENTER);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(sbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(sbox), 2);
-  gtk_grid_attach(GTK_GRID(box), sbox, 0, box_row++, 1, 1);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "mnemonic-widget", view,
-    "label", _("Choose Saved Game to _Load:"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-  gtk_grid_attach(GTK_GRID(sbox), label, 0, sbox_row++, 1, 1);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW(sw), 300);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_grid_attach(GTK_GRID(sbox), sw, 0, sbox_row++, 1, 1);
-
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_widget_set_hexpand(bbox, TRUE);
-  gtk_box_set_spacing(GTK_BOX(bbox), 12);
-  gtk_grid_attach(GTK_GRID(box), bbox, 0, box_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Browse..."));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(load_browse_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_Cancel"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(main_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_OK"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(load_callback), NULL);
-
-  return box;
-}
-
-/**********************************************************************//**
-  Updates the info for the currently selected scenario.
-**************************************************************************/
-static void scenario_list_callback(void)
-{
-  GtkTreeIter it;
-  GtkTextBuffer *buffer;
-  char *description;
-  char *authors;
-  char *filename;
-  int ver;
-  char vername[50];
-
-  if (gtk_tree_selection_get_selected(scenario_selection, NULL, &it)) {
-    gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                       2, &description, -1);
-    gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                       3, &authors, -1);
-    gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                       1, &filename, -1);
-    gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                       4, &ver, -1);
-    filename = skip_to_basename(filename);
-    if (ver > 0) {
-      int maj;
-      int min;
-
-      maj = ver / 1000000;
-      ver %= 1000000;
-      min = ver / 10000;
-      ver %= 10000;
-      if (ver >= 9000) {
-        /* Development version, have '+' */
-        fc_snprintf(vername, sizeof(vername), "%d.%d+", maj, min);
-      } else {
-        fc_snprintf(vername, sizeof(vername), "%d.%d", maj, min);
-      }
-    } else {
-      /* TRANS: Old scenario format version */
-      fc_snprintf(vername, sizeof(vername), _("pre-2.6"));
-    }
-  } else {
-    description = "";
-    authors = "";
-    filename = "";
-    vername[0] = '\0';
-  }
-
-  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(scenario_description));
-  gtk_text_buffer_set_text(buffer, description, -1);
-  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(scenario_authors));
-  gtk_text_buffer_set_text(buffer, authors, -1);
-  gtk_label_set_text(GTK_LABEL(scenario_filename), filename);
-  gtk_label_set_text(GTK_LABEL(scenario_version), vername);
-}
-
-/**********************************************************************//**
-  Loads the currently selected scenario.
-**************************************************************************/
-static void scenario_callback(void)
-{
-  GtkTreeIter it;
-  char *filename;
-
-  if (!gtk_tree_selection_get_selected(scenario_selection, NULL, &it)) {
-    return;
-  }
-
-  gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it, 1, &filename, -1);
-  load_filename(filename);
-}
-
-/**********************************************************************//**
-  Call the default GTK requester for scenario loading.
-**************************************************************************/
-static void scenario_browse_callback(GtkWidget *w, gpointer data)
-{
-  save_dialog_file_chooser_popup(_("Choose a Scenario"),
-                                 GTK_FILE_CHOOSER_ACTION_OPEN,
-                                 load_filename);
-}
-
-/**********************************************************************//**
-  Update the scenario page.
-**************************************************************************/
-static void update_scenario_page(void)
-{
-  struct fileinfo_list *files;
-
-  gtk_list_store_clear(scenario_store);
-
-  /* search for scenario files. */
-  files = fileinfolist_infix(get_scenario_dirs(), ".sav", TRUE);
-  fileinfo_list_iterate(files, pfile) {
-    struct section_file *sf;
-
-    if ((sf = secfile_load_section(pfile->fullname, "scenario", TRUE))
-        && secfile_lookup_bool_default(sf, TRUE, "scenario.is_scenario")) {
-      const char *sname, *sdescription, *sauthors;
-      int fcver;
-      int fcdev;
-      int current_ver = MAJOR_VERSION * 1000000 + MINOR_VERSION * 10000;
-      int current_dev;
-
-      current_dev = current_ver;
-      if (PATCH_VERSION >= 90) {
-        /* Patch level matters on development versions */
-        current_dev += PATCH_VERSION * 100;
-      }
-
-      fcver = secfile_lookup_int_default(sf, 0, "scenario.game_version");
-      if (fcver < 30000) {
-        /* Pre-3.0 versions stored version number without emergency version
-         * part in the end. To get comparable version number stored,
-         * multiply by 100. */
-        fcver *= 100;
-      }
-      if (fcver % 10000 >= 9000) {
-        fcdev = fcver - (fcver % 100);   /* Emergency version does not count. */
-      } else {
-        fcdev = fcver - (fcver % 10000); /* Patch version does not count. */
-      }
-      sname = secfile_lookup_str_default(sf, NULL, "scenario.name");
-      sdescription = secfile_lookup_str_default(sf, NULL,
-                                                "scenario.description");
-      sauthors = secfile_lookup_str_default(sf, NULL, "scenario.authors");
-      log_debug("scenario file: %s from %s", sname, pfile->fullname);
-
-      /* Ignore scenarios for newer freeciv versions than we are. */
-      if (fcdev <= current_dev) {
-        bool add_new = TRUE;
-
-        if (sname != NULL) {
-          GtkTreeIter it;
-          bool valid;
-
-          valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(scenario_store), &it);
-          while (valid) {
-            char *oname;
-
-            gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                               0, &oname, -1);
-
-            if (!strcmp(sname, oname)) {
-              /* Already listed scenario has the same name as the one we just found */
-              int existing;
-
-              gtk_tree_model_get(GTK_TREE_MODEL(scenario_store), &it,
-                                 4, &existing, -1);
-              log_debug("Duplicate %s (%d vs %d)", sname, existing, fcver);
-
-              if (existing > fcver) {
-                /* Already listed one has higher version number */
-                add_new = FALSE;
-              } else if (existing < fcver) {
-                /* New one has higher version number */
-                add_new = FALSE;
-
-                gtk_list_store_set(scenario_store, &it,
-                                   0, sname && strlen(sname) ? Q_(sname) : pfile->name,
-                                   1, pfile->fullname,
-                                   2, (NULL != sdescription && '\0' != sdescription[0]
-                                       ? Q_(sdescription) : ""),
-                                   3, (NULL != sauthors && sauthors[0] != '\0'
-                                       ? Q_(sauthors) : ""),
-                                   4, fcver,
-                                   -1);
-              } else {
-                /* Same version number -> list both */
-              }
-            }
-            valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(scenario_store), &it);
-          }
-        }
-
-        if (add_new) {
-          GtkTreeIter it;
-
-          gtk_list_store_append(scenario_store, &it);
-          gtk_list_store_set(scenario_store, &it,
-                             0, sname && strlen(sname) ? Q_(sname) : pfile->name,
-                             1, pfile->fullname,
-                             2, (NULL != sdescription && '\0' != sdescription[0]
-                                 ? Q_(sdescription) : ""),
-                             3, (NULL != sauthors && sauthors[0] != '\0'
-                                 ? Q_(sauthors) : ""),
-                             4, fcver,
-                             -1);
-        }
-      }
-
-      secfile_destroy(sf);
-    }
-  } fileinfo_list_iterate_end;
-
-  fileinfo_list_destroy(files);
-}
-
-/**********************************************************************//**
-  Scenario table cell bind function
-**************************************************************************/
-static void scenario_factory_bind(GtkSignalListItemFactory *self,
-                                  GtkListItem *list_item,
-                                  gpointer user_data)
-{
-  FcScenRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(child), row->name);
-}
-
-/**********************************************************************//**
-  Scenario table cell setup function
-**************************************************************************/
-static void scenario_factory_setup(GtkSignalListItemFactory *self,
-                                   GtkListItem *list_item,
-                                   gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Create the scenario page.
-**************************************************************************/
-GtkWidget *create_scenario_page(void)
-{
-  GtkWidget *vgrid, *hbox, *sbox, *bbox, *filenamebox, *descbox;
-  GtkWidget *versionbox, *vertext;
-  GtkWidget *button, *label, *view, *sw, *swa, *text;
-  GtkCellRenderer *rend;
-  GtkListItemFactory *factory;
-  int grid_row = 0;
-  int filenamecol = 0;
-  int vercol = 0;
-  int descrow = 0;
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(vgrid), 18);
-  gtk_widget_set_margin_start(vgrid, 4);
-  gtk_widget_set_margin_end(vgrid, 4);
-  gtk_widget_set_margin_top(vgrid, 4);
-  gtk_widget_set_margin_bottom(vgrid, 4);
-
-  scenario_store = gtk_list_store_new(5, G_TYPE_STRING,
-                                         G_TYPE_STRING,
-                                         G_TYPE_STRING,
-                                         G_TYPE_STRING,
-                                         G_TYPE_INT);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(scenario_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(scenario_factory_setup),
-                   nullptr);
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(scenario_store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(scenario_store);
-
-  rend = gtk_cell_renderer_text_new();
-  gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-      -1, NULL, rend, "text", 0, NULL);
-
-  scenario_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  g_signal_connect(scenario_selection, "changed",
-                   G_CALLBACK(scenario_list_callback), NULL);
-  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
-
-  gtk_tree_selection_set_mode(scenario_selection, GTK_SELECTION_SINGLE);
-
-  g_signal_connect(view, "row-activated",
-                   G_CALLBACK(scenario_callback), NULL);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-    "use-underline", TRUE,
-    "mnemonic-widget", view,
-    "label", _("Choose a _Scenario:"),
-    "xalign", 0.0,
-    "yalign", 0.5,
-    NULL);
-  gtk_grid_attach(GTK_GRID(vgrid), label, 0, grid_row++, 1, 1);
-
-  sbox = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(sbox), 12);
-  gtk_grid_set_row_homogeneous(GTK_GRID(sbox), TRUE);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(sbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(sbox), 2);
-  gtk_grid_attach(GTK_GRID(vgrid), sbox, 0, grid_row++, 1, 1);
-
-  hbox = gtk_grid_new();
-  gtk_grid_set_column_homogeneous(GTK_GRID(hbox), TRUE);
-  gtk_grid_set_column_spacing(GTK_GRID(hbox), 12);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_grid_attach(GTK_GRID(sbox), sw, 0, 0, 1, 2);
-
-  text = gtk_text_view_new();
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 2);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  scenario_description = text;
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), text);
-
-  text = gtk_text_view_new();
-  gtk_widget_set_hexpand(text, TRUE);
-  gtk_widget_set_vexpand(text, TRUE);
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
-  gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 2);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
-  scenario_authors = text;
-
-  swa = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(swa), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swa), GTK_POLICY_AUTOMATIC,
-                                 GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(swa), text);
-
-  text = gtk_label_new(_("Filename:"));
-  scenario_filename = gtk_label_new("");
-  gtk_widget_set_halign(scenario_filename, GTK_ALIGN_START);
-  gtk_widget_set_valign(scenario_filename, GTK_ALIGN_CENTER);
-  gtk_label_set_selectable(GTK_LABEL(scenario_filename), TRUE);
-
-  filenamebox = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hbox), 12);
-  gtk_widget_set_margin_bottom(filenamebox, 5);
-  gtk_widget_set_margin_end(filenamebox, 5);
-  gtk_widget_set_margin_start(filenamebox, 5);
-  gtk_widget_set_margin_top(filenamebox, 5);
-
-  gtk_grid_attach(GTK_GRID(filenamebox), text, filenamecol++, 0, 1, 1);
-  gtk_grid_attach(GTK_GRID(filenamebox), scenario_filename,
-                  filenamecol++, 0, 1, 1);
-
-  /* TRANS: Scenario format version */
-  vertext = gtk_label_new(_("Format:"));
-  scenario_version = gtk_label_new("");
-  gtk_widget_set_halign(scenario_version, GTK_ALIGN_START);
-  gtk_widget_set_valign(scenario_version, GTK_ALIGN_CENTER);
-  gtk_label_set_selectable(GTK_LABEL(scenario_version), TRUE);
-
-  versionbox = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hbox), 12);
-  gtk_widget_set_margin_bottom(versionbox, 5);
-  gtk_widget_set_margin_end(versionbox, 5);
-  gtk_widget_set_margin_start(versionbox, 5);
-  gtk_widget_set_margin_top(versionbox, 5);
-
-  gtk_grid_attach(GTK_GRID(versionbox), vertext, vercol++, 0, 1, 1);
-  gtk_grid_attach(GTK_GRID(versionbox), scenario_version,
-                  vercol++, 0, 1, 1);
-
-  descbox = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(descbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(descbox), 6);
-  gtk_grid_attach(GTK_GRID(descbox), sw, 0, descrow++, 1, 1);
-  gtk_grid_attach(GTK_GRID(descbox), swa, 0, descrow++, 1, 1);
-  gtk_grid_attach(GTK_GRID(descbox), filenamebox,
-                  0, descrow++, 1, 1);
-  gtk_grid_attach(GTK_GRID(descbox), versionbox,
-                  0, descrow++, 1, 1);
-  gtk_grid_attach(GTK_GRID(sbox), descbox, 1, 0, 1, 2);
-
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_set_spacing(GTK_BOX(bbox), 12);
-  gtk_grid_attach(GTK_GRID(vgrid), bbox, 0, grid_row++, 1, 1);
-
-  button = gtk_button_new_with_mnemonic(_("_Browse..."));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-      G_CALLBACK(scenario_browse_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_Cancel"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(main_callback), NULL);
-
-  button = gtk_button_new_with_mnemonic(_("_OK"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(scenario_callback), NULL);
-
-  return vgrid;
-}
-
-/**********************************************************************//**
-  Returns current client page
-**************************************************************************/
-enum client_pages get_current_client_page(void)
-{
-  return current_page;
-}
-
-/**********************************************************************//**
-  Changes the current page. The action is delayed.
-**************************************************************************/
-void real_set_client_page(enum client_pages new_page)
-{
-  /* Don't use current_page directly here because maybe it could be modified
-   * before we reach the end of this function. */
-  enum client_pages old_page = current_page;
-
-  /* If the page remains the same, don't do anything. */
-  if (old_page == new_page) {
-    return;
-  }
-
-  log_debug("Switching client page from %s to %s.",
-            -1 == old_page ? "(no page)" : client_pages_name(old_page),
-            client_pages_name(new_page));
-
-  current_page = new_page;
-
-  switch (old_page) {
-  case PAGE_SCENARIO:
-  case PAGE_LOAD:
-    break;
-  case PAGE_GAME:
-    {
-      struct video_mode *vmode = resolution_request_get();
-
-      enable_menus(FALSE);
-      if (vmode == NULL) {
-        gtk_window_unmaximize(GTK_WINDOW(toplevel));
-      }
-    }
-    break;
-  default:
-    break;
-  }
-
-  switch (new_page) {
-  case PAGE_MAIN:
-  case PAGE_START:
-    if (is_server_running()) {
-      gtk_widget_set_visible(start_options_table, game.info.is_new_game);
-      update_start_page();
-    } else {
-      gtk_widget_set_visible(start_options_table, FALSE);
-    }
-    voteinfo_gui_update();
-    overview_size_changed();
-    conn_list_dialog_update();
-    break;
-  case PAGE_GAME:
-    {
-      struct video_mode *vmode = resolution_request_get();
-
-      reset_unit_table();
-      enable_menus(TRUE);
-      if (vmode == NULL) {
-        gtk_window_maximize(GTK_WINDOW(toplevel));
-      }
-      voteinfo_gui_update();
-      mapview_freeze();
-    }
-    break;
-  case PAGE_LOAD:
-    update_load_page();
-    break;
-  case PAGE_SCENARIO:
-    update_scenario_page();
-    break;
-  case PAGE_NETWORK:
-    update_network_page();
-    break;
-  }
-
-  /* Hide/show statusbar. */
-  if (new_page == PAGE_START || new_page == PAGE_GAME) {
-    clear_network_statusbar();
-    gtk_widget_set_visible(statusbar_frame, FALSE);
-  } else {
-    gtk_widget_set_visible(statusbar_frame, TRUE);
-  }
-
-  gtk_notebook_set_current_page(GTK_NOTEBOOK(toplevel_tabs), new_page);
-
-  /* Update the GUI. */
-  while (g_main_context_pending(NULL)) {
-    g_main_context_iteration(NULL, FALSE);
-  }
-
-  switch (new_page) {
-  case PAGE_MAIN:
-    break;
-  case PAGE_START:
-    chatline_scroll_to_bottom(FALSE);
-    inputline_grab_focus();
-    break;
-  case PAGE_LOAD:
-    gtk_tree_view_focus(gtk_tree_selection_get_tree_view(load_selection));
-    break;
-  case PAGE_SCENARIO:
-    gtk_tree_view_focus(gtk_tree_selection_get_tree_view(scenario_selection));
-    break;
-  case PAGE_GAME:
-    chatline_scroll_to_bottom(FALSE);
-    refresh_chat_buttons();
-    center_on_something();
-    mapview_thaw();
-    add_idle_callback(main_message_area_resize, NULL);
-    add_idle_callback(animation_idle_cb, NULL);
-    break;
-  case PAGE_NETWORK:
-    update_network_lists();
-    gtk_widget_grab_focus(network_login);
-    gtk_editable_set_position(GTK_EDITABLE(network_login), 0);
-    set_connection_state(connection_status);
-    break;
-  }
-}
-
-/****************************************************************************
-                            SAVE GAME DIALOGs
-****************************************************************************/
-
-/**********************************************************************//**
-  Save game 'save_dialog_files_fn_t' implementation.
-**************************************************************************/
-static struct fileinfo_list *save_dialog_savegame_list(void)
-{
-  return fileinfolist_infix(get_save_dirs(), ".sav", FALSE);
-}
-
-/**********************************************************************//**
-  Save game dialog.
-**************************************************************************/
-void save_game_dialog_popup(void)
-{
-  static GtkWidget *shell = NULL;
-
-  if (NULL != shell) {
-    return;
-  }
-
-  shell = save_dialog_new(_("Save Game"), _("Saved _Games:"),
-                          _("Save _Filename:"), send_save_game,
-                          save_dialog_savegame_list);
-  g_signal_connect(shell, "destroy", G_CALLBACK(widget_destroyed),
-                   &shell);
-  gtk_window_present(GTK_WINDOW(shell));
-}
-
-/**********************************************************************//**
-  Save scenario 'save_dialog_action_fn_t' implementation.
-**************************************************************************/
-static void save_dialog_save_scenario(const char *filename)
-{
-  dsend_packet_save_scenario(&client.conn, filename);
-}
-
-/**********************************************************************//**
-  Save scenario 'save_dialog_files_fn_t' implementation.
-**************************************************************************/
-static struct fileinfo_list *save_dialog_scenario_list(void)
-{
-  return fileinfolist_infix(get_scenario_dirs(), ".sav", FALSE);
-}
-
-/**********************************************************************//**
-  Save scenario dialog.
-**************************************************************************/
-void save_scenario_dialog_popup(void)
-{
-  static GtkWidget *shell = NULL;
-
-  if (NULL != shell) {
-    return;
-  }
-
-  shell = save_dialog_new(_("Save Scenario"), _("Saved Sce_narios:"),
-                          _("Save Sc_enario:"), save_dialog_save_scenario,
-                          save_dialog_scenario_list);
-  g_signal_connect(shell, "destroy", G_CALLBACK(widget_destroyed),
-                   &shell);
-  gtk_window_present(GTK_WINDOW(shell));
-}
-
-/**********************************************************************//**
-  Save mapimg 'save_dialog_files_fn_t' implementation. If possible, only the
-  current directory is used. As fallback, the files in the save directories
-  are listed.
-**************************************************************************/
-static struct fileinfo_list *save_dialog_mapimg_list(void)
-{
-  return fileinfolist_infix(get_save_dirs(), ".map", FALSE);
-}
-
-/**********************************************************************//**
-  Save scenario dialog.
-**************************************************************************/
-void save_mapimg_dialog_popup(void)
-{
-  static GtkWidget *shell = NULL;
-
-  if (NULL != shell) {
-    return;
-  }
-
-  shell = save_dialog_new(_("Save Map Image"), _("Saved Map _Images:"),
-                          _("Save _Map Images:"), mapimg_client_save,
-                          save_dialog_mapimg_list);
-  g_signal_connect(shell, "destroy", G_CALLBACK(widget_destroyed),
-                   &shell);
-  gtk_window_present(GTK_WINDOW(shell));
-}
-
-/**********************************************************************//**
-  Save map image. On error popup a message window for the user.
-**************************************************************************/
-void mapimg_client_save(const char *filename)
-{
-  if (!mapimg_client_createmap(filename)) {
-    char msg[512];
-
-    fc_snprintf(msg, sizeof(msg), "(%s)", mapimg_error());
-    popup_notify_dialog(_("Error"),
-                        _("Error Creating the Map Image!"), msg);
-  }
-}
-
-/**********************************************************************//**
-  Set the list of available rulesets. The default ruleset should be
-  "default", and if the user changes this then set_ruleset() should be
-  called.
-**************************************************************************/
-void set_rulesets(int num_rulesets, char **rulesets)
-{
-  int i;
-  int def_idx = -1;
-
-  gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(ruleset_combo));
-  for (i = 0; i < num_rulesets; i++) {
-
-    gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(ruleset_combo), rulesets[i]);
-    if (!strcmp("default", rulesets[i])) {
-      def_idx = i;
-    }
-  }
-
-  no_ruleset_callback = TRUE;
-
-  /* HACK: Server should tell us the current ruleset. */
-  gtk_combo_box_set_active(GTK_COMBO_BOX(ruleset_combo), def_idx);
-
-  no_ruleset_callback = FALSE;
-}
diff --git a/client/gui-gtk-5.0/pages.h b/client/gui-gtk-5.0/pages.h
deleted file mode 100644
index 1db5aef97a..0000000000
--- a/client/gui-gtk-5.0/pages.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__PAGES_H
-#define FC__PAGES_H
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "support.h"            /* bool type */
-
-/* client */
-#include "pages_g.h"
-
-extern GtkWidget *start_message_area;
-
-GtkWidget *create_main_page(void);
-GtkWidget *create_start_page(void);
-GtkWidget *create_scenario_page(void);
-GtkWidget *create_load_page(void);
-GtkWidget *create_network_page(void);
-
-GtkWidget *create_statusbar(void);
-void append_network_statusbar(const char *text, bool force);
-
-void save_game_dialog_popup(void);
-void save_scenario_dialog_popup(void);
-void save_mapimg_dialog_popup(void);
-void mapimg_client_save(const char *filename);
-
-void ai_fill_changed_by_server(int aifill);
-
-void destroy_server_scans(void);
-
-#endif /* FC__PAGES_H */
diff --git a/client/gui-gtk-5.0/plrdlg.c b/client/gui-gtk-5.0/plrdlg.c
deleted file mode 100644
index dc8e3afdd0..0000000000
--- a/client/gui-gtk-5.0/plrdlg.c
+++ /dev/null
@@ -1,1119 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "astring.h"
-#include "fcintl.h"
-#include "support.h"
-
-/* common */
-#include "diptreaty.h"
-#include "packets.h"
-#include "nation.h"
-#include "player.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "connectdlg_common.h"
-#include "tilespec.h"
-#include "colors.h"
-#include "graphics.h"
-#include "options.h"
-#include "text.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "inteldlg.h"
-#include "spaceshipdlg.h"
-#include "colors.h"
-#include "graphics.h"
-
-#include "plrdlg.h"
-
-struct gui_dialog *players_dialog_shell;
-static GtkWidget *players_list;
-static GtkTreeSelection *players_selection;
-static GSimpleAction *players_int_command;
-static GSimpleAction *players_meet_command;
-static GSimpleAction *players_war_command;
-static GSimpleAction *players_vision_command;
-static GSimpleAction *players_sship_command;
-
-static GtkListStore *players_dialog_store;
-#define PLR_DLG_COL_STYLE       (0 + num_player_dlg_columns)
-#define PLR_DLG_COL_WEIGHT      (1 + num_player_dlg_columns)
-#define PLR_DLG_COL_ID          (2 + num_player_dlg_columns)
-#define PLR_DLG_COL_TOOLTIP     (3 + num_player_dlg_columns)
-
-#define PLR_DLG_COL_TOTAL       (PLR_DLG_COL_TOOLTIP + 1)
-
-static void create_players_dialog(void);
-static void players_meet_callback(GSimpleAction *action, GVariant *parameter,
-                                  gpointer data);
-static void players_war_callback(GSimpleAction *action, GVariant *parameter,
-                                 gpointer data);
-static void players_vision_callback(GSimpleAction *action, GVariant *parameter,
-                                    gpointer data);
-static void players_intel_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data);
-static void players_intel_wonder_callback(GSimpleAction *action,
-                                          GVariant *parameter, gpointer data);
-static void players_sship_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data);
-static void players_ai_toggle_callback(GSimpleAction *action, GVariant *parameter,
-                                       gpointer data);
-static void players_ai_skill_callback(GSimpleAction *action, GVariant *parameter,
-                                      gpointer data);
-
-static void update_views(void);
-
-static GMenu *display_menu;
-
-/**********************************************************************//**
-  Popup the dialog 10% inside the main-window, and optionally raise it.
-**************************************************************************/
-void popup_players_dialog(bool raise)
-{
-  if (!players_dialog_shell) {
-    create_players_dialog();
-  }
-  gui_dialog_present(players_dialog_shell);
-  if (raise) {
-    gui_dialog_raise(players_dialog_shell);
-  }
-}
-
-/**********************************************************************//**
-  Closes the players dialog.
-**************************************************************************/
-void popdown_players_dialog(void)
-{
-  if (players_dialog_shell) {
-    gui_dialog_destroy(players_dialog_shell);
-  }
-}
-
-/**********************************************************************//**
-  Create a small colored square representing the player color, for use
-  in player lists.
-  May return NULL if the player has no color yet.
-**************************************************************************/
-GdkPixbuf *create_player_icon(const struct player *plr)
-{
-  int width = 20;
-  int height = 20;
-  GdkPixbuf *tmp;
-  cairo_surface_t *surface;
-  struct color *color;
-  cairo_t *cr;
-
-  if (!player_has_color(plr)) {
-    return NULL;
-  }
-
-  surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
-
-  cr = cairo_create(surface);
-
-  color = get_color(tileset, COLOR_PLAYER_COLOR_BACKGROUND);
-  gdk_cairo_set_source_rgba(cr, &color->color);
-  cairo_rectangle(cr, 0, 0, width, height);
-  cairo_fill(cr);
-
-  color = get_player_color(tileset, plr);
-  gdk_cairo_set_source_rgba(cr, &color->color);
-  cairo_rectangle(cr, 1, 1, width - 2, height - 2);
-  cairo_fill(cr);
-
-  cairo_destroy(cr);
-  tmp = surface_get_pixbuf(surface, width, height);
-  cairo_surface_destroy(surface);
-
-  return tmp;
-}
-
-/**********************************************************************//**
-  Refresh player menu
-**************************************************************************/
-static void update_players_menu(void)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    struct player *plr;
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-    plr = player_by_number(plrno);
-
-    if (plr->spaceship.state != SSHIP_NONE) {
-      g_simple_action_set_enabled(players_sship_command, TRUE);
-    } else {
-      g_simple_action_set_enabled(players_sship_command, FALSE);
-    }
-
-    if (NULL != client.conn.playing) {
-      /* We keep button sensitive in case of DIPL_SENATE_BLOCKING, so that player
-       * can request server side to check requirements of those effects with omniscience */
-      g_simple_action_set_enabled(players_war_command,
-                                  can_client_issue_orders()
-                                  && pplayer_can_cancel_treaty(client_player(),
-                                                               player_by_number(plrno))
-                                  != DIPL_ERROR);
-    } else {
-      g_simple_action_set_enabled(players_war_command, FALSE);
-    }
-
-    g_simple_action_set_enabled(players_vision_command,
-                                can_client_issue_orders()
-                                && gives_shared_vision(client.conn.playing, plr)
-                                && !players_on_same_team(client.conn.playing, plr));
-
-    g_simple_action_set_enabled(players_meet_command, can_meet_with_player(plr));
-    g_simple_action_set_enabled(players_int_command, can_intel_with_player(plr));
-    return;
-  }
-
-  g_simple_action_set_enabled(players_meet_command, FALSE);
-  g_simple_action_set_enabled(players_int_command, FALSE);
-}
-
-/**********************************************************************//**
-  Something selected from player menu
-**************************************************************************/
-static void selection_callback(GtkTreeSelection *selection, gpointer data)
-{
-  update_players_menu();
-}
-
-/**********************************************************************//**
-  Left button pressed on player list
-**************************************************************************/
-static gboolean left_button_press_callback(GtkGestureClick *gesture, int n_press,
-                                           double x, double y)
-{
-  GtkTreeView *view
-    = GTK_TREE_VIEW(gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture)));
-
-  if (n_press == 2) {
-    GtkTreePath *path;
-
-    gtk_tree_view_get_cursor(view, &path, NULL);
-    if (path) {
-      GtkTreeModel *model = gtk_tree_view_get_model(view);
-      GtkTreeIter it;
-      gint id;
-      struct player *plr;
-
-      gtk_tree_model_get_iter(model, &it, path);
-      gtk_tree_path_free(path);
-
-      gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &id, -1);
-      plr = player_by_number(id);
-
-      if (can_intel_with_player(plr)) {
-        popup_intel_dialog(plr);
-      }
-    }
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Right button pressed on player list
-**************************************************************************/
-static gboolean right_button_press_callback(GtkGestureClick *gesture, int n_press,
-                                            double x, double y)
-{
-  GtkTreeView *view
-    = GTK_TREE_VIEW(gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture)));
-
-  if (n_press == 2) {
-    GtkTreePath *path;
-
-    gtk_tree_view_get_cursor(view, &path, NULL);
-    if (path) {
-      GtkTreeModel *model = gtk_tree_view_get_model(view);
-      GtkTreeIter it;
-      gint id;
-      struct player *plr;
-
-      gtk_tree_model_get_iter(model, &it, path);
-      gtk_tree_path_free(path);
-
-      gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &id, -1);
-      plr = player_by_number(id);
-
-      if (can_meet_with_player(plr)) {
-        dsend_packet_diplomacy_init_meeting_req(&client.conn, id);
-      }
-    }
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Sorting function for plr dlg.
-**************************************************************************/
-static gint plrdlg_sort_func(GtkTreeModel *model,
-                             GtkTreeIter *a, GtkTreeIter *b, gpointer data)
-{
-  GValue value = { 0, };
-  struct player *player1;
-  struct player *player2;
-  gint n;
-
-  n = GPOINTER_TO_INT(data);
-
-  gtk_tree_model_get_value(model, a, PLR_DLG_COL_ID, &value);
-  player1 = player_by_number(g_value_get_int(&value));
-  g_value_unset(&value);
-
-  gtk_tree_model_get_value(model, b, PLR_DLG_COL_ID, &value);
-  player2 = player_by_number(g_value_get_int(&value));
-  g_value_unset(&value);
-
-  return player_dlg_columns[n].sort_func(player1, player2);
-}
-
-/**********************************************************************//**
-  Create a player dialog store.
-**************************************************************************/
-static GtkListStore *players_dialog_store_new(void)
-{
-  GtkListStore *store;
-  GType model_types[num_player_dlg_columns + PLR_DLG_COL_TOTAL];
-  int i;
-
-  for (i = 0; i < num_player_dlg_columns; i++) {
-    switch (player_dlg_columns[i].type) {
-    case COL_FLAG:
-      model_types[i] = GDK_TYPE_PIXBUF;
-      break;
-    case COL_COLOR:
-      model_types[i] = GDK_TYPE_PIXBUF;
-      break;
-    case COL_BOOLEAN:
-      model_types[i] = G_TYPE_BOOLEAN;
-      break;
-    case COL_TEXT:
-    case COL_RIGHT_TEXT:
-      model_types[i] = G_TYPE_STRING;
-      break;
-    }
-  }
-
-  /* Special (invisible rows) - Text style, weight and player id */
-  model_types[i++] = G_TYPE_INT;        /* PLR_DLG_COL_STYLE. */
-  model_types[i++] = G_TYPE_INT;        /* PLR_DLG_COL_WEIGHT. */
-  model_types[i++] = G_TYPE_INT;        /* PLR_DLG_COL_ID. */
-  model_types[i++] = G_TYPE_STRING;     /* PLR_DLG_COL_TOOLTIP */
-
-  store = gtk_list_store_newv(i, model_types);
-
-  /* Set sort order */
-  for (i = 0; i < num_player_dlg_columns; i++) {
-    if (player_dlg_columns[i].sort_func != NULL) {
-        gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(store), i,
-                                        plrdlg_sort_func, GINT_TO_POINTER(i),
-                                        NULL);
-    }
-  }
-
-  return store;
-}
-
-/************************************************************************//**
-  Create up-to-date menu item for the plrdlg display menu.
-  Caller need to g_object_unref() returned item.
-****************************************************************************/
-static GMenuItem *create_plrdlg_display_menu_item(int pos)
-{
-  GMenuItem *item;
-  char act_name[50];
-  struct player_dlg_column *pcol;
-
-  pcol = &player_dlg_columns[pos];
-
-  fc_snprintf(act_name, sizeof(act_name), "win.display%d(%s)",
-              pos, pcol->show ? "true" : "false");
-  item = g_menu_item_new(pcol->title, NULL);
-  g_menu_item_set_detailed_action(item, act_name);
-
-  return item;
-}
-
-/************************************************************************//**
-  Create up-to-date menu item for "Dead Players" menu entry.
-  Caller need to g_object_unref() returned item.
-****************************************************************************/
-static GMenuItem *create_dead_players_menu_item(void)
-{
-  GMenuItem *item;
-  char act_name[50];
-
-  /* TODO: Should this be gui-specific option as there's no universal
-   *       player dlg setup? */
-  fc_snprintf(act_name, sizeof(act_name), "win.show_dead(%s)",
-              gui_options.player_dlg_show_dead_players ? "true" : "false");
-  item = g_menu_item_new(Q_("?show:Dead Players"), NULL);
-  g_menu_item_set_detailed_action(item, act_name);
-
-  return item;
-}
-
-/**********************************************************************//**
-  Toggled column visibility
-**************************************************************************/
-static void toggle_view(GSimpleAction *act, GVariant *value, gpointer data)
-{
-  int idx = GPOINTER_TO_INT(data);
-  struct player_dlg_column *pcol = &player_dlg_columns[idx];
-
-  pcol->show ^= 1;
-  update_views();
-
-  /* The menu has no 'playername' in the beginning, so menu index is one smaller
-   * then column index. */
-  g_menu_remove(display_menu, idx - 1);
-
-  menu_item_insert_unref(display_menu, idx - 1, create_plrdlg_display_menu_item(idx));
-}
-
-/**********************************************************************//**
-  Called whenever player toggles the 'Show/Dead Players' menu item
-**************************************************************************/
-static void toggle_dead_players(GSimpleAction *act, GVariant *value,
-                                gpointer data)
-{
-  int idx = GPOINTER_TO_INT(data);
-
-  gui_options.player_dlg_show_dead_players ^= 1;
-  real_players_dialog_update(NULL);
-
-  /* The menu has no 'playername' in the beginning, so menu index is one smaller
-   * then column index - applies also to this even though this is not
-   * a column. */
-  g_menu_remove(display_menu, idx - 1);
-
-  menu_item_insert_unref(display_menu, idx - 1,
-                         create_dead_players_menu_item());
-}
-
-/**********************************************************************//**
-  Create and return the "diplomacy" menu for the player report. This menu
-  contains diplomacy actions the current player can use on other nations.
-**************************************************************************/
-static GMenu *create_diplomacy_menu(GActionGroup *group)
-{
-  GMenu *menu;
-  GSimpleAction *act;
-
-  menu = g_menu_new();
-
-  act = g_simple_action_new("meet", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_meet_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("_Meet"), "win.meet"));
-  players_meet_command = act;
-
-  act = g_simple_action_new("cancel_treaty", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_war_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("Cancel _Treaty"),
-                                               "win.cancel_treaty"));
-  players_war_command = act;
-
-  act = g_simple_action_new("withdraw_vision", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_vision_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("_Withdraw Vision"),
-                                               "win.withdraw_vision"));
-  players_vision_command = act;
-
-  return menu;
-}
-
-/**********************************************************************//**
-  Create and return the "intelligence" menu. The items in this menu are
-  used by the player to see more detailed information about other nations.
-**************************************************************************/
-static GMenu *create_intelligence_menu(GActionGroup *group)
-{
-  GMenu *menu;
-  GSimpleAction *act;
-
-  menu = g_menu_new();
-
-  act = g_simple_action_new("report", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_intel_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("_Report"), "win.report"));
-  players_int_command = act;
-
-  act = g_simple_action_new("wonders", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_intel_wonder_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("_Wonders"), "win.wonders"));
-
-  act = g_simple_action_new("spaceship", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate", G_CALLBACK(players_sship_callback), NULL);
-  menu_item_append_unref(menu, g_menu_item_new(_("_Spaceship"), "win.spaceship"));
-  players_sship_command = act;
-
-  return menu;
-}
-
-/**********************************************************************//**
-  Create 'show' menu for player dialog
-**************************************************************************/
-static GMenu *create_show_menu(GActionGroup *group)
-{
-  GVariantType *bvart = g_variant_type_new("b");
-  int i;
-  GSimpleAction *act;
-  GVariant *var;
-
-  display_menu = g_menu_new();
-
-  /* Index starting at one (1) here to force playername to always be shown */
-  for (i = 1; i < num_player_dlg_columns - 1; i++) {
-    char act_name[50];
-
-    var = g_variant_new("b", TRUE);
-    fc_snprintf(act_name, sizeof(act_name), "display%d", i);
-    act = g_simple_action_new_stateful(act_name, bvart, var);
-    g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-    g_signal_connect(act, "change-state", G_CALLBACK(toggle_view), GINT_TO_POINTER(i));
-
-    menu_item_insert_unref(display_menu, i, create_plrdlg_display_menu_item(i));
-  }
-
-  var = g_variant_new("b", TRUE);
-  act = g_simple_action_new_stateful("show_dead", bvart, var);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-
-  menu_item_insert_unref(display_menu, i, create_dead_players_menu_item());
-  g_signal_connect(act, "change-state", G_CALLBACK(toggle_dead_players),
-                   GINT_TO_POINTER(i));
-
-  g_variant_type_free(bvart);
-
-  return display_menu;
-}
-
-/**********************************************************************//**
-  Create and return the "AI" menu, to adjust difficulty levels
-  of players.
-**************************************************************************/
-static GMenu *create_ai_menu(GActionGroup *group)
-{
-  GMenu *menu;
-  GSimpleAction *act;
-  enum ai_level level;
-
-  menu = g_menu_new();
-
-  act = g_simple_action_new("ai_toggle", NULL);
-  g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-  g_signal_connect(act, "activate",
-                   G_CALLBACK(players_ai_toggle_callback), NULL);
-
-  menu_item_append_unref(menu, g_menu_item_new(_("_Toggle AI Mode"),
-                                               "win.ai_toggle"));
-
-  for (level = 0; level < AI_LEVEL_COUNT; level++) {
-    if (is_settable_ai_level(level)) {
-      const char *level_name = ai_level_translated_name(level);
-      char act_name[50];
-
-      fc_snprintf(act_name, sizeof(act_name), "ai_level%d", level);
-      act = g_simple_action_new(act_name, NULL);
-      g_action_map_add_action(G_ACTION_MAP(group), G_ACTION(act));
-      g_signal_connect(act, "activate",
-                       G_CALLBACK(players_ai_skill_callback),
-                       GUINT_TO_POINTER(level));
-
-      fc_snprintf(act_name, sizeof(act_name), "win.ai_level%d", level);
-      menu_item_append_unref(menu, g_menu_item_new(level_name, act_name));
-    }
-  }
-
-  return menu;
-}
-
-/**********************************************************************//**
-  Create all of player dialog
-**************************************************************************/
-void create_players_dialog(void)
-{
-  int i;
-  GtkWidget *sep, *sw;
-  GtkWidget *aux_menu;
-  GMenu *topmenu, *submenu;
-  GActionGroup *group;
-  GtkWidget *vgrid;
-  GtkEventController *left_controller;
-  GtkEventController *right_controller;
-  GtkGesture *gesture;
-  int grid_row = 0;
-
-  gui_dialog_new(&players_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL,
-                 TRUE);
-  /* TRANS: Nations report title */
-  gui_dialog_set_title(players_dialog_shell, _("Nations"));
-
-  gui_dialog_add_button(players_dialog_shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  gui_dialog_set_default_size(players_dialog_shell, -1, 270);
-
-  players_dialog_store = players_dialog_store_new();
-
-  players_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL
-                                              (players_dialog_store));
-  gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(players_list),
-                                   PLR_DLG_COL_TOOLTIP);
-  gtk_widget_set_hexpand(players_list, TRUE);
-  gtk_widget_set_vexpand(players_list, TRUE);
-  g_object_unref(players_dialog_store);
-  gtk_widget_set_name(players_list, "small_font");
-
-  players_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(players_list));
-  g_signal_connect(players_selection, "changed",
-      G_CALLBACK(selection_callback), NULL);
-  gesture = gtk_gesture_click_new();
-  left_controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(left_controller, "pressed",
-                   G_CALLBACK(left_button_press_callback), NULL);
-  gtk_widget_add_controller(players_list, left_controller);
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  right_controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(right_controller, "pressed",
-                   G_CALLBACK(right_button_press_callback), NULL);
-  gtk_widget_add_controller(players_list, right_controller);
-
-  for (i = 0; i < num_player_dlg_columns; i++) {
-    struct player_dlg_column *pcol;
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *col;
-
-    pcol = &player_dlg_columns[i];
-    col = NULL;
-
-    switch (pcol->type) {
-    case COL_FLAG:
-      renderer = gtk_cell_renderer_pixbuf_new();
-
-      col = gtk_tree_view_column_new_with_attributes(pcol->title,
-         renderer, "pixbuf", i, NULL);
-      break;
-    case COL_BOOLEAN:
-      renderer = gtk_cell_renderer_toggle_new();
-
-      col = gtk_tree_view_column_new_with_attributes(pcol->title, renderer,
-        "active", i, NULL);
-      break;
-    case COL_COLOR:
-      renderer = gtk_cell_renderer_pixbuf_new();
-
-      col = gtk_tree_view_column_new_with_attributes(pcol->title, renderer,
-             "pixbuf", i, NULL);
-      break;
-    case COL_TEXT:
-      renderer = gtk_cell_renderer_text_new();
-      g_object_set(renderer, "style-set", TRUE, "weight-set", TRUE, NULL);
-
-      col = gtk_tree_view_column_new_with_attributes(pcol->title, renderer,
-                                                     "text", i,
-                                                     "style", PLR_DLG_COL_STYLE,
-                                                     "weight", PLR_DLG_COL_WEIGHT,
-                                                     NULL);
-      gtk_tree_view_column_set_sort_column_id(col, i);
-      break;
-    case COL_RIGHT_TEXT:
-      renderer = gtk_cell_renderer_text_new();
-      g_object_set(renderer, "style-set", TRUE, "weight-set", TRUE, NULL);
-
-      col = gtk_tree_view_column_new_with_attributes(pcol->title, renderer,
-                                                     "text", i,
-                                                     "style", PLR_DLG_COL_STYLE,
-                                                     "weight", PLR_DLG_COL_WEIGHT,
-                                                     NULL);
-      gtk_tree_view_column_set_sort_column_id(col, i);
-      g_object_set(renderer, "xalign", 1.0, NULL);
-      gtk_tree_view_column_set_alignment(col, 1.0);
-      break;
-    }
-
-    if (col) {
-      gtk_tree_view_append_column(GTK_TREE_VIEW(players_list), col);
-    }
-  }
-
-  gtk_tree_view_set_search_column(GTK_TREE_VIEW(players_list),
-                                  player_dlg_default_sort_column());
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), players_list);
-
-  gui_dialog_add_content_widget(players_dialog_shell, sw);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_grid_attach(GTK_GRID(vgrid), sep, 0, grid_row++, 1, 1);
-
-  aux_menu = aux_menu_new();
-  gtk_grid_attach(GTK_GRID(vgrid), aux_menu, 0, grid_row++, 1, 1);
-
-  gui_dialog_add_action_widget(players_dialog_shell, vgrid);
-
-  group = G_ACTION_GROUP(g_simple_action_group_new());
-  topmenu = g_menu_new();
-
-  submenu = create_diplomacy_menu(group);
-  submenu_append_unref(topmenu, _("Di_plomacy"), G_MENU_MODEL(submenu));
-
-  submenu = create_intelligence_menu(group);
-  submenu_append_unref(topmenu, _("_Intelligence"), G_MENU_MODEL(submenu));
-
-  submenu = create_show_menu(group);
-  submenu_append_unref(topmenu, _("_Display"), G_MENU_MODEL(submenu));
-
-  submenu = create_ai_menu(group);
-  submenu_append_unref(topmenu, _("_AI"), G_MENU_MODEL(submenu));
-
-  gtk_widget_insert_action_group(aux_menu, "win", group);
-  gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(topmenu));
-
-  gui_dialog_show_all(players_dialog_shell);
-
-  real_players_dialog_update(NULL);
-
-  gtk_tree_view_focus(GTK_TREE_VIEW(players_list));
-}
-
-
-/**************************************************************************
-...
-**************************************************************************/
-#define MIN_DIMENSION 5
-
-/**********************************************************************//**
-  Builds the flag pixmap. May return NULL if there is not enough memory.
-  You must call g_object_unref on the returned pixbuf when it is no
-  longer needed.
-**************************************************************************/
-GdkPixbuf *get_flag(const struct nation_type *nation)
-{
-  int x0, y0, x1, y1, w, h;
-  GdkPixbuf *im;
-  struct sprite *flag;
-
-  flag = get_nation_flag_sprite(tileset, nation);
-
-  /* Calculate the bounding box ... */
-  sprite_get_bounding_box(flag, &x0, &y0, &x1, &y1);
-
-  fc_assert_ret_val(x0 != -1, NULL);
-  fc_assert_ret_val(y0 != -1, NULL);
-  fc_assert_ret_val(x1 != -1, NULL);
-  fc_assert_ret_val(y1 != -1, NULL);
-
-  w = (x1 - x0) + 1;
-  h = (y1 - y0) + 1;
-
-  /* If the flag is smaller then 5 x 5, something is wrong */
-  fc_assert_ret_val(w >= MIN_DIMENSION && h >= MIN_DIMENSION, NULL);
-
-  /* Croping */
-  im = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
-  if (im != NULL) {
-    GdkPixbuf *pixbuf = sprite_get_pixbuf(flag);
-
-    gdk_pixbuf_copy_area(pixbuf, x0, y0, w, h,
-                         im, 0, 0);
-    g_object_unref(G_OBJECT(pixbuf));
-  }
-
-  /* Finally store the scaled flag pixbuf in the static flags array */
-  return im;
-}
-
-/**********************************************************************//**
-  Fills the player list with the information for 'pplayer' at the row
-  given by 'it'.
-**************************************************************************/
-static void fill_row(GtkListStore *store, GtkTreeIter *it,
-                     const struct player *pplayer)
-{
-  struct player_dlg_column *pcol;
-  GdkPixbuf *pixbuf;
-  int style = PANGO_STYLE_NORMAL, weight = PANGO_WEIGHT_NORMAL;
-  int k;
-
-  for (k = 0; k < num_player_dlg_columns; k++) {
-    pcol = &player_dlg_columns[k];
-    switch (pcol->type) {
-    case COL_TEXT:
-    case COL_RIGHT_TEXT:
-      gtk_list_store_set(store, it, k, pcol->func(pplayer), -1);
-      break;
-    case COL_FLAG:
-      pixbuf = get_flag(nation_of_player(pplayer));
-      if (pixbuf != NULL) {
-        gtk_list_store_set(store, it, k, pixbuf, -1);
-        g_object_unref(pixbuf);
-      }
-      break;
-    case COL_COLOR:
-      pixbuf = create_player_icon(pplayer);
-      if (pixbuf != NULL) {
-        gtk_list_store_set(store, it, k, pixbuf, -1);
-        g_object_unref(pixbuf);
-      }
-      break;
-    case COL_BOOLEAN:
-      gtk_list_store_set(store, it, k, pcol->bool_func(pplayer), -1);
-      break;
-    }
-  }
-
-  gtk_list_store_set(store, it, PLR_DLG_COL_TOOLTIP,
-                     score_tooltip(pplayer, pplayer->score.game), -1);
-
-   /* Now add some eye candy ... */
-  if (client_has_player()) {
-    switch (player_diplstate_get(client_player(), pplayer)->type) {
-    case DS_WAR:
-      weight = PANGO_WEIGHT_NORMAL;
-      style = PANGO_STYLE_ITALIC;
-      break;
-    case DS_ALLIANCE:
-    case DS_TEAM:
-      weight = PANGO_WEIGHT_BOLD;
-      style = PANGO_STYLE_NORMAL;
-      break;
-    case DS_ARMISTICE:
-    case DS_CEASEFIRE:
-    case DS_PEACE:
-    case DS_NO_CONTACT:
-      weight = PANGO_WEIGHT_NORMAL;
-      style = PANGO_STYLE_NORMAL;
-      break;
-    case DS_LAST:
-      break;
-    }
-  }
-
-  gtk_list_store_set(store, it,
-                     PLR_DLG_COL_STYLE, style,
-                     PLR_DLG_COL_WEIGHT, weight,
-                     PLR_DLG_COL_ID, player_number(pplayer),
-                     -1);
-}
-
-/**********************************************************************//**
-  Return TRUE if the player should be shown in the player list.
-**************************************************************************/
-static bool player_should_be_shown(const struct player *pplayer)
-{
-  return NULL != pplayer && (gui_options.player_dlg_show_dead_players
-                             || pplayer->is_alive)
-         && (!is_barbarian(pplayer));
-}
-
-/**********************************************************************//**
-  Clear and refill the entire player list.
-**************************************************************************/
-void real_players_dialog_update(void *unused)
-{
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  int selected;
-
-  if (NULL == players_dialog_shell) {
-    return;
-  }
-
-  /* Save the selection. */
-  if (gtk_tree_selection_get_selected(players_selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter, PLR_DLG_COL_ID, &selected, -1);
-  } else {
-    selected = -1;
-  }
-
-  gtk_list_store_clear(players_dialog_store);
-  players_iterate(pplayer) {
-    if (!player_should_be_shown(pplayer)) {
-      continue;
-    }
-    gtk_list_store_append(players_dialog_store, &iter);
-    fill_row(players_dialog_store, &iter, pplayer);
-    if (player_number(pplayer) == selected) {
-      /* Restore the selection. */
-      gtk_tree_selection_select_iter(players_selection, &iter);
-    }
-  } players_iterate_end;
-
-  update_views();
-}
-
-/**********************************************************************//**
-  Callback for diplomatic meetings button. This button is enabled iff
-  we can meet with the other player.
-**************************************************************************/
-void players_meet_callback(GSimpleAction *action, GVariant *parameter,
-                           gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-
-    dsend_packet_diplomacy_init_meeting_req(&client.conn, plrno);
-  }
-}
-
-/**********************************************************************//**
-  Confirm pact/treaty cancellation.
-  Frees strings passed in.
-**************************************************************************/
-static void confirm_cancel_pact(enum clause_type clause, int plrno,
-                                char *title, char *question)
-{
-  GtkWidget *shell;
-
-  shell = gtk_message_dialog_new(NULL, 0,
-                                 GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-                                 "%s", question);
-  gtk_window_set_title(GTK_WINDOW(shell), title);
-  setup_dialog(shell, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(shell), GTK_RESPONSE_NO);
-
-  if (blocking_dialog(shell) == GTK_RESPONSE_YES) {
-    dsend_packet_diplomacy_cancel_pact(&client.conn, plrno, clause);
-  }
-  gtk_window_destroy(GTK_WINDOW(shell));
-  FC_FREE(title);
-  FC_FREE(question);
-}
-
-/**********************************************************************//**
-  Pact cancellation requested
-**************************************************************************/
-void players_war_callback(GSimpleAction *action, GVariant *parameter,
-                          gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    struct astring title = ASTRING_INIT, question = ASTRING_INIT;
-    gint plrno;
-    struct player *aplayer;
-    enum diplstate_type oldstate, newstate;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-    aplayer = player_by_number(plrno);
-    fc_assert_ret(aplayer != NULL);
-
-    oldstate = player_diplstate_get(client_player(), aplayer)->type;
-    newstate = cancel_pact_result(oldstate);
-
-    /* TRANS: %s is a diplomatic state: "Cancel Cease-fire" */
-    astr_set(&title, _("Cancel %s"), diplstate_type_translated_name(oldstate));
-
-    if (newstate == DS_WAR) {
-      astr_set(&question, _("Really declare war on the %s?"),
-               nation_plural_for_player(aplayer));
-    } else {
-      /* TRANS: "Cancel Belgian Alliance? ... will be Armistice." */
-      astr_set(&question, _("Cancel %s %s? New diplomatic state will be %s."),
-               nation_adjective_for_player(aplayer),
-               diplstate_type_translated_name(oldstate),
-               diplstate_type_translated_name(newstate));
-    }
-
-    /* Can be any pact clause */
-    confirm_cancel_pact(CLAUSE_CEASEFIRE, plrno,
-                        astr_to_str(&title), astr_to_str(&question));
-  }
-}
-
-/**********************************************************************//**
-  Withdrawing shared vision
-**************************************************************************/
-void players_vision_callback(GSimpleAction *action, GVariant *parameter,
-                             gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    struct astring question = ASTRING_INIT;
-    gint plrno;
-    struct player *aplayer;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-    aplayer = player_by_number(plrno);
-    fc_assert_ret(aplayer != NULL);
-
-    /* TRANS: "...from the Belgians?" */
-    astr_set(&question, _("Withdraw shared vision from the %s?"),
-             nation_plural_for_player(aplayer));
-
-    confirm_cancel_pact(CLAUSE_VISION, plrno,
-                        fc_strdup(_("Withdraw Shared Vision")),
-                        astr_to_str(&question));
-  }
-}
-
-/**********************************************************************//**
-  Intelligence report query
-**************************************************************************/
-void players_intel_callback(GSimpleAction *action, GVariant *parameter,
-                            gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-
-    if (can_intel_with_player(player_by_number(plrno))) {
-      popup_intel_dialog(player_by_number(plrno));
-    }
-  }
-}
-
-/**********************************************************************//**
-  Wonders list report query
-**************************************************************************/
-void players_intel_wonder_callback(GSimpleAction *action, GVariant *parameter,
-                                   gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-
-    popup_intel_wonder_dialog(player_by_number(plrno));
-  }
-}
-
-/**********************************************************************//**
-  Spaceship query callback
-**************************************************************************/
-void players_sship_callback(GSimpleAction *action, GVariant *parameter,
-                            gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-    popup_spaceship_dialog(player_by_number(plrno));
-  }
-}
-
-/**********************************************************************//**
-  AI toggle callback.
-**************************************************************************/
-static void players_ai_toggle_callback(GSimpleAction *action,
-                                       GVariant *parameter,
-                                       gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-
-    send_chat_printf("/aitoggle \"%s\"", player_name(player_by_number(plrno)));
-  }
-}
-
-/**********************************************************************//**
-  AI skill level setting callback.
-**************************************************************************/
-static void players_ai_skill_callback(GSimpleAction *action,
-                                      GVariant *parameter,
-                                      gpointer data)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  if (gtk_tree_selection_get_selected(players_selection, &model, &it)) {
-    gint plrno;
-
-    gtk_tree_model_get(model, &it, PLR_DLG_COL_ID, &plrno, -1);
-
-    send_chat_printf("/%s %s",
-                     ai_level_cmd(GPOINTER_TO_UINT(data)),
-                     player_name(player_by_number(plrno)));
-  }
-}
-
-/**********************************************************************//**
-  Refresh players dialog views.
-**************************************************************************/
-static void update_views(void)
-{
-  int i;
-
-  for (i = 0; i < num_player_dlg_columns; i++) {
-    GtkTreeViewColumn *col;
-
-    col = gtk_tree_view_get_column(GTK_TREE_VIEW(players_list), i);
-    gtk_tree_view_column_set_visible(col, player_dlg_columns[i].show);
-  }
-}
diff --git a/client/gui-gtk-5.0/plrdlg.h b/client/gui-gtk-5.0/plrdlg.h
deleted file mode 100644
index a626bc3359..0000000000
--- a/client/gui-gtk-5.0/plrdlg.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__PLRDLG_H
-#define FC__PLRDLG_H
-
-/* client */
-#include "plrdlg_g.h"
-
-void popdown_players_dialog(void);
-
-/* Misc helper functions */
-GdkPixbuf *get_flag(const struct nation_type *pnation);
-GdkPixbuf *create_player_icon(const struct player *plr);
-
-extern struct gui_dialog *players_dialog_shell;
-
-#endif /* FC__PLRDLG_H */
diff --git a/client/gui-gtk-5.0/rallypointdlg.c b/client/gui-gtk-5.0/rallypointdlg.c
deleted file mode 100644
index c2f41bc29a..0000000000
--- a/client/gui-gtk-5.0/rallypointdlg.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "city.h"
-#include "game.h"
-#include "tile.h"
-
-/* client */
-#include "client_main.h"
-#include "goto.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "rallypointdlg.h"
-
-bool rally_dialog = FALSE;
-static GtkWidget *instruction_label = NULL;
-static GtkWidget *persistent;
-
-static int rally_city_id = -1;
-
-/************************************************************************//**
-  Is rally point dialog currently open?
-****************************************************************************/
-static bool rally_dialog_open(void)
-{
-  return rally_dialog;
-}
-
-/************************************************************************//**
-  Handle rally point dialog closing.
-****************************************************************************/
-static void rally_response_callback(GtkWidget *dlg, gint arg)
-{
-  rally_dialog = FALSE;
-  instruction_label = NULL;
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/************************************************************************//**
-  Open rally point placement dialog
-****************************************************************************/
-void rally_dialog_popup(void)
-{
-  GtkWidget *dlg;
-  GtkWidget *main_box;
-  GtkWidget *sep;
-
-  if (rally_dialog_open()) {
-    /* One rally point dialog already open. */
-    return;
-  }
-
-  dlg = gtk_dialog_new_with_buttons(_("Place Rally Point"), NULL, 0,
-                                    _("Close"), GTK_RESPONSE_NO,
-                                    NULL);
-
-  setup_dialog(dlg, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_NO);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dlg), TRUE);
-
-  main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-
-  instruction_label = gtk_label_new(_("First click a city."));
-  gtk_box_append(GTK_BOX(main_box), instruction_label);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_append(GTK_BOX(main_box), sep);
-
-  persistent = gtk_check_button_new_with_label(_("Persistent rallypoint"));
-  gtk_box_append(GTK_BOX(main_box), persistent);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_append(GTK_BOX(main_box), sep);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dlg))),
-                 main_box);
-
-  g_signal_connect(dlg, "destroy", G_CALLBACK(rally_response_callback),
-                   nullptr);
-  g_signal_connect(dlg, "response", G_CALLBACK(rally_response_callback),
-                   nullptr);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(dlg)),
-                         TRUE);
-  gtk_widget_set_visible(dlg, TRUE);
-
-  rally_dialog = TRUE;
-}
-
-/************************************************************************//**
-  Which rally point placement phace we are at the moment.
-****************************************************************************/
-enum rally_phase rally_placement_phase(void)
-{
-  if (!rally_dialog) {
-    return RALLY_NONE;
-  }
-
-  if (rally_city_id > 0) {
-    return RALLY_TILE;
-  }
-
-  return RALLY_CITY;
-}
-
-/************************************************************************//**
-  Set city or tile for the infra placement.
-  Returns whether the click was considered to be one for rally dialog.
-****************************************************************************/
-bool rally_set_tile(struct tile *ptile)
-{
-  struct city *pcity = NULL;
-  enum rally_phase phase = rally_placement_phase();
-
-  if (phase == RALLY_NONE) {
-    return FALSE;
-  }
-
-  if (ptile == NULL) {
-    return TRUE;
-  }
-
-  if (rally_city_id > 0) {
-    pcity = game_city_by_number(rally_city_id);
-
-    if (pcity == NULL || city_owner(pcity) != client_player()) {
-      /* City destroyed or captured while we've
-       * been setting the rally point? */
-      rally_city_id = -1;
-      phase = RALLY_CITY;
-
-      gtk_label_set_text(GTK_LABEL(instruction_label),
-                         _("Select another city."));
-    }
-  }
-
-  if (phase == RALLY_CITY) {
-    char buffer[100];
-
-    pcity = tile_city(ptile);
-
-    if (pcity == NULL || city_owner(pcity) != client_player()) {
-      return TRUE;
-    }
-
-    rally_city_id = pcity->id;
-
-    fc_snprintf(buffer, sizeof(buffer), _("Now select rally point for %s"),
-                city_name_get(pcity));
-    gtk_label_set_text(GTK_LABEL(instruction_label), buffer);
-  } else {
-    char buffer[100];
-    bool psist = gtk_check_button_get_active(GTK_CHECK_BUTTON(persistent));
-
-    fc_assert(pcity != NULL);
-
-    rally_city_id = -1;
-
-    if (send_rally_tile(pcity, ptile, psist)) {
-      fc_snprintf(buffer, sizeof(buffer),
-                  _("%s rally point set. Select another city."),
-                  city_name_get(pcity));
-    } else {
-      fc_snprintf(buffer, sizeof(buffer),
-                  _("%s rally point setting failed. Select next city."),
-                  city_name_get(pcity));
-    }
-
-    gtk_label_set_text(GTK_LABEL(instruction_label), buffer);
-  }
-
-  return TRUE;
-}
diff --git a/client/gui-gtk-5.0/rallypointdlg.h b/client/gui-gtk-5.0/rallypointdlg.h
deleted file mode 100644
index 73ab6fe7ce..0000000000
--- a/client/gui-gtk-5.0/rallypointdlg.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__RALLYPOINTDLG_H
-#define FC__RALLYPOINTDLG_H
-
-enum rally_phase { RALLY_NONE, RALLY_CITY, RALLY_TILE };
-
-void rally_dialog_popup(void);
-enum rally_phase rally_placement_phase(void);
-bool rally_set_tile(struct tile *ptile);
-
-#endif  /* FC__RALLYPOINTDLG_H */
diff --git a/client/gui-gtk-5.0/ratesdlg.h b/client/gui-gtk-5.0/ratesdlg.h
deleted file mode 100644
index fd0d5e87a2..0000000000
--- a/client/gui-gtk-5.0/ratesdlg.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2003 - The Freeciv Project
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__RATESDLG_H
-#define FC__RATESDLG_H
-
-/* client */
-#include "ratesdlg_g.h"
-
-/* nothing to add */
-
-#endif  /* FC__RATESDLG_H */
diff --git a/client/gui-gtk-5.0/repodlgs.c b/client/gui-gtk-5.0/repodlgs.c
deleted file mode 100644
index 1efd8e7e24..0000000000
--- a/client/gui-gtk-5.0/repodlgs.c
+++ /dev/null
@@ -1,2017 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "fc_types.h" /* LINE_BREAK */
-#include "game.h"
-#include "government.h"
-#include "packets.h"
-#include "research.h"
-#include "tech.h"
-#include "unitlist.h"
-
-/* client */
-#include "chatline_common.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "control.h"
-#include "mapview_common.h"
-#include "options.h"
-#include "packhand_gen.h"
-#include "control.h"
-#include "reqtree.h"
-#include "text.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "cityrep.h"
-#include "dialogs.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "helpdlg.h"
-#include "plrdlg.h"
-#include "sprite.h"
-
-#include "repodlgs.h"
-
-
-/****************************************************************************
-                         RESEARCH REPORT DIALOG
-****************************************************************************/
-struct science_report {
-  struct gui_dialog *shell;
-  GtkComboBox *reachable_techs;
-  GtkComboBox *reachable_goals;
-  GtkWidget *button_show_all;
-  GtkLabel *main_label;         /* Gets science_dialog_text(). */
-  GtkProgressBar *progress_bar;
-  GtkLabel *goal_label;
-  GtkDrawingArea *drawing_area;
-};
-
-static GtkListStore *science_report_store_new(void);
-static inline void science_report_store_set(GtkListStore *store,
-                                            GtkTreeIter *iter,
-                                            Tech_type_id tech);
-static bool science_report_combo_get_active(GtkComboBox *combo,
-                                            Tech_type_id *tech,
-                                            char **name);
-static void science_report_combo_set_active(GtkComboBox *combo,
-                                            Tech_type_id tech);
-static gboolean science_diagram_left_button_up(GtkGestureClick *gesture,
-                                               int n_press,
-                                               double x, double y);
-static gboolean science_diagram_right_button_up(GtkGestureClick *gesture,
-                                                int n_press,
-                                                double x, double y);
-
-static void science_diagram_update(GtkDrawingArea *widget, cairo_t *cr,
-                                   int width, int height, gpointer data);
-static GtkWidget *science_diagram_new(void);
-static void science_diagram_data(GtkWidget *widget, bool show_all);
-static void science_diagram_center(GtkWidget *diagram, Tech_type_id tech);
-static void science_report_redraw(struct science_report *preport);
-static gint cmp_func(gconstpointer a_p, gconstpointer b_p);
-static void science_report_update(struct science_report *preport);
-static void science_report_current_callback(GtkComboBox *combo,
-                                            gpointer data);
-static void science_report_show_all_callback(GtkComboBox *combo,
-                                             gpointer data);
-static void science_report_goal_callback(GtkComboBox *combo, gpointer data);
-static void science_report_init(struct science_report *preport);
-static void science_report_free(struct science_report *preport);
-
-static struct science_report science_report = { NULL, };
-static bool science_report_no_combo_callback = FALSE;
-
-/* Those values must match the function science_report_store_new(). */
-enum science_report_columns {
-  SRD_COL_NAME,
-  SRD_COL_STEPS,
-
-  /* Not visible. */
-  SRD_COL_ID,           /* Tech_type_id */
-
-  SRD_COL_NUM
-};
-
-/************************************************************************//**
-  Create a science report list store.
-****************************************************************************/
-static GtkListStore *science_report_store_new(void)
-{
-  return gtk_list_store_new(SRD_COL_NUM,
-                            G_TYPE_STRING,      /* SRD_COL_NAME */
-                            G_TYPE_INT,         /* SRD_COL_STEPS */
-                            G_TYPE_INT);        /* SRD_COL_ID */
-}
-
-/************************************************************************//**
-  Append a technology to the list store.
-****************************************************************************/
-static inline void science_report_store_set(GtkListStore *store,
-                                            GtkTreeIter *iter,
-                                            Tech_type_id tech)
-{
-  const struct research *presearch = research_get(client_player());
-
-  gtk_list_store_set(store, iter,
-                     SRD_COL_NAME,
-                     research_advance_name_translation(presearch, tech),
-                     SRD_COL_STEPS,
-                     research_goal_unknown_techs(presearch, tech),
-                     SRD_COL_ID, tech,
-                     -1);
-}
-
-/************************************************************************//**
-  Get the active tech of the combo.
-****************************************************************************/
-static bool science_report_combo_get_active(GtkComboBox *combo,
-                                            Tech_type_id *tech,
-                                            char **name)
-{
-  GtkTreeIter iter;
-
-  if (science_report_no_combo_callback
-      || !gtk_combo_box_get_active_iter(combo, &iter)) {
-    return FALSE;
-  }
-
-  gtk_tree_model_get(gtk_combo_box_get_model(combo), &iter,
-                     SRD_COL_NAME, name,
-                     SRD_COL_ID, tech,
-                     -1);
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Set the active tech of the combo.
-****************************************************************************/
-static void science_report_combo_set_active(GtkComboBox *combo,
-                                            Tech_type_id tech)
-{
-  ITree iter;
-  Tech_type_id iter_tech;
-
-  for (itree_begin(gtk_combo_box_get_model(combo), &iter);
-       !itree_end(&iter); itree_next(&iter)) {
-    itree_get(&iter, SRD_COL_ID, &iter_tech, -1);
-    if (iter_tech == tech) {
-      science_report_no_combo_callback = TRUE;
-      gtk_combo_box_set_active_iter(combo, &iter.it);
-      science_report_no_combo_callback = FALSE;
-      return;
-    }
-  }
-  log_error("%s(): Tech %d not found in the combo.", __FUNCTION__, tech);
-}
-
-/************************************************************************//**
-  Change tech goal or research.
-****************************************************************************/
-static gboolean science_diagram_left_button_up(GtkGestureClick *gesture,
-                                               int n_press,
-                                               double x, double y)
-{
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkWidget *w = gtk_event_controller_get_widget(controller);
-  struct reqtree *reqtree = g_object_get_data(G_OBJECT(w), "reqtree");
-  Tech_type_id tech;
-
-  tech = get_tech_on_reqtree(reqtree, x, y);
-
-  if (tech == A_NONE) {
-    return TRUE;
-  }
-
-  if (can_client_issue_orders()) {
-    /* Set research or research goal */
-    switch (research_invention_state(research_get(client_player()),
-                                     tech)) {
-    case TECH_PREREQS_KNOWN:
-      dsend_packet_player_research(&client.conn, tech);
-      break;
-    case TECH_UNKNOWN:
-      dsend_packet_player_tech_goal(&client.conn, tech);
-      break;
-    case TECH_KNOWN:
-      break;
-    }
-  }
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Open tech help dialog.
-****************************************************************************/
-static gboolean science_diagram_right_button_up(GtkGestureClick *gesture,
-                                                int n_press,
-                                                double x, double y)
-{
-  const struct research *presearch;
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkWidget *w = gtk_event_controller_get_widget(controller);
-  struct reqtree *reqtree = g_object_get_data(G_OBJECT(w), "reqtree");
-  Tech_type_id tech;
-
-  tech = get_tech_on_reqtree(reqtree, x, y);
-
-  if (tech == A_NONE) {
-    return TRUE;
-  }
-
-  presearch = research_get(client_player());
-
-  /* Open help */
-  popup_help_dialog_typed(research_advance_name_translation(presearch,
-                                                            tech),
-                          HELP_TECH);
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Draw the invalidated portion of the reqtree.
-****************************************************************************/
-static void science_diagram_update(GtkDrawingArea *widget, cairo_t *cr,
-                                   int width, int height, gpointer data)
-{
-  /* FIXME: This currently redraws everything! */
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  struct reqtree *reqtree = g_object_get_data(G_OBJECT(widget), "reqtree");
-  int rtwidth, rtheight;
-  GtkAdjustment *hadjustment;
-  GtkAdjustment *vadjustment;
-  gint hadjustment_value;
-  gint vadjustment_value;
-  GtkViewport *vp;
-
-  if (!tileset_is_fully_loaded()) {
-    return;
-  }
-
-  get_reqtree_dimensions(reqtree, &rtwidth, &rtheight);
-  gtk_widget_set_size_request(GTK_WIDGET(widget), rtwidth, rtheight);
-
-  vp = GTK_VIEWPORT(gtk_widget_get_parent(GTK_WIDGET(widget)));
-  hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(vp));
-  vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vp));
-
-  hadjustment_value = (gint)gtk_adjustment_get_value(hadjustment);
-  vadjustment_value = (gint)gtk_adjustment_get_value(vadjustment);
-
-  cairo_translate(cr, -hadjustment_value, -vadjustment_value);
-
-  canvas.drawable = cr;
-
-  draw_reqtree(reqtree, &canvas, 0, 0, 0, 0, rtwidth, rtheight);
-}
-
-/************************************************************************//**
-  Return the drawing area widget of new technology diagram. Set in 'x' the
-  position of the current tech to center to it.
-****************************************************************************/
-static GtkWidget *science_diagram_new(void)
-{
-  GtkWidget *diagram;
-  GtkEventController *controller;
-  GtkGesture *gesture;
-
-  diagram = gtk_drawing_area_new();
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(diagram),
-                                 science_diagram_update, NULL, NULL);
-
-  controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
-  g_signal_connect(controller, "released",
-                   G_CALLBACK(science_diagram_left_button_up), NULL);
-  gtk_widget_add_controller(diagram, controller);
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "released",
-                   G_CALLBACK(science_diagram_right_button_up), NULL);
-  gtk_widget_add_controller(diagram, controller);
-
-  return diagram;
-}
-
-/************************************************************************//**
-  Recreate the req tree.
-****************************************************************************/
-static void science_diagram_data(GtkWidget *widget, bool show_all)
-{
-  struct reqtree *reqtree;
-
-  if (can_conn_edit(&client.conn)) {
-    /* Show all techs in editor mode, not only currently reachable ones */
-    reqtree = create_reqtree(NULL, TRUE);
-  } else {
-    /* Show only at some point reachable techs */
-    reqtree = create_reqtree(client_player(), show_all);
-  }
-
-  g_object_set_data_full(G_OBJECT(widget), "reqtree", reqtree,
-                         (GDestroyNotify) destroy_reqtree);
-}
-
-/************************************************************************//**
-  Set the diagram parent to point to 'tech' location.
-****************************************************************************/
-static void science_diagram_center(GtkWidget *diagram, Tech_type_id tech)
-{
-  GtkViewport *vp = GTK_VIEWPORT(gtk_widget_get_parent(diagram));
-  struct reqtree *reqtree;
-  int x, y, width, height;
-
-  reqtree = g_object_get_data(G_OBJECT(diagram), "reqtree");
-  get_reqtree_dimensions(reqtree, &width, &height);
-  if (find_tech_on_reqtree(reqtree, tech, &x, &y, NULL, NULL)) {
-    GtkAdjustment *adjust = NULL;
-    gdouble value;
-
-    adjust = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(vp));
-    value = (gtk_adjustment_get_lower(adjust)
-      + gtk_adjustment_get_upper(adjust)
-      - gtk_adjustment_get_page_size(adjust)) / width * x;
-    gtk_adjustment_set_value(adjust, value);
-
-    adjust = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vp));
-    value = (gtk_adjustment_get_lower(adjust)
-      + gtk_adjustment_get_upper(adjust)
-      - gtk_adjustment_get_page_size(adjust)) / height * y;
-    gtk_adjustment_set_value(adjust, value);
-  }
-}
-
-/************************************************************************//**
-  Resize and redraw the requirement tree.
-****************************************************************************/
-static void science_report_redraw(struct science_report *preport)
-{
-  Tech_type_id researching;
-
-  fc_assert_ret(NULL != preport);
-
-  science_diagram_data(GTK_WIDGET(preport->drawing_area),
-                       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
-                         preport->button_show_all)));
-
-  if (client_has_player()) {
-    researching = research_get(client_player())->researching;
-  } else {
-    researching = A_UNSET;
-  }
-  science_diagram_center(GTK_WIDGET(preport->drawing_area), researching);
-
-  gtk_widget_queue_draw(GTK_WIDGET(preport->drawing_area));
-}
-
-/************************************************************************//**
-  Utility for g_list_sort.
-****************************************************************************/
-static gint cmp_func(gconstpointer a_p, gconstpointer b_p)
-{
-  const gchar *a_str, *b_str;
-  gint a = GPOINTER_TO_INT(a_p), b = GPOINTER_TO_INT(b_p);
-  const struct research *presearch = research_get(client_player());
-
-  a_str = research_advance_name_translation(presearch, a);
-  b_str = research_advance_name_translation(presearch, b);
-
-  return fc_strcoll(a_str, b_str);
-}
-
-/************************************************************************//**
-  Update a science report dialog.
-****************************************************************************/
-static void science_report_update(struct science_report *preport)
-{
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GList *sorting_list, *item;
-  struct research *presearch = research_get(client_player());
-  const char *text;
-  double pct;
-  Tech_type_id tech;
-  Tech_type_id ac = advance_count();
-
-  fc_assert_ret(NULL != preport);
-  fc_assert_ret(NULL != presearch);
-
-  /* Disable callbacks. */
-  science_report_no_combo_callback = TRUE;
-
-  gtk_widget_queue_draw(GTK_WIDGET(preport->drawing_area));
-
-  gtk_label_set_text(preport->main_label, science_dialog_text());
-
-  /* Update the progress bar. */
-  text = get_science_target_text(&pct);
-  gtk_progress_bar_set_text(preport->progress_bar, text);
-  gtk_progress_bar_set_fraction(preport->progress_bar, pct);
-  /* Work around GTK refresh bug? */
-  gtk_widget_queue_resize(GTK_WIDGET(preport->progress_bar));
-
-  /* Update reachable techs. */
-  store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->reachable_techs));
-  gtk_list_store_clear(store);
-  sorting_list = NULL;
-
-  /* Collect all techs which are reachable in the next step. */
-  advance_index_iterate_max(A_FIRST, i, ac) {
-    if (TECH_PREREQS_KNOWN == presearch->inventions[i].state) {
-      sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
-    }
-  } advance_index_iterate_max_end;
-
-  if (sorting_list != NULL) {
-    if (A_UNSET == presearch->researching
-        || is_future_tech(presearch->researching)) {
-      gtk_list_store_append(store, &iter);
-      science_report_store_set(store, &iter, presearch->researching);
-      gtk_combo_box_set_active_iter(preport->reachable_techs, &iter);
-    }
-
-    /* Sort the list, append it to the store. */
-    sorting_list = g_list_sort(sorting_list, cmp_func);
-    for (item = sorting_list; NULL != item; item = g_list_next(item)) {
-      tech = GPOINTER_TO_INT(item->data);
-      gtk_list_store_append(store, &iter);
-      science_report_store_set(store, &iter, tech);
-      if (tech == presearch->researching) {
-        gtk_combo_box_set_active_iter(preport->reachable_techs, &iter);
-      }
-    }
-
-    /* Free, re-init. */
-    g_list_free(sorting_list);
-    sorting_list = NULL;
-  } else {
-    /* No reachable normal techs. Can we select Future Tech? */
-    Tech_type_id next;
-
-    gtk_list_store_append(store, &iter);
-    if (research_future_next(presearch)) {
-      next = A_FUTURE;
-    } else {
-      next = presearch->researching;
-    }
-    science_report_store_set(store, &iter, next);
-
-    gtk_combo_box_set_active_iter(preport->reachable_techs, &iter);
-  }
-
-  store = GTK_LIST_STORE(gtk_combo_box_get_model(preport->reachable_goals));
-  gtk_list_store_clear(store);
-
-  /* Update the tech goal. */
-  gtk_label_set_text(preport->goal_label,
-                     get_science_goal_text(presearch->tech_goal));
-
-  /* Collect all techs which are reachable in next 10 steps. */
-  advance_index_iterate_max(A_FIRST, i, ac) {
-    if (research_invention_reachable(presearch, i)
-        && TECH_KNOWN != presearch->inventions[i].state
-        && (i == presearch->tech_goal
-            || 10 >= presearch->inventions[i].num_required_techs)) {
-      sorting_list = g_list_prepend(sorting_list, GINT_TO_POINTER(i));
-    }
-  } advance_index_iterate_max_end;
-
-  if (sorting_list != NULL) {
-    if (A_UNSET == presearch->tech_goal) {
-      gtk_list_store_append(store, &iter);
-      science_report_store_set(store, &iter, A_UNSET);
-      gtk_combo_box_set_active_iter(preport->reachable_goals, &iter);
-    }
-
-    /* Sort the list, append it to the store. */
-    sorting_list = g_list_sort(sorting_list, cmp_func);
-    for (item = sorting_list; NULL != item; item = g_list_next(item)) {
-      tech = GPOINTER_TO_INT(item->data);
-      gtk_list_store_append(store, &iter);
-      science_report_store_set(store, &iter, tech);
-      if (tech == presearch->tech_goal) {
-        gtk_combo_box_set_active_iter(preport->reachable_goals, &iter);
-      }
-    }
-
-    /* Free. */
-    g_list_free(sorting_list);
-  } else {
-    /* No reachable normal techs. Can we select Future Tech? */
-    Tech_type_id goal;
-
-    gtk_list_store_append(store, &iter);
-
-    if (research_future_next(presearch)) {
-      goal = A_FUTURE;
-    } else {
-      goal = A_UNSET;
-    }
-
-    science_report_store_set(store, &iter, goal);
-    gtk_combo_box_set_active_iter(preport->reachable_goals, &iter);
-  }
-
-  /* Re-enable callbacks. */
-  science_report_no_combo_callback = FALSE;
-}
-
-/************************************************************************//**
-  Activated item in the reachable techs combo box.
-****************************************************************************/
-static void science_report_current_callback(GtkComboBox *combo,
-                                            gpointer data)
-{
-  Tech_type_id tech;
-  char *tech_name;
-
-  if (!science_report_combo_get_active(combo, &tech, &tech_name)) {
-    return;
-  }
-
-  if (gtk_check_button_get_active(GTK_CHECK_BUTTON(data))) {
-    popup_help_dialog_typed(tech_name, HELP_TECH);
-  } else if (can_client_issue_orders()) {
-    dsend_packet_player_research(&client.conn, tech);
-  }
-
-  free(tech_name);
-  /* Revert, or we will not be in sync with the server. */
-  science_report_combo_set_active(combo, research_get
-                                  (client_player())->researching);
-}
-
-/************************************************************************//**
-  Show or hide unreachable techs.
-****************************************************************************/
-static void science_report_show_all_callback(GtkComboBox *combo,
-                                             gpointer data)
-{
-  struct science_report *preport = (struct science_report *) data;
-
-  science_report_redraw(preport);
-}
-
-/************************************************************************//**
-  Activated item in the reachable goals combo box.
-****************************************************************************/
-static void science_report_goal_callback(GtkComboBox *combo, gpointer data)
-{
-  Tech_type_id tech;
-  char *tech_name;
-
-  if (!science_report_combo_get_active(combo, &tech, &tech_name)) {
-    return;
-  }
-
-  if (gtk_check_button_get_active(GTK_CHECK_BUTTON(data))) {
-    popup_help_dialog_typed(tech_name, HELP_TECH);
-  } else if (can_client_issue_orders()) {
-    dsend_packet_player_tech_goal(&client.conn, tech);
-  }
-
-  free(tech_name);
-  /* Revert, or we will not be in sync with the server. */
-  science_report_combo_set_active(combo, research_get
-                                  (client_player())->tech_goal);
-}
-
-/************************************************************************//**
-  Initialize a science report.
-****************************************************************************/
-static void science_report_init(struct science_report *preport)
-{
-  GtkWidget *frame, *table, *help_button, *show_all_button, *sw, *w;
-  GtkSizeGroup *group;
-  GtkListStore *store;
-  GtkCellRenderer *renderer;
-
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_new(&preport->shell, GTK_NOTEBOOK(top_notebook), NULL, TRUE);
-  /* TRANS: Research report title */
-  gui_dialog_set_title(preport->shell, _("Research"));
-
-  gui_dialog_add_button(preport->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
-  w = gtk_label_new(NULL);
-  gui_dialog_add_content_widget(preport->shell, w);
-  preport->main_label = GTK_LABEL(w);
-
-  /* Current research target line. */
-  frame = gtk_frame_new(_("Researching"));
-  gui_dialog_add_content_widget(preport->shell, frame);
-
-  table = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(table), 4);
-  gtk_frame_set_child(GTK_FRAME(frame), table);
-
-  help_button = gtk_check_button_new_with_label(_("Help"));
-  gtk_grid_attach(GTK_GRID(table), help_button, 5, 0, 1, 1);
-
-  store = science_report_store_new();
-  w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-  gtk_size_group_add_widget(group, w);
-  g_object_unref(G_OBJECT(store));
-  renderer = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer, TRUE);
-  gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer, "text",
-                                 SRD_COL_NAME, NULL);
-  gtk_widget_set_sensitive(w, can_client_issue_orders());
-  g_signal_connect(w, "changed", G_CALLBACK(science_report_current_callback),
-                   help_button);
-  gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
-  preport->reachable_techs = GTK_COMBO_BOX(w);
-
-  w = gtk_progress_bar_new();
-  gtk_widget_set_hexpand(w, TRUE);
-  gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(w), TRUE);
-  gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
-  gtk_widget_set_size_request(w, -1, 25);
-  preport->progress_bar = GTK_PROGRESS_BAR(w);
-
-  /* Research goal line. */
-  frame = gtk_frame_new( _("Goal"));
-  gui_dialog_add_content_widget(preport->shell, frame);
-
-  table = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(table), 4);
-  gtk_frame_set_child(GTK_FRAME(frame), table);
-
-  store = science_report_store_new();
-  w = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
-  gtk_size_group_add_widget(group, w);
-  g_object_unref(G_OBJECT(store));
-  renderer = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(w), renderer, TRUE);
-  gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer, "text",
-                                 SRD_COL_NAME, NULL);
-  renderer = gtk_cell_renderer_text_new();
-  gtk_cell_layout_pack_end(GTK_CELL_LAYOUT(w), renderer, FALSE);
-  gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(w), renderer, "text",
-                                 SRD_COL_STEPS, NULL);
-  gtk_widget_set_sensitive(w, can_client_issue_orders());
-  g_signal_connect(w, "changed", G_CALLBACK(science_report_goal_callback),
-                   help_button);
-  gtk_grid_attach(GTK_GRID(table), w, 0, 0, 1, 1);
-  preport->reachable_goals = GTK_COMBO_BOX(w);
-
-  w = gtk_label_new(NULL);
-  gtk_widget_set_hexpand(w, TRUE);
-  gtk_grid_attach(GTK_GRID(table), w, 2, 0, 1, 1);
-  gtk_widget_set_size_request(w, -1, 25);
-  preport->goal_label = GTK_LABEL(w);
-
-  /* Toggle "Show All" button. */
-  /* TRANS: As in 'Show all (even not reachable) techs'. */
-  show_all_button = gtk_toggle_button_new_with_label(_("Show all"));
-  gtk_grid_attach(GTK_GRID(table), show_all_button, 5, 0, 1, 1);
-  g_signal_connect(show_all_button, "toggled",
-                   G_CALLBACK(science_report_show_all_callback), preport);
-  gtk_widget_set_sensitive(show_all_button, can_client_issue_orders()
-                                             && !client_is_global_observer());
-  preport->button_show_all = show_all_button;
-
-  /* Science diagram. */
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-  gui_dialog_add_content_widget(preport->shell, sw);
-
-  w = science_diagram_new();
-  gtk_widget_set_hexpand(w, TRUE);
-  gtk_widget_set_vexpand(w, TRUE);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), w);
-  preport->drawing_area = GTK_DRAWING_AREA(w);
-
-  science_report_update(preport);
-  gui_dialog_show_all(preport->shell);
-  gtk_widget_queue_draw(GTK_WIDGET(preport->drawing_area));
-  g_object_unref(group);
-
-  /* This must be _after_ the dialog is drawn to really center it ... */
-  science_report_redraw(preport);
-}
-
-/************************************************************************//**
-  Free a science report.
-****************************************************************************/
-static void science_report_free(struct science_report *preport)
-{
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_destroy(preport->shell);
-  fc_assert(NULL == preport->shell);
-
-  memset(preport, 0, sizeof(*preport));
-}
-
-/************************************************************************//**
-  Create the science report is needed.
-****************************************************************************/
-void science_report_dialog_popup(bool raise)
-{
-  struct research *presearch = research_get(client_player());
-
-  if (NULL == science_report.shell) {
-    science_report_init(&science_report);
-  }
-
-  if (NULL != presearch
-      && A_UNSET == presearch->tech_goal
-      && A_UNSET == presearch->researching) {
-    gui_dialog_alert(science_report.shell);
-  } else {
-    gui_dialog_present(science_report.shell);
-  }
-
-  if (raise) {
-    gui_dialog_raise(science_report.shell);
-  }
-}
-
-/************************************************************************//**
-  Closes the science report dialog.
-****************************************************************************/
-void science_report_dialog_popdown(void)
-{
-  if (NULL != science_report.shell) {
-    science_report_free(&science_report);
-    fc_assert(NULL == science_report.shell);
-  }
-}
-
-/************************************************************************//**
-  Update the science report dialog.
-****************************************************************************/
-void real_science_report_dialog_update(void *unused)
-{
-  if (NULL != science_report.shell) {
-    science_report_update(&science_report);
-  }
-}
-
-/************************************************************************//**
-  Resize and redraw the requirement tree.
-****************************************************************************/
-void science_report_dialog_redraw(void)
-{
-  if (NULL != science_report.shell) {
-    science_report_redraw(&science_report);
-  }
-}
-
-
-/****************************************************************************
-                      ECONOMY REPORT DIALOG
-****************************************************************************/
-struct economy_report {
-  struct gui_dialog *shell;
-  GtkTreeView *tree_view;
-  GtkLabel *label;
-};
-
-static struct economy_report economy_report = { NULL, NULL, NULL };
-
-enum economy_report_response {
-  ERD_RES_SELL_REDUNDANT = 1,
-  ERD_RES_SELL_ALL,
-  ERD_RES_DISBAND_UNITS
-};
-
-/* Those values must match the functions economy_report_store_new() and
- * economy_report_column_name(). */
-enum economy_report_columns {
-  ERD_COL_SPRITE,
-  ERD_COL_NAME,
-  ERD_COL_REDUNDANT,
-  ERD_COL_COUNT,
-  ERD_COL_COST,
-  ERD_COL_TOTAL_COST,
-  ERD_COL_EMPTY,  /*  Will make an empty space for scroll bar */
-
-  /* Not visible. */
-  ERD_COL_IS_IMPROVEMENT,
-  ERD_COL_CID,
-
-  ERD_COL_NUM
-};
-
-/************************************************************************//**
-  Create a new economy report list store.
-****************************************************************************/
-static GtkListStore *economy_report_store_new(void)
-{
-  return gtk_list_store_new(ERD_COL_NUM,
-                            GDK_TYPE_PIXBUF,    /* ERD_COL_SPRITE */
-                            G_TYPE_STRING,      /* ERD_COL_NAME */
-                            G_TYPE_INT,         /* ERD_COL_REDUNDANT */
-                            G_TYPE_INT,         /* ERD_COL_COUNT */
-                            G_TYPE_INT,         /* ERD_COL_COST */
-                            G_TYPE_INT,         /* ERD_COL_TOTAL_COST */
-                            G_TYPE_STRING,      /* ERD_COL_EMPTY */
-                            G_TYPE_BOOLEAN,     /* ERD_COL_IS_IMPROVEMENT */
-                            G_TYPE_INT,         /* ERD_COL_UNI_KIND */
-                            G_TYPE_INT);        /* ERD_COL_UNI_VALUE_ID */
-}
-
-/************************************************************************//**
-  Returns the title of the column (translated).
-****************************************************************************/
-static const char *
-economy_report_column_name(enum economy_report_columns col)
-{
-  switch (col) {
-  case ERD_COL_SPRITE:
-    /* TRANS: Image header */
-    return _("Type");
-  case ERD_COL_NAME:
-    return Q_("?Building or Unit type:Name");
-  case ERD_COL_REDUNDANT:
-    return _("Redundant");
-  case ERD_COL_COUNT:
-    return _("Count");
-  case ERD_COL_COST:
-    return _("Cost");
-  case ERD_COL_TOTAL_COST:
-    /* TRANS: Upkeep total, count*cost. */
-    return _("U Total");
-  case ERD_COL_EMPTY:
-    /* Empty space for scrollbar*/
-    return "   ";
-  case ERD_COL_IS_IMPROVEMENT:
-  case ERD_COL_CID:
-  case ERD_COL_NUM:
-    break;      /* No more columns will be displayed after reaching this */
-  }
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Update the economy report dialog.
-****************************************************************************/
-static void economy_report_update(struct economy_report *preport)
-{
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GdkPixbuf *pix;
-  struct improvement_entry building_entries[B_LAST];
-  struct unit_entry unit_entries[U_LAST];
-  int entries_used, building_total, unit_total, tax, i;
-  char buf[256];
-  cid selected;
-
-  fc_assert_ret(NULL != preport);
-
-  /* Save the selection. */
-  selection = gtk_tree_view_get_selection(preport->tree_view);
-  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter, ERD_COL_CID, &selected, -1);
-  } else {
-    selected = -1;
-  }
-
-  model = gtk_tree_view_get_model(preport->tree_view);
-  store = GTK_LIST_STORE(model);
-  gtk_list_store_clear(store);
-
-  /* Buildings. */
-  get_economy_report_data(building_entries, &entries_used,
-                          &building_total, &tax);
-  for (i = 0; i < entries_used; i++) {
-    struct improvement_entry *pentry = building_entries + i;
-    struct impr_type *pimprove = pentry->type;
-    struct sprite *sprite = get_building_sprite(tileset, pimprove);
-    cid id = cid_encode_building(pimprove);
-
-    pix = sprite_get_pixbuf(sprite);
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       ERD_COL_SPRITE, pix,
-                       ERD_COL_NAME, improvement_name_translation(pimprove),
-                       ERD_COL_REDUNDANT, pentry->redundant,
-                       ERD_COL_COUNT, pentry->count,
-                       ERD_COL_COST, pentry->cost,
-                       ERD_COL_TOTAL_COST, pentry->total_cost,
-                       ERD_COL_EMPTY, " ",
-                       ERD_COL_IS_IMPROVEMENT, TRUE,
-                       ERD_COL_CID, id,
-                       -1);
-    g_object_unref(G_OBJECT(pix));
-    if (selected == id) {
-      /* Restore the selection. */
-      gtk_tree_selection_select_iter(selection, &iter);
-    }
-  }
-
-  /* Units. */
-  get_economy_report_units_data(unit_entries, &entries_used, &unit_total);
-  for (i = 0; i < entries_used; i++) {
-    struct unit_entry *pentry = unit_entries + i;
-    struct unit_type *putype = pentry->type;
-    struct sprite *sprite = get_unittype_sprite(tileset, putype,
-                                                ACTIVITY_LAST,
-                                                direction8_invalid());
-    cid id = cid_encode_unit(putype);
-
-    pix = sprite_get_pixbuf(sprite);
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       ERD_COL_SPRITE, pix,
-                       ERD_COL_NAME, utype_name_translation(putype),
-                       ERD_COL_REDUNDANT, 0,
-                       ERD_COL_COUNT, pentry->count,
-                       ERD_COL_COST, pentry->cost,
-                       ERD_COL_TOTAL_COST, pentry->total_cost,
-                       ERD_COL_EMPTY, " ",
-                       ERD_COL_IS_IMPROVEMENT, FALSE,
-                       ERD_COL_CID, id,
-                       -1);
-    g_object_unref(G_OBJECT(pix));
-    if (selected == id) {
-      /* Restore the selection. */
-      gtk_tree_selection_select_iter(selection, &iter);
-    }
-  }
-
-  /* Update the label. */
-  fc_snprintf(buf, sizeof(buf), _("Income: %d    Total Costs: %d"),
-              tax, building_total + unit_total);
-  gtk_label_set_text(preport->label, buf);
-}
-
-/************************************************************************//**
-  Issue a command on the economy report.
-****************************************************************************/
-static void economy_report_command_callback(struct gui_dialog *pdialog,
-                                            int response,
-                                            gpointer data)
-{
-  struct economy_report *preport = data;
-  GtkTreeSelection *selection = gtk_tree_view_get_selection(preport->tree_view);
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-  GtkWidget *shell;
-  struct universal selected;
-  cid id;
-  char buf[256] = "";
-
-  switch (response) {
-  case ERD_RES_SELL_REDUNDANT:
-  case ERD_RES_SELL_ALL:
-  case ERD_RES_DISBAND_UNITS:
-    break;
-  default:
-    gui_dialog_destroy(pdialog);
-    return;
-  }
-
-  if (!can_client_issue_orders()
-      || !gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    return;
-  }
-
-  gtk_tree_model_get(model, &iter, ERD_COL_CID, &id, -1);
-  selected = cid_decode(id);
-
-  switch (selected.kind) {
-  case VUT_IMPROVEMENT:
-    {
-      const struct impr_type *pimprove = selected.value.building;
-
-      if (can_sell_building(pimprove)
-          && (ERD_RES_SELL_ALL == response
-              || (ERD_RES_SELL_REDUNDANT == response))) {
-        bool redundant = (ERD_RES_SELL_REDUNDANT == response);
-        gint count;
-
-        gtk_tree_model_get(model, &iter,
-                           redundant ? ERD_COL_REDUNDANT : ERD_COL_COUNT,
-                           &count, -1);
-        if (count == 0) {
-          break;
-        }
-        shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
-                                       | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                       GTK_MESSAGE_QUESTION,
-                                       GTK_BUTTONS_YES_NO,
-                                       redundant
-                                       /* TRANS: %s is an improvement */
-                                       ? _("Do you really wish to sell "
-                                           "every redundant %s (%d total)?")
-                                       /* TRANS: %s is an improvement */
-                                       : _("Do you really wish to sell "
-                                           "every %s (%d total)?"),
-                                       improvement_name_translation(pimprove),
-                                       count);
-        setup_dialog(shell, gui_dialog_get_toplevel(pdialog));
-        gtk_window_set_title(GTK_WINDOW(shell), _("Sell Improvements"));
-
-        if (GTK_RESPONSE_YES == blocking_dialog(shell)) {
-          sell_all_improvements(pimprove, redundant, buf, sizeof(buf));
-        }
-        gtk_window_destroy(GTK_WINDOW(shell));
-      }
-    }
-    break;
-  case VUT_UTYPE:
-    {
-      if (ERD_RES_DISBAND_UNITS == response) {
-        const struct unit_type *putype = selected.value.utype;
-        gint count;
-
-        gtk_tree_model_get(model, &iter, ERD_COL_COUNT, &count, -1);
-
-        shell = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL
-                                       | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                       GTK_MESSAGE_QUESTION,
-                                       GTK_BUTTONS_YES_NO,
-                                       /* TRANS: %s is a unit */
-                                       _("Do you really wish to disband "
-                                         "every %s (%d total)?"),
-                                       utype_name_translation(putype),
-                                       count);
-        setup_dialog(shell, gui_dialog_get_toplevel(pdialog));
-        gtk_window_set_title(GTK_WINDOW(shell), _("Disband Units"));
-
-        if (GTK_RESPONSE_YES == blocking_dialog(shell)) {
-          disband_all_units(putype, FALSE, buf, sizeof(buf));
-        }
-        gtk_window_destroy(GTK_WINDOW(shell));
-      }
-    }
-    break;
-  default:
-    log_error("Not supported type: %d.", selected.kind);
-  }
-
-  if ('\0' != buf[0]) {
-    shell = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
-                                   GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
-                                   "%s", buf);
-    setup_dialog(shell, gui_dialog_get_toplevel(pdialog));
-    g_signal_connect(shell, "response", G_CALLBACK(gtk_window_destroy),
-                     NULL);
-    gtk_window_set_title(GTK_WINDOW(shell), _("Sell-Off: Results"));
-    gtk_window_present(GTK_WINDOW(shell));
-  }
-}
-
-/************************************************************************//**
-  Called when a building or a unit type is selected in the economy list.
-****************************************************************************/
-static void economy_report_selection_callback(GtkTreeSelection *selection,
-                                              gpointer data)
-{
-  struct gui_dialog *pdialog = ((struct economy_report *)data)->shell;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-
-  if (can_client_issue_orders()
-      && gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    struct universal selected;
-    cid id;
-
-    gtk_tree_model_get(model, &iter, ERD_COL_CID, &id, -1);
-    selected = cid_decode(id);
-    switch (selected.kind) {
-    case VUT_IMPROVEMENT:
-      {
-        bool can_sell = can_sell_building(selected.value.building);
-        gint redundant;
-
-        gtk_tree_model_get(model, &iter, ERD_COL_REDUNDANT, &redundant, -1);
-
-        gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_REDUNDANT,
-                                          can_sell && redundant > 0);
-        gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_ALL, can_sell);
-        gui_dialog_set_response_sensitive(pdialog, ERD_RES_DISBAND_UNITS,
-                                          FALSE);
-      }
-      return;
-    case VUT_UTYPE:
-      gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_REDUNDANT,
-                                        FALSE);
-      gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_ALL, FALSE);
-      gui_dialog_set_response_sensitive(pdialog, ERD_RES_DISBAND_UNITS,
-                                        TRUE);
-      return;
-    default:
-      log_error("Not supported type: %d.", selected.kind);
-      break;
-    }
-  }
-
-  gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_REDUNDANT, FALSE);
-  gui_dialog_set_response_sensitive(pdialog, ERD_RES_SELL_ALL, FALSE);
-  gui_dialog_set_response_sensitive(pdialog, ERD_RES_DISBAND_UNITS, FALSE);
-}
-
-/************************************************************************//**
-  Create a new economy report.
-****************************************************************************/
-static void economy_report_init(struct economy_report *preport)
-{
-  GtkWidget *view, *sw, *label, *button;
-  GtkListStore *store;
-  GtkTreeSelection *selection;
-  const char *title;
-  enum economy_report_columns i;
-
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_new(&preport->shell, GTK_NOTEBOOK(top_notebook), preport, TRUE);
-  gui_dialog_set_title(preport->shell, _("Economy"));
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gui_dialog_add_content_widget(preport->shell, sw);
-
-  store = economy_report_store_new();
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(store);
-  gtk_widget_set_name(view, "small_font");
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  preport->tree_view = GTK_TREE_VIEW(view);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(economy_report_selection_callback), preport);
-
-  for (i = 0; (title = economy_report_column_name(i)); i++) {
-    GtkCellRenderer *renderer;
-    GtkTreeViewColumn *col;
-    GType type = gtk_tree_model_get_column_type(GTK_TREE_MODEL(store), i);
-
-    if (GDK_TYPE_PIXBUF == type) {
-      renderer = gtk_cell_renderer_pixbuf_new();
-      col = gtk_tree_view_column_new_with_attributes(title, renderer,
-                                                     "pixbuf", i, NULL);
-#if 0
-    } else if (G_TYPE_BOOLEAN == type) {
-      renderer = gtk_cell_renderer_toggle_new();
-      col = gtk_tree_view_column_new_with_attributes(title, renderer,
-                                                     "active", i, NULL);
-#endif
-    } else {
-      bool is_redundant = (i == ERD_COL_REDUNDANT);
-
-      renderer = gtk_cell_renderer_text_new();
-      if (is_redundant) {
-        /* Special treatment: hide "Redundant" column for units */
-        col = gtk_tree_view_column_new_with_attributes(title, renderer,
-                                                       "text", i,
-                                                       "visible",
-                                                       ERD_COL_IS_IMPROVEMENT,
-                                                       NULL);
-      } else {
-        col = gtk_tree_view_column_new_with_attributes(title, renderer,
-                                                       "text", i, NULL);
-      }
-    }
-
-    if (i > 1) {
-      g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
-      gtk_tree_view_column_set_alignment(col, 1.0);
-    }
-
-    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-  }
-
-  label = gtk_label_new(NULL);
-  gui_dialog_add_content_widget(preport->shell, label);
-  gtk_widget_set_margin_start(label, 5);
-  gtk_widget_set_margin_end(label, 5);
-  gtk_widget_set_margin_top(label, 5);
-  gtk_widget_set_margin_bottom(label, 5);
-  preport->label = GTK_LABEL(label);
-
-  gui_dialog_add_button(preport->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  button = gui_dialog_add_button(preport->shell, NULL, _("_Disband"),
-                                 ERD_RES_DISBAND_UNITS);
-  gtk_widget_set_sensitive(button, FALSE);
-
-  button = gui_dialog_add_button(preport->shell, NULL, _("Sell _All"),
-                                 ERD_RES_SELL_ALL);
-  gtk_widget_set_sensitive(button, FALSE);
-
-  button = gui_dialog_add_button(preport->shell, NULL, _("Sell _Redundant"),
-                                 ERD_RES_SELL_REDUNDANT);
-  gtk_widget_set_sensitive(button, FALSE);
-
-  gui_dialog_response_set_callback(preport->shell,
-                                   economy_report_command_callback);
-
-  gui_dialog_set_default_size(preport->shell, -1, 350);
-  gui_dialog_show_all(preport->shell);
-
-  economy_report_update(preport);
-
-  gtk_tree_view_focus(GTK_TREE_VIEW(view));
-}
-
-/************************************************************************//**
-  Free an economy report.
-****************************************************************************/
-static void economy_report_free(struct economy_report *preport)
-{
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_destroy(preport->shell);
-  fc_assert(NULL == preport->shell);
-
-  memset(preport, 0, sizeof(*preport));
-}
-
-/************************************************************************//**
-  Create the economy report if needed.
-****************************************************************************/
-void economy_report_dialog_popup(bool raise)
-{
-  if (NULL == economy_report.shell) {
-    economy_report_init(&economy_report);
-  }
-
-  gui_dialog_present(economy_report.shell);
-  if (raise) {
-    gui_dialog_raise(economy_report.shell);
-  }
-}
-
-/************************************************************************//**
-  Close the economy report dialog.
-****************************************************************************/
-void economy_report_dialog_popdown(void)
-{
-  if (NULL != economy_report.shell) {
-    economy_report_free(&economy_report);
-  }
-}
-
-/************************************************************************//**
-  Update the economy report dialog.
-****************************************************************************/
-void real_economy_report_dialog_update(void *unused)
-{
-  if (NULL != economy_report.shell) {
-    economy_report_update(&economy_report);
-  }
-}
-
-
-/****************************************************************************
-                           UNITS REPORT DIALOG
-****************************************************************************/
-struct units_report {
-  struct gui_dialog *shell;
-  GtkTreeView *tree_view;
-};
-
-static struct units_report units_report = { NULL, NULL };
-
-enum units_report_response {
-  URD_RES_NEAREST = 1,
-  URD_RES_UPGRADE
-};
-
-/* Those values must match the order of unit_report_columns[]. */
-enum units_report_columns {
-  URD_COL_UTYPE_NAME,
-  URD_COL_UPGRADABLE,
-  URD_COL_N_UPGRADABLE,
-  URD_COL_IN_PROGRESS,
-  URD_COL_ACTIVE,
-  URD_COL_SHIELD,
-  URD_COL_FOOD,
-  URD_COL_GOLD,
-  URD_COL_EMPTY,        /* Empty space for scrollbar */
-
-  /* Not visible. */
-  URD_COL_TEXT_WEIGHT,
-  URD_COL_UPG_VISIBLE,
-  URD_COL_NUPG_VISIBLE,
-  URD_COL_UTYPE_ID,
-
-  URD_COL_NUM
-};
-
-static const struct {
-  GType type;
-  const char *title;
-  const char *tooltip;
-  bool rightalign;
-  int visible_col;
-} unit_report_columns[] = {
-  { /* URD_COL_UTYPE_NAME */   G_TYPE_STRING,  N_("Unit Type"),
-    NULL,                         FALSE,  -1 },
-  { /* URD_COL_UPGRADABLE */   G_TYPE_BOOLEAN, N_("?Upgradable unit [short]:U"),
-    N_("Upgradable"),             TRUE,   URD_COL_UPG_VISIBLE },
-  { /* URD_COL_N_UPGRADABLE */ G_TYPE_INT,     "" /* merge with previous col */,
-    NULL,                         TRUE,   URD_COL_NUPG_VISIBLE },
-  /* TRANS: "In progress" abbreviation. */
-  { /* URD_COL_IN_PROGRESS */  G_TYPE_INT,     N_("In-Prog"),
-    N_("In progress"),            TRUE,   -1 },
-  { /* URD_COL_ACTIVE */       G_TYPE_INT,     N_("Active"),
-    NULL,                         TRUE,   -1 },
-  { /* URD_COL_SHIELD */       G_TYPE_INT,     N_("Shield"),
-    N_("Total shield upkeep"),    TRUE,   -1 },
-  { /* URD_COL_FOOD */         G_TYPE_INT,     N_("Food"),
-    N_("Total food upkeep"),      TRUE,   -1 },
-  { /* URD_COL_GOLD */         G_TYPE_INT,     N_("Gold"),
-    N_("Total gold upkeep"),      TRUE,   -1 },
-  { /* URD_COL_EMPTY */         G_TYPE_STRING, "   ",
-    " ", TRUE, -1 },
-
-  { /* URD_COL_TEXT_WEIGHT */  G_TYPE_INT,     NULL /* ... */ },
-  { /* URD_COL_UPG_VISIBLE */  G_TYPE_BOOLEAN, NULL /* ... */ },
-  { /* URD_COL_NUPG_VISIBLE */ G_TYPE_BOOLEAN, NULL /* ... */ },
-  { /* URD_COL_UTYPE_ID */     G_TYPE_INT,     NULL /* ... */ }
-};
-
-/************************************************************************//**
-  Create a new units report list store.
-****************************************************************************/
-static GtkListStore *units_report_store_new(void)
-{
-  int i;
-  GType cols[URD_COL_NUM];
-
-  fc_assert(ARRAY_SIZE(unit_report_columns) == URD_COL_NUM);
-
-  for (i = 0; i < URD_COL_NUM; i++) {
-    cols[i] = unit_report_columns[i].type;
-  }
-
-  return gtk_list_store_newv(URD_COL_NUM, cols);
-}
-
-/************************************************************************//**
-  Update the units report.
-****************************************************************************/
-static void units_report_update(struct units_report *preport)
-{
-  struct urd_info {
-    int active_count;
-    int building_count;
-    int upkeep[O_LAST];
-  };
-
-  struct urd_info unit_array[utype_count()];
-  struct urd_info unit_totals;
-  struct urd_info *info;
-  int total_upgradable_count = 0;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkListStore *store;
-  GtkTreeIter iter;
-  Unit_type_id selected, utype_id;
-
-  fc_assert_ret(NULL != preport);
-
-  memset(unit_array, '\0', sizeof(unit_array));
-  memset(&unit_totals, '\0', sizeof(unit_totals));
-
-  /* Count units. */
-  players_iterate(pplayer) {
-    if (client_has_player() && pplayer != client_player()) {
-      continue;
-    }
-
-    unit_list_iterate(pplayer->units, punit) {
-      info = unit_array + utype_index(unit_type_get(punit));
-
-      if (0 != punit->homecity) {
-        output_type_iterate(o) {
-          info->upkeep[o] += punit->upkeep[o];
-        } output_type_iterate_end;
-      }
-      info->active_count++;
-    } unit_list_iterate_end;
-    city_list_iterate(pplayer->cities, pcity) {
-      if (VUT_UTYPE == pcity->production.kind) {
-        int num_units;
-        info = unit_array + utype_index(pcity->production.value.utype);
-        /* Account for build slots in city */
-        (void) city_production_build_units(pcity, TRUE, &num_units);
-        /* Unit is in progress even if it won't be done this turn */
-        num_units = MAX(num_units, 1);
-        info->building_count += num_units;
-      }
-    } city_list_iterate_end;
-  } players_iterate_end;
-
-  /* Save selection. */
-  selection = gtk_tree_view_get_selection(preport->tree_view);
-  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
-    gtk_tree_model_get(model, &iter, URD_COL_UTYPE_ID, &selected, -1);
-  } else {
-    selected = -1;
-  }
-
-  /* Make the store. */
-  model = gtk_tree_view_get_model(preport->tree_view);
-  store = GTK_LIST_STORE(model);
-  gtk_list_store_clear(store);
-
-  unit_type_iterate(utype) {
-    bool upgradable;
-
-    utype_id = utype_index(utype);
-    info = unit_array + utype_id;
-
-    if (0 == info->active_count && 0 == info->building_count) {
-      continue;         /* We don't need a row for this type. */
-    }
-
-    upgradable = client_has_player()
-                 && NULL != can_upgrade_unittype(client_player(), utype);
-
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter,
-                       URD_COL_UTYPE_NAME, utype_name_translation(utype),
-                       URD_COL_UPGRADABLE, upgradable,
-                       URD_COL_N_UPGRADABLE, 0, /* never displayed */
-                       URD_COL_IN_PROGRESS, info->building_count,
-                       URD_COL_ACTIVE, info->active_count,
-                       URD_COL_SHIELD, info->upkeep[O_SHIELD],
-                       URD_COL_FOOD, info->upkeep[O_FOOD],
-                       URD_COL_GOLD, info->upkeep[O_GOLD],
-                       URD_COL_EMPTY, " ",
-                       URD_COL_TEXT_WEIGHT, PANGO_WEIGHT_NORMAL,
-                       URD_COL_UPG_VISIBLE, TRUE,
-                       URD_COL_NUPG_VISIBLE, FALSE,
-                       URD_COL_UTYPE_ID, utype_id,
-                       -1);
-    if (selected == utype_id) {
-      /* Restore the selection. */
-      gtk_tree_selection_select_iter(selection, &iter);
-    }
-
-    /* Update totals. */
-    unit_totals.active_count += info->active_count;
-    output_type_iterate(o) {
-      unit_totals.upkeep[o] += info->upkeep[o];
-    } output_type_iterate_end;
-    unit_totals.building_count += info->building_count;
-    if (upgradable) {
-      total_upgradable_count += info->active_count;
-    }
-  } unit_type_iterate_end;
-
-  /* Add the total row. */
-  gtk_list_store_append(store, &iter);
-  gtk_list_store_set(store, &iter,
-                     URD_COL_UTYPE_NAME, _("Totals:"),
-                     URD_COL_UPGRADABLE, FALSE, /* never displayed */
-                     URD_COL_N_UPGRADABLE, total_upgradable_count,
-                     URD_COL_IN_PROGRESS, unit_totals.building_count,
-                     URD_COL_ACTIVE, unit_totals.active_count,
-                     URD_COL_SHIELD, unit_totals.upkeep[O_SHIELD],
-                     URD_COL_FOOD, unit_totals.upkeep[O_FOOD],
-                     URD_COL_GOLD, unit_totals.upkeep[O_GOLD],
-                     URD_COL_EMPTY, " ",
-                     URD_COL_TEXT_WEIGHT, PANGO_WEIGHT_BOLD,
-                     URD_COL_UPG_VISIBLE, FALSE,
-                     URD_COL_NUPG_VISIBLE, TRUE,
-                     URD_COL_UTYPE_ID, U_LAST,
-                     -1);
-  if (selected == U_LAST) {
-    /* Restore the selection. */
-    gtk_tree_selection_select_iter(selection, &iter);
-  }
-}
-
-/************************************************************************//**
-  GtkTreeSelection "changed" signal handler.
-****************************************************************************/
-static void units_report_selection_callback(GtkTreeSelection *selection,
-                                            gpointer data)
-{
-  struct units_report *preport = data;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  int active_count;
-  struct unit_type *utype = NULL;
-
-  if (gtk_tree_selection_get_selected(selection, &model, &it)) {
-    int ut;
-
-    gtk_tree_model_get(model, &it,
-                       URD_COL_ACTIVE, &active_count,
-                       URD_COL_UTYPE_ID, &ut,
-                       -1);
-    if (0 < active_count) {
-      utype = utype_by_number(ut);
-    }
-  }
-
-  if (NULL == utype) {
-    gui_dialog_set_response_sensitive(preport->shell, URD_RES_NEAREST,
-                                      FALSE);
-    gui_dialog_set_response_sensitive(preport->shell, URD_RES_UPGRADE,
-                                      FALSE);
-  } else {
-    gui_dialog_set_response_sensitive(preport->shell, URD_RES_NEAREST, TRUE);
-    gui_dialog_set_response_sensitive(preport->shell, URD_RES_UPGRADE,
-        (can_client_issue_orders()
-         && action_ever_possible(ACTION_UPGRADE_UNIT)
-         && NULL != can_upgrade_unittype(client_player(), utype)));
-  }
-}
-
-/************************************************************************//**
-  Returns the nearest unit of the type 'utype'.
-****************************************************************************/
-static struct unit *find_nearest_unit(const struct unit_type *utype,
-                                      struct tile *ptile)
-{
-  struct unit *best_candidate = NULL;
-  int best_dist = FC_INFINITY, dist;
-
-  players_iterate(pplayer) {
-    if (client_has_player() && pplayer != client_player()) {
-      continue;
-    }
-
-    unit_list_iterate(pplayer->units, punit) {
-      if (utype == unit_type_get(punit)
-          && FOCUS_AVAIL == punit->client.focus_status
-          && 0 < punit->moves_left
-          && !punit->done_moving
-          && punit->ssa_controller == SSA_NONE) {
-        dist = sq_map_distance(unit_tile(punit), ptile);
-        if (dist < best_dist) {
-          best_candidate = punit;
-          best_dist = dist;
-        }
-      }
-    } unit_list_iterate_end;
-  } players_iterate_end;
-
-  return best_candidate;
-}
-
-/************************************************************************//**
-  Gui dialog handler.
-****************************************************************************/
-static void units_report_command_callback(struct gui_dialog *pdialog,
-                                          int response,
-                                          gpointer data)
-{
-  struct units_report *preport = data;
-  struct unit_type *utype = NULL;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  switch (response) {
-  case URD_RES_NEAREST:
-  case URD_RES_UPGRADE:
-    break;
-  default:
-    gui_dialog_destroy(pdialog);
-    return;
-  }
-
-  /* Nearest & upgrade commands. */
-  selection = gtk_tree_view_get_selection(preport->tree_view);
-  if (gtk_tree_selection_get_selected(selection, &model, &it)) {
-    int ut;
-
-    gtk_tree_model_get(model, &it, URD_COL_UTYPE_ID, &ut, -1);
-    utype = utype_by_number(ut);
-  }
-
-  if (response == URD_RES_NEAREST) {
-    struct tile *ptile;
-    struct unit *punit;
-
-    ptile = get_center_tile_mapcanvas();
-    if ((punit = find_nearest_unit(utype, ptile))) {
-      center_tile_mapcanvas(unit_tile(punit));
-
-      if (ACTIVITY_IDLE == punit->activity
-          || ACTIVITY_SENTRY == punit->activity) {
-        if (can_unit_do_activity_client(punit, ACTIVITY_IDLE)) {
-          unit_focus_set_and_select(punit);
-        }
-      }
-    }
-  } else if (can_client_issue_orders()) {
-    GtkWidget *shell;
-    const struct unit_type *upgrade = can_upgrade_unittype(client_player(), utype);
-    char buf[1024];
-    int price = unit_upgrade_price(client_player(), utype, upgrade);
-
-    fc_snprintf(buf, ARRAY_SIZE(buf), PL_("Treasury contains %d gold.",
-                                          "Treasury contains %d gold.",
-                                          client_player()->economic.gold),
-                client_player()->economic.gold);
-
-    shell = gtk_message_dialog_new(NULL,
-                                   GTK_DIALOG_MODAL
-                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                   GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-                                   /* TRANS: Last %s is pre-pluralised
-                                    * "Treasury contains %d gold." */
-                                   PL_("Upgrade as many %s to %s as possible "
-                                       "for %d gold each?\n%s",
-                                       "Upgrade as many %s to %s as possible "
-                                       "for %d gold each?\n%s", price),
-                                   utype_name_translation(utype),
-                                   utype_name_translation(upgrade),
-                                   price, buf);
-    setup_dialog(shell, gui_dialog_get_toplevel(preport->shell));
-
-    gtk_window_set_title(GTK_WINDOW(shell), _("Upgrade Obsolete Units"));
-
-    if (GTK_RESPONSE_YES == blocking_dialog(shell)) {
-      dsend_packet_unit_type_upgrade(&client.conn, utype_number(utype));
-    }
-
-    gtk_window_destroy(GTK_WINDOW(shell));
-  }
-}
-
-/************************************************************************//**
-  Create a units report.
-****************************************************************************/
-static void units_report_init(struct units_report *preport)
-{
-  GtkWidget *view, *sw, *button;
-  GtkListStore *store;
-  GtkTreeSelection *selection;
-  GtkTreeViewColumn *col = NULL;
-  enum units_report_columns i;
-
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_new(&preport->shell, GTK_NOTEBOOK(top_notebook), preport, TRUE);
-  gui_dialog_set_title(preport->shell, _("Units"));
-
-  sw = gtk_scrolled_window_new();
-  gtk_widget_set_halign(sw, GTK_ALIGN_CENTER);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gui_dialog_add_content_widget(preport->shell, sw);
-
-  store = units_report_store_new();
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_vexpand(view, TRUE);
-  g_object_unref(store);
-  gtk_widget_set_name(view, "small_font");
-  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  preport->tree_view = GTK_TREE_VIEW(view);
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
-  g_signal_connect(selection, "changed",
-                   G_CALLBACK(units_report_selection_callback), preport);
-
-  for (i = 0; unit_report_columns[i].title != NULL; i++) {
-    GtkCellRenderer *renderer;
-
-    if (strlen(unit_report_columns[i].title) > 0) {
-      GtkWidget *header = gtk_label_new(Q_(unit_report_columns[i].title));
-
-      if (unit_report_columns[i].tooltip) {
-        gtk_widget_set_tooltip_text(header,
-                                    Q_(unit_report_columns[i].tooltip));
-      }
-      gtk_widget_set_visible(header, TRUE);
-      col = gtk_tree_view_column_new();
-      gtk_tree_view_column_set_widget(col, header);
-      if (unit_report_columns[i].rightalign) {
-        gtk_tree_view_column_set_alignment(col, 1.0);
-      }
-      gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
-    } /* else add new renderer to previous TreeViewColumn */
-
-    fc_assert(col != NULL);
-    if (G_TYPE_BOOLEAN == unit_report_columns[i].type) {
-      renderer = gtk_cell_renderer_toggle_new();
-      gtk_tree_view_column_pack_start(col, renderer, FALSE);
-      gtk_tree_view_column_add_attribute(col, renderer, "active", i);
-    } else {
-      renderer = gtk_cell_renderer_text_new();
-      gtk_tree_view_column_pack_start(col, renderer, TRUE);
-      gtk_tree_view_column_add_attribute(col, renderer, "text", i);
-      gtk_tree_view_column_add_attribute(col, renderer,
-                                         "weight", URD_COL_TEXT_WEIGHT);
-    }
-
-    if (unit_report_columns[i].visible_col >= 0) {
-      gtk_tree_view_column_add_attribute(col, renderer, "visible",
-                                         unit_report_columns[i].visible_col);
-    }
-
-    if (unit_report_columns[i].rightalign) {
-      g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
-    }
-  }
-
-  gui_dialog_add_button(preport->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-
-  button = gui_dialog_add_button(preport->shell, NULL, _("_Upgrade"),
-                                 URD_RES_UPGRADE);
-  gtk_widget_set_sensitive(button, FALSE);
-
-  button = gui_dialog_add_button(preport->shell, "edit-find",
-                                 _("Find _Nearest"), URD_RES_NEAREST);
-  gtk_widget_set_sensitive(button, FALSE);
-
-  gui_dialog_response_set_callback(preport->shell,
-                                   units_report_command_callback);
-
-  gui_dialog_set_default_size(preport->shell, -1, 350);
-  gui_dialog_show_all(preport->shell);
-
-  units_report_update(preport);
-  gtk_tree_view_focus(GTK_TREE_VIEW(view));
-}
-
-/************************************************************************//**
-  Free an units report.
-****************************************************************************/
-static void units_report_free(struct units_report *preport)
-{
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_destroy(preport->shell);
-  fc_assert(NULL == preport->shell);
-
-  memset(preport, 0, sizeof(*preport));
-}
-
-/************************************************************************//**
-  Create the units report if needed.
-****************************************************************************/
-void units_report_dialog_popup(bool raise)
-{
-  if (NULL == units_report.shell) {
-    units_report_init(&units_report);
-  }
-
-  gui_dialog_present(units_report.shell);
-  if (raise) {
-    gui_dialog_raise(units_report.shell);
-  }
-}
-
-/************************************************************************//**
-  Closes the units report dialog.
-****************************************************************************/
-void units_report_dialog_popdown(void)
-{
-  if (NULL != units_report.shell) {
-    units_report_free(&units_report);
-    fc_assert(NULL == units_report.shell);
-  }
-}
-
-/************************************************************************//**
-  Update the units report dialog.
-****************************************************************************/
-void real_units_report_dialog_update(void *unused)
-{
-  if (NULL != units_report.shell) {
-    units_report_update(&units_report);
-  }
-}
-
-
-/****************************************************************************
-                         FINAL REPORT DIALOG
-****************************************************************************/
-struct endgame_report {
-  struct gui_dialog *shell;
-  GtkTreeView *tree_view;
-  GtkListStore *store;
-  int player_count;
-  int players_received;
-};
-
-enum endgame_report_columns {
-  FRD_COL_PLAYER,
-  FRD_COL_NATION,
-  FRD_COL_SCORE,
-  FRD_COL_TOOLTIP,
-
-  FRD_COL_NUM
-};
-
-static struct endgame_report endgame_report = { NULL, NULL };
-
-/************************************************************************//**
-  Returns the title of the column (translated).
-****************************************************************************/
-static const char *
-endgame_report_column_name(enum endgame_report_columns col)
-{
-  switch (col) {
-  case FRD_COL_PLAYER:
-    return _("Player\n");
-  case FRD_COL_NATION:
-    return _("Nation\n");
-  case FRD_COL_SCORE:
-    return _("Score\n");
-  case FRD_COL_TOOLTIP:
-  case FRD_COL_NUM:
-    break;
-  }
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Fill a final report with statistics for each player.
-****************************************************************************/
-static void endgame_report_update(struct endgame_report *preport,
-                                  const struct packet_endgame_report *packet)
-{
-  const size_t col_num = packet->category_num + FRD_COL_NUM;
-  GType col_types[col_num];
-  GtkListStore *store;
-  GtkTreeViewColumn *col;
-  int i;
-
-  fc_assert_ret(NULL != preport);
-
-  /* Remove the old columns. */
-  while ((col = gtk_tree_view_get_column(preport->tree_view, 0))) {
-    gtk_tree_view_remove_column(preport->tree_view, col);
-  }
-
-  /* Create the new model. */
-  col_types[FRD_COL_PLAYER] = G_TYPE_STRING;
-  col_types[FRD_COL_NATION] = GDK_TYPE_PIXBUF;
-  col_types[FRD_COL_SCORE] = G_TYPE_INT;
-  col_types[FRD_COL_TOOLTIP] = G_TYPE_STRING;
-  for (i = FRD_COL_NUM; (guint)i < col_num; i++) {
-    col_types[i] = G_TYPE_INT;
-  }
-  store = gtk_list_store_newv(col_num, col_types);
-  gtk_tree_view_set_model(preport->tree_view, GTK_TREE_MODEL(store));
-  g_object_unref(G_OBJECT(store));
-
-  /* Create the new columns. */
-  for (i = 0; (guint)i < col_num; i++) {
-    GtkCellRenderer *renderer;
-    const char *title;
-    const char *attribute;
-
-    if (GDK_TYPE_PIXBUF == col_types[i]) {
-      renderer = gtk_cell_renderer_pixbuf_new();
-      attribute = "pixbuf";
-    } else {
-      renderer = gtk_cell_renderer_text_new();
-      attribute = "text";
-    }
-
-    if (i < FRD_COL_NUM) {
-      title = endgame_report_column_name(i);
-    } else {
-      title = packet->category_name[i - FRD_COL_NUM];
-    }
-
-    if (title != NULL) {
-      col = gtk_tree_view_column_new_with_attributes(Q_(title), renderer,
-                                                     attribute, i, NULL);
-      gtk_tree_view_append_column(preport->tree_view, col);
-      if (GDK_TYPE_PIXBUF != col_types[i]) {
-        gtk_tree_view_column_set_sort_column_id(col, i);
-      }
-    }
-  }
-
-  gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(preport->tree_view),
-                                   FRD_COL_TOOLTIP);
-
-  preport->store = store;
-  preport->player_count = packet->player_num;
-  preport->players_received = 0;
-}
-
-/************************************************************************//**
-  Handle endgame report information about one player.
-****************************************************************************/
-void endgame_report_dialog_player(const struct packet_endgame_player *packet)
-{
-  /* Fill the model with player stats. */
-  struct endgame_report *preport = &endgame_report;
-  const struct player *pplayer = player_by_number(packet->player_id);
-  GtkTreeIter iter;
-  int i;
-
-  gtk_list_store_append(preport->store, &iter);
-  gtk_list_store_set(preport->store, &iter,
-                     FRD_COL_PLAYER, player_name(pplayer),
-                     FRD_COL_NATION, get_flag(nation_of_player(pplayer)),
-                     FRD_COL_SCORE, packet->score,
-                     FRD_COL_TOOLTIP, score_tooltip(pplayer, packet->score),
-                     -1);
-  for (i = 0; i < packet->category_num; i++) {
-    gtk_list_store_set(preport->store, &iter,
-                       i + FRD_COL_NUM, packet->category_score[i],
-                       -1);
-  }
-
-  preport->players_received++;
-
-  if (preport->players_received == preport->player_count) {
-    gui_dialog_present(preport->shell);
-  }
-}
-
-/************************************************************************//**
-  Prepare a final report.
-****************************************************************************/
-static void endgame_report_init(struct endgame_report *preport)
-{
-  GtkWidget *sw, *view;
-
-  fc_assert_ret(NULL != preport);
-
-  gui_dialog_new(&preport->shell, GTK_NOTEBOOK(top_notebook), NULL, TRUE);
-  gui_dialog_set_title(preport->shell, _("Score"));
-
-  gui_dialog_set_default_size(preport->shell, 700, 420);
-
-  /* Setup the layout. */
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-  gui_dialog_add_content_widget(preport->shell, sw);
-
-  view = gtk_tree_view_new();
-  gtk_widget_set_name(view, "small_font");
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  preport->tree_view = GTK_TREE_VIEW(view);
-
-  if (preport->shell->type == GUI_DIALOG_TAB) {
-    gtk_widget_set_hexpand(GTK_WIDGET(view), TRUE);
-    gtk_widget_set_vexpand(GTK_WIDGET(view), TRUE);
-  }
-
-  gui_dialog_show_all(preport->shell);
-}
-
-/************************************************************************//**
-  Start building a dialog with player statistics at endgame.
-****************************************************************************/
-void endgame_report_dialog_start(const struct packet_endgame_report *packet)
-{
-  if (NULL == endgame_report.shell) {
-    endgame_report_init(&endgame_report);
-  }
-  endgame_report_update(&endgame_report, packet);
-}
diff --git a/client/gui-gtk-5.0/repodlgs.h b/client/gui-gtk-5.0/repodlgs.h
deleted file mode 100644
index 3d9809afd8..0000000000
--- a/client/gui-gtk-5.0/repodlgs.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__REPODLGS_H
-#define FC__REPODLGS_H
-
-/* client */
-#include "repodlgs_g.h"
-
-void science_report_dialog_popdown(void);
-void economy_report_dialog_popdown(void);
-void units_report_dialog_popdown(void);
-
-#endif /* FC__REPODLGS_H */
diff --git a/client/gui-gtk-5.0/soundset_dlg.c b/client/gui-gtk-5.0/soundset_dlg.c
deleted file mode 100644
index 75fc8c6923..0000000000
--- a/client/gui-gtk-5.0/soundset_dlg.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "game.h"
-
-/* client */
-#include "audio.h"
-#include "client_main.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "dialogs_g.h"
-
-/************************************************************************//**
-  Callback either loading suggested soundset or doing nothing
-****************************************************************************/
-static void soundset_suggestion_response(gint arg)
-{
-  if (arg == GTK_RESPONSE_YES) {
-    /* User accepted soundset loading */
-    audio_restart(game.control.preferred_soundset,
-                  music_set_name);
-  }
-}
-
-/************************************************************************//**
-  Popup dialog asking if ruleset suggested soundset should be
-  used.
-****************************************************************************/
-void popup_soundset_suggestion_dialog(void)
-{
-  GtkWidget *dialog, *label;
-  char buf[1024];
-
-  dialog = gtk_dialog_new_with_buttons(_("Preferred soundset"),
-                                       NULL,
-                                       0,
-                                       _("_Load soundset"),
-                                       GTK_RESPONSE_YES,
-                                       _("_Keep current soundset"),
-                                       GTK_RESPONSE_NO,
-                                       NULL);
-  setup_dialog(dialog, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
-
-  fc_snprintf(buf, sizeof(buf),
-              _("Modpack suggests using %s soundset.\n"
-                "It might not work with other soundsets.\n"
-                "You are currently using soundset %s."),
-              game.control.preferred_soundset, sound_set_name);
-
-  label = gtk_label_new(buf);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                 label);
-  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-  gtk_widget_set_visible(label, TRUE);
-
-  /* In case incoming rulesets are incompatible with current soundset
-   * we need to block their receive before user has accepted loading
-   * of the correct soundset. */
-  soundset_suggestion_response(blocking_dialog(dialog));
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
-
-/************************************************************************//**
-  Callback either loading suggested musicset or doing nothing
-****************************************************************************/
-static void musicset_suggestion_response(gint arg)
-{
-  if (arg == GTK_RESPONSE_YES) {
-    /* User accepted musicset loading */
-    audio_restart(sound_set_name, game.control.preferred_musicset);
-  }
-}
-
-/************************************************************************//**
-  Popup dialog asking if ruleset suggested musicset should be
-  used.
-****************************************************************************/
-void popup_musicset_suggestion_dialog(void)
-{
-  GtkWidget *dialog, *label;
-  char buf[1024];
-
-  dialog = gtk_dialog_new_with_buttons(_("Preferred musicset"),
-                                       NULL,
-                                       0,
-                                       _("_Load musicset"),
-                                       GTK_RESPONSE_YES,
-                                       _("_Keep current musicset"),
-                                       GTK_RESPONSE_NO,
-                                       NULL);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
-
-  fc_snprintf(buf, sizeof(buf),
-              _("Modpack suggests using %s musicset.\n"
-                "It might not work with other musicsets.\n"
-                "You are currently using musicset %s."),
-              game.control.preferred_musicset, music_set_name);
-
-  label = gtk_label_new(buf);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                 label);
-  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-  gtk_widget_set_visible(label, TRUE);
-
-  /* In case incoming rulesets are incompatible with current musicset
-   * we need to block their receive before user has accepted loading
-   * of the correct musicset. */
-  musicset_suggestion_response(blocking_dialog(dialog));
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
diff --git a/client/gui-gtk-5.0/spaceshipdlg.c b/client/gui-gtk-5.0/spaceshipdlg.c
deleted file mode 100644
index 830f20ecc5..0000000000
--- a/client/gui-gtk-5.0/spaceshipdlg.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-#include "support.h"
-
-/* common */
-#include "game.h"
-#include "map.h"
-#include "packets.h"
-#include "player.h"
-#include "spaceship.h"
-#include "victory.h"
-
-/* client */
-#include "client_main.h"
-#include "climisc.h"
-#include "colors.h"
-#include "options.h"
-#include "text.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "dialogs.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "helpdlg.h"
-#include "inputdlg.h"
-#include "mapctrl.h"
-#include "mapview.h"
-#include "repodlgs.h"
-
-#include "spaceshipdlg.h"
-
-struct spaceship_dialog {
-  struct player *pplayer;
-  struct gui_dialog *shell;
-  GtkWidget *main_form;
-  GtkWidget *info_label;
-  GtkWidget *image_canvas;
-};
-
-#define SPECLIST_TAG dialog
-#define SPECLIST_TYPE struct spaceship_dialog
-#include "speclist.h"
-
-#define dialog_list_iterate(dialoglist, pdialog) \
-    TYPED_LIST_ITERATE(struct spaceship_dialog, dialoglist, pdialog)
-#define dialog_list_iterate_end  LIST_ITERATE_END
-
-static struct dialog_list *dialog_list;
-
-static struct spaceship_dialog *get_spaceship_dialog(struct player *pplayer);
-static struct spaceship_dialog *create_spaceship_dialog(struct player
-                                                        *pplayer);
-
-static void spaceship_dialog_update_image(struct spaceship_dialog *pdialog);
-static void spaceship_dialog_update_info(struct spaceship_dialog *pdialog);
-
-/************************************************************************//**
-  Initialize spaceship dialogs
-****************************************************************************/
-void spaceship_dialog_init(void)
-{
-  dialog_list = dialog_list_new();
-}
-
-/************************************************************************//**
-  Free resources allocated for spaceship dialogs
-****************************************************************************/
-void spaceship_dialog_done(void)
-{
-  dialog_list_destroy(dialog_list);
-}
-
-/************************************************************************//**
-  Get spaceship dialog about certain player
-****************************************************************************/
-struct spaceship_dialog *get_spaceship_dialog(struct player *pplayer)
-{
-  dialog_list_iterate(dialog_list, pdialog) {
-    if (pdialog->pplayer == pplayer) {
-      return pdialog;
-    }
-  } dialog_list_iterate_end;
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Refresh spaceship dialog of certain player
-****************************************************************************/
-void refresh_spaceship_dialog(struct player *pplayer)
-{
-  struct spaceship_dialog *pdialog;
-  struct player_spaceship *pship;
-
-  if (!(pdialog = get_spaceship_dialog(pplayer))) {
-    return;
-  }
-
-  pship = &(pdialog->pplayer->spaceship);
-
-  if (victory_enabled(VC_SPACERACE)
-      && pplayer == client.conn.playing
-      && pship->state == SSHIP_STARTED
-      && pship->success_rate > 0.0) {
-    gui_dialog_set_response_sensitive(pdialog->shell,
-                                      GTK_RESPONSE_ACCEPT, TRUE);
-  } else {
-    gui_dialog_set_response_sensitive(pdialog->shell,
-                                      GTK_RESPONSE_ACCEPT, FALSE);
-  }
-
-  spaceship_dialog_update_info(pdialog);
-  spaceship_dialog_update_image(pdialog);
-}
-
-/************************************************************************//**
-  Popup the dialog 10% inside the main-window
-****************************************************************************/
-void popup_spaceship_dialog(struct player *pplayer)
-{
-  struct spaceship_dialog *pdialog;
-
-  if (!(pdialog = get_spaceship_dialog(pplayer))) {
-    pdialog = create_spaceship_dialog(pplayer);
-  }
-
-  gui_dialog_raise(pdialog->shell);
-}
-
-/************************************************************************//**
-  Popdown the dialog
-****************************************************************************/
-void popdown_spaceship_dialog(struct player *pplayer)
-{
-  struct spaceship_dialog *pdialog;
-
-  if ((pdialog = get_spaceship_dialog(pplayer))) {
-    gui_dialog_destroy(pdialog->shell);
-  }
-}
-
-/************************************************************************//**
-  Draw spaceship dialog canvas.
-****************************************************************************/
-static void spaceship_image_canvas_draw(GtkDrawingArea *w, cairo_t *cr,
-                                        int width, int height,
-                                        gpointer data)
-{
-  struct spaceship_dialog *pdialog = (struct spaceship_dialog *)data;
-  struct canvas store = FC_STATIC_CANVAS_INIT;
-
-  store.drawable = cr;
-
-  put_spaceship(&store, 0, 0, pdialog->pplayer);
-}
-
-/************************************************************************//**
-  Spaceship dialog being destroyed
-****************************************************************************/
-static void spaceship_destroy_callback(GtkWidget *w, gpointer data)
-{
-  struct spaceship_dialog *pdialog = (struct spaceship_dialog *)data;
-
-  dialog_list_remove(dialog_list, pdialog);
-
-  free(pdialog);
-}
-
-/************************************************************************//**
-  User has responded to spaceship dialog
-****************************************************************************/
-static void spaceship_response(struct gui_dialog *dlg, int response,
-                               gpointer data)
-{
-  switch (response) {
-  case GTK_RESPONSE_ACCEPT:
-    send_packet_spaceship_launch(&client.conn);
-    break;
-
-  default:
-    gui_dialog_destroy(dlg);
-    break;
-  }
-}
-
-/************************************************************************//**
-  Create new spaceship dialog
-****************************************************************************/
-struct spaceship_dialog *create_spaceship_dialog(struct player *pplayer)
-{
-  struct spaceship_dialog *pdialog;
-  GtkWidget *hgrid, *frame;
-  int w, h;
-  int grid_col = 0;
-
-  pdialog = fc_malloc(sizeof(struct spaceship_dialog));
-  pdialog->pplayer = pplayer;
-
-  gui_dialog_new(&pdialog->shell, GTK_NOTEBOOK(top_notebook), NULL, TRUE);
-  gui_dialog_set_title(pdialog->shell, player_name(pplayer));
-
-  gui_dialog_add_button(pdialog->shell, "window-close", _("_Close"),
-                        GTK_RESPONSE_CLOSE);
-  gui_dialog_add_button(pdialog->shell, NULL, _("_Launch"),
-                        GTK_RESPONSE_ACCEPT);
-
-  g_signal_connect(pdialog->shell->grid, "destroy",
-                   G_CALLBACK(spaceship_destroy_callback), pdialog);
-  gui_dialog_response_set_callback(pdialog->shell, spaceship_response);
-
-  hgrid = gtk_grid_new();
-  gtk_grid_set_column_spacing(GTK_GRID(hgrid), 5);
-  gui_dialog_add_content_widget(pdialog->shell, hgrid);
-
-  frame = gtk_frame_new(NULL);
-  gtk_grid_attach(GTK_GRID(hgrid), frame, grid_col++, 0, 1, 1);
-
-  pdialog->image_canvas = gtk_drawing_area_new();
-  gtk_widget_set_can_focus(pdialog->image_canvas, TRUE);
-  get_spaceship_dimensions(&w, &h);
-  gtk_widget_set_size_request(pdialog->image_canvas, w, h);
-
-  gtk_frame_set_child(GTK_FRAME(frame), pdialog->image_canvas);
-  gtk_widget_realize(pdialog->image_canvas);
-
-  gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(pdialog->image_canvas),
-                                 spaceship_image_canvas_draw, pdialog, NULL);
-
-  pdialog->info_label = gtk_label_new(get_spaceship_descr(NULL));
-
-  gtk_label_set_justify(GTK_LABEL(pdialog->info_label), GTK_JUSTIFY_LEFT);
-  gtk_widget_set_halign(pdialog->info_label, GTK_ALIGN_START);
-  gtk_widget_set_valign(pdialog->info_label, GTK_ALIGN_START);
-
-  gtk_grid_attach(GTK_GRID(hgrid), pdialog->info_label, grid_col++, 0, 1, 1);
-  gtk_widget_set_name(pdialog->info_label, "spaceship_label");
-
-  dialog_list_prepend(dialog_list, pdialog);
-
-  gtk_widget_grab_focus(pdialog->image_canvas);
-
-  gui_dialog_show_all(pdialog->shell);
-
-  refresh_spaceship_dialog(pdialog->pplayer);
-
-  return pdialog;
-}
-
-/************************************************************************//**
-  Update spaceship dialog info label text
-****************************************************************************/
-void spaceship_dialog_update_info(struct spaceship_dialog *pdialog)
-{
-  gtk_label_set_text(GTK_LABEL(pdialog->info_label),
-                     get_spaceship_descr(&pdialog->pplayer->spaceship));
-}
-
-/************************************************************************//**
-  Should also check connectedness, and show non-connected
-  parts differently.
-****************************************************************************/
-void spaceship_dialog_update_image(struct spaceship_dialog *pdialog)
-{
-  gtk_widget_queue_draw(pdialog->image_canvas);
-}
diff --git a/client/gui-gtk-5.0/spaceshipdlg.h b/client/gui-gtk-5.0/spaceshipdlg.h
deleted file mode 100644
index cb2392c9c2..0000000000
--- a/client/gui-gtk-5.0/spaceshipdlg.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__SPACESHIPDLG_H
-#define FC__SPACESHIPDLG_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "spaceshipdlg_g.h"
-
-void spaceship_dialog_init(void);
-void spaceship_dialog_done(void);
-
-#endif  /* FC__SPACESHIPDLG_H */
diff --git a/client/gui-gtk-5.0/sprite.c b/client/gui-gtk-5.0/sprite.c
deleted file mode 100644
index e2d746c24a..0000000000
--- a/client/gui-gtk-5.0/sprite.c
+++ /dev/null
@@ -1,593 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-/* utility */
-#include "log.h"
-#include "mem.h"
-#include "shared.h"
-
-/* client/gui-gtk-5.0 */
-#include "colors.h"
-#include "mapview.h"
-
-#include "sprite.h"
-
-#define MAX_FILE_EXTENSIONS 50
-
-/************************************************************************//**
-  Create a new sprite by cropping and taking only the given portion of
-  the image.
-
-  source gives the sprite that is to be cropped.
-
-  x,y, width, height gives the rectangle to be cropped.  The pixel at
-  position of the source sprite will be at (0,0) in the new sprite, and
-  the new sprite will have dimensions (width, height).
-
-  mask gives an additional mask to be used for clipping the new sprite.
-
-  mask_offset_x, mask_offset_y is the offset of the mask relative to the
-  origin of the source image.  The pixel at (mask_offset_x,mask_offset_y)
-  in the mask image will be used to clip pixel (0,0) in the source image
-  which is pixel (-x,-y) in the new image.
-
-  scale gives scale of new tileset
-  smooth means if scaling might be bilinear, if set to false use nearest
-  neighbor
-****************************************************************************/
-struct sprite *crop_sprite(struct sprite *source,
-                           int x, int y,
-                           int width, int height,
-                           struct sprite *mask, int mask_offset_x, int mask_offset_y,
-                           float scale, bool smooth)
-{
-  struct sprite *new = fc_malloc(sizeof(*new));
-  cairo_t *cr;
-
-  fc_assert_ret_val(source, NULL);
-
-  new->surface = cairo_surface_create_similar(source->surface,
-          CAIRO_CONTENT_COLOR_ALPHA, width, height);
-  cr = cairo_create(new->surface);
-  cairo_rectangle(cr, 0, 0, width, height);
-  cairo_clip(cr);
-
-  cairo_set_source_surface(cr, source->surface, -x, -y);
-  cairo_paint(cr);
-  if (mask) {
-    cairo_set_operator(cr, CAIRO_OPERATOR_DEST_IN);
-    cairo_set_source_surface(cr, mask->surface, mask_offset_x-x, mask_offset_y-y);
-    cairo_paint(cr);
-  }
-  cairo_destroy(cr);
-
-  return new;
-}
-
-/************************************************************************//**
-  Create a sprite with the given height, width and color.
-****************************************************************************/
-struct sprite *create_sprite(int width, int height, struct color *pcolor)
-{
-  struct sprite *sprite = fc_malloc(sizeof(*sprite));
-  cairo_t *cr;
-
-  fc_assert_ret_val(width > 0, NULL);
-  fc_assert_ret_val(height > 0, NULL);
-  fc_assert_ret_val(pcolor != NULL, NULL);
-
-  sprite->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-                                               width, height);
-
-  cr = cairo_create(sprite->surface);
-  gdk_cairo_set_source_rgba(cr, &pcolor->color);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  return sprite;
-}
-
-/************************************************************************//**
-  Find the dimensions of the sprite.
-****************************************************************************/
-void get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
-{
-  *width = cairo_image_surface_get_width(sprite->surface);
-  *height = cairo_image_surface_get_height(sprite->surface);
-}
-
-/************************************************************************//**
-  Returns the filename extensions the client supports
-  Order is important.
-****************************************************************************/
-const char **gfx_fileextensions(void)
-{
-  /* Includes space for hardcoded 'png' and termination NULL */
-  static const char *ext[MAX_FILE_EXTENSIONS + 2] =
-  {
-    NULL
-  };
-
-  if (ext[0] == NULL) {
-    int count = 0;
-    GSList *formats = gdk_pixbuf_get_formats();
-    GSList *next = formats;
-
-    while ((next = g_slist_next(next)) != NULL && count < MAX_FILE_EXTENSIONS) {
-      GdkPixbufFormat *format = g_slist_nth_data(next, 0);
-      gchar **mimes = gdk_pixbuf_format_get_mime_types(format);
-      int i;
-
-      /* Consider .png to be supported even when there's no mime-type called "png" */
-      ext[count++] = fc_strdup("png");
-
-      for (i = 0; mimes[i] != NULL && count < MAX_FILE_EXTENSIONS; i++) {
-        char *end = strstr(mimes[i], "/");
-
-        if (end != NULL) {
-          ext[count++] = fc_strdup(end + 1);
-        }
-      }
-
-      g_strfreev(mimes);
-    }
-
-    g_slist_free(formats);
-
-    ext[count] = NULL;
-  }
-
-  return ext;
-}
-
-/************************************************************************//**
-  Called when the cairo surface with freeciv allocated data is destroyed.
-****************************************************************************/
-static void surf_destroy_callback(void *data)
-{
-  free(data);
-}
-
-/************************************************************************//**
-  Load the given graphics file into a sprite. This function loads an
-  entire image file, which may later be broken up into individual sprites
-  with crop_sprite().
-****************************************************************************/
-struct sprite *load_gfxfile(const char *filename, bool svgflag)
-{
-  struct sprite *spr;
-  GError *err = NULL;
-  GdkPixbuf *pb = gdk_pixbuf_new_from_file(filename, &err);
-  int width;
-  int height;
-  unsigned char *pbdata;
-  int rs;
-  unsigned char *cairo_data;
-  unsigned char *data;
-  int i, j;
-  int cairo_stride;
-  bool has_alpha;
-  int channels;
-
-  if (pb == NULL) {
-    log_error(_("Can't load %s: %s"), filename, err->message);
-    return NULL;
-  }
-
-  spr = fc_malloc(sizeof(*spr));
-  spr->surface = NULL;
-
-  width = gdk_pixbuf_get_width(pb);
-  height = gdk_pixbuf_get_height(pb);
-  pbdata = gdk_pixbuf_get_pixels(pb);
-  rs = gdk_pixbuf_get_rowstride(pb);
-  has_alpha = gdk_pixbuf_get_has_alpha(pb);
-  channels = gdk_pixbuf_get_n_channels(pb);
-
-  cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
-  if (cairo_stride <= 0) {
-    log_error("Cairo does not give stride for width %d", width);
-    free_sprite(spr);
-
-    return NULL;
-  }
-
-  cairo_data = fc_malloc(height * cairo_stride * 4);
-  data = cairo_data;
-
-  for (i = 0; i < height; i++) {
-    for (j = 0; j < width; j++) {
-      if (has_alpha) {
-        unsigned char tmp;
-
-#define MULTI_UNc(a,b) ((a * b - (b / 2)) / 0xFF)
-
-        if (is_bigendian()) {
-          tmp = pbdata[j * channels + 3];
-          data[j * 4 + 3] = MULTI_UNc(pbdata[j * channels + 2], tmp);
-          data[j * 4 + 2] = MULTI_UNc(pbdata[j * channels + 1], tmp);
-          data[j * 4 + 1] = MULTI_UNc(pbdata[j * channels + 0], tmp);
-          data[j * 4 + 0] = tmp;
-        } else {
-          tmp = MULTI_UNc(pbdata[j * channels + 2], pbdata[j * channels + 3]);
-          data[j * 4 + 1] = MULTI_UNc(pbdata[j * channels + 1],
-                                      pbdata[j * channels + 3]);
-          data[j * 4 + 2] = MULTI_UNc(pbdata[j * channels + 0],
-                                      pbdata[j * channels + 3]);
-          data[j * 4 + 0] = tmp;
-          data[j * 4 + 3] = pbdata[j * channels + 3];
-        }
-
-#undef MULTI_UNc
-
-      } else {
-        data[j * 4 + 3] = 255;
-        data[j * 4 + 0] = pbdata[j * channels + 2];
-        data[j * 4 + 1] = pbdata[j * channels + 1];
-        data[j * 4 + 2] = pbdata[j * channels + 0];
-      }
-    }
-
-    data += cairo_stride;
-    pbdata += rs;
-  }
-
-  g_object_unref(pb);
-
-  spr->surface = cairo_image_surface_create_for_data(cairo_data, CAIRO_FORMAT_ARGB32,
-                                                     width, height, cairo_stride);
-  if (spr->surface == NULL
-      || cairo_surface_status(spr->surface) != CAIRO_STATUS_SUCCESS) {
-    log_error("Cairo image surface creation error");
-    free_sprite(spr);
-    free(cairo_data);
-
-    return NULL;
-  }
-
-  cairo_surface_set_user_data(spr->surface, NULL, cairo_data, surf_destroy_callback);
-
-  fc_assert(cairo_image_surface_get_format(spr->surface) == CAIRO_FORMAT_ARGB32);
-
-  if (cairo_surface_status(spr->surface) != CAIRO_STATUS_SUCCESS) {
-    log_fatal("Failed reading graphics file: \"%s\"", filename);
-
-    exit(EXIT_FAILURE);
-  }
-
-  return spr;
-}
-
-/************************************************************************//**
-  Free a sprite and all associated image data.
-****************************************************************************/
-void free_sprite(struct sprite *s)
-{
-  if (s->surface != NULL) {
-    cairo_surface_destroy(s->surface);
-  }
-
-  free(s);
-}
-
-/************************************************************************//**
-  Scales a sprite. If the sprite contains a mask, the mask is scaled
-  as as well.
-****************************************************************************/
-struct sprite *sprite_scale(struct sprite *src, int new_w, int new_h)
-{
-  cairo_t *cr;
-  struct sprite *new = fc_malloc(sizeof(*new));
-  int width, height;
-
-  get_sprite_dimensions(src, &width, &height);
-
-  new->surface = cairo_surface_create_similar(src->surface,
-      CAIRO_CONTENT_COLOR_ALPHA, new_w, new_h);
-
-  cr = cairo_create(new->surface);
-  cairo_save(cr);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_restore(cr);
-  cairo_scale(cr, (double) new_w / (double) width, (double) new_h / (double) height);
-  cairo_set_source_surface(cr, src->surface, 0, 0);
-  cairo_paint(cr);
-
-  cairo_destroy(cr);
-
-  return new;
-}
-
-/************************************************************************//**
-  Method returns the bounding box of a sprite. It assumes a rectangular
-  object/mask. The bounding box contains the border (pixel which have
-  unset pixel as neighbors) pixel.
-****************************************************************************/
-void sprite_get_bounding_box(struct sprite *sprite, int *start_x,
-                             int *start_y, int *end_x, int *end_y)
-{
-  unsigned char *data = cairo_image_surface_get_data(sprite->surface);
-  int width = cairo_image_surface_get_width(sprite->surface);
-  int height = cairo_image_surface_get_height(sprite->surface);
-  int i, j;
-  int endian;
-
-  if (is_bigendian()) {
-    endian = 0;
-  } else {
-    endian = 3;
-  }
-
-  fc_assert(cairo_image_surface_get_format(sprite->surface) == CAIRO_FORMAT_ARGB32);
-
-  /* Parses mask image for the first column that contains a visible pixel */
-  *start_x = -1;
-  for (i = 0; i < width && *start_x == -1; i++) {
-    for (j = 0; j < height; j++) {
-      if (data[(j * width + i) * 4 + endian]) {
-        *start_x = i;
-        break;
-      }
-    }
-  }
-
-  /* Parses mask image for the last column that contains a visible pixel */
-  *end_x = -1;
-  for (i = width - 1; i >= *start_x && *end_x == -1; i--) {
-    for (j = 0; j < height; j++) {
-      if (data[(j * width + i) * 4 + endian]) {
-        *end_x = i;
-        break;
-      }
-    }
-  }
-
-  /* Parses mask image for the first row that contains a visible pixel */
-  *start_y = -1;
-  for (i = 0; i < height && *start_y == -1; i++) {
-    for (j = *start_x; j <= *end_x; j++) {
-      if (data[(i * width + j) * 4 + endian]) {
-        *start_y = i;
-        break;
-      }
-    }
-  }
-
-  /* Parses mask image for the last row that contains a visible pixel */
-  *end_y = -1;
-  for (i = height - 1; i >= *end_y && *end_y == -1; i--) {
-    for (j = *start_x; j <= *end_x; j++) {
-      if (data[(i * width + j) * 4 + endian]) {
-        *end_y = i;
-        break;
-      }
-    }
-  }
-}
-
-/************************************************************************//**
-  Crops all blankspace from a sprite (insofar as is possible as a rectangle)
-****************************************************************************/
-struct sprite *crop_blankspace(struct sprite *s)
-{
-  int x1, y1, x2, y2;
-
-  sprite_get_bounding_box(s, &x1, &y1, &x2, &y2);
-
-  return crop_sprite(s, x1, y1, x2 - x1 + 1, y2 - y1 + 1, NULL, -1, -1,
-                     1.0, FALSE);
-}
-
-/************************************************************************//**
-  Render a pixbuf from the sprite.
-
-  NOTE: the pixmap and mask of a sprite must not change after this
-        function is called!
-****************************************************************************/
-GdkPixbuf *sprite_get_pixbuf(struct sprite *sprite)
-{
-  int width, height;
-
-  if (!sprite) {
-    return NULL;
-  }
-
-  get_sprite_dimensions(sprite, &width, &height);
-
-  return surface_get_pixbuf(sprite->surface, width, height);
-}
-
-/************************************************************************//**
-  Render a pixbuf from the cairo surface
-****************************************************************************/
-GdkPixbuf *surface_get_pixbuf(cairo_surface_t *surf, int width, int height)
-{
-  cairo_t *cr;
-  cairo_surface_t *tmpsurf;
-  GdkPixbuf *pb;
-  unsigned char *pixels;
-  int rowstride;
-  int i;
-
-  pb = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
-  pixels = gdk_pixbuf_get_pixels(pb);
-  rowstride = gdk_pixbuf_get_rowstride(pb);
-
-  tmpsurf = cairo_image_surface_create_for_data(pixels, CAIRO_FORMAT_ARGB32,
-                                                width, height, rowstride);
-
-  cr = cairo_create(tmpsurf);
-  cairo_save(cr);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_restore(cr);
-  cairo_set_source_surface(cr, surf, 0, 0);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  for (i = height; i > 0; i--) {
-    unsigned char *p = pixels;
-    unsigned char *end = p + 4 * width;
-    unsigned char tmp;
-
-#define DIV_UNc(a,b) (((guint16) (a) * 0xFF + ((b) / 2)) / (b))
-
-    while (p < end) {
-      tmp = p[0];
-
-      if (is_bigendian()) {
-        if (tmp != 0) {
-          p[0] = DIV_UNc(p[1], tmp);
-          p[1] = DIV_UNc(p[2], tmp);
-          p[2] = DIV_UNc(p[3], tmp);
-          p[3] = tmp;
-        } else {
-          p[1] = p[2] = p[3] = 0;
-        }
-      } else {
-        if (p[3] != 0) {
-          p[0] = DIV_UNc(p[2], p[3]);
-          p[1] = DIV_UNc(p[1], p[3]);
-          p[2] = DIV_UNc(tmp, p[3]);
-        } else {
-          p[0] = p[1] = p[2] = 0;
-        }
-      }
-
-      p += 4;
-    }
-
-#undef DIV_UNc
-
-    pixels += rowstride;
-  }
-
-  cairo_surface_destroy(tmpsurf);
-
-  return pb;
-}
-
-/************************************************************************//**
-  Create a pixbuf containing a representative image for the given extra
-  type, to be used as an icon in the GUI.
-
-  May return NULL on error.
-
-  NB: You must call g_object_unref on the non-NULL return value when you
-  no longer need it.
-****************************************************************************/
-GdkPixbuf *create_extra_pixbuf(const struct extra_type *pextra)
-{
-  struct drawn_sprite sprs[80];
-  int count, w, h, canvas_x, canvas_y;
-  GdkPixbuf *pixbuf;
-  struct canvas canvas = FC_STATIC_CANVAS_INIT;
-  cairo_t *cr;
-
-  w = tileset_tile_width(tileset);
-  h = tileset_tile_height(tileset);
-
-  canvas.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
-  canvas_x = 0;
-  canvas_y = 0;
-
-  cr = cairo_create(canvas.surface);
-  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
-  cairo_paint(cr);
-  cairo_destroy(cr);
-
-  count = fill_basic_extra_sprite_array(tileset, sprs, pextra);
-  put_drawn_sprites(&canvas, 1.0, canvas_x, canvas_y, count, sprs, FALSE);
-
-  pixbuf = surface_get_pixbuf(canvas.surface, w, h);
-  cairo_surface_destroy(canvas.surface);
-
-  return pixbuf;
-}
-
-/************************************************************************//**
-  Create a GtkPicture from cairo surface.
-****************************************************************************/
-GtkWidget *picture_new_from_surface(cairo_surface_t *surf)
-{
-  GdkPixbuf *pb;
-  GtkWidget *pic;
-
-  pb = surface_get_pixbuf(surf,
-                          cairo_image_surface_get_width(surf),
-                          cairo_image_surface_get_height(surf));
-
-  pic = gtk_picture_new_for_pixbuf(pb);
-  g_object_unref(pb);
-
-  return pic;
-}
-
-/************************************************************************//**
-  Set a GtkPicture from cairo surface.
-****************************************************************************/
-void picture_set_from_surface(GtkPicture *pic, cairo_surface_t *surf)
-{
-  GdkPixbuf *pb;
-  GdkTexture *texture;
-  GdkPaintable *empty;
-
-  pb = surface_get_pixbuf(surf,
-                          cairo_image_surface_get_width(surf),
-                          cairo_image_surface_get_height(surf));
-
-  /* Workaround to gtk bug that gtk_picture_set_paintable() does
-   * not work if the new paintable is of the same size as current */
-  empty = gdk_paintable_new_empty(1, 1);
-  gtk_picture_set_paintable(pic, empty);
-
-  texture = gdk_texture_new_for_pixbuf(pb);
-  gtk_picture_set_paintable(pic, GDK_PAINTABLE(texture));
-  g_object_unref(texture);
-  g_object_unref(pb);
-}
-
-/************************************************************************//**
-  Return a sprite image of a number.
-****************************************************************************/
-struct sprite *load_gfxnumber(int num)
-{
-  int width, height;
-  char buf[10];
-  struct sprite *spr;
-  struct color *sprcolor = color_alloc(0xff, 0xff, 0x00);
-  struct color *textcolor = color_alloc(0x00, 0x00, 0x00);
-  cairo_t *cr;
-  int border = 2;
-
-  fc_snprintf(buf, sizeof(buf), "%d", num);
-  get_text_size(&width, &height, FONT_CITY_PROD, buf);
-
-  spr = create_sprite(width + border * 2, height + border * 2, sprcolor);
-
-  cr = cairo_create(spr->surface);
-
-  surface_put_text(cr, border, border, 1.0, FONT_CITY_PROD, textcolor, buf);
-
-  cairo_destroy(cr);
-
-  color_free(textcolor);
-  color_free(sprcolor);
-
-  return spr;
-}
diff --git a/client/gui-gtk-5.0/sprite.h b/client/gui-gtk-5.0/sprite.h
deleted file mode 100644
index d166a78702..0000000000
--- a/client/gui-gtk-5.0/sprite.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__SPRITE_H
-#define FC__SPRITE_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "sprite_g.h"
-
-struct sprite
-{
-  cairo_surface_t *surface;
-};
-
-struct sprite *sprite_scale(struct sprite *src, int new_w, int new_h);
-void sprite_get_bounding_box(struct sprite *sprite, int *start_x,
-                             int *start_y, int *end_x, int *end_y);
-struct sprite *crop_blankspace(struct sprite *s);
-
-/********************************************************************
-  Note: a sprite cannot be changed after these functions are called!
-********************************************************************/
-GdkPixbuf *sprite_get_pixbuf(struct sprite *sprite);
-GdkPixbuf *surface_get_pixbuf(cairo_surface_t *surf, int width, int height);
-
-GdkPixbuf *create_extra_pixbuf(const struct extra_type *pextra);
-
-GtkWidget *picture_new_from_surface(cairo_surface_t *surf);
-void picture_set_from_surface(GtkPicture *image, cairo_surface_t *surf);
-
-#endif /* FC__SPRITE_H */
diff --git a/client/gui-gtk-5.0/theme_dlg.c b/client/gui-gtk-5.0/theme_dlg.c
deleted file mode 100644
index 59c8c6b6e9..0000000000
--- a/client/gui-gtk-5.0/theme_dlg.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* client */
-#include "dialogs_g.h"
-#include "options.h"
-
-/* gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-static bool load_theme = FALSE;
-
-/************************************************************************//**
-  Callback deciding if the theme may be loaded or not
-****************************************************************************/
-static void theme_suggestion_response(gint arg)
-{
-  load_theme = (arg == GTK_RESPONSE_YES);
-}
-
-/************************************************************************//**
-  Popup dialog asking if tileset suggested theme should be
-  used.
-****************************************************************************/
-bool popup_theme_suggestion_dialog(const char *theme_name)
-{
-  GtkWidget *dialog, *label;
-  char buf[1024];
-  char *current_name = GUI_GTK_OPTION(default_theme_name);
-
-  if (current_name == nullptr) {
-    /* gui option default_theme_name is not yet set.
-     * This can happen when we load tileset requested at command line and
-     * user has not saved theme information to .freeciv-client-rc.A.B. */
-    current_name = FC_GTK5_DEFAULT_THEME_NAME;
-  }
-
-  dialog = gtk_dialog_new_with_buttons(_("Theme suggested"),
-                                       nullptr,
-                                       0,
-                                       _("Load theme"),
-                                       GTK_RESPONSE_YES,
-                                       _("Keep current theme"),
-                                       GTK_RESPONSE_NO,
-                                       NULL);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
-
-  fc_snprintf(buf, sizeof(buf),
-              _("Tileset suggests using %s theme.\n"
-              "You are currently using %s."),
-              theme_name, current_name);
-
-  label = gtk_label_new(buf);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                 label);
-  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-  gtk_widget_set_visible(label, TRUE);
-
-  theme_suggestion_response(blocking_dialog(dialog));
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-
-  return load_theme;
-}
diff --git a/client/gui-gtk-5.0/themes.c b/client/gui-gtk-5.0/themes.c
deleted file mode 100644
index 578c564283..0000000000
--- a/client/gui-gtk-5.0/themes.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 2005 The Freeciv Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#ifdef FREECIV_HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fc_dirent.h"
-#include "mem.h"
-#include "string_vector.h"
-
-/* client */
-#include "themes_common.h"
-
-/* gui-gtk-5.0 */
-#include "gui_main.h"
-
-#include "themes_g.h"
-
-static GtkCssProvider *theme_provider = NULL;
-
-/*************************************************************************//**
-  Loads a gtk theme directory/theme_name
-*****************************************************************************/
-void gui_load_theme(const char *directory, const char *theme_name)
-{
-  char buf[strlen(directory) + strlen(theme_name) + 32];
-
-  if (theme_provider == NULL) {
-    theme_provider = gtk_css_provider_new();
-    gtk_style_context_add_provider_for_display(
-        gtk_widget_get_display(toplevel),
-        GTK_STYLE_PROVIDER(theme_provider),
-        GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  }
-
-  /* Gtk theme is a directory containing gtk-4.0/gtk.css file */
-  fc_snprintf(buf, sizeof(buf), "%s/%s/gtk-4.0/gtk.css", directory,
-              theme_name);
-
-  gtk_css_provider_load_from_path(theme_provider, buf);
-}
-
-/*************************************************************************//**
-  Clears a theme (sets default system theme)
-*****************************************************************************/
-void gui_clear_theme(void)
-{
-  bool theme_loaded;
-
-  /* Try to load user defined theme */
-  theme_loaded = load_theme(GUI_GTK_OPTION(default_theme_name));
-
-  /* No user defined theme loaded -> try to load Freeciv default theme */
-  if (!theme_loaded) {
-    theme_loaded = load_theme(GUI_GTK_DEFAULT_THEME_NAME);
-    if (theme_loaded) {
-      sz_strlcpy(GUI_GTK_OPTION(default_theme_name), GUI_GTK_DEFAULT_THEME_NAME);
-    }
-  }
-
-  /* Still no theme loaded -> drop theme provider */
-  if (!theme_loaded && theme_provider != NULL) {
-    gtk_style_context_remove_provider_for_display(
-        gtk_widget_get_display(toplevel),
-        GTK_STYLE_PROVIDER(theme_provider));
-    theme_provider = NULL;
-  }
-}
-
-/*************************************************************************//**
-  Each gui has its own themes directories.
-  For gtk4x these are:
-  - /usr/share/themes
-  - ~/.themes
-  Returns an array containing these strings and sets array size in count.
-  The caller is responsible for freeing the array and the paths.
-*****************************************************************************/
-char **get_gui_specific_themes_directories(int *count)
-{
-  gchar *standard_dir;
-  char *home_dir;
-  const struct strvec *data_dirs = get_data_dirs();
-  char **directories = fc_malloc((2 + strvec_size(data_dirs))
-                                 * sizeof(char *));
-
-  *count = 0;
-
-  /* Freeciv-specific GTK4x themes directories */
-  strvec_iterate(data_dirs, dir_name) {
-    char buf[strlen(dir_name) + strlen("/themes/gtk4") + 1];
-
-    fc_snprintf(buf, sizeof(buf), "%s/themes/gtk4", dir_name);
-
-    directories[(*count)++] = fc_strdup(buf);
-  } strvec_iterate_end;
-
-  /* Standard GTK themes directory */
-#ifdef CROSSER
-  standard_dir = "../share/themes";
-#else  /* CROSSER */
-  standard_dir = "/usr/share/themes";
-#endif /* CROSSER */
-  directories[(*count)++] = fc_strdup(standard_dir);
-
-  /* User GTK themes directory (~/.themes) */
-  home_dir = user_home_dir();
-  if (home_dir) {
-    char buf[strlen(home_dir) + 16];
-
-    fc_snprintf(buf, sizeof(buf), "%s/.themes/", home_dir);
-    directories[(*count)++] = fc_strdup(buf);
-  }
-
-  return directories;
-}
-
-/*************************************************************************//**
-  Return an array of names of usable themes in the given directory.
-  Array size is stored in count.
-  Usable theme for gtk is a directory which contains file gtk-4.0/gtk.css.
-  The caller is responsible for freeing the array and the names
-*****************************************************************************/
-char **get_usable_themes_in_directory(const char *directory, int *count)
-{
-  DIR *dir;
-  struct dirent *entry;
-  char **theme_names = fc_malloc(sizeof(char *) * 2);
-  /* Allocated memory size */
-  int t_size = 2;
-
-
-  *count = 0;
-
-  dir = fc_opendir(directory);
-  if (!dir) {
-    /* This isn't directory or we can't list it */
-    return theme_names;
-  }
-
-  while ((entry = readdir(dir))) {
-    char buf[strlen(directory) + strlen(entry->d_name) + 32];
-    struct stat stat_result;
-
-    fc_snprintf(buf, sizeof(buf),
-                "%s/%s/gtk-4.0/gtk.css", directory, entry->d_name);
-
-    if (fc_stat(buf, &stat_result) != 0) {
-      /* File doesn't exist */
-      continue;
-    }
-
-    if (!S_ISREG(stat_result.st_mode)) {
-      /* Not a regular file */
-      continue;
-    }
-
-    /* Otherwise it's ok */
-
-    /* Increase array size if needed */
-    if (*count == t_size) {
-      theme_names = fc_realloc(theme_names, t_size * 2 * sizeof(char *));
-      t_size *= 2;
-    }
-
-    theme_names[*count] = fc_strdup(entry->d_name);
-    (*count)++;
-  }
-
-  closedir(dir);
-
-  return theme_names;
-}
diff --git a/client/gui-gtk-5.0/tileset_dlg.c b/client/gui-gtk-5.0/tileset_dlg.c
deleted file mode 100644
index da6545e949..0000000000
--- a/client/gui-gtk-5.0/tileset_dlg.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "game.h"
-#include "unitlist.h"
-
-/* client */
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-
-#include "dialogs_g.h"
-
-extern char forced_tileset_name[512];
-
-/************************************************************************//**
-  Callback either loading suggested tileset or doing nothing
-****************************************************************************/
-static void tileset_suggestion_response(gint arg)
-{
-  if (arg == GTK_RESPONSE_YES) {
-    /* User accepted tileset loading */
-    sz_strlcpy(forced_tileset_name, game.control.preferred_tileset);
-    if (!tilespec_reread(game.control.preferred_tileset, TRUE, 1.0)) {
-      tileset_error(LOG_ERROR, game.control.preferred_tileset,
-                    _("Can't load requested tileset."));
-    }
-  }
-}
-
-/************************************************************************//**
-  Popup dialog asking if ruleset suggested tileset should be
-  used.
-****************************************************************************/
-void popup_tileset_suggestion_dialog(void)
-{
-  GtkWidget *dialog, *label;
-  char buf[1024];
-
-  dialog = gtk_dialog_new_with_buttons(_("Preferred tileset"),
-                                       NULL,
-                                       0,
-                                       _("_Load tileset"),
-                                       GTK_RESPONSE_YES,
-                                       _("_Keep current tileset"),
-                                       GTK_RESPONSE_NO,
-                                       NULL);
-  setup_dialog(dialog, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
-
-  fc_snprintf(buf, sizeof(buf),
-              _("Modpack suggests using %s tileset.\n"
-                "It might not work with other tilesets.\n"
-                "You are currently using tileset %s."),
-              game.control.preferred_tileset, tileset_basename(tileset));
-
-  label = gtk_label_new(buf);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                 label);
-  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
-  gtk_widget_set_visible(label, TRUE);
-
-  /* In case incoming rulesets are incompatible with current tileset
-   * we need to block their receive before user has accepted loading
-   * of the correct tileset. */
-  tileset_suggestion_response(blocking_dialog(dialog));
-
-  gtk_window_destroy(GTK_WINDOW(dialog));
-}
diff --git a/client/gui-gtk-5.0/transportdlg.c b/client/gui-gtk-5.0/transportdlg.c
deleted file mode 100644
index 3d60e2bfa6..0000000000
--- a/client/gui-gtk-5.0/transportdlg.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "game.h"
-#include "movement.h"
-#include "unit.h"
-
-/* client */
-#include "control.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "sprite.h"
-#include "unitselunitdlg.h"
-
-#include "transportdlg.h"
-
-struct transport_radio_cb_data {
-  GtkWidget *dlg;
-  int tp_id;
-};
-
-/************************************************************************//**
-  Handle user response to transport dialog.
-****************************************************************************/
-static void transport_response_callback(GtkWidget *dlg, gint arg)
-{
-  if (arg == GTK_RESPONSE_YES) {
-    struct unit *pcargo =
-      game_unit_by_number(GPOINTER_TO_INT(
-                            g_object_get_data(G_OBJECT(dlg),
-                                              "actor")));
-
-    if (pcargo != NULL) {
-      int tp_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dlg),
-                                                    "target"));
-      struct tile *ptile = g_object_get_data(G_OBJECT(dlg), "tile");
-
-      if (tp_id == 0) {
-        /* Load to any */
-        request_unit_load(pcargo, NULL, ptile);
-      } else {
-        struct unit *ptransport = game_unit_by_number(tp_id);
-
-        if (ptransport != NULL) {
-          /* Still exist */
-          request_unit_load(pcargo, ptransport, ptile);
-        }
-      }
-    }
-  }
-
-  gtk_window_destroy(GTK_WINDOW(dlg));
-}
-
-/************************************************************************//**
-  Handle transport request automatically when there's nothing to
-  choose from. Otherwise open up transport dialog for the unit
-****************************************************************************/
-bool request_transport(struct unit *cargo, struct tile *ptile)
-{
-  int tcount;
-  struct unit_list *potential_transports = unit_list_new();
-  struct unit *best_transport = transporter_for_unit_at(cargo, ptile);
-
-  unit_list_iterate(ptile->units, ptransport) {
-    if (could_unit_load(cargo, ptransport)) {
-      unit_list_append(potential_transports, ptransport);
-    }
-  } unit_list_iterate_end;
-
-  tcount = unit_list_size(potential_transports);
-
-  if (tcount == 0) {
-    fc_assert(best_transport == NULL);
-    unit_list_destroy(potential_transports);
-
-    return FALSE; /* Unit was not handled here. */
-  } else if (tcount == 1) {
-    /* There's exactly one potential transport - use it automatically */
-    fc_assert(unit_list_get(potential_transports, 0) == best_transport);
-    request_unit_load(cargo, unit_list_get(potential_transports, 0), ptile);
-
-    unit_list_destroy(potential_transports);
-
-    return TRUE;
-  }
-
-  return select_tgt_unit(cargo, ptile, potential_transports, best_transport,
-                         _("Transport selection"),
-                         _("Looking for transport:"),
-                         _("Transports available:"),
-                         _("Load"),
-                         G_CALLBACK(transport_response_callback));
-}
diff --git a/client/gui-gtk-5.0/transportdlg.h b/client/gui-gtk-5.0/transportdlg.h
deleted file mode 100644
index e9aad2965e..0000000000
--- a/client/gui-gtk-5.0/transportdlg.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__TRANSPORTDLG_H
-#define FC__TRANSPORTDLG_H
-
-/* client */
-#include "dialogs_g.h"
-
-#endif  /* FC__TRANSPORTDLG_H */
diff --git a/client/gui-gtk-5.0/unitselect.c b/client/gui-gtk-5.0/unitselect.c
deleted file mode 100644
index a5388ee9d3..0000000000
--- a/client/gui-gtk-5.0/unitselect.c
+++ /dev/null
@@ -1,1305 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "fc_types.h"
-#include "game.h"
-#include "player.h"
-#include "unit.h"
-#include "unitlist.h"
-#include "unittype.h"
-
-/* client */
-#include "client_main.h"
-#include "control.h"
-#include "goto.h"
-#include "tilespec.h"
-#include "unitselect_common.h"
-
-/* client/gui-gtk-5.0 */
-#include "graphics.h"
-#include "gui_stuff.h"
-#include "gui_main.h"
-
-#include "unitselect.h"
-
-/* Activate this to get more columns (see below) */
-#undef DEBUG_USDLG
-
-enum usdlg_column_types {
-  COL_PIXBUF,
-  COL_TEXT,
-  COL_INT
-};
-
-enum usdlg_row_types {
-  ROW_UNITTYPE,
-  ROW_ACTIVITY,
-  ROW_UNIT,
-  ROW_UNIT_TRANSPORTED
-};
-
-/* Basic data (Unit, description, count) */
-#define USDLG_COLUMNS_DEFAULT       3
-/* Additional data; shown if DEBUG_USDLG */
-#define USDLG_COL_UTID          USDLG_COLUMNS_DEFAULT + 0 /* Unit type ID */
-#define USDLG_COL_UID           USDLG_COLUMNS_DEFAULT + 1 /* Unit ID */
-#define USDLG_COL_LOCATION      USDLG_COLUMNS_DEFAULT + 2 /* Unit location */
-#define USDLG_COL_ACTIVITY      USDLG_COLUMNS_DEFAULT + 3 /* Unit activity */
-#define USDLG_COL_ROW_TYPE      USDLG_COLUMNS_DEFAULT + 4 /* Row type */
-#define USDLG_COLUMNS_DEBUG     USDLG_COLUMNS_DEFAULT + 5
-/* Layout options; never shown */
-#define USDLG_COL_STYLE         USDLG_COLUMNS_DEBUG + 0
-#define USDLG_COL_WEIGHT        USDLG_COLUMNS_DEBUG + 1
-#define USDLG_COLUMNS_ALL       USDLG_COLUMNS_DEBUG + 2
-
-#ifdef DEBUG_USDLG
-  #define USDLG_COLUMNS_SHOW    USDLG_COLUMNS_DEBUG
-#else
-  #define USDLG_COLUMNS_SHOW    USDLG_COLUMNS_DEFAULT
-#endif /* DEBUG_USDLG */
-
-enum usdlg_column_types usdlg_col_types[USDLG_COLUMNS_ALL] = {
-  COL_PIXBUF, /* Unit */
-  COL_TEXT,   /* Description */
-  COL_INT,    /* Count */
-  COL_INT,    /* Debug: unit type */
-  COL_INT,    /* Debug: unit ID */
-  COL_INT,    /* Debug: location */
-  COL_INT,    /* Debug: activity */
-  COL_INT,    /* Debug: row type */
-  COL_INT,    /* Layout: style */
-  COL_INT     /* Layout: width */
-};
-
-static const char *usdlg_col_titles[USDLG_COLUMNS_ALL] = {
-  N_("Unit"),
-  N_("Description"),
-  N_("Count"),
-  "[Unittype]", /* Only for debug, no translation! */
-  "[Unit ID]",
-  "[Location]",
-  "[Activity]",
-  "[Row type]",
-  "[Style]",
-  "[Width]"
-};
-
-enum usdlg_cmd {
-  USDLG_CMD_SELECT,
-  USDLG_CMD_DESELECT,
-  USDLG_CMD_READY,
-  USDLG_CMD_SENTRY,
-  USDLG_CMD_CENTER,
-  USDLG_CMD_FOCUS,
-  USDLG_CMD_LAST
-};
-
-struct unit_select_dialog {
-  struct tile *ptile;
-  int unit_id_focus;
-
-  GtkWidget *shell;
-  GtkWidget *notebook;
-
-  struct {
-    GtkTreeStore *store;
-    GtkWidget *view;
-    GtkTreePath *path;
-  } units;
-
-  struct {
-    GtkTreeStore *store;
-    GtkWidget *page;
-    GtkWidget *view;
-    GtkTreePath *path;
-
-    GtkWidget *cmd[USDLG_CMD_LAST];
-  } tabs[SELLOC_COUNT];
-};
-
-/* The unit selection dialog; should only be used in usdlg_get(). */
-static struct unit_select_dialog *unit_select_dlg = NULL;
-
-static struct unit_select_dialog *usdlg_get(bool create);
-static struct unit_select_dialog *usdlg_create(void);
-static void usdlg_destroy(void);
-static void usdlg_destroy_callback(GObject *object, gpointer data);
-static void usdlg_tile(struct unit_select_dialog *pdialog,
-                       struct tile *ptile);
-static void usdlg_refresh(struct unit_select_dialog *pdialog);
-
-static void usdlg_tab_select(struct unit_select_dialog *pdialog,
-                             const char *title,
-                             enum unit_select_location_mode loc);
-static GtkTreeStore *usdlg_tab_store_new(void);
-static bool usdlg_tab_update(struct unit_select_dialog *pdialog,
-                             struct usdata_hash *ushash,
-                             enum unit_select_location_mode loc);
-static void usdlg_tab_append_utype(GtkTreeStore *store,
-                                   enum unit_select_location_mode loc,
-                                   const struct unit_type *putype,
-                                   GtkTreeIter *it);
-static void usdlg_tab_append_activity(GtkTreeStore *store,
-                                      enum unit_select_location_mode loc,
-                                      const struct unit_type *putype,
-                                      enum unit_activity act,
-                                      int count, GtkTreeIter *it,
-                                      GtkTreeIter *parent);
-static void usdlg_tab_append_units(struct unit_select_dialog *pdialog,
-                                   enum unit_select_location_mode loc,
-                                   enum unit_activity act,
-                                   const struct unit *punit,
-                                   bool transported, GtkTreeIter *it,
-                                   GtkTreeIter *parent);
-
-static void usdlg_cmd_ready(GObject *object, gpointer data);
-static void usdlg_cmd_sentry(GObject *object, gpointer data);
-static void usdlg_cmd_select(GObject *object, gpointer data);
-static void usdlg_cmd_deselect(GObject *object, gpointer data);
-static void usdlg_cmd_exec(GObject *object, gpointer mode_data,
-                           enum usdlg_cmd cmd);
-static void usdlg_cmd_exec_unit(struct unit *punit, enum usdlg_cmd cmd);
-static void usdlg_cmd_center(GObject *object, gpointer data);
-static void usdlg_cmd_focus(GObject *object, gpointer data);
-static void usdlg_cmd_focus_real(GtkTreeView *view);
-static void usdlg_cmd_row_activated(GtkTreeView *view, GtkTreePath *path,
-                                    GtkTreeViewColumn *col, gpointer data);
-static void usdlg_cmd_cursor_changed(GtkTreeView *view, gpointer data);
-
-
-/*************************************************************************//**
-  Popup the unit selection dialog.
-*****************************************************************************/
-void unit_select_dialog_popup_main(struct tile *ptile, bool create)
-{
-  struct unit_select_dialog *pdialog;
-
-  /* Create the dialog if it is requested. */
-  pdialog = usdlg_get(create);
-
-  /* Present the unit selection dialog if it exists. */
-  if (pdialog) {
-    /* Show all. */
-    gtk_widget_set_visible(GTK_WIDGET(pdialog->shell), TRUE);
-    /* Update tile. */
-    usdlg_tile(pdialog, ptile);
-    /* Refresh data and hide unused tabs. */
-    usdlg_refresh(pdialog);
-  }
-}
-
-/*************************************************************************//**
-  Popdown the unit selection dialog.
-*****************************************************************************/
-void unit_select_dialog_popdown(void)
-{
-  usdlg_destroy();
-}
-
-/*************************************************************************//**
-  Get the current unit selection dialog. Create it if needed and 'create' is
-  TRUE.
-*****************************************************************************/
-static struct unit_select_dialog *usdlg_get(bool create)
-{
-  if (unit_select_dlg) {
-    /* Return existing dialog. */
-    return unit_select_dlg;
-  } else if (create) {
-    /* Create new dialog. */
-    unit_select_dlg = usdlg_create();
-    return unit_select_dlg;
-  } else {
-    /* Nothing. */
-    return NULL;
-  }
-}
-
-/*************************************************************************//**
-  Create a new unit selection dialog.
-*****************************************************************************/
-static struct unit_select_dialog *usdlg_create(void)
-{
-  GtkWidget *vbox;
-  GtkWidget *close_cmd;
-  struct unit_select_dialog *pdialog;
-
-  /* Create a container for the dialog. */
-  pdialog = fc_calloc(1, sizeof(*pdialog));
-
-  /* No tile defined. */
-  pdialog->ptile = NULL;
-
-  /* Create the dialog. */
-  pdialog->shell = gtk_dialog_new();
-  gtk_window_set_title(GTK_WINDOW(pdialog->shell), _("Unit selection"));
-  setup_dialog(pdialog->shell, toplevel);
-  g_signal_connect(pdialog->shell, "destroy",
-                   G_CALLBACK(usdlg_destroy_callback), pdialog);
-  gtk_widget_realize(pdialog->shell);
-
-  vbox = gtk_dialog_get_content_area(GTK_DIALOG(pdialog->shell));
-
-  /* Notebook. */
-  pdialog->notebook = gtk_notebook_new();
-  gtk_notebook_set_tab_pos(GTK_NOTEBOOK(pdialog->notebook),
-                           GTK_POS_BOTTOM);
-  gtk_box_insert_child_after(GTK_BOX(vbox), pdialog->notebook, NULL);
-
-  /* Append pages. */
-  usdlg_tab_select(pdialog, _("_Units"), SELLOC_UNITS);
-  usdlg_tab_select(pdialog, _("_Tile"), SELLOC_TILE);
-  usdlg_tab_select(pdialog, _("C_ontinent"), SELLOC_CONT);
-  usdlg_tab_select(pdialog, _("_Land"), SELLOC_LAND);
-  usdlg_tab_select(pdialog, _("_Sea"), SELLOC_SEA);
-  usdlg_tab_select(pdialog, _("_Both"), SELLOC_BOTH);
-  usdlg_tab_select(pdialog, _("_World"), SELLOC_WORLD);
-
-  /* Buttons. */
-  close_cmd = gtk_dialog_add_button(GTK_DIALOG(pdialog->shell),
-                                    _("_Close"), GTK_RESPONSE_CLOSE);
-  gtk_dialog_set_default_response(GTK_DIALOG(pdialog->shell),
-                                  GTK_RESPONSE_CLOSE);
-  g_signal_connect(close_cmd, "clicked",
-                   G_CALLBACK(usdlg_destroy_callback), pdialog);
-
-  return pdialog;
-}
-
-/*************************************************************************//**
-  Destroy a unit selection dialog.
-*****************************************************************************/
-static void usdlg_destroy(void)
-{
-  if (unit_select_dlg) {
-    gtk_window_destroy(GTK_WINDOW(unit_select_dlg->shell));
-    free(unit_select_dlg);
-  }
-  unit_select_dlg = NULL;
-}
-
-/*************************************************************************//**
-  Callback for the destruction of the dialog.
-*****************************************************************************/
-static void usdlg_destroy_callback(GObject *object, gpointer data)
-{
-  usdlg_destroy();
-}
-
-/*************************************************************************//**
-  Set the reference tile.
-*****************************************************************************/
-static void usdlg_tile(struct unit_select_dialog *pdialog,
-                       struct tile *ptile)
-{
-  if (!pdialog) {
-    return;
-  }
-
-  /* Check for a valid tile. */
-  if (ptile != NULL) {
-    pdialog->ptile = ptile;
-  } else if (pdialog->ptile == NULL) {
-    struct unit *punit = head_of_units_in_focus();
-
-    if (punit) {
-      pdialog->ptile = unit_tile(punit);
-      center_tile_mapcanvas(pdialog->ptile);
-    } else {
-      pdialog->ptile = get_center_tile_mapcanvas();
-    }
-  }
-}
-
-/*************************************************************************//**
-  Refresh the dialog.
-*****************************************************************************/
-static void usdlg_refresh(struct unit_select_dialog *pdialog)
-{
-  struct usdata_hash *ushash = NULL;
-  enum unit_select_location_mode loc;
-
-  if (!pdialog) {
-    return;
-  }
-
-  /* Sort units into the hash. */
-  ushash = usdlg_data_new(pdialog->ptile);
-  /* Update all tabs. */
-  for (loc = unit_select_location_mode_begin();
-       loc != unit_select_location_mode_end();
-       loc = unit_select_location_mode_next(loc)) {
-    bool show = usdlg_tab_update(pdialog, ushash, loc);
-
-    if (!show) {
-      gtk_widget_set_visible(pdialog->tabs[loc].page, FALSE);
-    } else {
-      gtk_widget_set_visible(pdialog->tabs[loc].page, TRUE);
-
-      if (pdialog->tabs[loc].path) {
-        gtk_tree_view_expand_row(GTK_TREE_VIEW(pdialog->tabs[loc].view),
-                                 pdialog->tabs[loc].path,FALSE);
-        gtk_tree_view_set_cursor(GTK_TREE_VIEW(pdialog->tabs[loc].view),
-                                 pdialog->tabs[loc].path, NULL, FALSE);
-        gtk_tree_path_free(pdialog->tabs[loc].path);
-        pdialog->tabs[loc].path = NULL;
-      }
-    }
-  }
-
-  /* Destroy the hash. */
-  usdlg_data_destroy(ushash);
-}
-
-/*************************************************************************//**
-  +--------------------------------+
-  | +-----------------+----------+ |
-  | | (unit list)     | select   | |
-  | |                 | deselect | |
-  | |                 |          | |
-  | |                 | center   | |
-  | |                 | focus    | |
-  | +-----------------+----------+ |
-  | | tabs | ... |                 |
-  |                          close |
-  +--------------------------------+
-*****************************************************************************/
-static void usdlg_tab_select(struct unit_select_dialog *pdialog,
-                             const char *title,
-                             enum unit_select_location_mode loc)
-{
-  GtkWidget *page, *label, *hgrid, *vgrid, *view, *sw;
-  GtkTreeStore *store;
-  static bool titles_done;
-  int i;
-  int page_row = 0;
-  int grid_col = 0;
-  int grid_row = 0;
-
-  page = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(page),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_widget_set_margin_start(page, 8);
-  gtk_widget_set_margin_end(page, 8);
-  gtk_widget_set_margin_top(page, 8);
-  gtk_widget_set_margin_bottom(page, 8);
-  pdialog->tabs[loc].page = page;
-
-  label = gtk_label_new_with_mnemonic(title);
-  gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label);
-
-  hgrid = gtk_grid_new();
-  gtk_grid_attach(GTK_GRID(page), hgrid, 0, page_row++, 1, 1);
-
-  store = usdlg_tab_store_new();
-  pdialog->tabs[loc].store = store;
-
-  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
-  gtk_widget_set_hexpand(view, TRUE);
-  gtk_widget_set_vexpand(view, TRUE);
-  pdialog->tabs[loc].view = view;
-  g_object_unref(store);
-
-  g_signal_connect(view, "row-activated", G_CALLBACK(usdlg_cmd_row_activated),
-                   GINT_TO_POINTER(loc));
-  g_signal_connect(view, "cursor-changed",
-                   G_CALLBACK(usdlg_cmd_cursor_changed), GINT_TO_POINTER(loc));
-
-  /* Translate titles. */
-  intl_slist(ARRAY_SIZE(usdlg_col_titles), usdlg_col_titles, &titles_done);
-
-  for (i = 0; i < USDLG_COLUMNS_SHOW; i++) {
-    GtkTreeViewColumn *column = NULL;
-    GtkCellRenderer *renderer = NULL;
-
-    switch (usdlg_col_types[i]) {
-    case COL_PIXBUF:
-      renderer = gtk_cell_renderer_pixbuf_new();
-      column = gtk_tree_view_column_new_with_attributes(
-                 usdlg_col_titles[i], renderer, "pixbuf", i, NULL);
-      gtk_tree_view_column_set_expand(column, FALSE);
-      break;
-    case COL_TEXT:
-      renderer = gtk_cell_renderer_text_new();
-      column = gtk_tree_view_column_new_with_attributes(
-                 usdlg_col_titles[i], renderer, "text", i,
-                 "style", USDLG_COL_STYLE, "weight", USDLG_COL_WEIGHT, NULL);
-      gtk_tree_view_column_set_expand(column, TRUE);
-      break;
-    case COL_INT:
-      renderer = gtk_cell_renderer_text_new();
-      column = gtk_tree_view_column_new_with_attributes(
-                 usdlg_col_titles[i], renderer, "text", i,
-                 "style", USDLG_COL_STYLE, "weight", USDLG_COL_WEIGHT, NULL);
-      g_object_set(renderer, "xalign", 1.0, NULL);
-      gtk_tree_view_column_set_alignment(column, 1.0);
-      gtk_tree_view_column_set_expand(column, FALSE);
-      break;
-    }
-
-    fc_assert_ret(column != NULL);
-    gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
-  }
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 300);
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
-  gtk_grid_attach(GTK_GRID(hgrid), sw, grid_col++, 0, 1, 1);
-
-  vgrid = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_attach(GTK_GRID(hgrid), vgrid, grid_col++, 0, 1, 1);
-
-  /* button box 1: ready, sentry */
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_READY]
-    = gtk_button_new_with_mnemonic(_("Ready"));
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_READY],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_READY], "clicked",
-                   G_CALLBACK(usdlg_cmd_ready), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_READY]), FALSE);
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]
-    = gtk_button_new_with_mnemonic(_("Sentry"));
-  gtk_widget_set_margin_bottom(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]), 10);
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY], "clicked",
-                   G_CALLBACK(usdlg_cmd_sentry), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]), FALSE);
-
-  /* button box 2: select, deselect */
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]
-    = gtk_button_new_with_mnemonic(_("_Select"));
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_SELECT],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT], "clicked",
-                   G_CALLBACK(usdlg_cmd_select), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]), FALSE);
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]
-    = gtk_button_new_with_mnemonic(_("_Deselect"));
-  gtk_widget_set_margin_bottom(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]), 10);
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT], "clicked",
-                   G_CALLBACK(usdlg_cmd_deselect), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]), FALSE);
-
-  /* button box 3: center, focus */
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]
-    = gtk_button_new_with_mnemonic(_("C_enter"));
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_CENTER],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER], "clicked",
-                   G_CALLBACK(usdlg_cmd_center), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]), FALSE);
-
-  pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]
-    = gtk_button_new_with_mnemonic(_("_Focus"));
-  gtk_grid_attach(GTK_GRID(vgrid),
-                  pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS],
-                  0, grid_row++, 1, 1);
-  g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS], "clicked",
-                   G_CALLBACK(usdlg_cmd_focus), GINT_TO_POINTER(loc));
-  gtk_widget_set_sensitive(
-    GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]), FALSE);
-}
-
-/*************************************************************************//**
-  Create a player dialog store.
-*****************************************************************************/
-static GtkTreeStore *usdlg_tab_store_new(void)
-{
-  GtkTreeStore *store;
-  GType model_types[USDLG_COLUMNS_ALL];
-  int i;
-
-  for (i = 0; i < USDLG_COLUMNS_ALL; i++) {
-    switch (usdlg_col_types[i]) {
-    case COL_PIXBUF:
-      model_types[i] = GDK_TYPE_PIXBUF;
-      break;
-    case COL_TEXT:
-      model_types[i] = G_TYPE_STRING;
-      break;
-    case COL_INT:
-      model_types[i] = G_TYPE_INT;
-      break;
-    }
-  }
-
-  store = gtk_tree_store_newv(i, model_types);
-
-  return store;
-}
-
-/*************************************************************************//**
-  Update on tab of the dialog.
-*****************************************************************************/
-static bool usdlg_tab_update(struct unit_select_dialog *pdialog,
-                             struct usdata_hash *ushash,
-                             enum unit_select_location_mode loc)
-{
-  bool show = FALSE;
-  GtkTreeStore *store;
-
-  fc_assert_ret_val(ushash, FALSE);
-  fc_assert_ret_val(pdialog != NULL, FALSE);
-
-  store = pdialog->tabs[loc].store;
-
-  /* clear current store. */
-  gtk_tree_store_clear(GTK_TREE_STORE(store));
-
-  /* Iterate over all unit types. */
-  if (loc == SELLOC_UNITS) {
-    /* Special case - show all units on this tile in their transports. */
-    unit_type_iterate(utype) {
-      struct usdata *data;
-
-      usdata_hash_lookup(ushash, utype_index(utype), &data);
-
-      if (!data) {
-        continue;
-      }
-
-      activity_type_iterate(act) {
-        if (unit_list_size(data->units[loc][act]) == 0) {
-          continue;
-        }
-
-        unit_list_iterate(data->units[loc][act], punit) {
-          GtkTreeIter it_unit;
-
-          usdlg_tab_append_units(pdialog, loc, act, punit, FALSE,
-                                 &it_unit, NULL);
-        } unit_list_iterate_end;
-
-        /* Show this tab. */
-        show = TRUE;
-      } activity_type_iterate_end;
-    } unit_type_iterate_end;
-  } else {
-    unit_type_iterate(utype) {
-      struct usdata *data;
-      bool first = TRUE;
-      GtkTreeIter it_utype;
-      GtkTreePath *path;
-      int count = 0;
-
-      usdata_hash_lookup(ushash, utype_index(utype), &data);
-
-      if (!data) {
-        continue;
-      }
-
-      activity_type_iterate(act) {
-        GtkTreeIter it_act;
-
-        if (unit_list_size(data->units[loc][act]) == 0) {
-          continue;
-        }
-
-        /* Level 1: Display unit type. */
-        if (first) {
-          usdlg_tab_append_utype(GTK_TREE_STORE(store), loc, data->utype,
-                                 &it_utype);
-          first = FALSE;
-        }
-
-        /* Level 2: Display unit activities. */
-        usdlg_tab_append_activity(GTK_TREE_STORE(store), loc, data->utype,
-                                  act, unit_list_size(data->units[loc][act]),
-                                  &it_act, &it_utype);
-
-        /* Level 3: Display all units with this activity
-         *          (and transported units in further level(s)). */
-        unit_list_iterate(data->units[loc][act], punit) {
-          GtkTreeIter it_unit;
-
-          usdlg_tab_append_units(pdialog, loc, act, punit, FALSE,
-                                 &it_unit, &it_act);
-        } unit_list_iterate_end;
-
-        count += unit_list_size(data->units[loc][act]);
-
-        /* Update sum of units with this type. */
-        gtk_tree_store_set(GTK_TREE_STORE(store), &it_utype, 2, count, -1);
-
-        /* Expand to the activities. */
-        path
-          = gtk_tree_model_get_path(GTK_TREE_MODEL(pdialog->tabs[loc].store),
-                                    &it_utype);
-        gtk_tree_view_expand_row(GTK_TREE_VIEW(pdialog->tabs[loc].view), path,
-                                 FALSE);
-        gtk_tree_path_free(path);
-
-        /* Show this tab. */
-        show = TRUE;
-      } activity_type_iterate_end;
-    } unit_type_iterate_end;
-  }
-
-  return show;
-}
-
-/*************************************************************************//**
-  Append the data for one unit type.
-*****************************************************************************/
-static void usdlg_tab_append_utype(GtkTreeStore *store,
-                                   enum unit_select_location_mode loc,
-                                   const struct unit_type *putype,
-                                   GtkTreeIter *it)
-{
-  GdkPixbuf *pix;
-  char buf[128];
-
-  fc_assert_ret(store != NULL);
-  fc_assert_ret(putype != NULL);
-
-  /* Add this item. */
-  gtk_tree_store_append(GTK_TREE_STORE(store), it, NULL);
-
-  /* Create a icon */
-  {
-    struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
-
-    canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-        tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
-
-    put_unittype(putype, &canvas_store, 1.0, 0, 0);
-    pix = surface_get_pixbuf(canvas_store.surface, tileset_full_tile_width(tileset),
-        tileset_full_tile_height(tileset));
-    cairo_surface_destroy(canvas_store.surface);
-  }
-
-  /* The name of the unit. */
-  fc_snprintf(buf, sizeof(buf), "%s", utype_name_translation(putype));
-
-  /* Add it to the tree. */
-  gtk_tree_store_set(GTK_TREE_STORE(store), it,
-                     0, pix,                            /* Unit pixmap */
-                     1, buf,                            /* Text */
-                     2, -1, /* will be set later */     /* Number of units */
-                     3, utype_index(putype),            /* Unit type ID */
-                     /* 4: not set */                   /* Unit ID */
-                     5, loc,                            /* Unit location */
-                     /* 6: not set */                   /* Unit activity */
-                     7, ROW_UNITTYPE,                   /* Row type */
-                     8, PANGO_STYLE_NORMAL,             /* Style */
-                     9, PANGO_WEIGHT_BOLD,              /* Weight */
-                     -1);
-  g_object_unref(pix);
-}
-
-/*************************************************************************//**
-  Append the unit activity.
-*****************************************************************************/
-static void usdlg_tab_append_activity(GtkTreeStore *store,
-                                      enum unit_select_location_mode loc,
-                                      const struct unit_type *putype,
-                                      enum unit_activity act,
-                                      int count, GtkTreeIter *it,
-                                      GtkTreeIter *parent)
-{
-  char buf[128] = "";
-
-  fc_assert_ret(store != NULL);
-  fc_assert_ret(putype != NULL);
-
-  /* Add this item. */
-  gtk_tree_store_append(GTK_TREE_STORE(store), it, parent);
-
-  /* The activity. */
-  fc_snprintf(buf, sizeof(buf), "%s", get_activity_text(act));
-
-  /* Add it to the tree. */
-  gtk_tree_store_set(GTK_TREE_STORE(store), it,
-                     /* 0: not set */                   /* Unit pixmap */
-                     1, buf,                            /* Text */
-                     2, count,                          /* Number of units */
-                     3, utype_index(putype),            /* Unit type ID */
-                     /* 4: not set */                   /* Unit ID */
-                     5, loc,                            /* Unit location */
-                     6, act,                            /* Unit activity */
-                     7, ROW_ACTIVITY,                   /* Row type */
-                     8, PANGO_STYLE_NORMAL,             /* Style */
-                     9, PANGO_WEIGHT_NORMAL,            /* Weight */
-                     -1);
-}
-
-/*************************************************************************//**
-  Get an unit selection list item suitable image of the specified unit.
-
-  Caller is responsible for getting rid of the returned image after use.
-*****************************************************************************/
-GdkPixbuf *usdlg_get_unit_image(const struct unit *punit)
-{
-  GdkPixbuf *out;
-  struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
-
-  canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-      tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
-
-  put_unit(punit, &canvas_store, 1.0, 0, 0);
-  out = surface_get_pixbuf(canvas_store.surface,
-                           tileset_full_tile_width(tileset),
-                           tileset_full_tile_height(tileset));
-  cairo_surface_destroy(canvas_store.surface);
-
-  return out;
-}
-
-/*************************************************************************//**
-  Get an unit selection list item suitable description of the specified
-  unit.
-*****************************************************************************/
-const char *usdlg_get_unit_descr(const struct unit *punit)
-{
-  static char buf[248] = "";
-  char buf2[248] = "";
-  struct city *phome;
-
-  phome = game_city_by_number(punit->homecity);
-  if (phome) {
-    fc_snprintf(buf2, sizeof(buf2), "%s", city_name_get(phome));
-  } else if (unit_owner(punit) == client_player()
-             || client_is_global_observer()) {
-    /* TRANS: used in place of unit home city name */
-    sz_strlcpy(buf2, _("no home city"));
-  } else {
-    /* TRANS: used in place of unit home city name */
-    sz_strlcpy(buf2, _("unknown"));
-  }
-#ifdef FREECIV_DEBUG
-  /* Strings only used in debug builds, don't bother with i18n */
-  fc_snprintf(buf, sizeof(buf), "%s [Unit ID %d]\n(%s)\nCoordinates: (%d,%d)",
-              unit_name_translation(punit), punit->id, buf2,
-              TILE_XY(unit_tile(punit)));
-  {
-    struct unit *ptrans = unit_transport_get(punit);
-
-    if (ptrans) {
-      cat_snprintf(buf, sizeof(buf), "\nTransported by unit ID %d",
-                   ptrans->id);
-    }
-  }
-#else /* FREECIV_DEBUG */
-  /* TRANS: unit type and home city, e.g. "Transport\n(New Orleans)" */
-  fc_snprintf(buf, sizeof(buf), _("%s\n(%s)"), unit_name_translation(punit),
-              buf2);
-#endif /* FREECIV_DEBUG */
-
-  return buf;
-}
-
-/*************************************************************************//**
-  Append units (recursively).
-*****************************************************************************/
-static void usdlg_tab_append_units(struct unit_select_dialog *pdialog,
-                                   enum unit_select_location_mode loc,
-                                   enum unit_activity act,
-                                   const struct unit *punit,
-                                   bool transported, GtkTreeIter *it,
-                                   GtkTreeIter *parent)
-{
-  const char *text;
-  GdkPixbuf *pix;
-  enum usdlg_row_types row = ROW_UNIT;
-  int style = PANGO_STYLE_NORMAL;
-  int weight = PANGO_WEIGHT_NORMAL;
-  GtkTreeStore *store;
-
-  fc_assert_ret(pdialog != NULL);
-  fc_assert_ret(punit != NULL);
-
-  store = pdialog->tabs[loc].store;
-
-
-  /* Add this item. */
-  gtk_tree_store_append(GTK_TREE_STORE(store), it, parent);
-
-  /* Unit gfx */
-  pix = usdlg_get_unit_image(punit);
-
-  text = usdlg_get_unit_descr(punit);
-
-  if (transported) {
-    weight = PANGO_WEIGHT_NORMAL;
-    style = PANGO_STYLE_ITALIC;
-    row = ROW_UNIT_TRANSPORTED;
-  }
-
-  /* Add it to the tree. */
-  gtk_tree_store_set(GTK_TREE_STORE(store), it,
-                     0, pix,                            /* Unit pixmap */
-                     1, text,                           /* Text */
-                     2, 1,                              /* Number of units */
-                     3, utype_index(unit_type_get(punit)), /* Unit type ID */
-                     4, punit->id,                      /* Unit ID */
-                     5, loc,                            /* Unit location */
-                     6, act,                            /* Unit activity */
-                     7, row,                            /* Row type */
-                     8, style,                          /* Style */
-                     9, weight,                         /* Weight */
-                     -1);
-  g_object_unref(pix);
-
-  if (get_transporter_occupancy(punit) > 0) {
-    unit_list_iterate(unit_transport_cargo(punit), pcargo) {
-      GtkTreeIter it_cargo;
-
-      usdlg_tab_append_units(pdialog, loc, act, pcargo, TRUE, &it_cargo, it);
-    } unit_list_iterate_end;
-  }
-
-  if (!transported && unit_is_in_focus(punit)
-      && get_num_units_in_focus() == 1) {
-    /* Put the keyboard focus on the selected unit. It isn't transported.
-     * Selection maps to keyboard focus since it alone is selected. */
-    fc_assert_action(pdialog->tabs[loc].path == NULL,
-                     /* Don't leak memory. */
-                     gtk_tree_path_free(pdialog->tabs[loc].path));
-
-    pdialog->tabs[loc].path
-      = gtk_tree_model_get_path(GTK_TREE_MODEL(store), it);
-  }
-}
-
-/*************************************************************************//**
-  Callback for the ready button.
-*****************************************************************************/
-static void usdlg_cmd_ready(GObject *object, gpointer data)
-{
-  usdlg_cmd_exec(object, data, USDLG_CMD_READY);
-}
-
-/*************************************************************************//**
-  Callback for the sentry button.
-*****************************************************************************/
-static void usdlg_cmd_sentry(GObject *object, gpointer data)
-{
-  usdlg_cmd_exec(object, data, USDLG_CMD_SENTRY);
-}
-
-/*************************************************************************//**
-  Callback for the select button.
-*****************************************************************************/
-static void usdlg_cmd_select(GObject *object, gpointer data)
-{
-  usdlg_cmd_exec(object, data, USDLG_CMD_SELECT);
-}
-
-/*************************************************************************//**
-  Callback for the deselect button.
-*****************************************************************************/
-static void usdlg_cmd_deselect(GObject *object, gpointer data)
-{
-  usdlg_cmd_exec(object, data, USDLG_CMD_DESELECT);
-}
-
-/*************************************************************************//**
-  Main function for the callbacks.
-*****************************************************************************/
-static void usdlg_cmd_exec(GObject *object, gpointer mode_data,
-                           enum usdlg_cmd cmd)
-{
-  enum unit_select_location_mode loc_mode
-    = (enum unit_select_location_mode) GPOINTER_TO_INT(mode_data);
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  gint row;
-  struct unit_select_dialog *pdialog = usdlg_get(FALSE);
-
-  fc_assert_ret(pdialog != NULL);
-  fc_assert_ret(unit_select_location_mode_is_valid(loc_mode));
-
-  if (!can_client_change_view() || !can_client_control()) {
-    return;
-  }
-
-  view = GTK_TREE_VIEW(pdialog->tabs[loc_mode].view);
-  selection = gtk_tree_view_get_selection(view);
-
-  if (!gtk_tree_selection_get_selected(selection, &model, &it)) {
-    log_debug("No selection");
-    return;
-  }
-  gtk_tree_model_get(model, &it, USDLG_COL_ROW_TYPE, &row, -1);
-
-  switch (row) {
-  case ROW_UNITTYPE:
-    {
-      gint loc, utid;
-      struct usdata_hash *ushash;
-      struct usdata *data;
-
-      gtk_tree_model_get(model, &it, USDLG_COL_LOCATION, &loc,
-                         USDLG_COL_UTID, &utid, -1);
-
-      /* We can't be sure that all units still exists - recalc the data. */
-      ushash = usdlg_data_new(pdialog->ptile);
-
-      usdata_hash_lookup(ushash, utid, &data);
-      if (data != NULL) {
-        activity_type_iterate(act) {
-          if (unit_list_size(data->units[loc][act]) == 0) {
-            continue;
-          }
-
-          unit_list_iterate(data->units[loc][act], punit) {
-            usdlg_cmd_exec_unit(punit, cmd);
-          } unit_list_iterate_end;
-        } activity_type_iterate_end;
-      }
-
-      /* Destroy the hash. */
-      usdlg_data_destroy(ushash);
-    }
-    break;
-  case ROW_ACTIVITY:
-    {
-      gint loc, act, utid;
-      struct usdata_hash *ushash;
-      struct usdata *data;
-
-      gtk_tree_model_get(model, &it, USDLG_COL_ACTIVITY, &act,
-                         USDLG_COL_LOCATION, &loc, USDLG_COL_UTID, &utid, -1);
-
-      /* We can't be sure that all units still exists - recalc the data. */
-      ushash = usdlg_data_new(pdialog->ptile);
-
-      usdata_hash_lookup(ushash, utid, &data);
-      if (data != NULL
-          && unit_list_size(data->units[loc][act]) != 0) {
-        unit_list_iterate(data->units[loc][act], punit) {
-          usdlg_cmd_exec_unit(punit, cmd);
-        } unit_list_iterate_end;
-      }
-
-      /* Destroy the hash. */
-      usdlg_data_destroy(ushash);
-    }
-    break;
-  case ROW_UNIT:
-  case ROW_UNIT_TRANSPORTED:
-    {
-      gint uid;
-      struct unit *punit;
-
-      gtk_tree_model_get(model, &it, USDLG_COL_UID, &uid, -1);
-
-      punit = game_unit_by_number(uid);
-
-      if (!punit) {
-        log_debug("Unit vanished (Unit ID %d)!", uid);
-        return;
-      }
-
-      usdlg_cmd_exec_unit(punit, cmd);
-    }
-    break;
-  }
-
-  /* Update focus. */
-  unit_focus_update();
-  /* Refresh dialog. */
-  usdlg_refresh(pdialog);
-}
-
-/*************************************************************************//**
-  Update one unit (select/deselect/ready/sentry).
-*****************************************************************************/
-static void usdlg_cmd_exec_unit(struct unit *punit, enum usdlg_cmd cmd)
-{
-  fc_assert_ret(punit);
-
-  switch (cmd) {
-  case USDLG_CMD_SELECT:
-    if (!unit_is_in_focus(punit)) {
-      unit_focus_add(punit);
-    }
-  break;
-  case USDLG_CMD_DESELECT:
-    if (unit_is_in_focus(punit)) {
-      unit_focus_remove(punit);
-    }
-    break;
-  case USDLG_CMD_READY:
-    if (punit->activity != ACTIVITY_IDLE) {
-      request_new_unit_activity(punit, ACTIVITY_IDLE);
-    }
-    break;
-  case USDLG_CMD_SENTRY:
-    if (punit->activity != ACTIVITY_SENTRY) {
-      request_new_unit_activity(punit, ACTIVITY_SENTRY);
-    }
-    break;
-  case USDLG_CMD_CENTER:
-  case USDLG_CMD_FOCUS:
-    /* Nothing here. It is done in its own functions. */
-    break;
-  case USDLG_CMD_LAST:
-    /* Should never happen. */
-    fc_assert_ret(cmd != USDLG_CMD_LAST);
-    break;
-  }
-}
-
-/*************************************************************************//**
-  Callback for the center button.
-*****************************************************************************/
-static void usdlg_cmd_center(GObject *object, gpointer data)
-{
-  enum unit_select_location_mode loc
-    = (enum unit_select_location_mode) GPOINTER_TO_INT(data);
-  GtkTreeView *view;
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  gint row;
-  struct unit_select_dialog *pdialog = usdlg_get(FALSE);
-
-  fc_assert_ret(pdialog != NULL);
-  fc_assert_ret(unit_select_location_mode_is_valid(loc));
-
-  view = GTK_TREE_VIEW(pdialog->tabs[loc].view);
-  selection = gtk_tree_view_get_selection(view);
-
-  if (!gtk_tree_selection_get_selected(selection, &model, &it)) {
-    log_debug("No selection");
-    return;
-  }
-  gtk_tree_model_get(model, &it, USDLG_COL_ROW_TYPE, &row, -1);
-
-  if (row == ROW_UNIT || row == ROW_UNIT_TRANSPORTED) {
-    gint uid;
-    struct unit *punit;
-
-    gtk_tree_model_get(model, &it, USDLG_COL_UID, &uid, -1);
-
-    punit = player_unit_by_number(client_player(), uid);
-    if (punit) {
-      center_tile_mapcanvas(unit_tile(punit));
-    }
-  }
-}
-
-/*************************************************************************//**
-  Callback for the focus button.
-*****************************************************************************/
-static void usdlg_cmd_focus(GObject *object, gpointer data)
-{
-  enum unit_select_location_mode loc
-    = (enum unit_select_location_mode) GPOINTER_TO_INT(data);
-  struct unit_select_dialog *pdialog = usdlg_get(FALSE);
-
-  fc_assert_ret(pdialog != NULL);
-  fc_assert_ret(unit_select_location_mode_is_valid(loc));
-
-  usdlg_cmd_focus_real(GTK_TREE_VIEW(pdialog->tabs[loc].view));
-}
-
-/*************************************************************************//**
-  Callback if a row is activated.
-*****************************************************************************/
-static void usdlg_cmd_row_activated(GtkTreeView *view, GtkTreePath *path,
-                                    GtkTreeViewColumn *col, gpointer data)
-{
-  usdlg_cmd_focus_real(view);
-}
-
-/*************************************************************************//**
-  Focus to the currently selected unit.
-*****************************************************************************/
-static void usdlg_cmd_focus_real(GtkTreeView *view)
-{
-  GtkTreeSelection *selection = gtk_tree_view_get_selection(view);
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  gint row;
-
-  if (!can_client_change_view() || !can_client_control()) {
-    return;
-  }
-
-  if (!gtk_tree_selection_get_selected(selection, &model, &it)) {
-    log_debug("No selection");
-    return;
-  }
-  gtk_tree_model_get(model, &it, USDLG_COL_ROW_TYPE, &row, -1);
-
-  if (row == ROW_UNIT || row == ROW_UNIT_TRANSPORTED) {
-    gint uid;
-    struct unit *punit;
-
-    gtk_tree_model_get(model, &it, USDLG_COL_UID, &uid, -1);
-
-    punit = player_unit_by_number(client_player(), uid);
-    if (punit && unit_owner(punit) == client_player()) {
-      unit_focus_set(punit);
-      usdlg_destroy();
-    }
-  }
-}
-
-/*************************************************************************//**
-  Callback if the row is changed.
-*****************************************************************************/
-static void usdlg_cmd_cursor_changed(GtkTreeView *view, gpointer data)
-{
-  enum unit_select_location_mode loc
-    = (enum unit_select_location_mode) GPOINTER_TO_INT(data);
-  GtkTreeSelection *selection;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  gint row, uid;
-  struct unit_select_dialog *pdialog = usdlg_get(FALSE);
-  struct unit *punit;
-  bool cmd_status[USDLG_CMD_LAST];
-  int cmd_id;
-
-  fc_assert_ret(unit_select_location_mode_is_valid(loc));
-
-  if (pdialog == NULL) {
-    /* Dialog closed, nothing we can do */
-    return;
-  }
-
-  selection = gtk_tree_view_get_selection(view);
-  if (!gtk_tree_selection_get_selected(selection, &model, &it)) {
-    log_debug("No selection");
-    return;
-  }
-  gtk_tree_model_get(model, &it, USDLG_COL_ROW_TYPE, &row, USDLG_COL_UID,
-                     &uid, -1);
-
-  switch (row) {
-  case ROW_UNITTYPE:
-  case ROW_ACTIVITY:
-    /* Button status for rows unittype and activity:
-     *             player    observer
-     * ready        TRUE      FALSE
-     * sentry       TRUE      FALSE
-     * select       TRUE      FALSE
-     * deselect     TRUE      FALSE
-     * center       FALSE     FALSE
-     * focus        FALSE     FALSE */
-    if (can_client_change_view() && can_client_control()) {
-      cmd_status[USDLG_CMD_READY] = TRUE;
-      cmd_status[USDLG_CMD_SENTRY] = TRUE;
-      cmd_status[USDLG_CMD_SELECT] = TRUE;
-      cmd_status[USDLG_CMD_DESELECT] = TRUE;
-    } else {
-      cmd_status[USDLG_CMD_READY] = FALSE;
-      cmd_status[USDLG_CMD_SENTRY] = FALSE;
-      cmd_status[USDLG_CMD_SELECT] = FALSE;
-      cmd_status[USDLG_CMD_DESELECT] = FALSE;
-    }
-
-    cmd_status[USDLG_CMD_CENTER] = FALSE;
-    cmd_status[USDLG_CMD_FOCUS] = FALSE;
-    break;
-  case ROW_UNIT:
-  case ROW_UNIT_TRANSPORTED:
-    /* Button status for rows unit and unit (transported):
-     *             player    observer
-     * ready        !IDLE     FALSE
-     * sentry       !SENTRY   FALSE
-     * select       !FOCUS    FALSE
-     * deselect     FOCUS     FALSE
-     * center       TRUE      TRUE
-     * focus        !FOCUS    FALSE */
-    punit = player_unit_by_number(client_player(), uid);
-
-    if (punit && can_client_change_view() && can_client_control()) {
-      if (punit->activity == ACTIVITY_IDLE) {
-        cmd_status[USDLG_CMD_READY] = FALSE;
-      } else {
-        cmd_status[USDLG_CMD_READY] = TRUE;
-      }
-
-      if (punit->activity == ACTIVITY_SENTRY) {
-        cmd_status[USDLG_CMD_SENTRY] = FALSE;
-      } else {
-        cmd_status[USDLG_CMD_SENTRY] = TRUE;
-      }
-
-      if (!unit_is_in_focus(punit)) {
-        cmd_status[USDLG_CMD_SELECT] = TRUE;
-        cmd_status[USDLG_CMD_DESELECT] = FALSE;
-        cmd_status[USDLG_CMD_FOCUS] = TRUE;
-      } else {
-        cmd_status[USDLG_CMD_SELECT] = FALSE;
-        cmd_status[USDLG_CMD_DESELECT] = TRUE;
-        cmd_status[USDLG_CMD_FOCUS] = FALSE;
-      }
-    } else {
-      cmd_status[USDLG_CMD_READY] = FALSE;
-      cmd_status[USDLG_CMD_SENTRY] = FALSE;
-
-      cmd_status[USDLG_CMD_SELECT] = FALSE;
-      cmd_status[USDLG_CMD_DESELECT] = FALSE;
-
-      cmd_status[USDLG_CMD_FOCUS] = FALSE;
-    }
-
-    cmd_status[USDLG_CMD_CENTER] = TRUE;
-    break;
-
-  default:
-    fc_assert(FALSE);
-    for (cmd_id = 0; cmd_id < USDLG_CMD_LAST; cmd_id++) {
-      cmd_status[cmd_id] = FALSE;
-    }
-    break;
-  }
-
-  /* Set widget status. */
-  for (cmd_id = 0; cmd_id < USDLG_CMD_LAST; cmd_id++) {
-    gtk_widget_set_sensitive(GTK_WIDGET(pdialog->tabs[loc].cmd[cmd_id]),
-                             cmd_status[cmd_id]);
-  }
-}
diff --git a/client/gui-gtk-5.0/unitselect.h b/client/gui-gtk-5.0/unitselect.h
deleted file mode 100644
index 069d2b1bc7..0000000000
--- a/client/gui-gtk-5.0/unitselect.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-*****************************************************************************/
-#ifndef FC__UNITSELECT_H
-#define FC__UNITSELECT_H
-
-#include <gtk/gtk.h>
-
-struct tile;
-
-void unit_select_dialog_popup_main(struct tile *ptile, bool create);
-
-void unit_select_dialog_popdown(void);
-
-GdkPixbuf *usdlg_get_unit_image(const struct unit *punit);
-const char *usdlg_get_unit_descr(const struct unit *punit);
-
-#endif  /* FC__UNITSELECT_H */
diff --git a/client/gui-gtk-5.0/unitselextradlg.c b/client/gui-gtk-5.0/unitselextradlg.c
deleted file mode 100644
index 59118c4dbe..0000000000
--- a/client/gui-gtk-5.0/unitselextradlg.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "extras.h"
-#include "game.h"
-#include "movement.h"
-#include "nation.h"
-#include "unit.h"
-
-/* client */
-#include "control.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "sprite.h"
-
-#include "unitselextradlg.h"
-
-struct unit_sel_extra_cb_data {
-  GtkWidget *dlg;
-  int tp_id;
-};
-
-/***********************************************************************//**
-  Get an extra selection list item suitable description of the specified
-  extra at the specified tile.
-***************************************************************************/
-static const char *tgt_extra_descr(const struct extra_type *tgt_extra,
-                                   const struct tile *tgt_tile)
-{
-  static char buf[248] = "";
-  static char buf2[248] = "";
-
-  if (tile_has_extra(tgt_tile, tgt_extra)) {
-    if (extra_owner(tgt_tile)) {
-      /* TRANS: nation adjective for extra owner used below if the target
-       * tile has the target extra and it has an owner. */
-      fc_snprintf(buf2, sizeof(buf2), Q_("?eowner:%s"),
-                  nation_adjective_for_player(extra_owner(tgt_tile)));
-    } else {
-      /* TRANS: used below if the target tile has the target extra but it
-       * doesn't have an owner. */
-      sz_strlcpy(buf2, _("target"));
-    }
-  } else {
-    /* TRANS: used below if the target tile doesn't have the target
-     * extra (so it is assumed that it will be created). */
-    sz_strlcpy(buf2, _("create"));
-  }
-
-  /* TRANS: extra name ... one of the above strings depending on if the
-   * target extra currently exists at the target tile and if it has an
-   * owner. */
-  fc_snprintf(buf, sizeof(buf), _("%s\n(%s)"),
-              extra_name_translation(tgt_extra), buf2);
-
-  return buf;
-}
-
-/************************************************************************//**
-  Callback to handle toggling of one of the target extra buttons.
-****************************************************************************/
-static void unit_sel_extra_toggled(GtkToggleButton *tb, gpointer userdata)
-{
-  struct unit_sel_extra_cb_data *cbdata
-          = (struct unit_sel_extra_cb_data *)userdata;
-
-  if (gtk_toggle_button_get_active(tb)) {
-    g_object_set_data(G_OBJECT(cbdata->dlg), "target",
-                      GINT_TO_POINTER(cbdata->tp_id));
-  }
-}
-
-/************************************************************************//**
-  Callback to handle destruction of one of the target extra buttons.
-****************************************************************************/
-static void unit_sel_extra_destroyed(GtkWidget *radio, gpointer userdata)
-{
-  free(userdata);
-}
-
-/************************************************************************//**
-  Create a dialog where a unit select what extra to act on.
-****************************************************************************/
-bool select_tgt_extra(struct unit *actor, struct tile *ptile,
-                      bv_extras potential_tgt_extras,
-                      struct extra_type *suggested_tgt_extra,
-                      const gchar *dlg_title,
-                      const gchar *actor_label,
-                      const gchar *tgt_label,
-                      const gchar *do_label,
-                      GCallback do_callback)
-{
-  GtkWidget *dlg;
-  GtkWidget *main_box;
-  GtkWidget *box, *grid;
-  GtkWidget *icon;
-  GtkWidget *lbl;
-  GtkWidget *sep;
-  GtkWidget *radio;
-  GtkWidget *default_option = NULL;
-  GtkWidget *first_option = NULL;
-  struct sprite *spr;
-  const struct unit_type *actor_type = unit_type_get(actor);
-  int tcount;
-  const struct extra_type *default_extra = NULL;
-  int tuw = tileset_unit_width(tileset);
-  int tuh = tileset_unit_height(tileset);
-  int tew = tileset_tile_width(tileset);
-  int teh = tileset_tile_height(tileset);
-
-  dlg = gtk_dialog_new_with_buttons(dlg_title, NULL, 0,
-                                    _("Close"), GTK_RESPONSE_NO,
-                                    do_label, GTK_RESPONSE_YES,
-                                    NULL);
-  setup_dialog(dlg, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_NO);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dlg), TRUE);
-
-  main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-
-  lbl = gtk_label_new(actor_label);
-  gtk_box_append(GTK_BOX(box), lbl);
-
-  spr = get_unittype_sprite(tileset, actor_type,
-                            actor->activity, direction8_invalid());
-  if (spr != NULL) {
-    icon = gtk_image_new_from_pixbuf(sprite_get_pixbuf(spr));
-  } else {
-    icon = gtk_image_new();
-  }
-  gtk_widget_set_size_request(icon, tuw, tuh);
-  gtk_box_append(GTK_BOX(box), icon);
-
-  lbl = gtk_label_new(utype_name_translation(actor_type));
-  gtk_box_append(GTK_BOX(box), lbl);
-
-  gtk_box_append(GTK_BOX(main_box), box);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_append(GTK_BOX(main_box), sep);
-
-  lbl = gtk_label_new(tgt_label);
-  gtk_box_append(GTK_BOX(main_box), lbl);
-
-  grid = gtk_grid_new();
-
-  tcount = 0;
-  extra_type_re_active_iterate(ptgt) {
-    GdkPixbuf *tubuf;
-
-    if (!BV_ISSET(potential_tgt_extras, extra_number(ptgt))) {
-      continue;
-    }
-
-    struct unit_sel_extra_cb_data *cbdata
-            = fc_malloc(sizeof(struct unit_sel_extra_cb_data));
-
-    cbdata->tp_id = ptgt->id;
-    cbdata->dlg = dlg;
-
-    radio = gtk_check_button_new();
-    gtk_check_button_set_group(GTK_CHECK_BUTTON(radio),
-                               GTK_CHECK_BUTTON(first_option));
-    if (first_option == NULL) {
-      first_option = radio;
-      default_option = first_option;
-      default_extra = ptgt;
-    }
-    g_signal_connect(radio, "toggled",
-                     G_CALLBACK(unit_sel_extra_toggled), cbdata);
-    g_signal_connect(radio, "destroy",
-                     G_CALLBACK(unit_sel_extra_destroyed), cbdata);
-    if (ptgt == suggested_tgt_extra) {
-      default_option = radio;
-      default_extra = suggested_tgt_extra;
-    }
-    gtk_grid_attach(GTK_GRID(grid), radio, 0, tcount, 1, 1);
-
-    tubuf = create_extra_pixbuf(ptgt);
-    if (tubuf != NULL) {
-      icon = gtk_image_new_from_pixbuf(tubuf);
-      g_object_unref(tubuf);
-    } else {
-      icon = gtk_image_new();
-    }
-    gtk_widget_set_size_request(icon, tew, teh);
-    gtk_grid_attach(GTK_GRID(grid), icon, 1, tcount, 1, 1);
-
-    lbl = gtk_label_new(tgt_extra_descr(ptgt, ptile));
-    gtk_grid_attach(GTK_GRID(grid), lbl, 2, tcount, 1, 1);
-
-    tcount++;
-  } extra_type_re_active_iterate_end;
-  gtk_box_append(GTK_BOX(main_box), grid);
-
-  fc_assert_ret_val(default_option, FALSE);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(default_option), TRUE);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dlg))),
-                 main_box);
-
-  g_object_set_data(G_OBJECT(dlg), "actor", GINT_TO_POINTER(actor->id));
-  g_object_set_data(G_OBJECT(dlg), "tile", ptile);
-
-  /* This function should never be called so that there would be no extra
-   * to select, and where there is extra to select, one of them gets
-   * selected as the default. */
-  fc_assert(default_extra != nullptr);
-  if (default_extra != nullptr) { /* Compiler still wants this */
-    g_object_set_data(G_OBJECT(dlg), "target",
-                      GINT_TO_POINTER(default_extra->id));
-  }
-
-  g_signal_connect(dlg, "response", do_callback, actor);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(dlg)), TRUE);
-  gtk_widget_set_visible(dlg, TRUE);
-
-  return TRUE;
-}
diff --git a/client/gui-gtk-5.0/unitselextradlg.h b/client/gui-gtk-5.0/unitselextradlg.h
deleted file mode 100644
index 790eeca39a..0000000000
--- a/client/gui-gtk-5.0/unitselextradlg.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2018 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__UNITSELEXTRADLG_H
-#define FC__UNITSELEXTRADLG_H
-
-bool select_tgt_extra(struct unit *actor, struct tile *ptile,
-                      bv_extras potential_tgt_extras,
-                      struct extra_type *suggested_tgt_extra,
-                      const gchar *dlg_title,
-                      const gchar *actor_label,
-                      const gchar *tgt_label,
-                      const gchar *do_label,
-                      GCallback do_callback);
-
-#endif  /* FC__UNITSELEXTRADLG_H */
diff --git a/client/gui-gtk-5.0/unitselunitdlg.c b/client/gui-gtk-5.0/unitselunitdlg.c
deleted file mode 100644
index 04bb457509..0000000000
--- a/client/gui-gtk-5.0/unitselunitdlg.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-
-/* common */
-#include "game.h"
-#include "movement.h"
-#include "unit.h"
-
-/* client */
-#include "control.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "sprite.h"
-#include "unitselect.h"
-
-#include "unitselunitdlg.h"
-
-struct unit_sel_unit_cb_data {
-  GtkWidget *dlg;
-  int tp_id;
-};
-
-/************************************************************************//**
-  Callback to handle toggling of one of the target unit buttons.
-****************************************************************************/
-static void unit_sel_unit_toggled(GtkToggleButton *tb, gpointer userdata)
-{
-  struct unit_sel_unit_cb_data *cbdata
-          = (struct unit_sel_unit_cb_data *)userdata;
-
-  if (gtk_toggle_button_get_active(tb)) {
-    g_object_set_data(G_OBJECT(cbdata->dlg), "target",
-                      GINT_TO_POINTER(cbdata->tp_id));
-  }
-}
-
-/************************************************************************//**
-  Callback to handle destruction of one of the target unit buttons.
-****************************************************************************/
-static void unit_sel_unit_destroyed(GtkWidget *radio, gpointer userdata)
-{
-  free(userdata);
-}
-
-/************************************************************************//**
-  Create a dialog where a unit select what other unit to act on.
-****************************************************************************/
-bool select_tgt_unit(struct unit *actor, struct tile *ptile,
-                     struct unit_list *potential_tgt_units,
-                     struct unit *suggested_tgt_unit,
-                     const gchar *dlg_title,
-                     const gchar *actor_label,
-                     const gchar *tgt_label,
-                     const gchar *do_label,
-                     GCallback do_callback)
-{
-  GtkWidget *dlg;
-  GtkWidget *main_box;
-  GtkWidget *box, *grid;
-  GtkWidget *icon;
-  GtkWidget *lbl;
-  GtkWidget *sep;
-  GtkWidget *radio;
-  GtkWidget *default_option = NULL;
-  GtkWidget *first_option = NULL;
-  struct sprite *spr;
-  const struct unit_type *actor_type = unit_type_get(actor);
-  int tcount;
-  const struct unit *default_unit = NULL;
-  int tuw = tileset_unit_width(tileset);
-  int tuh = tileset_unit_height(tileset);
-
-  dlg = gtk_dialog_new_with_buttons(dlg_title, NULL, 0,
-                                    _("Close"), GTK_RESPONSE_NO,
-                                    do_label, GTK_RESPONSE_YES,
-                                    NULL);
-  setup_dialog(dlg, toplevel);
-  gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_NO);
-  gtk_window_set_destroy_with_parent(GTK_WINDOW(dlg), TRUE);
-
-  main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-
-  lbl = gtk_label_new(actor_label);
-  gtk_box_append(GTK_BOX(box), lbl);
-
-  spr = get_unittype_sprite(tileset, actor_type,
-                            actor->activity, direction8_invalid());
-  if (spr != NULL) {
-    icon = gtk_image_new_from_pixbuf(sprite_get_pixbuf(spr));
-  } else {
-    icon = gtk_image_new();
-  }
-  gtk_widget_set_size_request(icon, tuw, tuh);
-  gtk_box_append(GTK_BOX(box), icon);
-
-  lbl = gtk_label_new(utype_name_translation(actor_type));
-  gtk_box_append(GTK_BOX(box), lbl);
-
-  gtk_box_append(GTK_BOX(main_box), box);
-
-  sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_append(GTK_BOX(main_box), sep);
-
-  lbl = gtk_label_new(tgt_label);
-  gtk_box_append(GTK_BOX(main_box), lbl);
-
-  grid = gtk_grid_new();
-
-  tcount = 0;
-  unit_list_iterate(potential_tgt_units, ptgt) {
-    GdkPixbuf *tubuf;
-
-    struct unit_sel_unit_cb_data *cbdata
-            = fc_malloc(sizeof(struct unit_sel_unit_cb_data));
-
-    cbdata->tp_id = ptgt->id;
-    cbdata->dlg = dlg;
-
-    radio = gtk_check_button_new();
-    gtk_check_button_set_group(GTK_CHECK_BUTTON(radio),
-                               GTK_CHECK_BUTTON(first_option));
-    if (first_option == NULL) {
-      first_option = radio;
-      default_option = first_option;
-      default_unit = ptgt;
-    }
-    g_signal_connect(radio, "toggled",
-                     G_CALLBACK(unit_sel_unit_toggled), cbdata);
-    g_signal_connect(radio, "destroy",
-                     G_CALLBACK(unit_sel_unit_destroyed), cbdata);
-    if (ptgt == suggested_tgt_unit) {
-      default_option = radio;
-      default_unit = suggested_tgt_unit;
-    }
-    gtk_grid_attach(GTK_GRID(grid), radio, 0, tcount, 1, 1);
-
-    tubuf = usdlg_get_unit_image(ptgt);
-    if (tubuf != NULL) {
-      icon = gtk_image_new_from_pixbuf(tubuf);
-      g_object_unref(tubuf);
-    } else {
-      icon = gtk_image_new();
-    }
-    gtk_widget_set_size_request(icon, tuw, tuh);
-    gtk_grid_attach(GTK_GRID(grid), icon, 1, tcount, 1, 1);
-
-    lbl = gtk_label_new(usdlg_get_unit_descr(ptgt));
-    gtk_grid_attach(GTK_GRID(grid), lbl, 2, tcount, 1, 1);
-
-    tcount++;
-  } unit_list_iterate_end;
-  gtk_box_append(GTK_BOX(main_box), grid);
-
-  fc_assert_ret_val(default_option, FALSE);
-  gtk_check_button_set_active(GTK_CHECK_BUTTON(default_option), TRUE);
-
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dlg))),
-                 main_box);
-
-  g_object_set_data(G_OBJECT(dlg), "actor", GINT_TO_POINTER(actor->id));
-  g_object_set_data(G_OBJECT(dlg), "tile", ptile);
-
-  /* This function should never be called so that there would be no unit
-   * to select, and where there is unit to select, one of them gets
-   * selected as the default. */
-  fc_assert(default_unit != nullptr);
-  if (default_unit != nullptr) { /* Compiler still wants this */
-    g_object_set_data(G_OBJECT(dlg), "target",
-                      GINT_TO_POINTER(default_unit->id));
-  }
-
-  g_signal_connect(dlg, "response", do_callback, actor);
-
-  gtk_widget_set_visible(gtk_dialog_get_content_area(GTK_DIALOG(dlg)), TRUE);
-  gtk_widget_set_visible(dlg, TRUE);
-
-  return TRUE;
-}
diff --git a/client/gui-gtk-5.0/unitselunitdlg.h b/client/gui-gtk-5.0/unitselunitdlg.h
deleted file mode 100644
index d872de86c5..0000000000
--- a/client/gui-gtk-5.0/unitselunitdlg.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__UNITSELUNITDLG_H
-#define FC__UNITSELUNITDLG_H
-
-bool select_tgt_unit(struct unit *actor, struct tile *ptile,
-                     struct unit_list *potential_tgt_units,
-                     struct unit *suggested_tgt_unit,
-                     const gchar *dlg_title,
-                     const gchar *actor_label,
-                     const gchar *tgt_label,
-                     const gchar *do_label,
-                     GCallback do_callback);
-
-#endif  /* FC__UNITSELUNITDLG_H */
diff --git a/client/gui-gtk-5.0/voteinfo_bar.c b/client/gui-gtk-5.0/voteinfo_bar.c
deleted file mode 100644
index fb016ceb2b..0000000000
--- a/client/gui-gtk-5.0/voteinfo_bar.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fcintl.h"
-#include "mem.h"
-#include "support.h"
-
-/* client */
-#include "options.h"
-#include "voteinfo.h"
-#include "update_queue.h"
-
-/* client/gui-gtk-5.0 */
-#include "chatline.h"
-
-#include "voteinfo_bar.h"
-
-/* A set of widgets. */
-struct voteinfo_bar {
-  GtkWidget *box;
-  GtkWidget *next_button;
-  GtkWidget *label;
-  GtkWidget *yes_button;
-  GtkWidget *no_button;
-  GtkWidget *abstain_button;
-  GtkWidget *yes_count_label;
-  GtkWidget *no_count_label;
-  GtkWidget *abstain_count_label;
-  GtkWidget *voter_count_label;
-};
-
-GtkWidget *pregame_votebar = NULL;      /* PAGE_START voteinfo bar. */
-GtkWidget *ingame_votebar = NULL;       /* PAGE_GAME voteinfo bar. */
-
-/**********************************************************************//**
-  Called after a click on a vote button.
-**************************************************************************/
-static void voteinfo_bar_do_vote_callback(GtkWidget *w, gpointer userdata)
-{
-  enum client_vote_type vote;
-  struct voteinfo *vi;
-
-  vote = GPOINTER_TO_INT(userdata);
-  vi = voteinfo_queue_get_current(NULL);
-
-  if (vi == NULL) {
-    return;
-  }
-
-  voteinfo_do_vote(vi->vote_no, vote);
-}
-
-/**********************************************************************//**
-  Switch to the next vote.
-**************************************************************************/
-static void voteinfo_bar_next_callback(GtkWidget *w, gpointer userdata)
-{
-  voteinfo_queue_next();
-  voteinfo_gui_update();
-}
-
-/**********************************************************************//**
-  Destroy the voteinfo_bar data structure.
-**************************************************************************/
-static void voteinfo_bar_destroy(GtkWidget *w, gpointer userdata)
-{
-  free((struct voteinfo_bar *) userdata);
-}
-
-/**********************************************************************//**
-  Create a voteinfo_bar structure. "split_bar" controls whether to split
-  voteinfo bar over two lines (for narrow windows) or put on a single line
-  to save vertical space.
-**************************************************************************/
-GtkWidget *voteinfo_bar_new(bool split_bar)
-{
-  GtkWidget *label, *button, *vgrid, *hgrid;
-  struct voteinfo_bar *vib;
-  const int BUTTON_HEIGHT = 12;
-  int grid_row = 0;
-  int grid_col = 0;
-
-  vib = fc_calloc(1, sizeof(struct voteinfo_bar));
-
-  if (!split_bar) {
-    hgrid = gtk_grid_new();
-    gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-    g_object_set_data(G_OBJECT(hgrid), "voteinfo_bar", vib);
-    g_signal_connect(hgrid, "destroy", G_CALLBACK(voteinfo_bar_destroy), vib);
-    vib->box = hgrid;
-    vgrid = NULL;        /* The compiler may require it. */
-  } else {
-    vgrid = gtk_grid_new();
-    gtk_grid_set_row_homogeneous(GTK_GRID(vgrid), TRUE);
-    gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
-                                   GTK_ORIENTATION_VERTICAL);
-    gtk_grid_set_row_spacing(GTK_GRID(vgrid), 4);
-    g_object_set_data(G_OBJECT(vgrid), "voteinfo_bar", vib);
-    g_signal_connect(vgrid, "destroy", G_CALLBACK(voteinfo_bar_destroy), vib);
-    vib->box = vgrid;
-    hgrid = gtk_grid_new();
-    gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-    gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
-  }
-
-  label = gtk_label_new("");
-  gtk_widget_set_hexpand(label, TRUE);
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start(label, 8);
-  gtk_widget_set_margin_end(label, 8);
-  gtk_widget_set_margin_top(label, 4);
-  gtk_widget_set_margin_bottom(label, 4);
-  gtk_label_set_max_width_chars(GTK_LABEL(label), 80);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-  gtk_widget_set_name(label, "vote label");
-  vib->label = label;
-
-  if (split_bar) {
-    hgrid = gtk_grid_new();
-    grid_col = 0;
-    gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
-    gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
-  }
-
-  button = gtk_button_new();
-  gtk_widget_set_margin_end(button, 16);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(voteinfo_bar_next_callback), NULL);
-  gtk_button_set_icon_name(GTK_BUTTON(button), "media-seek-backward");
-  gtk_widget_set_size_request(button, -1, BUTTON_HEIGHT);
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_widget_set_focus_on_click(button, FALSE);
-  gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  vib->next_button = button;
-
-  button = gtk_button_new_with_mnemonic(_("_YES"));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(voteinfo_bar_do_vote_callback),
-                   GINT_TO_POINTER(CVT_YES));
-  gtk_widget_set_focus_on_click(button, FALSE);
-  gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  gtk_widget_set_name(button, "vote yes button");
-  vib->yes_button = button;
-
-  label = gtk_label_new("0");
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-  vib->yes_count_label = label;
-
-  button = gtk_button_new_with_mnemonic(_("_NO"));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(voteinfo_bar_do_vote_callback),
-                   GINT_TO_POINTER(CVT_NO));
-  gtk_widget_set_focus_on_click(button, FALSE);
-  gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  gtk_widget_set_name(button, "vote no button");
-  vib->no_button = button;
-
-  label = gtk_label_new("0");
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-  vib->no_count_label = label;
-
-  button = gtk_button_new_with_mnemonic(_("_ABSTAIN"));
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(voteinfo_bar_do_vote_callback),
-                   GINT_TO_POINTER(CVT_ABSTAIN));
-  gtk_widget_set_focus_on_click(button, FALSE);
-  gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
-  gtk_widget_set_name(button, "vote abstain button");
-  vib->abstain_button = button;
-
-  label = gtk_label_new("0");
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-  vib->abstain_count_label = label;
-
-  label = gtk_label_new("/0");
-  gtk_widget_set_halign(label, GTK_ALIGN_START);
-  gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
-  gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
-  vib->voter_count_label = label;
-
-  return vib->box;
-}
-
-/**********************************************************************//**
-  Refresh all vote related GUI widgets. Called by the voteinfo module when
-  the client receives new vote information from the server.
-**************************************************************************/
-void voteinfo_gui_update(void)
-{
-  int vote_count, index;
-  struct voteinfo_bar *vib = NULL;
-  struct voteinfo *vi = NULL;
-  char buf[1024], status[1024], ordstr[128], color[32];
-  bool running, need_scroll;
-  gchar *escaped_desc, *escaped_user;
-
-  if (get_client_page() == PAGE_START && NULL != pregame_votebar) {
-    vib = g_object_get_data(G_OBJECT(pregame_votebar), "voteinfo_bar");
-  } else if (get_client_page() == PAGE_GAME && NULL != ingame_votebar) {
-    vib = g_object_get_data(G_OBJECT(ingame_votebar), "voteinfo_bar");
-  }
-
-  if (vib == nullptr) {
-    return;
-  }
-
-  if (!voteinfo_bar_can_be_shown()) {
-    gtk_widget_set_visible(vib->box, FALSE);
-    return;
-  }
-
-  vote_count = voteinfo_queue_size();
-  vi = voteinfo_queue_get_current(&index);
-
-  if (vi != NULL && vi->resolved && vi->passed) {
-    /* TRANS: Describing a vote that passed. */
-    fc_snprintf(status, sizeof(status), _("[passed]"));
-    sz_strlcpy(color, "green");
-  } else if (vi != NULL && vi->resolved && !vi->passed) {
-    /* TRANS: Describing a vote that failed. */
-    fc_snprintf(status, sizeof(status), _("[failed]"));
-    sz_strlcpy(color, "red");
-  } else if (vi != NULL && vi->remove_time > 0) {
-    /* TRANS: Describing a vote that was removed. */
-    fc_snprintf(status, sizeof(status), _("[removed]"));
-    sz_strlcpy(color, "grey");
-  } else {
-    status[0] = '\0';
-  }
-
-  if (vote_count > 1) {
-    fc_snprintf(ordstr, sizeof(ordstr),
-                "<span weight=\"bold\">(%d/%d)</span> ",
-                index + 1, vote_count);
-  } else {
-    ordstr[0] = '\0';
-  }
-
-  if (status[0] != '\0') {
-    fc_snprintf(buf, sizeof(buf),
-        "<span weight=\"bold\" background=\"%s\">%s</span> ",
-        color, status);
-    sz_strlcpy(status, buf);
-  }
-
-  if (vi != NULL) {
-    escaped_desc = g_markup_escape_text(vi->desc, -1);
-    escaped_user = g_markup_escape_text(vi->user, -1);
-    /* TRANS: "Vote" as a process */
-    fc_snprintf(buf, sizeof(buf), _("%sVote %d by %s: %s%s"),
-                ordstr, vi->vote_no, escaped_user, status,
-                escaped_desc);
-    g_free(escaped_desc);
-    g_free(escaped_user);
-  } else {
-    buf[0] = '\0';
-  }
-  gtk_label_set_markup(GTK_LABEL(vib->label), buf);
-
-  if (vi != NULL)  {
-    fc_snprintf(buf, sizeof(buf), "%d", vi->yes);
-    gtk_label_set_text(GTK_LABEL(vib->yes_count_label), buf);
-    fc_snprintf(buf, sizeof(buf), "%d", vi->no);
-    gtk_label_set_text(GTK_LABEL(vib->no_count_label), buf);
-    fc_snprintf(buf, sizeof(buf), "%d", vi->abstain);
-    gtk_label_set_text(GTK_LABEL(vib->abstain_count_label), buf);
-    fc_snprintf(buf, sizeof(buf), "/%d", vi->num_voters);
-    gtk_label_set_text(GTK_LABEL(vib->voter_count_label), buf);
-  } else {
-    gtk_label_set_text(GTK_LABEL(vib->yes_count_label), "-");
-    gtk_label_set_text(GTK_LABEL(vib->no_count_label), "-");
-    gtk_label_set_text(GTK_LABEL(vib->abstain_count_label), "-");
-    gtk_label_set_text(GTK_LABEL(vib->voter_count_label), "/-");
-  }
-
-  running = vi != NULL && !vi->resolved && vi->remove_time == 0;
-
-  gtk_widget_set_sensitive(vib->yes_button, running);
-  gtk_widget_set_sensitive(vib->no_button, running);
-  gtk_widget_set_sensitive(vib->abstain_button, running);
-
-  need_scroll = !gtk_widget_get_visible(vib->box)
-    && chatline_is_scrolled_to_bottom();
-
-  gtk_widget_set_visible(vib->box, TRUE);
-
-  if (vote_count <= 1) {
-    gtk_widget_set_visible(vib->next_button, FALSE);
-  }
-
-  if (need_scroll) {
-    /* Showing the votebar when it was hidden
-     * previously makes the chatline scroll up. */
-    chatline_scroll_to_bottom(TRUE);
-  }
-}
diff --git a/client/gui-gtk-5.0/voteinfo_bar.h b/client/gui-gtk-5.0/voteinfo_bar.h
deleted file mode 100644
index 67ccb395d6..0000000000
--- a/client/gui-gtk-5.0/voteinfo_bar.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__VOTEBAR_H
-#define FC__VOTEBAR_H
-
-#include <gtk/gtk.h>
-
-/* client */
-#include "voteinfo_bar_g.h"
-
-extern GtkWidget *pregame_votebar;
-extern GtkWidget *ingame_votebar;
-
-GtkWidget *voteinfo_bar_new(bool split_bar);
-
-#endif  /* FC__VOTEBAR_H */
diff --git a/client/gui-gtk-5.0/wldlg.c b/client/gui-gtk-5.0/wldlg.c
deleted file mode 100644
index ade183ad5e..0000000000
--- a/client/gui-gtk-5.0/wldlg.c
+++ /dev/null
@@ -1,1799 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-
-/* utility */
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-#include "support.h"
-
-/* common */
-#include "city.h"
-#include "packets.h"
-#include "worklist.h"
-
-/* client */
-#include "citydlg_common.h"
-#include "client_main.h"
-#include "climisc.h"
-#include "global_worklist.h"
-#include "options.h"
-#include "text.h"
-#include "tilespec.h"
-
-/* client/gui-gtk-5.0 */
-#include "canvas.h"
-#include "citydlg.h"
-#include "graphics.h"
-#include "gui_main.h"
-#include "gui_stuff.h"
-#include "helpdlg.h"
-#include "inputdlg.h"
-
-#include "wldlg.h"
-
-static GtkWidget *worklists_shell;
-
-enum {
-  WORKLISTS_NEW,
-  WORKLISTS_DELETE,
-  WORKLISTS_PROPERTIES,
-  WORKLISTS_CLOSE
-};
-
-static GListStore *worklists_store;
-static GtkSingleSelection *worklists_selection;
-
-static int max_unit_height = -1, max_unit_width = -1;
-
-static void reset_global_worklist(GtkWidget *editor,
-                                  struct global_worklist *pgwl);
-static void popup_worklist(struct global_worklist *pgwl);
-static void popdown_worklist(struct global_worklist *pgwl);
-static void dst_row_callback_depr(GtkTreeView *view, GtkTreePath *path,
-                                  GtkTreeViewColumn *col, gpointer data);
-
-#define FC_TYPE_WORKLIST_ROW (fc_worklist_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcWorklistRow, fc_worklist_row, FC, WORKLIST_ROW, GObject)
-
-struct _FcWorklistRow
-{
-  GObject parent_instance;
-
-  char *name;
-  int id;
-};
-
-struct _FcWorklistClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcWorklistRow, fc_worklist_row, G_TYPE_OBJECT)
-
-
-#define FC_TYPE_WLMETA_ROW (fc_wlmeta_row_get_type())
-
-G_DECLARE_FINAL_TYPE(FcWlmetaRow, fc_wlmeta_row, FC, WLMETA_ROW, GObject)
-
-struct _FcWlmetaRow
-{
-  GObject parent_instance;
-
-  const char *name;
-  int id;
-};
-
-struct _FcWlmetaClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcWlmetaRow, fc_wlmeta_row, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Initialization method for FcWorklistRow class
-**************************************************************************/
-static void
-fc_worklist_row_class_init(FcWorklistRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcWorklistRow
-**************************************************************************/
-static void
-fc_worklist_row_init(FcWorklistRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcWorklistRow creation method
-**************************************************************************/
-#if 0
-static FcWorklistRow *fc_worklist_row_new(void)
-{
-  FcWorklistRow *result;
-
-  result = g_object_new(FC_TYPE_WORKLIST_ROW, nullptr);
-
-  return result;
-}
-#endif
-
-/**********************************************************************//**
-  Initialization method for FcWlmetaRow class
-**************************************************************************/
-static void
-fc_wlmeta_row_class_init(FcWlmetaRowClass *klass)
-{
-}
-
-/**********************************************************************//**
-  Initialization method for FcWlmetaRow
-**************************************************************************/
-static void
-fc_wlmeta_row_init(FcWlmetaRow *self)
-{
-}
-
-/**********************************************************************//**
-  FcWlmetaRow creation method
-**************************************************************************/
-static FcWlmetaRow *fc_wlmeta_row_new(void)
-{
-  FcWlmetaRow *result;
-
-  result = g_object_new(FC_TYPE_WLMETA_ROW, nullptr);
-
-  return result;
-}
-
-/************************************************************************//**
-  Illegal initialization value for max unit size variables
-****************************************************************************/
-void blank_max_unit_size(void)
-{
-  max_unit_height = -1;
-  max_unit_width = -1;
-}
-
-/************************************************************************//**
-  Setup max unit sprite size.
-****************************************************************************/
-static void update_max_unit_size(void)
-{
-  max_unit_height = 0;
-  max_unit_width = 0;
-
-  unit_type_iterate(i) {
-    int x1, x2, y1, y2;
-    struct sprite *sprite = get_unittype_sprite(tileset, i,
-                                                ACTIVITY_LAST,
-                                                direction8_invalid());
-
-    sprite_get_bounding_box(sprite, &x1, &y1, &x2, &y2);
-    max_unit_width = MAX(max_unit_width, x2 - x1);
-    max_unit_height = MAX(max_unit_height, y2 - y1);
-  } unit_type_iterate_end;
-}
-
-/************************************************************************//**
-  Worklists dialog being destroyed
-****************************************************************************/
-static void worklists_destroy_callback(GtkWidget *w, gpointer data)
-{
-  worklists_shell = NULL;
-}
-
-/************************************************************************//**
-  Refresh worklists, both global and those of open city dialogs.
-****************************************************************************/
-void update_worklist_report_dialog(void)
-{
-  g_list_store_remove_all(worklists_store);
-
-  global_worklists_iterate(pgwl) {
-    FcWlmetaRow *row = fc_wlmeta_row_new();
-
-    row->name = global_worklist_name(pgwl);
-    row->id = global_worklist_id(pgwl);
-
-    g_list_store_append(worklists_store, row);
-    g_object_unref(row);
-  } global_worklists_iterate_end;
-
-  refresh_all_city_worklists();
-}
-
-/************************************************************************//**
-  User has responded to worklist report
-****************************************************************************/
-static void worklists_response(GtkWidget *w, gint response)
-{
-  struct global_worklist *pgwl;
-  FcWlmetaRow *row = FC_WLMETA_ROW(gtk_single_selection_get_selected_item(worklists_selection));
-
-  if (row != nullptr) {
-    pgwl = global_worklist_by_id(row->id);
-  } else {
-    pgwl = nullptr;
-  }
-
-  switch (response) {
-  case WORKLISTS_NEW:
-    global_worklist_new(_("new"));
-    update_worklist_report_dialog();
-    return;
-
-  case WORKLISTS_DELETE:
-    if (!pgwl) {
-      return;
-    }
-
-    popdown_worklist(pgwl);
-    global_worklist_destroy(pgwl);
-    update_worklist_report_dialog();
-    return;
-
-  case WORKLISTS_PROPERTIES:
-    if (!pgwl) {
-      return;
-    }
-
-    popup_worklist(pgwl);
-    return;
-
-  default:
-    gtk_window_destroy(GTK_WINDOW(worklists_shell));
-    return;
-  }
-}
-
-/************************************************************************//**
-  Worklist cell edited
-****************************************************************************/
-static void cell_edited(GtkEditable *self, gpointer data)
-{
-  int id = GPOINTER_TO_INT(data);
-  struct global_worklist *pgwl;
-
-  pgwl = global_worklist_by_id(id);
-
-  if (pgwl != nullptr) {
-    global_worklist_set_name(pgwl, gtk_editable_get_text(self));
-
-    refresh_all_city_worklists();
-  }
-}
-
-/**********************************************************************//**
-  Wlmeta table cell bind function
-**************************************************************************/
-static void wlmeta_factory_bind(GtkSignalListItemFactory *self,
-                                GtkListItem *list_item,
-                                gpointer user_data)
-{
-  FcWlmetaRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_editable_set_text(GTK_EDITABLE(child), row->name);
-
-  g_signal_connect(GTK_EDITABLE(child), "changed", G_CALLBACK(cell_edited),
-                   GINT_TO_POINTER(row->id));
-}
-
-/**********************************************************************//**
-  Wlmeta table cell setup function
-**************************************************************************/
-static void wlmeta_factory_setup(GtkSignalListItemFactory *self,
-                                 GtkListItem *list_item,
-                                 gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_editable_label_new(""));
-}
-
-/************************************************************************//**
-  Bring up the global worklist report.
-****************************************************************************/
-static GtkWidget *create_worklists_report(void)
-{
-  GtkWidget *shell;
-  GtkWidget *vbox, *label;
-  GtkListItemFactory *factory;
-  GtkWidget *list;
-  GtkColumnViewColumn *column;
-
-  shell = gtk_dialog_new_with_buttons(_("Edit worklists"),
-                                      NULL,
-                                      0,
-                                      _("_New"),
-                                      WORKLISTS_NEW,
-                                      _("_Delete"),
-                                      WORKLISTS_DELETE,
-                                      _("_Properties"),
-                                      WORKLISTS_PROPERTIES,
-                                      _("_Close"),
-                                      WORKLISTS_CLOSE,
-                                      NULL);
-  setup_dialog(shell, toplevel);
-
-  g_signal_connect(shell, "response",
-                   G_CALLBACK(worklists_response), NULL);
-  g_signal_connect(shell, "destroy",
-                   G_CALLBACK(worklists_destroy_callback), NULL);
-
-  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
-  gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
-                 vbox);
-
-  worklists_store = g_list_store_new(FC_TYPE_WLMETA_ROW);
-
-  worklists_selection = gtk_single_selection_new(G_LIST_MODEL(worklists_store));
-  list = gtk_column_view_new(GTK_SELECTION_MODEL(worklists_selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(wlmeta_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(wlmeta_factory_setup),
-                   nullptr);
-
-  column = gtk_column_view_column_new(_("Name"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(list), column);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", list,
-                       "label", _("_Worklists:"),
-                       "xalign", 0.0, "yalign", 0.5, NULL);
-
-  gtk_box_append(GTK_BOX(vbox), label);
-  gtk_box_append(GTK_BOX(vbox), list);
-  gtk_widget_set_visible(vbox, TRUE);
-
-  return shell;
-}
-
-/************************************************************************//**
-  Open worklists report
-****************************************************************************/
-void popup_worklists_report(void)
-{
-  if (worklists_shell == NULL) {
-    worklists_shell = create_worklists_report();
-
-    update_worklist_report_dialog();
-  }
-
-  gtk_window_present(GTK_WINDOW(worklists_shell));
-}
-
-/****************************************************************
-  ...
-*****************************************************************/
-struct worklist_data {
-  int global_worklist_id;
-  struct city *pcity;
-
-  GtkWidget *editor;
-
-  GtkListStore *src_depr, *dst_depr;
-  GtkWidget *src_view_depr, *dst_view_depr;
-  GMenu *menu;
-  int menu_size;
-  GActionGroup *group;
-  GtkTreeSelection *src_selection_depr, *dst_selection_depr;
-
-  GtkTreeViewColumn *src_col, *dst_col;
-
-  GtkWidget *change_cmd, *help_cmd;
-  GtkWidget *up_cmd, *down_cmd, *prepend_cmd, *append_cmd, *remove_cmd;
-
-  bool future;
-};
-
-static GHashTable *hash;
-
-static void commit_worklist(struct worklist_data *ptr);
-
-/************************************************************************//**
-  Add drag&drop target
-****************************************************************************/
-void add_worklist_dnd_target(GtkWidget *w,
-                             gboolean (drag_drop_cb)
-                               (GtkDropTarget *target, const GValue *value,
-                                double x, double y, gpointer data),
-                             gpointer data)
-{
-  GtkDropTarget *dnd_tgt;
-
-  dnd_tgt = gtk_drop_target_new(G_TYPE_INT, GDK_ACTION_COPY);
-
-  g_signal_connect(dnd_tgt, "drop", G_CALLBACK(drag_drop_cb), data);
-
-  gtk_widget_add_controller(w, GTK_EVENT_CONTROLLER(dnd_tgt));
-}
-
-/************************************************************************//**
-  Get worklist by id
-****************************************************************************/
-static GtkWidget *get_worklist(int global_worklist_id)
-{
-  if (hash) {
-    gpointer ret;
-
-    ret = g_hash_table_lookup(hash, GINT_TO_POINTER(global_worklist_id));
-    return ret;
-  } else {
-    return NULL;
-  }
-}
-
-/************************************************************************//**
-  Insert worklist to editor
-****************************************************************************/
-static void insert_worklist(int global_worklist_id, GtkWidget *editor)
-{
-  if (!hash) {
-    hash = g_hash_table_new(g_direct_hash, g_direct_equal);
-  }
-  g_hash_table_insert(hash, GINT_TO_POINTER(global_worklist_id), editor);
-}
-
-/************************************************************************//**
-  Remove worklist from hash
-****************************************************************************/
-static void delete_worklist(int global_worklist_id)
-{
-  if (hash) {
-    g_hash_table_remove(hash, GINT_TO_POINTER(global_worklist_id));
-  }
-}
-
-/************************************************************************//**
-  Worklist editor window used by the global worklist report.
-****************************************************************************/
-static void popup_worklist(struct global_worklist *pgwl)
-{
-  GtkWidget *shell;
-
-  if (!(shell = get_worklist(global_worklist_id(pgwl)))) {
-    GtkWidget *editor;
-
-    shell = gtk_dialog_new_with_buttons(global_worklist_name(pgwl),
-                                        GTK_WINDOW(worklists_shell),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        _("_Close"),
-                                        GTK_RESPONSE_CLOSE,
-                                        NULL);
-    g_signal_connect(shell, "response", G_CALLBACK(gtk_window_destroy), NULL);
-    gtk_window_set_default_size(GTK_WINDOW(shell), 500, 400);
-
-    editor = create_worklist();
-    reset_global_worklist(editor, pgwl);
-    insert_worklist(global_worklist_id(pgwl), editor);
-
-    gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(shell))),
-                   editor);
-    gtk_widget_set_visible(editor, TRUE);
-
-    refresh_worklist(editor);
-  }
-
-  gtk_window_present(GTK_WINDOW(shell));
-}
-
-/************************************************************************//**
-  Close worklist
-****************************************************************************/
-static void popdown_worklist(struct global_worklist *pgwl)
-{
-  GtkWidget *shell;
-
-  if ((shell = get_worklist(global_worklist_id(pgwl)))) {
-    GtkWidget *parent;
-
-    parent = gtk_widget_get_ancestor(shell, GTK_TYPE_WINDOW);
-    gtk_window_destroy(GTK_WINDOW(parent));
-  }
-}
-
-/************************************************************************//**
-  Destroy worklist
-****************************************************************************/
-static void worklist_destroy(GtkWidget *editor, gpointer data)
-{
-  struct worklist_data *ptr;
-
-  ptr = data;
-
-  if (ptr->global_worklist_id != -1) {
-    delete_worklist(ptr->global_worklist_id);
-  }
-
-  free(ptr);
-}
-
-/************************************************************************//**
-  Item activated from menu
-****************************************************************************/
-static void menu_item_callback(GSimpleAction *action, GVariant *parameter,
-                               gpointer data)
-{
-  struct global_worklist *pgwl;
-  const struct worklist *pwl;
-  struct worklist_data *ptr = (struct worklist_data *)data;
-  size_t i;
-
-  if (NULL == client.conn.playing) {
-    return;
-  }
-
-  pgwl = global_worklist_by_id(GPOINTER_TO_INT
-                               (g_object_get_data(G_OBJECT(action), "id")));
-  if (pgwl == NULL) {
-    return;
-  }
-
-  pwl = global_worklist_get(pgwl);
-
-  for (i = 0; i < (size_t) worklist_length(pwl); i++) {
-    GtkTreeIter it;
-    cid id;
-    char buf[8192];
-
-    id = cid_encode(pwl->entries[i]);
-
-    gtk_list_store_append(ptr->dst_depr, &it);
-    gtk_list_store_set(ptr->dst_depr, &it, 0, (gint)id,
-                       1, production_help(&(pwl->entries[i]),
-                                          buf, sizeof(buf)), -1);
-  }
-
-  commit_worklist(ptr);
-}
-
-/************************************************************************//**
-  Open menu for adding items to worklist
-****************************************************************************/
-static GMenu *create_wl_menu(struct worklist_data *ptr)
-{
-  GSimpleAction *act;
-  int current_size = 0;
-
-  if (ptr->menu == NULL) {
-    ptr->menu = g_menu_new();
-    ptr->menu_size = 0;
-  }
-
-  global_worklists_iterate(pgwl) {
-    int id = global_worklist_id(pgwl);
-    char act_name[60];
-
-    fc_snprintf(act_name, sizeof(act_name), "wl%d", id);
-    act = g_simple_action_new(act_name, NULL);
-
-    g_object_set_data(G_OBJECT(act), "id",
-                      GINT_TO_POINTER(global_worklist_id(pgwl)));
-    g_action_map_add_action(G_ACTION_MAP(ptr->group), G_ACTION(act));
-    g_signal_connect(act, "activate", G_CALLBACK(menu_item_callback), ptr);
-
-    fc_snprintf(act_name, sizeof(act_name), "win.wl%d", id);
-
-    if (ptr->menu_size > current_size) {
-      g_menu_remove(ptr->menu, current_size);
-    }
-    menu_item_insert_unref(ptr->menu, current_size++,
-                           g_menu_item_new(global_worklist_name(pgwl), act_name));
-  } global_worklists_iterate_end;
-
-  act = g_simple_action_new("wledit", NULL);
-  g_action_map_add_action(G_ACTION_MAP(ptr->group), G_ACTION(act));
-  g_signal_connect(act, "activate",
-                   G_CALLBACK(popup_worklists_report), NULL);
-
-  if (ptr->menu_size > current_size) {
-    g_menu_remove(ptr->menu, current_size);
-  }
-
-  menu_item_insert_unref(ptr->menu, current_size++,
-                         g_menu_item_new(_("Edit Global _Worklists"), "win.wledit"));
-
-  if (ptr->menu_size < current_size) {
-    ptr->menu_size = current_size;
-  } else {
-    while (ptr->menu_size > current_size) {
-      g_menu_remove(ptr->menu, --ptr->menu_size);
-    }
-  }
-
-  return ptr->menu;
-}
-
-/************************************************************************//**
-  Open help dialog for the cid pointed by iterator.
-****************************************************************************/
-static void wl_help_from_iter(GtkTreeModel *model, GtkTreeIter *it)
-{
-  gint id;
-  struct universal target;
-
-  gtk_tree_model_get(model, it, 0, &id, -1);
-  target = cid_decode(id);
-
-  if (VUT_UTYPE == target.kind) {
-    popup_help_dialog_typed(utype_name_translation(target.value.utype),
-                            HELP_UNIT);
-  } else if (is_great_wonder(target.value.building)) {
-    popup_help_dialog_typed(improvement_name_translation(target.value.building),
-                            HELP_WONDER);
-  } else {
-    popup_help_dialog_typed(improvement_name_translation(target.value.building),
-                            HELP_IMPROVEMENT);
-  }
-}
-
-/************************************************************************//**
-  Help button clicked
-****************************************************************************/
-static void help_callback(GtkWidget *w, gpointer data)
-{
-  struct worklist_data *ptr;
-  GtkTreeSelection *selection_depr;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  ptr = data;
-  selection_depr = ptr->src_selection_depr;
-
-  if (gtk_tree_selection_get_selected(selection_depr, &model, &it)) {
-    wl_help_from_iter(model, &it);
-  } else {
-    popup_help_dialog_string(HELP_WORKLIST_EDITOR_ITEM);
-  }
-}
-
-/************************************************************************//**
-  "Change Production" clicked
-****************************************************************************/
-static void change_callback(GtkWidget *w, gpointer data)
-{
-  struct worklist_data *ptr;
-  GtkTreeSelection *selection_depr;
-  GtkTreeModel *model;
-  GtkTreeIter it;
-
-  ptr = data;
-  selection_depr = ptr->src_selection_depr;
-
-  if (gtk_tree_selection_get_selected(selection_depr, &model, &it)) {
-    gint id;
-    struct universal univ;
-
-    gtk_tree_model_get(model, &it, 0, &id, -1);
-    univ = cid_production(id);
-    city_change_production(ptr->pcity, &univ);
-  }
-}
-
-/************************************************************************//**
-  Showing of future targets toggled
-****************************************************************************/
-static void future_callback(GtkToggleButton *toggle, gpointer data)
-{
-  struct worklist_data *ptr;
-
-  ptr = data;
-  ptr->future = !ptr->future;
-
-  refresh_worklist(ptr->editor);
-}
-
-/************************************************************************//**
-  Move item up in worklist
-****************************************************************************/
-static void queue_bubble_up(struct worklist_data *ptr)
-{
-  GtkTreePath *path;
-  GtkTreeViewColumn *col;
-  GtkTreeModel *model;
-
-  if (!gtk_widget_is_sensitive(ptr->dst_view_depr)) {
-    return;
-  }
-
-  model = GTK_TREE_MODEL(ptr->dst_depr);
-  gtk_tree_view_get_cursor(GTK_TREE_VIEW(ptr->dst_view_depr), &path, &col);
-  if (path) {
-    GtkTreeIter it, it_prev;
-
-    if (gtk_tree_path_prev(path)) {
-      gtk_tree_model_get_iter(model, &it_prev, path);
-      it = it_prev;
-      gtk_tree_model_iter_next(model, &it);
-
-      gtk_list_store_swap(GTK_LIST_STORE(model), &it, &it_prev);
-
-      gtk_tree_view_set_cursor(GTK_TREE_VIEW(ptr->dst_view_depr), path, col, FALSE);
-      commit_worklist(ptr);
-    }
-  }
-  gtk_tree_path_free(path);
-}
-
-/************************************************************************//**
-  Removal of the item requested
-****************************************************************************/
-static void queue_remove(struct worklist_data *ptr)
-{
-  GtkTreePath *path;
-  GtkTreeViewColumn *col;
-
-  gtk_tree_view_get_cursor(GTK_TREE_VIEW(ptr->dst_view_depr), &path, &col);
-  if (path) {
-    dst_row_callback_depr(GTK_TREE_VIEW(ptr->dst_view_depr), path, col, ptr);
-    gtk_tree_path_free(path);
-  }
-}
-
-/************************************************************************//**
-  Move item down in queue
-****************************************************************************/
-static void queue_bubble_down(struct worklist_data *ptr)
-{
-  GtkTreePath *path;
-  GtkTreeViewColumn *col;
-  GtkTreeModel *model;
-
-  if (!gtk_widget_is_sensitive(ptr->dst_view_depr)) {
-    return;
-  }
-
-  model = GTK_TREE_MODEL(ptr->dst_depr);
-  gtk_tree_view_get_cursor(GTK_TREE_VIEW(ptr->dst_view_depr), &path, &col);
-  if (path) {
-    GtkTreeIter it, it_next;
-
-    gtk_tree_model_get_iter(model, &it, path);
-    it_next = it;
-    if (gtk_tree_model_iter_next(model, &it_next)) {
-      gtk_list_store_swap(GTK_LIST_STORE(model), &it, &it_next);
-
-      gtk_tree_path_next(path);
-      gtk_tree_view_set_cursor(GTK_TREE_VIEW(ptr->dst_view_depr), path, col, FALSE);
-      commit_worklist(ptr);
-    }
-  }
-  gtk_tree_path_free(path);
-}
-
-/************************************************************************//**
-  Insert item to queue
-****************************************************************************/
-static void queue_insert(struct worklist_data *ptr, bool prepend)
-{
-  GtkTreeModel *model;
-  GtkTreeIter it;
-  GtkTreePath *path;
-  GtkTreeModel *src_model_depr, *dst_model_depr;
-  GtkTreeIter src_it, dst_it;
-  gint i, ncols;
-
-  if (!gtk_widget_is_sensitive(ptr->dst_view_depr)) {
-    return;
-  }
-
-  if (!gtk_tree_selection_get_selected(ptr->src_selection_depr, &model, &it)) {
-    return;
-  }
-
-  path = gtk_tree_model_get_path(model, &it);
-
-  src_model_depr = GTK_TREE_MODEL(ptr->src_depr);
-  dst_model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-
-  gtk_tree_model_get_iter(src_model_depr, &src_it, path);
-  if (prepend) {
-    gtk_list_store_prepend(GTK_LIST_STORE(dst_model_depr), &dst_it);
-  } else {
-    gtk_list_store_append(GTK_LIST_STORE(dst_model_depr), &dst_it);
-  }
-
-  ncols = gtk_tree_model_get_n_columns(src_model_depr);
-
-  for (i = 0; i < ncols; i++) {
-    GValue value = { 0, };
-
-    gtk_tree_model_get_value(src_model_depr, &src_it, i, &value);
-    gtk_list_store_set_value(GTK_LIST_STORE(dst_model_depr), &dst_it, i, &value);
-  }
-  commit_worklist(ptr);
-
-  gtk_tree_path_free(path);
-}
-
-/************************************************************************//**
-  Prepend item to worklist
-****************************************************************************/
-static void queue_prepend(struct worklist_data *ptr)
-{
-  queue_insert(ptr, TRUE);
-}
-
-/************************************************************************//**
-  Append item to worklist
-****************************************************************************/
-static void queue_append(struct worklist_data *ptr)
-{
-  queue_insert(ptr, FALSE);
-}
-
-/************************************************************************//**
-  Source row activated
-****************************************************************************/
-static void src_row_callback_depr(GtkTreeView *view, GtkTreePath *path,
-                                  GtkTreeViewColumn *col, gpointer data)
-{
-  struct worklist_data *ptr;
-  GtkTreeModel *src_model_depr, *dst_model_depr;
-  GtkTreeIter src_it, dst_it;
-  gint i, ncols;
-
-  ptr = data;
-
-  if (!gtk_widget_is_sensitive(ptr->dst_view_depr)) {
-    return;
-  }
-
-  src_model_depr = GTK_TREE_MODEL(ptr->src_depr);
-  dst_model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-
-  gtk_tree_model_get_iter(src_model_depr, &src_it, path);
-  gtk_list_store_append(GTK_LIST_STORE(dst_model_depr), &dst_it);
-
-  ncols = gtk_tree_model_get_n_columns(src_model_depr);
-
-  for (i = 0; i < ncols; i++) {
-    GValue value = { 0, };
-
-    gtk_tree_model_get_value(src_model_depr, &src_it, i, &value);
-    gtk_list_store_set_value(GTK_LIST_STORE(dst_model_depr), &dst_it, i, &value);
-  }
-  commit_worklist(ptr);
-}
-
-/************************************************************************//**
-  Destination row activated
-****************************************************************************/
-static void dst_row_callback_depr(GtkTreeView *view, GtkTreePath *path,
-                                  GtkTreeViewColumn *col, gpointer data)
-{
-  struct worklist_data *ptr;
-  GtkTreeModel *dst_model_depr;
-  GtkTreeIter it;
-
-  ptr = data;
-  dst_model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-
-  gtk_tree_model_get_iter(dst_model_depr, &it, path);
-
-  gtk_list_store_remove(GTK_LIST_STORE(dst_model_depr), &it);
-  commit_worklist(ptr);
-}
-
-/************************************************************************//**
-  Key press for source
-****************************************************************************/
-static gboolean src_key_press_callback(GtkEventControllerKey *controller,
-                                       guint keyval, guint keycode,
-                                       GdkModifierType state, gpointer data)
-{
-  struct worklist_data *ptr;
-
-  ptr = data;
-
-  if (!gtk_widget_is_sensitive(ptr->dst_view_depr)) {
-    return FALSE;
-  }
-
-  if ((state & GDK_SHIFT_MASK) && keyval == GDK_KEY_Insert) {
-    queue_prepend(ptr);
-    return TRUE;
-  } else if (keyval == GDK_KEY_Insert) {
-    queue_append(ptr);
-    return TRUE;
-  } else {
-    return FALSE;
-  }
-}
-
-/************************************************************************//**
-  Key press for destination
-****************************************************************************/
-static gboolean dst_key_press_callback(GtkEventControllerKey *controller,
-                                       guint keyval, guint keycode,
-                                       GdkModifierType state, gpointer data)
-{
-  GtkTreeModel *model_depr;
-  struct worklist_data *ptr;
-
-  ptr = data;
-  model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-
-  if (keyval == GDK_KEY_Delete) {
-    GtkTreeIter it, it_next;
-    bool deleted = FALSE;
-
-    if (gtk_tree_model_get_iter_first(model_depr, &it)) {
-      bool more;
-
-      do {
-        it_next = it;
-        more = gtk_tree_model_iter_next(model_depr, &it_next);
-
-        if (gtk_tree_selection_iter_is_selected(ptr->dst_selection_depr, &it)) {
-          gtk_list_store_remove(GTK_LIST_STORE(model_depr), &it);
-          deleted = TRUE;
-        }
-        it = it_next;
-
-      } while (more);
-    }
-
-    if (deleted) {
-      commit_worklist(ptr);
-    }
-
-    return TRUE;
-  } else if ((state & GDK_ALT_MASK) && keyval == GDK_KEY_Up) {
-    queue_bubble_up(ptr);
-
-    return TRUE;
-  } else if ((state & GDK_ALT_MASK) && keyval == GDK_KEY_Down) {
-    queue_bubble_down(ptr);
-
-    return TRUE;
-  } else {
-    return FALSE;
-  }
-}
-
-/************************************************************************//**
-  Selection from source
-****************************************************************************/
-static void src_selection_callback_depr(GtkTreeSelection *selection, gpointer data)
-{
-  struct worklist_data *ptr;
-
-  ptr = data;
-
-  /* Update widget sensitivity. */
-  if (gtk_tree_selection_get_selected(selection, NULL, NULL)) {
-    if (can_client_issue_orders()
-        && (!ptr->pcity || city_owner(ptr->pcity) == client.conn.playing)) {
-      /* If ptr->pcity is NULL, this is a global worklist */
-      gtk_widget_set_sensitive(ptr->change_cmd, TRUE);
-      gtk_widget_set_sensitive(ptr->prepend_cmd, TRUE);
-      gtk_widget_set_sensitive(ptr->append_cmd, TRUE);
-    } else {
-      gtk_widget_set_sensitive(ptr->change_cmd, FALSE);
-      gtk_widget_set_sensitive(ptr->prepend_cmd, FALSE);
-      gtk_widget_set_sensitive(ptr->append_cmd, FALSE);
-    }
-    gtk_widget_set_sensitive(ptr->help_cmd, TRUE);
-  } else {
-    gtk_widget_set_sensitive(ptr->change_cmd, FALSE);
-    gtk_widget_set_sensitive(ptr->help_cmd, FALSE);
-    gtk_widget_set_sensitive(ptr->prepend_cmd, FALSE);
-    gtk_widget_set_sensitive(ptr->append_cmd, FALSE);
-  }
-}
-
-/************************************************************************//**
-  Selection from destination
-****************************************************************************/
-static void dst_selection_callback_depr(GtkTreeSelection *selection, gpointer data)
-{
-  struct worklist_data *ptr;
-
-  ptr = data;
-
-  /* Update widget sensitivity. */
-  if (gtk_tree_selection_count_selected_rows(selection) > 0) {
-    int num_rows = 0;
-    GtkTreeIter it;
-
-    gtk_widget_set_sensitive(ptr->up_cmd, TRUE);
-    gtk_widget_set_sensitive(ptr->down_cmd, TRUE);
-    if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ptr->dst_depr), &it)) {
-      do {
-        num_rows++;
-      } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(ptr->dst_depr), &it));
-    }
-    if (num_rows > 1) {
-      gtk_widget_set_sensitive(ptr->remove_cmd, TRUE);
-    } else {
-      gtk_widget_set_sensitive(ptr->remove_cmd, FALSE);
-    }
-  } else {
-    gtk_widget_set_sensitive(ptr->up_cmd, FALSE);
-    gtk_widget_set_sensitive(ptr->down_cmd, FALSE);
-    gtk_widget_set_sensitive(ptr->remove_cmd, FALSE);
-  }
-}
-
-/************************************************************************//**
-  Render worklist cell
-****************************************************************************/
-static void cell_render_func(GtkTreeViewColumn *col, GtkCellRenderer *rend,
-                             GtkTreeModel *model, GtkTreeIter *it,
-                             gpointer data)
-{
-  gint id;
-  struct universal target;
-
-  gtk_tree_model_get(model, it, 0, &id, -1);
-  target = cid_production(id);
-
-  if (GTK_IS_CELL_RENDERER_PIXBUF(rend)) {
-    GdkPixbuf *pix;
-    struct sprite *sprite;
-
-    if (VUT_UTYPE == target.kind) {
-      sprite = sprite_scale(get_unittype_sprite(tileset, target.value.utype,
-                                                ACTIVITY_LAST,
-                                                direction8_invalid()),
-                            max_unit_width, max_unit_height);
-    } else {
-      sprite = get_building_sprite(tileset, target.value.building);
-    }
-    pix = sprite_get_pixbuf(sprite);
-    g_object_set(rend, "pixbuf", pix, NULL);
-    g_object_unref(G_OBJECT(pix));
-    if (VUT_UTYPE == target.kind) {
-      free_sprite(sprite);
-    }
-  } else {
-    struct city **pcity = data;
-    gint column;
-    char *row[4];
-    char buf[4][64];
-    guint i;
-    gboolean useless;
-
-    for (i = 0; i < ARRAY_SIZE(row); i++) {
-      row[i] = buf[i];
-    }
-    column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(rend), "column"));
-
-    get_city_dialog_production_row(row, sizeof(buf[0]), &target, *pcity);
-    g_object_set(rend, "text", row[column], NULL);
-
-    if (NULL != *pcity && VUT_IMPROVEMENT == target.kind) {
-      useless = is_improvement_redundant(*pcity, target.value.building);
-      /* Mark building redundant if we are really certain that there is
-       * no use for it. */
-      g_object_set(rend, "strikethrough", useless, NULL);
-    } else {
-      g_object_set(rend, "strikethrough", FALSE, NULL);
-    }
-  }
-}
-
-/************************************************************************//**
-  Populate view with buildable item information
-****************************************************************************/
-static void populate_view(GtkTreeView *view, struct city **ppcity,
-                          GtkTreeViewColumn **pcol)
-{
-  static const char *titles[] =
-  { N_("Type"), N_("Name"), N_("Info"), N_("Cost"), N_("Turns") };
-
-  static bool titles_done;
-  guint i;
-  GtkCellRenderer *rend;
-  GtkTreeViewColumn *col;
-
-  intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
-
-  /* Case i == 0 taken out of the loop to workaround gcc-4.2.1 bug
-   * https://gcc.gnu.org/PR33381
-   * Some values would 'stick' from i == 0 round. */
-  i = 0;
-
-  rend = gtk_cell_renderer_pixbuf_new();
-
-  gtk_tree_view_insert_column_with_data_func(view, i, titles[i], rend,
-                                             cell_render_func, ppcity, NULL);
-  col = gtk_tree_view_get_column(view, i);
-
-  if (GUI_GTK_OPTION(show_task_icons)) {
-    if (max_unit_width == -1 || max_unit_height == -1) {
-      update_max_unit_size();
-    }
-  } else {
-    g_object_set(col, "visible", FALSE, NULL);
-  }
-  if (GUI_GTK_OPTION(show_task_icons)) {
-    g_object_set(rend, "height", max_unit_height, NULL);
-  }
-
-  for (i = 1; i < ARRAY_SIZE(titles); i++) {
-    gint pos = i - 1;
-
-    rend = gtk_cell_renderer_text_new();
-    g_object_set_data(G_OBJECT(rend), "column", GINT_TO_POINTER(pos));
-
-    gtk_tree_view_insert_column_with_data_func(view,
-                                               i, titles[i], rend,
-                                               cell_render_func, ppcity, NULL);
-    col = gtk_tree_view_get_column(view, i);
-
-    if (pos >= 2) {
-      g_object_set(G_OBJECT(rend), "xalign", 1.0, NULL);
-      gtk_tree_view_column_set_alignment(col, 1.0);
-    }
-
-    if (pos == 3) {
-      *pcol = col;
-    }
-    if (GUI_GTK_OPTION(show_task_icons)) {
-      g_object_set(rend, "height", max_unit_height, NULL);
-    }
-  }
-}
-
-/************************************************************************//**
-  Open help dialog for the worklist item.
-****************************************************************************/
-static gboolean wl_right_button_up(GtkGestureClick *gesture,
-                                   int n_press,
-                                   double x, double y)
-{
-  GtkEventController *controller = GTK_EVENT_CONTROLLER(gesture);
-  GtkWidget *w = gtk_event_controller_get_widget(controller);
-  GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(w));
-  GtkTreePath *path;
-  int bx, by;
-
-  gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(w), x, y, &bx, &by);
-
-  if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(w), bx, by, &path, NULL, NULL, NULL)) {
-    GtkTreeIter iter;
-
-    if (gtk_tree_model_get_iter(model, &iter, path)) {
-      wl_help_from_iter(model, &iter);
-    }
-  }
-
-  return TRUE;
-}
-
-/************************************************************************//**
-  Receive drag&drop
-****************************************************************************/
-static gboolean drag_drop(GtkDropTarget *target, const GValue *value,
-                          double x, double y, gpointer data)
-{
-  struct worklist_data *ptr = (struct worklist_data *)data;
-  GtkTreeIter it;
-  char buf[8192];
-  cid id = g_value_get_int(value);
-  struct universal univ;
-
-  univ = cid_production(id);
-  gtk_list_store_append(ptr->dst_depr, &it);
-  gtk_list_store_set(ptr->dst_depr, &it, 0, id, 1,
-                     production_help(&univ, buf, sizeof(buf)), -1);
-
-  commit_worklist(ptr);
-
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Worklist table cell bind function
-**************************************************************************/
-static void worklist_factory_bind(GtkSignalListItemFactory *self,
-                                  GtkListItem *list_item,
-                                  gpointer user_data)
-{
-  FcWorklistRow *row;
-  GtkWidget *child = gtk_list_item_get_child(list_item);
-
-  row = gtk_list_item_get_item(list_item);
-
-  gtk_label_set_text(GTK_LABEL(child), row->name);
-}
-
-/**********************************************************************//**
-  Worklist table cell setup function
-**************************************************************************/
-static void worklist_factory_setup(GtkSignalListItemFactory *self,
-                                   GtkListItem *list_item,
-                                   gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/************************************************************************//**
-  Worklist editor shell.
-****************************************************************************/
-GtkWidget *create_worklist(void)
-{
-  GtkWidget *editor, *table, *sw, *bbox;
-  GtkWidget *src_view_depr, *dst_view_depr, *label, *button;
-  GtkWidget *aux_menu;
-  GMenu *menu;
-  GtkWidget *table2, *arrow, *check;
-  GtkSizeGroup *sgroup;
-  GtkListStore *src_store_depr, *dst_store_depr;
-  GtkListItemFactory *factory;
-  struct worklist_data *ptr;
-  int editor_row = 0;
-  GtkEventController *controller;
-  GtkGesture *gesture;
-  GtkDropTarget *dnd_tgt;
-
-  ptr = fc_malloc(sizeof(*ptr));
-
-  src_store_depr = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
-  dst_store_depr = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
-
-  ptr->global_worklist_id = -1;
-  ptr->pcity = NULL;
-  ptr->src_depr = src_store_depr;
-  ptr->dst_depr = dst_store_depr;
-  ptr->future = FALSE;
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(worklist_factory_bind),
-                   nullptr);
-  g_signal_connect(factory, "setup", G_CALLBACK(worklist_factory_setup),
-                   nullptr);
-
-  /* Create shell. */
-  editor = gtk_grid_new();
-  gtk_grid_set_row_spacing(GTK_GRID(editor), 6);
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(editor),
-                                 GTK_ORIENTATION_VERTICAL);
-  g_signal_connect(editor, "destroy", G_CALLBACK(worklist_destroy), ptr);
-  g_object_set_data(G_OBJECT(editor), "data", ptr);
-
-  ptr->editor = editor;
-
-  /* Add source and target lists.  */
-  table = gtk_grid_new();
-  gtk_grid_attach(GTK_GRID(editor), table, 0, editor_row++, 1, 1);
-
-  sgroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_grid_attach(GTK_GRID(table), sw, 3, 1, 2, 1);
-
-  src_view_depr = gtk_tree_view_new_with_model(GTK_TREE_MODEL(src_store_depr));
-  gtk_widget_set_hexpand(src_view_depr, TRUE);
-  gtk_widget_set_vexpand(src_view_depr, TRUE);
-  g_object_unref(src_store_depr);
-  gtk_size_group_add_widget(sgroup, src_view_depr);
-  gtk_widget_set_name(src_view_depr, "small_font");
-  gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(src_view_depr), 1);
-
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(wl_right_button_up), NULL);
-  gtk_widget_add_controller(src_view_depr, controller);
-
-  populate_view(GTK_TREE_VIEW(src_view_depr), &ptr->pcity, &ptr->src_col);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), src_view_depr);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", src_view_depr,
-                       "label", _("Source _Tasks:"),
-                       "xalign", 0.0, "yalign", 0.5, NULL);
-  gtk_grid_attach(GTK_GRID(table), label, 3, 0, 1, 1);
-
-  check = gtk_check_button_new_with_mnemonic(_("Show _Future Targets"));
-  gtk_grid_attach(GTK_GRID(table), check, 4, 0, 1, 1);
-  g_signal_connect(check, "toggled", G_CALLBACK(future_callback), ptr);
-
-  table2 = gtk_grid_new();
-  gtk_grid_attach(GTK_GRID(table), table2, 2, 1, 1, 1);
-
-  button = gtk_button_new();
-  gtk_widget_set_margin_top(button, 24);
-  gtk_widget_set_margin_bottom(button, 24);
-  ptr->prepend_cmd = button;
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_grid_attach(GTK_GRID(table2), button, 0, 0, 1, 1);
-
-  arrow = gtk_image_new_from_icon_name("pan-start-symbolic");
-  gtk_button_set_child(GTK_BUTTON(button), arrow);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(queue_prepend), ptr);
-  gtk_widget_set_sensitive(ptr->prepend_cmd, FALSE);
-
-  button = gtk_button_new();
-  ptr->up_cmd = button;
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_grid_attach(GTK_GRID(table2), button, 0, 1, 1, 1);
-
-  arrow = gtk_image_new_from_icon_name("pan-up-symbolic");
-  gtk_button_set_child(GTK_BUTTON(button), arrow);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(queue_bubble_up), ptr);
-  gtk_widget_set_sensitive(ptr->up_cmd, FALSE);
-
-  button = gtk_button_new();
-  ptr->down_cmd = button;
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_grid_attach(GTK_GRID(table2), button, 0, 2, 1, 1);
-
-  arrow = gtk_image_new_from_icon_name("pan-down-symbolic");
-  gtk_button_set_child(GTK_BUTTON(button), arrow);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(queue_bubble_down), ptr);
-  gtk_widget_set_sensitive(ptr->down_cmd, FALSE);
-
-  button = gtk_button_new();
-  gtk_widget_set_margin_top(button, 24);
-  gtk_widget_set_margin_bottom(button, 24);
-  ptr->append_cmd = button;
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_grid_attach(GTK_GRID(table2), button, 0, 3, 1, 1);
-
-  arrow = gtk_image_new_from_icon_name("pan-start-symbolic");
-  gtk_button_set_child(GTK_BUTTON(button), arrow);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(queue_append), ptr);
-  gtk_widget_set_sensitive(ptr->append_cmd, FALSE);
-
-  button = gtk_button_new();
-  gtk_widget_set_margin_top(button, 24);
-  gtk_widget_set_margin_bottom(button, 24);
-  ptr->remove_cmd = button;
-  gtk_button_set_has_frame(GTK_BUTTON(button), FALSE);
-  gtk_grid_attach(GTK_GRID(table2), button, 0, 4, 1, 1);
-
-  arrow = gtk_image_new_from_icon_name("pan-end-symbolic");
-  gtk_button_set_child(GTK_BUTTON(button), arrow);
-  g_signal_connect_swapped(button, "clicked",
-                           G_CALLBACK(queue_remove), ptr);
-  gtk_widget_set_sensitive(ptr->remove_cmd, FALSE);
-
-  sw = gtk_scrolled_window_new();
-  gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_grid_attach(GTK_GRID(table), sw, 0, 1, 2, 1);
-
-  dst_view_depr = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dst_store_depr));
-  gtk_widget_set_hexpand(dst_view_depr, TRUE);
-  gtk_widget_set_vexpand(dst_view_depr, TRUE);
-  g_object_unref(dst_store_depr);
-  gtk_size_group_add_widget(sgroup, dst_view_depr);
-  gtk_widget_set_name(dst_view_depr, "small_font");
-  gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(dst_view_depr), 1);
-
-  gesture = gtk_gesture_click_new();
-  gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
-  controller = GTK_EVENT_CONTROLLER(gesture);
-  g_signal_connect(controller, "pressed",
-                   G_CALLBACK(wl_right_button_up), NULL);
-  gtk_widget_add_controller(dst_view_depr, controller);
-
-  populate_view(GTK_TREE_VIEW(dst_view_depr), &ptr->pcity, &ptr->dst_col);
-  gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), dst_view_depr);
-
-  label = g_object_new(GTK_TYPE_LABEL,
-                       "use-underline", TRUE,
-                       "mnemonic-widget", dst_view_depr,
-                       "label", _("Target _Worklist:"),
-                       "xalign", 0.0, "yalign", 0.5, NULL);
-  gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
-
-  /* Add bottom menu and buttons. */
-  bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
-  gtk_box_set_spacing(GTK_BOX(bbox), 10);
-  gtk_grid_attach(GTK_GRID(editor), bbox, 0, editor_row++, 1, 1);
-
-  ptr->menu = NULL;
-  aux_menu = aux_menu_new();
-  ptr->group = G_ACTION_GROUP(g_simple_action_group_new());
-  menu = create_wl_menu(ptr);
-  gtk_menu_button_set_menu_model(GTK_MENU_BUTTON(aux_menu), G_MENU_MODEL(menu));
-
-  gtk_box_append(GTK_BOX(bbox), aux_menu);
-  gtk_widget_insert_action_group(aux_menu, "win", ptr->group);
-
-  button = icon_label_button_new("help-browser", _("Help"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(help_callback), ptr);
-  ptr->help_cmd = button;
-  gtk_widget_set_sensitive(ptr->help_cmd, FALSE);
-
-  button = gtk_button_new_with_mnemonic(_("Change Prod_uction"));
-  gtk_box_append(GTK_BOX(bbox), button);
-  g_signal_connect(button, "clicked",
-                   G_CALLBACK(change_callback), ptr);
-  ptr->change_cmd = button;
-  gtk_widget_set_sensitive(ptr->change_cmd, FALSE);
-
-  ptr->src_view_depr = src_view_depr;
-  ptr->dst_view_depr = dst_view_depr;
-  ptr->src_selection_depr = gtk_tree_view_get_selection(GTK_TREE_VIEW(src_view_depr));
-  ptr->dst_selection_depr = gtk_tree_view_get_selection(GTK_TREE_VIEW(dst_view_depr));
-  gtk_tree_selection_set_mode(ptr->dst_selection_depr, GTK_SELECTION_MULTIPLE);
-
-  /* DND and other state changing callbacks. */
-  gtk_tree_view_set_reorderable(GTK_TREE_VIEW(dst_view_depr), TRUE);
-
-  dnd_tgt = gtk_drop_target_new(G_TYPE_INT, GDK_ACTION_COPY);
-
-  g_signal_connect(dnd_tgt, "drop", G_CALLBACK(drag_drop), ptr);
-  gtk_widget_add_controller(GTK_WIDGET(dst_view_depr), GTK_EVENT_CONTROLLER(dnd_tgt));
-
-  controller = gtk_event_controller_key_new();
-  g_signal_connect(controller, "key-pressed",
-                   G_CALLBACK(src_key_press_callback), ptr);
-  gtk_widget_add_controller(src_view_depr, controller);
-
-  controller = gtk_event_controller_key_new();
-  g_signal_connect(controller, "key-pressed",
-                   G_CALLBACK(dst_key_press_callback), ptr);
-  gtk_widget_add_controller(dst_view_depr, controller);
-
-  g_signal_connect(src_view_depr, "row_activated",
-                   G_CALLBACK(src_row_callback_depr), ptr);
-
-  g_signal_connect(dst_view_depr, "row_activated",
-                   G_CALLBACK(dst_row_callback_depr), ptr);
-
-  g_signal_connect(ptr->src_selection_depr, "changed",
-                   G_CALLBACK(src_selection_callback_depr), ptr);
-  g_signal_connect(ptr->dst_selection_depr, "changed",
-                   G_CALLBACK(dst_selection_callback_depr), ptr);
-
-
-  gtk_widget_set_visible(table, TRUE);
-  gtk_widget_set_visible(bbox, TRUE);
-
-  return editor;
-}
-
-/************************************************************************//**
-  Prepare data for drag&drop
-****************************************************************************/
-static GdkContentProvider *drag_prepare(GtkDragSource *source,
-                                        double x, double y,
-                                        gpointer data)
-{
-  GtkTreeIter it;
-  struct worklist_data *ptr = (struct worklist_data *)data;
-
-  if (gtk_tree_selection_get_selected(ptr->src_selection_depr, NULL, &it)) {
-    gint id;
-    GdkContentProvider *provider;
-
-    gtk_tree_model_get(GTK_TREE_MODEL(ptr->src_depr), &it, 0, &id, -1);
-
-    provider = gdk_content_provider_new_typed(G_TYPE_INT, id);
-
-    gtk_drag_source_set_content(source, provider);
-
-    return provider;
-  }
-
-  return NULL;
-}
-
-/************************************************************************//**
-  Set drag icon
-****************************************************************************/
-static void drag_begin(GtkDragSource *source, GdkDrag *drag,
-                       gpointer *data)
-{
-  GdkContentProvider *content = gtk_drag_source_get_content(source);
-  GValue val = { 0, };
-  GdkPaintable *paintable;
-  cid id;
-  struct universal target;
-  struct sprite *sprite;
-  GdkPixbuf *pix;
-  GtkWidget *img;
-
-  g_value_init(&val, G_TYPE_INT);
-  if (gdk_content_provider_get_value(content, &val, NULL)) {
-    id = g_value_get_int(&val);
-    target = cid_production(id);
-
-    if (VUT_UTYPE == target.kind) {
-      sprite = sprite_scale(get_unittype_sprite(tileset, target.value.utype,
-                                                ACTIVITY_LAST,
-                                                direction8_invalid()),
-                            max_unit_width, max_unit_height);
-    } else {
-      sprite = get_building_sprite(tileset, target.value.building);
-    }
-    pix = sprite_get_pixbuf(sprite);
-    img = gtk_image_new_from_pixbuf(pix);
-
-    paintable = gtk_image_get_paintable(GTK_IMAGE(img));
-
-    gtk_drag_source_set_icon(source, paintable, 0, 0);
-    g_object_unref(paintable);
-  }
-}
-
-/************************************************************************//**
-  Reset worklist for city
-****************************************************************************/
-void reset_city_worklist(GtkWidget *editor, struct city *pcity)
-{
-  struct worklist_data *ptr;
-  GtkDragSource *dnd_src;
-
-  ptr = g_object_get_data(G_OBJECT(editor), "data");
-
-  ptr->global_worklist_id = -1;
-  ptr->pcity = pcity;
-
-  gtk_list_store_clear(ptr->src_depr);
-  gtk_list_store_clear(ptr->dst_depr);
-
-  g_object_set(ptr->src_col, "visible", TRUE, NULL);
-  g_object_set(ptr->dst_col, "visible", TRUE, NULL);
-
-  dnd_src = gtk_drag_source_new();
-
-  g_signal_connect(dnd_src, "prepare", G_CALLBACK(drag_prepare), ptr);
-  g_signal_connect(dnd_src, "drag-begin", G_CALLBACK(drag_begin), ptr);
-
-  gtk_widget_add_controller(GTK_WIDGET(ptr->src_view_depr),
-                            GTK_EVENT_CONTROLLER(dnd_src));
-}
-
-/************************************************************************//**
-  Reset one of the global worklists
-****************************************************************************/
-static void reset_global_worklist(GtkWidget *editor,
-                                  struct global_worklist *pgwl)
-{
-  struct worklist_data *ptr;
-
-  ptr = g_object_get_data(G_OBJECT(editor), "data");
-
-  ptr->global_worklist_id = global_worklist_id(pgwl);
-  ptr->pcity = nullptr;
-
-  gtk_list_store_clear(ptr->src_depr);
-  gtk_list_store_clear(ptr->dst_depr);
-
-  gtk_widget_set_visible(ptr->change_cmd, FALSE);
-  g_object_set(ptr->src_col, "visible", FALSE, NULL);
-  g_object_set(ptr->dst_col, "visible", FALSE, NULL);
-
-  gtk_tree_view_unset_rows_drag_source(GTK_TREE_VIEW(ptr->src_view_depr));
-}
-
-/************************************************************************//**
-  Refresh worklist info
-****************************************************************************/
-void refresh_worklist(GtkWidget *editor)
-{
-  struct worklist_data *ptr;
-  struct worklist queue;
-  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
-  int i, targets_used;
-  struct item items[MAX_NUM_PRODUCTION_TARGETS];
-  bool selected;
-  gint id;
-  GtkTreeIter it;
-  GtkTreePath *path;
-  GtkTreeModel *model_depr;
-  gboolean exists;
-
-  ptr = g_object_get_data(G_OBJECT(editor), "data");
-
-  /* Refresh source tasks. */
-  if (gtk_tree_selection_get_selected(ptr->src_selection_depr, NULL, &it)) {
-    gtk_tree_model_get(GTK_TREE_MODEL(ptr->src_depr), &it, 0, &id, -1);
-    selected = TRUE;
-  } else {
-    selected = FALSE;
-  }
-
-  /* These behave just right if ptr->pcity is NULL -> in case of global
-   * worklist. */
-  targets_used = collect_eventually_buildable_targets(targets, ptr->pcity,
-                                                      ptr->future);
-  name_and_sort_items(targets, targets_used, items, FALSE, ptr->pcity);
-
-  /* Re-purpose existing items in the list store -- this avoids the
-   * UI jumping around (especially as the set of source tasks doesn't
-   * actually change much in practice). */
-  model_depr = GTK_TREE_MODEL(ptr->src_depr);
-  exists = gtk_tree_model_get_iter_first(model_depr, &it);
-
-  path = NULL;
-  for (i = 0; i < targets_used; i++) {
-    char buf[8192];
-
-    if (!exists) {
-      gtk_list_store_append(ptr->src_depr, &it);
-    }
-
-    gtk_list_store_set(ptr->src_depr, &it, 0, (gint)cid_encode(items[i].item),
-                       1, production_help(&(items[i].item),
-                                          buf, sizeof(buf)), -1);
-
-    if (selected && cid_encode(items[i].item) == id) {
-      path = gtk_tree_model_get_path(GTK_TREE_MODEL(ptr->src_depr), &it);
-    }
-
-    if (exists) {
-      exists = gtk_tree_model_iter_next(model_depr, &it);
-    }
-  }
-
-  /* If the list got shorter, delete any excess items. */
-  if (exists) {
-    GtkTreeIter it_next;
-    bool more;
-
-    do {
-      it_next = it;
-      more = gtk_tree_model_iter_next(model_depr, &it_next);
-
-      gtk_list_store_remove(ptr->src_depr, &it);
-      it = it_next;
-    } while (more);
-  }
-
-  /* Select the same item that was previously selected, if any. */
-  if (path) {
-    gtk_tree_view_set_cursor(GTK_TREE_VIEW(ptr->src_view_depr), path, NULL, FALSE);
-    gtk_tree_path_free(path);
-  }
-
-  /* Refresh target worklist. */
-  model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-  exists = gtk_tree_model_get_iter_first(model_depr, &it);
-
-  /* Dance around worklist braindamage. */
-  if (ptr->pcity != NULL) {
-    city_get_queue(ptr->pcity, &queue);
-  } else {
-    const struct global_worklist *pgwl;
-
-    pgwl = global_worklist_by_id(ptr->global_worklist_id);
-
-    fc_assert(NULL != pgwl);
-
-    worklist_copy(&queue, global_worklist_get(pgwl));
-  }
-
-  for (i = 0; i < worklist_length(&queue); i++) {
-    struct universal target = queue.entries[i];
-    char buf[8192];
-
-    if (!exists) {
-      gtk_list_store_append(ptr->dst_depr, &it);
-    }
-
-    gtk_list_store_set(ptr->dst_depr, &it, 0, (gint)cid_encode(target),
-                       1, production_help(&target,
-                                          buf, sizeof(buf)), -1);
-
-    if (exists) {
-      exists = gtk_tree_model_iter_next(model_depr, &it);
-    }
-  }
-
-  if (exists) {
-    GtkTreeIter it_next;
-    bool more;
-
-    do {
-      it_next = it;
-      more = gtk_tree_model_iter_next(model_depr, &it_next);
-
-      gtk_list_store_remove(ptr->dst_depr, &it);
-      it = it_next;
-    } while (more);
-  }
-
-  create_wl_menu(ptr);
-
-  /* Update widget sensitivity. */
-  if (ptr->pcity) {
-    if ((can_client_issue_orders()
-         && city_owner(ptr->pcity) == client.conn.playing)) {
-      gtk_widget_set_sensitive(ptr->dst_view_depr, TRUE);
-    } else {
-      gtk_widget_set_sensitive(ptr->dst_view_depr, FALSE);
-    }
-  } else {
-    gtk_widget_set_sensitive(ptr->dst_view_depr, TRUE);
-  }
-}
-
-/************************************************************************//**
-  Commit worklist data to worklist
-****************************************************************************/
-static void commit_worklist(struct worklist_data *ptr)
-{
-  struct worklist queue;
-  GtkTreeModel *model_depr;
-  GtkTreeIter it;
-  size_t i;
-
-  model_depr = GTK_TREE_MODEL(ptr->dst_depr);
-
-  worklist_init(&queue);
-
-  i = 0;
-  if (gtk_tree_model_get_iter_first(model_depr, &it)) {
-    do {
-      gint id;
-      struct universal univ;
-
-      /* Oops, the player has a worklist longer than what we can store. */
-      if (i >= MAX_LEN_WORKLIST) {
-        break;
-      }
-
-      gtk_tree_model_get(model_depr, &it, 0, &id, -1);
-      univ = cid_production(id);
-      worklist_append(&queue, &univ);
-
-      i++;
-    } while (gtk_tree_model_iter_next(model_depr, &it));
-  }
-
-  /* Dance around worklist braindamage. */
-  if (ptr->pcity) {
-    if (!city_set_queue(ptr->pcity, &queue)) {
-      /* Failed to change worklist. This means worklist visible
-       * on screen is not true. */
-      refresh_worklist(ptr->editor);
-    }
-  } else {
-    struct global_worklist *pgwl;
-
-    pgwl = global_worklist_by_id(ptr->global_worklist_id);
-    if (pgwl) {
-      global_worklist_set(pgwl, &queue);
-    }
-  }
-}
diff --git a/client/gui-gtk-5.0/wldlg.h b/client/gui-gtk-5.0/wldlg.h
deleted file mode 100644
index 0ada9d9252..0000000000
--- a/client/gui-gtk-5.0/wldlg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-#ifndef FC__WLDLG_H
-#define FC__WLDLG_H
-
-#include <gtk/gtk.h>
-
-/* common */
-#include "improvement.h"
-#include "unittype.h"
-#include "worklist.h"
-
-/* client */
-#include "climisc.h"
-
-#include "wldlg_g.h"
-
-/* The global worklist view. */
-void popup_worklists_report(void);
-
-/* An individual worklist. */
-GtkWidget *create_worklist(void);
-void reset_city_worklist(GtkWidget *editor, struct city *pcity);
-void refresh_worklist(GtkWidget *editor);
-
-void add_worklist_dnd_target(GtkWidget *w,
-                             gboolean (drag_drop_cb)
-                               (GtkDropTarget *target, const GValue *value,
-                                double x, double y, gpointer data),
-                             gpointer data);
-
-void blank_max_unit_size(void);
-
-#endif /* FC__WLDLG_H */
diff --git a/tools/fcmp/mpgui_gtk5.c b/tools/fcmp/mpgui_gtk5.c
deleted file mode 100644
index ee6180871f..0000000000
--- a/tools/fcmp/mpgui_gtk5.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/***********************************************************************
- Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-***********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-/* utility */
-#include "fc_cmdline.h"
-#include "fciconv.h"
-#include "fcintl.h"
-#include "log.h"
-#include "mem.h"
-
-/* common */
-#include "version.h"
-
-/* modinst */
-#include "download.h"
-#include "mpcmdline.h"
-#include "mpdb.h"
-
-#include "modinst.h"
-
-static GtkWidget *toplevel;
-static GtkWidget *statusbar;
-static GtkWidget *progressbar;
-static GtkWidget *main_list;
-static GListStore *main_store;
-static GtkWidget *URL_input;
-static GtkAlertDialog *quit_dialog;
-static gboolean downloading = FALSE;
-
-struct fcmp_params fcmp = {
-  .list_url = MODPACK_LIST_URL,
-  .inst_prefix = nullptr,
-  .autoinstall = nullptr
-};
-
-static GtkApplication *fcmp_app;
-
-static gboolean quit_dialog_callback(void);
-
-#define ML_COL_NAME    0
-#define ML_COL_VER     1
-#define ML_COL_INST    2
-#define ML_COL_TYPE    3
-#define ML_COL_SUBTYPE 4
-#define ML_COL_LIC     5
-#define ML_COL_URL     6
-
-#define ML_COL_COUNT   7
-
-#define ML_TYPE        7
-#define ML_NOTES       8
-#define ML_STORE_SIZE  9
-
-#define FC_TYPE_MPROW (fc_mprow_get_type())
-
-G_DECLARE_FINAL_TYPE(FcMPRow, fc_mprow, FC, MPROW, GObject)
-
-struct _FcMPRow
-{
-  GObject parent_instance;
-
-  const char *name;
-  const char *ver;
-  const char *inst;
-  const char *type;
-  const char *subtype;
-  const char *lic;
-  char *URL;
-  const char *notes;
-
-  int type_int;
-};
-
-struct _FcMPRowClass
-{
-  GObjectClass parent_class;
-};
-
-G_DEFINE_TYPE(FcMPRow, fc_mprow, G_TYPE_OBJECT)
-
-/**********************************************************************//**
-  Finalizing method for FcMPRow class
-**************************************************************************/
-static void fc_mprow_finalize(GObject *gobject)
-{
-  FcMPRow *row = FC_MPROW(gobject);
-
-  free(row->URL);
-  row->URL = nullptr;
-
-  G_OBJECT_CLASS(fc_mprow_parent_class)->finalize(gobject);
-}
-
-/**********************************************************************//**
-  Initialization method for FcMPRow class
-**************************************************************************/
-static void
-fc_mprow_class_init(FcMPRowClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS(klass);
-
-  object_class->finalize = fc_mprow_finalize;
-}
-
-/**********************************************************************//**
-  Initialization method for FcMPRow
-**************************************************************************/
-static void
-fc_mprow_init(FcMPRow *self)
-{
-  self->URL = nullptr;
-}
-
-/**********************************************************************//**
-  FcMPRow creation method
-**************************************************************************/
-static FcMPRow *fc_mprow_new(void)
-{
-  FcMPRow *result;
-
-  result = g_object_new(FC_TYPE_MPROW, nullptr);
-
-  return result;
-}
-
-/**********************************************************************//**
-  freeciv-modpack quit
-**************************************************************************/
-static void modinst_quit(void)
-{
-  g_application_quit(G_APPLICATION(fcmp_app));
-}
-
-/**********************************************************************//**
-  This is the response callback for the dialog with the message:
-  Are you sure you want to quit?
-**************************************************************************/
-static void quit_dialog_response(GObject *dialog, GAsyncResult *result,
-                                 gpointer data)
-{
-  int button = gtk_alert_dialog_choose_finish(GTK_ALERT_DIALOG(dialog),
-                                              result, nullptr);
-
-  if (button == 0) {
-    modinst_quit();
-  }
-
-  quit_dialog = nullptr;
-}
-
-/**********************************************************************//**
-  Popups the quit dialog if download in progress
-**************************************************************************/
-static gboolean quit_dialog_callback(void)
-{
-  if (downloading) {
-    /* Download in progress. Confirm quit from user. */
-
-    if (quit_dialog == nullptr) {
-      const char *buttons[] = { _("Quit"), _("Cancel"), nullptr };
-
-      quit_dialog = gtk_alert_dialog_new(_("Modpack installation in progress.\n"
-                                           "Are you sure you want to quit?"));
-
-      gtk_alert_dialog_set_buttons(GTK_ALERT_DIALOG(quit_dialog), buttons);
-
-      gtk_alert_dialog_choose(GTK_ALERT_DIALOG(quit_dialog),
-                              GTK_WINDOW(toplevel), nullptr,
-                              quit_dialog_response, nullptr);
-    }
-
-  } else {
-    /* User loses no work by quitting, so let's not annoy them
-     * with confirmation dialog. */
-    modinst_quit();
-  }
-
-  /* Stop emission of event. */
-  return TRUE;
-}
-
-/**********************************************************************//**
-  Progress indications from downloader
-**************************************************************************/
-static void msg_callback(const char *msg)
-{
-  log_verbose("%s", msg);
-  gtk_label_set_text(GTK_LABEL(statusbar), msg);
-}
-
-/**********************************************************************//**
-  Progress indications from downloader
-**************************************************************************/
-static void pbar_callback(int downloaded, int max)
-{
-  /* Control file already downloaded */
-  double fraction = (double) downloaded / (max);
-
-  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), fraction);
-}
-
-struct msg_data {
-  char *msg;
-};
-
-/**********************************************************************//**
-  Main thread handling of message sent from downloader thread.
-**************************************************************************/
-static gboolean msg_main_thread(gpointer user_data)
-{
-  struct msg_data *data = (struct msg_data *)user_data;
-
-  msg_callback(data->msg);
-
-  FC_FREE(data->msg);
-  FC_FREE(data);
-
-  return G_SOURCE_REMOVE;
-}
-
-/**********************************************************************//**
-  Downloader thread message callback.
-**************************************************************************/
-static void msg_dl_thread(const char *msg)
-{
-  struct msg_data *data = fc_malloc(sizeof(*data));
-
-  data->msg = fc_strdup(msg);
-
-  g_idle_add(msg_main_thread, data);
-}
-
-struct pbar_data {
-  int current;
-  int max;
-};
-
-/**********************************************************************//**
-  Main thread handling of progressbar update sent from downloader thread.
-**************************************************************************/
-static gboolean pbar_main_thread(gpointer user_data)
-{
-  struct pbar_data *data = (struct pbar_data *)user_data;
-
-  pbar_callback(data->current, data->max);
-
-  FC_FREE(data);
-
-  return G_SOURCE_REMOVE;
-}
-
-/**********************************************************************//**
-  Downloader thread progress bar callback.
-**************************************************************************/
-static void pbar_dl_thread(int current, int max)
-{
-  struct pbar_data *data = fc_malloc(sizeof(*data));
-
-  data->current = current;
-  data->max = max;
-
-  g_idle_add(pbar_main_thread, data);
-}
-
-/**********************************************************************//**
-  Main thread handling of versionlist update requested by downloader thread
-**************************************************************************/
-static gboolean versionlist_update_main_thread(gpointer user_data)
-{
-#if 0
-  GtkTreeIter iter;
-
-  if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(main_store), &iter)) {
-    do {
-      const char *name_str;
-      int type_int;
-      const char *new_inst;
-      enum modpack_type type;
-
-      gtk_tree_model_get(GTK_TREE_MODEL(main_store), &iter,
-                         ML_COL_NAME, &name_str,
-                         ML_TYPE, &type_int,
-                         -1);
-
-     type = type_int;
-
-     new_inst = mpdb_installed_version(name_str, type);
-
-     if (new_inst == nullptr) {
-       new_inst = _("Not installed");
-     }
-
-     gtk_list_store_set(main_store, &iter,
-                        ML_COL_INST, new_inst,
-                        -1);
-
-    } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(main_store), &iter));
-  }
-#endif
-
-  return G_SOURCE_REMOVE;
-}
-
-/**********************************************************************//**
-  Downloader thread requests versionlist update.
-**************************************************************************/
-static void versionlist_update_dl_thread(void)
-{
-  g_idle_add(versionlist_update_main_thread, nullptr);
-}
-
-/**********************************************************************//**
-  Entry point for downloader thread
-**************************************************************************/
-static gpointer download_thread(gpointer data)
-{
-  const char *errmsg;
-
-  errmsg = download_modpack(data, &fcmp, msg_dl_thread, pbar_dl_thread);
-
-  if (errmsg == nullptr) {
-    msg_dl_thread(_("Ready"));
-  } else {
-    msg_dl_thread(errmsg);
-  }
-
-  free(data);
-
-  versionlist_update_dl_thread();
-
-  downloading = FALSE;
-
-  return nullptr;
-}
-
-/**********************************************************************//**
-  Download modpack, display error message dialogs
-**************************************************************************/
-static void gui_download_modpack(const char *URL)
-{
-  GThread *downloader;
-  char *URLbuf;
-
-  if (downloading) {
-    gtk_label_set_text(GTK_LABEL(statusbar),
-                       _("Another download already active"));
-    return;
-  }
-
-  downloading = TRUE;
-
-  URLbuf = fc_malloc(strlen(URL) + 1);
-
-  strcpy(URLbuf, URL);
-
-  downloader = g_thread_new("Downloader", download_thread, URLbuf);
-  if (downloader == nullptr) {
-    gtk_label_set_text(GTK_LABEL(statusbar),
-                       _("Failed to start downloader"));
-    free(URLbuf);
-  } else {
-    g_thread_unref(downloader);
-  }
-}
-
-/**********************************************************************//**
-  Install modpack button clicked
-**************************************************************************/
-static void install_clicked(GtkWidget *w, gpointer data)
-{
-  GtkEntry *URL_in = data;
-  GtkEntryBuffer *buffer = gtk_entry_get_buffer(URL_in);
-  const char *URL = gtk_entry_buffer_get_text(buffer);
-
-  gui_download_modpack(URL);
-}
-
-/**********************************************************************//**
-  URL entered
-**************************************************************************/
-static void URL_return(GtkEntry *w, gpointer data)
-{
-  const char *URL;
-  GtkEntryBuffer *buffer = gtk_entry_get_buffer(w);
-
-  URL = gtk_entry_buffer_get_text(buffer);
-  gui_download_modpack(URL);
-}
-
-/**********************************************************************//**
-  Callback for getting main list row tooltip
-**************************************************************************/
-static gboolean query_main_list_tooltip_cb(GtkWidget *widget,
-                                           gint x, gint y,
-                                           gboolean keyboard_tip,
-                                           GtkTooltip *tooltip,
-                                           gpointer data)
-{
-  GtkWidget *child = gtk_widget_get_first_child(gtk_widget_get_next_sibling(gtk_widget_get_first_child(widget)));
-  int row_number = -1; /* 0 after header */
-  int curr_y = 0;
-
-  while (GTK_IS_WIDGET(child)) {
-    curr_y += gtk_widget_get_height(GTK_WIDGET(child));
-
-    if (curr_y > y) {
-      FcMPRow *row = g_list_model_get_item(G_LIST_MODEL(main_store), row_number);
-
-      if (row != nullptr) {
-        log_debug("Tooltip row %d. Notes: %s", row_number,
-                  row->notes == nullptr ? "-" : row->notes);
-
-        if (row->notes != nullptr) {
-          gtk_tooltip_set_markup(tooltip, row->notes);
-
-          return TRUE;
-        }
-      }
-
-      return FALSE;
-    }
-
-    row_number++;
-
-    child = gtk_widget_get_next_sibling(child);
-  }
-
-  return FALSE;
-}
-
-/**********************************************************************//**
-  Build main modpack list view
-**************************************************************************/
-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)
-{
-  FcMPRow *row;
-
-  row = fc_mprow_new();
-
-  if (modpack_type_is_valid(type)) {
-    row->type = _(modpack_type_name(type));
-  } else {
-    /* TRANS: Unknown modpack type */
-    row->type = _("?");
-  }
-
-  if (license != nullptr) {
-    row->lic = license;
-  } else {
-    /* TRANS: License of modpack is not known */
-    row->lic = Q_("?license:Unknown");
-  }
-
-  row->inst = mpdb_installed_version(name, type);
-  if (row->inst == nullptr) {
-    row->inst = _("Not installed");
-  }
-
-  row->name = name;
-  row->ver = version;
-  row->subtype = subtype;
-  row->URL = fc_strdup(URL);
-  row->notes = notes;
-
-  row->type_int = type;
-
-  g_list_store_append(main_store, row);
-  g_object_unref(row);
-}
-
-/**********************************************************************//**
-  Callback called when entry from main modpack list selected
-**************************************************************************/
-static void selection_change(GtkSelectionModel *model,
-                             guint position, guint n_items,
-                             gpointer user_data)
-{
-  GtkSingleSelection *selection = GTK_SINGLE_SELECTION(model);
-  int row_number = gtk_single_selection_get_selected(selection);
-  GListModel *lmodel = gtk_single_selection_get_model(selection);
-  FcMPRow *row = g_list_model_get_item(lmodel, row_number);
-  GtkEntryBuffer *buffer;
-
-  log_debug("Selected row: %d. URL: %s", row_number, row->URL);
-
-  buffer = gtk_entry_get_buffer(GTK_ENTRY(URL_input));
-  gtk_entry_buffer_set_text(buffer, row->URL, -1);
-}
-
-/**********************************************************************//**
-  Table cell bind function
-**************************************************************************/
-static void factory_bind(GtkSignalListItemFactory *self,
-                         GtkListItem *list_item,
-                         gpointer user_data)
-{
-  FcMPRow *row;
-  const char *str = "-";
-
-  row = gtk_list_item_get_item(list_item);
-
-  switch (GPOINTER_TO_INT(user_data)) {
-  case ML_COL_NAME:
-    str = row->name;
-    break;
-  case ML_COL_VER:
-    str = row->ver;
-    break;
-  case ML_COL_INST:
-    str = row->inst;
-    break;
-  case ML_COL_TYPE:
-    str = row->type;
-    break;
-  case ML_COL_SUBTYPE:
-    str = row->subtype;
-    break;
-  case ML_COL_LIC:
-    str = row->lic;
-    break;
-  case ML_COL_URL:
-    str = row->URL;
-    break;
-  }
-
-  gtk_label_set_text(GTK_LABEL(gtk_list_item_get_child(list_item)),
-                     str);
-}
-
-/**********************************************************************//**
-  Table cell setup function
-**************************************************************************/
-static void factory_setup(GtkSignalListItemFactory *self,
-                          GtkListItem *list_item,
-                          gpointer user_data)
-{
-  gtk_list_item_set_child(list_item, gtk_label_new(""));
-}
-
-/**********************************************************************//**
-  Build widgets
-**************************************************************************/
-static void modinst_setup_widgets(void)
-{
-  GtkWidget *mbox, *Ubox;
-  GtkWidget *version_label;
-  GtkWidget *install_button;
-  GtkWidget *URL_label;
-  GtkColumnViewColumn *column;
-  GtkListItemFactory *factory;
-  GtkSingleSelection *selection;
-  const char *errmsg;
-  char verbuf[2048];
-  const char *rev_ver;
-
-  mbox = gtk_grid_new();
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(mbox),
-                                 GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_row_spacing(GTK_GRID(mbox), 4);
-
-  rev_ver = fc_git_revision();
-
-  if (rev_ver == nullptr) {
-    fc_snprintf(verbuf, sizeof(verbuf), "%s%s", word_version(), VERSION_STRING);
-  } else {
-    fc_snprintf(verbuf, sizeof(verbuf), _("%s%s\ncommit: %s"),
-                word_version(), VERSION_STRING, rev_ver);
-  }
-
-  version_label = gtk_label_new(verbuf);
-
-  main_store = g_list_store_new(FC_TYPE_MPROW);
-  selection = gtk_single_selection_new(G_LIST_MODEL(main_store));
-  g_signal_connect(selection, "selection-changed", G_CALLBACK(selection_change),
-                   nullptr);
-
-  main_list = gtk_column_view_new(GTK_SELECTION_MODEL(selection));
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_NAME));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("Name"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_VER));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("Version"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_INST));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("Installed"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_TYPE));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(Q_("?modpack:Type"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_SUBTYPE));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("Subtype"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_LIC));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("License"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  factory = gtk_signal_list_item_factory_new();
-  g_signal_connect(factory, "bind", G_CALLBACK(factory_bind),
-                   GINT_TO_POINTER(ML_COL_URL));
-  g_signal_connect(factory, "setup", G_CALLBACK(factory_setup), nullptr);
-
-  column = gtk_column_view_column_new(_("URL"), factory);
-  gtk_column_view_append_column(GTK_COLUMN_VIEW(main_list), column);
-
-  install_button = gtk_button_new();
-  gtk_button_set_label(GTK_BUTTON(install_button), _("Install modpack"));
-
-  Ubox = gtk_grid_new();
-  gtk_widget_set_halign(Ubox, GTK_ALIGN_CENTER);
-  gtk_grid_set_column_spacing(GTK_GRID(Ubox), 4);
-  URL_label = gtk_label_new_with_mnemonic(_("Modpack URL"));
-
-  URL_input = gtk_entry_new();
-  gtk_entry_buffer_set_text(gtk_entry_get_buffer(GTK_ENTRY(URL_input)),
-                            DEFAULT_URL_START, -1);
-  g_signal_connect(URL_input, "activate",
-		   G_CALLBACK(URL_return), nullptr);
-
-  g_signal_connect(install_button, "clicked",
-                   G_CALLBACK(install_clicked), URL_input);
-
-  gtk_grid_attach(GTK_GRID(Ubox), URL_label, 0, 0, 1, 1);
-  gtk_grid_attach(GTK_GRID(Ubox), URL_input, 0, 1, 1, 1);
-
-  progressbar = gtk_progress_bar_new();
-
-  statusbar = gtk_label_new(_("Select modpack to install"));
-
-  gtk_widget_set_hexpand(main_list, TRUE);
-  gtk_widget_set_vexpand(main_list, TRUE);
-
-  gtk_grid_attach(GTK_GRID(mbox), version_label, 0, 0, 1, 1);
-  gtk_grid_attach(GTK_GRID(mbox), main_list, 0, 1, 1, 1);
-  gtk_grid_attach(GTK_GRID(mbox), Ubox, 0, 2, 1, 1);
-  gtk_grid_attach(GTK_GRID(mbox), install_button, 0, 3, 1, 1);
-  gtk_grid_attach(GTK_GRID(mbox), progressbar, 0, 4, 1, 1);
-  gtk_grid_attach(GTK_GRID(mbox), statusbar, 0, 5, 1, 1);
-
-  gtk_window_set_child(GTK_WINDOW(toplevel), mbox);
-
-  errmsg = download_modpack_list(&fcmp, setup_modpack_list, msg_callback);
-
-  g_object_set(main_list, "has-tooltip", TRUE, nullptr);
-  g_signal_connect(main_list, "query-tooltip",
-                   G_CALLBACK(query_main_list_tooltip_cb), nullptr);
-
-  if (errmsg != nullptr) {
-    gtk_label_set_text(GTK_LABEL(statusbar), errmsg);
-  }
-}
-
-/**********************************************************************//**
-  Run the gui
-**************************************************************************/
-static void activate_gui(GtkApplication *app, gpointer data)
-{
-  quit_dialog = nullptr;
-
-  toplevel = gtk_application_window_new(app);
-
-  gtk_widget_realize(toplevel);
-  gtk_widget_set_name(toplevel, "Freeciv-modpack");
-  gtk_window_set_title(GTK_WINDOW(toplevel),
-                       _("Freeciv modpack installer (gtk4x)"));
-
-#if 0
-    /* Keep the icon of the executable on Windows */
-#ifndef FREECIV_MSWINDOWS
-  {
-    /* Unlike main client, this only works if installed. Ignore any
-     * errors loading the icon. */
-    GError *err;
-
-    (void) gtk_window_set_icon_from_file(GTK_WINDOW(toplevel),
-                                         MPICON_PATH, &err);
-  }
-#endif /* FREECIV_MSWINDOWS */
-#endif /* 0 */
-
-  g_signal_connect(toplevel, "close_request",
-                   G_CALLBACK(quit_dialog_callback), nullptr);
-
-  modinst_setup_widgets();
-
-  gtk_widget_set_visible(toplevel, TRUE);
-
-  if (fcmp.autoinstall != nullptr) {
-    gui_download_modpack(fcmp.autoinstall);
-  }
-}
-
-/**********************************************************************//**
-  Entry point of the freeciv-modpack program
-**************************************************************************/
-int main(int argc, char *argv[])
-{
-  int ui_options;
-
-  fcmp_init();
-
-  /* This modifies argv! */
-  ui_options = fcmp_parse_cmdline(argc, argv);
-
-  if (ui_options != -1) {
-    int i;
-
-    for (i = 1; i <= ui_options; i++) {
-      if (is_option("--help", argv[i])) {
-        /* TRANS: No full stop after the URL, could cause confusion. */
-        fc_fprintf(stderr, _("Report bugs at %s\n"), BUG_URL);
-
-        ui_options = -1;
-      }
-    }
-  }
-
-  if (ui_options != -1) {
-    load_install_info_lists(&fcmp);
-
-    if (gtk_init_check()) {
-      fcmp_app = gtk_application_new(nullptr, 0);
-      g_signal_connect(fcmp_app, "activate",
-                       G_CALLBACK(activate_gui), nullptr);
-      g_application_run(G_APPLICATION(fcmp_app), 0, nullptr);
-
-      g_object_unref(fcmp_app);
-    } else {
-      log_fatal(_("Failed to open graphical mode."));
-    }
-
-    close_mpdbs();
-  }
-
-  fcmp_deinit();
-  cmdline_option_values_free();
-
-  return EXIT_SUCCESS;
-}
-- 
2.51.0

