[gnome-control-center] region: Drop "restart" in-app notification
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Drop "restart" in-app notification
- Date: Mon, 10 Jul 2017 13:28:38 +0000 (UTC)
commit 79295b6260bb63f4dc89fe3565a6197cfeb21e81
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Jun 28 13:17:01 2017 +0200
region: Drop "restart" in-app notification
This changes are based on the mockups available at
https://wiki.gnome.org/Design/SystemSettings/RegionAndLanguage
https://bugzilla.gnome.org/show_bug.cgi?id=702351
panels/region/cc-region-panel.c | 28 ++------------------
panels/region/region.ui | 54 +--------------------------------------
2 files changed, 4 insertions(+), 78 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 0cf2214..d18a3fa 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -86,8 +86,6 @@ struct _CcRegionPanelPrivate {
GDBusProxy *session;
GCancellable *cancellable;
- GtkWidget *overlay;
- GtkWidget *notification;
GtkWidget *restart_notification;
GtkWidget *language_section;
@@ -208,8 +206,6 @@ restart_now (CcRegionPanel *self)
{
CcRegionPanelPrivate *priv = self->priv;
- gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->notification), FALSE);
-
g_dbus_proxy_call (priv->session,
"Logout",
g_variant_new ("(u)", 0),
@@ -229,7 +225,6 @@ show_restart_notification (CcRegionPanel *self,
setlocale (LC_MESSAGES, locale);
}
- gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification), TRUE);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->restart_notification), TRUE);
if (locale) {
@@ -238,14 +233,6 @@ show_restart_notification (CcRegionPanel *self,
}
}
-static void
-dismiss_notification (CcRegionPanel *self)
-{
- CcRegionPanelPrivate *priv = self->priv;
-
- gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification), FALSE);
-}
-
typedef struct {
CcRegionPanel *self;
int category;
@@ -648,7 +635,7 @@ setup_language_section (CcRegionPanel *self)
priv->formats_label = WID ("formats_label");
priv->restart_notification = WID ("restart-revealer");
- widget = WID ("restart-button1");
+ widget = WID ("restart-button");
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (restart_now), self);
widget = WID ("language_list");
@@ -1803,7 +1790,6 @@ static void
cc_region_panel_init (CcRegionPanel *self)
{
CcRegionPanelPrivate *priv;
- GtkWidget *button;
GError *error = NULL;
priv = self->priv = REGION_PANEL_PRIVATE (self);
@@ -1834,18 +1820,10 @@ cc_region_panel_init (CcRegionPanel *self)
session_proxy_ready,
self);
- priv->notification = GTK_WIDGET (gtk_builder_get_object (priv->builder, "notification"));
-
- button = GTK_WIDGET (gtk_builder_get_object (priv->builder, "restart-button"));
- g_signal_connect_swapped (button, "clicked", G_CALLBACK (restart_now), self);
-
- button = GTK_WIDGET (gtk_builder_get_object (priv->builder, "dismiss-button"));
- g_signal_connect_swapped (button, "clicked", G_CALLBACK (dismiss_notification), self);
-
setup_login_button (self);
setup_language_section (self);
setup_input_section (self);
- priv->overlay = GTK_WIDGET (gtk_builder_get_object (priv->builder, "overlay"));
- gtk_container_add (GTK_CONTAINER (self), priv->overlay);
+ gtk_container_add (GTK_CONTAINER (self),
+ GTK_WIDGET (gtk_builder_get_object (priv->builder, "vbox_region")));
}
diff --git a/panels/region/region.ui b/panels/region/region.ui
index 556fa7d..b28504f 100644
--- a/panels/region/region.ui
+++ b/panels/region/region.ui
@@ -1,56 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkOverlay" id="overlay">
- <property name="visible">True</property>
- <child type="overlay">
- <object class="GtkRevealer" id="notification">
- <property name="visible">True</property>
- <property name="halign">GTK_ALIGN_CENTER</property>
- <property name="valign">GTK_ALIGN_START</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="spacing">6</property>
- <style>
- <class name="app-notification"/>
- </style>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">30</property>
- <property name="label" translatable="yes">Your session needs to be restarted for changes
to take effect</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="restart-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="label" translatable="yes">Restart Now</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="dismiss-button">
- <property name="visible">True</property>
- <property name="valign">GTK_ALIGN_CENTER</property>
- <style>
- <class name="flat"/>
- </style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon_name">window-close-symbolic</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
<object class="GtkBox" id="vbox_region">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -148,7 +98,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="restart-button1">
+ <object class="GtkButton" id="restart-button">
<property name="visible">True</property>
<property name="margin_start">20</property>
<property name="margin_end">20</property>
@@ -560,6 +510,4 @@
</object>
</child>
</object>
- </child>
- </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]