[gnome-control-center/wip/feborges/new-users-panel: 13/18] user-accounts: Drop "Lock" button and add "Add User" button
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-users-panel: 13/18] user-accounts: Drop "Lock" button and add "Add User" button
- Date: Mon, 11 Jul 2016 12:53:27 +0000 (UTC)
commit 934c0d52092acad5dcc7ea5c58dd9be4854afb92
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Jun 29 14:33:33 2016 +0200
user-accounts: Drop "Lock" button and add "Add User" button
panels/user-accounts/um-user-panel.c | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
---
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index f323a04..58c8670 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -1322,14 +1322,6 @@ cc_user_panel_dispose (GObject *object)
G_OBJECT_CLASS (cc_user_panel_parent_class)->dispose (object);
}
-static GPermission *
-cc_user_panel_get_permission (CcPanel *panel)
-{
- CcUserPanelPrivate *priv = UM_USER_PANEL (panel)->priv;
-
- return priv->permission;
-}
-
static const char *
cc_user_panel_get_help_uri (CcPanel *panel)
{
@@ -1337,14 +1329,34 @@ cc_user_panel_get_help_uri (CcPanel *panel)
}
static void
+cc_user_panel_constructed (GObject *object)
+{
+ GtkWidget *button;
+ CcShell *shell;
+
+ G_OBJECT_CLASS (cc_user_panel_parent_class)->constructed (object);
+
+ shell = cc_panel_get_shell (CC_PANEL (object));
+
+ button = gtk_button_new_with_mnemonic (_("_Add User"));
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
+ gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
+ gtk_widget_set_visible (button, TRUE);
+
+ cc_shell_embed_widget_in_header (shell, button);
+
+ g_signal_connect (GTK_BUTTON (button), "clicked", G_CALLBACK (add_user), UM_USER_PANEL
(object)->priv);
+}
+
+static void
cc_user_panel_class_init (CcUserPanelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
object_class->dispose = cc_user_panel_dispose;
+ object_class->constructed = cc_user_panel_constructed;
- panel_class->get_permission = cc_user_panel_get_permission;
panel_class->get_help_uri = cc_user_panel_get_help_uri;
g_type_class_add_private (klass, sizeof (CcUserPanelPrivate));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]