summaryrefslogtreecommitdiff
path: root/gsearchtool/src/gsearchtool-callbacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsearchtool/src/gsearchtool-callbacks.c')
-rw-r--r--gsearchtool/src/gsearchtool-callbacks.c110
1 files changed, 50 insertions, 60 deletions
diff --git a/gsearchtool/src/gsearchtool-callbacks.c b/gsearchtool/src/gsearchtool-callbacks.c
index 7b915658..737ca064 100644
--- a/gsearchtool/src/gsearchtool-callbacks.c
+++ b/gsearchtool/src/gsearchtool-callbacks.c
@@ -1,32 +1,29 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * MATE Search Tool
+/* Copyright (C) 2002 the Free Software Foundation
+ * Copyright (C) 2012-2021 MATE Developers
*
- * File: gsearchtool-callbacks.c
+ * This file is part of MATE Utils.
*
- * (C) 2002 the Free Software Foundation
+ * MATE Utils is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
*
- * Authors: Dennis Cranston <[email protected]>
- * George Lebl
+ * MATE Utils is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>.
*
+ * Authors:
+ * Dennis Cranston <[email protected]>
+ * George Lebl
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <string.h>
@@ -200,9 +197,9 @@ click_help_cb (GtkWidget * widget,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_error_free (error);
@@ -224,7 +221,7 @@ click_expander_cb (GObject * object,
GDK_HINT_MIN_SIZE);
}
else {
- GdkGeometry default_geometry = {MINIMUM_WINDOW_WIDTH, MINIMUM_WINDOW_HEIGHT};
+ GdkGeometry default_geometry = { MINIMUM_WINDOW_WIDTH, MINIMUM_WINDOW_HEIGHT, 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0 };
gtk_widget_hide (gsearch->available_options_vbox);
gtk_window_set_geometry_hints (GTK_WINDOW (gsearch->window),
@@ -332,7 +329,6 @@ look_in_folder_changed_cb (GtkWidget * widget,
g_free (value);
}
-
static gint
display_dialog_file_open_limit (GtkWidget * window,
gint count)
@@ -407,9 +403,9 @@ display_dialog_could_not_open_file (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
@@ -436,9 +432,9 @@ display_dialog_could_not_open_folder (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
@@ -739,9 +735,9 @@ display_dialog_could_not_move_to_trash (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
}
@@ -817,9 +813,9 @@ display_dialog_could_not_delete (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
}
@@ -1147,8 +1143,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
gtk_widget_show (new1);
- g_signal_connect (G_OBJECT (new1),
- "activate",
+ g_signal_connect (new1, "activate",
G_CALLBACK (open_file_cb),
(gpointer) gsearch);
}
@@ -1173,8 +1168,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
gtk_widget_show (new1);
- g_signal_connect (G_OBJECT (new1),
- "activate",
+ g_signal_connect (new1, "activate",
G_CALLBACK (open_file_cb),
(gpointer) gsearch);
}
@@ -1261,7 +1255,8 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
on the parent menu item. Since submenus in gtk+ are automatically displayed when
the user hovers over them, most will never click on the parent menu item.
The work-around is to connect to "button-press-event". */
- g_signal_connect (G_OBJECT(new1), "button-press-event", G_CALLBACK (open_file_event_cb),
+ g_signal_connect (new1, "button-press-event",
+ G_CALLBACK (open_file_event_cb),
(gpointer) gsearch);
}
else {
@@ -1303,8 +1298,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
gtk_widget_show (new1);
- g_signal_connect (G_OBJECT (new1),
- "activate",
+ g_signal_connect (new1, "activate",
G_CALLBACK (open_folder_cb),
(gpointer) gsearch);
@@ -1314,8 +1308,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
gtk_widget_show (new1);
- g_signal_connect (G_OBJECT (new1),
- "activate",
+ g_signal_connect (new1, "activate",
G_CALLBACK (copy_path_cb),
(gpointer) gsearch);
}
@@ -1334,8 +1327,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_container_add (GTK_CONTAINER (gsearch->search_results_popup_menu), new1);
gtk_widget_show (new1);
- g_signal_connect (G_OBJECT (new1),
- "activate",
+ g_signal_connect (new1, "activate",
G_CALLBACK (move_to_trash_cb),
(gpointer) gsearch);
@@ -1352,8 +1344,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_widget_set_sensitive (gsearch->search_results_save_results_as_item, FALSE);
}
- g_signal_connect (G_OBJECT (gsearch->search_results_save_results_as_item),
- "activate",
+ g_signal_connect (gsearch->search_results_save_results_as_item, "activate",
G_CALLBACK (show_file_selector_cb),
(gpointer) gsearch);
}
@@ -1623,7 +1614,7 @@ drag_begin_file_cb (GtkWidget * widget,
number_of_selected_rows = gtk_tree_selection_count_selected_rows (GTK_TREE_SELECTION (gsearch->search_results_selection));
if (number_of_selected_rows > 1) {
- gtk_drag_set_icon_stock (context, "gtk-dnd-multiple", 0, 0);
+ gtk_drag_set_icon_name (context, "gtk-dnd-multiple", 0, 0);
}
else if (number_of_selected_rows == 1) {
GdkPixbuf * pixbuf;
@@ -1646,7 +1637,7 @@ drag_begin_file_cb (GtkWidget * widget,
gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
}
else {
- gtk_drag_set_icon_stock (context, "gtk-dnd", 0, 0);
+ gtk_drag_set_icon_name (context, "gtk-dnd", 0, 0);
}
}
}
@@ -1714,7 +1705,6 @@ drag_file_cb (GtkWidget * widget,
g_free (uri_list);
}
-
void
show_file_selector_cb (GtkAction * action,
gpointer data)
@@ -1735,7 +1725,7 @@ show_file_selector_cb (GtkAction * action,
gsearch->save_results_as_default_filename);
}
- g_signal_connect (G_OBJECT (file_chooser), "response",
+ g_signal_connect (file_chooser, "response",
G_CALLBACK (save_results_cb), gsearch);
gtk_window_set_modal (GTK_WINDOW (file_chooser), TRUE);
@@ -1766,9 +1756,9 @@ display_dialog_could_not_save_no_name (GtkWidget * window)
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
g_free (secondary);
@@ -1798,9 +1788,9 @@ display_dialog_could_not_save_to (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
gtk_widget_show (dialog);
g_free (primary);
}