Commit 6af11c82 authored by Simon Steinbeiss's avatar Simon Steinbeiss Committed by Simon Steinbeiß
Browse files

Move about dialog to settings

parent 977c2ddd
......@@ -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
*/
......
......@@ -22,18 +22,6 @@
<property name="can_focus">False</property>
<property name="show_arrow">False</property>
<property name="icon_size">1</property>
<child>
<object class="GtkToolButton" id="toolbutton-about">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-about</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolItem" id="filter-toolitem">
<property name="use_action_appearance">False</property>
......
......@@ -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);
}
......
......@@ -2,10 +2,25 @@
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">help-browser</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">help-about</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">window-close-symbolic</property>
</object>
<object class="GtkDialog" id="settings-dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Settings for Task Manager</property>
<property name="title" translatable="yes">Task Manager Settings</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
......@@ -24,25 +39,55 @@
<object class="GtkButtonBox" id="dialog-action_area">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<property name="layout_style">spread</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">_Help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button-about">
<property name="label" translatable="yes">About</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">image2</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button-close">
<property name="label">gtk-close</property>
<property name="label">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="image">image3</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment