After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734422 - Enterprise toggle isn't shown
Enterprise toggle isn't shown
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: User Accounts
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Ondrej Holy
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-07 12:44 UTC by Ondrej Holy
Modified: 2014-08-15 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix enterprise toggle (7.91 KB, patch)
2014-08-07 12:51 UTC, Ondrej Holy
committed Details | Review
Screenshot (32.72 KB, image/png)
2014-08-07 12:52 UTC, Ondrej Holy
  Details
use GtkStack instead of GtkNotebook in Add user dialog (5.08 KB, patch)
2014-08-14 11:42 UTC, Ondrej Holy
needs-work Details | Review
use GtkStack instead of GtkNotebook in Add user dialog (4.87 KB, patch)
2014-08-15 15:23 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2014-08-07 12:44:53 UTC
Enterprise toggle isn't shown in Add user dialog and following errors are printed:

(gnome-control-center:3559): Gtk-CRITICAL **: gtk_container_remove: assertion 'gtk_widget_get_parent (widget) == GTK_WIDGET (container) || GTK_IS_ASSISTANT (container) || GTK_IS_ACTION_BAR (container)' failed

(gnome-control-center:3559): Gtk-CRITICAL **: gtk_box_pack: assertion 'gtk_widget_get_parent (child) == NULL' failed

It is because header bar buttons are used.
Comment 1 Ondrej Holy 2014-08-07 12:51:13 UTC
Created attachment 282807 [details] [review]
fix enterprise toggle

Don't add the toggle into the dialog action area.
Comment 2 Ondrej Holy 2014-08-07 12:52:54 UTC
Created attachment 282808 [details]
Screenshot

Screenshot with the change...
Comment 3 Bastien Nocera 2014-08-07 12:56:57 UTC
Review of attachment 282807 [details] [review]:

Rest looks good.

::: panels/user-accounts/data/account-dialog.ui
@@ +33,3 @@
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkNotebook" id="notebook">

Use GtkStack?
Comment 4 Ondrej Holy 2014-08-09 12:43:16 UTC
(In reply to comment #3)
> Review of attachment 282807 [details] [review]:
> 
> Rest looks good.

Thanks for the review!
 
> ::: panels/user-accounts/data/account-dialog.ui
> @@ +33,3 @@
> +        <property name="orientation">vertical</property>
> +        <child>
> +          <object class="GtkNotebook" id="notebook">
> 
> Use GtkStack?

I just rename existing GtkNotebook:

-          <object class="GtkNotebook" id="account-dialog">
...
+          <object class="GtkNotebook" id="notebook">

so I will transform the GtkNotebook to the GtkStack later in another commit (let the bug open until then).
Comment 5 Ondrej Holy 2014-08-14 11:42:40 UTC
Created attachment 283379 [details] [review]
use GtkStack instead of GtkNotebook in Add user dialog

The promised fix is here...
Comment 6 Bastien Nocera 2014-08-15 13:00:51 UTC
Review of attachment 283379 [details] [review]:

::: panels/user-accounts/um-account-dialog.c
@@ +1389,3 @@
+        switch (mode) {
+        case UM_LOCAL:
+                gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "_local");

Instead of this huge switch, define a separate array of strings:

static const char * const mode_pages[] = {
  "_local",
  "_enterprise",
  "_offline"
};

and use gtk_stack_set_visible_child_name (GTK_STACK (self->stack), mode_pages[mode]);
Comment 7 Ondrej Holy 2014-08-15 15:23:29 UTC
Created attachment 283514 [details] [review]
use GtkStack instead of GtkNotebook in Add user dialog

Thanks for the review, there is fixed one :-)
Comment 8 Bastien Nocera 2014-08-15 15:28:38 UTC
Review of attachment 283514 [details] [review]:

Looks good.
Comment 9 Ondrej Holy 2014-08-15 15:32:57 UTC
Comment on attachment 283514 [details] [review]
use GtkStack instead of GtkNotebook in Add user dialog

commit 3695f858dde4d91243885c853302d9b9b2f64bf2