summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file-conflict-dialog.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
committerlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
commit276eb145ce96d5f75f8d3901daf6310f60ddbb81 (patch)
tree544f41e76c9a91973867065696fc2e414ca60170 /libcaja-private/caja-file-conflict-dialog.c
parent969e4d021fe49654fe6e5ee7e88c920fec126505 (diff)
downloadcaja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.bz2
caja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.xz
move to GTK+3 (>= 3.14), drop libunique, GTK+2 code, and --with-gtk build option
*Remove GTK_VERSION_CHECK (3, 0, 0) and libunique selectors *Remove GTK2 and libunique specific code. *Leaves selector for specific GTK3 versions. *Remove #DEFINES for vbox/hbox previously required for GTK2 compatability *Keep vbox in caja-spatial-window.c, it is necessary for the desktop to work *spatial-window vbox issue at https://github.com/mate-desktop/caja/issues/591
Diffstat (limited to 'libcaja-private/caja-file-conflict-dialog.c')
-rw-r--r--libcaja-private/caja-file-conflict-dialog.c65
1 files changed, 7 insertions, 58 deletions
diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c
index 588483be..03a9dfb6 100644
--- a/libcaja-private/caja-file-conflict-dialog.c
+++ b/libcaja-private/caja-file-conflict-dialog.c
@@ -70,11 +70,6 @@ G_DEFINE_TYPE (CajaFileConflictDialog,
(G_TYPE_INSTANCE_GET_PRIVATE ((object), CAJA_TYPE_FILE_CONFLICT_DIALOG, \
CajaFileConflictDialogDetails))
-#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
-
static void
file_icons_changed (CajaFile *file,
CajaFileConflictDialog *fcd)
@@ -115,11 +110,7 @@ file_list_ready_cb (GList *files,
GdkPixbuf *pixbuf;
GtkWidget *label;
GString *str;
-#if GTK_CHECK_VERSION(3,0,0)
PangoAttrList *attr_list;
-#else
- PangoFontDescription *desc;
-#endif
details = fcd->details;
@@ -220,7 +211,6 @@ file_list_ready_cb (GList *files,
label = gtk_label_new (primary_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
-#if GTK_CHECK_VERSION (3, 0, 0)
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
@@ -238,30 +228,9 @@ file_list_ready_cb (GList *files,
NULL);
pango_attr_list_unref (attr_list);
-#else
- gtk_widget_set_size_request (label, 350, -1);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (details->titles_vbox),
- label, FALSE, FALSE, 0);
-
- gtk_widget_modify_font (label, NULL);
-
- desc = pango_font_description_new ();
- pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD);
- pango_font_description_set_size (desc,
- pango_font_description_get_size (gtk_widget_get_style (label)->font_desc) * PANGO_SCALE_LARGE);
- gtk_widget_modify_font (label, desc);
- pango_font_description_free (desc);
- gtk_widget_show (label);
-#endif
-
label = gtk_label_new (secondary_text);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_label_set_max_width_chars (GTK_LABEL (label), 60);
-#else
- gtk_widget_set_size_request (label, 350, -1);
-#endif
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
#else
@@ -596,11 +565,7 @@ diff_button_clicked_cb (GtkButton *w,
static void
caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *hbox, *vbox, *vbox2;
-#else
- GtkWidget *hbox, *vbox, *vbox2, *alignment;
-#endif
GtkWidget *widget, *dialog_area;
CajaFileConflictDialogDetails *details;
GtkDialog *dialog;
@@ -612,7 +577,7 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
source_is_dir = caja_file_is_directory (details->source);
/* Setup the main hbox */
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
dialog_area = gtk_dialog_get_content_area (dialog);
gtk_box_pack_start (GTK_BOX (dialog_area), hbox, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
@@ -621,42 +586,30 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
widget = gtk_image_new_from_icon_name ("dialog-warning",
GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
gtk_widget_set_valign (widget, GTK_ALIGN_START);
-#else
- gtk_misc_set_alignment (GTK_MISC (widget), 0.5, 0.0);
-#endif
/* Setup the vbox containing the dialog body */
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
/* Setup the vbox for the dialog labels */
- widget = gtk_vbox_new (FALSE, 12);
+ widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
details->titles_vbox = widget;
/* Setup the hboxes to pack file infos into */
-#if GTK_CHECK_VERSION (3, 0, 0)
- vbox2 = gtk_vbox_new (FALSE, 12);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_widget_set_halign (vbox2, GTK_ALIGN_START);
gtk_widget_set_valign (vbox2, GTK_ALIGN_START);
gtk_widget_set_margin_start (vbox2, 12);
gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
-#else
- alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
- g_object_set (alignment, "left-padding", 12, NULL);
- vbox2 = gtk_vbox_new (FALSE, 12);
- gtk_container_add (GTK_CONTAINER (alignment), vbox2);
- gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
-#endif
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
details->first_hbox = hbox;
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
details->second_hbox = hbox;
@@ -666,7 +619,7 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
g_signal_connect (details->expander, "activate",
G_CALLBACK (expander_activated_cb), dialog);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (details->expander), hbox);
widget = gtk_entry_new ();
@@ -683,11 +636,7 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
g_signal_connect (widget, "clicked",
G_CALLBACK (reset_button_clicked_cb), dialog);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_show_all (vbox2);
-#else
- gtk_widget_show_all (alignment);
-#endif
/* Setup the diff button for text files */
details->diff_button = gtk_button_new_with_label (_("Differences..."));