Use a more KNF style.
authorRoy Marples <roy@marples.name>
Wed, 11 Feb 2009 22:33:15 +0000 (22:33 +0000)
committerRoy Marples <roy@marples.name>
Wed, 11 Feb 2009 22:33:15 +0000 (22:33 +0000)
main.c
menu.c
wpa.c

diff --git a/main.c b/main.c
index 1c715adc6e2be377e6070e65df52192d925d9b95..3c42c88a541c45ce717685b3345c20ea784c6af3 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,28 +1,28 @@
-/*
- * dhcpcd-gtk
- * Copyright 2009 Roy Marples <roy@marples.name>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
+=/*
 * dhcpcd-gtk
 * Copyright 2009 Roy Marples <roy@marples.name>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
 
 /* TODO: Animate the icon from carrier -> address
  * maybe use network-idle -> network-transmit ->
@@ -123,20 +123,20 @@ error_exit(const char *msg, GError *error)
        if (error) {
                g_critical("%s: %s", msg, error->message);
                dialog = gtk_message_dialog_new(NULL,
-                                               0,
-                                               GTK_MESSAGE_ERROR,
-                                               GTK_BUTTONS_CLOSE,
-                                               "%s: %s",
-                                               msg,
-                                               error->message);
+                   0,
+                   GTK_MESSAGE_ERROR,
+                   GTK_BUTTONS_CLOSE,
+                   "%s: %s",
+                   msg,
+                   error->message);
        } else {
                g_critical("%s", msg);
                dialog = gtk_message_dialog_new(NULL,
-                                               0,
-                                               GTK_MESSAGE_ERROR,
-                                               GTK_BUTTONS_CLOSE,
-                                               "%s",
-                                               msg);
+                   0,
+                   GTK_MESSAGE_ERROR,
+                   GTK_BUTTONS_CLOSE,
+                   "%s",
+                   msg);
        }
        gtk_dialog_run(GTK_DIALOG(dialog));
        gtk_widget_destroy(dialog);
@@ -162,8 +162,8 @@ get_scan_results(struct if_msg *ifm)
        otype = dbus_g_type_get_collection("GPtrArray", otype);
 
        if (!dbus_g_proxy_call(dbus, "ScanResults", &error,
-                              G_TYPE_STRING, ifm->ifname, G_TYPE_INVALID,
-                              otype, &array, G_TYPE_INVALID))
+               G_TYPE_STRING, ifm->ifname, G_TYPE_INVALID,
+               otype, &array, G_TYPE_INVALID))
                error_exit(_("ScanResults"), error);
 
        for (i = 0; i < array->len; i++) {
@@ -273,7 +273,7 @@ print_if_msg(const struct if_msg *ifm)
                                        reason = N_("Disassociated from");
                                        showssid = TRUE;
                                } else
-                                   reason = N_("Not associated");
+                                       reason = N_("Not associated");
                        } else
                                reason = N_("Cable unplugged");
                        showip = FALSE;
@@ -401,7 +401,7 @@ update_online(void)
                        ani_timer = g_timeout_add(500, animate_carrier, NULL);
                } else {
                        gtk_status_icon_set_from_icon_name(status_icon,
-                                                          "network-offline");
+                           "network-offline");
                }
        }
        gtk_status_icon_set_tooltip(status_icon, msgs);
@@ -434,9 +434,9 @@ notify(const char *title, const char *msg, const char *icon)
                notify_notification_close(nn, NULL);
        if (gtk_status_icon_get_visible(status_icon))
                nn = notify_notification_new_with_status_icon(title,
-                                                             msg,
-                                                             icon,
-                                                             status_icon);
+                   msg,
+                   icon,
+                   status_icon);
        else
                nn = notify_notification_new(title, msg, icon, NULL);
        notify_notification_set_timeout(nn, 5000);
@@ -541,8 +541,8 @@ dhcpcd_get_interfaces()
        otype = dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE);
        otype = dbus_g_type_get_map("GHashTable", G_TYPE_STRING, otype);
        if (!dbus_g_proxy_call(dbus, "GetInterfaces", &error,
-                              G_TYPE_INVALID,
-                              otype, &ifs, G_TYPE_INVALID))
+               G_TYPE_INVALID,
+               otype, &ifs, G_TYPE_INVALID))
                error_exit("GetInterfaces", error);
        g_hash_table_foreach(ifs, foreach_make_ifm, NULL);
        g_hash_table_unref(ifs);
@@ -552,8 +552,8 @@ dhcpcd_get_interfaces()
        g_strfreev(interface_order);
        interface_order = NULL;
        if (!dbus_g_proxy_call(dbus, "ListInterfaces", &error,
-                              G_TYPE_INVALID,
-                              G_TYPE_STRV, &interface_order, G_TYPE_INVALID))
+               G_TYPE_INVALID,
+               G_TYPE_STRV, &interface_order, G_TYPE_INVALID))
                error_exit("ListInterfaces", error);
        interfaces = g_list_sort(interfaces, if_msg_comparer);
 
@@ -564,8 +564,8 @@ dhcpcd_get_interfaces()
                if (!ifm->wireless)
                        continue;
                if (!dbus_g_proxy_call(dbus, "ScanResults", &error,
-                                      G_TYPE_STRING, ifm->ifname, G_TYPE_INVALID,
-                                      otype, &array, G_TYPE_INVALID)) 
+                       G_TYPE_STRING, ifm->ifname, G_TYPE_INVALID,
+                       otype, &array, G_TYPE_INVALID)) 
                {
                        g_message("ScanResults: %s", error->message);
                        g_clear_error(&error);
@@ -618,8 +618,8 @@ check_status(const char *status)
        if (!refresh)
                return;
        if (!dbus_g_proxy_call(dbus, "GetDhcpcdVersion", &error,
-                              G_TYPE_INVALID,
-                              G_TYPE_STRING, &version, G_TYPE_INVALID))
+               G_TYPE_INVALID,
+               G_TYPE_STRING, &version, G_TYPE_INVALID))
                error_exit(_("GetDhcpcdVersion"), error);
        g_message(_("Connected to %s-%s"), "dhcpcd", version);
        g_free(version);
@@ -705,21 +705,21 @@ main(int argc, char *argv[])
        if (bus == NULL || error != NULL)
                error_exit(_("Could not connect to system bus"), error);
        dbus = dbus_g_proxy_new_for_name(bus,
-                                             DHCPCD_SERVICE,
-                                             DHCPCD_PATH,
-                                             DHCPCD_SERVICE);
+           DHCPCD_SERVICE,
+           DHCPCD_PATH,
+           DHCPCD_SERVICE);
 
        g_message(_("Connecting to dhcpcd-dbus ..."));
        while (--tries > 0) {
                g_clear_error(&error);
                if (dbus_g_proxy_call_with_timeout(dbus,
-                                                  "GetVersion",
-                                                  500,
-                                                  &error,
-                                                  G_TYPE_INVALID,
-                                                  G_TYPE_STRING,
-                                                  &version,
-                                                  G_TYPE_INVALID))
+                       "GetVersion",
+                       500,
+                       &error,
+                       G_TYPE_INVALID,
+                       G_TYPE_STRING,
+                       &version,
+                       G_TYPE_INVALID))
                        break;
        }
        if (tries == 0)
@@ -732,28 +732,28 @@ main(int argc, char *argv[])
        menu_init(status_icon);
 
        if (!dbus_g_proxy_call(dbus, "GetStatus", &error,
-                              G_TYPE_INVALID,
-                              G_TYPE_STRING, &version, G_TYPE_INVALID))
+               G_TYPE_INVALID,
+               G_TYPE_STRING, &version, G_TYPE_INVALID))
                error_exit(_("GetStatus"), error);
        check_status(version);
        g_free(version);
 
        otype = dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE);
        dbus_g_proxy_add_signal(dbus, "Event",
-                               otype, G_TYPE_INVALID);
+           otype, G_TYPE_INVALID);
        dbus_g_proxy_connect_signal(dbus, "Event",
-                                   G_CALLBACK(dhcpcd_event),
-                                   bus, NULL);
+           G_CALLBACK(dhcpcd_event),
+           bus, NULL);
        dbus_g_proxy_add_signal(dbus, "StatusChanged",
-                               G_TYPE_STRING, G_TYPE_INVALID);
+           G_TYPE_STRING, G_TYPE_INVALID);
        dbus_g_proxy_connect_signal(dbus, "StatusChanged",
-                                   G_CALLBACK(dhcpcd_status),
-                                   bus, NULL);
+           G_CALLBACK(dhcpcd_status),
+           bus, NULL);
        dbus_g_proxy_add_signal(dbus, "ScanResults",
-                               G_TYPE_STRING, G_TYPE_INVALID);
+           G_TYPE_STRING, G_TYPE_INVALID);
        dbus_g_proxy_connect_signal(dbus, "ScanResults",
-                                   G_CALLBACK(dhcpcd_scan_results),
-                                   bus, NULL);
+           G_CALLBACK(dhcpcd_scan_results),
+           bus, NULL);
 
        gtk_main();
        return 0;
diff --git a/menu.c b/menu.c
index a826c9f34fe6d6d6cdd7a41a8cc3a7ff5844fdee..cf15f4d6eb4112e458d8df615686074375bc8b55 100644 (file)
--- a/menu.c
+++ b/menu.c
 
 static const char *copyright = "Copyright (c) 2009 Roy Marples";
 
-static const char *authors[] = {
-       "Roy Marples <roy@marples.name>",
-       NULL
-};
+static const char *authors[] = { "Roy Marples <roy@marples.name>", NULL };
 
 static void
 on_quit(_unused GtkMenuItem *item, _unused gpointer data)
@@ -84,13 +81,13 @@ on_about(_unused GtkMenuItem *item, _unused gpointer data)
        gtk_about_dialog_set_email_hook(email_hook, NULL, NULL);
        gtk_about_dialog_set_url_hook(url_hook, NULL, NULL);
        gtk_show_about_dialog(NULL,
-                             "version", VERSION,
-                             "copyright", copyright,
-                             "website-label", "dhcpcd Website",
-                             "website", "http://roy.marples.name/projects/dhcpcd",
-                             "authors", authors,
-                             "logo-icon-name", GTK_STOCK_NETWORK,
-                             NULL);
+           "version", VERSION,
+           "copyright", copyright,
+           "website-label", "dhcpcd Website",
+           "website", "http://roy.marples.name/projects/dhcpcd",
+           "authors", authors,
+           "logo-icon-name", GTK_STOCK_NETWORK,
+           NULL);
 }
 
 static void
@@ -120,7 +117,7 @@ add_scan_results(GtkMenu *menu, const struct if_msg *ifm)
                else
                        icon = "network-wireless-encrypted";
                image = gtk_image_new_from_icon_name(icon,
-                                                    GTK_ICON_SIZE_MENU);
+                   GTK_ICON_SIZE_MENU);
                gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
 
                bar = gtk_progress_bar_new();
@@ -139,7 +136,7 @@ add_scan_results(GtkMenu *menu, const struct if_msg *ifm)
                gtk_widget_show(image);
                gtk_widget_show(box);
                g_signal_connect(G_OBJECT(item), "activate",
-                               G_CALLBACK(ssid_hook), gl->data);
+                   G_CALLBACK(ssid_hook), gl->data);
                gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
        }
 }
@@ -180,7 +177,7 @@ on_activate(GtkStatusIcon *icon, _unused guint button, _unused guint32 atime, _u
 #if 0
                item = gtk_image_menu_item_new_with_label(ifm->name);
                image = gtk_image_new_from_icon_name("network-wireless",
-                                                    GTK_ICON_SIZE_MENU);
+                   GTK_ICON_SIZE_MENU);
                gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
 
                gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
@@ -188,8 +185,8 @@ on_activate(GtkStatusIcon *icon, _unused guint button, _unused guint32 atime, _u
        }
        gtk_widget_show_all(GTK_WIDGET(menu));
        gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-                      gtk_status_icon_position_menu, icon,
-                      1, gtk_get_current_event_time());
+           gtk_status_icon_position_menu, icon,
+           1, gtk_get_current_event_time());
 }
 
 static void
@@ -204,10 +201,10 @@ on_popup(GtkStatusIcon *icon, guint button, guint32 atime, gpointer data)
 
        item = gtk_image_menu_item_new_with_mnemonic(_("_Quit"));
        image = gtk_image_new_from_icon_name(GTK_STOCK_QUIT,
-                                            GTK_ICON_SIZE_MENU);
+           GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
        g_signal_connect(G_OBJECT(item), "activate",
-                        G_CALLBACK(on_quit), icon);
+           G_CALLBACK(on_quit), icon);
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 
        item = gtk_separator_menu_item_new();
@@ -215,23 +212,23 @@ on_popup(GtkStatusIcon *icon, guint button, guint32 atime, gpointer data)
 
        item = gtk_image_menu_item_new_with_mnemonic(_("_Help"));
        image = gtk_image_new_from_icon_name(GTK_STOCK_HELP,
-                                            GTK_ICON_SIZE_MENU);
+           GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
        g_signal_connect(G_OBJECT(item), "activate",
-                        G_CALLBACK(on_help), icon);
+           G_CALLBACK(on_help), icon);
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 
        item = gtk_image_menu_item_new_with_mnemonic(_("_About"));
        image = gtk_image_new_from_icon_name(GTK_STOCK_ABOUT,
-                                            GTK_ICON_SIZE_MENU);
+           GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
        g_signal_connect(G_OBJECT(item), "activate",
-                        G_CALLBACK(on_about), icon);
+           G_CALLBACK(on_about), icon);
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 
        gtk_widget_show_all(GTK_WIDGET(menu));
        gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
-                      gtk_status_icon_position_menu, data, button, atime);
+           gtk_status_icon_position_menu, data, button, atime);
        if (button == 0)
                gtk_menu_shell_select_first(GTK_MENU_SHELL(menu), FALSE);
 }
@@ -240,7 +237,7 @@ void
 menu_init(GtkStatusIcon *icon)
 {
        g_signal_connect_object(G_OBJECT(icon), "activate",
-                               G_CALLBACK(on_activate), icon, 0);
+           G_CALLBACK(on_activate), icon, 0);
        g_signal_connect_object(G_OBJECT(icon), "popup_menu",
-                               G_CALLBACK(on_popup), icon, 0);
+           G_CALLBACK(on_popup), icon, 0);
 }
diff --git a/wpa.c b/wpa.c
index ed68f18ed473f1e6dc46933d7eacb43a370e3d84..a90462ed5c96958963800d38c138c9ef1270e633 100644 (file)
--- a/wpa.c
+++ b/wpa.c
@@ -41,16 +41,16 @@ find_network(const char *ifname, const char *ssid)
        char *nssid;
 
        otype = dbus_g_type_get_struct("GValueArray",
-                       G_TYPE_INT,
-                       G_TYPE_STRING,
-                       G_TYPE_STRING,
-                       G_TYPE_STRING,
-                       G_TYPE_INVALID);
+           G_TYPE_INT,
+           G_TYPE_STRING,
+           G_TYPE_STRING,
+           G_TYPE_STRING,
+           G_TYPE_INVALID);
        otype = dbus_g_type_get_collection("GPtrArray", otype);
        error = NULL;
        if (!dbus_g_proxy_call(dbus, "ListNetworks", &error,
-                              G_TYPE_STRING, ifname, G_TYPE_INVALID,
-                              otype, &array, G_TYPE_INVALID))
+               G_TYPE_STRING, ifname, G_TYPE_INVALID,
+               otype, &array, G_TYPE_INVALID))
        {
                g_warning("ListNetworks: %s", error->message);
                g_error_free(error);
@@ -68,8 +68,8 @@ find_network(const char *ifname, const char *ssid)
        }
 
        if (!dbus_g_proxy_call(dbus, "AddNetwork", &error,
-                              G_TYPE_STRING, ifname, G_TYPE_INVALID,
-                              G_TYPE_INT, &id, G_TYPE_INVALID))
+               G_TYPE_STRING, ifname, G_TYPE_INVALID,
+               G_TYPE_INT, &id, G_TYPE_INVALID))
        {
                g_warning("AddNetwork: %s", error->message);
                g_error_free(error);
@@ -78,12 +78,12 @@ find_network(const char *ifname, const char *ssid)
 
        nssid = g_strconcat("\"", ssid, "\"", NULL);
        if (!dbus_g_proxy_call(dbus, "SetNetwork", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INT, id,
-                              G_TYPE_STRING, "ssid",
-                              G_TYPE_STRING, nssid,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
+               G_TYPE_STRING, ifname,
+               G_TYPE_INT, id,
+               G_TYPE_STRING, "ssid",
+               G_TYPE_STRING, nssid,
+               G_TYPE_INVALID,
+               G_TYPE_INVALID))
        {
                g_warning("SetNetwork: %s", error->message);
                g_free(nssid);
@@ -97,8 +97,8 @@ find_network(const char *ifname, const char *ssid)
 
 static int
 configure_network(const char *ifname, int id, const char *mgmt,
-               const char *var, const char *val,
-               gboolean quote)
+    const char *var, const char *val,
+    gboolean quote)
 {
        GError *error;
        char *str;
@@ -109,12 +109,12 @@ configure_network(const char *ifname, int id, const char *mgmt,
                return -1;
 
        dbus_g_proxy_call(dbus, "SetNetwork", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INT, id,
-                              G_TYPE_STRING, "key_mgmt",
-                              G_TYPE_STRING, mgmt,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID);
+           G_TYPE_STRING, ifname,
+           G_TYPE_INT, id,
+           G_TYPE_STRING, "key_mgmt",
+           G_TYPE_STRING, mgmt,
+           G_TYPE_INVALID,
+           G_TYPE_INVALID);
 
        error = NULL;
        if (quote)
@@ -122,23 +122,23 @@ configure_network(const char *ifname, int id, const char *mgmt,
        else
                str = NULL;
        if (!dbus_g_proxy_call(dbus, "SetNetwork", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INT, id,
-                              G_TYPE_STRING, var,
-                              G_TYPE_STRING, quote ? str : val,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
+               G_TYPE_STRING, ifname,
+               G_TYPE_INT, id,
+               G_TYPE_STRING, var,
+               G_TYPE_STRING, quote ? str : val,
+               G_TYPE_INVALID,
+               G_TYPE_INVALID))
        {
                g_warning("SetNetwork: %s", error->message);
                g_free(str);
                g_error_free(error);
                dialog = gtk_message_dialog_new(NULL,
-                               GTK_DIALOG_MODAL,
-                               GTK_MESSAGE_ERROR,
-                               GTK_BUTTONS_OK,
-                               _("Failed to set password, probably too short."));
+                   GTK_DIALOG_MODAL,
+                   GTK_MESSAGE_ERROR,
+                   GTK_BUTTONS_OK,
+                   _("Failed to set password, probably too short."));
                gtk_window_set_title(GTK_WINDOW(dialog),
-                               _("Error setting password"));
+                   _("Error setting password"));
                gtk_dialog_run(GTK_DIALOG(dialog));
                gtk_widget_destroy(dialog);
                return -1;
@@ -146,10 +146,10 @@ configure_network(const char *ifname, int id, const char *mgmt,
        g_free(str);
 
        if (!dbus_g_proxy_call(dbus, "EnableNetwork", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INT, id,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
+               G_TYPE_STRING, ifname,
+               G_TYPE_INT, id,
+               G_TYPE_INVALID,
+               G_TYPE_INVALID))
        {
                g_warning("EnableNetwork: %s", error->message);
                g_error_free(error);
@@ -157,39 +157,39 @@ configure_network(const char *ifname, int id, const char *mgmt,
        }
 
        if (!dbus_g_proxy_call(dbus, "SaveConfig", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
+               G_TYPE_STRING, ifname,
+               G_TYPE_INVALID,
+               G_TYPE_INVALID))
        {
                g_warning("SaveConfig: %s", error->message);
                if (!warned) {
                        warned = TRUE;
                        dialog = gtk_message_dialog_new(NULL,
-                                                       GTK_DIALOG_MODAL,
-                                                       GTK_MESSAGE_ERROR,
-                                                       GTK_BUTTONS_OK,
-                                                       _("Failed to save wpa_supplicant configuration.\n\nYou should add update_config=1 to /etc/wpa_supplicant.conf.\nThis warning will not appear again until program restarted."));
+                           GTK_DIALOG_MODAL,
+                           GTK_MESSAGE_ERROR,
+                           GTK_BUTTONS_OK,
+                           _("Failed to save wpa_supplicant configuration.\n\nYou should add update_config=1 to /etc/wpa_supplicant.conf.\nThis warning will not appear again until program restarted."));
                        gtk_window_set_title(GTK_WINDOW(dialog),
-                                            _("Error saving configuration"));
+                           _("Error saving configuration"));
                        gtk_dialog_run(GTK_DIALOG(dialog));
                        gtk_widget_destroy(dialog);
                }
                g_error_free(error);
        }
 /*
-       if (!dbus_g_proxy_call(dbus, "Disconnect", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
-       {
-               g_warning("Disconnect: %s", error->message);
-               g_error_free(error);
-       }
+  if (!dbus_g_proxy_call(dbus, "Disconnect", &error,
+  G_TYPE_STRING, ifname,
+  G_TYPE_INVALID,
+  G_TYPE_INVALID))
+  {
+  g_warning("Disconnect: %s", error->message);
+  g_error_free(error);
+  }
 */
        if (!dbus_g_proxy_call(dbus, "Reassociate", &error,
-                              G_TYPE_STRING, ifname,
-                              G_TYPE_INVALID,
-                              G_TYPE_INVALID))
+               G_TYPE_STRING, ifname,
+               G_TYPE_INVALID,
+               G_TYPE_INVALID))
        {
                g_warning("Reassociate: %s", error->message);
                g_error_free(error);
@@ -212,15 +212,15 @@ wpa_configure(const struct if_ap *ifa)
        gint result, id, retval;
 
        dialog = gtk_dialog_new_with_buttons(ifa->ssid,
-               NULL,
-               GTK_DIALOG_MODAL,
-               GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
-               GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
-               NULL);
+           NULL,
+           GTK_DIALOG_MODAL,
+           GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+           GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+           NULL);
        gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
        gtk_window_set_icon_name(GTK_WINDOW(dialog), "config-users");
        gtk_dialog_set_default_response(GTK_DIALOG(dialog),
-                                       GTK_RESPONSE_ACCEPT);
+           GTK_RESPONSE_ACCEPT);
        vbox = GTK_DIALOG(dialog)->vbox;
 
        hbox = gtk_hbox_new(FALSE, 2);
@@ -248,7 +248,7 @@ wpa_configure(const struct if_ap *ifa)
                }
                if (id != -1) {
                        retval = configure_network(ifa->ifname, id, mgt, var,
-                                       gtk_entry_get_text(GTK_ENTRY(psk)), TRUE);
+                           gtk_entry_get_text(GTK_ENTRY(psk)), TRUE);
                }
        }
        gtk_widget_destroy(dialog);