summaryrefslogtreecommitdiff
path: root/gsearchtool/src
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-22 15:49:16 +0300
committermonsta <[email protected]>2016-11-22 15:49:16 +0300
commitea481767c4e3ec19136a5b61ad46f244a9a5ffa7 (patch)
treebbcceb1d2a0be587e7127109f57e41e9e9b43f98 /gsearchtool/src
parent8f9a34f003061d7c5e6cfe8a8cb64ec6e98d7c4a (diff)
downloadmate-utils-ea481767c4e3ec19136a5b61ad46f244a9a5ffa7.tar.bz2
mate-utils-ea481767c4e3ec19136a5b61ad46f244a9a5ffa7.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17
Diffstat (limited to 'gsearchtool/src')
-rw-r--r--gsearchtool/src/gsearchtool-support.c20
-rw-r--r--gsearchtool/src/gsearchtool.c67
2 files changed, 0 insertions, 87 deletions
diff --git a/gsearchtool/src/gsearchtool-support.c b/gsearchtool/src/gsearchtool-support.c
index d12cdbfb..b4bdc0b1 100644
--- a/gsearchtool/src/gsearchtool-support.c
+++ b/gsearchtool/src/gsearchtool-support.c
@@ -897,11 +897,7 @@ get_themed_icon_pixbuf (GThemedIcon * icon,
g_clear_error (&error);
}
-#if GTK_CHECK_VERSION (3, 8, 0)
g_object_unref (icon_info);
-#else
- gtk_icon_info_free (icon_info);
-#endif
g_strfreev (icon_names);
return pixbuf;
@@ -952,10 +948,8 @@ open_file_with_filemanager (GtkWidget * window,
GDesktopAppInfo * d_app_info;
GKeyFile * key_file;
GdkAppLaunchContext * ctx = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkScreen *screen;
GdkDisplay *display;
-#endif
GList * list = NULL;
GAppInfo * g_app_info;
GFile * g_file;
@@ -995,13 +989,9 @@ open_file_with_filemanager (GtkWidget * window,
d_app_info = g_desktop_app_info_new_from_keyfile (key_file);
if (d_app_info != NULL) {
-#if GTK_CHECK_VERSION (3, 0, 0)
screen = gtk_widget_get_screen (GTK_WIDGET (window));
display = gdk_screen_get_display (screen);
ctx = gdk_display_get_app_launch_context (display);
-#else
- ctx = gdk_app_launch_context_new ();
-#endif
gdk_app_launch_context_set_screen (ctx, gtk_widget_get_screen (window));
result = g_app_info_launch_uris (G_APP_INFO (d_app_info), list, G_APP_LAUNCH_CONTEXT (ctx), NULL);
@@ -1029,9 +1019,7 @@ open_file_with_application (GtkWidget * window,
GAppInfo * app)
{
GdkAppLaunchContext * context;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
-#endif
GdkScreen * screen;
gboolean result;
@@ -1040,12 +1028,8 @@ open_file_with_application (GtkWidget * window,
}
screen = gtk_widget_get_screen (window);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = gdk_screen_get_display (screen);
context = gdk_display_get_app_launch_context (display);
-#else
- context = gdk_app_launch_context_new ();
-#endif
gdk_app_launch_context_set_screen (context, screen);
if (app == NULL) {
@@ -1146,11 +1130,7 @@ gsearchtool_button_new_with_stock_icon (const gchar * string,
label = gtk_label_new_with_mnemonic (string);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
-#else
- hbox = gtk_hbox_new (FALSE, 2);
-#endif
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
diff --git a/gsearchtool/src/gsearchtool.c b/gsearchtool/src/gsearchtool.c
index 8b42b662..eeae2ecd 100644
--- a/gsearchtool/src/gsearchtool.c
+++ b/gsearchtool/src/gsearchtool.c
@@ -1738,11 +1738,7 @@ handle_search_command_stderr_io (GIOChannel * ioc,
gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
spacer = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
@@ -1786,11 +1782,7 @@ handle_search_command_stderr_io (GIOChannel * ioc,
gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- hbox = gtk_hbox_new (FALSE, 0);
-#endif
spacer = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
@@ -1964,11 +1956,7 @@ create_constraint_box (GSearchWindow * gsearch,
GtkWidget * entry_hbox;
GtkWidget * button;
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- hbox = gtk_hbox_new (FALSE, 12);
-#endif
switch (GSearchOptionTemplates[opt->constraint_id].type) {
case SEARCH_CONSTRAINT_TYPE_BOOLEAN:
@@ -2044,11 +2032,7 @@ create_constraint_box (GSearchWindow * gsearch,
(gpointer) gsearch);
/* add text field */
-#if GTK_CHECK_VERSION (3, 0, 0)
entry_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- entry_hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), entry_hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (entry_hbox), entry, TRUE, TRUE, 0);
@@ -2175,13 +2159,8 @@ create_additional_constraint_section (GSearchWindow * gsearch)
GtkWidget * hbox;
gchar * desc;
-#if GTK_CHECK_VERSION (3, 0, 0)
gsearch->available_options_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-#else
- gsearch->available_options_vbox = gtk_vbox_new (FALSE, 6);
- hbox = gtk_hbox_new (FALSE, 12);
-#endif
gtk_box_pack_end (GTK_BOX (gsearch->available_options_vbox), hbox, FALSE, FALSE, 0);
@@ -2312,13 +2291,8 @@ create_search_results_section (GSearchWindow * gsearch)
GtkTreeViewColumn * column;
GtkCellRenderer * renderer;
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@@ -2362,9 +2336,6 @@ create_search_results_section (GSearchWindow * gsearch)
gtk_tree_view_set_headers_visible (gsearch->search_results_tree_view, FALSE);
gtk_tree_view_set_search_equal_func (gsearch->search_results_tree_view,
gsearch_equal_func, NULL, NULL);
-#if !GTK_CHECK_VERSION (3, 14, 0)
- gtk_tree_view_set_rules_hint (gsearch->search_results_tree_view, TRUE);
-#endif
g_object_unref (G_OBJECT (gsearch->search_results_list_store));
if (gsearch->is_window_accessible) {
@@ -2812,51 +2783,29 @@ gsearch_app_create (GSearchWindow * gsearch)
gtk_window_maximize (GTK_WINDOW (gsearch->window));
}
-#if GTK_CHECK_VERSION (3, 0, 0)
container = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- container = gtk_vbox_new (FALSE, 6);
-#endif
gtk_container_add (GTK_CONTAINER (gsearch->window), container);
gtk_container_set_border_width (GTK_CONTAINER (container), 12);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
gsearch->name_and_folder_table = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (gsearch->name_and_folder_table), 6);
gtk_grid_set_column_spacing (GTK_GRID (gsearch->name_and_folder_table), 12);
-#else
- gsearch->name_and_folder_table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (gsearch->name_and_folder_table), 6);
- gtk_table_set_col_spacings (GTK_TABLE (gsearch->name_and_folder_table), 12);
-#endif
gtk_container_add (GTK_CONTAINER (hbox), gsearch->name_and_folder_table);
label = gtk_label_new_with_mnemonic (_("_Name contains:"));
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
g_object_set (G_OBJECT (label), "xalign", 0.0, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (gsearch->name_and_folder_table), label, 0, 0, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (gsearch->name_and_folder_table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 1);
-#endif
gsearch->name_contains_entry = gsearch_history_entry_new ("gsearchtool-file-entry", FALSE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), gsearch->name_contains_entry);
gsearch_history_entry_set_history_length (GSEARCH_HISTORY_ENTRY (gsearch->name_contains_entry), 10);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_hexpand (gsearch->name_contains_entry, TRUE);
gtk_grid_attach (GTK_GRID (gsearch->name_and_folder_table), gsearch->name_contains_entry, 1, 0, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (gsearch->name_and_folder_table), gsearch->name_contains_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
-#endif
entry = gsearch_history_entry_get_entry (GSEARCH_HISTORY_ENTRY (gsearch->name_contains_entry));
if (GTK_IS_ACCESSIBLE (gtk_widget_get_accessible (gsearch->name_contains_entry))) {
@@ -2872,20 +2821,12 @@ gsearch_app_create (GSearchWindow * gsearch)
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
g_object_set (G_OBJECT (label), "xalign", 0.0, NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (gsearch->name_and_folder_table), label, 0, 1, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (gsearch->name_and_folder_table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
-#endif
gsearch->look_in_folder_button = gtk_file_chooser_button_new (_("Browse"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (gsearch->look_in_folder_button));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_hexpand (gsearch->look_in_folder_button, TRUE);
gtk_grid_attach (GTK_GRID (gsearch->name_and_folder_table), gsearch->look_in_folder_button, 1, 1, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (gsearch->name_and_folder_table), gsearch->look_in_folder_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0);
-#endif
g_signal_connect (G_OBJECT (gsearch->look_in_folder_button), "current-folder-changed",
G_CALLBACK (look_in_folder_changed_cb),
@@ -2924,22 +2865,14 @@ gsearch_app_create (GSearchWindow * gsearch)
add_atk_relation (GTK_WIDGET (gsearch->show_more_options_expander), GTK_WIDGET (gsearch->available_options_vbox), ATK_RELATION_CONTROLLER_FOR);
}
-#if GTK_CHECK_VERSION (3, 0, 0)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
-#else
- vbox = gtk_vbox_new (FALSE, 12);
-#endif
gtk_box_pack_start (GTK_BOX (container), vbox, TRUE, TRUE, 0);
gsearch->search_results_vbox = create_search_results_section (gsearch);
gtk_widget_set_sensitive (GTK_WIDGET (gsearch->search_results_vbox), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), gsearch->search_results_vbox, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-#else
- hbox = gtk_hbutton_box_new ();
-#endif
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);