[gnome-applets/wip/gnome-3.10+: 10/29] invest-applet: update applet
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/gnome-3.10+: 10/29] invest-applet: update applet
- Date: Thu, 28 Aug 2014 15:51:14 +0000 (UTC)
commit 9572fe4e867b5b395fae3c4fdcf5ab248c098ad7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Jul 6 20:48:07 2014 +0300
invest-applet: update applet
invest-applet/data/financialchart.ui | 132 ++++++++++++++++++-----------
invest-applet/data/invest-applet-menu.xml | 25 +++++-
invest-applet/data/prefs-dialog.ui | 31 ++++---
invest-applet/invest/__init__.py | 57 ++++---------
invest-applet/invest/applet.py | 44 ++++++----
invest-applet/invest/preferences.py | 2 +-
invest-applet/invest/quotes.py | 2 +-
invest-applet/invest/widgets.py | 2 +-
8 files changed, 166 insertions(+), 129 deletions(-)
---
diff --git a/invest-applet/data/financialchart.ui b/invest-applet/data/financialchart.ui
index d7d8095..bb4c95a 100644
--- a/invest-applet/data/financialchart.ui
+++ b/invest-applet/data/financialchart.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
<interface>
- <!-- interface-requires gtk+ 2.12 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkWindow" id="window">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -11,12 +12,14 @@
<property name="destroy_with_parent">True</property>
<property name="icon_name">stock_chart</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkBox" id="hbox1">
+ <property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -48,10 +51,11 @@
</child>
<child>
<object class="GtkCheckButton" id="autorefresh">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<child>
@@ -61,7 +65,8 @@
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
- <object class="GtkHBox" id="hbox5">
+ <object class="GtkBox" id="hbox5">
+ <property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
@@ -151,7 +156,7 @@
</object>
<packing>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
@@ -165,7 +170,7 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
@@ -179,22 +184,24 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkBox" id="hbox3">
<property name="visible">True</property>
+ <property name="orientation">horizontal</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="pe5">
<property name="label" translatable="yes">5</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -207,11 +214,12 @@
<child>
<object class="GtkCheckButton" id="pe10">
<property name="label" translatable="yes">10</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -223,11 +231,12 @@
<child>
<object class="GtkCheckButton" id="pe20">
<property name="label" translatable="yes">20</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -240,11 +249,12 @@
<child>
<object class="GtkCheckButton" id="pe50">
<property name="label" translatable="yes">50</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -256,11 +266,12 @@
<child>
<object class="GtkCheckButton" id="pe100">
<property name="label" translatable="yes">100</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -272,11 +283,12 @@
<child>
<object class="GtkCheckButton" id="pe200">
<property name="label" translatable="yes">200</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -306,21 +318,23 @@
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkBox" id="hbox4">
<property name="visible">True</property>
+ <property name="orientation">horizontal</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="pb">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://biz.yahoo.com/charts/guide13.html and
http://en.wikipedia.org/wiki/Bollinger_bands">Bollinger</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -333,11 +347,12 @@
<child>
<object class="GtkCheckButton" id="pp">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://biz.yahoo.com/charts/guide16.html and
http://en.wikipedia.org/wiki/Parabolic_SAR">SAR</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -349,11 +364,12 @@
<child>
<object class="GtkCheckButton" id="ps">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://biz.yahoo.com/charts/guide6.html and
http://en.wikipedia.org/wiki/Stock_split">Splits</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -365,11 +381,12 @@
<child>
<object class="GtkCheckButton" id="pv">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://biz.yahoo.com/charts/guide20.html and
http://en.wikipedia.org/wiki/Volume_%28finance%29">Volumes</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -400,7 +417,7 @@
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
@@ -412,45 +429,48 @@
<child>
<object class="GtkCheckButton" id="ar">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Relative_Strength_Index">RSI</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="av">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Volume_%28finance%29">Vol</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="af">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Money_flow_index">MFI</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -458,17 +478,18 @@
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ass">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Stochastic_oscillator">Slow stoch</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -478,17 +499,18 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="avm">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Volume_%28finance%29">Vol+MA</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -497,34 +519,36 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ap">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Rate_of_change_%28technical_analysis%29">ROC</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="afs">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Stochastic_oscillator">Fast stoch</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -533,17 +557,18 @@
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="aw">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/Williams_%25R">W%R</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -553,23 +578,24 @@
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="am">
<property name="label" translatable="yes" comments="Please keep this term short. For
its meaning, see http://en.wikipedia.org/wiki/MACD">MACD</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
+ <property name="y_options"/>
</packing>
</child>
</object>
@@ -583,18 +609,20 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">horizontal</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="pm5">
<property name="label" translatable="yes">5</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -606,11 +634,12 @@
<child>
<object class="GtkCheckButton" id="pm10">
<property name="label" translatable="yes">10</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -622,11 +651,12 @@
<child>
<object class="GtkCheckButton" id="pm20">
<property name="label" translatable="yes">20</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -639,11 +669,12 @@
<child>
<object class="GtkCheckButton" id="pm50">
<property name="label" translatable="yes">50</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -655,11 +686,12 @@
<child>
<object class="GtkCheckButton" id="pm100">
<property name="label" translatable="yes">100</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -671,11 +703,12 @@
<child>
<object class="GtkCheckButton" id="pm200">
<property name="label" translatable="yes">200</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -695,8 +728,9 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox6">
+ <object class="GtkBox" id="hbox6">
<property name="visible">True</property>
+ <property name="orientation">horizontal</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBoxText" id="q">
@@ -800,7 +834,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">stock_chart</property>
- <property name="icon-size">5</property>
+ <property name="icon_size">5</property>
</object>
</child>
</object>
diff --git a/invest-applet/data/invest-applet-menu.xml b/invest-applet/data/invest-applet-menu.xml
index d4a3e61..344180e 100644
--- a/invest-applet/data/invest-applet-menu.xml
+++ b/invest-applet/data/invest-applet-menu.xml
@@ -1,5 +1,20 @@
-<menuitem name="Refresh" action="Refresh" />
-<menuitem name="Prefs" action="Prefs" />
-<separator/>
-<menuitem name="About" action="About" />
-<menuitem name="Help" action="Help" />
+<section>
+ <item>
+ <attribute name="label" translatable="yes">Refresh</attribute>
+ <attribute name="action">invest.refresh</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Preferences</attribute>
+ <attribute name="action">invest.preferences</attribute>
+ </item>
+</section>
+<section>
+ <item>
+ <attribute name="label" translatable="yes">Help</attribute>
+ <attribute name="action">invest.help</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">About</attribute>
+ <attribute name="action">invest.about</attribute>
+ </item>
+</section>
diff --git a/invest-applet/data/prefs-dialog.ui b/invest-applet/data/prefs-dialog.ui
index ae3c5c7..67ab247 100644
--- a/invest-applet/data/prefs-dialog.ui
+++ b/invest-applet/data/prefs-dialog.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="preferences">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -25,10 +26,10 @@
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -40,11 +41,11 @@
<child>
<object class="GtkButton" id="close">
<property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -62,14 +63,16 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="big_box">
+ <object class="GtkBox" id="big_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
+ <property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
- <object class="GtkVBox" id="loaded_extensions_box">
+ <object class="GtkBox" id="loaded_extensions_box">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="explanation">
@@ -111,8 +114,9 @@
<property name="bottom_padding">18</property>
<property name="left_padding">18</property>
<child>
- <object class="GtkVBox" id="vbox156">
+ <object class="GtkBox" id="vbox156">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
@@ -142,7 +146,8 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkBox" id="hbox1">
+ <property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -150,10 +155,10 @@
<child>
<object class="GtkButton" id="addstock">
<property name="label">gtk-add</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -165,10 +170,10 @@
<child>
<object class="GtkButton" id="addgroup">
<property name="label" translatable="yes" context=" " comments="Instead of
adding a single stock to the list of stocks, the 'Add Group' button adds a group (kind of a sub folder) to
which numerous stocks can be added. A group here refers to a group of stocks.">Add Group</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
</object>
<packing>
<property name="expand">True</property>
@@ -179,10 +184,10 @@
<child>
<object class="GtkButton" id="remove">
<property name="label">gtk-remove</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -201,12 +206,12 @@
<child>
<object class="GtkCheckButton" id="indexexpansion">
<property name="label" translatable="yes" comments="An index value (for instance
the NASDAQ Composite) is based on a number of stocks. This option allows to also show the quotes of the
stocks an index is based on. ">Show stocks of index values</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">An index value, for instance
the <i>NASDAQ Composite</i> (^IXIC), is based on a number of stocks. This option allows to also
show the quotes of the <i><b>stocks</b></i> an index is based on.</property>
- <property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -220,11 +225,11 @@
<child>
<object class="GtkCheckButton" id="hidecharts">
<property name="label" translatable="yes">Hide charts in quotes list</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">A small chart image is shown
next to each quote. The retrieval of each chart image causes network traffic. Hiding charts reduces the
network bandwidth demand significantly.</property>
- <property name="use_action_appearance">False</property>
<property name="relief">none</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -305,7 +310,7 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
diff --git a/invest-applet/invest/__init__.py b/invest-applet/invest/__init__.py
index 986284d..6ae6ec7 100644
--- a/invest-applet/invest/__init__.py
+++ b/invest-applet/invest/__init__.py
@@ -2,7 +2,7 @@ import os, sys, traceback
from os.path import join, exists, isdir, isfile, dirname, abspath, expanduser
from types import ListType
import datetime
-from gi.repository import GObject, Gtk, Gdk, GConf
+from gi.repository import GObject, Gio, Gtk, Gdk
import cPickle
import networkmanager
@@ -51,7 +51,7 @@ else:
BUILDER_DATA_DIR = BUILDERDIR
ART_DATA_DIR = SHARED_DATA_DIR
-USER_INVEST_DIR = expanduser("~/.gnome2/invest-applet")
+USER_INVEST_DIR = expanduser("~/.config/gnome-applets/invest-applet")
if not exists(USER_INVEST_DIR):
try:
os.makedirs(USER_INVEST_DIR, 0744)
@@ -63,19 +63,6 @@ if not exists(USER_INVEST_DIR):
# when presenting save/open dialogs
os.chdir(expanduser("~"))
-#Gconf client
-GCONF_CLIENT = GConf.Client.get_default()
-
-# GConf directory for invest in window mode and shared settings
-GCONF_DIR = "/apps/invest"
-
-# GConf key for list of enabled handlers, when uninstalled, use a debug key to not conflict
-# with development version
-#GCONF_ENABLED_HANDLERS = GCONF_DIR + "/enabled_handlers"
-
-# Preload gconf directories
-#GCONF_CLIENT.add_dir(GCONF_DIR, gconf.CLIENT_PRELOAD_RECURSIVE)
-
# tests whether the given stocks are in the old labelless format
def labelless_stock_format(stocks):
if len(stocks) == 0:
@@ -191,32 +178,27 @@ PROXY = None
# borrowed from Ross Burton
# http://burtonini.com/blog/computers/postr
# extended by exception handling and retry scheduling
-def get_gnome_proxy(client):
- sleep = 10 # sleep between attempts for 10 seconds
- attempts = 3 # try to get configuration from gconf at most three times
- get_gnome_proxy_retry(client, attempts, sleep)
-
-def get_gnome_proxy_retry(client, attempts, sleep):
- # decrease attempts counter
- attempts -= 1
-
+def get_gnome_proxy():
# sanity check if we still need to look for proxy configuration
global PROXY
if PROXY != None:
return
- # try to get config from gconfd
+ # try to get config from gsettings
try:
- if client.get_bool("/system/http_proxy/use_http_proxy"):
- host = client.get_string("/system/http_proxy/host")
- port = client.get_int("/system/http_proxy/port")
+ proxy_settings = Gio.Settings.new("org.gnome.system.proxy")
+ proxy_http_settings = Gio.Settings.new("org.gnome.system.proxy.http")
+
+ if proxy_settings.get_enum("mode") == 1:
+ host = proxy_http_settings.get_string("host")
+ port = proxy_http_settings.get_int("port")
if host is None or host == "" or port == 0:
# gnome proxy is not valid, stop here
return
- if client.get_bool("/system/http_proxy/use_authentication"):
- user = client.get_string("/system/http_proxy/authentication_user")
- password = client.get_string("/system/http_proxy/authentication_password")
+ if proxy_http_settings.get_boolean("use-authentication"):
+ user = proxy_http_settings.get_string("authentication-user")
+ password = proxy_http_settings.get_string("authentication-password")
if user and user != "":
url = "http://%s:%s %s:%d" % (user, password, host, port)
else:
@@ -228,16 +210,9 @@ def get_gnome_proxy_retry(client, attempts, sleep):
PROXY = {'http': url}
except Exception, msg:
- error("Failed to get proxy configuration from GConfd:\n%s" % msg)
- # we did not succeed, schedule retry
- if attempts > 0:
- error("Retrying to contact GConfd in %d seconds" % sleep)
- GObject.timeout_add(sleep * 1000, get_gnome_proxy_retry, client, attempts, sleep)
-
-# use gconf to get proxy config
-debug("Detecting proxy settings")
-client = GConf.Client.get_default()
-get_gnome_proxy(client)
+ error("Failed to get proxy configuration from GSettings:\n%s" % msg)
+
+get_gnome_proxy()
# connect to Network Manager to identify current network connectivity
diff --git a/invest-applet/invest/applet.py b/invest-applet/invest/applet.py
index ac013c2..6dfbd01 100644
--- a/invest-applet/invest/applet.py
+++ b/invest-applet/invest/applet.py
@@ -1,9 +1,6 @@
import os, time
from os.path import *
-
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, GConf, PanelApplet
-GObject.threads_init()
-
+from gi.repository import GObject, Gio, Gtk, Gdk, GdkPixbuf, PanelApplet
from gettext import gettext as _
import invest, invest.about, invest.chart, invest.preferences, invest.defs
@@ -20,17 +17,28 @@ class InvestApplet(PanelApplet.Applet):
invest.debug("init applet");
self.applet = applet
- # name, stock_id, label, accellerator, tooltip, callback
- menu_actions = [("About", Gtk.STOCK_HELP, _("About"), None, None, self.on_about),
- ("Help", Gtk.STOCK_HELP, _("Help"), None, None, self.on_help),
- ("Prefs", Gtk.STOCK_PREFERENCES, _("Preferences"), None, None,
self.on_preferences),
- ("Refresh", Gtk.STOCK_REFRESH, _("Refresh"), None, None, self.on_refresh)
- ]
- actiongroup = Gtk.ActionGroup.new("InvestAppletActions")
- actiongroup.set_translation_domain(invest.defs.GETTEXT_PACKAGE)
- actiongroup.add_actions(menu_actions, None)
+ actiongroup = Gio.SimpleActionGroup.new()
+
+ action = Gio.SimpleAction.new("about", None)
+ action.connect("activate", self.on_about)
+ actiongroup.add_action(action)
+
+ action = Gio.SimpleAction.new("help", None)
+ action.connect("activate", self.on_help)
+ actiongroup.add_action(action)
+
+ action = Gio.SimpleAction.new("preferences", None)
+ action.connect("activate", self.on_preferences)
+ actiongroup.add_action(action)
+
+ action = Gio.SimpleAction.new("refresh", None)
+ action.connect("activate", self.on_refresh)
+ actiongroup.add_action(action)
+
self.applet.setup_menu_from_file (join(invest.defs.PKGDATADIR, "ui/invest-applet-menu.xml"),
- actiongroup);
+ actiongroup, invest.defs.GETTEXT_PACKAGE);
+
+ self.applet.insert_action_group ("invest", actiongroup);
evbox = Gtk.HBox()
self.applet_icon = Gtk.Image()
@@ -70,17 +78,17 @@ class InvestApplet(PanelApplet.Applet):
# c) Everything is normal: pop-up the window
self.ilw.toggle_show()
- def on_about(self, action, data):
+ def on_about(self, action, parameter):
invest.about.show_about()
- def on_help(self, action, data):
+ def on_help(self, action, parameter):
invest.help.show_help()
- def on_preferences(self, action, data):
+ def on_preferences(self, action, parameter):
invest.preferences.show_preferences(self)
self.reload_ilw()
- def on_refresh(self, action, data):
+ def on_refresh(self, action, parameter):
self.quotes_updater.refresh()
def set_applet_icon(self, change):
diff --git a/invest-applet/invest/preferences.py b/invest-applet/invest/preferences.py
index caff3c4..7bc30d1 100644
--- a/invest-applet/invest/preferences.py
+++ b/invest-applet/invest/preferences.py
@@ -1,7 +1,7 @@
from gettext import gettext as _
import locale
from os.path import join
-from gi.repository import GObject, Gtk, GConf
+from gi.repository import GObject, Gtk
import invest
import currencies
import cPickle
diff --git a/invest-applet/invest/quotes.py b/invest-applet/invest/quotes.py
index 767b6ea..e441838 100644
--- a/invest-applet/invest/quotes.py
+++ b/invest-applet/invest/quotes.py
@@ -1,5 +1,5 @@
from os.path import join, getmtime
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, GConf, PanelApplet
+from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, PanelApplet
from gettext import gettext as _
import csv
import locale
diff --git a/invest-applet/invest/widgets.py b/invest-applet/invest/widgets.py
index 3177b36..1721c26 100644
--- a/invest-applet/invest/widgets.py
+++ b/invest-applet/invest/widgets.py
@@ -1,6 +1,6 @@
import os, time
from os.path import *
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, GConf, PanelApplet, Pango
+from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, PanelApplet, Pango
from gettext import gettext as _
import locale
import csv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]