Hdy → Adw

This simply changes namespaces. Fortunately, no further widgetry
changes will be necessary - all the widgets and APIs seem to have
an exact match in libadwaita.
This commit is contained in:
Georges Basile Stavracas Neto 2022-07-08 15:11:30 -03:00
parent d142554ed3
commit e322d8cd98
9 changed files with 41 additions and 41 deletions

View file

@ -26,7 +26,7 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include "restrict-applications-dialog.h"
#include "restrict-applications-selector.h"
@ -54,13 +54,13 @@ struct _MctRestrictApplicationsDialog
GtkDialog parent_instance;
MctRestrictApplicationsSelector *selector;
HdyPreferencesGroup *group;
AdwPreferencesGroup *group;
MctAppFilter *app_filter; /* (owned) (not nullable) */
gchar *user_display_name; /* (owned) (nullable) */
};
G_DEFINE_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, HDY_TYPE_PREFERENCES_WINDOW)
G_DEFINE_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, ADW_TYPE_PREFERENCES_WINDOW)
typedef enum
{
@ -215,14 +215,14 @@ update_description (MctRestrictApplicationsDialog *self)
if (self->user_display_name == NULL)
{
hdy_preferences_group_set_description (self->group, NULL);
adw_preferences_group_set_description (self->group, NULL);
return;
}
/* Translators: the placeholder is a users full name */
description = g_strdup_printf (_("Restrict %s from using the following installed applications."),
self->user_display_name);
hdy_preferences_group_set_description (self->group, description);
adw_preferences_group_set_description (self->group, description);
}
/**

View file

@ -24,14 +24,14 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/manager.h>
G_BEGIN_DECLS
#define MCT_TYPE_RESTRICT_APPLICATIONS_DIALOG (mct_restrict_applications_dialog_get_type ())
G_DECLARE_FINAL_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, MCT, RESTRICT_APPLICATIONS_DIALOG, HdyPreferencesWindow)
G_DECLARE_FINAL_TYPE (MctRestrictApplicationsDialog, mct_restrict_applications_dialog, MCT, RESTRICT_APPLICATIONS_DIALOG, AdwPreferencesWindow)
MctRestrictApplicationsDialog *mct_restrict_applications_dialog_new (MctAppFilter *app_filter,
const gchar *user_display_name);

View file

@ -2,16 +2,16 @@
<!-- Copyright © 2020 Endless, Inc. -->
<interface domain="malcontent">
<requires lib="gtk+" version="3.12"/>
<template class="MctRestrictApplicationsDialog" parent="HdyPreferencesWindow">
<template class="MctRestrictApplicationsDialog" parent="AdwPreferencesWindow">
<property name="title" translatable="yes">Restrict Applications</property>
<property name="skip-taskbar-hint">True</property>
<property name="default-width">500</property>
<property name="default-height">500</property>
<property name="search-enabled">False</property>
<child>
<object class="HdyPreferencesPage">
<object class="AdwPreferencesPage">
<child>
<object class="HdyPreferencesGroup" id="group">
<object class="AdwPreferencesGroup" id="group">
<!-- Translated dynamically: -->
<property name="description">Restrict {username} from using the following installed applications.</property>
<child>

View file

@ -28,7 +28,7 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/app-filter.h>
#include "restrict-applications-selector.h"
@ -336,16 +336,16 @@ create_row_for_app_cb (gpointer item,
else
g_object_ref (icon);
row = hdy_action_row_new ();
row = adw_action_row_new ();
/* Icon */
w = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &size, NULL);
gtk_image_set_pixel_size (GTK_IMAGE (w), size);
hdy_action_row_add_prefix (HDY_ACTION_ROW (row), w);
adw_action_row_add_prefix (ADW_ACTION_ROW (row), w);
/* App name label */
hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (row), app_name);
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (row), app_name);
/* Switch */
w = g_object_new (GTK_TYPE_SWITCH,
@ -357,7 +357,7 @@ create_row_for_app_cb (gpointer item,
GTK_STYLE_PROVIDER (self->css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION - 1);
gtk_container_add (GTK_CONTAINER (row), w);
hdy_action_row_set_activatable_widget (HDY_ACTION_ROW (row), w);
adw_action_row_set_activatable_widget (ADW_ACTION_ROW (row), w);
gtk_widget_show_all (row);

View file

@ -78,15 +78,15 @@ struct _MctUserControls
GtkLabel *description_label;
GMenu *age_menu;
GtkSwitch *restrict_software_installation_switch;
HdyActionRow *restrict_software_installation_row;
AdwActionRow *restrict_software_installation_row;
GtkSwitch *restrict_web_browsers_switch;
HdyActionRow *restrict_web_browsers_row;
AdwActionRow *restrict_web_browsers_row;
GtkButton *oars_button;
GtkLabel *oars_button_label;
GtkPopover *oars_popover;
MctRestrictApplicationsDialog *restrict_applications_dialog;
GtkLabel *restrict_applications_description;
HdyActionRow *restrict_applications_row;
AdwActionRow *restrict_applications_row;
GSimpleActionGroup *action_group; /* (owned) */
@ -470,17 +470,17 @@ update_labels_from_name (MctUserControls *self)
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents %s from running web browsers. Limited web content may still be available in other applications."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_web_browsers_row, l);
adw_action_row_set_subtitle (self->restrict_web_browsers_row, l);
g_clear_pointer (&l, g_free);
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents specified applications from being used by %s."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_applications_row, l);
adw_action_row_set_subtitle (self->restrict_applications_row, l);
g_clear_pointer (&l, g_free);
/* Translators: The placeholder is a users display name. */
l = g_strdup_printf (_("Prevents %s from installing applications."), self->user_display_name);
hdy_action_row_set_subtitle (self->restrict_software_installation_row, l);
adw_action_row_set_subtitle (self->restrict_software_installation_row, l);
g_clear_pointer (&l, g_free);
}

View file

@ -27,7 +27,7 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libhandy-1/handy.h>
#include <adwaita.h>
#include <libmalcontent/malcontent.h>

View file

@ -4,9 +4,9 @@
<requires lib="gtk+" version="3.12"/>
<template class="MctUserControls" parent="GtkBin">
<child>
<object class="HdyPreferencesPage">
<object class="AdwPreferencesPage">
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<child>
<object class="GtkLabel" id="description_label">
<property name="wrap">True</property>
@ -19,10 +19,10 @@
<!-- Application Usage Restrictions -->
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Application Usage Restrictions</property>
<child>
<object class="HdyActionRow" id="restrict_web_browsers_row">
<object class="AdwActionRow" id="restrict_web_browsers_row">
<property name="title" translatable="yes">Restrict _Web Browsers</property>
<property name="use_underline">True</property>
<property name="activatable_widget">restrict_web_browsers_switch</property>
@ -43,7 +43,7 @@
</child>
<child>
<object class="HdyActionRow" id="restrict_applications_row">
<object class="AdwActionRow" id="restrict_applications_row">
<property name="activatable">True</property>
<property name="title" translatable="yes">_Restrict Applications</property>
<property name="use_underline">True</property>
@ -66,10 +66,10 @@
<!-- Software Installation Restrictions -->
<child>
<object class="HdyPreferencesGroup">
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Software Installation Restrictions</property>
<child>
<object class="HdyActionRow" id="restrict_software_installation_row">
<object class="AdwActionRow" id="restrict_software_installation_row">
<property name="visible" bind-source="restrict_software_installation_switch" bind-property="visible" bind-flags="default|sync-create" />
<property name="title" translatable="yes">Restrict Application _Installation</property>
<property name="use_underline">True</property>
@ -91,7 +91,7 @@
</child>
<child>
<object class="HdyActionRow">
<object class="AdwActionRow">
<property name="title" translatable="yes">Application _Suitability</property>
<property name="use_underline">True</property>
<property name="activatable_widget">oars_button</property>