[Xfce4-commits] <xfce4-weather-plugin:master> Add unit "International knots" for wind speed.

Harald Judt noreply at xfce.org
Tue Dec 4 21:14:03 CET 2012


Updating branch refs/heads/master
         to 5b16b92080b17cd630990c5b415e4753b9289bb1 (commit)
       from 3a13d47f11fedd66f651f76d4b1fdcd877054ac3 (commit)

commit 5b16b92080b17cd630990c5b415e4753b9289bb1
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue Dec 4 21:11:22 2012 +0100

    Add unit "International knots" for wind speed.

 panel-plugin/weather-config.c |    2 ++
 panel-plugin/weather-data.c   |    5 +++++
 panel-plugin/weather-data.h   |    3 ++-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index f77cba5..64885b1 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -700,6 +700,8 @@ create_units_page(xfceweather_dialog *dialog)
                     _("Miles per hour (mph)"));
     ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
                     _("Meters per second (m/s)"));
+    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
+                    _("International knots (kt)"));
     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
 
     /* precipitations */
diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 62edcb8..a30b062 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -148,6 +148,9 @@ get_data(const xml_time *timeslice,
         case MPH:
             val *= 2.2369362920544;
             break;
+        case KNOTS:
+            val *= 1.9438445;
+            break;
         }
         return g_strdup_printf(ROUND_TO_INT("%.1f"), val);
 
@@ -228,6 +231,8 @@ get_unit(const units_config *units,
             return _("mph");
         case MPS:
             return _("m/s");
+        case KNOTS:
+            return _("kt");
         }
     case WIND_DIRECTION_DEG:
     case LATITUDE:
diff --git a/panel-plugin/weather-data.h b/panel-plugin/weather-data.h
index b9dc488..3f96793 100644
--- a/panel-plugin/weather-data.h
+++ b/panel-plugin/weather-data.h
@@ -56,7 +56,8 @@ typedef enum {
 typedef enum {
     KMH,
     MPH,
-    MPS
+    MPS,
+    KNOTS
 } units_windspeed;
 
 typedef enum {


More information about the Xfce4-commits mailing list