Description: Add modem connection speed to status window Author: Marc Deslauriers <marc.deslauriers@ubuntu.com> diff -Nur -x '*.orig' -x '*~' gnome-ppp-0.3.23/build-tree/gnome-ppp-0.3.23/gnome-ppp.glade gnome-ppp-0.3.23.new/build-tree/gnome-ppp-0.3.23/gnome-ppp.glade --- gnome-ppp-0.3.23/gnome-ppp.glade 2010-10-08 00:03:42.000000000 -0400 +++ gnome-ppp-0.3.23/gnome-ppp.glade 2010-10-08 00:04:00.000000000 -0400 @@ -2548,7 +2548,7 @@ <child> <widget class="GtkTable" id="table15"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="homogeneous">True</property> <property name="row_spacing">6</property> @@ -2602,9 +2602,9 @@ </child> <child> - <widget class="GtkLabel" id="label154"> + <widget class="GtkLabel" id="label160"> <property name="visible">True</property> - <property name="label" translatable="yes">Status:</property> + <property name="label" translatable="yes">Connection speed:</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2626,9 +2626,9 @@ </child> <child> - <widget class="GtkLabel" id="status"> + <widget class="GtkLabel" id="connect_speed"> <property name="visible">True</property> - <property name="label" translatable="yes">Idle</property> + <property name="label" translatable="yes">Unknown</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2644,15 +2644,14 @@ <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> - <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="label156"> + <widget class="GtkLabel" id="label154"> <property name="visible">True</property> - <property name="label" translatable="yes">Speed (download):</property> + <property name="label" translatable="yes">Status:</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2674,9 +2673,9 @@ </child> <child> - <widget class="GtkLabel" id="speed_in"> + <widget class="GtkLabel" id="status"> <property name="visible">True</property> - <property name="label" translatable="yes">0 Kb/s</property> + <property name="label" translatable="yes">Idle</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2698,9 +2697,9 @@ </child> <child> - <widget class="GtkLabel" id="label157"> + <widget class="GtkLabel" id="label156"> <property name="visible">True</property> - <property name="label" translatable="yes">Speed (upload):</property> + <property name="label" translatable="yes">Speed (download):</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2722,7 +2721,7 @@ </child> <child> - <widget class="GtkLabel" id="speed_out"> + <widget class="GtkLabel" id="speed_in"> <property name="visible">True</property> <property name="label" translatable="yes">0 Kb/s</property> <property name="use_underline">False</property> @@ -2743,6 +2742,54 @@ <property name="x_options">fill</property> <property name="y_options"></property> </packing> + </child> + + <child> + <widget class="GtkLabel" id="label157"> + <property name="visible">True</property> + <property name="label" translatable="yes">Speed (upload):</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="speed_out"> + <property name="visible">True</property> + <property name="label" translatable="yes">0 Kb/s</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> </child> </widget> </child> diff -Nur -x '*.orig' -x '*~' gnome-ppp-0.3.23/build-tree/gnome-ppp-0.3.23/src/gnome-ppp.h gnome-ppp-0.3.23.new/build-tree/gnome-ppp-0.3.23/src/gnome-ppp.h --- gnome-ppp-0.3.23/src/gnome-ppp.h 2005-05-03 19:29:31.000000000 -0400 +++ gnome-ppp-0.3.23/src/gnome-ppp.h 2010-10-08 00:04:00.000000000 -0400 @@ -177,6 +177,7 @@ GtkWidget *window; GtkWidget *interface; + GtkWidget *connect_speed; GtkWidget *status; GtkWidget *speed_in; GtkWidget *speed_out; diff -Nur -x '*.orig' -x '*~' gnome-ppp-0.3.23/build-tree/gnome-ppp-0.3.23/src/gnome-ppp-main.c gnome-ppp-0.3.23.new/build-tree/gnome-ppp-0.3.23/src/gnome-ppp-main.c --- gnome-ppp-0.3.23/src/gnome-ppp-main.c 2005-05-03 19:52:47.000000000 -0400 +++ gnome-ppp-0.3.23/src/gnome-ppp-main.c 2010-10-08 00:04:00.000000000 -0400 @@ -120,6 +120,7 @@ /* details window */ gnome_ppp.details.window = NULL; gnome_ppp.details.interface = NULL; + gnome_ppp.details.connect_speed = NULL; gnome_ppp.details.status = NULL; gnome_ppp.details.speed_in = NULL; gnome_ppp.details.speed_out = NULL; @@ -249,6 +250,7 @@ gnome_ppp.details.window = glade_xml_get_widget (gnome_ppp.xml, "details"); gtk_window_set_icon_from_file (GTK_WINDOW (gnome_ppp.details.window), icon, NULL); gnome_ppp.details.interface = glade_xml_get_widget (gnome_ppp.xml, "interface"); + gnome_ppp.details.connect_speed = glade_xml_get_widget (gnome_ppp.xml, "connect_speed"); gnome_ppp.details.status = glade_xml_get_widget (gnome_ppp.xml, "status"); gnome_ppp.details.speed_in = glade_xml_get_widget (gnome_ppp.xml, "speed_in"); gnome_ppp.details.speed_out = glade_xml_get_widget (gnome_ppp.xml, "speed_out"); diff -Nur -x '*.orig' -x '*~' gnome-ppp-0.3.23/build-tree/gnome-ppp-0.3.23/src/gnome-ppp-wvdial.c gnome-ppp-0.3.23.new/build-tree/gnome-ppp-0.3.23/src/gnome-ppp-wvdial.c --- gnome-ppp-0.3.23/src/gnome-ppp-wvdial.c 2010-10-08 00:03:42.000000000 -0400 +++ gnome-ppp-0.3.23/src/gnome-ppp-wvdial.c 2010-10-08 00:04:00.000000000 -0400 @@ -103,6 +103,12 @@ sscanf (line, "%s %s %s %s", tmp, tmp, tmp, iface); gtk_label_set_text (GTK_LABEL (gnome_ppp.details.interface), &iface[0]); } + if (g_strrstr (line, "CONNECT ") != NULL) { + gchar connect_speed[255]; + gchar tmp[255]; + sscanf (line, "%254s %254s", tmp, connect_speed); + gtk_label_set_text (GTK_LABEL (gnome_ppp.details.connect_speed), &connect_speed[0]); + } /* in case we are using auto reconnect */ if (g_strrstr (line, "--> Auto Reconnect") != NULL) { gtk_label_set_text (GTK_LABEL (gnome_ppp.connecting.msgs), _("Reconnecting..."));