[gnome-applets] invest: Use proper labels for the chart selection combo-box



commit a68d1b669f2f76595f6f7e259ec5b181d8cea641
Author: Callum McKenzie <callum spooky-possum org>
Date:   Thu Aug 27 22:53:53 2009 +1200

    invest: Use proper labels for the chart selection combo-box
    
    The previous version used URL fragments which were bad enough in
    English let alone any other language. Patch from Enrico Minack (bug
    582766/536224).

 invest-applet/data/financialchart.ui |   15 +++++++++------
 invest-applet/invest/chart.py        |    5 ++++-
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/invest-applet/data/financialchart.ui b/invest-applet/data/financialchart.ui
index aa8380f..13b92c6 100644
--- a/invest-applet/data/financialchart.ui
+++ b/invest-applet/data/financialchart.ui
@@ -7,22 +7,25 @@
     </columns>
     <data>
       <row>
-        <col id="0">1d</col>
+        <col id="0" translatable="yes">Today</col>
       </row>
       <row>
-        <col id="0">5d</col>
+        <col id="0" translatable="yes">5 Days</col>
       </row>
       <row>
-        <col id="0">3m</col>
+        <col id="0" translatable="yes">3 Months</col>
       </row>
       <row>
-        <col id="0">6m</col>
+        <col id="0" translatable="yes">6 Months</col>
       </row>
       <row>
-        <col id="0">1y</col>
+        <col id="0" translatable="yes">1 Year</col>
       </row>
       <row>
-        <col id="0">5y</col>
+        <col id="0" translatable="yes">5 Years</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Maximum</col>
       </row>
     </data>
   </object>
diff --git a/invest-applet/invest/chart.py b/invest-applet/invest/chart.py
index 99d9242..c6caff7 100644
--- a/invest-applet/invest/chart.py
+++ b/invest-applet/invest/chart.py
@@ -99,6 +99,9 @@ class FinancialChart:
 	def __init__(self, ui):
 		self.ui = ui
 		
+		#Time ranges of the plot
+		self.time_ranges = ["1d", "5d", "3m", "6m", "1y", "5y", "my"]
+		
 		# Window Properties
 		win = ui.get_object("window")
 		win.set_title(_("Financial Chart"))
@@ -206,7 +209,7 @@ class FinancialChart:
 		chart_base_url = "http://ichart.europe.yahoo.com/z?s=%(s)s&t=%(t)s&q=%(q)s&l=%(l)s&z=%(z)s&p=%(p)s&a=%(a)s%(opt)s"
 		url = chart_base_url % {
 			"s": tickers[0],
-			"t": self.ui.get_object("t").get_active_text(),
+			"t": self.time_ranges[self.ui.get_object("t").get_active()],
 			"q": self.ui.get_object("q").get_active_text(),
 			"l": "off",
 			"z": "l",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]