]> www.fi.muni.cz Git - evince.git/commitdiff
Bump GTK+ requirements to 2.20.0
authorCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 31 Mar 2010 15:51:45 +0000 (17:51 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 31 Mar 2010 15:51:45 +0000 (17:51 +0200)
Remove GTK_CHECK_VERSION macros and unneeded code.

configure.ac
data/evince-ui.xml
libdocument/ev-attachment.c
libview/ev-print-operation.c
shell/ev-properties-license.c
shell/ev-sidebar-attachments.c
shell/ev-window.c

index 7c48f9add7f52848b7895f9ba21317c177cc436b..472aa99407a52c25f3b89b214cd78707992274ba 100644 (file)
@@ -122,7 +122,7 @@ AM_CONDITIONAL([PLATFORM_WIN32],[test "$with_platform" = "win32"])
 
 dnl Specify required versions of dependencies
 DBUS_GLIB_REQUIRED=0.70
-GTK_REQUIRED=2.14.0
+GTK_REQUIRED=2.20.0
 GLIB_REQUIRED=2.18.0
 KEYRING_REQUIRED=2.22.0
 AC_SUBST([GLIB_REQUIRED])
index d5ca9c435386202842a493a24cc626f6aa21a67b..962e8b26b488a5c0cd1a553d7b4e12695dadf43c 100644 (file)
@@ -5,7 +5,6 @@
       <menuitem name="FileOpenCopyMenu" action="FileOpenCopy"/>
       <menuitem name="FileSaveAsMenu" action="FileSaveAs"/>
       <separator/>
-      <menuitem name="FilePageSetupMenu" action="FilePageSetup"/>
       <menuitem name="FilePrintMenu" action="FilePrint"/>
       <separator/>
       <menuitem name="FilePropertiesMenu" action="FileProperties"/>
index 0e9653dc4312910c61e13fc166398a2c5642cc89..1b25823b17f5a101589378ac3ca20fdb3a0d1ff7 100644 (file)
@@ -354,12 +354,11 @@ ev_attachment_launch_app (EvAttachment *attachment,
        g_assert (G_IS_APP_INFO (attachment->priv->app));
 
        files = g_list_prepend (files, attachment->priv->tmp_file);
-       
-#if GTK_CHECK_VERSION (2, 14, 0)
+
        context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
        gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context), screen);
        gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context), timestamp);
-#endif
+
        result = g_app_info_launch (attachment->priv->app, files,
                                    context, &ioerror);
        
index 85ba06c2fe158be29a80875d0ee91f09176c6564..a1a3332d2dc4c9a4a475d8fa0733d3a5daf5d891 100644 (file)
@@ -285,27 +285,21 @@ void
 ev_print_operation_set_embed_page_setup (EvPrintOperation *op,
                                         gboolean          embed)
 {
-#if GTK_CHECK_VERSION (2, 17, 4)
        EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
 
        g_return_if_fail (EV_IS_PRINT_OPERATION (op));
 
        class->set_embed_page_setup (op, embed);
-#endif
 }
 
 gboolean
 ev_print_operation_get_embed_page_setup (EvPrintOperation *op)
 {
-#if GTK_CHECK_VERSION (2, 17, 4)
        EvPrintOperationClass *class = EV_PRINT_OPERATION_GET_CLASS (op);
 
        g_return_val_if_fail (EV_IS_PRINT_OPERATION (op), FALSE);
 
        return class->get_embed_page_setup (op);
-#else
-       return FALSE;
-#endif
 }
 
 const gchar *
@@ -324,7 +318,6 @@ ev_print_operation_get_progress (EvPrintOperation *op)
        return op->progress;
 }
 
-#if GTK_CHECK_VERSION (2, 17, 1) | GTKUNIXPRINT_ENABLED
 static void
 ev_print_operation_update_status (EvPrintOperation *op,
                                  gint              page,
@@ -350,7 +343,6 @@ ev_print_operation_update_status (EvPrintOperation *op,
 
        g_signal_emit (op, signals[STATUS_CHANGED], 0);
 }
-#endif
 
 #if GTKUNIXPRINT_ENABLED
 
@@ -1319,10 +1311,9 @@ ev_print_operation_export_run (EvPrintOperation *op,
                ev_file_exporter_get_capabilities (EV_FILE_EXPORTER (op->document));
        gtk_print_unix_dialog_set_manual_capabilities (GTK_PRINT_UNIX_DIALOG (dialog),
                                                       capabilities);
-#if GTK_CHECK_VERSION (2, 17, 4)
+
        gtk_print_unix_dialog_set_embed_page_setup (GTK_PRINT_UNIX_DIALOG (dialog),
                                                    export->embed_page_setup);
-#endif
 
        gtk_print_unix_dialog_set_current_page (GTK_PRINT_UNIX_DIALOG (dialog),
                                                export->current_page);
@@ -1368,11 +1359,9 @@ static void
 ev_print_operation_export_set_embed_page_setup (EvPrintOperation *op,
                                                gboolean          embed)
 {
-#if GTK_CHECK_VERSION (2, 17, 4)
        EvPrintOperationExport *export = EV_PRINT_OPERATION_EXPORT (op);
 
        export->embed_page_setup = embed;
-#endif
 }
 
 static gboolean
@@ -1502,7 +1491,6 @@ ev_print_operation_export_class_init (EvPrintOperationExportClass *klass)
 
 #endif /* GTKUNIXPRINT_ENABLED */
 
-#if GTK_CHECK_VERSION (2, 17, 1)
 /* Print to cairo interface */
 #define EV_TYPE_PRINT_OPERATION_PRINT         (ev_print_operation_print_get_type())
 #define EV_PRINT_OPERATION_PRINT(object)      (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_PRINT_OPERATION_PRINT, EvPrintOperationPrint))
@@ -1650,23 +1638,17 @@ static void
 ev_print_operation_print_set_embed_page_setup (EvPrintOperation *op,
                                               gboolean          embed)
 {
-#if GTK_CHECK_VERSION (2, 17, 4)
        EvPrintOperationPrint *print = EV_PRINT_OPERATION_PRINT (op);
 
        gtk_print_operation_set_embed_page_setup (print->op, embed);
-#endif
 }
 
 static gboolean
 ev_print_operation_print_get_embed_page_setup (EvPrintOperation *op)
 {
-#if GTK_CHECK_VERSION (2, 17, 4)
        EvPrintOperationPrint *print = EV_PRINT_OPERATION_PRINT (op);
 
        return gtk_print_operation_get_embed_page_setup (print->op);
-#else
-       return FALSE;
-#endif
 }
 
 static void
@@ -1764,22 +1746,12 @@ _print_context_get_hard_margins (GtkPrintContext *context,
                                 gdouble         *left,
                                 gdouble         *right)
 {
-#if GTK_CHECK_VERSION (2, 19, 2)
        if (!gtk_print_context_get_hard_margins (context, top, bottom, left, right)) {
                *top = 0;
                *bottom = 0;
                *left = 0;
                *right = 0;
        }
-#else
-       GtkPageSetup *page_setup;
-
-       page_setup = gtk_print_context_get_page_setup (context);
-       *top = gtk_page_setup_get_top_margin (page_setup, GTK_UNIT_POINTS);
-       *bottom = gtk_page_setup_get_bottom_margin (page_setup, GTK_UNIT_POINTS);
-       *left = gtk_page_setup_get_left_margin (page_setup, GTK_UNIT_POINTS);
-       *right = gtk_page_setup_get_right_margin (page_setup, GTK_UNIT_POINTS);
-#endif
 }
 
 static void
@@ -2026,22 +1998,14 @@ ev_print_operation_print_class_init (EvPrintOperationPrintClass *klass)
 
        g_object_class->finalize = ev_print_operation_print_finalize;
 }
-#endif /* GTK_CHECK_VERSION (2, 17, 1) */
 
-gboolean ev_print_operation_exists_for_document (EvDocument *document)
+gboolean
+ev_print_operation_exists_for_document (EvDocument *document)
 {
 #if GTKUNIXPRINT_ENABLED
-#if GTK_CHECK_VERSION (2, 17, 1)
        return (EV_IS_FILE_EXPORTER(document) || EV_IS_DOCUMENT_PRINT(document));
 #else
-       return EV_IS_FILE_EXPORTER(document);
-#endif
-#else /* ! GTKUNIXPRINT_ENABLED */
-#if GTK_CHECK_VERSION (2, 17, 1)
        return EV_IS_DOCUMENT_PRINT(document);
-#else
-       return FALSE;
-#endif
 #endif /* GTKUNIXPRINT_ENABLED */
 }
 
@@ -2053,12 +2017,10 @@ ev_print_operation_new (EvDocument *document)
 
        g_return_val_if_fail (ev_print_operation_exists_for_document (document), NULL);
 
-#if GTK_CHECK_VERSION (2, 17, 1)
        if (EV_IS_DOCUMENT_PRINT (document))
                op = EV_PRINT_OPERATION (g_object_new (EV_TYPE_PRINT_OPERATION_PRINT,
                                                       "document", document, NULL));
        else
-#endif
 #if GTKUNIXPRINT_ENABLED
                op = EV_PRINT_OPERATION (g_object_new (EV_TYPE_PRINT_OPERATION_EXPORT,
                                                       "document", document, NULL));
index f7c7233a38c3a8fdb9ccf52ade125d1adc5cb078..79c6a19ee8cff859f06f4e769ca891692c3c81db 100644 (file)
@@ -84,16 +84,15 @@ get_license_uri_widget (const gchar *uri)
                      "ellipsize", PANGO_ELLIPSIZE_END,
                      NULL);
 
-#if GTK_CHECK_VERSION (2, 17, 0)
        checked_uri = g_uri_parse_scheme (uri);
        if (checked_uri) {
                markup = g_markup_printf_escaped ("<a href=\"%s\">%s</a>", uri, uri);
                gtk_label_set_markup (GTK_LABEL (label), markup);
                g_free (markup);
                g_free (checked_uri);
-       } else
-#endif
+       } else {
                gtk_label_set_text (GTK_LABEL (label), uri);
+       }
 
        return label;
 }
index aaaea31c99c2fb8298aec45ef7bcce1440d0a66f..60c7ae0aca7de6977c7da98431412a00dac658c9 100644 (file)
@@ -534,12 +534,6 @@ ev_sidebar_attachments_class_init (EvSidebarAttachmentsClass *ev_attachbar_class
 static void
 ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
 {
-#if !GTK_CHECK_VERSION (2, 15, 0)
-        const GtkTargetEntry drag_targets[] = {
-                { "text/uri-list", 0, 0 }
-        };
-#endif
-
        GtkWidget *swindow;
        
        ev_attachbar->priv = EV_SIDEBAR_ATTACHMENTS_GET_PRIVATE (ev_attachbar);
@@ -589,21 +583,12 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
                                                                g_object_unref);
 
        /* Drag and Drop */
-#if GTK_CHECK_VERSION (2, 15, 0)
        gtk_icon_view_enable_model_drag_source (
                GTK_ICON_VIEW (ev_attachbar->priv->icon_view),
                GDK_BUTTON1_MASK,
                NULL, 0,
                GDK_ACTION_COPY);
         gtk_drag_source_add_uri_targets (ev_attachbar->priv->icon_view);
-#else
-       gtk_icon_view_enable_model_drag_source (
-               GTK_ICON_VIEW (ev_attachbar->priv->icon_view),
-               GDK_BUTTON1_MASK,
-               drag_targets,
-               G_N_ELEMENTS (drag_targets),
-               GDK_ACTION_COPY);
-#endif
 
        g_signal_connect (ev_attachbar->priv->icon_view,
                          "drag-data-get",
index 1f527b566025feac3aad91bce4dfa15ed29015e8..5f522c15ab840fdce6d6d17bfaac088f31611240 100644 (file)
@@ -409,9 +409,6 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
        /* File menu */
        ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document);
        ev_window_set_action_sensitive (ev_window, "FileSaveAs", has_document && ok_to_copy);
-#if !GTK_CHECK_VERSION (2, 17, 4)
-       ev_window_set_action_sensitive (ev_window, "FilePageSetup", has_pages && ok_to_print && ok_to_print_setup);
-#endif
        ev_window_set_action_sensitive (ev_window, "FilePrint", has_pages && ok_to_print);
        ev_window_set_action_sensitive (ev_window, "FileProperties", has_document && has_properties);
 
@@ -2880,43 +2877,6 @@ get_print_page_setup (GKeyFile *key_file)
        return page_setup ? page_setup : gtk_page_setup_new ();
 }
 
-static void
-ev_window_print_page_setup_done_cb (GtkPageSetup *page_setup,
-                                   EvWindow     *window)
-{
-       /* Dialog was canceled */
-       if (!page_setup)
-               return;
-
-       ev_window_save_print_page_setup (window, page_setup);
-}
-
-static void
-ev_window_cmd_file_print_setup (GtkAction *action,
-                               EvWindow  *ev_window)
-{
-       GKeyFile         *print_settings_file;
-       GtkPrintSettings *print_settings;
-       GtkPageSetup     *print_page_setup;
-
-       print_settings_file = get_print_settings_file ();
-
-       print_settings = get_print_settings (print_settings_file);
-       ev_window_load_print_settings_from_metadata (ev_window, print_settings);
-
-       print_page_setup = get_print_page_setup (print_settings_file);
-       ev_window_load_print_page_setup_from_metadata (ev_window, print_page_setup);
-
-       gtk_print_run_page_setup_dialog_async (GTK_WINDOW (ev_window),
-                                              print_page_setup,
-                                              print_settings,
-                                              (GtkPageSetupDoneFunc)ev_window_print_page_setup_done_cb,
-                                              ev_window);
-       g_object_unref (print_settings);
-       g_object_unref (print_page_setup);
-       g_key_file_free (print_settings_file);
-}
-
 static void
 ev_window_print_cancel (EvWindow *ev_window)
 {
@@ -5041,9 +5001,6 @@ static const GtkActionEntry entries[] = {
                { "FileSaveAs", GTK_STOCK_SAVE_AS, N_("_Save a Copy…"), "<control>S",
          N_("Save a copy of the current document"),
          G_CALLBACK (ev_window_cmd_save_as) },
-       { "FilePageSetup", GTK_STOCK_PAGE_SETUP, N_("Page Set_up…"), NULL,
-         N_("Set up the page settings for printing"),
-         G_CALLBACK (ev_window_cmd_file_print_setup) },
        { "FilePrint", GTK_STOCK_PRINT, N_("_Print…"), "<control>P",
          N_("Print this document"),
          G_CALLBACK (ev_window_cmd_file_print) },
@@ -6164,16 +6121,6 @@ ev_window_init (EvWindow *ev_window)
        }
        g_free (ui_path);
 
-#if GTK_CHECK_VERSION (2, 17, 4)
-       {
-               GtkAction *action;
-
-               action = gtk_action_group_get_action (ev_window->priv->action_group,
-                                                     "FilePageSetup");
-               g_object_set (action, "visible", FALSE, "sensitive", FALSE, NULL);
-       }
-#endif
-
        ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
        ev_window->priv->recent_action_group = NULL;
        ev_window->priv->recent_ui_id = 0;