network: Replace GtkNotebook with GtkStack
This commit is contained in:
parent
d163fb3f22
commit
fc25e17a9f
2 changed files with 17 additions and 22 deletions
|
@ -40,15 +40,9 @@
|
||||||
<property name="spacing">0</property>
|
<property name="spacing">0</property>
|
||||||
<property name="border_width">0</property>
|
<property name="border_width">0</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkNotebook" id="toplevel_notebook">
|
<object class="GtkStack" id="toplevel_stack">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="show_tabs">False</property>
|
|
||||||
<property name="show_border">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkNotebook" id="notebook">
|
<object class="GtkNotebook" id="notebook">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -56,10 +50,8 @@
|
||||||
<property name="show_border">False</property>
|
<property name="show_border">False</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox" id="add_connection_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="vexpand">True</property>
|
<property name="vexpand">True</property>
|
||||||
|
|
|
@ -51,6 +51,13 @@ struct _NetConnectionEditor
|
||||||
{
|
{
|
||||||
GtkDialog parent;
|
GtkDialog parent;
|
||||||
|
|
||||||
|
GtkBox *add_connection_box;
|
||||||
|
GtkFrame *add_connection_frame;
|
||||||
|
GtkButton *apply_button;
|
||||||
|
GtkButton *cancel_button;
|
||||||
|
GtkNotebook *notebook;
|
||||||
|
GtkStack *toplevel_stack;
|
||||||
|
|
||||||
GtkWidget *parent_window;
|
GtkWidget *parent_window;
|
||||||
NMClient *client;
|
NMClient *client;
|
||||||
NMDevice *device;
|
NMDevice *device;
|
||||||
|
@ -61,12 +68,6 @@ struct _NetConnectionEditor
|
||||||
gboolean is_changed;
|
gboolean is_changed;
|
||||||
NMAccessPoint *ap;
|
NMAccessPoint *ap;
|
||||||
|
|
||||||
GtkButton *cancel_button;
|
|
||||||
GtkButton *apply_button;
|
|
||||||
GtkNotebook *notebook;
|
|
||||||
GtkFrame *add_connection_frame;
|
|
||||||
GtkNotebook *toplevel_notebook;
|
|
||||||
|
|
||||||
GSList *initializing_pages;
|
GSList *initializing_pages;
|
||||||
GSList *pages;
|
GSList *pages;
|
||||||
|
|
||||||
|
@ -228,11 +229,13 @@ net_connection_editor_class_init (NetConnectionEditorClass *class)
|
||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/connection-editor.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/connection-editor.ui");
|
||||||
|
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, add_connection_box);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, add_connection_frame);
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, add_connection_frame);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, apply_button);
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, apply_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, cancel_button);
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, cancel_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, notebook);
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, notebook);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, toplevel_notebook);
|
gtk_widget_class_bind_template_child (widget_class, NetConnectionEditor, toplevel_stack);
|
||||||
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, delete_event_cb);
|
gtk_widget_class_bind_template_callback (widget_class, delete_event_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, cancel_clicked_cb);
|
gtk_widget_class_bind_template_callback (widget_class, cancel_clicked_cb);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, apply_clicked_cb);
|
gtk_widget_class_bind_template_callback (widget_class, apply_clicked_cb);
|
||||||
|
@ -623,7 +626,7 @@ finish_add_connection (NetConnectionEditor *self, NMConnection *connection)
|
||||||
frame = GTK_BIN (self->add_connection_frame);
|
frame = GTK_BIN (self->add_connection_frame);
|
||||||
gtk_widget_destroy (gtk_bin_get_child (frame));
|
gtk_widget_destroy (gtk_bin_get_child (frame));
|
||||||
|
|
||||||
gtk_notebook_set_current_page (self->toplevel_notebook, 0);
|
gtk_stack_set_visible_child (self->toplevel_stack, GTK_WIDGET (self->notebook));
|
||||||
gtk_widget_show (GTK_WIDGET (self->apply_button));
|
gtk_widget_show (GTK_WIDGET (self->apply_button));
|
||||||
|
|
||||||
if (connection)
|
if (connection)
|
||||||
|
@ -768,7 +771,7 @@ net_connection_editor_add_connection (NetConnectionEditor *self)
|
||||||
gtk_widget_show_all (GTK_WIDGET (list));
|
gtk_widget_show_all (GTK_WIDGET (list));
|
||||||
gtk_container_add (frame, GTK_WIDGET (list));
|
gtk_container_add (frame, GTK_WIDGET (list));
|
||||||
|
|
||||||
gtk_notebook_set_current_page (self->toplevel_notebook, 1);
|
gtk_stack_set_visible_child (self->toplevel_stack, GTK_WIDGET (self->add_connection_box));
|
||||||
gtk_widget_hide (GTK_WIDGET (self->apply_button));
|
gtk_widget_hide (GTK_WIDGET (self->apply_button));
|
||||||
gtk_window_set_title (GTK_WINDOW (self), _("Add VPN"));
|
gtk_window_set_title (GTK_WINDOW (self), _("Add VPN"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue