From 6af11c82b74c41efa76c31033122166f7340a3dc Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Mon, 4 Jan 2021 00:27:53 +0100 Subject: [PATCH] Move about dialog to settings --- src/process-window.c | 52 ----------------------------------- src/process-window.ui | 12 --------- src/settings-dialog.c | 54 ++++++++++++++++++++++++++++++++++++- src/settings-dialog.ui | 61 ++++++++++++++++++++++++++++++++++++------ 4 files changed, 106 insertions(+), 73 deletions(-) diff --git a/src/process-window.c b/src/process-window.c index acd9f18..84f0be2 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -71,7 +71,6 @@ static gboolean xtm_process_window_configure_event (XtmProcessWindow *window, G static gboolean xtm_process_vpaned_move_event (XtmProcessWindow *window, GdkEventButton *event); static gboolean xtm_process_window_key_pressed (XtmProcessWindow *window, GdkEventKey *event); static void monitor_update_step_size (XtmProcessWindow *window); -static void show_about_dialog (XtmProcessWindow *window); static void @@ -256,9 +255,6 @@ xtm_process_window_init (XtmProcessWindow *window) G_CALLBACK (xwininfo_clicked_cb), window); gtk_widget_show_all (GTK_WIDGET (xwininfo)); - button = GTK_WIDGET (gtk_builder_get_object (window->builder, "toolbutton-about")); - g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_about_dialog), window); - { GtkWidget *toolitem; guint refresh_rate; @@ -416,54 +412,6 @@ monitor_update_step_size (XtmProcessWindow *window) g_object_set (window->mem_monitor, "step-size", refresh_rate / 1000.0, NULL); } -static void -show_about_dialog (XtmProcessWindow *window) -{ - const gchar *authors[] = { - "(c) 2018-2019 Rozhuk Ivan", - "(c) 2014 Landry Breuil", - "(c) 2014 Harald Judt", - "(c) 2014 Peter de Ridder", - "(c) 2014 Simon Steinbeiss", - "(c) 2008-2010 Mike Massonnet", - "(c) 2005-2008 Johannes Zellner", - "", - "FreeBSD", - " \342\200\242 Rozhuk Ivan", - " \342\200\242 Mike Massonnet", - " \342\200\242 Oliver Lehmann", - "", - "OpenBSD", - " \342\200\242 Landry Breuil", - "", - "Linux", - " \342\200\242 Johannes Zellner", - " \342\200\242 Mike Massonnet", - "", - "OpenSolaris", - " \342\200\242 Mike Massonnet", - " \342\200\242 Peter Tribble", - NULL }; - const gchar *license = - "This program is free software; you can redistribute it and/or modify\n" - "it under the terms of the GNU General Public License as published by\n" - "the Free Software Foundation; either version 2 of the License, or\n" - "(at your option) any later version.\n"; - - gtk_show_about_dialog (GTK_WINDOW (window->window), - "program-name", _("Task Manager"), - "version", PACKAGE_VERSION, - "copyright", "Copyright \302\251 2005-2019 The Xfce development team", - "logo-icon-name", "org.xfce.taskmanager", - "comments", _("Easy to use task manager"), - "license", license, - "authors", authors, - "translator-credits", _("translator-credits"), - "website", "http://goodies.xfce.org/projects/applications/xfce4-taskmanager", - "website-label", "goodies.xfce.org", - NULL); -} - /** * Class functions */ diff --git a/src/process-window.ui b/src/process-window.ui index 42d0e77..8c958e7 100644 --- a/src/process-window.ui +++ b/src/process-window.ui @@ -22,18 +22,6 @@ False False 1 - - - True - False - True - gtk-about - - - False - True - - False diff --git a/src/settings-dialog.c b/src/settings-dialog.c index cd0cca2..8cd69e2 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -38,7 +38,7 @@ G_DEFINE_TYPE (XtmSettingsDialog, xtm_settings_dialog, GTK_TYPE_WIDGET) static void xtm_settings_dialog_finalize (GObject *object); static void xtm_settings_dialog_show (GtkWidget *widget); static void xtm_settings_dialog_hide (GtkWidget *widget); - +static void show_about_dialog (GtkWidget *widget); static void @@ -84,10 +84,59 @@ combobox_changed (GtkComboBox *combobox, XtmSettings *settings) g_object_set (settings, setting_name, active, NULL); } +static void +show_about_dialog (GtkWidget *widget) +{ + const gchar *authors[] = { + "(c) 2018-2019 Rozhuk Ivan", + "(c) 2014 Landry Breuil", + "(c) 2014 Harald Judt", + "(c) 2014 Peter de Ridder", + "(c) 2014 Simon Steinbeiss", + "(c) 2008-2010 Mike Massonnet", + "(c) 2005-2008 Johannes Zellner", + "", + "FreeBSD", + " \342\200\242 Rozhuk Ivan", + " \342\200\242 Mike Massonnet", + " \342\200\242 Oliver Lehmann", + "", + "OpenBSD", + " \342\200\242 Landry Breuil", + "", + "Linux", + " \342\200\242 Johannes Zellner", + " \342\200\242 Mike Massonnet", + "", + "OpenSolaris", + " \342\200\242 Mike Massonnet", + " \342\200\242 Peter Tribble", + NULL }; + const gchar *license = + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n"; + + gtk_show_about_dialog (GTK_WINDOW (widget), + "program-name", _("Task Manager"), + "version", PACKAGE_VERSION, + "copyright", "Copyright \302\251 2005-2019 The Xfce development team", + "logo-icon-name", "org.xfce.taskmanager", + "comments", _("Easy to use task manager"), + "license", license, + "authors", authors, + "translator-credits", _("translator-credits"), + "website", "http://goodies.xfce.org/projects/applications/xfce4-taskmanager", + "website-label", "goodies.xfce.org", + NULL); +} + static void xtm_settings_dialog_init (XtmSettingsDialog *dialog) { GtkBuilder *builder; + GtkWidget *about; g_object_ref_sink (dialog); @@ -109,6 +158,9 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog) builder_bind_toggle_button (builder, "button-show-status-icon", dialog->settings, "show-status-icon"); builder_bind_toggle_button (builder, "button-process-tree", dialog->settings, "process-tree"); + about = GTK_WIDGET (gtk_builder_get_object (builder, "button-about")); + g_signal_connect_swapped (about, "clicked", G_CALLBACK (show_about_dialog), dialog->window); + g_object_unref (builder); } diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 5aa26ab..dddbaf1 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -2,10 +2,25 @@ + + True + False + help-browser + + + True + False + help-about + + + True + False + window-close-symbolic + False 5 - Settings for Task Manager + Task Manager Settings False True True @@ -24,25 +39,55 @@ True False - end + spread - - gtk-close + + _Help True True True - True + image1 + True + + + True + True + 0 + + + + + About + True + True + True + image2 + + + True + True + 1 + + + + + _Close + True + True + True + image3 + True False False - 0 + 2 - False - False + True + True end 0