diff --git a/panels/diagnostics/diagnostics.gresource.xml b/panels/diagnostics/diagnostics.gresource.xml deleted file mode 100644 index 541d62cb2..000000000 --- a/panels/diagnostics/diagnostics.gresource.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - cc-diagnostics-panel.ui - - diff --git a/panels/diagnostics/gnome-diagnostics-panel.desktop.in b/panels/diagnostics/gnome-diagnostics-panel.desktop.in deleted file mode 100644 index 06d187f5e..000000000 --- a/panels/diagnostics/gnome-diagnostics-panel.desktop.in +++ /dev/null @@ -1,15 +0,0 @@ -[Desktop Entry] -Name=Diagnostics -Comment=Settings for automatically problem reporting -Exec=gnome-control-center diagnostics -# FIXME -# Translators: Do NOT translate or transliterate this text (this is an icon file name)! -Icon=org.gnome.Settings-diagnostics-symbolic -Terminal=false -Type=Application -NoDisplay=true -StartupNotify=true -Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-PrivacySettings; -OnlyShowIn=GNOME;Unity; -# Translators: Search terms to find the Diagnostics panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! -Keywords=diagnostics;crash; diff --git a/panels/diagnostics/icons/meson.build b/panels/diagnostics/icons/meson.build deleted file mode 100644 index c1b200dd1..000000000 --- a/panels/diagnostics/icons/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -install_data( - 'scalable/org.gnome.Settings-diagnostics-symbolic.svg', - install_dir: join_paths(control_center_icondir, 'hicolor', 'scalable', 'apps') -) diff --git a/panels/diagnostics/icons/scalable/org.gnome.Settings-diagnostics-symbolic.svg b/panels/diagnostics/icons/scalable/org.gnome.Settings-diagnostics-symbolic.svg deleted file mode 100644 index 34e4afc59..000000000 --- a/panels/diagnostics/icons/scalable/org.gnome.Settings-diagnostics-symbolic.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/panels/diagnostics/meson.build b/panels/diagnostics/meson.build deleted file mode 100644 index 8daa3af6c..000000000 --- a/panels/diagnostics/meson.build +++ /dev/null @@ -1,32 +0,0 @@ -panels_list += cappletname -desktop = 'gnome-@0@-panel.desktop'.format(cappletname) - -i18n.merge_file( - type: 'desktop', - input: desktop + '.in', - output: desktop, - po_dir: po_dir, - install: true, - install_dir: control_center_desktopdir -) - -sources = files('cc-diagnostics-panel.c') - -sources += gnome.compile_resources( - 'cc-' + cappletname + '-resources', - cappletname + '.gresource.xml', - c_name: 'cc_' + cappletname, - export: true -) - -cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir) - -panels_libs += static_library( - cappletname, - sources: sources, - include_directories: [top_inc, common_inc], - dependencies: common_deps, - c_args: cflags -) - -subdir('icons') diff --git a/panels/diagnostics/cc-diagnostics-panel.c b/panels/privacy/cc-diagnostics-page.c similarity index 71% rename from panels/diagnostics/cc-diagnostics-panel.c rename to panels/privacy/cc-diagnostics-page.c index 9aeca6ecd..814d2cacb 100644 --- a/panels/diagnostics/cc-diagnostics-panel.c +++ b/panels/privacy/cc-diagnostics-page.c @@ -18,17 +18,16 @@ * Author: Matthias Clasen */ -#include "cc-diagnostics-panel.h" -#include "cc-diagnostics-resources.h" +#include "cc-diagnostics-page.h" #include "cc-util.h" #include "shell/cc-application.h" #include #include -struct _CcDiagnosticsPanel +struct _CcDiagnosticsPage { - CcPanel parent_instance; + AdwNavigationPage parent_instance; AdwPreferencesGroup *diagnostics_group; GtkSwitch *abrt_switch; @@ -36,30 +35,20 @@ struct _CcDiagnosticsPanel GSettings *privacy_settings; }; -CC_PANEL_REGISTER (CcDiagnosticsPanel, cc_diagnostics_panel) +G_DEFINE_TYPE (CcDiagnosticsPage, cc_diagnostics_page, ADW_TYPE_NAVIGATION_PAGE) /* Static init function */ -static void -set_panel_visibility (CcPanelVisibility visibility) -{ - CcApplication *application; - - application = CC_APPLICATION (g_application_get_default ()); - cc_shell_model_set_panel_visibility (cc_application_get_model (application), - "diagnostics", - visibility); - -} - static void abrt_appeared_cb (GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer user_data) { + CcDiagnosticsPage *self = CC_DIAGNOSTICS_PAGE (user_data); + g_debug ("ABRT appeared"); - set_panel_visibility (CC_PANEL_VISIBLE); + gtk_widget_set_visible (GTK_WIDGET (self), TRUE); } static void @@ -67,60 +56,56 @@ abrt_vanished_cb (GDBusConnection *connection, const gchar *name, gpointer user_data) { + CcDiagnosticsPage *self = CC_DIAGNOSTICS_PAGE (user_data); + g_debug ("ABRT vanished"); - set_panel_visibility (CC_PANEL_VISIBLE_IN_SEARCH); -} - -void -cc_diagnostics_panel_static_init_func (void) -{ - g_bus_watch_name (G_BUS_TYPE_SYSTEM, - "org.freedesktop.problems.daemon", - G_BUS_NAME_WATCHER_FLAGS_NONE, - abrt_appeared_cb, - abrt_vanished_cb, - NULL, - NULL); - - set_panel_visibility (CC_PANEL_VISIBLE_IN_SEARCH); + gtk_widget_set_visible (GTK_WIDGET (self), FALSE); } static void -cc_diagnostics_panel_finalize (GObject *object) +cc_diagnostics_page_finalize (GObject *object) { - CcDiagnosticsPanel *self = CC_DIAGNOSTICS_PANEL (object); + CcDiagnosticsPage *self = CC_DIAGNOSTICS_PAGE (object); g_clear_object (&self->privacy_settings); - G_OBJECT_CLASS (cc_diagnostics_panel_parent_class)->finalize (object); + G_OBJECT_CLASS (cc_diagnostics_page_parent_class)->finalize (object); } static void -cc_diagnostics_panel_class_init (CcDiagnosticsPanelClass *klass) +cc_diagnostics_page_class_init (CcDiagnosticsPageClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - oclass->finalize = cc_diagnostics_panel_finalize; + oclass->finalize = cc_diagnostics_page_finalize; - gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/diagnostics/cc-diagnostics-panel.ui"); + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/privacy/cc-diagnostics-page.ui"); - gtk_widget_class_bind_template_child (widget_class, CcDiagnosticsPanel, diagnostics_group); - gtk_widget_class_bind_template_child (widget_class, CcDiagnosticsPanel, abrt_switch); + gtk_widget_class_bind_template_child (widget_class, CcDiagnosticsPage, diagnostics_group); + gtk_widget_class_bind_template_child (widget_class, CcDiagnosticsPage, abrt_switch); } static void -cc_diagnostics_panel_init (CcDiagnosticsPanel *self) +cc_diagnostics_page_init (CcDiagnosticsPage *self) { g_autofree gchar *os_name = NULL; g_autofree gchar *url = NULL; g_autofree gchar *msg = NULL; g_autofree gchar *link = NULL; - g_resources_register (cc_diagnostics_get_resource ()); - gtk_widget_init_template (GTK_WIDGET (self)); + g_bus_watch_name (G_BUS_TYPE_SYSTEM, + "org.freedesktop.problems.daemon", + G_BUS_NAME_WATCHER_FLAGS_NONE, + abrt_appeared_cb, + abrt_vanished_cb, + self, + NULL); + + gtk_widget_set_visible (GTK_WIDGET (self), FALSE); + self->privacy_settings = g_settings_new ("org.gnome.desktop.privacy"); g_settings_bind (self->privacy_settings, "report-technical-problems", diff --git a/panels/diagnostics/cc-diagnostics-panel.h b/panels/privacy/cc-diagnostics-page.h similarity index 77% rename from panels/diagnostics/cc-diagnostics-panel.h rename to panels/privacy/cc-diagnostics-page.h index 3875ec554..05b8ae1c2 100644 --- a/panels/diagnostics/cc-diagnostics-panel.h +++ b/panels/privacy/cc-diagnostics-page.h @@ -20,13 +20,11 @@ #pragma once -#include +#include G_BEGIN_DECLS -#define CC_TYPE_DIAGNOSTICS_PANEL (cc_diagnostics_panel_get_type ()) -G_DECLARE_FINAL_TYPE (CcDiagnosticsPanel, cc_diagnostics_panel, CC, DIAGNOSTICS_PANEL, CcPanel) - -void cc_diagnostics_panel_static_init_func (void); +#define CC_TYPE_DIAGNOSTICS_PAGE (cc_diagnostics_page_get_type ()) +G_DECLARE_FINAL_TYPE (CcDiagnosticsPage, cc_diagnostics_page, CC, DIAGNOSTICS_PAGE, AdwNavigationPage) G_END_DECLS diff --git a/panels/diagnostics/cc-diagnostics-panel.ui b/panels/privacy/cc-diagnostics-page.ui similarity index 65% rename from panels/diagnostics/cc-diagnostics-panel.ui rename to panels/privacy/cc-diagnostics-page.ui index 13cf4c0bd..84e74b61d 100644 --- a/panels/diagnostics/cc-diagnostics-panel.ui +++ b/panels/privacy/cc-diagnostics-page.ui @@ -1,7 +1,15 @@ - diff --git a/panels/privacy/gnome-privacy-panel.desktop.in b/panels/privacy/gnome-privacy-panel.desktop.in index 25b42d60a..fff169d08 100644 --- a/panels/privacy/gnome-privacy-panel.desktop.in +++ b/panels/privacy/gnome-privacy-panel.desktop.in @@ -11,4 +11,4 @@ StartupNotify=true Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-AccountSettings; OnlyShowIn=GNOME; # Translators: Search terms to find the Privacy panel. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! -Keywords=Privacy;Screen;Lock;Private;Usage;Recent;History;Files;Temporary;Tmp;Trash;Purge;Retain; +Keywords=Privacy;Screen;Lock;Private;Usage;Recent;History;Files;Temporary;Tmp;Trash;Purge;Retain;Diagnostics;Crash; diff --git a/panels/privacy/icons/scalable/actions/diagnostics-symbolic.svg b/panels/privacy/icons/scalable/actions/diagnostics-symbolic.svg new file mode 100644 index 000000000..4f1e184b9 --- /dev/null +++ b/panels/privacy/icons/scalable/actions/diagnostics-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/panels/privacy/meson.build b/panels/privacy/meson.build index e455c6d0f..4d6066f51 100644 --- a/panels/privacy/meson.build +++ b/panels/privacy/meson.build @@ -11,6 +11,7 @@ i18n.merge_file( ) sources = files( + 'cc-diagnostics-page.c', 'cc-privacy-panel.c', 'cc-screen-page.c', 'cc-usage-page.c', diff --git a/panels/privacy/privacy.gresource.xml b/panels/privacy/privacy.gresource.xml index 76e929721..f9e324402 100644 --- a/panels/privacy/privacy.gresource.xml +++ b/panels/privacy/privacy.gresource.xml @@ -1,11 +1,13 @@ + cc-diagnostics-page.ui cc-privacy-panel.ui cc-screen-page.ui cc-usage-page.ui + icons/scalable/actions/diagnostics-symbolic.svg icons/scalable/actions/lock-symbolic.svg icons/scalable/actions/trash-symbolic.svg