Description: Port to GTK+ 3 and GSettings.
Bug-Debian: https://bugs.debian.org/885740
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2018-08-21
---

--- gnomekiss-2.0.orig/configure.in
+++ gnomekiss-2.0/configure.in
@@ -10,7 +10,7 @@
 AM_PROG_CC_STDC
 AC_HEADER_STDC
 
-pkg_modules="libgnomeui-2.0"
+pkg_modules="gtk+-3.0 libcanberra"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 AC_SUBST(PACKAGE_CFLAGS)
 AC_SUBST(PACKAGE_LIBS)
@@ -22,6 +22,7 @@
 dnl Add the languages which your application supports here.
 ALL_LINGUAS="en_GB es es_ES"
 AM_GLIB_GNU_GETTEXT
+GLIB_GSETTINGS
 
 AC_OUTPUT([
 Makefile
--- gnomekiss-2.0.orig/src/main.c
+++ gnomekiss-2.0/src/main.c
@@ -20,64 +20,115 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
 
 #include "interface.h"
 #include "support.h"
 #include "kiss.h"
 
 /* Implementation */
-GtkWidget *app, *area, *appbar, *pref_dialog, *error_clist;
-GtkWidget *about, *error_list, *set_open, *config_open, *add_open;
+GtkWidget *app, *area, *appbar, *pbar, *error_clist;
+GtkWidget *about, *error_list;
 GtkWidget *buttons[SETS], *items[SETS];
 
 static GtkTargetEntry targets[1]= { { "text/uri-list", 0, 1} };
 
-static void set_toggle(char *toggle, gboolean value) {
-  GtkWidget *widget;
-
-  widget = lookup_widget(pref_dialog, toggle);
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), value);
-}
-
 static void preferences(void) {
-  GtkWidget *widget;
+  GKeyFile *kf;
+  gchar *file;
 
-  gnome_config_push_prefix("/GnomeKiss/");
-  prefs.midi= gnome_config_get_bool("Sound/midi=true");
-  set_toggle("pref_midi", prefs.midi);
-
-  prefs.midi_player= gnome_config_get_string("Sound/midi_player=playmidi");
-  widget = lookup_widget(pref_dialog, "pref_midi_player");
-  gtk_entry_set_text(GTK_ENTRY(widget), prefs.midi_player);
-
-  prefs.esound= gnome_config_get_bool("Sound/esound=true");
-  set_toggle("pref_esound", prefs.esound);
-
-  prefs.error_list= gnome_config_get_bool("Diagnostics/error_list=true");
-  set_toggle("pref_error_list", prefs.error_list);
-  prefs.warnings= gnome_config_get_bool("Diagnostics/warnings=true");
-  set_toggle("pref_warnings", prefs.warnings);
-  prefs.trace= gnome_config_get_bool("Diagnostics/trace=false");
-  set_toggle("pref_trace", prefs.trace);
-
-  prefs.ignore_colon= gnome_config_get_bool("Features/ignore_colon=false");
-  set_toggle("pref_ignore_colon", prefs.ignore_colon);
-  prefs.fkiss_case= gnome_config_get_bool("Features/fkiss_case=false");
-  set_toggle("pref_fkiss_case", prefs.fkiss_case);
-  prefs.default_palette= gnome_config_get_bool("Features/default_palette=false");
-  set_toggle("pref_default_palette", prefs.default_palette);
-  
-  prefs.speed_factor= gnome_config_get_int("Features/speed_factor=1");
-  widget = lookup_widget(pref_dialog, "pref_speed_factor");
-  gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),(gfloat)prefs.speed_factor);
-
-  prefs.min_timer= gnome_config_get_int("Features/min_timer=1");
-  widget = lookup_widget(pref_dialog, "pref_min_timer");
-  gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),(gfloat)prefs.min_timer);
+  settings = g_settings_new("org.tlrmx.devel.GnomeKiss");
 
-  prefs.catch_drop= gnome_config_get_bool("Features/catch_drop=false");
-  set_toggle("pref_catch_drop", prefs.catch_drop);
+  /* Migrate old settings; code can be dropped for bullseye.  */
+  kf = g_key_file_new();
+  file = g_build_filename(g_get_home_dir(), ".gnome2", "GnomeKiss", NULL);
+
+  if (g_key_file_load_from_file(kf, file, G_KEY_FILE_NONE, NULL)) {
+    gchar **groups;
+    gsize len;
+
+    /* File exists but if the user never changed the settings it will
+       contain only the Placement section (internal Bonobo stuff).  */
+    groups = g_key_file_get_groups(kf, &len);
+    if (len > 1) {
+      gchar *player;
+
+      /* Apply all changes at once.  */
+      g_settings_delay(settings);
+      g_settings_set_boolean(settings, "midi",
+                             g_key_file_get_boolean(kf, "Sound",
+                                                    "midi", NULL));
+      g_settings_set_boolean(settings, "sound",
+                             g_key_file_get_boolean(kf, "Sound",
+                                                    "esound", NULL));
+      player = g_key_file_get_string(kf, "Sound", "midi_player", NULL);
+      g_settings_set_string(settings, "midi-player", player);
+      g_free(player);
+
+      g_settings_set_boolean(settings, "error-list",
+                             g_key_file_get_boolean(kf, "Diagnostics",
+                                                    "error_list", NULL));
+      g_settings_set_boolean(settings, "trace",
+                             g_key_file_get_boolean(kf, "Diagnostics",
+                                                    "trace", NULL));
+      g_settings_set_boolean(settings, "warnings",
+                             g_key_file_get_boolean(kf, "Diagnostics",
+                                                    "warnings", NULL));
+
+      g_settings_set_boolean(settings, "ignore-colon",
+                             g_key_file_get_boolean(kf, "Features",
+                                                    "ignore_colon", NULL));
+      g_settings_set_boolean(settings, "default-palette",
+                             g_key_file_get_boolean(kf, "Features",
+                                                    "default_palette", NULL));
+      g_settings_set_boolean(settings, "fkiss-case",
+                             g_key_file_get_boolean(kf, "Features",
+                                                    "fkiss_case", NULL));
+      g_settings_set_boolean(settings, "catch-drop",
+                             g_key_file_get_boolean(kf, "Features",
+                                                    "catch_drop", NULL));
+      g_settings_set_int(settings, "speed-factor",
+                         g_key_file_get_integer(kf, "Features",
+                                                "speed_factor", NULL));
+      g_settings_set_int(settings, "min-timer",
+                         g_key_file_get_integer(kf, "Features",
+                                                "min_timer", NULL));
+      g_settings_apply(settings);
+    }
+
+    /* Is it safe to delete the old file?  I guess so, if GSettings'
+       promises regarding atomicity can be trusted.  OTOH, if it
+       contained only the Placement section, it is useless anyway.  */
+    g_unlink(file);
+    g_strfreev(groups);
+  }
+
+  g_free(file);
+  g_key_file_free(kf);
+
+  /* The Preferences dialog is not constructed yet but the prefs
+     struct still needs to be populated so that the program functions
+     properly.  The settings will be read again when the user opens
+     the Preferences; this is supposed to be a cheap operation.  The
+     original code relied on accessing all widgets as pointers which
+     is wasteful as it keeps them allocated for the lifetime of the
+     program.  */
+  prefs.midi= g_settings_get_boolean(settings, "midi");
+  prefs.midi_player= g_settings_get_string(settings, "midi-player");
+  prefs.esound= g_settings_get_boolean(settings, "sound");
+
+  prefs.error_list= g_settings_get_boolean(settings, "error-list");
+  prefs.warnings= g_settings_get_boolean(settings, "warnings");
+  prefs.trace= g_settings_get_boolean(settings, "trace");
+
+  prefs.ignore_colon= g_settings_get_boolean(settings, "ignore-colon");
+  prefs.fkiss_case= g_settings_get_boolean(settings, "fkiss-case");
+  prefs.default_palette= g_settings_get_boolean(settings, "default-palette");
+  prefs.speed_factor= g_settings_get_int(settings, "speed-factor");
+  prefs.min_timer= g_settings_get_int(settings, "min-timer");
+  prefs.catch_drop= g_settings_get_boolean(settings, "catch-drop");
 }
 
 int
@@ -93,31 +144,20 @@
   textdomain (GETTEXT_PACKAGE);
 #endif
 
-  gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
-                      argc, argv,
-                      GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR,
-                      NULL);
+  gtk_init (&argc, &argv);
 
-  gtk_widget_push_visual(gdk_rgb_get_visual());
-  gtk_widget_push_colormap(gdk_rgb_get_cmap());
   application = create_application ();
   about= create_about ();
   error_list= create_error_list ();
-  set_open= create_set_open ();
-  config_open= create_config_open ();
-  add_open= create_add_open ();
-  pref_dialog= create_preferences ();
-  gtk_widget_pop_visual();
-  gtk_widget_pop_colormap();
 
   /* Get initial prefs state */
   preferences();
 
   app = application;
   area = lookup_widget(app, "area");
+  pbar = lookup_widget(app, "pbar");
   appbar = lookup_widget(app, "appbar");
   error_clist = lookup_widget(error_list, "error_clist");
-  gtk_clist_column_titles_passive(GTK_CLIST (error_clist));
 
   for (i= 0; i < SETS; ++i) {
     snprintf(widget_name, sizeof(widget_name), "show_set%d", i);
--- gnomekiss-2.0.orig/src/support.h
+++ gnomekiss-2.0/src/support.h
@@ -6,7 +6,7 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 
 #undef Q_
 #ifdef ENABLE_NLS
@@ -35,10 +35,6 @@
  * Private Functions.
  */
 
-/* This is used to create the pixmaps used in the interface. */
-GtkWidget*  create_pixmap              (GtkWidget       *widget,
-                                        const gchar     *filename);
-
 /* This is used to create the pixbufs used in the interface. */
 GdkPixbuf*  create_pixbuf              (const gchar     *filename);
 
--- gnomekiss-2.0.orig/src/kiss.h
+++ gnomekiss-2.0/src/kiss.h
@@ -1,7 +1,7 @@
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
-#include <gnome.h>
+#include <gtk/gtk.h>
 
 /* arbitrary limit */
 
@@ -21,10 +21,21 @@
 #define KISS_PENDING 0
 #define KISS_DONE 1
 
-extern GtkWidget *app, *area, *appbar, *pref_dialog, *error_clist;
-extern GtkWidget *about, *error_list, *set_open, *config_open, *add_open;
+extern GtkWidget *app, *area, *appbar, *pbar, *error_clist;
+extern GtkWidget *about, *error_list;
 extern GtkWidget *buttons[SETS], *items[SETS];
 
+static gboolean clear_area = FALSE;
+GSettings *settings;
+GtkListStore *error_store;
+
+enum {
+  FILE_COLUMN,
+  LINE_COLUMN,
+  MESSAGE_COLUMN,
+  N_ELEMENTS
+};
+
 extern int mouse_x, mouse_y;
 
 extern int view;
@@ -254,7 +265,7 @@
 typedef struct {
   gboolean midi;               /* play MIDI */
   gchar  * midi_player;        /* external program to play MIDI */
-  gboolean esound;             /* play WAVs and AUs with GNOME esound */
+  gboolean esound;             /* play WAVs and AUs with libcanberra */
 
   gboolean ignore_colon;       /* treat : without set numbers as ALL */
   gboolean default_palette;    /* a 256 color default palette */
@@ -284,6 +295,7 @@
 
 /* functions */
 
+void show_message(const gchar *message);
 void set_timer(int which, long when);
 void reset_timers(void);
 
--- gnomekiss-2.0.orig/src/cell.c
+++ gnomekiss-2.0/src/cell.c
@@ -21,7 +21,8 @@
 #endif
 
 #include <ctype.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include "kiss.h"
 
 /* Concrete instantiation */
--- gnomekiss-2.0.orig/src/cnf.c
+++ gnomekiss-2.0/src/cnf.c
@@ -28,7 +28,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 
 #include "support.h"
 #include "kiss.h"
@@ -123,6 +124,8 @@
 }
 
 void parse_file(const char *filename) {
+  GdkMonitor *monitor;
+  GdkRectangle rect;
   FILE *fp;
   gchar *dirname;
   gchar line[1024];
@@ -135,7 +138,7 @@
 
   fp= fopen(filename, "r");
   if (fp == NULL) {
-    gnome_app_message(GNOME_APP(app), strerror(errno));
+    show_message(strerror(errno));
     return;
   }
 
@@ -157,15 +160,15 @@
 
   view= -1; /* re-initialise set view thingy */
 
-  gnome_appbar_clear_stack(GNOME_APPBAR(appbar));
-  gnome_appbar_set_default(GNOME_APPBAR(appbar), _("Reading configuration..."));
+  gtk_statusbar_remove_all(GTK_STATUSBAR(appbar), 0);
+  gtk_statusbar_push(GTK_STATUSBAR(appbar), 0, _("Reading configuration..."));
   
   for (line_no= 1; !feof(fp); ++line_no) {
     /* note line number for error reporting */
     set_line(line_no);
 
     if (line_no % 1000 == 0) {
-      gnome_appbar_set_progress_percentage(GNOME_APPBAR(appbar),
+      gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pbar),
                                            (ftell(fp) * 1.0) / buf.st_size);
       /* Update GUI */
       while (gtk_events_pending()) gtk_main_iteration();
@@ -220,17 +223,21 @@
   }
   fclose(fp);
 
-  gnome_appbar_set_progress_percentage(GNOME_APPBAR(appbar), 0.0);
+  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(pbar), 0.0);
   file_done();
 
   /* Yes, thanks for asking, these values are arbitrary, if you know a
      way to get better values at run-time please tell me ! */
 
-  width= MIN(gdk_screen_width() - 16, config.width + 32);
-  height= MIN(gdk_screen_height() - 16, config.height + 105);
+  monitor = gdk_display_get_monitor_at_window(gdk_display_get_default(),
+                                              gtk_widget_get_window(app));
+  gdk_monitor_get_workarea(monitor, &rect);
+
+  width= MIN(rect.width - 16, config.width + 32);
+  height= MIN(rect.height - 16, config.height + 105);
 
   gtk_window_set_default_size(GTK_WINDOW(app), width, height);
-  gtk_drawing_area_size(GTK_DRAWING_AREA(area), config.width, config.height);
+  gtk_widget_set_size_request(area, config.width, config.height);
 
   /* Set description */
 
@@ -239,7 +246,7 @@
                       (ckiss) ? _(" (CKiSS)") : "",
                       (numcol > 255) ? _(" (Enhanced)") : "");
                       
-  gnome_appbar_set_default(GNOME_APPBAR(appbar), config.description);
+  gtk_statusbar_push(GTK_STATUSBAR(appbar), 0, config.description);
 
   /* Sort out set visibility */
 
--- gnomekiss-2.0.orig/src/collision.c
+++ gnomekiss-2.0/src/collision.c
@@ -20,7 +20,8 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include "kiss.h"
 
 #define KISS_IN		1
--- gnomekiss-2.0.orig/src/errors.c
+++ gnomekiss-2.0/src/errors.c
@@ -20,7 +20,7 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include "kiss.h"
 
 /* Central error logging service */
@@ -30,6 +30,7 @@
 
 static void log_line(char *file, char *line, char *message) {
   gchar *text[3];
+  GtkTreeIter iter;
 
   if (prefs.error_list) {
     gtk_widget_show(error_list);
@@ -37,7 +38,11 @@
   text[0]= file;
   text[1]= line;
   text[2]= message;
-  row= gtk_clist_append(GTK_CLIST(error_clist), text);
+  gtk_list_store_append(error_store, &iter);
+  gtk_list_store_set(error_store, &iter,
+                     FILE_COLUMN, text[0],
+                     LINE_COLUMN, text[1],
+                     MESSAGE_COLUMN, text[2], -1);
 }
 
 void log_error(char *format, ...) {
@@ -54,7 +59,6 @@
     log_line(config.filename, line, message);
   } else {
     log_line("(none)", "N/A", message);
-    gtk_clist_moveto(GTK_CLIST(error_clist), row, 0, 0.0, 0.0);
   }
   g_free(message);
   va_end(args);
@@ -78,7 +82,6 @@
     log_line(config.filename, line, message);
   } else {
     log_line("(none)", "N/A", message);
-    gtk_clist_moveto(GTK_CLIST(error_clist), row, 0, 0.0, 0.0);
   }
   g_free(message);
   va_end(args);
@@ -93,8 +96,6 @@
 
   if (line_no == 0) {
     first_row= row;
-  } else if (line == 0) {
-    gtk_clist_moveto(GTK_CLIST(error_clist), first_row + 1, 0, 0.0, 0.0);
   }
   line_no= line;
 }
--- gnomekiss-2.0.orig/src/event.c
+++ gnomekiss-2.0/src/event.c
@@ -23,7 +23,9 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <canberra.h>
 #include "support.h"
 #include "kiss.h"
 
@@ -674,7 +676,11 @@
     break;
   case ACTION_SOUND:
     if (prefs.esound) {
-      gnome_sound_play(KissString(action->args[0]));
+      ca_context *context;
+
+      ca_context_create(&context);
+      ca_context_play(context, 0, CA_PROP_MEDIA_FILENAME,
+                      KissString(action->args[0]), NULL);
     }
     break;
   case ACTION_SOUND_CANCEL:
@@ -708,7 +714,7 @@
   case ACTION_WINDOW_SIZE:
     offset_x+= KissValue(action->args[0]);
     offset_y+= KissValue(action->args[1]);
-    gtk_widget_set_usize(lookup_widget(app, "scrolledwindow1"),
+    gtk_widget_set_size_request(lookup_widget(app, "scrolledwindow1"),
                          config.width + offset_x, config.height + offset_y);
     break;
 
@@ -737,7 +743,7 @@
     stop_midi();
     break;
   case ACTION_NOTIFY:
-    gnome_app_message(GNOME_APP(app), KissString(action->args[0]));
+    show_message(KissString(action->args[0]));
     break;
 
 /* FKiSS 2.1 onwards */
--- gnomekiss-2.0.orig/src/french.c
+++ gnomekiss-2.0/src/french.c
@@ -22,7 +22,8 @@
 
 #include <ctype.h>
 #include <stdlib.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include <limits.h>
 
 #include "kiss.h"
--- gnomekiss-2.0.orig/src/lzh.c
+++ gnomekiss-2.0/src/lzh.c
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#include <glib/gi18n.h>
 #include "kiss.h"
 
 #define PREFIX "-xqifw="
@@ -48,27 +49,25 @@
   mktemp(temp); /* safe in this context */
   if (mkdir(temp, 0700) != 0) {
     fprintf(stderr, _("Couldn't create \"%s\": %s\n"), temp, strerror(errno));
-    gnome_app_message(GNOME_APP(app),
-                        _("Unable to create temporary directory"));
+    show_message(_("Unable to create temporary directory"));
     return NULL;
   }
   child = fork();
   if (child < 0) {
-    gnome_app_message(GNOME_APP(app), _("Unable to run external programs"));
+    show_message(("Unable to run external programs"));
   } else if (child) {
     waitpid(child, &status, 0);
     package_open= 1;
     if (WEXITSTATUS(status) == 182) {
-      gnome_app_message(GNOME_APP(app), _("You need LHA to unpack .LZH files"));
+      show_message(_("You need LHA to unpack .LZH files"));
       lha_close();
       return NULL;
     } else if (WEXITSTATUS(status) == 1) {
-      gnome_app_message(GNOME_APP(app),
-              _("Can't load this .LZH file - perhaps it is corrupted?"));
+      show_message(_("Can't load this .LZH file - perhaps it is corrupted?"));
       lha_close();
       return NULL;
     } else if (WEXITSTATUS(status) != 0) {
-      gnome_app_message(GNOME_APP(app), _("Unknown error handling .LZH file"));
+      show_message(_("Unknown error handling .LZH file"));
     }
   } else {
     snprintf(options, sizeof(options), PREFIX "%s", temp);
@@ -89,16 +88,15 @@
 
   child = fork();
   if (child < 0) {
-    gnome_app_message(GNOME_APP(app), _("Unable to run external programs"));
+    show_message(_("Unable to run external programs"));
   } else if (child) {
     waitpid(child, &status, 0);
     if (WEXITSTATUS(status) == 182) {
-      gnome_app_message(GNOME_APP(app), _("You need LHA to unpack .LZH files"));
+      show_message(_("You need LHA to unpack .LZH files"));
     } else if (WEXITSTATUS(status) == 1) {
-      gnome_app_message(GNOME_APP(app),
-                     _("Can't load this .LZH file - perhaps it is corrupted?"));
+      show_message(_("Can't load this .LZH file - perhaps it is corrupted?"));
     } else if (WEXITSTATUS(status) != 0) {
-      gnome_app_message(GNOME_APP(app), _("Unknown error handling .LZH file"));
+      show_message(_("Unknown error handling .LZH file"));
     }
   } else {
     snprintf(options, sizeof(options), PREFIX "%s", temp);
--- gnomekiss-2.0.orig/src/timer.c
+++ gnomekiss-2.0/src/timer.c
@@ -20,7 +20,8 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include <limits.h>
 #include <sys/time.h>
 #include <unistd.h>
@@ -100,7 +101,7 @@
   }
 
   if (fk_timer_source == 0) {
-    fk_timer_source= gtk_timeout_add(10, (GSourceFunc) check_timers, NULL);
+    fk_timer_source= g_timeout_add(10, (GSourceFunc) check_timers, NULL);
     gettimeofday(&lasttime, NULL);
   }
 
--- gnomekiss-2.0.orig/src/util.c
+++ gnomekiss-2.0/src/util.c
@@ -20,7 +20,8 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -32,6 +33,9 @@
 
 static GMemChunk *event_chunk= NULL;
 
+extern void on_open_config_activate(GtkMenuItem *menuitem,
+                                    gpointer user_data);
+
 void free_action_list(GSList *list) {
   /* FIXME small leak, debug() notify() strings lost */
   g_slist_free(list);
@@ -87,8 +91,9 @@
 
 
 void render_all() {
-  GdkColor color;
-  GdkColormap *cmap;
+  GtkStyleContext *ctxt;
+  GtkCssProvider *provider;
+  gchar *css;
   gint set;
   static long int last = -1;
 
@@ -100,22 +105,25 @@
   gtk_widget_queue_draw(area); /* redraw everything */
 
   /* render_all gets called just in time to fix the bg color */
-  cmap= gtk_widget_get_colormap(area);
   set= config.pal_set[view];
 
   if (set * 256 + config.bg_color != last) {
     last = set * 256 + config.bg_color;
-    color.red= 257 * palettes[set][config.bg_color * 3];
-    color.green= 257 * palettes[set][config.bg_color * 3 + 1];
-    color.blue= 257 * palettes[set][config.bg_color * 3 + 2];
-
-    /* I have no idea if this is portable, removing it will just cause
-       the unused border to be grey instead of colored */
-
-    if (gdk_colormap_alloc_color(cmap, &color, FALSE, TRUE)) {
-      gdk_window_set_background(area->window, &color);
-      gdk_window_clear(area->window);
-    }
+
+    css = g_strdup_printf(".config-background {"
+                          "background-color: rgb(%d, %d, %d); }",
+                          palettes[set][config.bg_color * 3],
+                          palettes[set][config.bg_color * 3 + 1],
+                          palettes[set][config.bg_color * 3 + 2]);
+
+    provider = gtk_css_provider_new();
+    gtk_css_provider_load_from_data(provider, css, -1, NULL);
+    ctxt = gtk_widget_get_style_context(area);
+    gtk_style_context_add_provider(ctxt, GTK_STYLE_PROVIDER(provider),
+                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+    gtk_style_context_add_class(ctxt, "config-background");
+    g_object_unref(provider);
+    g_free(css);
   }
 
 }
@@ -195,9 +203,9 @@
 void change_cursor(GdkWindow *window, GdkCursorType type) {
   GdkCursor *cursor;
 
-  cursor = gdk_cursor_new(type);
+  cursor = gdk_cursor_new_for_display(gdk_display_get_default(), type);
   gdk_window_set_cursor(window, cursor);
-  gdk_cursor_destroy(cursor);
+  g_object_unref(cursor);
 }
 
 void clean_up() {
@@ -219,7 +227,9 @@
   reset_events();
 
   if (area != NULL) {
-    gdk_window_clear(area->window);
+    /* Trigger emission of the "draw" signal.  */
+    clear_area = TRUE;
+    gdk_window_invalidate_rect(gtk_widget_get_window(area), NULL, FALSE);
   }
 
   /* free config filename */
@@ -299,9 +309,10 @@
   len= strlen(filename);
   if (len > 4 && g_strcasecmp(filename + len - 4, ".lzh") == 0) {
     if ((temp= lha_open(filename))) {
-      gtk_file_selection_complete(GTK_FILE_SELECTION(config_open), temp);
-      gtk_file_selection_complete(GTK_FILE_SELECTION(config_open), "*.cnf");
-      gtk_widget_show (config_open);
+      /* The file was succeffully unpacked, invoke the callback
+         directly so that the temporary directory is presented to the
+         user for selection.  */
+      on_open_config_activate(NULL, temp);
       g_free(temp);
     }
   } else {
--- gnomekiss-2.0.orig/src/callbacks.c
+++ gnomekiss-2.0/src/callbacks.c
@@ -20,7 +20,8 @@
 #  include <config.h>
 #endif
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 #include <string.h>
 
 #include "callbacks.h"
@@ -39,6 +40,7 @@
 {
   clean_up();
   lha_close();
+  g_object_unref(settings);
   gtk_main_quit();
 }
 
@@ -57,10 +59,11 @@
 
 gboolean
 on_area_expose_event                   (GtkWidget       *widget,
-                                        GdkEventExpose  *event,
+                                        cairo_t         *cr,
                                         gpointer         user_data)
 {
-  gint32 y, height;
+  GdkPixbuf *pixbuf;
+  gint widget_height, height;
   guchar *buffer;
 
 #if 0
@@ -93,13 +96,26 @@
     global_start= config.rgb_buf + (config.height * config.row_stride);
   }
 
-  y= event->area.y;
-  height= (y + event->area.height <= config.height) ? event->area.height
-                                     : (config.height - y);
-
-  gdk_draw_rgb_image (widget->window, widget->style->fg_gc[widget->state],
-                      0, y, config.width, height, GDK_RGB_DITHER_NORMAL,
-                      config.rgb_buf + (y * config.row_stride), config.row_stride);
+  widget_height = gtk_widget_get_allocated_height (widget);
+  height= (widget_height <= config.height) ? widget_height
+                                     : config.height;
+
+  pixbuf = gdk_pixbuf_new_from_data (config.rgb_buf,
+                                     GDK_COLORSPACE_RGB,
+                                     FALSE, 8,
+                                     config.width, height,
+                                     config.row_stride, NULL, NULL);
+  gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+  cairo_paint (cr);
+  g_object_unref (pixbuf);
+
+  /* Cheap trick to replace gdk_window_clear.  */
+  if (clear_area) {
+    GtkStyleContext *ctxt;
+
+    ctxt = gtk_widget_get_style_context (widget);
+    gtk_render_background (ctxt, cr, 0, 0, config.width, height);
+  }
 
 #if 0
   gettimeofday(&stop_time, NULL);
@@ -129,7 +145,7 @@
 {
   gchar const *name;
 
-  if (GTK_CHECK_MENU_ITEM(menuitem)->active) {
+  if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem))) {
     name = gtk_widget_get_name((GtkWidget *)menuitem);
     switch_view (name[4] - '0');
   }
@@ -153,7 +169,7 @@
 {
   gchar const *name;
 
-  if (GTK_CHECK_MENU_ITEM(menuitem)->active) {
+  if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem))) {
     name = gtk_widget_get_name((GtkWidget *)menuitem);
     switch_color (name[6] - '0');
   }
@@ -163,7 +179,22 @@
 on_preferences_activate                (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-  gtk_widget_show (pref_dialog);
+  GtkWidget *dialog;
+  gint response;
+
+  dialog = create_preferences ();
+  g_settings_delay (settings);
+
+  response = gtk_dialog_run (GTK_DIALOG (dialog));
+  if (response == GTK_RESPONSE_ACCEPT)
+    {
+      if (g_settings_get_has_unapplied (settings))
+        g_settings_apply (settings);
+    }
+  else if (g_settings_get_has_unapplied (settings))
+    g_settings_revert (settings);
+
+  gtk_widget_destroy (dialog);
 }
 
 
@@ -182,6 +213,7 @@
                                         GdkEventButton  *event,
                                         gpointer         user_data)
 {
+  GdkWindow *window;
   char *status_entry;
   if (event->type != GDK_BUTTON_PRESS) return FALSE;
 
@@ -192,11 +224,13 @@
   config.selected= config.target= intersect(x1, y1);
   dragged= 0;
 
+  window = gtk_widget_get_window(widget);
+
   if (config.target == NULL) {
-    change_cursor(widget->window, GDK_X_CURSOR);
+    change_cursor(window, GDK_X_CURSOR);
     return FALSE;
   } else {
-    change_cursor(widget->window, GDK_HAND2);
+    change_cursor(window, GDK_HAND2);
   }
 
   ox = config.target->object->x[view];
@@ -206,8 +240,8 @@
              config.target->object->id, config.target->name,
              config.target->object->fix, config.target->object->x[view],
              config.target->object->y[view]);
-  gnome_appbar_pop(GNOME_APPBAR(appbar));
-  gnome_appbar_push(GNOME_APPBAR(appbar), status_entry);
+  gtk_statusbar_pop(GTK_STATUSBAR(appbar), 0);
+  gtk_statusbar_push(GTK_STATUSBAR(appbar), 0, status_entry);
 
   events(config.target->object->press);
   events(config.target->events->press);
@@ -242,10 +276,13 @@
                                         GdkEventMotion  *event,
                                         gpointer         user_data)
 {
+  GdkSeat *seat;
   int x2, y2;
 
   /* Update global mouse info */
-  gdk_window_get_pointer(event->window, &mouse_x, &mouse_y, NULL);
+  seat = gdk_display_get_default_seat(gdk_window_get_display(event->window));
+  gdk_window_get_device_position(event->window, gdk_seat_get_pointer(seat),
+                                 &mouse_x, &mouse_y, NULL);
 
   if (config.target == NULL)
     return FALSE;
@@ -281,7 +318,7 @@
   /* Update global mouse info */
   mouse_x= event->x; mouse_y= event->y;
 
-  change_cursor(widget->window, GDK_LEFT_PTR);
+  change_cursor(gtk_widget_get_window(widget), GDK_LEFT_PTR);
 
   if (config.target == NULL)
     return FALSE;
@@ -319,60 +356,87 @@
 
 void
 on_open_activate                       (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+                                        const char      *title)
 {
-  gtk_file_selection_complete(GTK_FILE_SELECTION(set_open), "*.lzh");
-  gtk_widget_show (set_open);
-}
-
-
-void
-on_set_open_ok                         (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  char const *filename;
-
-  gtk_widget_hide (set_open);
-  filename= gtk_file_selection_get_filename(GTK_FILE_SELECTION(set_open));
-  open_either(filename);
-}
-
+  GtkWidget *dialog;
+  GtkFileChooser *chooser;
+  GtkFileFilter *filter;
+  gint response;
+
+  dialog = gtk_file_chooser_dialog_new (title,
+                                        GTK_WINDOW (app),
+                                        GTK_FILE_CHOOSER_ACTION_OPEN,
+                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                        _("_OK"), GTK_RESPONSE_ACCEPT,
+                                        NULL);
+
+  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+  chooser = GTK_FILE_CHOOSER (dialog);
+  filter = gtk_file_filter_new ();
+  gtk_file_filter_set_name (filter, _("LZH archives"));
+  gtk_file_filter_add_pattern (filter, "*.lzh");
+  gtk_file_chooser_add_filter (chooser, filter);
+
+  response = gtk_dialog_run (GTK_DIALOG (dialog));
+  if (response == GTK_RESPONSE_ACCEPT)
+    {
+      gchar *filename;
+
+      filename = gtk_file_chooser_get_filename (chooser);
+      open_either (filename);
+      g_free (filename);
+    }
 
-void
-on_set_open_cancel                     (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  gtk_widget_hide (set_open);
+  gtk_widget_destroy (dialog);
 }
 
 void
 on_open_config_activate                (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-  gtk_file_selection_complete(GTK_FILE_SELECTION(config_open), "*.cnf");
-  gtk_widget_show (config_open);
-}
-
+  GtkWidget *dialog;
+  GtkFileChooser *chooser;
+  GtkFileFilter *filter;
+  gint response;
+
+  dialog = gtk_file_chooser_dialog_new (_("Select Config file"),
+                                        GTK_WINDOW (app),
+                                        GTK_FILE_CHOOSER_ACTION_OPEN,
+                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                        _("_OK"), GTK_RESPONSE_ACCEPT,
+                                        NULL);
+
+  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), TRUE);
+  gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+  chooser = GTK_FILE_CHOOSER (dialog);
+  filter = gtk_file_filter_new ();
+  gtk_file_filter_set_name (filter, _("Config files"));
+  gtk_file_filter_add_pattern (filter, "*.cnf");
+  gtk_file_chooser_add_filter (chooser, filter);
+
+  /* If called explicitly by open_either after sucessful unarchiving
+     of the .lzh file -- set current folder to the unpacked one.  */
+  if (user_data)
+    gtk_file_chooser_set_current_folder (chooser, user_data);
+
+  response = gtk_dialog_run (GTK_DIALOG (dialog));
+  if (response == GTK_RESPONSE_ACCEPT)
+    {
+      gchar *filename;
+
+      filename = gtk_file_chooser_get_filename (chooser);
+      parse_file (filename);
+      g_free (filename);
+    }
 
-void
-on_config_open_ok                      (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  gchar const *filename;
-  gtk_widget_hide (config_open);
-  filename= gtk_file_selection_get_filename(GTK_FILE_SELECTION(config_open));
-  parse_file(filename);
+  gtk_widget_destroy (dialog);
 }
 
 
 void
-on_config_open_cancel                  (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  gtk_widget_hide (config_open);
-}
-
-void
 on_close_activate                      (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
@@ -382,74 +446,18 @@
 
 
 void
-on_open_add_on_activate                (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
-{
-  gtk_file_selection_complete(GTK_FILE_SELECTION(add_open), "*.lzh");
-  gtk_widget_show (add_open);
-}
-
-
-void
 on_close_errors_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
   gtk_widget_hide(error_list);
 }
 
-
-void
-on_add_open_ok                         (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  gchar const *filename;
-  gtk_widget_hide (add_open);
-  filename= gtk_file_selection_get_filename(GTK_FILE_SELECTION(add_open));
-  lha_extend(filename);
-}
-
-
-void
-on_add_open_cancel                     (GtkButton       *button,
-                                        gpointer         user_data)
-{
-  gtk_widget_hide (add_open);
-}
-
-gint
-on_preferences_close                   (GnomeDialog     *gnomedialog,
-                                        gpointer         user_data)
-{
-  gtk_widget_hide(pref_dialog);
-  return TRUE;
-}
-
-void
-on_preferences_apply                   (GnomePropertyBox *gnomepropertybox,
-                                        gint             page,
-                                        gpointer         user_data)
-{
-  gnome_config_set_bool("Sound/midi", prefs.midi);
-  gnome_config_set_bool("Sound/esound", prefs.esound);
-  gnome_config_set_bool("Diagnostics/error_list", prefs.error_list);
-  gnome_config_set_bool("Diagnostics/trace", prefs.trace);
-  gnome_config_set_bool("Diagnostics/warnings", prefs.warnings);
-  gnome_config_set_bool("Features/ignore_colon", prefs.ignore_colon);
-  gnome_config_set_bool("Features/default_palette", prefs.default_palette);
-  gnome_config_set_bool("Features/fkiss_case", prefs.fkiss_case);
-  gnome_config_set_bool("Features/catch_drop", prefs.catch_drop);
-  gnome_config_set_int("Features/speed_factor", prefs.speed_factor);
-  gnome_config_set_int("Features/min_timer", prefs.min_timer);
-  gnome_config_set_string("Sound/midi_player", prefs.midi_player);
-  gnome_config_sync();
-}
-
 void
 on_pref_midi_toggled                   (GtkToggleButton *togglebutton,
                                         gpointer         user_data)
 {
   prefs.midi = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "midi", prefs.midi);
 }
 
 void
@@ -457,7 +465,7 @@
                                         gpointer         user_data)
 {
   prefs.esound = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "sound", prefs.esound);
 }
 
 void
@@ -465,7 +473,7 @@
                                         gpointer         user_data)
 {
   prefs.error_list = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "error-list", prefs.error_list);
 }
 
 
@@ -474,7 +482,7 @@
                                         gpointer         user_data)
 {
   prefs.trace = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "trace", prefs.trace);
 }
 
 
@@ -483,7 +491,7 @@
                                         gpointer         user_data)
 {
   prefs.warnings = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "warnings", prefs.warnings);
 }
 
 
@@ -492,7 +500,7 @@
                                         gpointer         user_data)
 {
   prefs.ignore_colon = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "ignore-colon", prefs.ignore_colon);
 }
 
 
@@ -501,7 +509,7 @@
                                         gpointer         user_data)
 {
   prefs.default_palette = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "default-palette", prefs.default_palette);
 }
 
 
@@ -510,7 +518,7 @@
                                         gpointer         user_data)
 {
   prefs.fkiss_case = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "fkiss-case", prefs.fkiss_case);
 }
 
 
@@ -519,34 +527,34 @@
                                         gpointer         user_data)
 {
   prefs.catch_drop = gtk_toggle_button_get_active(togglebutton);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  g_settings_set_boolean(settings, "catch-drop", prefs.catch_drop);
 }
 
 
 void
-on_pref_speed_factor_changed           (GtkEditable     *editable,
+on_pref_speed_factor_changed           (GtkSpinButton   *spinbutton,
                                         gpointer         user_data)
 {
-  prefs.speed_factor = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  prefs.speed_factor = gtk_spin_button_get_value_as_int(spinbutton);
+  g_settings_set_int(settings, "speed-factor", prefs.speed_factor);
 }
 
 
 void
-on_pref_min_timer_changed              (GtkEditable     *editable,
+on_pref_min_timer_changed              (GtkSpinButton   *spinbutton,
                                         gpointer         user_data)
 {
-  prefs.min_timer = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  prefs.min_timer = gtk_spin_button_get_value_as_int(spinbutton);
+  g_settings_set_int(settings, "min-timer", prefs.min_timer);
 }
 
 void
-on_pref_midi_player_changed            (GtkEditable     *editable,
+on_pref_midi_player_changed            (GtkEntry        *entry,
                                         gpointer         user_data)
 {
   g_free(prefs.midi_player);
-  prefs.midi_player = gtk_editable_get_chars(editable, 0, -1);
-  gnome_property_box_changed(GNOME_PROPERTY_BOX(pref_dialog));
+  prefs.midi_player = g_strdup(gtk_entry_get_text(entry));
+  g_settings_set_string(settings, "midi-player", prefs.midi_player);
 }
 
 void
@@ -562,8 +570,8 @@
   char *filename;
   int k;
 
-  filename= (char *) data->data;
-  for (k= 0; k < data->length; ++k) {
+  filename= (char *) gtk_selection_data_get_text(data);
+  for (k= 0; k < gtk_selection_data_get_length(data); ++k) {
     if (filename[k] == '\r') {
       filename[k]= '\0';
       break;
@@ -573,6 +581,9 @@
   if ( !strncmp(filename, "file:", 5)) {
     open_either(filename + 5);
   }
+
+  if (filename)
+    g_free(filename);
 }
 
 void
@@ -588,7 +599,7 @@
 on_clear_errors_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-  gtk_clist_clear(GTK_CLIST(error_clist));
+  gtk_list_store_clear(error_store);
 }
 
 void
@@ -606,4 +617,3 @@
     config.selected->object->fix= 1; /* will trigger unfix() on next click */
   }
 }
-
--- gnomekiss-2.0.orig/src/support.c
+++ gnomekiss-2.0/src/support.c
@@ -12,10 +12,28 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 
 #include "support.h"
 
+/* Just a wrapper around GtkMessageDialog.  */
+void
+show_message (const gchar *message)
+{
+  extern GtkWidget *app;
+  GtkWidget *dialog;
+
+  dialog = gtk_message_dialog_new (GTK_WINDOW (app),
+                                   GTK_DIALOG_DESTROY_WITH_PARENT,
+                                   GTK_MESSAGE_INFO,
+                                   GTK_BUTTONS_CLOSE,
+                                   "%s", message);
+
+  gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_destroy (dialog);
+}
+
 GtkWidget*
 lookup_widget                          (GtkWidget       *widget,
                                         const gchar     *widget_name)
@@ -27,9 +45,8 @@
       if (GTK_IS_MENU (widget))
         parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
       else
-        parent = widget->parent;
-      if (!parent)
-        parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
+        parent = gtk_widget_get_parent (widget);
+
       if (parent == NULL)
         break;
       widget = parent;
@@ -43,30 +60,6 @@
 }
 
 /* This is an internally used function to create pixmaps. */
-GtkWidget*
-create_pixmap                          (GtkWidget       *widget,
-                                        const gchar     *filename)
-{
-  GtkWidget *pixmap;
-  gchar *pathname;
-
-  if (!filename || !filename[0])
-      return gtk_image_new ();
-
-  pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
-                                        filename, TRUE, NULL);
-  if (!pathname)
-    {
-      g_warning (_("Couldn't find pixmap file: %s"), filename);
-      return gtk_image_new ();
-    }
-
-  pixmap = gtk_image_new_from_file (pathname);
-  g_free (pathname);
-  return pixmap;
-}
-
-/* This is an internally used function to create pixmaps. */
 GdkPixbuf*
 create_pixbuf                          (const gchar     *filename)
 {
@@ -77,8 +70,8 @@
   if (!filename || !filename[0])
       return NULL;
 
-  pathname = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_APP_PIXMAP,
-                                        filename, TRUE, NULL);
+  pathname = g_build_filename (PACKAGE_DATA_DIR, "pixmaps", GETTEXT_PACKAGE,
+                               filename, NULL);
 
   if (!pathname)
     {
--- gnomekiss-2.0.orig/src/variable.c
+++ gnomekiss-2.0/src/variable.c
@@ -22,7 +22,7 @@
 
 #include <ctype.h>
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include "kiss.h"
 
 static GSList *variables;
--- gnomekiss-2.0.orig/src/interface.c
+++ gnomekiss-2.0/src/interface.c
@@ -12,8 +12,8 @@
 #include <string.h>
 #include <stdio.h>
 
-#include <bonobo.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
 
 #include "callbacks.h"
 #include "interface.h"
@@ -21,257 +21,12 @@
 
 #define GLADE_HOOKUP_OBJECT(component,widget,name) \
   g_object_set_data_full (G_OBJECT (component), name, \
-    gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
+    g_object_ref (widget), (GDestroyNotify) g_object_unref)
 
 #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
   g_object_set_data (G_OBJECT (component), name, widget)
 
-static GnomeUIInfo file_menu_uiinfo[] =
-{
-  GNOMEUIINFO_MENU_OPEN_ITEM (on_open_activate, NULL),
-  {
-    GNOME_APP_UI_ITEM, N_("Open _Configuration..."),
-    N_("Open a different config file"),
-    (gpointer) on_open_config_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Open _Add-on..."),
-    NULL,
-    (gpointer) on_open_add_on_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_MENU_CLOSE_ITEM (on_close_activate, NULL),
-  GNOMEUIINFO_SEPARATOR,
-  GNOMEUIINFO_MENU_EXIT_ITEM (on_exit_activate, NULL),
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo set_0_uiinfo[] =
-{
-  {
-    GNOME_APP_UI_ITEM, N_("Set _0"),
-    N_("Switch to set 0"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_0, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _1"),
-    N_("Switch to set 1"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_1, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _2"),
-    N_("Switch to set 2"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_2, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _3"),
-    N_("Switch to set 3"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_3, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _4"),
-    N_("Switch to set 4"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_4, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _5"),
-    N_("Switch to set 5"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_5, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _6"),
-    N_("Switch to set 6"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_6, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _7"),
-    N_("Switch to set 7"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_7, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _8"),
-    N_("Switch to set 8"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_8, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Set _9"),
-    N_("Switch to set 9"),
-    (gpointer) on_set_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_9, (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo sets_menu_uiinfo[] =
-{
-  {
-    GNOME_APP_UI_RADIOITEMS, NULL, NULL, set_0_uiinfo,
-    NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 0,
-    (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo group_0_uiinfo[] =
-{
-  {
-    GNOME_APP_UI_ITEM, N_("Group _0"),
-    N_("Use palette group 0"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_0, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _1"),
-    N_("Use palette group 1"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_1, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _2"),
-    N_("Use palette group 2"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_2, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _3"),
-    N_("Use palette group 3"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_3, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _4"),
-    N_("Use palette group 4"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_4, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _5"),
-    N_("Use palette group 5"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_5, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _6"),
-    N_("Use palette group 6"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_6, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _7"),
-    N_("Use palette group 7"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_7, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _8"),
-    N_("Use palette group 8"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_8, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("Group _9"),
-    N_("Use palette group 9"),
-    (gpointer) on_group_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_9, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo colors_menu_uiinfo[] =
-{
-  {
-    GNOME_APP_UI_RADIOITEMS, NULL, NULL, group_0_uiinfo,
-    NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 0,
-    (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo tools1_menu_uiinfo[] =
-{
-  {
-    GNOME_APP_UI_ITEM, N_("_Error list"),
-    NULL,
-    (gpointer) on_error_list_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    GDK_question, (GdkModifierType) GDK_CONTROL_MASK, NULL
-  },
-  {
-    GNOME_APP_UI_ITEM, N_("_Unfix"),
-    NULL,
-    (gpointer) on_unfix_activate, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo settings_menu_uiinfo[] =
-{
-  GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences_activate, NULL),
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo help_menu_uiinfo[] =
-{
-  GNOMEUIINFO_MENU_ABOUT_ITEM (on_about_activate, NULL),
-  GNOMEUIINFO_END
-};
-
-static GnomeUIInfo menubar1_uiinfo[] =
-{
-  GNOMEUIINFO_MENU_FILE_TREE (file_menu_uiinfo),
-  GNOMEUIINFO_MENU_VIEW_TREE (sets_menu_uiinfo),
-  {
-    GNOME_APP_UI_SUBTREE, N_("_Colors"),
-    NULL,
-    colors_menu_uiinfo, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
-  {
-    GNOME_APP_UI_SUBTREE, N_("_Tools"),
-    NULL,
-    tools1_menu_uiinfo, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
-  GNOMEUIINFO_MENU_SETTINGS_TREE (settings_menu_uiinfo),
-  GNOMEUIINFO_MENU_HELP_TREE (help_menu_uiinfo),
-  GNOMEUIINFO_END
-};
+extern GSettings *settings;
 
 GtkWidget*
 create_application (void)
@@ -279,6 +34,52 @@
   GtkWidget *application;
   GdkPixbuf *application_icon_pixbuf;
   GtkWidget *dock1;
+  GtkWidget *menubar;
+  GtkAccelGroup *accel_group;
+  GtkWidget *filemenu;
+  GtkWidget *file_menu;
+  GtkWidget *open_menu;
+  GtkWidget *open_config_menu;
+  GtkWidget *open_addon_menu;
+  GtkWidget *close_menu;
+  GtkWidget *separator;
+  GtkWidget *quit_menu;
+  GtkWidget *setmenu;
+  GSList *setgroup = NULL;
+  GtkWidget *set_menu;
+  GtkWidget *set0_menu;
+  GtkWidget *set1_menu;
+  GtkWidget *set2_menu;
+  GtkWidget *set3_menu;
+  GtkWidget *set4_menu;
+  GtkWidget *set5_menu;
+  GtkWidget *set6_menu;
+  GtkWidget *set7_menu;
+  GtkWidget *set8_menu;
+  GtkWidget *set9_menu;
+  GtkWidget *colormenu;
+  GSList *colgroup = NULL;
+  GtkWidget *col_menu;
+  GtkWidget *col0_menu;
+  GtkWidget *col1_menu;
+  GtkWidget *col2_menu;
+  GtkWidget *col3_menu;
+  GtkWidget *col4_menu;
+  GtkWidget *col5_menu;
+  GtkWidget *col6_menu;
+  GtkWidget *col7_menu;
+  GtkWidget *col8_menu;
+  GtkWidget *col9_menu;
+  GtkWidget *toolmenu;
+  GtkWidget *tool_menu;
+  GtkWidget *errlist_menu;
+  GtkWidget *unfix_menu;
+  GtkWidget *settingsmenu;
+  GtkWidget *settings_menu;
+  GtkWidget *prefs_menu;
+  GtkWidget *helpmenu;
+  GtkWidget *help_menu;
+  GtkWidget *about_menu;
   GtkWidget *toolbar1;
   GtkIconSize tmp_toolbar_icon_size;
   GtkWidget *tmp_image;
@@ -300,145 +101,383 @@
   GtkWidget *scrolledwindow1;
   GtkWidget *viewport1;
   GtkWidget *area;
+  GtkWidget *hbox;
+  GtkWidget *pbar;
   GtkWidget *appbar;
-  GtkTooltips *tooltips;
 
-  tooltips = gtk_tooltips_new ();
-
-  application = gnome_app_new ("GnomeKiss", _("GnomeKiss"));
+  application = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_title (GTK_WINDOW (application), _("GnomeKiss"));
   gtk_widget_set_name (application, "application");
-  application_icon_pixbuf = create_pixbuf ("gnomekiss/besito_sinfondo.png");
+  application_icon_pixbuf = create_pixbuf ("besito_sinfondo.png");
   if (application_icon_pixbuf)
     {
       gtk_window_set_icon (GTK_WINDOW (application), application_icon_pixbuf);
-      gdk_pixbuf_unref (application_icon_pixbuf);
+      g_object_unref (application_icon_pixbuf);
     }
 
-  dock1 = GNOME_APP (application)->dock;
+  dock1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+  gtk_container_add (GTK_CONTAINER (application), dock1);
   gtk_widget_set_name (dock1, "dock1");
   gtk_widget_show (dock1);
 
-  gnome_app_create_menus (GNOME_APP (application), menubar1_uiinfo);
-
-  gtk_widget_set_name (menubar1_uiinfo[0].widget, "file");
-
-  gtk_widget_set_name (file_menu_uiinfo[0].widget, "open");
-
-  gtk_widget_set_name (file_menu_uiinfo[1].widget, "open_config");
-
-  gtk_widget_set_name (file_menu_uiinfo[2].widget, "open_add_on");
-
-  gtk_widget_set_name (file_menu_uiinfo[3].widget, "close");
-
-  gtk_widget_set_name (file_menu_uiinfo[4].widget, "separator1");
-
-  gtk_widget_set_name (file_menu_uiinfo[5].widget, "exit");
-
-  gtk_widget_set_name (menubar1_uiinfo[1].widget, "sets");
-
-  gtk_widget_set_name (set_0_uiinfo[0].widget, "set_0");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[0].widget), TRUE);
-
-  gtk_widget_set_name (set_0_uiinfo[1].widget, "set_1");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[1].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[1].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[2].widget, "set_2");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[2].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[2].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[3].widget, "set_3");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[3].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[3].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[4].widget, "set_4");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[4].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[4].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[5].widget, "set_5");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[5].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[5].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[6].widget, "set_6");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[6].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[6].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[7].widget, "set_7");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[7].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[7].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[8].widget, "set_8");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[8].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[8].widget, FALSE);
-
-  gtk_widget_set_name (set_0_uiinfo[9].widget, "set_9");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set_0_uiinfo[9].widget), TRUE);
-  gtk_widget_set_sensitive (set_0_uiinfo[9].widget, FALSE);
-
-  gtk_widget_set_name (menubar1_uiinfo[2].widget, "colors");
-
-  gtk_widget_set_name (group_0_uiinfo[0].widget, "group_0");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[0].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[1].widget, "group_1");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[1].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[2].widget, "group_2");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[2].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[3].widget, "group_3");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[3].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[4].widget, "group_4");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[4].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[5].widget, "group_5");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[5].widget), TRUE);
+  menubar = gtk_menu_bar_new ();
+  gtk_widget_show (menubar);
+  gtk_container_add (GTK_CONTAINER (dock1), menubar);
+
+  accel_group = gtk_accel_group_new ();
+  gtk_window_add_accel_group (GTK_WINDOW (application), accel_group);
+
+  filemenu = gtk_menu_new ();
+  gtk_menu_set_accel_group (GTK_MENU (filemenu), accel_group);
+  file_menu = gtk_menu_item_new_with_mnemonic (_("_File"));
+  gtk_widget_set_name (file_menu, "file");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (file_menu), filemenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), file_menu);
+
+  open_menu = gtk_menu_item_new_with_mnemonic (_("_Open"));
+  gtk_widget_set_tooltip_text (open_menu, _("Open a file"));
+  gtk_widget_set_name (open_menu, "open");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), open_menu);
+  gtk_widget_add_accelerator (open_menu, "activate", accel_group,
+                              GDK_KEY_O, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (open_menu, "activate",
+                    G_CALLBACK (on_open_activate), _("Open KiSS Set"));
+
+  open_config_menu
+    = gtk_menu_item_new_with_mnemonic (_("Open _Configuration..."));
+  gtk_widget_set_tooltip_text (open_config_menu,
+                               _("Open a different config file"));
+  gtk_widget_set_name (open_config_menu, "open_config");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), open_config_menu);
+  g_signal_connect (open_config_menu, "activate",
+                    G_CALLBACK (on_open_config_activate), NULL);
+
+  open_addon_menu = gtk_menu_item_new_with_mnemonic (_("Open _Add-on..."));
+  gtk_widget_set_name (open_addon_menu, "open_add_on");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), open_addon_menu);
+  g_signal_connect (open_addon_menu, "activate",
+                    G_CALLBACK (on_open_activate), _("Select Add-on"));
+
+  close_menu = gtk_menu_item_new_with_mnemonic (_("_Close"));
+  gtk_widget_set_tooltip_text (close_menu, _("Close the current file"));
+  gtk_widget_set_name (close_menu, "close");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), close_menu);
+  gtk_widget_add_accelerator (close_menu, "activate", accel_group,
+                              GDK_KEY_W, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (close_menu, "activate",
+                    G_CALLBACK (on_close_activate), NULL);
+
+  separator = gtk_separator_menu_item_new ();
+  gtk_widget_set_name (separator, "separator1");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), separator);
+
+  quit_menu = gtk_menu_item_new_with_mnemonic (_("_Quit"));
+  gtk_widget_set_tooltip_text (quit_menu, _("Quit the application"));
+  gtk_widget_set_name (quit_menu, "exit");
+  gtk_menu_shell_append (GTK_MENU_SHELL (filemenu), quit_menu);
+  gtk_widget_add_accelerator (quit_menu, "activate", accel_group,
+                              GDK_KEY_Q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (quit_menu, "activate",
+                    G_CALLBACK (on_exit_activate), NULL);
+
+  setmenu = gtk_menu_new ();
+  gtk_menu_set_accel_group (GTK_MENU (setmenu), accel_group);
+  set_menu = gtk_menu_item_new_with_mnemonic (_("_View"));
+  gtk_widget_set_name (set_menu, "sets");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (set_menu), setmenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), set_menu);
+
+  set0_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _0"));
+  gtk_widget_set_tooltip_text (set0_menu, _("Switch to set 0"));
+  gtk_widget_set_name (set0_menu, "set_0");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set0_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set0_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set0_menu);
+  gtk_widget_add_accelerator (set0_menu, "activate", accel_group,
+                              GDK_KEY_0, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set0_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set1_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _1"));
+  gtk_widget_set_tooltip_text (set1_menu, _("Switch to set 1"));
+  gtk_widget_set_name (set1_menu, "set_1");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set1_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set1_menu), TRUE);
+  gtk_widget_set_sensitive (set1_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set1_menu);
+  gtk_widget_add_accelerator (set1_menu, "activate", accel_group,
+                              GDK_KEY_1, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set1_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set2_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _2"));
+  gtk_widget_set_tooltip_text (set2_menu, _("Switch to set 2"));
+  gtk_widget_set_name (set2_menu, "set_2");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set2_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set2_menu), TRUE);
+  gtk_widget_set_sensitive (set2_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set2_menu);
+  gtk_widget_add_accelerator (set2_menu, "activate", accel_group,
+                              GDK_KEY_2, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set2_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set3_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _3"));
+  gtk_widget_set_tooltip_text (set3_menu, _("Switch to set 3"));
+  gtk_widget_set_name (set3_menu, "set_3");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set3_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set3_menu), TRUE);
+  gtk_widget_set_sensitive (set3_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set3_menu);
+  gtk_widget_add_accelerator (set3_menu, "activate", accel_group,
+                              GDK_KEY_3, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set3_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set4_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _4"));
+  gtk_widget_set_tooltip_text (set4_menu, _("Switch to set 4"));
+  gtk_widget_set_name (set4_menu, "set_4");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set4_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set4_menu), TRUE);
+  gtk_widget_set_sensitive (set4_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set4_menu);
+  gtk_widget_add_accelerator (set4_menu, "activate", accel_group,
+                              GDK_KEY_4, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set4_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set5_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _5"));
+  gtk_widget_set_tooltip_text (set5_menu, _("Switch to set 5"));
+  gtk_widget_set_name (set5_menu, "set_5");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set5_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set5_menu), TRUE);
+  gtk_widget_set_sensitive (set5_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set5_menu);
+  gtk_widget_add_accelerator (set5_menu, "activate", accel_group,
+                              GDK_KEY_5, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set5_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set6_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _6"));
+  gtk_widget_set_tooltip_text (set6_menu, _("Switch to set 6"));
+  gtk_widget_set_name (set6_menu, "set_6");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set6_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set6_menu), TRUE);
+  gtk_widget_set_sensitive (set6_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set6_menu);
+  gtk_widget_add_accelerator (set6_menu, "activate", accel_group,
+                              GDK_KEY_6, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set6_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set7_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _7"));
+  gtk_widget_set_tooltip_text (set7_menu, _("Switch to set 7"));
+  gtk_widget_set_name (set7_menu, "set_7");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set7_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set7_menu), TRUE);
+  gtk_widget_set_sensitive (set7_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set7_menu);
+  gtk_widget_add_accelerator (set7_menu, "activate", accel_group,
+                              GDK_KEY_7, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set7_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set8_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _8"));
+  gtk_widget_set_tooltip_text (set8_menu, _("Switch to set 8"));
+  gtk_widget_set_name (set8_menu, "set_8");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set8_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set8_menu), TRUE);
+  gtk_widget_set_sensitive (set8_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set8_menu);
+  gtk_widget_add_accelerator (set8_menu, "activate", accel_group,
+                              GDK_KEY_8, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set8_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  set9_menu = gtk_radio_menu_item_new_with_mnemonic (setgroup, _("Set _9"));
+  gtk_widget_set_tooltip_text (set1_menu, _("Switch to set 9"));
+  gtk_widget_set_name (set9_menu, "set_9");
+  setgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (set9_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (set9_menu), TRUE);
+  gtk_widget_set_sensitive (set9_menu, FALSE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (setmenu), set9_menu);
+  gtk_widget_add_accelerator (set9_menu, "activate", accel_group,
+                              GDK_KEY_9, 0, GTK_ACCEL_VISIBLE);
+  g_signal_connect (set9_menu, "activate", G_CALLBACK (on_set_activate), NULL);
+
+  colormenu = gtk_menu_new ();
+  gtk_menu_set_accel_group (GTK_MENU (colormenu), accel_group);
+  col_menu = gtk_menu_item_new_with_mnemonic (_("_Colors"));
+  gtk_widget_set_name (col_menu, "colors");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (col_menu), colormenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), col_menu);
+
+  col0_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _0"));
+  gtk_widget_set_tooltip_text (col0_menu, _("Use palette group 0"));
+  gtk_widget_set_name (col0_menu, "group_0");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col0_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col0_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col0_menu);
+  gtk_widget_add_accelerator (col0_menu, "activate", accel_group,
+                              GDK_KEY_0, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col0_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col1_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _1"));
+  gtk_widget_set_tooltip_text (col1_menu, _("Use palette group 1"));
+  gtk_widget_set_name (col1_menu, "group_1");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col1_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col1_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col1_menu);
+  gtk_widget_add_accelerator (col1_menu, "activate", accel_group,
+                              GDK_KEY_1, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col1_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col2_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _2"));
+  gtk_widget_set_tooltip_text (col2_menu, _("Use palette group 2"));
+  gtk_widget_set_name (col2_menu, "group_2");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col2_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col2_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col2_menu);
+  gtk_widget_add_accelerator (col2_menu, "activate", accel_group,
+                              GDK_KEY_2, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col2_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col3_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _3"));
+  gtk_widget_set_tooltip_text (col3_menu, _("Use palette group 3"));
+  gtk_widget_set_name (col3_menu, "group_3");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col3_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col3_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col3_menu);
+  gtk_widget_add_accelerator (col3_menu, "activate", accel_group,
+                              GDK_KEY_3, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col3_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col4_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _4"));
+  gtk_widget_set_tooltip_text (col4_menu, _("Use palette group 4"));
+  gtk_widget_set_name (col4_menu, "group_4");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col4_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col4_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col4_menu);
+  gtk_widget_add_accelerator (col4_menu, "activate", accel_group,
+                              GDK_KEY_4, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col4_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col5_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _5"));
+  gtk_widget_set_tooltip_text (col5_menu, _("Use palette group 5"));
+  gtk_widget_set_name (col5_menu, "group_5");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col5_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col5_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col5_menu);
+  gtk_widget_add_accelerator (col5_menu, "activate", accel_group,
+                              GDK_KEY_5, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col5_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col6_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _6"));
+  gtk_widget_set_tooltip_text (col6_menu, _("Use palette group 6"));
+  gtk_widget_set_name (col6_menu, "group_6");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col6_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col6_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col6_menu);
+  gtk_widget_add_accelerator (col6_menu, "activate", accel_group,
+                              GDK_KEY_6, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col6_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col7_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _7"));
+  gtk_widget_set_tooltip_text (col7_menu, _("Use palette group 7"));
+  gtk_widget_set_name (col7_menu, "group_7");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col7_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col7_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col7_menu);
+  gtk_widget_add_accelerator (col7_menu, "activate", accel_group,
+                              GDK_KEY_7, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col7_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col8_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _8"));
+  gtk_widget_set_tooltip_text (col8_menu, _("Use palette group 8"));
+  gtk_widget_set_name (col8_menu, "group_8");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col8_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col8_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col8_menu);
+  gtk_widget_add_accelerator (col8_menu, "activate", accel_group,
+                              GDK_KEY_8, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col8_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  col9_menu = gtk_radio_menu_item_new_with_mnemonic (colgroup, _("Group _9"));
+  gtk_widget_set_tooltip_text (col9_menu, _("Use palette group 9"));
+  gtk_widget_set_name (col9_menu, "group_9");
+  colgroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (col9_menu));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (col9_menu), TRUE);
+  gtk_menu_shell_append (GTK_MENU_SHELL (colormenu), col9_menu);
+  gtk_widget_add_accelerator (col9_menu, "activate", accel_group,
+                              GDK_KEY_9, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+  g_signal_connect (col9_menu, "activate",
+                    G_CALLBACK (on_group_activate), NULL);
+
+  toolmenu = gtk_menu_new ();
+  gtk_menu_set_accel_group (GTK_MENU (toolmenu), accel_group);
+  tool_menu = gtk_menu_item_new_with_mnemonic (_("_Tools"));
+  gtk_widget_set_name (tool_menu, "tools1");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (tool_menu), toolmenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), tool_menu);
+
+  errlist_menu = gtk_menu_item_new_with_mnemonic (_("_Error list"));
+  gtk_widget_set_name (errlist_menu, "error_list1");
+  gtk_menu_shell_append (GTK_MENU_SHELL (toolmenu), errlist_menu);
+  gtk_widget_add_accelerator (errlist_menu, "activate", accel_group,
+                              GDK_KEY_question, GDK_CONTROL_MASK,
+                              GTK_ACCEL_VISIBLE);
+  g_signal_connect (errlist_menu, "activate",
+                    G_CALLBACK (on_error_list_activate), NULL);
+
+  unfix_menu = gtk_menu_item_new_with_mnemonic (_("_Unfix"));
+  gtk_widget_set_name (unfix_menu, "unfix");
+  gtk_menu_shell_append (GTK_MENU_SHELL (toolmenu), unfix_menu);
+  g_signal_connect (unfix_menu, "activate",
+                    G_CALLBACK (on_unfix_activate), NULL);
+
+  settingsmenu = gtk_menu_new ();
+  settings_menu = gtk_menu_item_new_with_mnemonic (_("_Settings"));
+  gtk_widget_set_name (settings_menu, "settings");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (settings_menu), settingsmenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), settings_menu);
+
+  prefs_menu = gtk_menu_item_new_with_mnemonic (_("Prefere_nces"));
+  gtk_widget_set_tooltip_text (prefs_menu, _("Configure the application"));
+  gtk_widget_set_name (prefs_menu, "preferences");
+  gtk_menu_shell_append (GTK_MENU_SHELL (settingsmenu), prefs_menu);
+  g_signal_connect (prefs_menu, "activate",
+                    G_CALLBACK (on_preferences_activate), NULL);
+
+  helpmenu = gtk_menu_new ();
+  help_menu = gtk_menu_item_new_with_mnemonic (_("_Help"));
+  gtk_widget_set_name (help_menu, "help");
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (help_menu), helpmenu);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), help_menu);
+
+  about_menu = gtk_menu_item_new_with_mnemonic (_("_About"));
+  gtk_widget_set_tooltip_text (about_menu, _("About this application"));
+  gtk_widget_set_name (about_menu, "about");
+  gtk_menu_shell_append (GTK_MENU_SHELL (helpmenu), about_menu);
+  g_signal_connect (about_menu, "activate",
+                    G_CALLBACK (on_about_activate), NULL);
 
-  gtk_widget_set_name (group_0_uiinfo[6].widget, "group_6");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[6].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[7].widget, "group_7");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[7].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[8].widget, "group_8");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[8].widget), TRUE);
-
-  gtk_widget_set_name (group_0_uiinfo[9].widget, "group_9");
-  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group_0_uiinfo[9].widget), TRUE);
-
-  gtk_widget_set_name (menubar1_uiinfo[3].widget, "tools1");
-
-  gtk_widget_set_name (tools1_menu_uiinfo[0].widget, "error_list1");
-
-  gtk_widget_set_name (tools1_menu_uiinfo[1].widget, "unfix");
-
-  gtk_widget_set_name (menubar1_uiinfo[4].widget, "settings");
-
-  gtk_widget_set_name (settings_menu_uiinfo[0].widget, "preferences");
-
-  gtk_widget_set_name (menubar1_uiinfo[5].widget, "help");
-
-  gtk_widget_set_name (help_menu_uiinfo[0].widget, "about");
+  gtk_widget_show_all (menubar);
 
   toolbar1 = gtk_toolbar_new ();
   gtk_widget_set_name (toolbar1, "toolbar1");
   gtk_widget_show (toolbar1);
-  gnome_app_add_toolbar (GNOME_APP (application), GTK_TOOLBAR (toolbar1), "toolbar1",
-                                BONOBO_DOCK_ITEM_BEH_EXCLUSIVE
-                                | BONOBO_DOCK_ITEM_BEH_LOCKED,
-                                BONOBO_DOCK_TOP, 1, 0, 0);
+  gtk_container_add (GTK_CONTAINER (dock1), toolbar1);
   gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
   gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_ICONS);
   tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
 
-  tmp_image = gtk_image_new_from_stock ("gtk-open", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("gtk-open", tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   button2 = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Open"));
   gtk_widget_set_name (button2, "button2");
   gtk_widget_show (button2);
   gtk_container_add (GTK_CONTAINER (toolbar1), button2);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (button2), tooltips, _("Open File"), NULL);
+  gtk_widget_set_tooltip_text (button2, _("Open File"));
 
   separatortoolitem1 = (GtkWidget*) gtk_separator_tool_item_new ();
   gtk_widget_set_name (separatortoolitem1, "separatortoolitem1");
@@ -447,130 +486,140 @@
 
   show_set0 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set0), _("0"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-red", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set0), tmp_image);
   gtk_widget_set_name (show_set0, "show_set0");
   gtk_widget_show (show_set0);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set0);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set0), tooltips, _("Switch to set 0"), NULL);
+  gtk_widget_set_tooltip_text (show_set0, _("Switch to set 0"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set0), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set0));
 
   show_set1 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set1), _("1"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-green", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set1), tmp_image);
   gtk_widget_set_name (show_set1, "show_set1");
   gtk_widget_show (show_set1);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set1);
   gtk_widget_set_sensitive (show_set1, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set1), tooltips, _("Switch to set 1"), NULL);
+  gtk_widget_set_tooltip_text (show_set1, _("Switch to set 1"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set1), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set1));
 
   show_set2 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set2), _("2"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-blue", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set2), tmp_image);
   gtk_widget_set_name (show_set2, "show_set2");
   gtk_widget_show (show_set2);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set2);
   gtk_widget_set_sensitive (show_set2, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set2), tooltips, _("Switch to set 2"), NULL);
+  gtk_widget_set_tooltip_text (show_set2, _("Switch to set 2"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set2), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set2));
 
   show_set3 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set3), _("3"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-red", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set3), tmp_image);
   gtk_widget_set_name (show_set3, "show_set3");
   gtk_widget_show (show_set3);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set3);
   gtk_widget_set_sensitive (show_set3, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set3), tooltips, _("Switch to set 3"), NULL);
+  gtk_widget_set_tooltip_text (show_set3, _("Switch to set 3"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set3), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set3));
 
   show_set4 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set4), _("4"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-green", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set4), tmp_image);
   gtk_widget_set_name (show_set4, "show_set4");
   gtk_widget_show (show_set4);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set4);
   gtk_widget_set_sensitive (show_set4, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set4), tooltips, _("Switch to set 4"), NULL);
+  gtk_widget_set_tooltip_text (show_set4, _("Switch to set 4"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set4), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set4));
 
   show_set5 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set5), _("5"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-blue", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set5), tmp_image);
   gtk_widget_set_name (show_set5, "show_set5");
   gtk_widget_show (show_set5);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set5);
   gtk_widget_set_sensitive (show_set5, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set5), tooltips, _("Switch to set 5"), NULL);
+  gtk_widget_set_tooltip_text (show_set5, _("Switch to set 5"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set5), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set5));
 
   show_set6 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set6), _("6"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-red", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set6), tmp_image);
   gtk_widget_set_name (show_set6, "show_set6");
   gtk_widget_show (show_set6);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set6);
   gtk_widget_set_sensitive (show_set6, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set6), tooltips, _("Switch to set 6"), NULL);
+  gtk_widget_set_tooltip_text (show_set6, _("Switch to set 6"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set6), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set6));
 
   show_set7 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set7), _("7"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-green", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set7), tmp_image);
   gtk_widget_set_name (show_set7, "show_set7");
   gtk_widget_show (show_set7);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set7);
   gtk_widget_set_sensitive (show_set7, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set7), tooltips, _("Switch to set 7"), NULL);
+  gtk_widget_set_tooltip_text (show_set7, _("Switch to set 7"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set7), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set7));
 
   show_set8 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set8), _("8"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-blue", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set8), tmp_image);
   gtk_widget_set_name (show_set8, "show_set8");
   gtk_widget_show (show_set8);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set8);
   gtk_widget_set_sensitive (show_set8, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set8), tooltips, _("Switch to set 8"), NULL);
+  gtk_widget_set_tooltip_text (show_set8, _("Switch to set 8"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set8), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set8));
 
   show_set9 = (GtkWidget*) gtk_radio_tool_button_new (NULL);
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (show_set9), _("9"));
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-book-red", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("accessories-dictionary",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (show_set9), tmp_image);
   gtk_widget_set_name (show_set9, "show_set9");
   gtk_widget_show (show_set9);
   gtk_container_add (GTK_CONTAINER (toolbar1), show_set9);
   gtk_widget_set_sensitive (show_set9, FALSE);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (show_set9), tooltips, _("Switch to set 9"), NULL);
+  gtk_widget_set_tooltip_text (show_set9, _("Switch to set 9"));
   gtk_radio_tool_button_set_group (GTK_RADIO_TOOL_BUTTON (show_set9), show_set0_group);
   show_set0_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (show_set9));
 
@@ -579,20 +628,21 @@
   gtk_widget_show (separatortoolitem2);
   gtk_container_add (GTK_CONTAINER (toolbar1), separatortoolitem2);
 
-  tmp_image = gtk_image_new_from_stock ("gnome-stock-attach", tmp_toolbar_icon_size);
+  tmp_image = gtk_image_new_from_icon_name ("emblem-documents",
+                                            tmp_toolbar_icon_size);
   gtk_widget_show (tmp_image);
   button5 = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Unfix"));
   gtk_widget_set_name (button5, "button5");
   gtk_widget_show (button5);
   gtk_container_add (GTK_CONTAINER (toolbar1), button5);
-  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (button5), tooltips, _("Unfix current object"), NULL);
+  gtk_widget_set_tooltip_text (button5, _("Unfix current object"));
 
   scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
   gtk_widget_set_name (scrolledwindow1, "scrolledwindow1");
   gtk_widget_show (scrolledwindow1);
-  gnome_app_set_contents (GNOME_APP (application), scrolledwindow1);
+  gtk_box_pack_start (GTK_BOX (dock1), scrolledwindow1, TRUE, TRUE, 0);
   gtk_widget_set_size_request (scrolledwindow1, 600, 400);
-  GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS);
+  gtk_widget_set_can_focus (scrolledwindow1, FALSE);
 
   viewport1 = gtk_viewport_new (NULL, NULL);
   gtk_widget_set_name (viewport1, "viewport1");
@@ -605,10 +655,17 @@
   gtk_container_add (GTK_CONTAINER (viewport1), area);
   gtk_widget_set_events (area, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
 
-  appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_widget_show (hbox);
+  gtk_container_add (GTK_CONTAINER (dock1), hbox);
+  pbar = gtk_progress_bar_new ();
+  gtk_widget_set_name (pbar, "pbar");
+  gtk_widget_show (pbar);
+  gtk_box_pack_start (GTK_BOX (hbox), pbar, FALSE, FALSE, 0);
+  appbar = gtk_statusbar_new ();
   gtk_widget_set_name (appbar, "appbar");
   gtk_widget_show (appbar);
-  gnome_app_set_statusbar (GNOME_APP (application), appbar);
+  gtk_box_pack_start (GTK_BOX (hbox), appbar, TRUE, TRUE, 0);
 
   g_signal_connect ((gpointer) application, "delete_event",
                     G_CALLBACK (on_application_delete_event),
@@ -616,10 +673,9 @@
   g_signal_connect ((gpointer) application, "drag_data_received",
                     G_CALLBACK (on_application_drag_data_received),
                     NULL);
-  gnome_app_install_menu_hints (GNOME_APP (application), menubar1_uiinfo);
   g_signal_connect ((gpointer) button2, "clicked",
                     G_CALLBACK (on_open_activate),
-                    NULL);
+                    _("Open KiSS Set"));
   g_signal_connect ((gpointer) show_set0, "clicked",
                     G_CALLBACK (on_set_clicked),
                     NULL);
@@ -653,7 +709,7 @@
   g_signal_connect ((gpointer) button5, "clicked",
                     G_CALLBACK (on_unfix_clicked),
                     NULL);
-  g_signal_connect ((gpointer) area, "expose_event",
+  g_signal_connect ((gpointer) area, "draw",
                     G_CALLBACK (on_area_expose_event),
                     NULL);
   g_signal_connect ((gpointer) area, "configure_event",
@@ -672,42 +728,42 @@
   /* Store pointers to all widgets, for use by lookup_widget(). */
   GLADE_HOOKUP_OBJECT_NO_REF (application, application, "application");
   GLADE_HOOKUP_OBJECT (application, dock1, "dock1");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[0].widget, "file");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[0].widget, "open");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[1].widget, "open_config");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[2].widget, "open_add_on");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[3].widget, "close");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[4].widget, "separator1");
-  GLADE_HOOKUP_OBJECT (application, file_menu_uiinfo[5].widget, "exit");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[1].widget, "sets");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[0].widget, "set_0");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[1].widget, "set_1");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[2].widget, "set_2");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[3].widget, "set_3");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[4].widget, "set_4");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[5].widget, "set_5");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[6].widget, "set_6");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[7].widget, "set_7");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[8].widget, "set_8");
-  GLADE_HOOKUP_OBJECT (application, set_0_uiinfo[9].widget, "set_9");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[2].widget, "colors");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[0].widget, "group_0");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[1].widget, "group_1");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[2].widget, "group_2");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[3].widget, "group_3");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[4].widget, "group_4");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[5].widget, "group_5");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[6].widget, "group_6");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[7].widget, "group_7");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[8].widget, "group_8");
-  GLADE_HOOKUP_OBJECT (application, group_0_uiinfo[9].widget, "group_9");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[3].widget, "tools1");
-  GLADE_HOOKUP_OBJECT (application, tools1_menu_uiinfo[0].widget, "error_list1");
-  GLADE_HOOKUP_OBJECT (application, tools1_menu_uiinfo[1].widget, "unfix");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[4].widget, "settings");
-  GLADE_HOOKUP_OBJECT (application, settings_menu_uiinfo[0].widget, "preferences");
-  GLADE_HOOKUP_OBJECT (application, menubar1_uiinfo[5].widget, "help");
-  GLADE_HOOKUP_OBJECT (application, help_menu_uiinfo[0].widget, "about");
+  GLADE_HOOKUP_OBJECT (application, file_menu, "file");
+  GLADE_HOOKUP_OBJECT (application, open_menu, "open");
+  GLADE_HOOKUP_OBJECT (application, open_config_menu, "open_config");
+  GLADE_HOOKUP_OBJECT (application, open_addon_menu, "open_add_on");
+  GLADE_HOOKUP_OBJECT (application, close_menu, "close");
+  GLADE_HOOKUP_OBJECT (application, separator, "separator1");
+  GLADE_HOOKUP_OBJECT (application, quit_menu, "exit");
+  GLADE_HOOKUP_OBJECT (application, set_menu, "sets");
+  GLADE_HOOKUP_OBJECT (application, set0_menu, "set_0");
+  GLADE_HOOKUP_OBJECT (application, set1_menu, "set_1");
+  GLADE_HOOKUP_OBJECT (application, set2_menu, "set_2");
+  GLADE_HOOKUP_OBJECT (application, set3_menu, "set_3");
+  GLADE_HOOKUP_OBJECT (application, set4_menu, "set_4");
+  GLADE_HOOKUP_OBJECT (application, set5_menu, "set_5");
+  GLADE_HOOKUP_OBJECT (application, set6_menu, "set_6");
+  GLADE_HOOKUP_OBJECT (application, set7_menu, "set_7");
+  GLADE_HOOKUP_OBJECT (application, set8_menu, "set_8");
+  GLADE_HOOKUP_OBJECT (application, set9_menu, "set_9");
+  GLADE_HOOKUP_OBJECT (application, col_menu, "colors");
+  GLADE_HOOKUP_OBJECT (application, col0_menu, "group_0");
+  GLADE_HOOKUP_OBJECT (application, col1_menu, "group_1");
+  GLADE_HOOKUP_OBJECT (application, col2_menu, "group_2");
+  GLADE_HOOKUP_OBJECT (application, col3_menu, "group_3");
+  GLADE_HOOKUP_OBJECT (application, col4_menu, "group_4");
+  GLADE_HOOKUP_OBJECT (application, col5_menu, "group_5");
+  GLADE_HOOKUP_OBJECT (application, col6_menu, "group_6");
+  GLADE_HOOKUP_OBJECT (application, col7_menu, "group_7");
+  GLADE_HOOKUP_OBJECT (application, col8_menu, "group_8");
+  GLADE_HOOKUP_OBJECT (application, col9_menu, "group_9");
+  GLADE_HOOKUP_OBJECT (application, tool_menu, "tools1");
+  GLADE_HOOKUP_OBJECT (application, errlist_menu, "error_list1");
+  GLADE_HOOKUP_OBJECT (application, unfix_menu, "unfix");
+  GLADE_HOOKUP_OBJECT (application, settings_menu, "settings");
+  GLADE_HOOKUP_OBJECT (application, prefs_menu, "preferences");
+  GLADE_HOOKUP_OBJECT (application, help_menu, "help");
+  GLADE_HOOKUP_OBJECT (application, about_menu, "about");
   GLADE_HOOKUP_OBJECT (application, toolbar1, "toolbar1");
   GLADE_HOOKUP_OBJECT (application, button2, "button2");
   GLADE_HOOKUP_OBJECT (application, separatortoolitem1, "separatortoolitem1");
@@ -727,95 +783,17 @@
   GLADE_HOOKUP_OBJECT (application, viewport1, "viewport1");
   GLADE_HOOKUP_OBJECT (application, area, "area");
   GLADE_HOOKUP_OBJECT (application, appbar, "appbar");
-  GLADE_HOOKUP_OBJECT_NO_REF (application, tooltips, "tooltips");
+  GLADE_HOOKUP_OBJECT (application, pbar, "pbar");
 
   return application;
 }
 
-GtkWidget*
-create_set_open (void)
-{
-  GtkWidget *set_open;
-  GtkWidget *ok_button1;
-  GtkWidget *cancel_button1;
-
-  set_open = gtk_file_selection_new (_("Open KiSS Set"));
-  gtk_widget_set_name (set_open, "set_open");
-  gtk_container_set_border_width (GTK_CONTAINER (set_open), 10);
-  gtk_window_set_modal (GTK_WINDOW (set_open), TRUE);
-  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (set_open), TRUE);
-  gtk_window_set_skip_pager_hint (GTK_WINDOW (set_open), TRUE);
-  gtk_window_set_type_hint (GTK_WINDOW (set_open), GDK_WINDOW_TYPE_HINT_DIALOG);
-
-  ok_button1 = GTK_FILE_SELECTION (set_open)->ok_button;
-  gtk_widget_set_name (ok_button1, "ok_button1");
-  gtk_widget_show (ok_button1);
-  GTK_WIDGET_SET_FLAGS (ok_button1, GTK_CAN_DEFAULT);
-
-  cancel_button1 = GTK_FILE_SELECTION (set_open)->cancel_button;
-  gtk_widget_set_name (cancel_button1, "cancel_button1");
-  gtk_widget_show (cancel_button1);
-  GTK_WIDGET_SET_FLAGS (cancel_button1, GTK_CAN_DEFAULT);
-
-  g_signal_connect ((gpointer) set_open, "delete_event",
-                    G_CALLBACK (gtk_widget_hide),
-                    NULL);
-  g_signal_connect ((gpointer) ok_button1, "clicked",
-                    G_CALLBACK (on_set_open_ok),
-                    NULL);
-  g_signal_connect ((gpointer) cancel_button1, "clicked",
-                    G_CALLBACK (on_set_open_cancel),
-                    NULL);
-
-  /* Store pointers to all widgets, for use by lookup_widget(). */
-  GLADE_HOOKUP_OBJECT_NO_REF (set_open, set_open, "set_open");
-  GLADE_HOOKUP_OBJECT_NO_REF (set_open, ok_button1, "ok_button1");
-  GLADE_HOOKUP_OBJECT_NO_REF (set_open, cancel_button1, "cancel_button1");
-
-  return set_open;
-}
-
-GtkWidget*
-create_config_open (void)
-{
-  GtkWidget *config_open;
-  GtkWidget *ok_button2;
-  GtkWidget *cancel_button2;
-
-  config_open = gtk_file_selection_new (_("Select Config file"));
-  gtk_widget_set_name (config_open, "config_open");
-  gtk_container_set_border_width (GTK_CONTAINER (config_open), 10);
-  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (config_open), TRUE);
-  gtk_window_set_skip_pager_hint (GTK_WINDOW (config_open), TRUE);
-  gtk_window_set_type_hint (GTK_WINDOW (config_open), GDK_WINDOW_TYPE_HINT_DIALOG);
-
-  ok_button2 = GTK_FILE_SELECTION (config_open)->ok_button;
-  gtk_widget_set_name (ok_button2, "ok_button2");
-  gtk_widget_show (ok_button2);
-  GTK_WIDGET_SET_FLAGS (ok_button2, GTK_CAN_DEFAULT);
-
-  cancel_button2 = GTK_FILE_SELECTION (config_open)->cancel_button;
-  gtk_widget_set_name (cancel_button2, "cancel_button2");
-  gtk_widget_show (cancel_button2);
-  GTK_WIDGET_SET_FLAGS (cancel_button2, GTK_CAN_DEFAULT);
-
-  g_signal_connect ((gpointer) config_open, "delete_event",
-                    G_CALLBACK (gtk_widget_hide),
-                    NULL);
-  g_signal_connect ((gpointer) ok_button2, "clicked",
-                    G_CALLBACK (on_config_open_ok),
-                    NULL);
-  g_signal_connect ((gpointer) cancel_button2, "clicked",
-                    G_CALLBACK (on_config_open_cancel),
-                    NULL);
-
-  /* Store pointers to all widgets, for use by lookup_widget(). */
-  GLADE_HOOKUP_OBJECT_NO_REF (config_open, config_open, "config_open");
-  GLADE_HOOKUP_OBJECT_NO_REF (config_open, ok_button2, "ok_button2");
-  GLADE_HOOKUP_OBJECT_NO_REF (config_open, cancel_button2, "cancel_button2");
-
-  return config_open;
-}
+enum {
+  FILE_COLUMN,
+  LINE_COLUMN,
+  MESSAGE_COLUMN,
+  N_ELEMENTS
+};
 
 GtkWidget*
 create_error_list (void)
@@ -823,10 +801,12 @@
   GtkWidget *error_list;
   GtkWidget *vbox1;
   GtkWidget *scrolledwindow2;
+  extern GtkListStore *error_store;
   GtkWidget *error_clist;
-  GtkWidget *label7;
-  GtkWidget *label8;
-  GtkWidget *label9;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *label7;
+  GtkTreeViewColumn *label8;
+  GtkTreeViewColumn *label9;
   GtkWidget *hbuttonbox1;
   GtkWidget *button4;
   GtkWidget *button6;
@@ -835,7 +815,7 @@
   gtk_widget_set_name (error_list, "error_list");
   gtk_window_set_title (GTK_WINDOW (error_list), _("Error list"));
 
-  vbox1 = gtk_vbox_new (FALSE, 0);
+  vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_widget_set_name (vbox1, "vbox1");
   gtk_widget_show (vbox1);
   gtk_container_add (GTK_CONTAINER (error_list), vbox1);
@@ -844,34 +824,41 @@
   gtk_widget_set_name (scrolledwindow2, "scrolledwindow2");
   gtk_widget_show (scrolledwindow2);
   gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow2, TRUE, TRUE, 0);
-  GTK_WIDGET_UNSET_FLAGS (scrolledwindow2, GTK_CAN_FOCUS);
+  gtk_widget_set_can_focus (scrolledwindow2, FALSE);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN);
 
-  error_clist = gtk_clist_new (3);
+  error_store = gtk_list_store_new (N_ELEMENTS, G_TYPE_STRING,
+                                    G_TYPE_STRING, G_TYPE_STRING);
+  error_clist = gtk_tree_view_new_with_model (GTK_TREE_MODEL (error_store));
   gtk_widget_set_name (error_clist, "error_clist");
   gtk_widget_show (error_clist);
   gtk_container_add (GTK_CONTAINER (scrolledwindow2), error_clist);
-  gtk_clist_set_column_width (GTK_CLIST (error_clist), 0, 80);
-  gtk_clist_set_column_width (GTK_CLIST (error_clist), 1, 80);
-  gtk_clist_set_column_width (GTK_CLIST (error_clist), 2, 80);
-  gtk_clist_column_titles_show (GTK_CLIST (error_clist));
-
-  label7 = gtk_label_new (_("File"));
-  gtk_widget_set_name (label7, "label7");
-  gtk_widget_show (label7);
-  gtk_clist_set_column_widget (GTK_CLIST (error_clist), 0, label7);
-
-  label8 = gtk_label_new (_("Line"));
-  gtk_widget_set_name (label8, "label8");
-  gtk_widget_show (label8);
-  gtk_clist_set_column_widget (GTK_CLIST (error_clist), 1, label8);
-
-  label9 = gtk_label_new (_("Message"));
-  gtk_widget_set_name (label9, "label9");
-  gtk_widget_show (label9);
-  gtk_clist_set_column_widget (GTK_CLIST (error_clist), 2, label9);
+  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (error_clist), TRUE);
+
+  renderer = gtk_cell_renderer_text_new ();
 
-  hbuttonbox1 = gtk_hbutton_box_new ();
+  label7 = gtk_tree_view_column_new_with_attributes (_("File"), renderer,
+                                                     "text", FILE_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_fixed_width (label7, 80);
+  gtk_tree_view_column_set_visible (label7, TRUE);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (error_clist), label7);
+
+  label8 = gtk_tree_view_column_new_with_attributes (_("Line"), renderer,
+                                                     "text", LINE_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_fixed_width (label8, 80);
+  gtk_tree_view_column_set_visible (label8, TRUE);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (error_clist), label8);
+
+  label9 = gtk_tree_view_column_new_with_attributes (_("Message"), renderer,
+                                                     "text", MESSAGE_COLUMN,
+                                                     NULL);
+  gtk_tree_view_column_set_fixed_width (label9, 80);
+  gtk_tree_view_column_set_visible (label9, TRUE);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (error_clist), label9);
+
+  hbuttonbox1 = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
   gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
   gtk_widget_show (hbuttonbox1);
   gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 0);
@@ -881,13 +868,13 @@
   gtk_widget_set_name (button4, "button4");
   gtk_widget_show (button4);
   gtk_container_add (GTK_CONTAINER (hbuttonbox1), button4);
-  GTK_WIDGET_SET_FLAGS (button4, GTK_CAN_DEFAULT);
+  gtk_widget_set_can_default (button4, TRUE);
 
   button6 = gtk_button_new_with_mnemonic (_("Clear"));
   gtk_widget_set_name (button6, "button6");
   gtk_widget_show (button6);
   gtk_container_add (GTK_CONTAINER (hbuttonbox1), button6);
-  GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT);
+  gtk_widget_set_can_default (button6, TRUE);
 
   g_signal_connect ((gpointer) error_list, "delete_event",
                     G_CALLBACK (gtk_widget_hide),
@@ -915,51 +902,11 @@
 }
 
 GtkWidget*
-create_add_open (void)
-{
-  GtkWidget *add_open;
-  GtkWidget *ok_button3;
-  GtkWidget *cancel_button3;
-
-  add_open = gtk_file_selection_new (_("Select Add-on"));
-  gtk_widget_set_name (add_open, "add_open");
-  gtk_container_set_border_width (GTK_CONTAINER (add_open), 10);
-  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (add_open), TRUE);
-  gtk_window_set_skip_pager_hint (GTK_WINDOW (add_open), TRUE);
-  gtk_window_set_type_hint (GTK_WINDOW (add_open), GDK_WINDOW_TYPE_HINT_DIALOG);
-
-  ok_button3 = GTK_FILE_SELECTION (add_open)->ok_button;
-  gtk_widget_set_name (ok_button3, "ok_button3");
-  gtk_widget_show (ok_button3);
-  GTK_WIDGET_SET_FLAGS (ok_button3, GTK_CAN_DEFAULT);
-
-  cancel_button3 = GTK_FILE_SELECTION (add_open)->cancel_button;
-  gtk_widget_set_name (cancel_button3, "cancel_button3");
-  gtk_widget_show (cancel_button3);
-  GTK_WIDGET_SET_FLAGS (cancel_button3, GTK_CAN_DEFAULT);
-
-  g_signal_connect ((gpointer) add_open, "delete_event",
-                    G_CALLBACK (gtk_widget_hide),
-                    NULL);
-  g_signal_connect ((gpointer) ok_button3, "clicked",
-                    G_CALLBACK (on_add_open_ok),
-                    NULL);
-  g_signal_connect ((gpointer) cancel_button3, "clicked",
-                    G_CALLBACK (on_add_open_cancel),
-                    NULL);
-
-  /* Store pointers to all widgets, for use by lookup_widget(). */
-  GLADE_HOOKUP_OBJECT_NO_REF (add_open, add_open, "add_open");
-  GLADE_HOOKUP_OBJECT_NO_REF (add_open, ok_button3, "ok_button3");
-  GLADE_HOOKUP_OBJECT_NO_REF (add_open, cancel_button3, "cancel_button3");
-
-  return add_open;
-}
-
-GtkWidget*
 create_preferences (void)
 {
+  extern GtkWidget *app;
   GtkWidget *preferences;
+  GtkWidget *carea;
   GtkWidget *notebook1;
   GtkWidget *table3;
   GtkWidget *pref_midi;
@@ -977,30 +924,37 @@
   GtkWidget *pref_fkiss_case;
   GtkWidget *pref_default_palette;
   GtkWidget *label_speed_factor;
-  GtkObject *pref_speed_factor_adj;
+  GtkAdjustment *pref_speed_factor_adj;
   GtkWidget *pref_speed_factor;
   GtkWidget *label_min_timer;
-  GtkObject *pref_min_timer_adj;
+  GtkAdjustment *pref_min_timer_adj;
   GtkWidget *pref_min_timer;
   GtkWidget *pref_catch_drop;
   GtkWidget *features;
-  GtkTooltips *tooltips;
+  gchar *midiplayer;
 
-  tooltips = gtk_tooltips_new ();
+  preferences = gtk_dialog_new_with_buttons (_("Preferences"),
+                                             GTK_WINDOW (app),
+                                             GTK_DIALOG_DESTROY_WITH_PARENT,
+                                             _("_OK"),
+                                             GTK_RESPONSE_ACCEPT,
+                                             _("_Cancel"),
+                                             GTK_RESPONSE_REJECT,
+                                             NULL);
 
-  preferences = gnome_property_box_new ();
   gtk_widget_set_name (preferences, "preferences");
-  gtk_window_set_title (GTK_WINDOW (preferences), _("Preferences"));
   gtk_window_set_resizable (GTK_WINDOW (preferences), FALSE);
   gtk_window_set_skip_taskbar_hint (GTK_WINDOW (preferences), TRUE);
   gtk_window_set_skip_pager_hint (GTK_WINDOW (preferences), TRUE);
   gtk_window_set_type_hint (GTK_WINDOW (preferences), GDK_WINDOW_TYPE_HINT_DIALOG);
 
-  notebook1 = GNOME_PROPERTY_BOX (preferences)->notebook;
+  carea = gtk_dialog_get_content_area (GTK_DIALOG (preferences));
+  notebook1 = gtk_notebook_new ();
   gtk_widget_set_name (notebook1, "notebook1");
   gtk_widget_show (notebook1);
+  gtk_container_add (GTK_CONTAINER (carea), notebook1);
 
-  table3 = gtk_table_new (3, 2, FALSE);
+  table3 = gtk_grid_new ();
   gtk_widget_set_name (table3, "table3");
   gtk_widget_show (table3);
   gtk_container_add (GTK_CONTAINER (notebook1), table3);
@@ -1008,34 +962,35 @@
   pref_midi = gtk_check_button_new_with_mnemonic (_("Play MIDI using external program"));
   gtk_widget_set_name (pref_midi, "pref_midi");
   gtk_widget_show (pref_midi);
-  gtk_table_attach (GTK_TABLE (table3), pref_midi, 0, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_midi),
+                                g_settings_get_boolean (settings, "midi"));
+  gtk_grid_attach (GTK_GRID (table3), pref_midi, 0, 0, 1, 1);
 
-  pref_esound = gtk_check_button_new_with_mnemonic (_("Play digital audio (needs GNOME audio)"));
+  pref_esound = gtk_check_button_new_with_mnemonic (_("Play digital audio"));
   gtk_widget_set_name (pref_esound, "pref_esound");
   gtk_widget_show (pref_esound);
-  gtk_table_attach (GTK_TABLE (table3), pref_esound, 0, 2, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_esound),
+                                g_settings_get_boolean (settings, "sound"));
+  gtk_grid_attach (GTK_GRID (table3), pref_esound, 0, 2, 1, 1);
 
   pref_midi_player = gtk_entry_new ();
   gtk_widget_set_name (pref_midi_player, "pref_midi_player");
   gtk_widget_show (pref_midi_player);
-  gtk_table_attach (GTK_TABLE (table3), pref_midi_player, 1, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_tooltips_set_tip (tooltips, pref_midi_player, _("Command that plays MIDI on your system e.g. playmidi -a"), NULL);
+  midiplayer = g_settings_get_string (settings, "midi-player");
+  gtk_entry_set_text (GTK_ENTRY (pref_midi_player), midiplayer);
+  g_free (midiplayer);
+  gtk_grid_attach (GTK_GRID (table3), pref_midi_player, 1, 1, 1, 1);
+  gtk_widget_set_tooltip_text (pref_midi_player,
+                               _("Command that plays MIDI on your system "
+                                 "e.g. playmidi -a"));
 
   label6 = gtk_label_new (_("MIDI player"));
   gtk_widget_set_name (label6, "label6");
   gtk_widget_show (label6);
-  gtk_table_attach (GTK_TABLE (table3), label6, 0, 1, 1, 2,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_CENTER);
-  gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
-  gtk_misc_set_padding (GTK_MISC (label6), 5, 0);
+  gtk_grid_attach (GTK_GRID (table3), label6, 0, 1, 1, 1);
+  gtk_widget_set_halign (label6, GTK_ALIGN_START);
+  gtk_label_set_yalign (GTK_LABEL (label6), 0.5);
+  gtk_widget_set_margin_start (label6, 5);
 
   label5 = gtk_label_new_with_mnemonic (_("_Sound"));
   gtk_widget_set_name (label5, "label5");
@@ -1043,7 +998,7 @@
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label5);
   gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_CENTER);
 
-  table2 = gtk_table_new (3, 2, FALSE);
+  table2 = gtk_grid_new ();
   gtk_widget_set_name (table2, "table2");
   gtk_widget_show (table2);
   gtk_container_add (GTK_CONTAINER (notebook1), table2);
@@ -1051,24 +1006,24 @@
   pref_error_list = gtk_check_button_new_with_mnemonic (_("Show error list (if any) after each doll loads"));
   gtk_widget_set_name (pref_error_list, "pref_error_list");
   gtk_widget_show (pref_error_list);
-  gtk_table_attach (GTK_TABLE (table2), pref_error_list, 0, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_error_list), TRUE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_error_list),
+                                g_settings_get_boolean (settings,
+                                                        "error-list"));
+  gtk_grid_attach (GTK_GRID (table2), pref_error_list, 0, 0, 1, 1);
 
   pref_trace = gtk_check_button_new_with_mnemonic (_("Trace actions at runtime"));
   gtk_widget_set_name (pref_trace, "pref_trace");
   gtk_widget_show (pref_trace);
-  gtk_table_attach (GTK_TABLE (table2), pref_trace, 0, 2, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_trace),
+                                g_settings_get_boolean (settings, "trace"));
+  gtk_grid_attach (GTK_GRID (table2), pref_trace, 0, 2, 1, 1);
 
   pref_warnings = gtk_check_button_new_with_mnemonic (_("Include warnings as well as errors"));
   gtk_widget_set_name (pref_warnings, "pref_warnings");
   gtk_widget_show (pref_warnings);
-  gtk_table_attach (GTK_TABLE (table2), pref_warnings, 0, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 10, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_warnings),
+                                g_settings_get_boolean (settings, "warnings"));
+  gtk_grid_attach (GTK_GRID (table2), pref_warnings, 0, 1, 1, 1);
 
   diagnostics = gtk_label_new_with_mnemonic (_("_Diagnostics"));
   gtk_widget_set_name (diagnostics, "diagnostics");
@@ -1076,7 +1031,7 @@
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), diagnostics);
   gtk_label_set_justify (GTK_LABEL (diagnostics), GTK_JUSTIFY_CENTER);
 
-  table1 = gtk_table_new (6, 2, FALSE);
+  table1 = gtk_grid_new ();
   gtk_widget_set_name (table1, "table1");
   gtk_widget_show (table1);
   gtk_container_add (GTK_CONTAINER (notebook1), table1);
@@ -1084,64 +1039,64 @@
   pref_ignore_colon = gtk_check_button_new_with_mnemonic (_("Ignore lone colon (show cell in all sets)"));
   gtk_widget_set_name (pref_ignore_colon, "pref_ignore_colon");
   gtk_widget_show (pref_ignore_colon);
-  gtk_table_attach (GTK_TABLE (table1), pref_ignore_colon, 0, 2, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_ignore_colon),
+                                g_settings_get_boolean (settings,
+                                                        "ignore-colon"));
+  gtk_grid_attach (GTK_GRID (table1), pref_ignore_colon, 0, 2, 1, 1);
 
   pref_fkiss_case = gtk_check_button_new_with_mnemonic (_("Case insensitive FKiSS parser"));
   gtk_widget_set_name (pref_fkiss_case, "pref_fkiss_case");
   gtk_widget_show (pref_fkiss_case);
-  gtk_table_attach (GTK_TABLE (table1), pref_fkiss_case, 0, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_fkiss_case),
+                                g_settings_get_boolean (settings,
+                                                        "fkiss-case"));
+  gtk_grid_attach (GTK_GRID (table1), pref_fkiss_case, 0, 1, 1, 1);
 
   pref_default_palette = gtk_check_button_new_with_mnemonic (_("Use PFK default palette (reload doll for effect)"));
   gtk_widget_set_name (pref_default_palette, "pref_default_palette");
   gtk_widget_show (pref_default_palette);
-  gtk_table_attach (GTK_TABLE (table1), pref_default_palette, 0, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_default_palette),
+                                g_settings_get_boolean (settings,
+                                                        "default-palette"));
+  gtk_grid_attach (GTK_GRID (table1), pref_default_palette, 0, 0, 1, 1);
 
   label_speed_factor = gtk_accel_label_new (_("Slow down factor"));
   gtk_widget_set_name (label_speed_factor, "label_speed_factor");
   gtk_widget_show (label_speed_factor);
-  gtk_table_attach (GTK_TABLE (table1), label_speed_factor, 0, 1, 4, 5,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (label_speed_factor), 0, 0.5);
+  gtk_grid_attach (GTK_GRID (table1), label_speed_factor, 0, 4, 1, 1);
+  gtk_label_set_yalign (GTK_LABEL (label_speed_factor), 0.5);
 
   pref_speed_factor_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 0);
   pref_speed_factor = gtk_spin_button_new (GTK_ADJUSTMENT (pref_speed_factor_adj), 1, 0);
   gtk_widget_set_name (pref_speed_factor, "pref_speed_factor");
   gtk_widget_show (pref_speed_factor);
-  gtk_table_attach (GTK_TABLE (table1), pref_speed_factor, 1, 2, 4, 5,
-                    (GtkAttachOptions) (0),
-                    (GtkAttachOptions) (0), 0, 0);
+  gtk_spin_button_set_value (GTK_SPIN_BUTTON (pref_speed_factor),
+                             g_settings_get_int (settings, "speed-factor"));
+  gtk_grid_attach (GTK_GRID (table1), pref_speed_factor, 1, 4, 1, 1);
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (pref_speed_factor), GTK_UPDATE_IF_VALID);
 
   label_min_timer = gtk_accel_label_new (_("Minimum timer interval (ms)"));
   gtk_widget_set_name (label_min_timer, "label_min_timer");
   gtk_widget_show (label_min_timer);
-  gtk_table_attach (GTK_TABLE (table1), label_min_timer, 0, 1, 5, 6,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (label_min_timer), 0, 0.5);
+  gtk_grid_attach (GTK_GRID (table1), label_min_timer, 0, 5, 1, 1);
+  gtk_label_set_yalign (GTK_LABEL (label_min_timer), 0.5);
 
   pref_min_timer_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 0);
   pref_min_timer = gtk_spin_button_new (GTK_ADJUSTMENT (pref_min_timer_adj), 1, 0);
   gtk_widget_set_name (pref_min_timer, "pref_min_timer");
   gtk_widget_show (pref_min_timer);
-  gtk_table_attach (GTK_TABLE (table1), pref_min_timer, 1, 2, 5, 6,
-                    (GtkAttachOptions) (0),
-                    (GtkAttachOptions) (0), 0, 0);
+  gtk_spin_button_set_value (GTK_SPIN_BUTTON (pref_min_timer),
+                             g_settings_get_int (settings, "min-timer"));
+  gtk_grid_attach (GTK_GRID (table1), pref_min_timer, 1, 5, 1, 1);
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (pref_min_timer), GTK_UPDATE_IF_VALID);
 
   pref_catch_drop = gtk_check_button_new_with_mnemonic (_("No {catch,drop} triggered if object is fixed"));
   gtk_widget_set_name (pref_catch_drop, "pref_catch_drop");
   gtk_widget_show (pref_catch_drop);
-  gtk_table_attach (GTK_TABLE (table1), pref_catch_drop, 0, 2, 3, 4,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_EXPAND), 0, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pref_catch_drop),
+                                g_settings_get_boolean (settings,
+                                                        "catch-drop"));
+  gtk_grid_attach (GTK_GRID (table1), pref_catch_drop, 0, 3, 1, 1);
 
   features = gtk_label_new_with_mnemonic (_("\"_Features\""));
   gtk_widget_set_name (features, "features");
@@ -1149,19 +1104,13 @@
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), features);
   gtk_label_set_justify (GTK_LABEL (features), GTK_JUSTIFY_CENTER);
 
-  g_signal_connect ((gpointer) preferences, "apply",
-                    G_CALLBACK (on_preferences_apply),
-                    NULL);
-  g_signal_connect ((gpointer) preferences, "close",
-                    G_CALLBACK (on_preferences_close),
-                    NULL);
   g_signal_connect ((gpointer) pref_midi, "toggled",
                     G_CALLBACK (on_pref_midi_toggled),
                     NULL);
   g_signal_connect ((gpointer) pref_esound, "toggled",
                     G_CALLBACK (on_pref_esound_toggled),
                     NULL);
-  g_signal_connect ((gpointer) pref_midi_player, "changed",
+  g_signal_connect ((gpointer) pref_midi_player, "activate",
                     G_CALLBACK (on_pref_midi_player_changed),
                     NULL);
   g_signal_connect ((gpointer) pref_error_list, "toggled",
@@ -1182,10 +1131,10 @@
   g_signal_connect ((gpointer) pref_default_palette, "toggled",
                     G_CALLBACK (on_pref_default_palette_toggled),
                     NULL);
-  g_signal_connect ((gpointer) pref_speed_factor, "changed",
+  g_signal_connect ((gpointer) pref_speed_factor, "value-changed",
                     G_CALLBACK (on_pref_speed_factor_changed),
                     NULL);
-  g_signal_connect ((gpointer) pref_min_timer, "changed",
+  g_signal_connect ((gpointer) pref_min_timer, "value-changed",
                     G_CALLBACK (on_pref_min_timer_changed),
                     NULL);
   g_signal_connect ((gpointer) pref_catch_drop, "toggled",
@@ -1216,7 +1165,6 @@
   GLADE_HOOKUP_OBJECT (preferences, pref_min_timer, "pref_min_timer");
   GLADE_HOOKUP_OBJECT (preferences, pref_catch_drop, "pref_catch_drop");
   GLADE_HOOKUP_OBJECT (preferences, features, "features");
-  GLADE_HOOKUP_OBJECT_NO_REF (preferences, tooltips, "tooltips");
 
   return preferences;
 }
@@ -1224,6 +1172,7 @@
 GtkWidget*
 create_about (void)
 {
+  extern GtkWidget *app;
   GtkWidget *about;
   const gchar *authors[] = {
     "Nick Lamb <drnick-gnomekiss@totl.net>",
@@ -1240,15 +1189,16 @@
 
   about = gtk_about_dialog_new ();
   gtk_widget_set_name (about, "about");
+  gtk_window_set_transient_for (GTK_WINDOW (about), GTK_WINDOW (app));
   gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about), VERSION);
-  gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (about), _("GnomeKiss"));
+  gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about), _("GnomeKiss"));
   gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (about), _("Copyright 2000-2005 Nick Lamb"));
   gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (about), _("A KiSS viewer for the GNOME desktop"));
   gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (about), _("This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."));
   gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (about), authors);
   gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG (about), artists);
   gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (about), translators);
-  about_logo_pixbuf = create_pixbuf ("gnomekiss/besito_sinfondo.png");
+  about_logo_pixbuf = create_pixbuf ("besito_sinfondo.png");
   gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), about_logo_pixbuf);
 
   /* Store pointers to all widgets, for use by lookup_widget(). */
--- gnomekiss-2.0.orig/src/callbacks.h
+++ gnomekiss-2.0/src/callbacks.h
@@ -1,4 +1,4 @@
-#include <gnome.h>
+#include <gtk/gtk.h>
 
 
 gboolean
@@ -18,17 +18,13 @@
 
 void
 on_open_activate                       (GtkMenuItem     *menuitem,
-                                        gpointer         user_data);
+                                        const gchar     *title);
 
 void
 on_open_config_activate                (GtkMenuItem     *menuitem,
                                         gpointer         user_data);
 
 void
-on_open_add_on_activate                (GtkMenuItem     *menuitem,
-                                        gpointer         user_data);
-
-void
 on_close_activate                      (GtkMenuItem     *menuitem,
                                         gpointer         user_data);
 
@@ -70,7 +66,7 @@
 
 gboolean
 on_area_expose_event                   (GtkWidget       *widget,
-                                        GdkEventExpose  *event,
+                                        cairo_t         *cr,
                                         gpointer         user_data);
 
 gboolean
@@ -94,22 +90,6 @@
                                         gpointer         user_data);
 
 void
-on_set_open_ok                         (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
-on_set_open_cancel                     (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
-on_config_open_ok                      (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
-on_config_open_cancel                  (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
 on_close_errors_clicked                (GtkButton       *button,
                                         gpointer         user_data);
 
@@ -118,23 +98,6 @@
                                         gpointer         user_data);
 
 void
-on_add_open_ok                         (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
-on_add_open_cancel                     (GtkButton       *button,
-                                        gpointer         user_data);
-
-void
-on_preferences_apply                   (GnomePropertyBox *propertybox,
-                                        gint             page_num,
-                                        gpointer         user_data);
-
-gboolean
-on_preferences_close                   (GnomeDialog     *gnomedialog,
-                                        gpointer         user_data);
-
-void
 on_pref_midi_toggled                   (GtkToggleButton *togglebutton,
                                         gpointer         user_data);
 
@@ -143,7 +106,7 @@
                                         gpointer         user_data);
 
 void
-on_pref_midi_player_changed            (GtkEditable     *editable,
+on_pref_midi_player_changed            (GtkEntry        *entry,
                                         gpointer         user_data);
 
 void
@@ -171,11 +134,11 @@
                                         gpointer         user_data);
 
 void
-on_pref_speed_factor_changed           (GtkEditable     *editable,
+on_pref_speed_factor_changed           (GtkSpinButton   *spinbutton,
                                         gpointer         user_data);
 
 void
-on_pref_min_timer_changed              (GtkEditable     *editable,
+on_pref_min_timer_changed              (GtkSpinButton   *spinbutton,
                                         gpointer         user_data);
 
 void
--- gnomekiss-2.0.orig/src/interface.h
+++ gnomekiss-2.0/src/interface.h
@@ -3,9 +3,7 @@
  */
 
 GtkWidget* create_application (void);
-GtkWidget* create_set_open (void);
-GtkWidget* create_config_open (void);
 GtkWidget* create_error_list (void);
-GtkWidget* create_add_open (void);
 GtkWidget* create_preferences (void);
 GtkWidget* create_about (void);
+void setup_settings_signals (void);
--- /dev/null
+++ gnomekiss-2.0/org.tlrmx.devel.GnomeKiss.gschema.xml
@@ -0,0 +1,52 @@
+<schemalist gettext-domain="gnomekiss">
+  <schema id="org.tlrmx.devel.GnomeKiss" path="/org/tlrmx/devel/gnomekiss/">
+    <key name="midi" type="b">
+      <default>true</default>
+      <summary>Whether to play MIDI using an external program.</summary>
+    </key>
+    <key name="sound" type="b">
+      <default>true</default>
+      <summary>Whether to play digital audio.</summary>
+    </key>
+    <key name="midi-player" type="s">
+      <default>'playmidi'</default>
+      <summary>Name of the MIDI player executable.</summary>
+    </key>
+    <key name="error-list" type="b">
+      <default>true</default>
+      <summary>Show error list after doll loading.</summary>
+    </key>
+    <key name="trace" type="b">
+      <default>false</default>
+      <summary>Trace all actions at runtime.</summary>
+    </key>
+    <key name="warnings" type="b">
+      <default>true</default>
+      <summary>Whether to include warnings in the error list.</summary>
+    </key>
+    <key name="ignore-colon" type="b">
+      <default>false</default>
+      <summary>Ignore lone colon (show cell in all sets).</summary>
+    </key>
+    <key name="default-palette" type="b">
+      <default>false</default>
+      <summary>User PFK default palette.</summary>
+    </key>
+    <key name="fkiss-case" type="b">
+      <default>false</default>
+      <summary>Case insensitive FKiSS parser.</summary>
+    </key>
+    <key name="catch-drop" type="b">
+      <default>false</default>
+      <summary>No {catch,drop} triggered if object is fixed.</summary>
+    </key>
+    <key name="speed-factor" type="i">
+      <default>1</default>
+      <summary>Slow down factor.</summary>
+    </key>
+    <key name="min-timer" type="i">
+      <default>1</default>
+      <summary>Minimum timer interval, in milliseconds.</summary>
+    </key>
+  </schema>
+</schemalist>
--- gnomekiss-2.0.orig/Makefile.am
+++ gnomekiss-2.0/Makefile.am
@@ -7,7 +7,12 @@
 	gnomekiss.spec \
 	gnomekiss.desktop \
 	gnomekiss.glade \
-	gnomekiss.gladep
+	gnomekiss.gladep \
+	$(gsettings_SCHEMAS)
+
+gsettings_SCHEMAS = org.tlrmx.devel.GnomeKiss.gschema.xml
+
+@GSETTINGS_RULES@
 
 install-data-local:
 	@$(NORMAL_INSTALL)
--- gnomekiss-2.0.orig/po/POTFILES.in
+++ gnomekiss-2.0/po/POTFILES.in
@@ -12,4 +12,5 @@
 src/lzh.c
 src/util.c
 src/timer.c
+org.tlrmx.devel.GnomeKiss.gschema.xml
 
