Commit 79295b62 authored by Felipe Borges's avatar Felipe Borges
Browse files

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
parent a739ebf3
......@@ -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")));
}
<?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>
Markdown is supported
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