[gnome-main-menu] main-menu: Remove unused code
- From: Stefano Karapetsas <stefanok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-main-menu] main-menu: Remove unused code
- Date: Wed, 12 Feb 2014 18:11:52 +0000 (UTC)
commit 916aadf08f193bea389c1a902a780f1a3506116e
Author: Stefano Karapetsas <stefano karapetsas com>
Date: Wed Feb 12 19:11:24 2014 +0100
main-menu: Remove unused code
main-menu/src/network-status-tile.c | 127 -----------------------------------
1 files changed, 0 insertions(+), 127 deletions(-)
---
diff --git a/main-menu/src/network-status-tile.c b/main-menu/src/network-status-tile.c
index 4bf2e5c..b82e05e 100644
--- a/main-menu/src/network-status-tile.c
+++ b/main-menu/src/network-status-tile.c
@@ -44,12 +44,8 @@ static void network_status_tile_open (Tile *, TileEvent *, TileAction *);
static void update_tile (NetworkStatusTile *);
static void refresh_status (NetworkStatusTile *);
-static void build_info_dialog (NetworkStatusTile *);
-static void update_info_dialog (NetworkStatusTile *);
-
static void tile_show_event_cb (GtkWidget *, gpointer);
static void status_changed_cb (NetworkStatusAgent *, gpointer);
-static void info_dialog_cfg_button_clicked_cb (GtkButton *, gpointer);
static void set_ui_label (GtkBuilder *, const gchar *, const gchar *);
static void launch_network_config (const gchar * desktop_key);
@@ -172,24 +168,6 @@ network_status_tile_open (Tile * tile, TileEvent * event, TileAction * action)
launch_network_config (NETWORK_CONFIG_TOOL_NM_KEY);
return;
}
-
- /* Using NM's glade file directly is a big maintenance problem. We need to get
- * NM to provide a API or .desktop file to show their status. For now just call the config
- if (!priv->info_dialog)
- build_info_dialog (NETWORK_STATUS_TILE (tile));
-
- if (!priv->info_dialog)
- {
- g_warning
- ("network_status_tile_open: could not find NetworkManager's applet.glade\n");
-
- return;
- }
-
- update_info_dialog (NETWORK_STATUS_TILE (tile));
-
- gtk_window_present_with_time (GTK_WINDOW (priv->info_dialog), event->time);
- */
}
static void
@@ -287,99 +265,6 @@ refresh_status (NetworkStatusTile * tile)
}
static void
-build_info_dialog (NetworkStatusTile * tile)
-{
- /*
- NetworkStatusTilePrivate *priv = NETWORK_STATUS_TILE_GET_PRIVATE (tile);
-
- gchar *filename;
-
- GtkWidget *close_button;
- GtkWidget *net_cfg_button;
-
- filename = g_build_filename (DATADIR, "nm-applet/applet.glade", NULL);
-
- if (!g_file_test (filename, G_FILE_TEST_EXISTS))
- return;
-
- priv->info_dialog_xml = glade_xml_new (filename, "info_dialog", "NetworkManager");
-
- priv->info_dialog = glade_xml_get_widget (priv->info_dialog_xml, "info_dialog");
-
- close_button = glade_xml_get_widget (priv->info_dialog_xml, "closebutton1");
- net_cfg_button = glade_xml_get_widget (priv->info_dialog_xml, "configure_button");
-
- g_signal_connect (priv->info_dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete),
- NULL);
-
- g_signal_connect_swapped (close_button, "clicked", G_CALLBACK (gtk_widget_hide),
- priv->info_dialog);
-
- g_signal_connect (net_cfg_button, "clicked", G_CALLBACK (info_dialog_cfg_button_clicked_cb),
- priv->info_dialog);
-
- g_free (filename);
- */
-}
-
-static void
-update_info_dialog (NetworkStatusTile * tile)
-{
- NetworkStatusTilePrivate *priv = NETWORK_STATUS_TILE_GET_PRIVATE (tile);
-
- GtkBuilder *ui = priv->info_dialog_ui;
-
- gchar *iface_and_type = NULL;
- gchar *speed = NULL;
-
- if (!priv->status_info)
- return;
-
- switch (priv->status_info->type)
- {
- case NM_DEVICE_TYPE_WIFI:
- iface_and_type =
- g_strdup_printf (_("Wireless Ethernet (%s)"), priv->status_info->iface);
- break;
-
- case NM_DEVICE_TYPE_ETHERNET:
- iface_and_type =
- g_strdup_printf (_("Wired Ethernet (%s)"), priv->status_info->iface);
- break;
-
- case NM_DEVICE_TYPE_MODEM:
- iface_and_type =
- g_strdup_printf (_("Mobile Ethernet (%s)"), priv->status_info->iface);
- break;
-
- default:
- iface_and_type = g_strdup_printf (_("Unknown"));
- break;
- }
-
- set_ui_label (ui, "label-interface", iface_and_type);
- g_free (iface_and_type);
-
- if (priv->status_info->speed_mbs)
- speed = g_strdup_printf (_("%d Mb/s"), priv->status_info->speed_mbs);
- else
- speed = g_strdup_printf (_("Unknown"));
-
- set_ui_label (ui, "label-speed", speed);
- g_free (speed);
-
- set_ui_label (ui, "label-driver", priv->status_info->driver);
- set_ui_label (ui, "label-ip-address", priv->status_info->ip4_addr);
- set_ui_label (ui, "label-broadcast-address", priv->status_info->broadcast);
- set_ui_label (ui, "label-subnet-mask", priv->status_info->subnet_mask);
- set_ui_label (ui, "label-default-route", priv->status_info->route);
- set_ui_label (ui, "label-primary-dns", priv->status_info->primary_dns);
- set_ui_label (ui, "label-secondary-dns", priv->status_info->secondary_dns);
- if (priv->status_info->hw_addr)
- set_ui_label (ui, "label-hardware-address", priv->status_info->hw_addr);
-}
-
-static void
tile_show_event_cb (GtkWidget * widget, gpointer user_data)
{
NetworkStatusTile *tile = NETWORK_STATUS_TILE (widget);
@@ -412,18 +297,6 @@ status_changed_cb (NetworkStatusAgent * agent, gpointer user_data)
}
static void
-info_dialog_cfg_button_clicked_cb (GtkButton * button, gpointer user_data)
-{
- /*
- GtkWidget *dialog = GTK_WIDGET (user_data);
-
- launch_network_config ();
-
- gtk_widget_hide (dialog);
- */
-}
-
-static void
set_ui_label (GtkBuilder * ui, const gchar * id, const gchar * text)
{
GtkLabel *label = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]