diff options
Diffstat (limited to 'baobab/src')
-rw-r--r-- | baobab/src/Makefile.am | 17 | ||||
-rw-r--r-- | baobab/src/baobab-cell-renderer-progress.c | 36 | ||||
-rw-r--r-- | baobab/src/baobab-cell-renderer-progress.h | 25 | ||||
-rw-r--r-- | baobab/src/baobab-chart.c | 52 | ||||
-rw-r--r-- | baobab/src/baobab-chart.h | 18 | ||||
-rw-r--r-- | baobab/src/baobab-prefs.c | 20 | ||||
-rw-r--r-- | baobab/src/baobab-prefs.h | 17 | ||||
-rw-r--r-- | baobab/src/baobab-remote-connect-dialog.c | 62 | ||||
-rw-r--r-- | baobab/src/baobab-remote-connect-dialog.h | 36 | ||||
-rw-r--r-- | baobab/src/baobab-ringschart.c | 47 | ||||
-rw-r--r-- | baobab/src/baobab-ringschart.h | 16 | ||||
-rw-r--r-- | baobab/src/baobab-scan.c | 49 | ||||
-rw-r--r-- | baobab/src/baobab-scan.h | 17 | ||||
-rw-r--r-- | baobab/src/baobab-treemap.c | 28 | ||||
-rw-r--r-- | baobab/src/baobab-treemap.h | 16 | ||||
-rw-r--r-- | baobab/src/baobab-treeview.c | 23 | ||||
-rw-r--r-- | baobab/src/baobab-treeview.h | 17 | ||||
-rw-r--r-- | baobab/src/baobab-utils.c | 32 | ||||
-rw-r--r-- | baobab/src/baobab-utils.h | 17 | ||||
-rw-r--r-- | baobab/src/baobab.c | 45 | ||||
-rw-r--r-- | baobab/src/baobab.h | 21 | ||||
-rw-r--r-- | baobab/src/callbacks.c | 25 | ||||
-rw-r--r-- | baobab/src/callbacks.h | 19 |
23 files changed, 312 insertions, 343 deletions
diff --git a/baobab/src/Makefile.am b/baobab/src/Makefile.am index e0d56b23..e6e34268 100644 --- a/baobab/src/Makefile.am +++ b/baobab/src/Makefile.am @@ -1,3 +1,18 @@ +# This file is part of MATE Utils. +# +# 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. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. + NULL = AM_CPPFLAGS = \ @@ -47,6 +62,7 @@ mate_disk_usage_analyzer_CFLAGS = \ $(GIO_CFLAGS) \ $(GTK_CFLAGS) \ $(LIBGTOP_CFLAGS) \ + $(MATE_DESKTOP_CFLAGS) \ $(WARN_CFLAGS) \ $(NULL) @@ -57,6 +73,7 @@ mate_disk_usage_analyzer_LDADD = \ $(GIO_LIBS) \ $(GTK_LIBS) \ $(LIBGTOP_LIBS) \ + $(MATE_DESKTOP_LIBS) \ $(NULL) CLEANFILES = $(BUILT_SOURCES) diff --git a/baobab/src/baobab-cell-renderer-progress.c b/baobab/src/baobab-cell-renderer-progress.c index 057c7e02..de7bb733 100644 --- a/baobab/src/baobab-cell-renderer-progress.c +++ b/baobab/src/baobab-cell-renderer-progress.c @@ -1,24 +1,26 @@ -/* baobab-cell-renderer-progress.c +/* Copyright (C) 2006 Paolo Borelli + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2006 Paolo Borelli + * This file is part of MATE Utils. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * 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. * - * This library is distributed in the hope that it will be useful, + * 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 - * Library General Public License for more details. + * 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 Library General Public - * License along with this library; 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/>. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <stdlib.h> #include "baobab-cell-renderer-progress.h" @@ -123,13 +125,13 @@ baobab_cell_renderer_progress_get_size (GtkCellRenderer *cell, gtk_cell_renderer_get_alignment (cell, &xalign, &yalign); if (x_offset) { - *x_offset = xalign * (cell_area->width - calc_width); + *x_offset = (gint) (xalign * (gfloat) (cell_area->width - calc_width)); *x_offset = MAX (*x_offset, 0); } if (y_offset) { - *y_offset = yalign * (cell_area->height - calc_height); + *y_offset = (gint) (yalign * (gfloat) (cell_area->height - calc_height)); *y_offset = MAX (*y_offset, 0); } } @@ -223,7 +225,7 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell, cairo_set_source_rgb (cr, 1, 1, 1); cairo_fill (cr); - perc_w = w * MAX (0, cellprogress->priv->perc) / 100; + perc_w = (gint) (w * MAX (0, cellprogress->priv->perc) / 100); cairo_rectangle (cr, is_rtl ? (x + w - perc_w) : x, y, perc_w, h); set_color_according_to_perc (cr, cellprogress->priv->perc); diff --git a/baobab/src/baobab-cell-renderer-progress.h b/baobab/src/baobab-cell-renderer-progress.h index 4fd2ca64..2b79d682 100644 --- a/baobab/src/baobab-cell-renderer-progress.h +++ b/baobab/src/baobab-cell-renderer-progress.h @@ -1,21 +1,20 @@ -/* baobab-cell-renderer-progress.h +/* Copyright (C) 2006 Paolo Borelli + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2006 Paolo Borelli + * This file is part of MATE Utils. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * 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. * - * This library is distributed in the hope that it will be useful, + * 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 - * Library General Public License for more details. + * 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 Library General Public - * License along with this library; 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/>. */ #ifndef __BAOBAB_CELL_RENDERER_PROGRESS_H__ diff --git a/baobab/src/baobab-chart.c b/baobab/src/baobab-chart.c index e484f146..d8350511 100644 --- a/baobab/src/baobab-chart.c +++ b/baobab/src/baobab-chart.c @@ -1,22 +1,20 @@ -/* - * baobab-chart.c +/* Copyright (C) 2006, 2007, 2008 Igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2006, 2007, 2008 Igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Felipe Erias <[email protected]> @@ -31,7 +29,10 @@ * Alejandro Garcia <[email protected]> */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <gtk/gtk.h> #include <glib/gi18n.h> @@ -166,7 +167,6 @@ static gboolean baobab_chart_query_tooltip (GtkWidget *widget, GtkTooltip *tooltip, gpointer user_data); - static void baobab_chart_class_init (BaobabChartClass *class) { @@ -377,7 +377,7 @@ baobab_chart_set_property (GObject *object, switch (prop_id) { case PROP_MAX_DEPTH: - baobab_chart_set_max_depth (GTK_WIDGET (chart), g_value_get_int (value)); + baobab_chart_set_max_depth (GTK_WIDGET (chart), g_value_get_uint (value)); break; case PROP_MODEL: baobab_chart_set_model (GTK_WIDGET (chart), g_value_get_object (value)); @@ -404,7 +404,7 @@ baobab_chart_get_property (GObject *object, switch (prop_id) { case PROP_MAX_DEPTH: - g_value_set_int (value, priv->max_depth); + g_value_set_uint (value, priv->max_depth); break; case PROP_MODEL: g_value_set_object (value, priv->model); @@ -522,8 +522,6 @@ baobab_chart_get_items (GtkWidget *chart, GtkTreePath *root) return; } - - model_root_path = gtk_tree_path_new_first (); gtk_tree_model_get_iter (priv->model, &model_root_iter, model_root_path); gtk_tree_path_free (model_root_path); @@ -656,7 +654,6 @@ baobab_chart_update_draw (BaobabChart* chart, if (priv->root == NULL) root_path = gtk_tree_path_new_first (); - root_depth = gtk_tree_path_get_depth (root_path); node_depth = gtk_tree_path_get_depth (path); @@ -747,7 +744,7 @@ baobab_chart_expose (GtkWidget *chart, cairo_t *cr) { BaobabChartPrivate *priv; gint w, h; - gdouble p, sx, sy; + gdouble p, sx, sy, aux; GtkTreePath *root_path = NULL; GtkTreePath *current_path = NULL; GtkAllocation allocation; @@ -755,10 +752,18 @@ baobab_chart_expose (GtkWidget *chart, cairo_t *cr) GdkRectangle area; gdouble x1, y1, x2, y2; cairo_clip_extents (cr, &x1, &y1, &x2, &y2); - area.x = floor (x1); - area.y = floor (y1); - area.width = ceil (x2) - area.x; - area.height = ceil (y2) - area.y; + + aux = floor (x1); + area.x = (int)aux; + + aux = floor (y1); + area.y = (int)aux; + + aux = ceil (x2); + area.width = (int)aux - area.x; + + aux = ceil (y2); + area.height = (int)aux - area.y; priv = BAOBAB_CHART (chart)->priv; @@ -864,7 +869,7 @@ baobab_chart_interpolate_colors (BaobabChartColor *color, void baobab_chart_get_item_color (BaobabChartColor *color, gdouble rel_position, - gint depth, + guint depth, gboolean highlighted) { gdouble intensity; @@ -880,7 +885,7 @@ baobab_chart_get_item_color (BaobabChartColor *color, *color = level_color; else { - color_number = rel_position / (100/3); + color_number = (int) (rel_position / (100.0/3.0)); next_color_number = (color_number + 1) % 6; baobab_chart_interpolate_colors (color, @@ -1162,7 +1167,7 @@ baobab_chart_query_tooltip (GtkWidget *widget, return TRUE; } -GdkPixbuf* +static GdkPixbuf* baobab_chart_get_pixbuf (GtkWidget *widget) { gint w, h; @@ -1173,7 +1178,6 @@ baobab_chart_get_pixbuf (GtkWidget *widget) w = gdk_window_get_width(gtk_widget_get_window(widget)); h = gdk_window_get_height(gtk_widget_get_window(widget)); - pixbuf = gdk_pixbuf_get_from_window ( gtk_widget_get_window (widget), 0, 0, diff --git a/baobab/src/baobab-chart.h b/baobab/src/baobab-chart.h index 19773024..ad82a429 100644 --- a/baobab/src/baobab-chart.h +++ b/baobab/src/baobab-chart.h @@ -1,22 +1,20 @@ -/* - * baobab-chart.h +/* Copyright (C) 2006, 2007, 2008 Igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2006, 2007, 2008 Igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Felipe Erias <[email protected]> @@ -142,7 +140,7 @@ void baobab_chart_freeze_updates (GtkWidget *chart); void baobab_chart_thaw_updates (GtkWidget *chart); void baobab_chart_get_item_color (BaobabChartColor *color, gdouble position, - gint depth, + guint depth, gboolean highlighted); void baobab_chart_move_up_root (GtkWidget *chart); void baobab_chart_zoom_in (GtkWidget *chart); diff --git a/baobab/src/baobab-prefs.c b/baobab/src/baobab-prefs.c index 56e37e51..ef40e96f 100644 --- a/baobab/src/baobab-prefs.c +++ b/baobab/src/baobab-prefs.c @@ -1,27 +1,25 @@ -/* - * baobab-prefs.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ - +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <string.h> #include <sys/stat.h> diff --git a/baobab/src/baobab-prefs.h b/baobab/src/baobab-prefs.h index 73893ae8..cb90a545 100644 --- a/baobab/src/baobab-prefs.h +++ b/baobab/src/baobab-prefs.h @@ -1,23 +1,20 @@ -/* - * baobab-prefs.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_PROPS_H__ diff --git a/baobab/src/baobab-remote-connect-dialog.c b/baobab/src/baobab-remote-connect-dialog.c index e892e06d..484ffbf5 100644 --- a/baobab/src/baobab-remote-connect-dialog.c +++ b/baobab/src/baobab-remote-connect-dialog.c @@ -1,32 +1,30 @@ -/* Baobab - (C) 2005 Fabio Marzocca - - baobab-remote-connect-dialog.c - - Modified module from caja-connect-server-dialog.c - Released under same licence - */ -/* - * Caja +/* Copyright (C) 2005 Fabio Marzocca + * Copyright (C) 2012-2021 MATE Developers * + * Modified module from caja-connect-server-dialog.c. + * Released under same licence. * Copyright (C) 2003 Red Hat, Inc. * - * Caja 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 file is part of MATE Utils. + * + * 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. * - * Caja is distributed in the hope that it will be useful, + * 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. + * 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; see the file COPYING. 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/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include "baobab-remote-connect-dialog.h" #include <string.h> @@ -36,7 +34,6 @@ #include "baobab.h" - /* Translators: all the strings in this file are meant to map the similar strings inside caja-connect-server and should be translated the same way @@ -58,7 +55,6 @@ G_DEFINE_TYPE(BaobabRemoteConnectDialog, baobab_remote_connect_dialog, GTK_TYPE_ #define RESPONSE_CONNECT GTK_RESPONSE_OK - static void display_error_dialog (GError *error, GFile *location, @@ -66,24 +62,18 @@ display_error_dialog (GError *error, { GtkWidget *dlg; char *parse_name; - char *error_message; parse_name = g_file_get_parse_name (location); - error_message = g_strdup_printf (_("Cannot scan location \"%s\""), - parse_name); - g_free (parse_name); - dlg = gtk_message_dialog_new (parent, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - error_message, NULL); + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Cannot scan location \"%s\""), parse_name); + g_free (parse_name); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), "%s", error->message); - g_free (error_message); - gtk_dialog_run (GTK_DIALOG (dlg)); gtk_widget_destroy (dlg); } @@ -564,10 +554,6 @@ port_insert_text (GtkEditable *editable, { int pos; - if (new_text_length < 0) { - new_text_length = strlen (new_text); - } - /* Only allow digits to be inserted as port number */ for (pos = 0; pos < new_text_length; pos++) { if (!g_ascii_isdigit (new_text[pos])) { @@ -659,7 +645,6 @@ baobab_remote_connect_dialog_init (BaobabRemoteConnectDialog *dialog) 1, get_method_description (&(methods[i])), -1); - if (methods[i].flags & DEFAULT_METHOD) { gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter); } @@ -688,7 +673,6 @@ baobab_remote_connect_dialog_init (BaobabRemoteConnectDialog *dialog) gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - dialog->details->grid = grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 6); gtk_grid_set_column_spacing (GTK_GRID (grid), 12); diff --git a/baobab/src/baobab-remote-connect-dialog.h b/baobab/src/baobab-remote-connect-dialog.h index 05dbcdfc..06e4e9d9 100644 --- a/baobab/src/baobab-remote-connect-dialog.h +++ b/baobab/src/baobab-remote-connect-dialog.h @@ -1,30 +1,24 @@ -/* Baobab - (C) 2005 Fabio Marzocca - - baobab-remote-connect-dialog.h - - Modified module from BaobabRemoteConnectDialog.h - Released under same licence - */ - -/* - * Caja +/* Copyright (C) 2005 Fabio Marzocca + * Copyright (C) 2012-2021 MATE Developers * + * Modified module from BaobabRemoteConnectDialog.h. + * Released under same licence. * Copyright (C) 2003 Red Hat, Inc. * - * Caja 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 file is part of MATE Utils. + * + * 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. * - * Caja is distributed in the hope that it will be useful, + * 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. + * 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; see the file COPYING. 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/>. */ #ifndef BAOBAB_REMOTE_CONNECT_DIALOG_H diff --git a/baobab/src/baobab-ringschart.c b/baobab/src/baobab-ringschart.c index cdb18a52..7b568673 100644 --- a/baobab/src/baobab-ringschart.c +++ b/baobab/src/baobab-ringschart.c @@ -1,22 +1,20 @@ -/* - * baobab-ringschart.c +/* Copyright (C) 2008 Igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2008 Igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Felipe Erias <[email protected]> @@ -69,7 +67,7 @@ struct _BaobabRingschartPrivate guint tips_timeout_event; GList *subtip_items; gboolean drawing_subtips; - gint subtip_timeout; + guint subtip_timeout; }; G_DEFINE_TYPE_WITH_PRIVATE (BaobabRingschart, baobab_ringschart, BAOBAB_CHART_TYPE); @@ -98,7 +96,6 @@ static void baobab_ringschart_get_item_rectangle (GtkWidget *chart, static void baobab_ringschart_pre_draw (GtkWidget *chart, cairo_t *cr); static void baobab_ringschart_post_draw (GtkWidget *chart, cairo_t *cr); - static void baobab_ringschart_class_init (BaobabRingschartClass *class) { @@ -132,7 +129,7 @@ baobab_ringschart_init (BaobabRingschart *chart) settings = gtk_settings_get_default (); g_object_get (G_OBJECT (settings), "gtk-tooltip-timeout", &timeout, NULL); - priv->subtip_timeout = 2 * timeout; + priv->subtip_timeout = 2 * (guint)timeout; } static void @@ -308,10 +305,10 @@ baobab_ringschart_get_point_min_rect (gdouble cx, gdouble angle, GdkRectangle *rect) { - gdouble x, y; + int x, y; - x = cx + cos (angle) * radius; - y = cy + sin (angle) * radius; + x = (int) (cx + cos (angle) * radius); + y = (int) (cy + sin (angle) * radius); rect->x = MIN (rect->x, x); rect->y = MIN (rect->y, y); @@ -349,16 +346,16 @@ baobab_ringschart_get_item_rectangle (GtkWidget *chart, baobab_ringschart_get_point_min_rect (cx, cy, r2, a2, &rect); if ( (a1 <= M_PI/2) && (a2 >= M_PI/2) ) - rect.height = MAX (rect.height, cy + sin (M_PI/2) * r2); + rect.height = MAX (rect.height, (int) (cy + sin (M_PI/2) * r2)); if ( (a1 <= M_PI) && (a2 >= M_PI) ) - rect.x = MIN (rect.x, cx + cos (M_PI) * r2); + rect.x = MIN (rect.x, (int) (cx + cos (M_PI) * r2)); if ( (a1 <= M_PI*1.5) && (a2 >= M_PI*1.5) ) - rect.y = MIN (rect.y, cy + sin (M_PI*1.5) * r2); + rect.y = MIN (rect.y, (int) (cy + sin (M_PI*1.5) * r2)); if ( (a1 <= M_PI*2) && (a2 >= M_PI*2) ) - rect.width = MAX (rect.width, cx + cos (M_PI*2) * r2); + rect.width = MAX (rect.width, (int) (cx + cos (M_PI*2) * r2)); rect.width -= rect.x; rect.height -= rect.y; @@ -366,7 +363,7 @@ baobab_ringschart_get_item_rectangle (GtkWidget *chart, item->rect = rect; } -gboolean +static gboolean baobab_ringschart_subfolder_tips_timeout (gpointer data) { BaobabRingschartPrivate *priv; @@ -380,7 +377,7 @@ baobab_ringschart_subfolder_tips_timeout (gpointer data) return FALSE; } -void +static void baobab_ringschart_clean_subforlder_tips_state (GtkWidget *chart) { BaobabRingschartPrivate *priv; @@ -518,10 +515,10 @@ baobab_ringschart_draw_subfolder_tips (GtkWidget *chart, cairo_t *cr) } /* get the GdkRectangle of the tooltip (with a little padding) */ - _rect.x = tooltip_rect.x - 1; - _rect.y = tooltip_rect.y - 1; - _rect.width = tooltip_rect.width + 2; - _rect.height = tooltip_rect.height + 2; + _rect.x = (int) (tooltip_rect.x - 1.0); + _rect.y = (int) (tooltip_rect.y - 1.0); + _rect.width = (int) (tooltip_rect.width + 2.0); + _rect.height = (int) (tooltip_rect.height + 2.0); /* Check if tooltip overlaps */ if (! gdk_rectangle_intersect (&_rect, &last_rect, NULL)) diff --git a/baobab/src/baobab-ringschart.h b/baobab/src/baobab-ringschart.h index f63d4fff..1e257778 100644 --- a/baobab/src/baobab-ringschart.h +++ b/baobab/src/baobab-ringschart.h @@ -1,22 +1,20 @@ -/* - * baobab-ringschart.h +/* Copyright (C) 2008 igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2008 igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Felipe Erias <[email protected]> diff --git a/baobab/src/baobab-scan.c b/baobab/src/baobab-scan.c index 824004ff..f79b9223 100644 --- a/baobab/src/baobab-scan.c +++ b/baobab/src/baobab-scan.c @@ -1,27 +1,25 @@ -/* - * baobab-scan.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ - +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <string.h> @@ -31,7 +29,7 @@ #include "baobab.h" #include "baobab-utils.h" - +#include "baobab-scan.h" /* Hardlinks handling. @@ -125,12 +123,12 @@ baobab_hardlinks_array_free (BaobabHardLinkArray *a) g_array_free (a, TRUE); } -#define BLOCK_SIZE 512 +#define BLOCK_SIZE 512UL struct allsizes { - goffset size; - goffset alloc_size; - gint depth; + guint64 size; + guint64 alloc_size; + guint depth; }; static const char *dir_attributes = \ @@ -144,7 +142,6 @@ static const char *dir_attributes = \ G_FILE_ATTRIBUTE_UNIX_DEVICE "," \ G_FILE_ATTRIBUTE_ACCESS_CAN_READ; - static gboolean is_in_dot_gvfs (GFile *file) { @@ -213,8 +210,10 @@ loopdir (GFile *file, parse_name = g_file_get_parse_name (file); - if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE)) - retloop.size = g_file_info_get_size (info); + if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE)) { + goffset file_size = g_file_info_get_size (info); + retloop.size = (guint64) file_size; + } if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_BLOCKS)) retloop.alloc_size = BLOCK_SIZE * @@ -247,9 +246,9 @@ loopdir (GFile *file, will be part of the GUI. */ /* prefill the model */ - data.size = 1; - data.alloc_size = 1; - data.depth = count - 1; + data.size = 1UL; + data.alloc_size = 1UL; + data.depth = (gint) count - 1; data.elements = -1; data.display_name = display_name; data.parse_name = parse_name; @@ -289,9 +288,9 @@ loopdir (GFile *file, G_FILE_ATTRIBUTE_UNIX_NLINK) > 1) { if (!baobab_hardlinks_array_add (hla, temp_info)) { - /* we already acconted for it */ - tempHLsize += g_file_info_get_size (temp_info); + goffset file_size = g_file_info_get_size (temp_info); + tempHLsize += (guint64) file_size; g_object_unref (temp_info); continue; } @@ -321,7 +320,7 @@ loopdir (GFile *file, data.parse_name = parse_name; data.size = retloop.size; data.alloc_size = retloop.alloc_size; - data.depth = count - 1; + data.depth = (gint) count - 1; data.elements = elements; data.tempHLsize = tempHLsize; baobab_fill_model (&data); diff --git a/baobab/src/baobab-scan.h b/baobab/src/baobab-scan.h index 2ef8ab1f..c687944a 100644 --- a/baobab/src/baobab-scan.h +++ b/baobab/src/baobab-scan.h @@ -1,23 +1,20 @@ -/* - * baobab-scan.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_SCAN_H__ diff --git a/baobab/src/baobab-treemap.c b/baobab/src/baobab-treemap.c index ee25fd87..966caddf 100644 --- a/baobab/src/baobab-treemap.c +++ b/baobab/src/baobab-treemap.c @@ -1,22 +1,20 @@ -/* - * baobab-treemap.c +/* Copyright (C) 2008 Igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2008 Igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Fabio Marzocca <[email protected]> @@ -284,17 +282,17 @@ baobab_treemap_get_item_rectangle (GtkWidget *chart, _rect = (cairo_rectangle_t *) item->data; - item->rect.x = _rect->x; - item->rect.y = _rect->y; + item->rect.x = (int) _rect->x; + item->rect.y = (int) _rect->y; if (item->depth % 2 != 0) { - item->rect.width = _rect->width - ITEM_PADDING; - item->rect.height = _rect->height; + item->rect.width = (int) _rect->width - ITEM_PADDING; + item->rect.height = (int) _rect->height; } else { - item->rect.width = _rect->width; - item->rect.height = _rect->height - ITEM_PADDING; + item->rect.width = (int) _rect->width; + item->rect.height = (int) _rect->height - ITEM_PADDING; } } diff --git a/baobab/src/baobab-treemap.h b/baobab/src/baobab-treemap.h index 734bc272..f2b38d84 100644 --- a/baobab/src/baobab-treemap.h +++ b/baobab/src/baobab-treemap.h @@ -1,22 +1,20 @@ -/* - * baobab-treemap.h +/* Copyright (C) 2008 igalia + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2008 igalia + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. * * Authors: * Fabio Marzocca <[email protected]> diff --git a/baobab/src/baobab-treeview.c b/baobab/src/baobab-treeview.c index 8e5b7839..50794773 100644 --- a/baobab/src/baobab-treeview.c +++ b/baobab/src/baobab-treeview.c @@ -1,26 +1,25 @@ -/* - * baobab-treeview.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <gtk/gtk.h> #include <glib.h> @@ -102,8 +101,8 @@ on_tv_button_press (GtkWidget *widget, GFile *file; gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), - event->x, event->y, - &path, NULL, NULL, NULL); + (gint) event->x, (gint) event->y, + &path, NULL, NULL, NULL); if (!path) return TRUE; diff --git a/baobab/src/baobab-treeview.h b/baobab/src/baobab-treeview.h index 998e88e4..62e85384 100644 --- a/baobab/src/baobab-treeview.h +++ b/baobab/src/baobab-treeview.h @@ -1,23 +1,20 @@ -/* - * baobab-treeview.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_TV_H__ diff --git a/baobab/src/baobab-utils.c b/baobab/src/baobab-utils.c index 5aaec321..43efd3fb 100644 --- a/baobab/src/baobab-utils.c +++ b/baobab/src/baobab-utils.c @@ -1,26 +1,25 @@ -/* - * baobab-utils.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <glib.h> #include <glib/gstdio.h> @@ -34,6 +33,8 @@ #include <glibtop/mountlist.h> #include <glibtop/fsusage.h> +#include <libmate-desktop/mate-image-menu-item.h> + #include "baobab.h" #include "baobab-treeview.h" #include "baobab-utils.h" @@ -71,7 +72,7 @@ baobab_get_filesystem (BaobabFS *fs) g_free (mountentries); } -void +static void filechooser_cb (GtkWidget *chooser, gint response, gpointer data) @@ -324,9 +325,9 @@ add_popupmenu_item (GtkMenu *pmenu, const gchar *label, const gchar *icon_name, GtkWidget *item; GtkWidget *image; - item = gtk_image_menu_item_new_with_mnemonic (label); + item = mate_image_menu_item_new_with_mnemonic (label); image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (item), image); g_signal_connect (item, "activate", item_cb, NULL); @@ -499,8 +500,9 @@ baobab_help_display (GtkWindow *parent, gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s", error->message); - 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); diff --git a/baobab/src/baobab-utils.h b/baobab/src/baobab-utils.h index d47ba798..679d530b 100644 --- a/baobab/src/baobab-utils.h +++ b/baobab/src/baobab-utils.h @@ -1,23 +1,20 @@ -/* - * baobab-utils.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_UTILS_H__ diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c index 4ad034ed..380f5407 100644 --- a/baobab/src/baobab.c +++ b/baobab/src/baobab.c @@ -1,32 +1,33 @@ -/* - * baobab.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif #include <gtk/gtk.h> #include <glib/gi18n.h> #include <gio/gio.h> #include <glibtop.h> +#include <libmate-desktop/mate-image-menu-item.h> + #include "baobab.h" #include "baobab-scan.h" #include "baobab-treeview.h" @@ -453,7 +454,7 @@ baobab_fill_model (struct chan_data *data) hardlinks = g_string_new (""); if (data->tempHLsize > 0) { - size = g_format_size (data->tempHLsize); + size = g_format_size (data->tempHLsize); g_string_assign (hardlinks, "<i>("); g_string_append (hardlinks, _("contains hardlinks for:")); @@ -911,20 +912,20 @@ create_context_menu (void) menu->widget = gtk_menu_new (); - menu->up_item = gtk_image_menu_item_new_with_label (_("Move to parent folder")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu->up_item), + menu->up_item = mate_image_menu_item_new_with_label (_("Move to parent folder")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menu->up_item), gtk_image_new_from_icon_name("go-up", GTK_ICON_SIZE_MENU)); - menu->zoom_in_item = gtk_image_menu_item_new_with_label (_("Zoom in")) ; - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu->zoom_in_item), + menu->zoom_in_item = mate_image_menu_item_new_with_label (_("Zoom in")) ; + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menu->zoom_in_item), gtk_image_new_from_icon_name("list-add", GTK_ICON_SIZE_MENU)); - menu->zoom_out_item = gtk_image_menu_item_new_with_label (_("Zoom out")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu->zoom_out_item), + menu->zoom_out_item = mate_image_menu_item_new_with_label (_("Zoom out")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menu->zoom_out_item), gtk_image_new_from_icon_name("list-remove", GTK_ICON_SIZE_MENU)); - menu->snapshot_item = gtk_image_menu_item_new_with_label (_("Save screenshot")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu->snapshot_item), + menu->snapshot_item = mate_image_menu_item_new_with_label (_("Save screenshot")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (menu->snapshot_item), gtk_image_new_from_icon_name ("applets-screenshooter", GTK_ICON_SIZE_MENU)); gtk_menu_shell_append (GTK_MENU_SHELL (menu->widget), @@ -1072,7 +1073,7 @@ static void on_chart_type_change (GtkWidget *combo, gpointer user_data) { GtkWidget *chart; - guint active; + gint active; active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); @@ -1224,14 +1225,16 @@ main (int argc, char *argv[]) const GOptionEntry options[] = { {"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, show_version, N_("Show version"), NULL}, {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &directories, NULL, N_("[DIRECTORY]")}, - {NULL} + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; GOptionContext *context; GError *error = NULL; +#ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); +#endif /* ENABLE_NLS */ g_set_application_name (_("Disk Usage Analyzer")); diff --git a/baobab/src/baobab.h b/baobab/src/baobab.h index 76b22d6a..a84c9334 100644 --- a/baobab/src/baobab.h +++ b/baobab/src/baobab.h @@ -1,23 +1,20 @@ -/* - * baobab.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_H__ @@ -92,7 +89,7 @@ struct _BaobabApplication { GVolumeMonitor *monitor_vol; GFileMonitor *monitor_home; - gint model_max_depth; + guint model_max_depth; GSettings *ui_settings; GSettings *prefs_settings; @@ -105,7 +102,7 @@ struct chan_data { guint64 size; guint64 alloc_size; guint64 tempHLsize; - guint depth; + gint depth; gint elements; gchar *display_name; gchar *parse_name; diff --git a/baobab/src/callbacks.c b/baobab/src/callbacks.c index 5c48aebb..7e8ad638 100644 --- a/baobab/src/callbacks.c +++ b/baobab/src/callbacks.c @@ -1,27 +1,24 @@ -/* - * callbacks.c - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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. + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H -# include <config.h> +#include <config.h> #endif #include <string.h> @@ -90,11 +87,9 @@ on_about_activate (GtkMenuItem *menuitem, gpointer user_data) "General Public License for more details."), N_("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 Street, Fifth Floor, Boston, MA 02110-1301, USA.") + "along with this program. If not, see <https://www.gnu.org/licenses/>.") }; - gchar* license_trans = g_strjoin("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL); #ifdef ENABLE_NLS @@ -109,7 +104,7 @@ on_about_activate (GtkMenuItem *menuitem, gpointer user_data) "title", _("About Disk Usage Analyzer"), "comments", _("Analyze your disk usage through a graphical tool."), "copyright", _("Copyright \xc2\xa9 2005-2010 Fabio Marzocca\n" - "Copyright \xc2\xa9 2011-2020 MATE developers"), + "Copyright \xc2\xa9 2011-2021 MATE developers"), "logo-icon-name", "mate-disk-usage-analyzer", "license", license_trans, "authors", authors, diff --git a/baobab/src/callbacks.h b/baobab/src/callbacks.h index d823cc32..e120aa35 100644 --- a/baobab/src/callbacks.h +++ b/baobab/src/callbacks.h @@ -1,23 +1,20 @@ -/* - * callbacks.h - * This file is part of baobab +/* Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2005-2006 Fabio Marzocca <[email protected]> + * This file is part of MATE Utils. * - * This program is free software; you can redistribute it and/or modify + * 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 + * 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, + * 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. * * 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 + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __BAOBAB_CALLBACKS_H__ @@ -31,6 +28,8 @@ void on_about_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menuscanhome_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menuallfs_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menuscandir_activate (GtkMenuItem *menuitem, gpointer user_data); +void on_menu_collapse_activate (GtkMenuItem *menuitem, gpointer user_data); +void on_menu_expand_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menu_stop_activate (GtkMenuItem *menuitem, gpointer user_data); void on_menu_rescan_activate (GtkMenuItem *menuitem, gpointer user_data); void on_tbscandir_clicked (GtkToolButton *toolbutton, gpointer user_data); |