mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 00:30:17 +01:00
2004-10-15 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerDbus.c info-daemon/NetworkManagerInfoDbus.c - Display an error dialog when the user tries to use an "Other wireless network" that's not found. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@250 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
3b9dafe345
commit
b4b4d1a41a
5 changed files with 51 additions and 8 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2004-10-15 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/NetworkManagerDbus.c
|
||||
info-daemon/NetworkManagerInfoDbus.c
|
||||
- Display an error dialog when the user tries to use an
|
||||
"Other wireless network" that's not found.
|
||||
|
||||
2004-10-15 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* panel-applet/NMWirelessApplet.[ch]
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@ int main( int argc, char *argv[] )
|
|||
NMIAppInfo *app_info = NULL;
|
||||
GMainLoop *loop;
|
||||
guint notify_id;
|
||||
GError *error = NULL;
|
||||
|
||||
struct poptOption options[] =
|
||||
{
|
||||
|
|
@ -302,11 +301,9 @@ int main( int argc, char *argv[] )
|
|||
|
||||
gtk_main ();
|
||||
|
||||
|
||||
if (app_info->notification_icon_pid > 0)
|
||||
kill (app_info->notification_icon_pid, SIGTERM);
|
||||
|
||||
|
||||
gnome_client_set_restart_style (client, GNOME_RESTART_ANYWAY);
|
||||
|
||||
gconf_client_notify_remove (app_info->gconf_client, notify_id);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct NMIAppInfo
|
|||
/*
|
||||
GtkWidget *notification_icon;
|
||||
*/
|
||||
GPid notification_icon_pid;
|
||||
GPid notification_icon_pid;
|
||||
guint notification_icon_watch;
|
||||
guint notification_icon_respawn_counter;
|
||||
GTimer *notification_icon_respawn_timer;
|
||||
|
|
|
|||
|
|
@ -513,6 +513,16 @@ static DBusHandlerResult nmi_dbus_nmi_message_handler (DBusConnection *connectio
|
|||
if (GTK_WIDGET_VISIBLE (dialog))
|
||||
nmi_passphrase_dialog_cancel (info);
|
||||
}
|
||||
else if (strcmp ("networkNotFound", method) == 0)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
|
||||
"The requested wireless network does not appear to be in range."
|
||||
" Another wireless network will be used if one is available.", NULL);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
else if (strcmp ("getNetworks", method) == 0)
|
||||
reply_message = nmi_dbus_get_networks (info, message);
|
||||
else if (strcmp ("getNetworkTimestamp", method) == 0)
|
||||
|
|
|
|||
|
|
@ -214,6 +214,36 @@ static DBusMessage *nm_dbus_nm_get_active_device (DBusConnection *connection, DB
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_dbus_send_network_not_found
|
||||
*
|
||||
* Tell the info-daemon to alert the user that a requested network was
|
||||
* not found.
|
||||
*
|
||||
*/
|
||||
void nm_dbus_send_network_not_found (DBusConnection *connection, const char *network)
|
||||
{
|
||||
DBusMessage *message;
|
||||
|
||||
g_return_if_fail (connection != NULL);
|
||||
g_return_if_fail (network != NULL);
|
||||
|
||||
message = dbus_message_new_method_call (NMI_DBUS_SERVICE, NMI_DBUS_PATH,
|
||||
NMI_DBUS_INTERFACE, "networkNotFound");
|
||||
if (message == NULL)
|
||||
{
|
||||
syslog (LOG_ERR, "nm_dbus_send_network_not_found(): Couldn't allocate the dbus message");
|
||||
return;
|
||||
}
|
||||
|
||||
dbus_message_append_args (message, DBUS_TYPE_STRING, network, DBUS_TYPE_INVALID);
|
||||
if (!dbus_connection_send (connection, message, NULL))
|
||||
syslog (LOG_WARNING, "nm_dbus_send_network_not_found(): could not send dbus message");
|
||||
|
||||
dbus_message_unref (message);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_dbus_nm_set_active_device
|
||||
*
|
||||
|
|
@ -281,10 +311,7 @@ static DBusMessage *nm_dbus_nm_set_active_device (DBusConnection *connection, DB
|
|||
|
||||
/* If the user specificed a wireless network too, force that as well */
|
||||
if (nm_device_is_wireless (dev) && !nm_device_find_and_use_essid (dev, network))
|
||||
{
|
||||
reply_message = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE, "NetworkNotFound",
|
||||
"The requested wireless network is not in range.");
|
||||
}
|
||||
nm_dbus_send_network_not_found (data->dbus_connection, network);
|
||||
else
|
||||
{
|
||||
if (nm_try_acquire_mutex (data->user_device_mutex, __FUNCTION__))
|
||||
|
|
@ -295,6 +322,8 @@ static DBusMessage *nm_dbus_nm_set_active_device (DBusConnection *connection, DB
|
|||
nm_device_ref (data->user_device);
|
||||
nm_unlock_mutex (data->user_device_mutex, __FUNCTION__);
|
||||
}
|
||||
else
|
||||
nm_dbus_send_network_not_found (data->dbus_connection, network);
|
||||
}
|
||||
|
||||
/* Have to mark our state changed since we blew away our connection trying out
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue