diff options
author | Gotam Gorabh <gautamy672@gmail.com> | 2023-04-09 00:36:18 +0530 |
---|---|---|
committer | Felipe Borges <felipeborges@gnome.org> | 2023-04-12 13:47:31 +0000 |
commit | 8cb77b4d3acbba3b37b0e7b52c3c14a85fac1666 (patch) | |
tree | 9c24efdc904acb9d50e162df259e5379f8458034 | |
parent | 14b3652289df4f7d1a44c9607a3880916ef74a56 (diff) | |
download | gnome-control-center-8cb77b4d3acbba3b37b0e7b52c3c14a85fac1666.tar.gz |
sharing:removed global master switch
These changes remove the global master switch from
sharing panel and set main_list_box active.
Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2415
-rw-r--r-- | panels/sharing/cc-sharing-panel.c | 38 | ||||
-rw-r--r-- | panels/sharing/cc-sharing-panel.ui | 9 |
2 files changed, 0 insertions, 47 deletions
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c index 4a6245b73..baf12d153 100644 --- a/panels/sharing/cc-sharing-panel.c +++ b/panels/sharing/cc-sharing-panel.c @@ -65,7 +65,6 @@ struct _CcSharingPanel GtkWidget *hostname_entry; GtkWidget *main_list_box; - GtkWidget *master_switch; GtkWidget *media_sharing_dialog; GtkWidget *media_sharing_headerbar; GtkWidget *media_sharing_row; @@ -115,31 +114,9 @@ struct _CcSharingPanel CC_PANEL_REGISTER (CcSharingPanel, cc_sharing_panel) -#define OFF_IF_VISIBLE(x, y) { if (gtk_widget_is_visible(x) && (y) != NULL && gtk_widget_is_sensitive(y)) gtk_switch_set_active (GTK_SWITCH(y), FALSE); } - static gboolean store_remote_desktop_credentials_timeout (gpointer user_data); static void -cc_sharing_panel_master_switch_notify (CcSharingPanel *self) -{ - gboolean active; - - active = gtk_switch_get_active (GTK_SWITCH (self->master_switch)); - - if (!active) - { - /* disable all services if the master switch is not active */ - OFF_IF_VISIBLE(self->media_sharing_row, self->media_sharing_switch); - OFF_IF_VISIBLE(self->personal_file_sharing_row, self->personal_file_sharing_switch); - OFF_IF_VISIBLE(self->remote_desktop_row, self->remote_desktop_switch); - - gtk_switch_set_active (GTK_SWITCH (self->remote_login_switch), FALSE); - } - - gtk_widget_set_sensitive (self->main_list_box, active); -} - -static void cc_sharing_panel_dispose (GObject *object) { CcSharingPanel *self = CC_SHARING_PANEL (object); @@ -261,7 +238,6 @@ cc_sharing_panel_class_init (CcSharingPanelClass *klass) gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, hostname_entry); gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, shared_folders_grid); - gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, master_switch); gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, main_list_box); gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, media_sharing_dialog); gtk_widget_class_bind_template_child (widget_class, CcSharingPanel, media_sharing_headerbar); @@ -324,10 +300,6 @@ cc_sharing_panel_switch_to_label_transform_func (GBinding *binding, else g_value_set_string (target_value, C_("service is disabled", "Off")); - /* ensure the master switch is active if one of the services is active */ - if (active) - gtk_switch_set_active (GTK_SWITCH (self->master_switch), TRUE); - return TRUE; } @@ -361,10 +333,6 @@ cc_sharing_panel_networks_to_label_transform_func (GBinding *binding, return FALSE; } - /* ensure the master switch is active if one of the services is active */ - if (status != CC_SHARING_STATUS_OFF) - gtk_switch_set_active (GTK_SWITCH (self->master_switch), TRUE); - return TRUE; } @@ -1425,12 +1393,6 @@ cc_sharing_panel_init (CcSharingPanel *self) g_signal_connect (self->remote_desktop_dialog, "response", G_CALLBACK (gtk_widget_hide), NULL); - /* start the panel in the disabled state */ - gtk_switch_set_active (GTK_SWITCH (self->master_switch), FALSE); - gtk_widget_set_sensitive (self->main_list_box, FALSE); - g_signal_connect_object (self->master_switch, "notify::active", - G_CALLBACK (cc_sharing_panel_master_switch_notify), self, G_CONNECT_SWAPPED); - gsd_sharing_proxy_new_for_bus (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, "org.gnome.SettingsDaemon.Sharing", diff --git a/panels/sharing/cc-sharing-panel.ui b/panels/sharing/cc-sharing-panel.ui index 846a5c787..54846def7 100644 --- a/panels/sharing/cc-sharing-panel.ui +++ b/panels/sharing/cc-sharing-panel.ui @@ -2,15 +2,6 @@ <interface> <template class="CcSharingPanel" parent="CcPanel"> - <child type="titlebar-end"> - <object class="GtkSwitch" id="master_switch"> - <property name="valign">center</property> - <accessibility> - <property name="label" translatable="yes">Sharing</property> - </accessibility> - </object> - </child> - <child type="content"> <object class="AdwPreferencesPage" id="sharing_panel"> <child> |