[gnome-control-center] sharing: Remove "Bluetooth" (Obex) sharing
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sharing: Remove "Bluetooth" (Obex) sharing
- Date: Thu, 30 Jul 2015 18:14:01 +0000 (UTC)
commit 9d45904f3c2e06240574145f9916686475497803
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jul 27 18:02:56 2015 +0200
sharing: Remove "Bluetooth" (Obex) sharing
It will be moved to the Bluetooth panel instead.
https://bugzilla.gnome.org/show_bug.cgi?id=740369
panels/sharing/Makefile.am | 3 +-
panels/sharing/cc-sharing-panel.c | 127 ------------------
panels/sharing/gnome-sharing-panel.desktop.in.in | 2 +-
panels/sharing/sharing.ui | 156 ----------------------
4 files changed, 2 insertions(+), 286 deletions(-)
---
diff --git a/panels/sharing/Makefile.am b/panels/sharing/Makefile.am
index cfbab9a..ec5cd3f 100644
--- a/panels/sharing/Makefile.am
+++ b/panels/sharing/Makefile.am
@@ -7,7 +7,6 @@ dbus_built_sources = org.gnome.SettingsDaemon.Sharing.c org.gnome.SettingsDaemon
AM_CPPFLAGS = \
$(PANEL_CFLAGS) \
$(SHARING_PANEL_CFLAGS) \
- $(BLUETOOTH_CFLAGS) \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
$(NULL)
@@ -53,7 +52,7 @@ $(dbus_built_sources) : Makefile.am org.gnome.SettingsDaemon.Sharing.xml
--generate-c-code org.gnome.SettingsDaemon.Sharing \
$(srcdir)/org.gnome.SettingsDaemon.Sharing.xml
-libsharing_la_LIBADD = $(PANEL_LIBS) $(SHARING_PANEL_LIBS) $(BLUETOOTH_LIBS)
+libsharing_la_LIBADD = $(PANEL_LIBS) $(SHARING_PANEL_LIBS)
libsharing_la_LDFLAGS = $(PANEL_LDFLAGS)
libexec_PROGRAMS = cc-remote-login-helper
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index 694a52f..ddc1420 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -76,7 +76,6 @@ struct _CcSharingPanelPrivate
GtkWidget *personal_file_sharing_switch;
GtkWidget *screen_sharing_switch;
- GtkWidget *bluetooth_sharing_dialog;
GtkWidget *media_sharing_dialog;
GtkWidget *personal_file_sharing_dialog;
GtkWidget *remote_login_dialog;
@@ -134,12 +133,6 @@ cc_sharing_panel_dispose (GObject *object)
g_clear_object (&priv->rfkill);
g_clear_object (&priv->builder);
- if (priv->bluetooth_sharing_dialog)
- {
- gtk_widget_destroy (priv->bluetooth_sharing_dialog);
- priv->bluetooth_sharing_dialog = NULL;
- }
-
if (priv->media_sharing_dialog)
{
gtk_widget_destroy (priv->media_sharing_dialog);
@@ -361,116 +354,6 @@ cc_sharing_panel_bind_switch_to_widgets (GtkWidget *gtkswitch,
va_end (w);
}
-static gboolean
-bluetooth_get_accept_files (GValue *value,
- GVariant *variant,
- gpointer user_data)
-{
- gboolean bonded;
-
- bonded = g_str_equal (g_variant_get_string (variant, NULL), "bonded");
-
- g_value_set_boolean (value, bonded);
-
- return TRUE;
-}
-
-static GVariant *
-bluetooth_set_accept_files (const GValue *value,
- const GVariantType *type,
- gpointer user_data)
-{
- if (g_value_get_boolean (value))
- return g_variant_new_string ("bonded");
- else
- return g_variant_new_string ("ask");
-}
-
-static gboolean
-get_boolean_property (GDBusProxy *proxy,
- const char *name)
-{
- GVariant *v;
- gboolean ret;
-
- v = g_dbus_proxy_get_cached_property (proxy, name);
- ret = g_variant_get_boolean (v);
- g_variant_unref (v);
-
- return ret;
-}
-
-static void
-bluetooth_state_changed (CcSharingPanel *self)
-{
- CcSharingPanelPrivate *priv = self->priv;
- gboolean state;
-
- state = get_boolean_property (priv->rfkill, "BluetoothHasAirplaneMode");
- if (!state)
- {
- gtk_widget_hide (WID ("bluetooth-sharing-button"));
- return;
- }
-
- if (get_boolean_property (priv->rfkill, "BluetoothAirplaneMode") ||
- get_boolean_property (priv->rfkill, "BluetoothHardwareAirplaneMode"))
- {
- gtk_widget_hide (WID ("bluetooth-sharing-button"));
- return;
- }
-
- gtk_widget_show (WID ("bluetooth-sharing-button"));
-}
-
-static void
-cc_sharing_panel_setup_bluetooth_sharing_dialog (CcSharingPanel *self)
-{
- CcSharingPanelPrivate *priv = self->priv;
- GSettings *settings;
-
- priv->rfkill = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- "org.gnome.SettingsDaemon.Rfkill",
- "/org/gnome/SettingsDaemon/Rfkill",
- "org.gnome.SettingsDaemon.Rfkill",
- NULL, NULL);
- if (!priv->rfkill)
- {
- /* No rfkill, not Linux */
- gtk_widget_hide (WID ("bluetooth-sharing-button"));
- return;
- }
-
- /* get the initial state */
- bluetooth_state_changed (self);
-
- g_signal_connect_swapped (priv->rfkill, "g-properties-changed",
- G_CALLBACK (bluetooth_state_changed), self);
-
- cc_sharing_panel_bind_switch_to_label (self,
- WID ("save-received-files-to-downloads-switch"),
- WID ("bluetooth-sharing-status-label"));
-
- cc_sharing_panel_bind_switch_to_widgets (WID ("save-received-files-to-downloads-switch"),
- WID ("receive-files-grid"),
- NULL);
-
- settings = g_settings_new (FILE_SHARING_SCHEMA_ID);
- g_settings_bind (settings, "bluetooth-obexpush-enabled",
- WID ("save-received-files-to-downloads-switch"), "active",
- G_SETTINGS_BIND_DEFAULT);
-
- g_settings_bind_with_mapping (settings, "bluetooth-accept-files",
- WID ("only-receive-from-trusted-devices-switch"),
- "active",
- G_SETTINGS_BIND_DEFAULT,
- bluetooth_get_accept_files,
- bluetooth_set_accept_files, NULL, NULL);
-
-}
-
static void
cc_sharing_panel_add_folder (GtkListBox *box,
GtkListBoxRow *row,
@@ -1188,7 +1071,6 @@ cc_sharing_panel_init (CcSharingPanel *self)
GError *err = NULL;
gchar *objects[] = {
"sharing-panel",
- "bluetooth-sharing-dialog",
"media-sharing-dialog",
"personal-file-sharing-dialog",
"remote-login-dialog",
@@ -1216,15 +1098,12 @@ cc_sharing_panel_init (CcSharingPanel *self)
priv->hostname_cancellable = g_cancellable_new ();
- priv->bluetooth_sharing_dialog = WID ("bluetooth-sharing-dialog");
priv->media_sharing_dialog = WID ("media-sharing-dialog");
priv->personal_file_sharing_dialog = WID ("personal-file-sharing-dialog");
priv->remote_login_dialog = WID ("remote-login-dialog");
priv->remote_login_cancellable = g_cancellable_new ();
priv->screen_sharing_dialog = WID ("screen-sharing-dialog");
- g_signal_connect (priv->bluetooth_sharing_dialog, "response",
- G_CALLBACK (gtk_widget_hide), NULL);
g_signal_connect (priv->media_sharing_dialog, "response",
G_CALLBACK (gtk_widget_hide), NULL);
g_signal_connect (priv->personal_file_sharing_dialog, "response",
@@ -1266,12 +1145,6 @@ cc_sharing_panel_init (CcSharingPanel *self)
g_error_free (error);
}
- /* bluetooth */
- if (cc_sharing_panel_check_schema_available (self, FILE_SHARING_SCHEMA_ID))
- cc_sharing_panel_setup_bluetooth_sharing_dialog (self);
- else
- gtk_widget_hide (WID ("bluetooth-sharing-button"));
-
/* media sharing */
cc_sharing_panel_setup_media_sharing_dialog (self);
diff --git a/panels/sharing/gnome-sharing-panel.desktop.in.in
b/panels/sharing/gnome-sharing-panel.desktop.in.in
index c3c278c..bfbb8cb 100644
--- a/panels/sharing/gnome-sharing-panel.desktop.in.in
+++ b/panels/sharing/gnome-sharing-panel.desktop.in.in
@@ -11,4 +11,4 @@ Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-Sys
OnlyShowIn=GNOME;Unity;
X-GNOME-Settings-Panel=sharing
# Translators: those are keywords for the sharing control-center panel
-_Keywords=share;sharing;ssh;host;name;remote;desktop;bluetooth;obex;media;audio;video;pictures;photos;movies;server;renderer;
+_Keywords=share;sharing;ssh;host;name;remote;desktop;media;audio;video;pictures;photos;movies;server;renderer;
diff --git a/panels/sharing/sharing.ui b/panels/sharing/sharing.ui
index bb4c75e..385b0ba 100644
--- a/panels/sharing/sharing.ui
+++ b/panels/sharing/sharing.ui
@@ -2,124 +2,6 @@
<!-- Generated with glade 3.18.1 -->
<interface>
<requires lib="gtk+" version="3.10"/>
- <object class="GtkDialog" id="bluetooth-sharing-dialog">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Bluetooth Sharing</property>
- <property name="resizable">False</property>
- <property name="type_hint">dialog</property>
- <property name="use_header_bar">1</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox6">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_start">12</property>
- <property name="margin_end">6</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Bluetooth Sharing allows you to share files with
other Bluetooth enabled devices</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="receive-files-grid">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="hexpand">True</property>
- <property name="label" translatable="yes">Only Receive From Trusted Devices</property>
- <property name="mnemonic_widget">only-receive-from-trusted-devices-switch</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="only-receive-from-trusted-devices-switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Save Received Files to Downloads Folder</property>
- <property name="mnemonic_widget">save-received-files-to-downloads-switch</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="save-received-files-to-downloads-switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
<object class="GtkBox" id="sharing-panel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -174,44 +56,6 @@
<object class="GtkListBox" id="main-list-box">
<property name="visible">True</property>
<child>
- <object class="GtkListBoxRow" id="bluetooth-sharing-button">
- <property name="visible">True</property>
- <child>
- <object class="GtkBox" id="box1">
- <property name="border-width">12</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="hexpand">True</property>
- <property translatable="yes" name="label">Bluetooth Sharing</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="bluetooth-sharing-status-label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">Off</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
<object class="GtkListBoxRow" id="personal-file-sharing-button">
<property name="visible">True</property>
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]