summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-23 18:15:54 +0300
committermonsta <[email protected]>2016-11-23 18:15:54 +0300
commitae5f4711a21508a70d7123dbc0efb610af1289a2 (patch)
tree54d4a9de3b092aa772ed8799fcf30e11e19ff93f /shell
parent7884bbe50fe8b8c26e68b8077c18047861c2dd0c (diff)
downloadatril-ae5f4711a21508a70d7123dbc0efb610af1289a2.tar.bz2
atril-ae5f4711a21508a70d7123dbc0efb610af1289a2.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require caja >= 1.17.1
Diffstat (limited to 'shell')
-rw-r--r--shell/eggfindbar.c88
-rw-r--r--shell/eggfindbar.h4
-rw-r--r--shell/ev-annotation-properties-dialog.c106
-rw-r--r--shell/ev-application.c5
-rw-r--r--shell/ev-message-area.c11
-rw-r--r--shell/ev-navigation-action-widget.c4
-rw-r--r--shell/ev-password-view.c53
-rw-r--r--shell/ev-progress-message-area.c6
-rw-r--r--shell/ev-sidebar-annotations.c20
-rw-r--r--shell/ev-sidebar-attachments.c4
-rw-r--r--shell/ev-sidebar-bookmarks.c8
-rw-r--r--shell/ev-sidebar-thumbnails.c14
-rw-r--r--shell/ev-sidebar.c16
-rw-r--r--shell/ev-utils.c8
-rw-r--r--shell/ev-window.c136
15 files changed, 24 insertions, 459 deletions
diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c
index 091a5b1a..ea34cd2a 100644
--- a/shell/eggfindbar.c
+++ b/shell/eggfindbar.c
@@ -26,10 +26,6 @@
#include "eggfindbar.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#endif
-
struct _EggFindBarPrivate
{
gchar *search_string;
@@ -166,23 +162,6 @@ egg_find_bar_class_init (EggFindBarClass *klass)
FALSE,
G_PARAM_READWRITE));
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* Style properties */
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_boxed ("all_matches_color",
- "Highlight color",
- "Color of highlight for all matches",
- GDK_TYPE_COLOR,
- G_PARAM_READABLE));
-
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_boxed ("current_match_color",
- "Current color",
- "Color of highlight for the current match",
- GDK_TYPE_COLOR,
- G_PARAM_READABLE));
-#endif
-
g_type_class_add_private (object_class, sizeof (EggFindBarPrivate));
binding_set = gtk_binding_set_by_class (klass);
@@ -323,7 +302,7 @@ egg_find_bar_init (EggFindBar *find_bar)
/* Find: |_____| */
item = gtk_tool_item_new ();
- box = gtk_hbox_new (FALSE, 12);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 0.0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 2, 2);
@@ -336,11 +315,7 @@ egg_find_bar_init (EggFindBar *find_bar)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry);
/* Prev */
-#if GTK_CHECK_VERSION (3, 0, 0)
arrow = gtk_image_new_from_icon_name ("pan-start-symbolic", GTK_ICON_SIZE_BUTTON);
-#else
- arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
-#endif
priv->previous_button = gtk_tool_button_new (arrow, Q_("Find Pre_vious"));
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->previous_button), TRUE);
gtk_tool_item_set_is_important (priv->previous_button, TRUE);
@@ -348,11 +323,7 @@ egg_find_bar_init (EggFindBar *find_bar)
_("Find previous occurrence of the search string"));
/* Next */
-#if GTK_CHECK_VERSION (3, 0, 0)
arrow = gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_BUTTON);
-#else
- arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
-#endif
priv->next_button = gtk_tool_button_new (arrow, Q_("Find Ne_xt"));
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->next_button), TRUE);
gtk_tool_item_set_is_important (priv->next_button, TRUE);
@@ -679,63 +650,6 @@ egg_find_bar_get_case_sensitive (EggFindBar *find_bar)
return priv->case_sensitive;
}
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-get_style_color (EggFindBar *find_bar,
- const char *style_prop_name,
- GdkColor *color)
-{
- GdkColor *style_color;
-
- gtk_widget_ensure_style (GTK_WIDGET (find_bar));
- gtk_widget_style_get (GTK_WIDGET (find_bar),
- "color", &style_color, NULL);
- if (style_color)
- {
- *color = *style_color;
- gdk_color_free (style_color);
- }
-}
-
-/**
- * egg_find_bar_get_all_matches_color:
- *
- * Gets the color to use to highlight all the
- * known matches.
- *
- * Since: 2.6
- */
-void
-egg_find_bar_get_all_matches_color (EggFindBar *find_bar,
- GdkColor *color)
-{
- GdkColor found_color = { 0, 0, 0, 0x0f0f };
-
- get_style_color (find_bar, "all_matches_color", &found_color);
-
- *color = found_color;
-}
-
-/**
- * egg_find_bar_get_current_match_color:
- *
- * Gets the color to use to highlight the match
- * we're currently on.
- *
- * Since: 2.6
- */
-void
-egg_find_bar_get_current_match_color (EggFindBar *find_bar,
- GdkColor *color)
-{
- GdkColor found_color = { 0, 0, 0, 0xffff };
-
- get_style_color (find_bar, "current_match_color", &found_color);
-
- *color = found_color;
-}
-#endif
-
/**
* egg_find_bar_set_status_text:
*
diff --git a/shell/eggfindbar.h b/shell/eggfindbar.h
index 975f9790..5ad01804 100644
--- a/shell/eggfindbar.h
+++ b/shell/eggfindbar.h
@@ -68,10 +68,6 @@ const char* egg_find_bar_get_search_string (EggFindBar *find_bar);
void egg_find_bar_set_case_sensitive (EggFindBar *find_bar,
gboolean case_sensitive);
gboolean egg_find_bar_get_case_sensitive (EggFindBar *find_bar);
-void egg_find_bar_get_all_matches_color (EggFindBar *find_bar,
- GdkColor *color);
-void egg_find_bar_get_current_match_color (EggFindBar *find_bar,
- GdkColor *color);
void egg_find_bar_set_status_text (EggFindBar *find_bar,
const char *text);
diff --git a/shell/ev-annotation-properties-dialog.c b/shell/ev-annotation-properties-dialog.c
index 68736b27..3d65b70f 100644
--- a/shell/ev-annotation-properties-dialog.c
+++ b/shell/ev-annotation-properties-dialog.c
@@ -35,11 +35,7 @@ struct _EvAnnotationPropertiesDialog {
EvAnnotationType annot_type;
EvAnnotation *annot;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid;
-#else
- GtkWidget *table;
-#endif
GtkWidget *author;
GtkWidget *color;
@@ -90,23 +86,14 @@ static void
ev_annotation_properties_dialog_constructed (GObject *object)
{
EvAnnotationPropertiesDialog *dialog = EV_ANNOTATION_PROPERTIES_DIALOG (object);
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid = dialog->grid;
-#else
- GtkWidget *table = dialog->table;
-#endif
GtkWidget *label;
switch (dialog->annot_type) {
case EV_ANNOTATION_TYPE_TEXT:
label = gtk_label_new (_("Icon:"));
gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 5, 6,
- GTK_FILL, GTK_FILL, 0, 0);
-#endif
gtk_widget_show (label);
dialog->icon = gtk_combo_box_text_new ();
@@ -121,14 +108,8 @@ ev_annotation_properties_dialog_constructed (GObject *object)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->icon), _("Circle"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dialog->icon), _("Unknown"));
gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->icon), 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (grid), dialog->icon, 1, 5, 1, 1);
gtk_widget_set_hexpand (dialog->icon, TRUE);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->icon,
- 1, 2, 5, 6,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
-#endif
gtk_widget_show (dialog->icon);
break;
@@ -145,11 +126,7 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
GtkDialog *dialog = GTK_DIALOG (annot_dialog);
GtkWidget *content_area;
GtkWidget *label;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid;
-#else
- GtkWidget *table;
-#endif
GtkWidget *hbox;
gchar *markup;
GdkColor color = { 0, 65535, 65535, 0 };
@@ -166,7 +143,6 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
content_area = gtk_dialog_get_content_area (dialog);
gtk_box_set_spacing (GTK_BOX (content_area), 2);
-#if GTK_CHECK_VERSION (3, 0, 0)
grid = gtk_grid_new ();
annot_dialog->grid = grid;
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
@@ -238,88 +214,6 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
gtk_combo_box_set_active (GTK_COMBO_BOX (annot_dialog->popup_state), 1);
gtk_grid_attach (GTK_GRID (grid), annot_dialog->popup_state, 1, 4, 1, 1);
gtk_widget_set_hexpand (annot_dialog->popup_state, TRUE);
-#else
- table = gtk_table_new (5, 2, FALSE);
- annot_dialog->table = table;
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_container_set_border_width (GTK_CONTAINER (table), 12);
- gtk_box_pack_start (GTK_BOX (content_area), table, FALSE, FALSE, 0);
- gtk_widget_show (table);
-
- label = gtk_label_new (_("Author:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (label);
-
- annot_dialog->author = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (annot_dialog->author), g_get_real_name ());
- gtk_table_attach (GTK_TABLE (table), annot_dialog->author,
- 1, 2, 0, 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show (annot_dialog->author);
-
- label = gtk_label_new (_("Color:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (label);
-
- annot_dialog->color = gtk_color_button_new_with_color (&color);
- gtk_table_attach (GTK_TABLE (table), annot_dialog->color,
- 1, 2, 1, 2,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show (annot_dialog->color);
-
- label = gtk_label_new (_("Style:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (label);
-
- annot_dialog->opacity = gtk_hscale_new_with_range (0, 100, 5);
- gtk_range_set_value (GTK_RANGE (annot_dialog->opacity), 100);
- gtk_table_attach (GTK_TABLE (table), annot_dialog->opacity,
- 1, 2, 2, 3,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show (annot_dialog->opacity);
-
- hbox = gtk_hbox_new (FALSE, 6);
-
- label = gtk_label_new (NULL);
- markup = g_strdup_printf ("<small>%s</small>", _("Transparent"));
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
-
- label = gtk_label_new (NULL);
- markup = g_strdup_printf ("<small>%s</small>", _("Opaque"));
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
-
- gtk_table_attach (GTK_TABLE (table), hbox,
- 1, 2, 3, 4,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
- gtk_widget_show (hbox);
-
- label = gtk_label_new (_("Initial window state:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5,
- GTK_FILL, GTK_FILL, 0, 0);
- gtk_widget_show (label);
-
- annot_dialog->popup_state = gtk_combo_box_text_new ();
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (annot_dialog->popup_state), _("Open"));
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (annot_dialog->popup_state), _("Close"));
- gtk_combo_box_set_active (GTK_COMBO_BOX (annot_dialog->popup_state), 1);
- gtk_table_attach (GTK_TABLE (table), annot_dialog->popup_state,
- 1, 2, 4, 5,
- GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
-#endif
gtk_widget_show (annot_dialog->popup_state);
}
diff --git a/shell/ev-application.c b/shell/ev-application.c
index c1bf42f5..b27ee512 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -269,12 +269,7 @@ ev_spawn (const char *uri,
GList uri_list;
GList *uris = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
ctx = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
-#else
- ctx = gdk_app_launch_context_new ();
- gdk_app_launch_context_set_display (ctx, gdk_screen_get_display (screen));
-#endif
gdk_app_launch_context_set_screen (ctx, screen);
gdk_app_launch_context_set_timestamp (ctx, timestamp);
diff --git a/shell/ev-message-area.c b/shell/ev-message-area.c
index a545f2b1..8226537b 100644
--- a/shell/ev-message-area.c
+++ b/shell/ev-message-area.c
@@ -25,11 +25,6 @@
#include "ev-message-area.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
#define EV_MESSAGE_AREA_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_MESSAGE_AREA, EvMessageAreaPrivate))
@@ -101,10 +96,10 @@ ev_message_area_init (EvMessageArea *area)
area->priv = EV_MESSAGE_AREA_GET_PRIVATE (area);
- area->priv->main_box = gtk_vbox_new (FALSE, 12);
+ area->priv->main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
- hbox = gtk_hbox_new (FALSE, 12);
- vbox = gtk_vbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
area->priv->label = gtk_label_new (NULL);
gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE);
diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c
index 27993699..de60674f 100644
--- a/shell/ev-navigation-action-widget.c
+++ b/shell/ev-navigation-action-widget.c
@@ -134,11 +134,7 @@ menu_position_func (GtkMenu *menu,
gint monitor_num;
GdkScreen *screen;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (button->menu), &menu_req, NULL);
-#else
- gtk_widget_size_request (GTK_WIDGET (button->menu), &menu_req);
-#endif
direction = gtk_widget_get_direction (widget);
screen = gtk_widget_get_screen (GTK_WIDGET (menu));
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
index bd7d5222..12ccffb2 100644
--- a/shell/ev-password-view.c
+++ b/shell/ev-password-view.c
@@ -30,11 +30,6 @@
#include "ev-keyring.h"
#include "ev-password-view.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
enum {
UNLOCK,
LAST_SIGNAL
@@ -121,13 +116,9 @@ ev_password_view_init (EvPasswordView *password_view)
password_view->priv->password_save = G_PASSWORD_SAVE_NEVER;
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_push_composite_child ();
-#endif
-
/* set ourselves up */
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
- vbox = gtk_vbox_new (FALSE, 24);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 24);
gtk_container_add (GTK_CONTAINER (password_view), align);
gtk_container_add (GTK_CONTAINER (align), vbox);
@@ -152,7 +143,7 @@ ev_password_view_init (EvPasswordView *password_view)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic (_("_Unlock Document"));
@@ -160,9 +151,6 @@ ev_password_view_init (EvPasswordView *password_view)
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show_all (align);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_pop_composite_child ();
-#endif
}
/* Public functions */
@@ -251,11 +239,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
GtkWidget *content_area, *action_area;
GtkWidget *entry_container;
GtkWidget *hbox, *main_vbox, *vbox, *icon;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *grid;
-#else
- GtkWidget *table;
-#endif
GtkWidget *label;
gchar *text, *markup, *file_name;
@@ -284,15 +268,9 @@ ev_password_view_ask_password (EvPasswordView *password_view)
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
GTK_RESPONSE_OK, FALSE);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (dialog,
- GTK_RESPONSE_OK,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
/* Build contents */
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
@@ -304,7 +282,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
gtk_widget_show (icon);
- main_vbox = gtk_vbox_new (FALSE, 18);
+ main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
gtk_widget_show (main_vbox);
@@ -325,7 +303,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
FALSE, FALSE, 0);
gtk_widget_show (label);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
@@ -339,19 +317,11 @@ ev_password_view_ask_password (EvPasswordView *password_view)
FALSE, FALSE, 0);
gtk_widget_show (entry_container);
-#if GTK_CHECK_VERSION (3, 0, 0)
grid = gtk_grid_new ();
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
gtk_container_add (GTK_CONTAINER (entry_container), grid);
gtk_widget_show (grid);
-#else
- table = gtk_table_new (1, 2, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_container_add (GTK_CONTAINER (entry_container), table);
- gtk_widget_show (table);
-#endif
label = gtk_label_new_with_mnemonic (_("_Password:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
@@ -364,21 +334,12 @@ ev_password_view_ask_password (EvPasswordView *password_view)
g_signal_connect (password_view->priv->password_entry, "activate",
G_CALLBACK (ev_password_dialog_entry_activated_cb),
dialog);
-#if GTK_CHECK_VERSION (3, 0, 0)
+
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
gtk_widget_show (label);
gtk_grid_attach (GTK_GRID (grid), password_view->priv->password_entry, 1, 0, 1, 1);
gtk_widget_set_hexpand (password_view->priv->password_entry, TRUE);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1, 0, 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_widget_show (label);
-
- gtk_table_attach_defaults (GTK_TABLE (table), password_view->priv->password_entry,
- 1, 2, 0, 1);
-#endif
gtk_widget_show (password_view->priv->password_entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
@@ -389,7 +350,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
GtkWidget *remember_box;
GSList *group;
- remember_box = gtk_vbox_new (FALSE, 6);
+ remember_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), remember_box,
FALSE, FALSE, 0);
gtk_widget_show (remember_box);
diff --git a/shell/ev-progress-message-area.c b/shell/ev-progress-message-area.c
index f3f5e3ad..c50b6041 100644
--- a/shell/ev-progress-message-area.c
+++ b/shell/ev-progress-message-area.c
@@ -24,10 +24,6 @@
#include "ev-progress-message-area.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
#define EV_PROGRESS_MESSAGE_AREA_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EV_TYPE_PROGRESS_MESSAGE_AREA, EvProgressMessageAreaPrivate))
@@ -89,7 +85,7 @@ ev_progress_message_area_init (EvProgressMessageArea *area)
contents = _ev_message_area_get_main_box (EV_MESSAGE_AREA (area));
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
area->priv->label = gtk_label_new (NULL);
gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE);
diff --git a/shell/ev-sidebar-annotations.c b/shell/ev-sidebar-annotations.c
index 94fa3092..e188eb3b 100644
--- a/shell/ev-sidebar-annotations.c
+++ b/shell/ev-sidebar-annotations.c
@@ -29,10 +29,6 @@
#include "ev-job-scheduler.h"
#include "ev-stock-icons.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_widget_render_icon(A,B,C,D) gtk_widget_render_icon_pixbuf(A,B,C)
-#endif
-
enum {
PROP_0,
PROP_WIDGET
@@ -132,10 +128,8 @@ ev_sidebar_annotations_add_annots_list (EvSidebarAnnotations *ev_annots)
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swindow),
GTK_SHADOW_IN);
-#if GTK_CHECK_VERSION (3, 0, 0)
// Use as much vertical space as available
gtk_widget_set_vexpand (GTK_WIDGET (swindow), TRUE);
-#endif
/* Create tree view */
loading_model = ev_sidebar_annotations_create_simple_model (_("Loading…"));
@@ -434,18 +428,16 @@ job_finished_callback (EvJobAnnots *job,
if (EV_IS_ANNOTATION_TEXT (annot)) {
if (!text_icon) {
/* FIXME: use a better icon than EDIT */
- text_icon = gtk_widget_render_icon (priv->tree_view,
- GTK_STOCK_EDIT,
- GTK_ICON_SIZE_BUTTON,
- NULL);
+ text_icon = gtk_widget_render_icon_pixbuf (priv->tree_view,
+ GTK_STOCK_EDIT,
+ GTK_ICON_SIZE_BUTTON);
}
pixbuf = text_icon;
} else if (EV_IS_ANNOTATION_ATTACHMENT (annot)) {
if (!attachment_icon) {
- attachment_icon = gtk_widget_render_icon (priv->tree_view,
- EV_STOCK_ATTACHMENT,
- GTK_ICON_SIZE_BUTTON,
- NULL);
+ attachment_icon = gtk_widget_render_icon_pixbuf (priv->tree_view,
+ EV_STOCK_ATTACHMENT,
+ GTK_ICON_SIZE_BUTTON);
}
pixbuf = attachment_icon;
}
diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c
index ddcaccda..a7c60f3f 100644
--- a/shell/ev-sidebar-attachments.c
+++ b/shell/ev-sidebar-attachments.c
@@ -264,11 +264,7 @@ ev_sidebar_attachments_popup_menu (GtkWidget *widget)
EvSidebarAttachments *ev_attachbar = EV_SIDEBAR_ATTACHMENTS (widget);
gint x, y;
-#if GTK_CHECK_VERSION(3, 0, 0)
ev_document_misc_get_pointer_position (widget, &x, &y);
-#else
- gtk_widget_get_pointer (widget, &x, &y);
-#endif
return ev_sidebar_attachments_popup_menu_show (ev_attachbar, x, y);
}
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c
index 4f2c237f..2823328a 100644
--- a/shell/ev-sidebar-bookmarks.c
+++ b/shell/ev-sidebar-bookmarks.c
@@ -380,11 +380,7 @@ ev_sidebar_bookmarks_popup_menu (GtkWidget *widget)
EvSidebarBookmarks *sidebar_bookmarks = EV_SIDEBAR_BOOKMARKS (widget);
gint x, y;
-#if GTK_CHECK_VERSION(3, 0, 0)
ev_document_misc_get_pointer_position (widget, &x, &y);
-#else
- gtk_widget_get_pointer (widget, &x, &y);
-#endif
return ev_sidebar_bookmarks_popup_menu_show (sidebar_bookmarks, x, y, TRUE);
}
@@ -475,11 +471,7 @@ ev_sidebar_bookmarks_init (EvSidebarBookmarks *sidebar_bookmarks)
gtk_container_add (GTK_CONTAINER (swindow), priv->tree_view);
gtk_widget_show (priv->tree_view);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-#else
- hbox = gtk_hbutton_box_new ();
-#endif
priv->add_button = gtk_button_new_from_stock (GTK_STOCK_ADD);
g_signal_connect (priv->add_button, "clicked",
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index 8f7f6517..0c420f57 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -685,14 +685,11 @@ static void
ev_sidebar_init_icon_view (EvSidebarThumbnails *ev_sidebar_thumbnails)
{
EvSidebarThumbnailsPrivate *priv;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkCellRenderer *renderer;
-#endif
priv = ev_sidebar_thumbnails->priv;
-
priv->icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (priv->list_store));
-#if GTK_CHECK_VERSION (3, 0, 0)
+
renderer = g_object_new (GTK_TYPE_CELL_RENDERER_PIXBUF,
"xalign", 0.5,
"yalign", 1.0,
@@ -712,10 +709,7 @@ ev_sidebar_init_icon_view (EvSidebarThumbnails *ev_sidebar_thumbnails)
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (priv->icon_view), renderer, FALSE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->icon_view),
renderer, "markup", 0, NULL);
-#else
- gtk_icon_view_set_markup_column (GTK_ICON_VIEW (priv->icon_view), 0);
- gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (priv->icon_view), 1);
-#endif
+
g_signal_connect (priv->icon_view, "selection-changed",
G_CALLBACK (ev_sidebar_icon_selection_changed), ev_sidebar_thumbnails);
@@ -750,11 +744,7 @@ ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails)
* it's just a workaround for bug #449462 (GTK2 only)
*/
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->swindow),
-#if GTK_CHECK_VERSION (3, 0, 0)
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-#else
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-#endif
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->swindow),
GTK_SHADOW_IN);
priv->vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->swindow));
diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c
index 5a775a91..8e072f48 100644
--- a/shell/ev-sidebar.c
+++ b/shell/ev-sidebar.c
@@ -32,10 +32,6 @@
#include "ev-sidebar.h"
#include "ev-sidebar-page.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#endif
-
enum
{
PROP_0,
@@ -235,11 +231,7 @@ ev_sidebar_select_button_press_cb (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
width = allocation.width;
gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (ev_sidebar->priv->menu, &requisition, NULL);
-#else
- gtk_widget_size_request (ev_sidebar->priv->menu, &requisition);
-#endif
gtk_widget_set_size_request (ev_sidebar->priv->menu,
MAX (width, requisition.width), -1);
@@ -357,7 +349,7 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
G_TYPE_INT);
/* top option menu */
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
ev_sidebar->priv->hbox = hbox;
gtk_box_pack_start (GTK_BOX (ev_sidebar), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
@@ -371,7 +363,7 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
G_CALLBACK (ev_sidebar_select_button_key_press_cb),
ev_sidebar);
- select_hbox = gtk_hbox_new (FALSE, 0);
+ select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
ev_sidebar->priv->label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (select_hbox),
@@ -379,11 +371,7 @@ ev_sidebar_init (EvSidebar *ev_sidebar)
FALSE, FALSE, 0);
gtk_widget_show (ev_sidebar->priv->label);
-#if GTK_CHECK_VERSION (3, 0, 0)
arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
-#else
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
-#endif
gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
gtk_widget_show (arrow);
diff --git a/shell/ev-utils.c b/shell/ev-utils.c
index 1363cace..8c9bae55 100644
--- a/shell/ev-utils.c
+++ b/shell/ev-utils.c
@@ -225,11 +225,7 @@ ev_gui_sanitise_popup_position (GtkMenu *menu,
g_return_if_fail (widget != NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
-#else
- gtk_widget_size_request (GTK_WIDGET (menu), &req);
-#endif
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
gtk_menu_set_monitor (menu, monitor_num);
@@ -255,11 +251,7 @@ ev_gui_menu_position_tree_selection (GtkMenu *menu,
GtkAllocation allocation;
GdkRectangle visible;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
-#else
- gtk_widget_size_request (GTK_WIDGET (menu), &req);
-#endif
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
gtk_widget_get_allocation (widget, &allocation);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 20effead..f2e07e5d 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -101,10 +101,6 @@
#include "ev-media-player-keys.h"
#endif /* ENABLE_DBUS */
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
typedef enum {
PAGE_MODE_DOCUMENT,
PAGE_MODE_PASSWORD
@@ -533,7 +529,6 @@ ev_window_update_actions (EvWindow *ev_window)
ev_view_get_has_selection (view));
}
#if ENABLE_EPUB
-#if GTK_CHECK_VERSION (3, 0, 0)
else if (webview) {
/*
* The webkit2 function for this is an asynchronous call,
@@ -543,13 +538,6 @@ ev_window_update_actions (EvWindow *ev_window)
ev_window_set_action_sensitive (ev_window,"EditCopy",
has_pages);
}
-#else
- else if(webview) {
- ev_window_set_action_sensitive (ev_window, "EditCopy",
- has_pages &&
- ev_web_view_get_has_selection (webview));
- }
-#endif
#endif
ev_window_set_action_sensitive (ev_window, "EditFindNext",
has_pages && can_find_in_page);
@@ -983,17 +971,6 @@ view_selection_changed_cb (EvView *view,
ev_window_set_action_sensitive (window, "EditCopy",
ev_view_get_has_selection (view));
}
-#if ENABLE_EPUB
-#if !GTK_CHECK_VERSION (3, 0, 0)
-static void
-web_view_selection_changed_cb(EvWebView *webview,
- EvWindow *window)
-{
- ev_window_set_action_sensitive (window,"EditCopy",
- ev_web_view_get_has_selection(webview));
-}
-#endif
-#endif
static void
view_layers_changed_cb (EvView *view,
@@ -3098,12 +3075,6 @@ ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
ev_document_factory_add_filters (fc, ev_window->priv->document);
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (GTK_DIALOG (fc),
- GTK_RESPONSE_OK,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
@@ -3145,12 +3116,7 @@ ev_window_cmd_send_to (GtkAction *action,
GdkScreen *screen;
screen = gtk_window_get_screen (GTK_WINDOW (ev_window));
-#if GTK_CHECK_VERSION (3, 0, 0)
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
-#else
- context = gdk_app_launch_context_new ();
- gdk_app_launch_context_set_display (context, gdk_screen_get_display (screen));
-#endif
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error);
@@ -3740,13 +3706,6 @@ ev_window_check_document_modified (EvWindow *ev_window)
GTK_RESPONSE_YES,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
- GTK_RESPONSE_YES,
- GTK_RESPONSE_NO,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
g_signal_connect (dialog, "response",
G_CALLBACK (document_modified_confirmation_dialog_response),
@@ -3845,13 +3804,6 @@ ev_window_check_print_queue (EvWindow *ev_window)
GTK_RESPONSE_YES,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
- GTK_RESPONSE_YES,
- GTK_RESPONSE_NO,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
g_signal_connect (dialog, "response",
G_CALLBACK (print_jobs_confirmation_dialog_response),
@@ -4116,7 +4068,6 @@ fullscreen_toolbar_setup_item_properties (GtkUIManager *ui_manager)
static void
fullscreen_toolbar_remove_shadow (GtkWidget *toolbar)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkCssProvider *provider;
gtk_widget_set_name (toolbar, "ev-fullscreen-toolbar");
@@ -4131,25 +4082,6 @@ fullscreen_toolbar_remove_shadow (GtkWidget *toolbar)
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
}
-#else
- static gboolean done = FALSE;
-
- if (!done) {
- gtk_rc_parse_string (
- "\n"
- " style \"fullscreen-toolbar-style\"\n"
- " {\n"
- " GtkToolbar::shadow-type=GTK_SHADOW_NONE\n"
- " }\n"
- "\n"
- " widget \"*.fullscreen-toolbar\" style \"fullscreen-toolbar-style\"\n"
- "\n");
- done = TRUE;
- }
-
- gtk_widget_set_name (toolbar, "fullscreen-toolbar");
-}
-#endif
static void
ev_window_run_fullscreen (EvWindow *window)
@@ -4625,11 +4557,7 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
gtk_container_set_border_width (GTK_CONTAINER (editor), 5);
gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_box_pack_start (GTK_BOX (content_area), editor, TRUE, TRUE, 0);
-#else
- gtk_container_add (GTK_CONTAINER (content_area), editor);
-#endif
egg_editable_toolbar_set_edit_mode (toolbar, TRUE);
@@ -5688,9 +5616,6 @@ find_bar_visibility_changed_cb (EggFindBar *find_bar,
}
#if ENABLE_EPUB
else {
-#if !GTK_CHECK_VERSION(3, 0, 0)
- ev_web_view_find_set_highlight_search(EV_WEB_VIEW(ev_window->priv->webview),visible);
-#endif
ev_web_view_find_search_changed(EV_WEB_VIEW(ev_window->priv->webview));
ev_web_view_set_handler(EV_WEB_VIEW(ev_window->priv->webview),visible);
}
@@ -6684,12 +6609,8 @@ launch_action (EvWindow *window, EvLinkAction *action)
GAppInfo *app_info;
GFile *file;
GList file_list = {NULL};
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkAppLaunchContext *context;
GdkScreen *screen;
-#else
- GAppLaunchContext *context;
-#endif
GError *error = NULL;
if (filename == NULL)
@@ -6720,7 +6641,6 @@ launch_action (EvWindow *window, EvLinkAction *action)
return;
}
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gtk_window_get_screen (GTK_WINDOW (window));
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
@@ -6728,16 +6648,6 @@ launch_action (EvWindow *window, EvLinkAction *action)
file_list.data = file;
if (!g_app_info_launch (app_info, &file_list, G_APP_LAUNCH_CONTEXT (context), &error)) {
-#else
- context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
- gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context),
- gtk_window_get_screen (GTK_WINDOW (window)));
- gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context),
- gtk_get_current_event_time ());
-
- file_list.data = file;
- if (!g_app_info_launch (app_info, &file_list, context, &error)) {
-#endif
ev_window_error_message (window, error,
"%s",
_("Unable to launch external application."));
@@ -6758,7 +6668,6 @@ launch_external_uri (EvWindow *window, EvLinkAction *action)
const gchar *uri = ev_link_action_get_uri (action);
GError *error = NULL;
gboolean ret;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkAppLaunchContext *context;
GdkScreen *screen;
@@ -6766,15 +6675,6 @@ launch_external_uri (EvWindow *window, EvLinkAction *action)
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
-#else
- GAppLaunchContext *context;
-
- context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
- gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context),
- gtk_window_get_screen (GTK_WINDOW (window)));
- gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context),
- gtk_get_current_event_time ());
-#endif
if (!g_strstr_len (uri, strlen (uri), "://") &&
!g_str_has_prefix (uri, "mailto:")) {
@@ -6799,17 +6699,10 @@ launch_external_uri (EvWindow *window, EvLinkAction *action)
new_uri = g_strdup_printf ("file:///%s", uri);
}
}
-#if GTK_CHECK_VERSION (3, 0, 0)
ret = g_app_info_launch_default_for_uri (new_uri, G_APP_LAUNCH_CONTEXT (context), &error);
g_free (new_uri);
} else {
ret = g_app_info_launch_default_for_uri (uri, G_APP_LAUNCH_CONTEXT (context), &error);
-#else
- ret = g_app_info_launch_default_for_uri (new_uri, context, &error);
- g_free (new_uri);
- } else {
- ret = g_app_info_launch_default_for_uri (uri, context, &error);
-#endif
}
if (ret == FALSE) {
@@ -7081,12 +6974,6 @@ ev_view_popup_cmd_save_image_as (GtkAction *action, EvWindow *window)
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (GTK_DIALOG (fc),
- GTK_RESPONSE_OK,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
@@ -7318,12 +7205,6 @@ ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, EvWindow *window)
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_dialog_set_alternative_button_order (GTK_DIALOG (fc),
- GTK_RESPONSE_OK,
- GTK_RESPONSE_CANCEL,
- -1);
-#endif
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE);
@@ -7663,14 +7544,12 @@ ev_window_init (EvWindow *ev_window)
ev_window->priv->chrome = EV_CHROME_NORMAL;
ev_window->priv->title = ev_window_title_new (ev_window);
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkStyleContext *context;
context = gtk_widget_get_style_context (GTK_WIDGET (ev_window));
gtk_style_context_add_class (context, "atril-window");
-#endif
- ev_window->priv->main_box = gtk_vbox_new (FALSE, 0);
+ ev_window->priv->main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (ev_window), ev_window->priv->main_box);
gtk_widget_show (ev_window->priv->main_box);
@@ -7753,10 +7632,8 @@ ev_window_init (EvWindow *ev_window)
NULL));
g_object_unref (toolbars_model);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (ev_window->priv->toolbar)),
GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
-#endif
egg_editable_toolbar_show (EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar),
"DefaultToolBar");
@@ -7766,11 +7643,7 @@ ev_window_init (EvWindow *ev_window)
gtk_widget_show (ev_window->priv->toolbar);
/* Add the main area */
-#if GTK_CHECK_VERSION (3, 0, 0)
ev_window->priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
-#else
- ev_window->priv->hpaned = gtk_hpaned_new ();
-#endif
g_signal_connect (ev_window->priv->hpaned,
"notify::position",
G_CALLBACK (ev_window_sidebar_position_change_cb),
@@ -7864,7 +7737,7 @@ ev_window_init (EvWindow *ev_window)
ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar),
sidebar_widget);
- ev_window->priv->view_box = gtk_vbox_new (FALSE, 0);
+ ev_window->priv->view_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
ev_window->priv->scrolled_window =
GTK_WIDGET (g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"shadow-type", GTK_SHADOW_IN,
@@ -7883,11 +7756,6 @@ ev_window_init (EvWindow *ev_window)
#if ENABLE_EPUB /*The webview, we won't add it now but it will replace the atril-view if a web(epub) document is encountered.*/
ev_window->priv->webview = ev_web_view_new();
ev_web_view_set_model(EV_WEB_VIEW(ev_window->priv->webview),ev_window->priv->model);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- g_signal_connect_object (ev_window->priv->webview,"selection-changed",
- G_CALLBACK(web_view_selection_changed_cb),
- ev_window, 0);
-#endif
#endif
page_cache_mb = g_settings_get_uint (ev_window_ensure_settings (ev_window),
GS_PAGE_CACHE_SIZE);