Commit 69e6b73b authored by Magnus Boman's avatar Magnus Boman Committed by Federico Mena Quintero

bnc262334 - Correct network status even if NetworkManager is not running

2008-05-07  Magnus Boman  <captain.magnus@gmail.com>

	https://bugzilla.novell.com/show_bug.cgi?id=262334 -
	Show the correct status in the network status tile even if
	NetworkManager is not running.

	* main-menu/src/main-menu-ui.c (create_status_section): Remember
	our network_status widget in the MainMenuUIPrivate.
	(present_slab_window): Update the network tile.

	* main-menu/src/network-status-tile.c (network_tile_update_status):
	New function.

	* main-menu/src/network-status-agent.c (init_nm_connection):
	Handle the case where we obtained a NM client object, but NM is
	not running.
Signed-off-by: 's avatarFederico Mena Quintero <federico@gnu.org>

svn path=/trunk/; revision=454
parent e2cd6594
2008-05-07 Magnus Boman <captain.magnus@gmail.com>
https://bugzilla.novell.com/show_bug.cgi?id=262334 -
Show the correct status in the network status tile even if
NetworkManager is not running.
* main-menu/src/main-menu-ui.c (create_status_section): Remember
our network_status widget in the MainMenuUIPrivate.
(present_slab_window): Update the network tile.
* main-menu/src/network-status-tile.c (network_tile_update_status):
New function.
* main-menu/src/network-status-agent.c (init_nm_connection):
Handle the case where we obtained a NM client object, but NM is
not running.
2008-04-11 Tambet Ingo <tambet@gmail.com>
Adapt the API changes of libnm-glib.
......
......@@ -100,6 +100,7 @@ typedef struct {
GtkWidget *search_section;
GtkWidget *search_entry;
GtkWidget *network_status;
GtkNotebook *file_section;
GtkWidget *page_selectors [3];
......@@ -404,6 +405,7 @@ main_menu_ui_init (MainMenuUI *this)
priv->status_section = NULL;
priv->system_section = NULL;
priv->network_status = NULL;
priv->volume_mon = NULL;
......@@ -730,15 +732,15 @@ create_status_section (MainMenuUI *this)
ctnr = GTK_CONTAINER (glade_xml_get_widget (
priv->main_menu_xml, "network-status-container"));
tile = network_status_tile_new ();
priv->network_status = network_status_tile_new ();
gtk_widget_set_size_request (tile, 6 * icon_width, -1);
gtk_widget_set_size_request (priv->network_status, 6 * icon_width, -1);
g_signal_connect (
G_OBJECT (tile), "tile-action-triggered",
G_OBJECT (priv->network_status), "tile-action-triggered",
G_CALLBACK (tile_action_triggered_cb), this);
gtk_container_add (ctnr, tile);
gtk_container_add (ctnr, priv->network_status);
gtk_widget_show_all (GTK_WIDGET (ctnr));
priv->status_section = glade_xml_get_widget (
......@@ -1841,6 +1843,8 @@ present_slab_window (MainMenuUI *this)
{
MainMenuUIPrivate *priv = PRIVATE (this);
network_tile_update_status (priv->network_status);
update_recently_used_sections (this);
gtk_window_present_with_time (GTK_WINDOW (priv->slab_window), gtk_get_current_event_time ());
......
......@@ -131,7 +131,7 @@ init_nm_connection (NetworkStatusAgent * agent)
priv->nm_client = nm_client_new();
if (!priv->nm_client)
if (!(priv->nm_client && nm_client_get_manager_running (priv->nm_client)))
{
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "nm_client_new failed");
......
......@@ -363,6 +363,19 @@ tile_show_event_cb (GtkWidget * widget, gpointer user_data)
update_tile (tile);
}
void
network_tile_update_status (GtkWidget * widget)
{
NetworkStatusTile *tile = NETWORK_STATUS_TILE (widget);
NetworkStatusTilePrivate *priv = NETWORK_STATUS_TILE_GET_PRIVATE (tile);
if (priv->agent->nm_present)
return;
refresh_status (tile);
update_tile (tile);
}
static void
status_changed_cb (NetworkStatusAgent * agent, gpointer user_data)
{
......
......@@ -48,5 +48,7 @@ GType network_status_tile_get_type (void);
GtkWidget *network_status_tile_new (void);
void network_tile_update_status (GtkWidget * widget);
G_END_DECLS
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment