[gcalctool] Merge currency and units together, drop old financial conversion bar and use generic conversion bar



commit 03d59f15942fe84d00eec39fbc31323fbd629fae
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Jan 26 22:33:33 2011 +1000

    Merge currency and units together, drop old financial conversion bar and use generic conversion bar

 configure.ac              |    3 +-
 data/buttons-financial.ui | 2559 +++++++++++++++++++++++----------------------
 src/Makefile.am           |   10 +
 src/currency.c            |   41 +-
 src/currency.h            |    8 +-
 src/gcalctool.c           |    3 +-
 src/math-buttons.c        |  216 +----
 src/math-converter.c      |  497 ++++------
 src/math-converter.h      |   10 +-
 src/math-equation.c       |    5 +-
 src/unit-category.c       |  115 ++
 src/unit-category.h       |   43 +
 src/unit-manager.c        |  320 ++----
 src/unit-manager.h        |   13 +-
 src/unit.c                |  124 +++
 src/unit.h                |   42 +
 16 files changed, 2026 insertions(+), 1983 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c4f0454..37a034c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,8 @@ PKG_CHECK_MODULES(GCALCTOOL, [
 
 PKG_CHECK_MODULES(GCALCCMD, [
     glib-2.0
-    gobject-2.0
+    gio-2.0 >= $GIO_REQUIRED
+    libxml-2.0
 ])
 
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
diff --git a/data/buttons-financial.ui b/data/buttons-financial.ui
index 5de18ba..f998ed2 100644
--- a/data/buttons-financial.ui
+++ b/data/buttons-financial.ui
@@ -2,25 +2,73 @@
 <interface>
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkDialog" id="term_dialog">
+  <object class="GtkDialog" id="ctrm_dialog">
+    <property name="can_focus">False</property>
     <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Payment Period dialog">Payment Period</property>
+    <property name="title" translatable="yes" comments="Title of Compounding Term dialog">Compounding Term</property>
     <property name="resizable">False</property>
     <property name="type_hint">dialog</property>
     <signal name="response" handler="finc_response_cb" swapped="no"/>
     <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox9">
+      <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-cancel</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>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button2">
+                <property name="label" translatable="yes" comments="Compounding Term Dialog: Calculate button">C_alculate</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_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
-          <object class="GtkTable" id="table9">
+          <object class="GtkTable" id="table1">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkEntry" id="term_pint">
+              <object class="GtkEntry" id="ctrm_pint">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -30,13 +78,13 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="term_fv">
+              <object class="GtkEntry" id="ctrm_fv">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -52,7 +100,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="term_pmt">
+              <object class="GtkEntry" id="ctrm_pv">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -62,18 +110,19 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label43">
+              <object class="GtkLabel" id="label5">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
+                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before present value input">Present _Value:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">term_pint</property>
+                <property name="mnemonic_widget">ctrm_pv</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -83,64 +132,88 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label44">
+              <object class="GtkLabel" id="label6">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before future value input">Future _Value:</property>
+                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">term_fv</property>
+                <property name="mnemonic_widget">ctrm_pint</property>
               </object>
               <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label45">
+              <object class="GtkLabel" id="label9">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before periodic payment input">_Periodic Payment:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">term_pmt</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" comments="Compounding Term Dialog: Description of calculation">Calculates the number of compounding periods necessary to increase an investment of present value to a future value, at a fixed interest rate per compounding period.</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="right_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label46">
+              <object class="GtkLabel" id="label16">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Payment Period Dialog: Description of calculation">Calculates the number of payment periods that are necessary during the term of an ordinary annuity, to accumulate a future value, at a periodic interest rate.</property>
-                <property name="wrap">True</property>
+                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before future value input">_Future Value:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">ctrm_fv</property>
               </object>
               <packing>
-                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button1</action-widget>
+      <action-widget response="-5">button2</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="ddb_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Double-Declining Depreciation dialog">Double-Declining Depreciation</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area9">
+          <object class="GtkHButtonBox" id="dialog-action_area2">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button17">
+              <object class="GtkButton" id="button3">
                 <property name="label">gtk-cancel</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>
@@ -150,12 +223,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button18">
-                <property name="label" translatable="yes" comments="Payment Period Dialog: Button to calculate result">C_alculate</property>
+              <object class="GtkButton" id="button4">
+                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -167,71 +241,57 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button17</action-widget>
-      <action-widget response="-5">button18</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="syd_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Sum-of-the-Years'-Digits Depreciation dialog">Sum-of-the-Years'-Digits Depreciation</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox8">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table8">
+          <object class="GtkTable" id="table2">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
-            <property name="n_rows">5</property>
+            <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label37">
+              <object class="GtkLabel" id="label7">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before period input">_Period:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">syd_period</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Description of calculation">Calculates the depreciation allowance on an asset for a specified period of time, using the double-declining balance method.</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="right_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label38">
+              <object class="GtkLabel" id="label8">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before life input">_Life:</property>
+                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before cost input">C_ost:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">syd_life</property>
+                <property name="mnemonic_widget">ddb_cost</property>
               </object>
               <packing>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label39">
+              <object class="GtkLabel" id="label10">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before salvage input">_Salvage:</property>
+                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before life input">_Life:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">syd_salvage</property>
+                <property name="mnemonic_widget">ddb_life</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -241,22 +301,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label40">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before cost input">_Cost:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">syd_cost</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>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="syd_cost">
+              <object class="GtkEntry" id="ddb_life">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -266,13 +311,13 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="syd_salvage">
+              <object class="GtkEntry" id="ddb_cost">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -282,29 +327,29 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="syd_life">
+              <object class="GtkLabel" id="label11">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="invisible_char">â??</property>
-                <property name="text">0</property>
-                <signal name="activate" handler="finc_activate_cb" swapped="no"/>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before period input">_Period:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">ddb_period</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
                 <property name="top_attach">3</property>
                 <property name="bottom_attach">4</property>
+                <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="syd_period">
+              <object class="GtkEntry" id="ddb_period">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -314,40 +359,49 @@
               <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="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label41">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Description of calculation">Calculates the depreciation allowance on an asset for a specified period of time, using the Sum-of-the-Years'-Digits method. This method of depreciation accelerates the rate of depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The useful life is the number of periods, typically years, over which an asset is depreciated. </property>
-                <property name="wrap">True</property>
-              </object>
-              <packing>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
                 <property name="y_options"></property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button3</action-widget>
+      <action-widget response="-5">button4</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="fv_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Future Value dialog">Future Value</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area8">
+          <object class="GtkHButtonBox" id="dialog-action_area3">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button15">
+              <object class="GtkButton" id="button5">
                 <property name="label">gtk-cancel</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>
@@ -357,12 +411,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button16">
-                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Calculate result button">C_alculate</property>
+              <object class="GtkButton" id="button6">
+                <property name="label" translatable="yes" comments="Future Value Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -374,41 +429,41 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button15</action-widget>
-      <action-widget response="-5">button16</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="sln_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Straight-Line Depreciation dialog">Straight-Line Depreciation</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox7">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table7">
+          <object class="GtkTable" id="table3">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label33">
+              <object class="GtkLabel" id="label12">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" comments="Future Value Dialog: Description of calculation">Calculates the future value of an investment based on a series of equal payments at a periodic interest rate over the number of payment periods in the term.</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="right_attach">2</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label13">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before cost input">_Cost:</property>
+                <property name="label" translatable="yes" comments="Future Value Dialog: Label before periodic payment input">_Periodic Payment:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">sln_cost</property>
+                <property name="mnemonic_widget">fv_pmt</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -418,12 +473,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label34">
+              <object class="GtkLabel" id="label14">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before salvage input">_Salvage:</property>
+                <property name="label" translatable="yes" comments="Future Value Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">sln_salvage</property>
+                <property name="mnemonic_widget">fv_pint</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -433,12 +489,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label35">
+              <object class="GtkLabel" id="label15">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before life input">_Life:</property>
+                <property name="label" translatable="yes" comments="Future Value Dialog: Label before number of periods input">_Number of Periods:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">sln_life</property>
+                <property name="mnemonic_widget">fv_n</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -448,7 +505,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="sln_life">
+              <object class="GtkEntry" id="fv_n">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -464,7 +521,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="sln_salvage">
+              <object class="GtkEntry" id="fv_pint">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -480,7 +537,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="sln_cost">
+              <object class="GtkEntry" id="fv_pmt">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -495,35 +552,44 @@
                 <property name="y_options"></property>
               </packing>
             </child>
-            <child>
-              <object class="GtkLabel" id="label32">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Description of calculation">Calculates the straight-line depreciation of an asset for one period. The straight-line method of depreciation divides the depreciable cost evenly over the useful life of an asset. The useful life is the number of periods, typically years, over which an asset is depreciated. </property>
-                <property name="wrap">True</property>
-              </object>
-              <packing>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button5</action-widget>
+      <action-widget response="-5">button6</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="gpm_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Gross Profit Margin dialog">Gross Profit Margin</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox10">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area7">
+          <object class="GtkHButtonBox" id="dialog-action_area10">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button13">
+              <object class="GtkButton" id="button19">
                 <property name="label">gtk-cancel</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>
@@ -533,12 +599,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button14">
-                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button20">
+                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -550,39 +617,25 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button13</action-widget>
-      <action-widget response="-5">button14</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="rate_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Periodic Interest Rate dialog">Periodic Interest Rate</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox6">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table6">
+          <object class="GtkTable" id="table10">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
-            <property name="n_rows">4</property>
+            <property name="n_rows">3</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label28">
+              <object class="GtkLabel" id="label47">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Description of calculation">Calculates the periodic interest necessary to increase an investment to a future value, over the number of compounding periods. </property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Description of calculation">Calculates the resale price of a product, based on the product cost and the wanted gross profit margin.</property>
                 <property name="wrap">True</property>
               </object>
               <packing>
@@ -592,12 +645,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label29">
+              <object class="GtkLabel" id="label48">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before future value input">_Future Value:</property>
+                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Label before cost input">C_ost:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">rate_fv</property>
+                <property name="mnemonic_widget">gpm_cost</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -607,12 +661,12 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label30">
+              <object class="GtkLabel" id="label49">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before present value input">Present _Value:</property>
+                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Label before margin input">_Margin:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">rate_pv</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -622,22 +676,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label31">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before term input">_Term:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">rate_n</property>
-              </object>
-              <packing>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="rate_fv">
+              <object class="GtkEntry" id="gpm_cost">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -653,7 +692,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="rate_pv">
+              <object class="GtkEntry" id="gpm_margin">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -668,38 +707,44 @@
                 <property name="y_options"></property>
               </packing>
             </child>
-            <child>
-              <object class="GtkEntry" id="rate_n">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="invisible_char">â??</property>
-                <property name="text">0</property>
-                <signal name="activate" handler="finc_activate_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button19</action-widget>
+      <action-widget response="-5">button20</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="pmt_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Periodic Payment dialog">Periodic Payment</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox4">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area6">
+          <object class="GtkHButtonBox" id="dialog-action_area4">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button11">
+              <object class="GtkButton" id="button7">
                 <property name="label">gtk-cancel</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>
@@ -709,12 +754,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button12">
-                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button8">
+                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -726,39 +772,26 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button11</action-widget>
-      <action-widget response="-5">button12</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="pv_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Present Value dialog">Present Value</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox5">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table5">
+          <object class="GtkTable" id="table4">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label36">
+              <object class="GtkLabel" id="label17">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Present Value Dialog: Description of calculation">Calculates the present value of an investment based on a series of equal payments discounted at a periodic interest rate over the number of payment periods in the term. </property>
+                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Description of calculation">Calculates the amount of the periodic payment of a loan, where payments are made at the end of each payment period. </property>
                 <property name="wrap">True</property>
               </object>
               <packing>
@@ -768,12 +801,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label24">
+              <object class="GtkLabel" id="label18">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Present Value Dialog: Label before periodic payment input">_Periodic Payment:</property>
+                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before principal input">_Principal:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pv_pmt</property>
+                <property name="mnemonic_widget">pmt_prin</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -783,12 +817,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label25">
+              <object class="GtkLabel" id="label19">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Present Value Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
+                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pv_pint</property>
+                <property name="mnemonic_widget">pmt_pint</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -798,12 +833,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label26">
+              <object class="GtkLabel" id="label21">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Present Value Dialog: Label before number of periods input">_Number of Periods:</property>
+                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before term input">_Term:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pv_n</property>
+                <property name="mnemonic_widget">pmt_n</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -813,7 +849,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pv_pmt">
+              <object class="GtkEntry" id="pmt_prin">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -829,7 +865,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pv_pint">
+              <object class="GtkEntry" id="pmt_pint">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -845,7 +881,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pv_n">
+              <object class="GtkEntry" id="pmt_n">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -862,12 +898,33 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button7</action-widget>
+      <action-widget response="-5">button8</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="pv_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Present Value dialog">Present Value</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox5">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
           <object class="GtkHButtonBox" id="dialog-action_area5">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
               <object class="GtkButton" id="button9">
@@ -876,6 +933,7 @@
                 <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>
@@ -891,6 +949,7 @@
                 <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_underline">True</property>
               </object>
               <packing>
@@ -902,39 +961,26 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button9</action-widget>
-      <action-widget response="-5">button10</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="pmt_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Periodic Payment dialog">Periodic Payment</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox4">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table4">
+          <object class="GtkTable" id="table5">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label17">
+              <object class="GtkLabel" id="label36">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Description of calculation">Calculates the amount of the periodic payment of a loan, where payments are made at the end of each payment period. </property>
+                <property name="label" translatable="yes" comments="Present Value Dialog: Description of calculation">Calculates the present value of an investment based on a series of equal payments discounted at a periodic interest rate over the number of payment periods in the term. </property>
                 <property name="wrap">True</property>
               </object>
               <packing>
@@ -944,12 +990,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label18">
+              <object class="GtkLabel" id="label24">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before principal input">_Principal:</property>
+                <property name="label" translatable="yes" comments="Present Value Dialog: Label before periodic payment input">_Periodic Payment:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pmt_prin</property>
+                <property name="mnemonic_widget">pv_pmt</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -959,12 +1006,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label19">
+              <object class="GtkLabel" id="label25">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
+                <property name="label" translatable="yes" comments="Present Value Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pmt_pint</property>
+                <property name="mnemonic_widget">pv_pint</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -974,12 +1022,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label21">
+              <object class="GtkLabel" id="label26">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Label before term input">_Term:</property>
+                <property name="label" translatable="yes" comments="Present Value Dialog: Label before number of periods input">_Number of Periods:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">pmt_n</property>
+                <property name="mnemonic_widget">pv_n</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -989,7 +1038,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pmt_prin">
+              <object class="GtkEntry" id="pv_pmt">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1005,7 +1054,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pmt_pint">
+              <object class="GtkEntry" id="pv_pint">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1021,7 +1070,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="pmt_n">
+              <object class="GtkEntry" id="pv_n">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1038,20 +1087,42 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button9</action-widget>
+      <action-widget response="-5">button10</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="rate_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Periodic Interest Rate dialog">Periodic Interest Rate</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox6">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area4">
+          <object class="GtkHButtonBox" id="dialog-action_area6">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button7">
+              <object class="GtkButton" id="button11">
                 <property name="label">gtk-cancel</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>
@@ -1061,12 +1132,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button8">
-                <property name="label" translatable="yes" comments="Periodic Payment Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button12">
+                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -1078,38 +1150,26 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button7</action-widget>
-      <action-widget response="-5">button8</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="gpm_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Gross Profit Margin dialog">Gross Profit Margin</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox10">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table10">
+          <object class="GtkTable" id="table6">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
-            <property name="n_rows">3</property>
+            <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label47">
+              <object class="GtkLabel" id="label28">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Description of calculation">Calculates the resale price of a product, based on the product cost and the wanted gross profit margin.</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Description of calculation">Calculates the periodic interest necessary to increase an investment to a future value, over the number of compounding periods. </property>
                 <property name="wrap">True</property>
               </object>
               <packing>
@@ -1119,12 +1179,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label48">
+              <object class="GtkLabel" id="label29">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Label before cost input">C_ost:</property>
+                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before future value input">_Future Value:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">gpm_cost</property>
+                <property name="mnemonic_widget">rate_fv</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -1134,11 +1195,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label49">
+              <object class="GtkLabel" id="label30">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Label before margin input">_Margin:</property>
+                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before present value input">Present _Value:</property>
                 <property name="use_underline">True</property>
+                <property name="mnemonic_widget">rate_pv</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -1148,7 +1211,23 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="gpm_cost">
+              <object class="GtkLabel" id="label31">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Periodic Interest Rate Dialog: Label before term input">_Term:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">rate_n</property>
+              </object>
+              <packing>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="rate_fv">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1164,7 +1243,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="gpm_margin">
+              <object class="GtkEntry" id="rate_pv">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1179,22 +1258,60 @@
                 <property name="y_options"></property>
               </packing>
             </child>
+            <child>
+              <object class="GtkEntry" id="rate_n">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â??</property>
+                <property name="text">0</property>
+                <signal name="activate" handler="finc_activate_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button11</action-widget>
+      <action-widget response="-5">button12</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="sln_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Straight-Line Depreciation dialog">Straight-Line Depreciation</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox7">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area10">
+          <object class="GtkHButtonBox" id="dialog-action_area7">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button19">
+              <object class="GtkButton" id="button13">
                 <property name="label">gtk-cancel</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>
@@ -1204,12 +1321,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button20">
-                <property name="label" translatable="yes" comments="Gross Profit Margin Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button14">
+                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Calculate button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -1221,53 +1339,28 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button19</action-widget>
-      <action-widget response="-5">button20</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="fv_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Future Value dialog">Future Value</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox3">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table3">
+          <object class="GtkTable" id="table7">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label12">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes" comments="Future Value Dialog: Description of calculation">Calculates the future value of an investment based on a series of equal payments at a periodic interest rate over the number of payment periods in the term.</property>
-                <property name="wrap">True</property>
-              </object>
-              <packing>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label13">
+              <object class="GtkLabel" id="label33">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Future Value Dialog: Label before periodic payment input">_Periodic Payment:</property>
+                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before cost input">_Cost:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">fv_pmt</property>
+                <property name="mnemonic_widget">sln_cost</property>
               </object>
               <packing>
                 <property name="top_attach">1</property>
@@ -1277,12 +1370,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label14">
+              <object class="GtkLabel" id="label34">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Future Value Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
+                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before salvage input">_Salvage:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">fv_pint</property>
+                <property name="mnemonic_widget">sln_salvage</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -1292,12 +1386,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label15">
+              <object class="GtkLabel" id="label35">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Future Value Dialog: Label before number of periods input">_Number of Periods:</property>
+                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Label before life input">_Life:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">fv_n</property>
+                <property name="mnemonic_widget">sln_life</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -1307,7 +1402,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="fv_n">
+              <object class="GtkEntry" id="sln_life">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1323,7 +1418,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="fv_pint">
+              <object class="GtkEntry" id="sln_salvage">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1339,7 +1434,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="fv_pmt">
+              <object class="GtkEntry" id="sln_cost">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1354,22 +1449,58 @@
                 <property name="y_options"></property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="label32">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Straight-Line Depreciation Dialog: Description of calculation">Calculates the straight-line depreciation of an asset for one period. The straight-line method of depreciation divides the depreciable cost evenly over the useful life of an asset. The useful life is the number of periods, typically years, over which an asset is depreciated. </property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="right_attach">2</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button13</action-widget>
+      <action-widget response="-5">button14</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="syd_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Sum-of-the-Years'-Digits Depreciation dialog">Sum-of-the-Years'-Digits Depreciation</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox8">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area3">
+          <object class="GtkHButtonBox" id="dialog-action_area8">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button5">
+              <object class="GtkButton" id="button15">
                 <property name="label">gtk-cancel</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>
@@ -1379,12 +1510,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button6">
-                <property name="label" translatable="yes" comments="Future Value Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button16">
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Calculate result button">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -1396,68 +1528,60 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button5</action-widget>
-      <action-widget response="-5">button6</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="ddb_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Double-Declining Depreciation dialog">Double-Declining Depreciation</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox2">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table2">
+          <object class="GtkTable" id="table8">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
-            <property name="n_rows">4</property>
+            <property name="n_rows">5</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkLabel" id="label7">
+              <object class="GtkLabel" id="label37">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Description of calculation">Calculates the depreciation allowance on an asset for a specified period of time, using the double-declining balance method.</property>
-                <property name="wrap">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before period input">_Period:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">syd_period</property>
               </object>
               <packing>
-                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label8">
+              <object class="GtkLabel" id="label38">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before cost input">C_ost:</property>
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before life input">_Life:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ddb_cost</property>
+                <property name="mnemonic_widget">syd_life</property>
               </object>
               <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label10">
+              <object class="GtkLabel" id="label39">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before life input">_Life:</property>
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before salvage input">_Salvage:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ddb_life</property>
+                <property name="mnemonic_widget">syd_salvage</property>
               </object>
               <packing>
                 <property name="top_attach">2</property>
@@ -1467,7 +1591,23 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="ddb_life">
+              <object class="GtkLabel" id="label40">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Label before cost input">_Cost:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">syd_cost</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>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="syd_cost">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1477,13 +1617,13 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="ddb_cost">
+              <object class="GtkEntry" id="syd_salvage">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1493,28 +1633,29 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label11">
+              <object class="GtkEntry" id="syd_life">
                 <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Label before period input">_Period:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ddb_period</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â??</property>
+                <property name="text">0</property>
+                <signal name="activate" handler="finc_activate_cb" swapped="no"/>
               </object>
               <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
                 <property name="top_attach">3</property>
                 <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="ddb_period">
+              <object class="GtkEntry" id="syd_period">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1524,27 +1665,63 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label41">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Sum-of-the-Years'-Digits Depreciation Dialog: Description of calculation">Calculates the depreciation allowance on an asset for a specified period of time, using the Sum-of-the-Years'-Digits method. This method of depreciation accelerates the rate of depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The useful life is the number of periods, typically years, over which an asset is depreciated. </property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="right_attach">2</property>
+                <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-6">button15</action-widget>
+      <action-widget response="-5">button16</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="term_dialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" comments="Title of Payment Period dialog">Payment Period</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <signal name="response" handler="finc_response_cb" swapped="no"/>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox9">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area2">
+          <object class="GtkHButtonBox" id="dialog-action_area9">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
-              <object class="GtkButton" id="button3">
+              <object class="GtkButton" id="button17">
                 <property name="label">gtk-cancel</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>
@@ -1554,12 +1731,13 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="button4">
-                <property name="label" translatable="yes" comments="Double-Declining Depreciation Dialog: Calculate button">C_alculate</property>
+              <object class="GtkButton" id="button18">
+                <property name="label" translatable="yes" comments="Payment Period Dialog: Button to calculate result">C_alculate</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_underline">True</property>
               </object>
               <packing>
@@ -1571,36 +1749,22 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button3</action-widget>
-      <action-widget response="-5">button4</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="ctrm_dialog">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" comments="Title of Compounding Term dialog">Compounding Term</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="finc_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
         <child>
-          <object class="GtkTable" id="table1">
+          <object class="GtkTable" id="table9">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <property name="border_width">6</property>
             <property name="n_rows">4</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <object class="GtkEntry" id="ctrm_pint">
+              <object class="GtkEntry" id="term_pint">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1610,13 +1774,13 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="ctrm_fv">
+              <object class="GtkEntry" id="term_fv">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1632,7 +1796,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEntry" id="ctrm_pv">
+              <object class="GtkEntry" id="term_pmt">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="invisible_char">â??</property>
@@ -1642,18 +1806,19 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label5">
+              <object class="GtkLabel" id="label43">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before present value input">Present _Value:</property>
+                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ctrm_pv</property>
+                <property name="mnemonic_widget">term_pint</property>
               </object>
               <packing>
                 <property name="top_attach">3</property>
@@ -1663,876 +1828,812 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label6">
+              <object class="GtkLabel" id="label44">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before periodic interest rate input">Periodic Interest _Rate:</property>
+                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before future value input">Future _Value:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ctrm_pint</property>
+                <property name="mnemonic_widget">term_fv</property>
               </object>
               <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label9">
+              <object class="GtkLabel" id="label45">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes" comments="Compounding Term Dialog: Description of calculation">Calculates the number of compounding periods necessary to increase an investment of present value to a future value, at a fixed interest rate per compounding period.</property>
-                <property name="wrap">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes" comments="Payment Period Dialog: Label before periodic payment input">_Periodic Payment:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">term_pmt</property>
               </object>
               <packing>
-                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label16">
+              <object class="GtkLabel" id="label46">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes" comments="Compounding Term Dialog: Label before future value input">_Future Value:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">ctrm_fv</property>
+                <property name="label" translatable="yes" comments="Payment Period Dialog: Description of calculation">Calculates the number of payment periods that are necessary during the term of an ordinary annuity, to accumulate a future value, at a periodic interest rate.</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="right_attach">2</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="button1">
-                <property name="label">gtk-cancel</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_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button2">
-                <property name="label" translatable="yes" comments="Compounding Term Dialog: Calculate button">C_alculate</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_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
       </object>
     </child>
     <action-widgets>
-      <action-widget response="-6">button1</action-widget>
-      <action-widget response="-5">button2</action-widget>
+      <action-widget response="-6">button17</action-widget>
+      <action-widget response="-5">button18</action-widget>
     </action-widgets>
   </object>
   <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
     <child>
-      <object class="GtkVBox" id="button_panel">
+      <object class="GtkTable" id="button_panel">
         <property name="visible">True</property>
-        <property name="spacing">6</property>
+        <property name="can_focus">False</property>
+        <property name="n_rows">4</property>
+        <property name="n_columns">10</property>
+        <property name="homogeneous">True</property>
         <child>
-          <object class="GtkHBox" id="hbox1">
+          <object class="GtkButton" id="calc_memory_button">
             <property name="visible">True</property>
-            <property name="spacing">6</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="use_action_appearance">False</property>
+            <property name="focus_on_click">False</property>
+            <child internal-child="accessible">
+              <object class="AtkObject" id="calc_memory_button-atkobject">
+                <property name="AtkObject::accessible-name" translatable="yes" comments="Accessible name for the memory value button">Memory</property>
+              </object>
+            </child>
+            <signal name="clicked" handler="memory_cb" swapped="no"/>
             <child>
-              <object class="GtkHBox" id="hbox2">
+              <object class="GtkHBox" id="hbox20">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">3</property>
                 <child>
-                  <object class="GtkComboBox" id="source_currency_combo">
+                  <object class="GtkLabel" id="label23">
                     <property name="visible">True</property>
-                    <property name="focus_on_click">False</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes" comments="The label on the memory button">&lt;i&gt;x&lt;/i&gt;</property>
+                    <property name="use_markup">True</property>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="label1">
+                  <object class="GtkArrow" id="arrow14">
                     <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes" comments="This is between the currency selector dropdowns, for example: [USD] in [EUR]"> in </property>
+                    <property name="can_focus">False</property>
+                    <property name="arrow_type">down</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <object class="GtkComboBox" id="target_currency_combo">
-                    <property name="visible">True</property>
-                    <property name="focus_on_click">False</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="currency_label">
-                <property name="visible">True</property>
-                <property name="xalign">1</property>
-                <property name="label" comments="Example content">$100 = â?¬120</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="currency_label-atkobject">
-                    <property name="AtkObject::accessible-name">currency_label</property>
-                    <property name="AtkObject::accessible-description">Displays a currency conversion</property>
-                  </object>
-                </child>
               </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
             </child>
           </object>
           <packing>
-            <property name="expand">False</property>
-            <property name="position">0</property>
+            <property name="left_attach">4</property>
+            <property name="right_attach">6</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
           </packing>
         </child>
         <child>
-          <object class="GtkTable" id="button_table">
+          <object class="GtkButton" id="calc_logarithm_button">
+            <property name="label">log</property>
             <property name="visible">True</property>
-            <property name="n_rows">4</property>
-            <property name="n_columns">10</property>
-            <property name="homogeneous">True</property>
-            <child>
-              <object class="GtkButton" id="calc_memory_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="focus_on_click">False</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="calc_memory_button-atkobject">
-                    <property name="AtkObject::accessible-name" translatable="yes" comments="Accessible name for the memory value button">Memory</property>
-                  </object>
-                </child>
-                <signal name="clicked" handler="memory_cb" swapped="no"/>
-                <child>
-                  <object class="GtkHBox" id="hbox20">
-                    <property name="visible">True</property>
-                    <property name="spacing">3</property>
-                    <child>
-                      <object class="GtkLabel" id="label23">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes" comments="The label on the memory button">&lt;i&gt;x&lt;/i&gt;</property>
-                        <property name="use_markup">True</property>
-                      </object>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkArrow" id="arrow14">
-                        <property name="visible">True</property>
-                        <property name="arrow_type">down</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_logarithm_button">
-                <property name="label">log</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">6</property>
-                <property name="right_attach">7</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_4_button">
-                <property name="label">4</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_7_button">
-                <property name="label">7</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_8_button">
-                <property name="label">8</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_9_button">
-                <property name="label">9</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_5_button">
-                <property name="label">5</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_6_button">
-                <property name="label">6</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_divide_button">
-                <property name="label">÷</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_1_button">
-                <property name="label">1</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_2_button">
-                <property name="label">2</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_0_button">
-                <property name="label">0</property>
-                <property name="width_request">50</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_numeric_point_button">
-                <property name="label" comments="Label is set in gtk.c to comply with LC flags">.</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="numeric_point_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_percentage_button">
-                <property name="label">%</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_3_button">
-                <property name="label">3</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="digit_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_multiply_button">
-                <property name="label">Ã?</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_subtract_button">
-                <property name="label">â??</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="subtract_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_add_button">
-                <property name="label">+</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_result_button">
-                <property name="label" translatable="yes" comments="Label on the solve button (clicking this solves the displayed calculation)">=</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="solve_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_start_group_button">
-                <property name="label">(</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_end_group_button">
-                <property name="label">)</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_clear_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="clear_cb" swapped="no"/>
-                <child>
-                  <object class="GtkImage" id="image2">
-                    <property name="visible">True</property>
-                    <property name="stock">gtk-clear</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_compounding_term_button">
-                <property name="label" translatable="yes" comments="Calculates the number of compounding periods necessary to increase an investment of present value pv to a future value of fv, at a fixed interest rate of int per compounding period. See also: http://en.wikipedia.org/wiki/Compound_interest";>Ctrm</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">7</property>
-                <property name="right_attach">8</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_double_declining_depreciation_button">
-                <property name="label" translatable="yes" comments="Calculates the depreciation allowance on an asset for a specified period of time, using the double-declining balance method. See also: http://en.wikipedia.org/wiki/Depreciation";>Ddb</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_future_value_button">
-                <property name="label" translatable="yes" comments="Calculates the future value of an investment based on a series of equal payments, each of amount pmt, at a periodic interest rate of int, over the number of payment periods in the term. See also: http://en.wikipedia.org/wiki/Future_value";>Fv</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_term_button">
-                <property name="label" translatable="yes" comments="Calculates the number of payment periods that are necessary during the term of an ordinary annuity, to accumulate a future value of fv, at a periodic interest rate of int. Each payment is equal to amount pmt. See also: http://en.wikipedia.org/wiki/Annuity_(finance_theory)">Term</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_sum_of_the_years_digits_depreciation_button">
-                <property name="label" translatable="yes" comments="Calculates the depreciation allowance on an asset for a specified period of time, using the Sum-Of-The-Years'-Digits method. This method of depreciation accelerates the rate of depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is cost - salvage. The useful life is the number of periods, typically years, over which an asset is depreciated. See also: http://en.wikipedia.org/wiki/Depreciation";>Syd</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_straight_line_depreciation_button">
-                <property name="label" translatable="yes" comments="Calculates the straight-line depreciation of an asset for one period. The depreciable cost is cost - salvage. The straight-line method of depreciation divides the depreciable cost evenly over the useful life of an asset. The useful life is the number of periods, typically years, over which an asset is depreciated. See also: http://en.wikipedia.org/wiki/Depreciation";>Sln</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_periodic_interest_rate_button">
-                <property name="label" translatable="yes" comments="Calculates the periodic interest necessary to increase an investment of present value pv to a future value of fv, over the number of compounding periods in term. See also: http://en.wikipedia.org/wiki/Interest                                      ">Rate</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">7</property>
-                <property name="right_attach">8</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_present_value_button">
-                <property name="label" translatable="yes" comments="Calculates the present value of an investment based on a series of equal payments, each of amount pmt, discounted at a periodic interest rate of int, over the number of payment periods in the term. See also: http://en.wikipedia.org/wiki/Present_value";>Pv</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">9</property>
-                <property name="right_attach">10</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="calc_finc_periodic_payment_button">
-                <property name="label" translatable="yes" comments="Calculates the amount of the periodic payment of a loan, where payments are made at the end of each payment period. See also: http://en.wikipedia.org/wiki/Amortization_schedule";>Pmt</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="left_attach">8</property>
-                <property name="right_attach">9</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="use_action_appearance">False</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">6</property>
+            <property name="right_attach">7</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_4_button">
+            <property name="label">4</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_7_button">
+            <property name="label">7</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_8_button">
+            <property name="label">8</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_9_button">
+            <property name="label">9</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_5_button">
+            <property name="label">5</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_6_button">
+            <property name="label">6</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_divide_button">
+            <property name="label">÷</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_1_button">
+            <property name="label">1</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_2_button">
+            <property name="label">2</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_0_button">
+            <property name="label">0</property>
+            <property name="width_request">50</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_numeric_point_button">
+            <property name="label" comments="Label is set in gtk.c to comply with LC flags">.</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="numeric_point_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_percentage_button">
+            <property name="label">%</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_3_button">
+            <property name="label">3</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="digit_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_multiply_button">
+            <property name="label">Ã?</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_subtract_button">
+            <property name="label">â??</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="subtract_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_add_button">
+            <property name="label">+</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">3</property>
+            <property name="right_attach">4</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_result_button">
+            <property name="label" translatable="yes" comments="Label on the solve button (clicking this solves the displayed calculation)">=</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="solve_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">4</property>
+            <property name="right_attach">6</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_start_group_button">
+            <property name="label">(</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">4</property>
+            <property name="right_attach">5</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_end_group_button">
+            <property name="label">)</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">5</property>
+            <property name="right_attach">6</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_clear_button">
+            <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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="clear_cb" swapped="no"/>
             <child>
-              <object class="GtkButton" id="calc_finc_gross_profit_margin_button">
-                <property name="label" translatable="yes" comments="Calculates the resale price of a product, based on the product cost and the wanted gross profit margin. See also: http://en.wikipedia.org/wiki/Gross_profit_margin";>Gpm</property>
+              <object class="GtkImage" id="image2">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="finc_cb" swapped="no"/>
+                <property name="can_focus">False</property>
+                <property name="stock">gtk-clear</property>
               </object>
-              <packing>
-                <property name="left_attach">7</property>
-                <property name="right_attach">8</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
             </child>
+          </object>
+          <packing>
+            <property name="left_attach">5</property>
+            <property name="right_attach">6</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_compounding_term_button">
+            <property name="label" translatable="yes" comments="Calculates the number of compounding periods necessary to increase an investment of present value pv to a future value of fv, at a fixed interest rate of int per compounding period. See also: http://en.wikipedia.org/wiki/Compound_interest";>Ctrm</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">7</property>
+            <property name="right_attach">8</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_double_declining_depreciation_button">
+            <property name="label" translatable="yes" comments="Calculates the depreciation allowance on an asset for a specified period of time, using the double-declining balance method. See also: http://en.wikipedia.org/wiki/Depreciation";>Ddb</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">8</property>
+            <property name="right_attach">9</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_future_value_button">
+            <property name="label" translatable="yes" comments="Calculates the future value of an investment based on a series of equal payments, each of amount pmt, at a periodic interest rate of int, over the number of payment periods in the term. See also: http://en.wikipedia.org/wiki/Future_value";>Fv</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">9</property>
+            <property name="right_attach">10</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_term_button">
+            <property name="label" translatable="yes" comments="Calculates the number of payment periods that are necessary during the term of an ordinary annuity, to accumulate a future value of fv, at a periodic interest rate of int. Each payment is equal to amount pmt. See also: http://en.wikipedia.org/wiki/Annuity_(finance_theory)">Term</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">8</property>
+            <property name="right_attach">9</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_sum_of_the_years_digits_depreciation_button">
+            <property name="label" translatable="yes" comments="Calculates the depreciation allowance on an asset for a specified period of time, using the Sum-Of-The-Years'-Digits method. This method of depreciation accelerates the rate of depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is cost - salvage. The useful life is the number of periods, typically years, over which an asset is depreciated. See also: http://en.wikipedia.org/wiki/Depreciation";>Syd</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">9</property>
+            <property name="right_attach">10</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_straight_line_depreciation_button">
+            <property name="label" translatable="yes" comments="Calculates the straight-line depreciation of an asset for one period. The depreciable cost is cost - salvage. The straight-line method of depreciation divides the depreciable cost evenly over the useful life of an asset. The useful life is the number of periods, typically years, over which an asset is depreciated. See also: http://en.wikipedia.org/wiki/Depreciation";>Sln</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">8</property>
+            <property name="right_attach">9</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_periodic_interest_rate_button">
+            <property name="label" translatable="yes" comments="Calculates the periodic interest necessary to increase an investment of present value pv to a future value of fv, over the number of compounding periods in term. See also: http://en.wikipedia.org/wiki/Interest                                      ">Rate</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">7</property>
+            <property name="right_attach">8</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_present_value_button">
+            <property name="label" translatable="yes" comments="Calculates the present value of an investment based on a series of equal payments, each of amount pmt, discounted at a periodic interest rate of int, over the number of payment periods in the term. See also: http://en.wikipedia.org/wiki/Present_value";>Pv</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">9</property>
+            <property name="right_attach">10</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_periodic_payment_button">
+            <property name="label" translatable="yes" comments="Calculates the amount of the periodic payment of a loan, where payments are made at the end of each payment period. See also: http://en.wikipedia.org/wiki/Amortization_schedule";>Pmt</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">8</property>
+            <property name="right_attach">9</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_finc_gross_profit_margin_button">
+            <property name="label" translatable="yes" comments="Calculates the resale price of a product, based on the product cost and the wanted gross profit margin. See also: http://en.wikipedia.org/wiki/Gross_profit_margin";>Gpm</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="finc_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">7</property>
+            <property name="right_attach">8</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_undo_button">
+            <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_underline">True</property>
+            <property name="focus_on_click">False</property>
             <child>
-              <object class="GtkButton" id="calc_undo_button">
+              <object class="GtkImage" id="image1">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <child>
-                  <object class="GtkImage" id="image1">
-                    <property name="visible">True</property>
-                    <property name="stock">gtk-undo</property>
-                  </object>
-                </child>
+                <property name="can_focus">False</property>
+                <property name="stock">gtk-undo</property>
               </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="calc_x_pow_y_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="focus_on_click">False</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="calc_x_pow_y_button-atkobject">
-                    <property name="AtkObject::accessible-name" translatable="yes" comments="Accessible name for the exponentiation (x to the power of y) button">Exponent</property>
-                  </object>
-                </child>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
-                <child>
-                  <object class="GtkLabel" id="x_pow_y_label">
-                    <property name="visible">True</property>
-                    <property name="label">&lt;i&gt;x&lt;/i&gt;&lt;sup&gt;&lt;i&gt;y&lt;/i&gt;&lt;/sup&gt;</property>
-                    <property name="use_markup">True</property>
-                  </object>
-                </child>
+          </object>
+          <packing>
+            <property name="left_attach">4</property>
+            <property name="right_attach">5</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="calc_x_pow_y_button">
+            <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="focus_on_click">False</property>
+            <child internal-child="accessible">
+              <object class="AtkObject" id="calc_x_pow_y_button-atkobject">
+                <property name="AtkObject::accessible-name" translatable="yes" comments="Accessible name for the exponentiation (x to the power of y) button">Exponent</property>
               </object>
-              <packing>
-                <property name="left_attach">6</property>
-                <property name="right_attach">7</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
             </child>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
             <child>
-              <object class="GtkButton" id="calc_root_button">
-                <property name="label">â??</property>
+              <object class="GtkLabel" id="x_pow_y_label">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-                <property name="focus_on_click">False</property>
-                <signal name="clicked" handler="button_cb" swapped="no"/>
+                <property name="can_focus">False</property>
+                <property name="label">&lt;i&gt;x&lt;/i&gt;&lt;sup&gt;&lt;i&gt;y&lt;/i&gt;&lt;/sup&gt;</property>
+                <property name="use_markup">True</property>
               </object>
-              <packing>
-                <property name="left_attach">6</property>
-                <property name="right_attach">7</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
             </child>
           </object>
           <packing>
-            <property name="position">1</property>
+            <property name="left_attach">6</property>
+            <property name="right_attach">7</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkButton" id="calc_root_button">
+            <property name="label">â??</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_underline">True</property>
+            <property name="focus_on_click">False</property>
+            <signal name="clicked" handler="button_cb" swapped="no"/>
+          </object>
+          <packing>
+            <property name="left_attach">6</property>
+            <property name="right_attach">7</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+            <property name="y_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
       </object>
     </child>
   </object>
diff --git a/src/Makefile.am b/src/Makefile.am
index e512538..e653455 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,6 +47,10 @@ gcalctool_SOURCES = \
 	mp-serializer.h \
 	financial.c \
 	financial.h \
+  	unit.c \
+	unit.h \
+	unit-category.c \
+	unit-category.h \
 	unit-manager.c \
 	unit-manager.h \
 	unittest.c \
@@ -57,6 +61,8 @@ gcalctool_LDADD = \
 
 gcalccmd_SOURCES = \
 	gcalccmd.c \
+	currency.c \
+	currency.h \
 	mp.c \
 	mp-convert.c \
 	mp-binary.c \
@@ -68,6 +74,10 @@ gcalccmd_SOURCES = \
 	mp-serializer.h\
 	math-enums.c \
 	math-enums.h \
+	unit.c \
+	unit.h \
+	unit-category.c \
+	unit-category.h \
 	unit-manager.c \
 	unit-manager.h
 
diff --git a/src/currency.c b/src/currency.c
index 5c74ad4..883a002 100644
--- a/src/currency.c
+++ b/src/currency.c
@@ -433,13 +433,11 @@ currency_get_info(const gchar *name)
 }
 
 
-gboolean
-currency_convert(const MPNumber *from_amount,
-                 const char *source_currency, const char *target_currency,
-                 MPNumber *to_amount)
+MPNumber *
+currency_get_value(const gchar *currency)
 {
     gchar *path;
-    Currency *from_info, *to_info;
+    Currency *info;
 
     /* Update rates if necessary */
     path = get_imf_rate_filepath();
@@ -458,38 +456,11 @@ currency_convert(const MPNumber *from_amount,
     g_free(path);
 
     if (downloading_imf_rates || downloading_ecb_rates)
-        return FALSE;
+        return NULL;
 
     if (!loaded_rates)
         load_rates();
   
-    from_info = get_currency(source_currency);
-    to_info = get_currency(target_currency);
-    if (!from_info || !to_info)
-        return FALSE;
-
-    if (mp_is_zero(&from_info->value) ||
-        mp_is_zero(&to_info->value)) {
-        mp_set_from_integer(0, to_amount);
-        return FALSE;
-    }
-
-    mp_divide(from_amount, &to_info->value, to_amount);
-    mp_multiply(to_amount, &from_info->value, to_amount);
-
-    return TRUE;
-}
-
-void
-currency_free_resources()
-{
-    GList *link;
-
-    for (link = currencies; link; link = link->next) {
-        Currency *c = link->data;
-        g_free(c->short_name);
-        g_free(c);
-    }
-    g_list_free(currencies);
-    currencies = NULL;
+    info = get_currency(currency);
+    return &info->value;
 }
diff --git a/src/currency.h b/src/currency.h
index 736f554..ea45751 100644
--- a/src/currency.h
+++ b/src/currency.h
@@ -77,12 +77,6 @@ static const CurrencyInfo currency_info[] = {
 
 const CurrencyInfo *currency_get_info(const gchar *name);
 
-/* Converts an amount of money from one currency to another */
-gboolean currency_convert(const MPNumber *from_amount,
-                          const char *source_currency, const char *target_currency,
-                          MPNumber *to_amount);
-
-/* Frees up all allocated resources */
-void currency_free_resources(void);
+MPNumber *currency_get_value(const gchar *currency);
 
 #endif /* CURRENCY_H */
diff --git a/src/gcalctool.c b/src/gcalctool.c
index 38fffb3..8bf030a 100644
--- a/src/gcalctool.c
+++ b/src/gcalctool.c
@@ -21,8 +21,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <locale.h>
+#include <glib/gi18n.h>
 
-#include "currency.h"
 #include "unittest.h"
 #include "math-window.h"
 #include "mp-equation.h"
@@ -206,7 +206,6 @@ quit_cb(MathWindow *window)
     g_settings_set_string(settings, "target-units", math_equation_get_target_units(equation));
     g_settings_sync();
 
-    currency_free_resources();
     gtk_main_quit();
 }
 
diff --git a/src/math-buttons.c b/src/math-buttons.c
index 69b215f..87eded8 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -63,11 +63,6 @@ struct MathButtonsPrivate
     GtkWidget *bit_panel;
     GtkWidget *bit_labels[MAXBITS];
 
-    GtkWidget *source_currency_combo;
-    GtkWidget *target_currency_combo;
-    MpSerializer *currency_serializer;
-    GtkWidget *currency_label;
-
     GtkWidget *character_code_dialog;
     GtkWidget *character_code_entry;
 };
@@ -289,11 +284,6 @@ static ButtonData button_data[] = {
     {NULL, NULL, 0, NULL}
 };
 
-typedef enum {
-    CURRENCY_TARGET_UPPER,
-    CURRENCY_TARGET_LOWER
-} CurrencyTargetRow;
-
 /* The names of each field in the dialogs for the financial functions */
 static char *finc_dialog_fields[][5] = {
     {"ctrm_pint", "ctrm_fv",     "ctrm_pv",    NULL,         NULL},
@@ -457,49 +447,8 @@ update_bit_panel(MathButtons *buttons)
 
 
 static void
-update_currency_label(MathButtons *buttons)
-{
-    MPNumber x, value;
-    char *label;
-
-    if (!buttons->priv->currency_label)
-        return;
-
-    if (!math_equation_get_number(buttons->priv->equation, &x))
-        return;
-  
-    if (currency_convert(&x,
-                         math_equation_get_source_currency(buttons->priv->equation),
-                         math_equation_get_target_currency(buttons->priv->equation),
-                         &value)) {
-        char *input_text, *output_text;
-        const char *source_symbol, *target_symbol;
-
-        input_text = mp_serializer_to_string(buttons->priv->currency_serializer, &x);
-        output_text = mp_serializer_to_string(buttons->priv->currency_serializer, &value);
-
-        source_symbol = currency_get_info(math_equation_get_source_currency(buttons->priv->equation))->symbol;
-        target_symbol = currency_get_info(math_equation_get_target_currency(buttons->priv->equation))->symbol;
-
-        /* Translators: first and third %s are currency symbols, second and fourth are amounts in these currencies, you may want to change the order of these, example: $100 = â?¬100 */
-        label = g_strdup_printf(_("%s%s = %s%s"),
-                                source_symbol, input_text,
-                                target_symbol, output_text);
-        g_free(input_text);
-        g_free(output_text);
-    }
-    else
-        label = g_strdup("");
-
-    gtk_label_set_text(GTK_LABEL(buttons->priv->currency_label), label);
-    g_free(label);
-}
-
-
-static void
 display_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)
 {
-    update_currency_label(buttons);
     update_bit_panel(buttons);
 }
 
@@ -548,102 +497,6 @@ base_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)
 }
 
 
-static void
-source_currency_combo_changed_cb(GtkWidget *combo, MathButtons *buttons)
-{
-    gchar *value;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
-    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
-    gtk_tree_model_get(model, &iter, 0, &value, -1);
-
-    math_equation_set_source_currency(buttons->priv->equation, value);
-    g_free(value);
-}
-
-
-static void
-source_currency_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gboolean valid;
-  
-    if (buttons->priv->mode != FINANCIAL)
-        return;
-
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(buttons->priv->source_currency_combo));
-    valid = gtk_tree_model_get_iter_first(model, &iter);
-
-    while (valid) {
-        gchar *v;
-        gboolean matched;
-
-        gtk_tree_model_get(model, &iter, 0, &v, -1);
-        matched = strcmp(math_equation_get_source_currency(buttons->priv->equation), v) == 0;
-        g_free(v);
-        if (matched)
-            break;
-        valid = gtk_tree_model_iter_next(model, &iter);
-    }
-    if (!valid)
-        valid = gtk_tree_model_get_iter_first(model, &iter);
-
-    gtk_combo_box_set_active_iter(GTK_COMBO_BOX(buttons->priv->source_currency_combo), &iter);
-    update_currency_label(buttons);
-}
-
-
-static void
-target_currency_combo_changed_cb(GtkWidget *combo, MathButtons *buttons)
-{
-    gchar *value;
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
-    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
-    gtk_tree_model_get(model, &iter, 0, &value, -1);
-
-    math_equation_set_target_currency(buttons->priv->equation, value);
-    g_free(value);
-}
-
-
-static void
-target_currency_changed_cb(MathEquation *equation, GParamSpec *spec, MathButtons *buttons)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gboolean valid;
-  
-    if (buttons->priv->mode != FINANCIAL)
-        return;
-
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(buttons->priv->target_currency_combo));
-    valid = gtk_tree_model_get_iter_first(model, &iter);
-
-    while (valid) {
-        gchar *v;
-        gboolean matched;
-
-        gtk_tree_model_get(model, &iter, 0, &v, -1);
-        matched = strcmp(math_equation_get_target_currency(buttons->priv->equation), v) == 0;
-        g_free(v);
-        if (matched)
-            break;
-        valid = gtk_tree_model_iter_next(model, &iter);
-    }
-    if (!valid)
-        valid = gtk_tree_model_get_iter_first(model, &iter);
-
-    gtk_combo_box_set_active_iter(GTK_COMBO_BOX(buttons->priv->target_currency_combo), &iter);
-    update_currency_label(buttons);
-}
-
-
 static GtkWidget *
 load_mode(MathButtons *buttons, ButtonMode mode)
 {
@@ -829,43 +682,8 @@ load_mode(MathButtons *buttons, ButtonMode mode)
 
     /* Setup financial functions */
     if (mode == FINANCIAL) {
-        GtkListStore *model;
-        GtkCellRenderer *renderer;
-
         load_finc_dialogs(buttons);
 
-        buttons->priv->source_currency_combo = GET_WIDGET(builder, "source_currency_combo");
-        buttons->priv->target_currency_combo = GET_WIDGET(builder, "target_currency_combo");
-        buttons->priv->currency_label = GET_WIDGET(builder, "currency_label");
-
-        buttons->priv->currency_serializer = mp_serializer_new(MP_DISPLAY_FORMAT_AUTOMATIC, 10, 2);
-
-        model = gtk_list_store_new(1, G_TYPE_STRING);
-
-        for (i = 0; currency_info[i].short_name != NULL; i++) {
-            GtkTreeIter iter;
-
-            gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-            gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, currency_info[i].short_name, -1);
-        }
-
-        gtk_combo_box_set_model(GTK_COMBO_BOX(buttons->priv->source_currency_combo), GTK_TREE_MODEL(model));
-        gtk_combo_box_set_model(GTK_COMBO_BOX(buttons->priv->target_currency_combo), GTK_TREE_MODEL(model));
-
-        renderer = gtk_cell_renderer_text_new();
-        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(buttons->priv->source_currency_combo), renderer, TRUE);
-        gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(buttons->priv->source_currency_combo), renderer, "text", 0);
-        renderer = gtk_cell_renderer_text_new();
-        gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(buttons->priv->target_currency_combo), renderer, TRUE);
-        gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(buttons->priv->target_currency_combo), renderer, "text", 0);
-
-        g_signal_connect(buttons->priv->source_currency_combo, "changed", G_CALLBACK(source_currency_combo_changed_cb), buttons);
-        g_signal_connect(buttons->priv->target_currency_combo, "changed", G_CALLBACK(target_currency_combo_changed_cb), buttons);
-        g_signal_connect(buttons->priv->equation, "notify::source-currency", G_CALLBACK(source_currency_changed_cb), buttons);
-        g_signal_connect(buttons->priv->equation, "notify::target-currency", G_CALLBACK(target_currency_changed_cb), buttons);
-        source_currency_changed_cb(buttons->priv->equation, NULL, buttons);
-        target_currency_changed_cb(buttons->priv->equation, NULL, buttons);
-
         set_data(builder, "calc_finc_compounding_term_button", "finc_dialog", "ctrm_dialog");
         set_data(builder, "calc_finc_double_declining_depreciation_button", "finc_dialog", "ddb_dialog");
         set_data(builder, "calc_finc_future_value_button", "finc_dialog", "fv_dialog");
@@ -886,6 +704,25 @@ load_mode(MathButtons *buttons, ButtonMode mode)
 }
 
 
+static void
+converter_changed_cb(MathConverter *converter, MathButtons *buttons)
+{
+    Unit *from_unit, *to_unit;
+
+    math_converter_get_conversion(converter, &from_unit, &to_unit);
+    if (buttons->priv->mode == FINANCIAL) {
+        math_equation_set_source_currency(buttons->priv->equation, unit_get_name(from_unit));
+        math_equation_set_target_currency(buttons->priv->equation, unit_get_name(to_unit));
+    }
+    else {
+        math_equation_set_source_units(buttons->priv->equation, unit_get_name(from_unit));
+        math_equation_set_target_units(buttons->priv->equation, unit_get_name(to_unit));      
+    }
+
+    g_object_unref(from_unit);
+    g_object_unref(to_unit);
+}
+
 
 static void
 load_buttons(MathButtons *buttons)
@@ -897,6 +734,7 @@ load_buttons(MathButtons *buttons)
 
     if (!buttons->priv->converter) {
         buttons->priv->converter = math_converter_new(buttons->priv->equation);
+        g_signal_connect(buttons->priv->converter, "changed", G_CALLBACK(converter_changed_cb), buttons);
         gtk_box_pack_start(GTK_BOX(buttons), GTK_WIDGET(buttons->priv->converter), FALSE, TRUE, 0);      
     }
 
@@ -933,7 +771,19 @@ math_buttons_set_mode(MathButtons *buttons, ButtonMode mode)
 
     load_buttons(buttons);
 
-    gtk_widget_set_visible(GTK_WIDGET(buttons->priv->converter), mode == ADVANCED);
+    gtk_widget_set_visible(GTK_WIDGET(buttons->priv->converter), mode == ADVANCED || mode == FINANCIAL);
+    if (mode == ADVANCED) {
+        math_converter_set_category(buttons->priv->converter, NULL);
+        math_converter_set_conversion(buttons->priv->converter,
+                                      math_equation_get_source_units(buttons->priv->equation),
+                                      math_equation_get_target_units(buttons->priv->equation));
+    }
+    else if (mode == FINANCIAL) {
+        math_converter_set_category(buttons->priv->converter, "currency");
+        math_converter_set_conversion(buttons->priv->converter,
+                                      math_equation_get_source_currency(buttons->priv->equation),
+                                      math_equation_get_target_currency(buttons->priv->equation));
+    }
 
     g_object_notify(G_OBJECT(buttons), "mode");
 }
diff --git a/src/math-converter.c b/src/math-converter.c
index feb2f73..e2279a7 100644
--- a/src/math-converter.c
+++ b/src/math-converter.c
@@ -19,326 +19,251 @@
 #include <glib/gi18n.h>
 
 #include "math-converter.h"
-#include "mp-serializer.h"
 #include "unit-manager.h"
 #include "currency.h"
 
 enum {
-    PROP_0,
-    PROP_EQUATION
+    CHANGED,
+    LAST_SIGNAL
 };
+static guint signals[LAST_SIGNAL] = { 0, };
 
 struct MathConverterPrivate
 {
     MathEquation *equation;
 
+    gchar *category;
+
     GtkWidget *from_combo;
     GtkWidget *to_combo;
 
     GtkWidget *result_label;
-    MpSerializer *serializer;
-};
-
-#define MAX_UNITS 20
-struct Unit {
-    char *ui_name;
-    char *internal_name;
-};
-
-struct UnitCategory {
-    char *name;
-    struct Unit units[MAX_UNITS];
 };
 
-static struct UnitCategory categories[] = {
-    {N_("Angle"),  {
-                          /* Angle unit */
-                          {N_("Degrees"), "degrees"},
-                          /* Angle unit */
-                          {N_("Radians"), "radians"},
-                          /* Angle unit */
-                          {N_("Gradians"), "gradians"},
-                          {NULL, NULL}}},
-    {N_("Length"), {
-                          /* Length unit */
-                          {N_("Parsecs"), "parsecs"},
-                          /* Length unit */
-                          {N_("Light Years"), "lightyears"},
-                          /* Length unit */
-                          {N_("Astronomical Units"), "au"},
-                          /* Length unit */
-                          {N_("Nautical Miles"), "nm"},
-                          /* Length unit */
-                          {N_("Miles"), "miles"},
-                          /* Length unit */
-                          {N_("Kilometers"), "kilometers"},
-                          /* Length unit */
-                          {N_("Cables"), "cables"},
-                          /* Length unit */
-                          {N_("Fathoms"), "fathoms"},
-                          /* Length unit */
-                          {N_("Meters"), "meters"},
-                          /* Length unit */
-                          {N_("Yards"), "yards"},
-                          /* Length unit */
-                          {N_("Feet"), "feet"},
-                          /* Length unit */
-                          {N_("Inches"), "inches"},
-                          /* Length unit */
-                          {N_("Centimeters"), "centimeters"},
-                          /* Length unit */
-                          {N_("Millimeters"), "millimeters"},
-                          /* Length unit */
-                          {N_("Micrometers"), "micrometers"},
-                          /* Length unit */
-                          {N_("Nanometers"), "nanometers"},
-                          {NULL, NULL}}},
-    {N_("Area"),   {
-                          /* Area unit */
-                          {N_("Hectares"), "hectares"},
-                          /* Area unit */
-                          {N_("Acres"), "acres"},
-                          /* Area unit */
-                          {N_("m²"), "m²"},
-                          /* Area unit */
-                          {N_("cm²"), "cm²"},
-                          /* Area unit */
-                          {N_("mm²"), "mm²"},
-                          {NULL, NULL}}},
-    {N_("Volume"), {
-                          /* Volume unit */
-                          {N_("m³"), "m³"},
-                          /* Volume unit */
-                          {N_("Gallons"), "gallons"},
-                          /* Volume unit */
-                          {N_("Liters"), "liters"},
-                          /* Volume unit */
-                          {N_("Quarts"), "quarts"},
-                          /* Volume unit */
-                          {N_("Pints"), "pints"},
-                          /* Volume unit */
-                          {N_("Milliliters"), "milliliters"},
-                          /* Volume unit */
-                          {N_("cm³"), "cm³"},
-                          /* Volume unit */
-                          {N_("mm³"), "mm³"},
-                          {NULL, NULL}}},
-    {N_("Weight"), {
-                          /* Weight unit */
-                          {N_("Tonnes"), "tonnes"},
-                          /* Weight unit */
-                          {N_("Kilograms"), "kilograms"},
-                          /* Weight unit */
-                          {N_("Pounds"), "pounds"},
-                          /* Weight unit */
-                          {N_("Ounces"), "ounces"},
-                          /* Weight unit */
-                          {N_("Grams"), "grams"},
-                          {NULL, NULL}}},
-    {N_("Duration"),   {
-                          /* Time unit */
-                          {N_("Years"), "years"},
-                          /* Time unit */
-                          {N_("Days"), "days"},
-                          /* Time unit */
-                          {N_("Hours"), "hours"},
-                          /* Time unit */
-                          {N_("Minutes"), "minutes"},
-                          /* Time unit */
-                          {N_("Seconds"), "seconds"},
-                          /* Time unit */
-                          {N_("Milliseconds"), "milliseconds"},
-                          /* Time unit */
-                          {N_("Microseconds"), "microseconds"},
-                          {NULL, NULL}}}
-};
 
 G_DEFINE_TYPE (MathConverter, math_converter, GTK_TYPE_HBOX);
 
+static void display_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter);
+static void update_from_model(MathConverter *converter);
+
 
 MathConverter *
 math_converter_new(MathEquation *equation)
 {
-    return g_object_new(math_converter_get_type(), "equation", equation, NULL);  
-}
-
-
-void
-math_converter_set_category(MathEquation *equation, const gchar *category)
-{
-}
-
-
-const gchar *
-math_converter_get_category(MathEquation *equation)
-{
-    return NULL;
+    MathConverter *converter = g_object_new(math_converter_get_type(), NULL);
+    converter->priv->equation = g_object_ref(equation);
+    g_signal_connect(converter->priv->equation, "notify::display", G_CALLBACK(display_changed_cb), converter);
+    update_from_model(converter);
+    return converter;
 }
 
 
 static void
 update_result_label(MathConverter *converter)
 {
+    GtkTreeIter from_iter, to_iter;
+    UnitCategory *category = NULL;
+    Unit *source_unit = NULL, *target_unit = NULL;
     MPNumber x, z;
     gboolean enabled;
-    gchar *label;
-    const gchar *source_units, *target_units;
-    char *source_value, *target_value;
 
     if (!converter->priv->result_label)
         return;
 
     enabled = math_equation_get_number(converter->priv->equation, &x);
 
-    source_units = math_equation_get_source_units(converter->priv->equation);
-    target_units = math_equation_get_target_units(converter->priv->equation);
-    if (!source_units || !target_units)
-        enabled = FALSE;
-    else if (!unit_manager_convert(math_equation_get_unit_manager(converter->priv->equation), &x, source_units, target_units, &z)) {
-        if (!currency_convert(&x, source_units, target_units, &z))
+    if (enabled &&
+        gtk_combo_box_get_active_iter(GTK_COMBO_BOX(converter->priv->from_combo), &from_iter) &&
+        gtk_combo_box_get_active_iter(GTK_COMBO_BOX(converter->priv->to_combo), &to_iter)) {
+        gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->from_combo)), &from_iter, 1, &category, 2, &source_unit, -1);
+        gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->to_combo)), &to_iter, 2, &target_unit, -1);
+        if (!unit_category_convert(category, &x, unit_get_name(source_unit), unit_get_name(target_unit), &z))
             enabled = FALSE;
     }
+    else
+       enabled = FALSE;
 
     gtk_widget_set_sensitive(converter->priv->result_label, enabled);
-    if (!enabled)
-        return;
+    if (enabled) {
+        gchar *source_text, *target_text, *label;
+        source_text = unit_format(source_unit, &x);
+        target_text = unit_format(target_unit, &z);
+        label = g_strdup_printf("%s = %s", source_text, target_text);
+        gtk_label_set_text(GTK_LABEL(converter->priv->result_label), label);
+        g_free(source_text);
+        g_free(target_text);
+        g_free(label);
+    }
+
+    if (category)
+        g_object_unref(category);
+    if (source_unit)
+        g_object_unref(source_unit);
+    if (target_unit)
+        g_object_unref(target_unit);
+}
 
-    source_value = mp_serializer_to_string(converter->priv->serializer, &x);
-    target_value = mp_serializer_to_string(converter->priv->serializer, &z);
 
-    // FIXME: Use currency symbols for currency
-    label = g_strdup_printf("%s %s = %s %s", source_value, source_units, target_value, target_units);
-    gtk_label_set_text(GTK_LABEL(converter->priv->result_label), label);
-    g_free(source_value);
-    g_free(target_value);
-    g_free(label); 
+static void
+display_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter)
+{
+    update_result_label(converter);
 }
 
 
 static void
-source_units_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter)
+update_from_model(MathConverter *converter)
 {
-    GtkTreeModel *model;
-    GtkTreeIter iter;
+    GtkTreeStore *from_model;
 
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->from_combo));
-    if (!gtk_tree_model_get_iter_first(model, &iter))
-        return;
-    do {
-        GtkTreeIter child_iter;
-
-        if (gtk_tree_model_iter_children(model, &child_iter, &iter)) {
-            do {
-                gint i, j;
-
-                gtk_tree_model_get(model, &child_iter, 1, &i, 2, &j, -1);
-                if ((i == -1 && strcmp(currency_info[j].short_name, math_equation_get_source_units(equation)) == 0) ||
-                    (i >= 0 && strcmp(categories[i].units[j].internal_name, math_equation_get_source_units(equation)) == 0)) {
-                    gtk_combo_box_set_active_iter(GTK_COMBO_BOX(converter->priv->from_combo), &child_iter);
-                    update_result_label(converter);
-                    return;
-                }
-            } while (gtk_tree_model_iter_next(model, &child_iter));
+    from_model = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_OBJECT, G_TYPE_OBJECT);
+
+    if (converter->priv->category == NULL) {
+        const GList *categories, *iter;
+
+        categories = unit_manager_get_categories(math_equation_get_unit_manager(converter->priv->equation));
+        for (iter = categories; iter; iter = iter->next) {
+            UnitCategory *category = iter->data;
+            GtkTreeIter parent;
+            const GList *unit_iter;
+          
+            gtk_tree_store_append(from_model, &parent, NULL);
+            gtk_tree_store_set(from_model, &parent, 0, unit_category_get_display_name(category), 1, category, -1);
+
+            for (unit_iter = unit_category_get_units(category); unit_iter; unit_iter = unit_iter->next) {
+                Unit *unit = unit_iter->data;
+                GtkTreeIter iter;
+
+                gtk_tree_store_append(from_model, &iter, &parent);
+                gtk_tree_store_set(from_model, &iter, 0, unit_get_display_name(unit), 1, category, 2, unit, -1);
+            }
+        }
+    }
+    else {
+        UnitCategory *category;
+        const GList *unit_iter;
+
+        category = unit_manager_get_category(math_equation_get_unit_manager(converter->priv->equation), converter->priv->category);
+        for (unit_iter = unit_category_get_units(category); unit_iter; unit_iter = unit_iter->next) {
+            Unit *unit = unit_iter->data;
+            GtkTreeIter iter;
+
+            gtk_tree_store_append(from_model, &iter, NULL);
+            gtk_tree_store_set(from_model, &iter, 0, unit_get_display_name(unit), 1, category, 2, unit, -1);
         }
-    } while (gtk_tree_model_iter_next(model, &iter));
+    }
+
+    gtk_combo_box_set_model(GTK_COMBO_BOX(converter->priv->from_combo), GTK_TREE_MODEL(from_model));
 }
 
 
-static void
-target_units_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter)
+void
+math_converter_set_category(MathConverter *converter, const gchar *category)
 {
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->to_combo));
-    if (!gtk_tree_model_get_iter_first(model, &iter))
+    if (category == NULL && converter->priv->category == NULL)
         return;
-    do {
-        gint i, j;
-
-        gtk_tree_model_get(model, &iter, 1, &i, 2, &j, -1);
-        if ((i == -1 && strcmp(currency_info[j].short_name, math_equation_get_source_units(equation)) == 0) ||
-            (i >= 0 && strcmp(categories[i].units[j].internal_name, math_equation_get_source_units(equation)) == 0)) {
-            gtk_combo_box_set_active_iter(GTK_COMBO_BOX(converter->priv->to_combo), &iter);
-            update_result_label(converter);
-            return;
-        }
-    } while (gtk_tree_model_iter_next(model, &iter));
+    if (category != NULL && converter->priv->category != NULL && strcmp(category, converter->priv->category) == 0)
+        return;
+
+    g_free(converter->priv->category);
+    converter->priv->category = g_strdup(category);
+
+    update_from_model(converter);
 }
 
 
-static void
-display_changed_cb(MathEquation *equation, GParamSpec *spec, MathConverter *converter)
+const gchar *
+math_converter_get_category(MathConverter *converter)
 {
-    update_result_label(converter);
+    return converter->priv->category;
 }
 
 
-static void
-math_converter_set_property(GObject      *object,
-                            guint         prop_id,
-                            const GValue *value,
-                            GParamSpec   *pspec)
+static gboolean
+iter_is_unit(GtkTreeModel *model, GtkTreeIter *iter, Unit *unit)
+{
+    Unit *u;
+
+    gtk_tree_model_get(model, iter, 2, &u, -1);
+  
+    if (!u)
+        return FALSE;
+
+    g_object_unref(u);
+    if (u == unit)
+        return TRUE;
+  
+    return FALSE;
+}
+
+
+static gboolean
+set_active_unit(GtkComboBox *combo, GtkTreeIter *iter, Unit *unit)
 {
-    MathConverter *self;
-
-    self = MATH_CONVERTER(object);
-
-    switch (prop_id) {
-    case PROP_EQUATION:
-        self->priv->equation = g_value_get_object(value);
-        g_signal_connect(self->priv->equation, "notify::source-units", G_CALLBACK(source_units_changed_cb), self);
-        g_signal_connect(self->priv->equation, "notify::target-units", G_CALLBACK(target_units_changed_cb), self);
-        g_signal_connect(self->priv->equation, "notify::display", G_CALLBACK(display_changed_cb), self);
-        source_units_changed_cb(self->priv->equation, NULL, self);
-        target_units_changed_cb(self->priv->equation, NULL, self);
-        display_changed_cb(self->priv->equation, NULL, self);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-        break;
+    GtkTreeModel *model;
+    GtkTreeIter child_iter;
+
+    model = gtk_combo_box_get_model(combo);
+  
+    if (iter && iter_is_unit(model, iter, unit)) {
+        gtk_combo_box_set_active_iter(combo, iter);
+        return TRUE;
     }
+
+    if (!gtk_tree_model_iter_children(model, &child_iter, iter))
+        return FALSE;
+  
+    do {
+        if (set_active_unit(combo, &child_iter, unit))
+            return TRUE;
+    } while (gtk_tree_model_iter_next(model, &child_iter));
+  
+    return FALSE;
 }
 
 
-static void
-math_converter_get_property(GObject    *object,
-                            guint       prop_id,
-                            GValue     *value,
-                            GParamSpec *pspec)
+void
+math_converter_set_conversion(MathConverter *converter, /*const gchar *category,*/ const gchar *unit_a, const gchar *unit_b)
 {
-    MathConverter *self;
+    Unit *ua;
+    Unit *ub;
 
-    self = MATH_CONVERTER(object);
+    ua = unit_manager_get_unit(math_equation_get_unit_manager(converter->priv->equation), unit_a);
+    ub = unit_manager_get_unit(math_equation_get_unit_manager(converter->priv->equation), unit_b);
+    if (!ua || !ub)
+        return;
 
-    switch (prop_id) {
-    case PROP_EQUATION:
-        g_value_set_object(value, self->priv->equation);
-        break;
-    default:
-        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
-        break;
-    }
+    set_active_unit(GTK_COMBO_BOX(converter->priv->from_combo), NULL, ua);
+    set_active_unit(GTK_COMBO_BOX(converter->priv->to_combo), NULL, ub);
 }
 
 
-static void
-math_converter_class_init(MathConverterClass *klass)
+void
+math_converter_get_conversion(MathConverter *converter, Unit **from_unit, Unit **to_unit)
 {
-    GObjectClass *object_class = G_OBJECT_CLASS(klass);
+    GtkTreeIter from_iter, to_iter;
 
-    object_class->get_property = math_converter_get_property;
-    object_class->set_property = math_converter_set_property;
+    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(converter->priv->from_combo), &from_iter);
+    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(converter->priv->to_combo), &to_iter);
 
+    gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->from_combo)), &from_iter, 2, from_unit, -1);
+    gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(converter->priv->to_combo)), &to_iter, 2, to_unit, -1);
+}
+
+
+static void
+math_converter_class_init(MathConverterClass *klass)
+{
     g_type_class_add_private(klass, sizeof(MathConverterPrivate));
 
-    g_object_class_install_property(object_class,
-                                    PROP_EQUATION,
-                                    g_param_spec_object("equation",
-                                                        "equation",
-                                                        "Equation being controlled",
-                                                        math_equation_get_type(),
-                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+    signals[CHANGED] =
+        g_signal_new("changed",
+                     G_TYPE_FROM_CLASS (klass),
+                     G_SIGNAL_RUN_LAST,
+                     G_STRUCT_OFFSET (MathConverterClass, changed),
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE, 0);
 }
 
 
@@ -347,58 +272,41 @@ from_combobox_changed_cb(GtkWidget *combo, MathConverter *converter)
 {
     GtkTreeModel *model;
     GtkTreeIter iter;
-    int category_index, unit_index;
-    const gchar *unit_name;
+    UnitCategory *category;
+    Unit *unit;
+    const GList *unit_iter;
 
     model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
-    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
-    gtk_tree_model_get(model, &iter, 1, &category_index, 2, &unit_index, -1);
-
-    model = GTK_TREE_MODEL(gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT));
-  
-    if (category_index == -1) {
-        int i;
-        for (i = 0; currency_info[i].short_name != NULL; i++) {
-            if (i == unit_index)
-                continue;
-            gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-            gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, currency_info[i].short_name, 1, -1, 2, i, -1);
-        }
-        unit_name = currency_info[unit_index].short_name;
-    }
-    else {
-        int i;
-        for (i = 0; categories[category_index].units[i].ui_name != NULL; i++) {
-            if (i == unit_index)
-                continue;
-            gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-            gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, _(categories[category_index].units[i].ui_name), 1, category_index, 2, i, -1);
-        }
-        unit_name = categories[category_index].units[unit_index].internal_name;
+    if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter))
+        return;
+    gtk_tree_model_get(model, &iter, 1, &category, 2, &unit, -1);
+
+    /* Set the to combobox to be the list of units can be converted to */
+    model = GTK_TREE_MODEL(gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_OBJECT, G_TYPE_OBJECT));
+    for (unit_iter = unit_category_get_units(category); unit_iter; unit_iter = unit_iter->next) {
+        Unit *u = unit_iter->data;
+        if (u == unit)
+            continue;
+        gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+        gtk_list_store_set(GTK_LIST_STORE(model), &iter, 0, unit_get_display_name(u), 1, category, 2, u, -1);
     }
-
     gtk_combo_box_set_model(GTK_COMBO_BOX(converter->priv->to_combo), model);
 
-    math_equation_set_source_units(converter->priv->equation, unit_name);
-
+    /* Select the first possible unit */
     gtk_combo_box_set_active(GTK_COMBO_BOX(converter->priv->to_combo), 0);
+
+    g_object_unref(category);  
+    g_object_unref(unit);
 }
 
 
 static void
 to_combobox_changed_cb(GtkWidget *combo, MathConverter *converter)
 {
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    int category_index, unit_index;
+    /* Conversion must have changed */
+    update_result_label(converter);
 
-    model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
-    gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo), &iter);
-    gtk_tree_model_get(model, &iter, 1, &category_index, 2, &unit_index, -1);
-    if (category_index == -1)
-        math_equation_set_target_units(converter->priv->equation, currency_info[unit_index].short_name);
-    else
-        math_equation_set_target_units(converter->priv->equation, categories[category_index].units[unit_index].internal_name);
+    g_signal_emit(converter, signals[CHANGED], 0);
 }
 
 
@@ -417,10 +325,7 @@ static void
 math_converter_init(MathConverter *converter)
 {
     GtkWidget *hbox, *label;
-    GtkTreeStore *from_model;
-    GtkTreeIter parent;
     GtkCellRenderer *renderer;
-    int i, j;
 
     converter->priv = G_TYPE_INSTANCE_GET_PRIVATE(converter, math_converter_get_type(), MathConverterPrivate);
 
@@ -431,28 +336,6 @@ math_converter_init(MathConverter *converter)
     gtk_box_pack_start(GTK_BOX(converter), hbox, FALSE, TRUE, 0);
 
     converter->priv->from_combo = gtk_combo_box_new ();
-    from_model = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
-    gtk_combo_box_set_model(GTK_COMBO_BOX(converter->priv->from_combo), GTK_TREE_MODEL(from_model));
-
-    for (i = 0; i < sizeof(categories) / sizeof(categories[0]); i++) {
-        gtk_tree_store_append(from_model, &parent, NULL);
-        gtk_tree_store_set(from_model, &parent, 0, _(categories[i].name), 1, i, -1);
-        for (j = 0; categories[i].units[j].ui_name != NULL; j++) {
-            GtkTreeIter iter;
-
-            gtk_tree_store_append(from_model, &iter, &parent);
-            gtk_tree_store_set(from_model, &iter, 0, _(categories[i].units[j].ui_name), 1, i, 2, j, -1);
-        }
-    }
-
-    gtk_tree_store_append(from_model, &parent, NULL);
-    gtk_tree_store_set(from_model, &parent, 0, _("Currency"), 1, i, -1);
-    for (i = 0; currency_info[i].short_name != NULL; i++) {
-        GtkTreeIter iter;
-
-        gtk_tree_store_append(from_model, &iter, &parent);
-        gtk_tree_store_set(from_model, &iter, 0, currency_info[i].short_name, 1, -1, 2, i, -1);
-    }
 
     renderer = gtk_cell_renderer_text_new();
     gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(converter->priv->from_combo), renderer, TRUE);
@@ -483,6 +366,4 @@ math_converter_init(MathConverter *converter)
     gtk_widget_set_sensitive(converter->priv->result_label, FALSE);
     gtk_widget_show(converter->priv->result_label);
     gtk_box_pack_start(GTK_BOX(converter), converter->priv->result_label, TRUE, TRUE, 0);
-
-    converter->priv->serializer = mp_serializer_new(MP_DISPLAY_FORMAT_AUTOMATIC, 10, 2);
 }
diff --git a/src/math-converter.h b/src/math-converter.h
index d3e83bf..1e17350 100644
--- a/src/math-converter.h
+++ b/src/math-converter.h
@@ -38,15 +38,21 @@ typedef struct
 typedef struct
 {
     GtkHBoxClass parent_class;
+
+    void (*changed)(MathConverter *converter);
 } MathConverterClass;
 
 GType math_converter_get_type(void);
 
 MathConverter *math_converter_new(MathEquation *equation);
 
-void math_converter_set_category(MathEquation *equation, const gchar *category);
+void math_converter_set_category(MathConverter *converter, const gchar *category);
+
+const gchar *math_converter_get_category(MathConverter *converter);
+
+void math_converter_set_conversion(MathConverter *converter, /*const gchar *category,*/ const gchar *unit_a, const gchar *unit_b);
 
-const gchar *math_converter_get_category(MathEquation *equation);
+void math_converter_get_conversion(MathConverter *converter, Unit **from_unit, Unit **to_unit);
 
 G_END_DECLS
 
diff --git a/src/math-equation.c b/src/math-equation.c
index 1df9a47..c76b774 100644
--- a/src/math-equation.c
+++ b/src/math-equation.c
@@ -1086,8 +1086,9 @@ set_variable(const char *name, const MPNumber *x, void *data)
 
 static int
 convert(const MPNumber *x, const char *x_units, const char *z_units, MPNumber *z, void *data)
-{   
-    return currency_convert(x, x_units, z_units, z);
+{
+    MathEquation *equation = data;
+    return unit_manager_convert(equation->priv->unit_manager, x, x_units, z_units, z);
 }
 
 
diff --git a/src/unit-category.c b/src/unit-category.c
new file mode 100644
index 0000000..81edd70
--- /dev/null
+++ b/src/unit-category.c
@@ -0,0 +1,115 @@
+#include <string.h>
+
+#include "unit-category.h"
+#include "currency.h" // FIXME: TEMP
+
+struct UnitCategoryPrivate
+{
+    gchar *name;
+    gchar *display_name;
+    GList *units;
+};
+
+G_DEFINE_TYPE (UnitCategory, unit_category, G_TYPE_OBJECT);
+
+
+UnitCategory *
+unit_category_new(const gchar *name, const gchar *display_name)
+{
+    UnitCategory *category = g_object_new(unit_category_get_type(), NULL);
+    category->priv->name = g_strdup(name);
+    category->priv->display_name = g_strdup(display_name);
+    return category;
+}
+
+
+const gchar *
+unit_category_get_name(UnitCategory *category)
+{
+    return category->priv->name;
+}
+
+
+const gchar *
+unit_category_get_display_name(UnitCategory *category)
+{
+    return category->priv->display_name;
+}
+
+
+void
+unit_category_add_unit(UnitCategory *category, Unit *unit)
+{
+    category->priv->units = g_list_append(category->priv->units, g_object_ref(unit));
+}
+
+
+Unit *
+unit_category_get_unit(UnitCategory *category, const gchar *name)
+{
+    GList *iter;
+
+    for (iter = category->priv->units; iter; iter = iter->next)
+    {
+        Unit *unit = iter->data;
+        if (strcmp(unit_get_name(unit), name) == 0)
+            return unit;
+    }
+  
+    return NULL;
+}
+
+
+const GList *
+unit_category_get_units(UnitCategory *category)
+{
+    return category->priv->units;
+}
+
+
+static Unit *
+get_unit(UnitCategory *category, const gchar *symbol)
+{
+    GList *iter;
+
+    for (iter = category->priv->units; iter; iter = iter->next) {
+        Unit *unit = iter->data;
+        if (unit_matches_symbol(unit, symbol))
+            return unit;
+    }
+
+    return NULL;
+}
+
+
+gboolean
+unit_category_convert(UnitCategory *category, const MPNumber *x, const char *x_units, const char *z_units, MPNumber *z)
+{
+    Unit *unit_x, *unit_z;
+
+    unit_x = get_unit(category, x_units);
+    unit_z = get_unit(category, z_units);
+    g_return_val_if_fail(unit_x != NULL, FALSE);
+    g_return_val_if_fail(unit_z != NULL, FALSE);
+    if (unit_get_value(unit_x) && unit_get_value(unit_z)) {
+        mp_multiply(x, unit_get_value(unit_x), z);
+        mp_divide(z, unit_get_value(unit_z), z);
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+
+static void
+unit_category_class_init(UnitCategoryClass *klass)
+{
+    g_type_class_add_private(klass, sizeof(UnitCategoryPrivate));
+}
+
+
+static void
+unit_category_init(UnitCategory *category)
+{
+    category->priv = G_TYPE_INSTANCE_GET_PRIVATE(category, unit_category_get_type(), UnitCategoryPrivate);
+}
diff --git a/src/unit-category.h b/src/unit-category.h
new file mode 100644
index 0000000..03349c2
--- /dev/null
+++ b/src/unit-category.h
@@ -0,0 +1,43 @@
+#ifndef UNIT_CATEGORY_H
+#define UNIT_CATEGORY_H
+
+#include <glib-object.h>
+#include "unit.h"
+#include "mp.h"
+
+G_BEGIN_DECLS
+
+#define UNIT_CATEGORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_category_get_type(), UnitCategory))
+
+typedef struct UnitCategoryPrivate UnitCategoryPrivate;
+
+typedef struct
+{
+    GObject parent_instance;
+    UnitCategoryPrivate *priv;
+} UnitCategory;
+
+typedef struct
+{
+    GObjectClass parent_class;
+} UnitCategoryClass;
+
+GType unit_category_get_type(void);
+
+UnitCategory *unit_category_new(const gchar *name, const gchar *display_name);
+
+const gchar *unit_category_get_name(UnitCategory *category);
+
+const gchar *unit_category_get_display_name(UnitCategory *category);
+
+Unit *unit_category_get_unit(UnitCategory *category, const gchar *name);
+
+void unit_category_add_unit(UnitCategory *category, Unit *unit);
+
+const GList *unit_category_get_units(UnitCategory *category);
+
+gboolean unit_category_convert(UnitCategory *category, const MPNumber *x, const char *x_units, const char *z_units, MPNumber *z);
+
+G_END_DECLS
+
+#endif /* UNIT_CATEGORY_H */
diff --git a/src/unit-manager.c b/src/unit-manager.c
index 5fb5fe4..84dc5a2 100644
--- a/src/unit-manager.c
+++ b/src/unit-manager.c
@@ -1,18 +1,8 @@
 #include <string.h>
+#include <glib/gi18n.h> // FIXME: Move out of here
 
 #include "unit-manager.h"
-
-typedef struct
-{
-    gchar *name;
-    MPNumber value;
-} Unit;
-
-typedef struct
-{
-    gchar *name;
-    GList *units;
-} UnitCategory;
+#include "currency.h" // FIXME: Move out of here
 
 struct UnitManagerPrivate
 {
@@ -26,204 +16,133 @@ static UnitManager *default_unit_manager = NULL;
 
 
 UnitManager *
-unit_manager_new()
+unit_manager_new(void)
 {
     return g_object_new(unit_manager_get_type(), NULL);
 }
 
 
-static void
-add_category(UnitManager *manager, const gchar *name, const gchar *units[][2])
+static MPNumber *
+get_value(const gchar *value, MPNumber *t)
 {
-    int i;
-
-    for (i = 0; units[i][0]; i++) {
-        MPNumber r;
-        mp_set_from_string(units[i][1], 10, &r);
-        unit_manager_add(manager, name, units[i][0], &r);
-    }
+    mp_set_from_string(value, 10, t);
+    return t;
 }
 
 
 UnitManager *
-unit_manager_get_default()
+unit_manager_get_default(void)
 {
-    const char *angle_units[][2] = {
-        /* FIXME: Approximations of 1/(units in a circle)
-         * Therefore, 360 deg != 400 grads */
-        {"grad",     "0.0025"},
-        {"gradian",  "0.0025"},
-        {"gradians", "0.0025"},
-        {"deg",      "0.002777778"},
-        {"degree",   "0.002777778"},
-        {"degrees",  "0.002777778"},
-        {"rad",      "0.159154943"},
-        {"radian",   "0.159154943"},
-        {"radians",  "0.159154943"},
-        {NULL, NULL}
-    };
-
-    const char *length_units[][2] = {
-        {"parsec",     "30857000000000000"},
-        {"parsecs",    "30857000000000000"},
-        {"pc",         "30857000000000000"},
-        {"lightyear",   "9460730472580800"},
-        {"lightyears",  "9460730472580800"},
-        {"ly",          "9460730472580800"},
-        {"au",              "149597870691"},
-        {"nm",                   "1852000"},
-        {"mile",                    "1609.344"},
-        {"miles",                   "1609.344"},
-        {"mi",                      "1609.344"},
-        {"kilometer",               "1000"},
-        {"kilometers",              "1000"},
-        {"km",                      "1000"},
-        {"kms",                     "1000"},
-        {"cable",                    "219.456"},
-        {"cables",                   "219.456"},
-        {"cb",                       "219.456"},
-        {"fathom",                     "1.8288"},
-        {"fathoms",                    "1.8288"},
-        {"ftm",                        "1.8288"},
-        {"meter",                      "1"},
-        {"meters",                     "1"},
-        {"m",                          "1"},
-        {"yard",                       "0.9144"},
-        {"yards",                      "0.9144"},
-        {"yd",                         "0.9144"},
-        {"foot",                       "0.3048"},
-        {"feet",                       "0.3048"},
-        {"ft",                         "0.3048"},
-        {"inch",                       "0.0254"},
-        {"inches",                     "0.0254"},
-        {"centimeter",                 "0.01"},
-        {"centimeters",                "0.01"},
-        {"cm",                         "0.01"},
-        {"cms",                        "0.01"},
-        {"millimeter",                 "0.001"},
-        {"millimeters",                "0.001"},
-        {"mm",                         "0.001"},
-        {"micrometer",                 "0.000001"},
-        {"micrometers",                "0.000001"},
-        {"um",                         "0.000001"},
-        {"nanometer",                  "0.000000001"},
-        {"nanometers",                 "0.000000001"},
-        {NULL, NULL}
-    };
-
-    const char *area_units[][2] = {
-        {"hectare",         "10000"},
-        {"hectares",        "10000"},
-        {"acre",             "4046.8564224"},
-        {"acres",            "4046.8564224"},
-        {"m²",                  "1"},
-        {"cm²",                 "0.001"},
-        {"mm²",                 "0.000001"},
-        {NULL, NULL}
-    };
-
-    const char *volume_units[][2] = {
-        {"m³",               "1000"},
-        {"gallon",              "3.785412"},
-        {"gallons",             "3.785412"},
-        {"gal",                 "3.785412"},
-        {"litre",               "1"},
-        {"litres",              "1"},
-        {"liter",               "1"},
-        {"liters",              "1"},
-        {"L",                   "1"},
-        {"quart",               "0.9463529"},
-        {"quarts",              "0.9463529"},
-        {"qt",                  "0.9463529"},
-        {"pint",                "0.4731765"},
-        {"pints",               "0.4731765"},
-        {"pt",                  "0.4731765"},
-        {"millilitre",          "0.001"},
-        {"millilitres",         "0.001"},
-        {"milliliter",          "0.001"},
-        {"milliliters",         "0.001"},
-        {"mL",                  "0.001"},
-        {"cm³",                 "0.001"},
-        {"mm³",                 "0.000001"},
-        {NULL, NULL}
-    };
-
-    const char *weight_units[][2] = {
-        {"tonne",            "1000"},
-        {"tonnes",           "1000"},
-        {"kilograms",           "1"},
-        {"kilogramme",          "1"},
-        {"kilogrammes",         "1"},
-        {"kg",                  "1"},
-        {"kgs",                 "1"},
-        {"pound",               "0.45359237"},
-        {"pounds",              "0.45359237"},
-        {"lb",                  "0.45359237"},
-        {"ounce",               "0.02834952"},
-        {"ounces",              "0.02834952"},
-        {"oz",                  "0.02834952"},
-        {"gram",                "0.001"},
-        {"grams",               "0.001"},
-        {"gramme",              "0.001"},
-        {"grammes",             "0.001"},
-        {"g",                   "0.001"},
-        {NULL, NULL}
-    };
-
-    const char *time_units[][2] = {
-        {"year",         "31557600"},
-        {"years",        "31557600"},
-        {"day",             "86400"},
-        {"days",            "86400"},
-        {"hour",             "3600"},
-        {"hours",            "3600"},
-        {"minute",             "60"},
-        {"minutes",            "60"},
-        {"second",              "1"},
-        {"seconds",             "1"},
-        {"s",                   "1"},
-        {"millisecond",         "0.001"},
-        {"milliseconds",        "0.001"},
-        {"ms",                  "0.001"},
-        {"microsecond",         "0.000001"},
-        {"microseconds",        "0.000001"},
-        {"us",                  "0.000001"},
-        {NULL, NULL}
-    };
+    UnitCategory *category;
+    MPNumber t;
+    int i;
 
     if (default_unit_manager)
         return default_unit_manager;
-  
+
     default_unit_manager = unit_manager_new();
-    add_category(default_unit_manager, "angles", angle_units);
-    add_category(default_unit_manager, "length", length_units);
-    add_category(default_unit_manager, "area", area_units);
-    add_category(default_unit_manager, "volume", volume_units);
-    add_category(default_unit_manager, "weight", weight_units);
-    add_category(default_unit_manager, "time", time_units);
+
+    /* FIXME: Approximations of 1/(units in a circle), therefore, 360 deg != 400 grads */
+    category = unit_manager_add_category(default_unit_manager, "angle", _("Angle"));
+    unit_category_add_unit(category, unit_new("degrees", _("Degrees"), "%s degrees", get_value("0.002777778", &t), "degrees", "degree", "deg", NULL));
+    unit_category_add_unit(category, unit_new("radians", _("Radians"), "%s radians", get_value("0.159154943", &t), "radians", "radian", "rad", NULL));
+    unit_category_add_unit(category, unit_new("gradians", _("Gradians"), "%s gradians", get_value("0.0025", &t), "gradians", "gradian", "grad", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "length", _("Length"));
+    unit_category_add_unit(category, unit_new("parsec", _("Parsecs"), "%s pc", get_value("30857000000000000", &t), "parsecs", "parsec", "pc", NULL));
+    unit_category_add_unit(category, unit_new("lightyear", _("Light Years"), "%s ly", get_value("9460730472580800", &t), "lightyears", "lightyear", "ly", NULL));
+    unit_category_add_unit(category, unit_new("au", _("Austronomical Units"), "%s au", get_value("149597870691", &t), "au", NULL));
+    unit_category_add_unit(category, unit_new("nm", _("Nautical Miles"), "%s nm", get_value("1852000", &t), "nm", NULL));
+    unit_category_add_unit(category, unit_new("mile", _("Miles"), "%s mi", get_value("1609.344", &t), "miles", "mile", "mi", NULL));
+    unit_category_add_unit(category, unit_new("kilometer", _("Kilometers"), "%s km", get_value("1000", &t), "kilometers", "kilometer", "km", "kms", NULL));
+    unit_category_add_unit(category, unit_new("cable", _("Cables"), "%s cable", get_value("219.456", &t), "cables", "cable", "cb", NULL));
+    unit_category_add_unit(category, unit_new("fathom", _("Fathoms"), "%s ftm", get_value("1.8288", &t), "fathoms", "fathom", "ftm", NULL));
+    unit_category_add_unit(category, unit_new("meter", _("Meters"), "%s m", get_value("1", &t), "meters", "meter", "m", NULL));
+    unit_category_add_unit(category, unit_new("yard", _("Yards"), "%s yd", get_value("0.9144", &t), "yards", "yard", "yd", NULL));
+    unit_category_add_unit(category, unit_new("foot", _("Feet"), "%s ft", get_value("0.3048", &t), "feet", "foot", "ft", NULL));
+    unit_category_add_unit(category, unit_new("inch", _("Inches"), "%s in", get_value("0.0254", &t), "inches", "inch", "in", NULL));
+    unit_category_add_unit(category, unit_new("centimeter", _("Centimeters"), "%s cm", get_value("0.01", &t), "centimeters", "centimeter", "cm", "cms", NULL));
+    unit_category_add_unit(category, unit_new("millimeter", _("Millimeters"), "%s mm", get_value("0.001", &t), "millimeters", "millimeter", "mm", NULL));
+    unit_category_add_unit(category, unit_new("micrometer", _("Micrometers"), "%s μm", get_value("0.000001", &t), "micrometers", "micrometer", "um", NULL));
+    unit_category_add_unit(category, unit_new("nanometer", _("Nanometers"), "%s nm", get_value("0.000000001", &t), "nanometers", "nanometer", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "area", _("Area"));
+    unit_category_add_unit(category, unit_new("hectare", _("Hectares"), "%s ha", get_value("10000", &t), "hectares", "hectare", "ha", NULL));
+    unit_category_add_unit(category, unit_new("acre", _("Acres"), "%s acres", get_value("4046.8564224", &t), "acres", "acre", NULL));
+    unit_category_add_unit(category, unit_new("m²", _("Square Meter"), "%s m²", get_value("1", &t), "m²", NULL));
+    unit_category_add_unit(category, unit_new("cm²", _("Square Centimeter"), "%s cm²", get_value("0.001", &t), "cm²", NULL));
+    unit_category_add_unit(category, unit_new("mm²", _("Square Millimeter"), "%s mm²", get_value("0.000001", &t), "mm²", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "volume", _("Volume"));
+    unit_category_add_unit(category, unit_new("m³", _("Cubic Meters"), "%s m³", get_value("1000", &t), "m³", NULL));
+    unit_category_add_unit(category, unit_new("gallon", _("Gallons"), "%s gallons", get_value("3.785412", &t), "gallons", "gallon", "gal", NULL));
+    unit_category_add_unit(category, unit_new("litre", _("Litres"), "%s L", get_value("1", &t), "litres", "litre", "liter", "liters", "L", NULL));
+    unit_category_add_unit(category, unit_new("quart", _("Quarts"), "%s quarts", get_value("0.9463529", &t), "quarts", "quart", "qt", NULL));
+    unit_category_add_unit(category, unit_new("pint", _("Pints"), "%s pt", get_value("0.4731765", &t), "pints", "pint", "pt", NULL));
+    unit_category_add_unit(category, unit_new("millilitre", _("Millilitres"), "%s mL", get_value("0.001", &t), "millilitres", "millilitre", "milliliter", "milliliters", "mL", "cm³", NULL));
+    unit_category_add_unit(category, unit_new("mm³", _("Microlitre"), "%s μL", get_value("0.000001", &t), "", "mm³", "μL", "uL", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "weight", _("Weight"));
+    unit_category_add_unit(category, unit_new("tonne", _("Tonnes"), "%s T", get_value("1000", &t), "tonnes", "tonne", NULL));
+    unit_category_add_unit(category, unit_new("kilograms", _("Kilograms"), "%s kg", get_value("1s", &t), "kilogram", "kilogramme", "kilogrammes", "kg", "kgs", NULL));
+    unit_category_add_unit(category, unit_new("pound", _("Pounds"), "%s lb", get_value("0.45359237", &t), "pounds", "pound", "lb", NULL));
+    unit_category_add_unit(category, unit_new("ounce", _("Ounces"), "%s oz", get_value("0.02834952", &t), "ounces", "ounce", "oz", NULL));
+    unit_category_add_unit(category, unit_new("gram", _("Grams"), "%s g", get_value("0.001", &t), "grams", "gram", "gramme", "grammes", "g", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "duration", _("Duration"));
+    unit_category_add_unit(category, unit_new("year", _("Years"), "%s years", get_value("31557600", &t), "years", "year", NULL));
+    unit_category_add_unit(category, unit_new("day", _("Days"), "%s days", get_value("86400", &t), "days", "day", NULL));
+    unit_category_add_unit(category, unit_new("hour", _("Hours"), "%s hours", get_value("3600", &t), "hours", "hour", NULL));
+    unit_category_add_unit(category, unit_new("minute", _("Minutes"), "%s minutes", get_value("60", &t), "minutes", "minute", NULL));
+    unit_category_add_unit(category, unit_new("second", _("Seconds"), "%s s", get_value("1", &t), "seconds", "second", "s", NULL));
+    unit_category_add_unit(category, unit_new("millisecond", _("Milliseconds"), "%s milliseconds", get_value("0.001", &t), "milliseconds", "millisecond", "ms", NULL));
+    unit_category_add_unit(category, unit_new("microsecond", _("Microseconds"), "%s microseconds", get_value("0.000001", &t), "microseconds", "microsecond", "us", NULL));
+
+    category = unit_manager_add_category(default_unit_manager, "currency", _("Currency"));
+    for (i = 0; currency_info[i].short_name != NULL; i++)
+    {
+        gchar *format;
+        Unit *unit;
+
+        format = g_strdup_printf("%s%%s", currency_info[i].symbol);
+        unit = unit_new(currency_info[i].short_name, currency_info[i].short_name, format, NULL, currency_info[i].short_name, NULL);
+        g_free(format);
+
+        unit_category_add_unit(category, unit);
+    }  
 
     return default_unit_manager;
 }
 
 
-static UnitCategory *
-category_new(const gchar *name)
+UnitCategory *
+unit_manager_add_category(UnitManager *manager, const gchar *name, const gchar *display_name)
 {
-    UnitCategory *category;  
-    category = g_malloc0(sizeof(UnitCategory));
-    category->name = g_strdup(name);
+    UnitCategory *category;
+
+    g_return_val_if_fail(unit_manager_get_category(manager, name) == NULL, NULL);
+    category = unit_category_new(name, display_name);
+    manager->priv->categories = g_list_append(manager->priv->categories, category);
+
     return category;
 }
 
 
-static UnitCategory *
-get_category(UnitManager *manager, const gchar *category)
+const GList *
+unit_manager_get_categories(UnitManager *manager)
+{
+    return manager->priv->categories;
+}
+
+
+UnitCategory *
+unit_manager_get_category(UnitManager *manager, const gchar *category)
 {
     GList *iter;
 
     for (iter = manager->priv->categories; iter; iter = iter->next) {
         UnitCategory *c = iter->data;
-        if (strcmp(c->name, category) == 0)
+        if (strcmp(unit_category_get_name(c), category) == 0)
             return c;
     }
 
@@ -231,37 +150,20 @@ get_category(UnitManager *manager, const gchar *category)
 }
 
 
-void
-unit_manager_add(UnitManager *manager, const gchar *category, const gchar *name, MPNumber *value)
-{
-    UnitCategory *c;
-    Unit *unit;
-
-    c = get_category(manager, category);
-    if (!c) {
-        c = category_new(category);
-        manager->priv->categories = g_list_append(manager->priv->categories, c);
-    }
-
-    unit = g_malloc0(sizeof(Unit));
-    unit->name = g_strdup(name);
-    mp_set_from_mp(value, &unit->value);
-    c->units = g_list_append(c->units, unit);
-}
-
-
-static Unit *
-get_unit(UnitCategory *category, const gchar *name)
+Unit *
+unit_manager_get_unit(UnitManager *manager, const gchar *unit)
 {
     GList *iter;
+    Unit *u;
 
-    for (iter = category->units; iter; iter = iter->next) {
-        Unit *unit = iter->data;
-        if (strcmp(unit->name, name) == 0)
-            return unit;
+    for (iter = manager->priv->categories; iter; iter = iter->next) {
+        UnitCategory *c = iter->data;
+        u = unit_category_get_unit (c, unit);
+        if (u)
+            return u;
     }
 
-    return NULL;
+    return NULL; 
 }
 
 
@@ -272,12 +174,8 @@ unit_manager_convert(UnitManager *manager, const MPNumber *x, const char *x_unit
 
     for (iter = manager->priv->categories; iter; iter = iter->next) {
         UnitCategory *c = iter->data;
-        Unit *unit_x, *unit_z;
-        if ((unit_x = get_unit(c, x_units)) && (unit_z = get_unit(c, z_units))) {
-            mp_multiply(x, &unit_x->value, z);
-            mp_divide(z, &unit_z->value, z);
+        if (unit_category_convert(c, x, x_units, z_units, z))
             return TRUE;
-        }
     }
   
     return FALSE;
diff --git a/src/unit-manager.h b/src/unit-manager.h
index d68bfda..02b983d 100644
--- a/src/unit-manager.h
+++ b/src/unit-manager.h
@@ -2,6 +2,7 @@
 #define UNIT_MANAGER_H
 
 #include <glib-object.h>
+#include "unit-category.h"
 #include "mp.h"
 
 G_BEGIN_DECLS
@@ -23,11 +24,17 @@ typedef struct
 
 GType unit_manager_get_type(void);
 
-UnitManager *unit_manager_new();
+UnitManager *unit_manager_new(void);
 
-UnitManager *unit_manager_get_default();
+UnitManager *unit_manager_get_default(void);
 
-void unit_manager_add(UnitManager *manager, const gchar *category, const gchar *name, MPNumber *value);
+UnitCategory *unit_manager_add_category(UnitManager *manager, const gchar *name, const gchar *display_name);
+
+const GList *unit_manager_get_categories(UnitManager *manager);
+
+UnitCategory *unit_manager_get_category(UnitManager *manager, const gchar *category);
+
+Unit *unit_manager_get_unit(UnitManager *manager, const gchar *unit);
 
 gboolean unit_manager_convert(UnitManager *manager, const MPNumber *x, const char *x_units, const char *z_units, MPNumber *z);
 
diff --git a/src/unit.c b/src/unit.c
new file mode 100644
index 0000000..3a53d74
--- /dev/null
+++ b/src/unit.c
@@ -0,0 +1,124 @@
+#include <string.h>
+#include <stdarg.h>
+
+#include "unit.h"
+#include "mp-serializer.h"
+#include "currency.h" // FIXME: Move out of here
+
+struct UnitPrivate
+{
+    gchar *name;
+    gchar *display_name;
+    gchar *format;
+    GList *symbols;
+    MPNumber value;
+    gboolean has_value;
+    MpSerializer *serializer;
+};
+
+G_DEFINE_TYPE (Unit, unit, G_TYPE_OBJECT);
+
+
+Unit *
+unit_new(const gchar *name, const gchar *display_name, const gchar *format, MPNumber *value, const gchar *symbol, ...)
+{
+    Unit *unit = g_object_new(unit_get_type(), NULL);
+    va_list ap;
+
+    unit->priv->name = g_strdup(name);
+    unit->priv->display_name = g_strdup(display_name);
+    unit->priv->format = g_strdup(format);
+    if (value)
+    {
+        unit->priv->has_value = TRUE;
+        mp_set_from_mp(value, &unit->priv->value);
+    }
+    else
+        unit->priv->has_value = FALSE;
+
+    unit->priv->symbols = g_list_append(unit->priv->symbols, g_strdup(symbol));
+    va_start(ap, symbol);
+    while(TRUE) {
+        const gchar *s = va_arg(ap, char *);
+        if (s == NULL)
+            break;
+        unit->priv->symbols = g_list_append(unit->priv->symbols, g_strdup(s));        
+    }
+    va_end(ap);
+
+    return unit;
+}
+
+
+const gchar *
+unit_get_name(Unit *unit)
+{
+    return unit->priv->name;
+}
+
+
+const gchar *
+unit_get_display_name(Unit *unit)
+{
+    return unit->priv->display_name;
+}
+
+
+gboolean
+unit_matches_symbol(Unit *unit, const gchar *symbol)
+{
+    GList *iter;
+
+    for (iter = unit->priv->symbols; iter; iter = iter->next) {
+        gchar *s = iter->data;
+        if (strcmp(s, symbol) == 0)
+            return TRUE;
+    }
+
+    return FALSE;
+}
+
+
+const GList *
+unit_get_symbols(Unit *unit)
+{
+    return unit->priv->symbols;
+}
+
+
+const MPNumber *
+unit_get_value(Unit *unit)
+{
+    if (unit->priv->has_value)
+        return &unit->priv->value;
+    else
+        return currency_get_value(unit->priv->name); // FIXME: Hack to make currency work
+}
+
+
+gchar *
+unit_format(Unit *unit, MPNumber *x)
+{
+    gchar *number_text, *text;
+
+    number_text = mp_serializer_to_string(unit->priv->serializer, x);
+    text = g_strdup_printf(unit->priv->format, number_text);
+    g_free(number_text);
+  
+    return text;
+}
+
+
+static void
+unit_class_init(UnitClass *klass)
+{
+    g_type_class_add_private(klass, sizeof(UnitPrivate));
+}
+
+
+static void
+unit_init(Unit *unit)
+{
+    unit->priv = G_TYPE_INSTANCE_GET_PRIVATE(unit, unit_get_type(), UnitPrivate);
+    unit->priv->serializer = mp_serializer_new(MP_DISPLAY_FORMAT_AUTOMATIC, 10, 2);
+}
diff --git a/src/unit.h b/src/unit.h
new file mode 100644
index 0000000..b01bde0
--- /dev/null
+++ b/src/unit.h
@@ -0,0 +1,42 @@
+#ifndef UNIT_H
+#define UNIT_H
+
+#include <glib-object.h>
+#include "mp.h"
+
+G_BEGIN_DECLS
+
+#define UNIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), unit_get_type(), Unit))
+
+typedef struct UnitPrivate UnitPrivate;
+
+typedef struct
+{
+    GObject parent_instance;
+    UnitPrivate *priv;
+} Unit;
+
+typedef struct
+{
+    GObjectClass parent_class;
+} UnitClass;
+
+GType unit_get_type(void);
+
+Unit *unit_new(const gchar *name, const gchar *display_name, const gchar *format, MPNumber *value, const gchar *symbol, ...);
+
+const gchar *unit_get_name(Unit *unit);
+
+const gchar *unit_get_display_name(Unit *unit);
+
+gboolean unit_matches_symbol(Unit *unit, const gchar *symbol);
+
+const GList *unit_get_symbols(Unit *unit);
+
+const MPNumber *unit_get_value(Unit *unit);
+
+gchar *unit_format(Unit *unit, MPNumber *x);
+
+G_END_DECLS
+
+#endif /* UNIT_H */



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