summaryrefslogtreecommitdiff
path: root/invest-applet/invest/chart.py
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-02-08 16:11:05 +0100
committerinfirit <[email protected]>2014-02-08 17:26:53 +0100
commitdef0518872318b85e1663109323b64be2a7cdb9b (patch)
treeb7727696e2d378eec2d590cb14cc28d8f4c2d432 /invest-applet/invest/chart.py
parent1064eda20bcf6ec52be3c3e26cb9bde4b1016115 (diff)
downloadmate-applets-def0518872318b85e1663109323b64be2a7cdb9b.tar.bz2
mate-applets-def0518872318b85e1663109323b64be2a7cdb9b.tar.xz
invest-applet: fixed chart and prefs window, added chart scale option
- combo boxes printed their content twice - preferences dialog threw warning - added plot scale option to charts window - Replace GtkComboBox with GtkComboBoxText Based on gnome commit 766c9e1711330ec2b7109aa39ddd43b6583a30d3 Authot: Enrico Minack <[email protected]> Url: https://git.gnome.org/browse/gnome-applets/commit/?id=766c9e1711330ec2b7109aa39ddd43b6583a30d3
Diffstat (limited to 'invest-applet/invest/chart.py')
-rw-r--r--invest-applet/invest/chart.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/invest-applet/invest/chart.py b/invest-applet/invest/chart.py
index 044a2209..e12424a6 100644
--- a/invest-applet/invest/chart.py
+++ b/invest-applet/invest/chart.py
@@ -104,9 +104,15 @@ class FinancialChart:
def __init__(self, ui):
self.ui = ui
- #Time ranges of the plot
+ #Time ranges of the plot (parameter / combo-box t)
self.time_ranges = ["1d", "5d", "3m", "6m", "1y", "5y", "my"]
+ #plot types (parameter / combo-box q)
+ self.plot_types = ["l", "b", "c"]
+
+ #plot scales (parameter / combo-box l)
+ self.plot_scales = ["off", "on"]
+
# Window Properties
win = ui.get_object("window")
win.set_title(_("Financial Chart"))
@@ -119,7 +125,7 @@ class FinancialChart:
pass
# Defaut comboboxes values
- for widget in ["t", "q"]:
+ for widget in ["t", "q", "l"]:
ui.get_object(widget).set_active(0)
# Connect every option widget to its corresponding change signal
@@ -131,7 +137,7 @@ class FinancialChart:
"pe5","pe10", "pe20","pe50","pe100","pe200",
"pb","pp","ps","pv",
"ar","af","ap","aw","am","ass","afs","av","avm"), "toggled"),
- (("t", "q"), "changed"),
+ (("t", "q", "l"), "changed"),
(("s",), "activate"),
]:
for widget in widgets:
@@ -215,8 +221,8 @@ class FinancialChart:
url = chart_base_url % {
"s": tickers[0],
"t": self.time_ranges[self.ui.get_object("t").get_active()],
- "q": self.ui.get_object("q").get_active_text(),
- "l": "off",
+ "q": self.plot_types[self.ui.get_object("q").get_active()],
+ "l": self.plot_scales[self.ui.get_object("l").get_active()],
"z": "l",
"p": p,
"a": a,