]> git.street.me.uk Git - andy/viking.git/blobdiff - src/print.c
Always open new .vik file in current window when no .vik file is loaded.
[andy/viking.git] / src / print.c
index 8b506710230240900ff30a94ed98a0bc9ea426fd..cf817a18b5d1bd3e34d60286d3c28271abd23937 100644 (file)
@@ -30,8 +30,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
-#if GTK_CHECK_VERSION(2,10,0)
-
 #include "viking.h"
 #include "print.h"
 #include "print-preview.h"
@@ -354,7 +352,11 @@ static void page_setup_cb (GtkWidget *widget, CustomWidgetInfo *info)
   GtkWidget         *toplevel;
 
   toplevel = gtk_widget_get_toplevel (widget);
+#if GTK_CHECK_VERSION (2,18,0)
+  if (! gtk_widget_is_toplevel (toplevel))
+#else
   if (! GTK_WIDGET_TOPLEVEL (toplevel))
+#endif
     toplevel = NULL;
 
   settings = gtk_print_operation_get_print_settings (operation);
@@ -593,9 +595,9 @@ static GtkWidget *create_custom_widget_cb(GtkPrintOperation *operation, PrintDat
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   gtk_widget_show (label);
 
-  combo = gtk_combo_box_new_text ();
+  combo = vik_combo_box_text_new ();
   for (center = center_modes; center->name; center++) {
-    gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _(center->name));
+    vik_combo_box_text_append (combo, _(center->name));
   }
   gtk_combo_box_set_active(GTK_COMBO_BOX(combo), VIK_PRINT_CENTER_BOTH);
   gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
@@ -667,5 +669,3 @@ static GtkWidget *create_custom_widget_cb(GtkPrintOperation *operation, PrintDat
   
   return layout;
 }
-
-#endif