Rename FlightMode to OfflineMode
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 20 Jan 2009 16:44:01 +0000 (17:44 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 20 Jan 2009 16:44:01 +0000 (17:44 +0100)
doc/manager-api.txt
src/connman.h
src/device.c
src/manager.c
test/test-manager

index bf3d1de..5ff5f6a 100644 (file)
@@ -57,15 +57,15 @@ Properties  string State [readonly]
                        device defines which becomes the default connection
                        when multiple are available.
 
-               boolean FlightMode [readwrite]
+               boolean OfflineMode [readwrite]
 
-                       The flight mode indicates the global setting for
-                       switching all radios on or off. Changing flight mode
+                       The offline mode indicates the global setting for
+                       switching all radios on or off. Changing offline mode
                        to true results in powering down all devices. When
-                       leaving flight mode the individual policy of each
+                       leaving offline mode the individual policy of each
                        device decides to switch the radio back on or not.
 
-                       During flight mode, it is still possible to switch
+                       During offline mode, it is still possible to switch
                        certain technologies manually back on. For example
                        the limited usage of WiFi or Bluetooth devices might
                        be allowed in some situations.
index 545183e..b944465 100644 (file)
@@ -163,7 +163,7 @@ void __connman_device_decrease_connections(struct connman_device *device);
 
 connman_bool_t __connman_device_has_driver(struct connman_device *device);
 
-int __connman_device_set_flightmode(connman_bool_t flightmode);
+int __connman_device_set_offlinemode(connman_bool_t offlinemode);
 
 #include <connman/network.h>
 
index d107bf4..f9c153d 100644 (file)
@@ -1159,10 +1159,10 @@ const char *connman_device_get_string(struct connman_device *device,
        return NULL;
 }
 
-static void set_flightmode(struct connman_element *element, gpointer user_data)
+static void set_offlinemode(struct connman_element *element, gpointer user_data)
 {
        struct connman_device *device = element->device;
-       connman_bool_t flightmode = GPOINTER_TO_UINT(user_data);
+       connman_bool_t offlinemode = GPOINTER_TO_UINT(user_data);
        connman_bool_t powered;
 
        DBG("element %p name %s", element, element->name);
@@ -1170,7 +1170,7 @@ static void set_flightmode(struct connman_element *element, gpointer user_data)
        if (device == NULL)
                return;
 
-       powered = (flightmode == TRUE) ? FALSE : TRUE;
+       powered = (offlinemode == TRUE) ? FALSE : TRUE;
 
        if (device->powered == powered)
                return;
@@ -1178,12 +1178,12 @@ static void set_flightmode(struct connman_element *element, gpointer user_data)
        set_powered(device, powered);
 }
 
-int __connman_device_set_flightmode(connman_bool_t flightmode)
+int __connman_device_set_offlinemode(connman_bool_t offlinemode)
 {
-       DBG("flightmode %d", flightmode);
+       DBG("offlinmode %d", offlinemode);
 
        __connman_element_foreach(NULL, CONNMAN_ELEMENT_TYPE_DEVICE,
-                               set_flightmode, GUINT_TO_POINTER(flightmode));
+                       set_offlinemode, GUINT_TO_POINTER(offlinemode));
 
        return 0;
 }
index f943720..a2f1be8 100644 (file)
@@ -35,7 +35,7 @@ enum connman_policy {
 };
 
 static enum connman_policy global_policy = CONNMAN_POLICY_SINGLE;
-static connman_bool_t global_flightmode = FALSE;
+static connman_bool_t global_offlinemode = FALSE;
 
 static const char *policy2string(enum connman_policy policy)
 {
@@ -185,8 +185,8 @@ static DBusMessage *get_properties(DBusConnection *conn,
                connman_dbus_dict_append_variant(&dict, "Policy",
                                                DBUS_TYPE_STRING, &str);
 
-       connman_dbus_dict_append_variant(&dict, "FlightMode",
-                                       DBUS_TYPE_BOOLEAN, &global_flightmode);
+       connman_dbus_dict_append_variant(&dict, "OfflineMode",
+                               DBUS_TYPE_BOOLEAN, &global_offlinemode);
 
        dbus_message_iter_close_container(&array, &dict);
 
@@ -222,17 +222,17 @@ static DBusMessage *set_property(DBusConnection *conn,
                        return __connman_error_invalid_arguments(msg);
 
                global_policy = policy;
-       } else if (g_str_equal(name, "FlightMode") == TRUE) {
-               connman_bool_t flightmode;
+       } else if (g_str_equal(name, "OfflineMode") == TRUE) {
+               connman_bool_t offlinemode;
 
-               dbus_message_iter_get_basic(&value, &flightmode);
+               dbus_message_iter_get_basic(&value, &offlinemode);
 
-               if (global_flightmode == flightmode)
+               if (global_offlinemode == offlinemode)
                        return __connman_error_invalid_arguments(msg);
 
-               global_flightmode = flightmode;
+               global_offlinemode = offlinemode;
 
-               __connman_device_set_flightmode(flightmode);
+               __connman_device_set_offlinemode(offlinemode);
        }
 
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
index e9f1231..7915eaf 100755 (executable)
@@ -54,7 +54,7 @@ def print_properties(key, value):
 for key in properties.keys():
        if key in ["Profiles", "Devices", "Connections"]:
                print_properties(key, properties[key])
-       elif key in ["FlightMode"]:
+       elif key in ["OfflineMode"]:
                print "%s" % (key)
                if properties[key] == dbus.Boolean(1):
                        print "    true"