Re: [Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-19 Thread Gonzalo Odiard
Pushed and the ticket closed.
Thanks again, and if is your first patch... welcome!

Gonzalo

On Sat, Mar 17, 2012 at 5:16 PM, Kalpa Welivitigoda callka...@gmail.comwrote:

 On Sun, Mar 18, 2012 at 1:06 AM, Gonzalo Odiard gonz...@laptop.org
 wrote:
  Thanks Kalpa,
  What do you think about replacing:
 
  -catbox = gtk.Label(c)
  +# If there is no category, display as Unknown
  +if c is '':
  +catbox = gtk.Label(_('Unknown'))
  +else:
  +catbox = gtk.Label(c)
 
  by:
 
  +# If there is no category, display as Unknown
  +description = c
  +if c is '':
  +description = _('Unknown')
   catbox = gtk.Label(description)
 
  Looks simpler, right?
 

 and much better.

 I've attached the new patch.


  Gonzalo
 
  On Sat, Mar 17, 2012 at 4:21 PM, callka...@gmail.com wrote:
 
  From: Kalpa Pathum Welivitigoda callka...@gmail.com
 
  ---
   budgetscreen.py |6 +-
   chartscreen.py  |7 +--
   2 files changed, 10 insertions(+), 3 deletions(-)
 
  diff --git a/budgetscreen.py b/budgetscreen.py
  index 0e2cd98..bcbceb5 100644
  --- a/budgetscreen.py
  +++ b/budgetscreen.py
  @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):
 
  # Build categories.
  for c in self.sorted_categories:
  -catbox = gtk.Label(c)
  +# If there is no category, display as Unknown
  +if c is '':
  +catbox = gtk.Label(_('Unknown'))
  +else:
  +catbox = gtk.Label(c)
  catbox.set_padding(10, 0)
 
  color = finance.get_category_color_str(c)
  diff --git a/chartscreen.py b/chartscreen.py
  index 129be9b..b6d1977 100644
  --- a/chartscreen.py
  +++ b/chartscreen.py
  @@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
  for c in self.sorted_categories:
  hbox = gtk.HBox()
 
  -catlabel = gtk.Label()
  -catlabel.set_markup(c)
  +# If there is no category, display as Unknown
  +if c is '':
  +catlabel = gtk.Label(_('Unknown'))
  +else:
  +catlabel = gtk.Label(c)
  catgroup.add_widget(catlabel)
 
  color = finance.get_category_color_str(c)
  --
  1.7.7.6
 
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 



 --
 Best Regards,

 Kalpa Pathum Welivitigoda
 http://about.me/callkalpa

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-19 Thread Kalpa Welivitigoda
On Mon, Mar 19, 2012 at 4:28 PM, Gonzalo Odiard gonz...@laptop.org wrote:
 Pushed and the ticket closed.
 Thanks again, and if is your first patch... welcome!


that's wow. yes it is my first to sugar.
Thanks

 Gonzalo


 On Sat, Mar 17, 2012 at 5:16 PM, Kalpa Welivitigoda callka...@gmail.com
 wrote:

 On Sun, Mar 18, 2012 at 1:06 AM, Gonzalo Odiard gonz...@laptop.org
 wrote:
  Thanks Kalpa,
  What do you think about replacing:
 
  -            catbox = gtk.Label(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catbox = gtk.Label(_('Unknown'))
  +            else:
  +                catbox = gtk.Label(c)
 
  by:
 
  +            # If there is no category, display as Unknown
  +            description = c
  +            if c is '':
  +                description = _('Unknown')
               catbox = gtk.Label(description)
 
  Looks simpler, right?
 

 and much better.

 I've attached the new patch.


  Gonzalo
 
  On Sat, Mar 17, 2012 at 4:21 PM, callka...@gmail.com wrote:
 
  From: Kalpa Pathum Welivitigoda callka...@gmail.com
 
  ---
   budgetscreen.py |    6 +-
   chartscreen.py  |    7 +--
   2 files changed, 10 insertions(+), 3 deletions(-)
 
  diff --git a/budgetscreen.py b/budgetscreen.py
  index 0e2cd98..bcbceb5 100644
  --- a/budgetscreen.py
  +++ b/budgetscreen.py
  @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):
 
          # Build categories.
          for c in self.sorted_categories:
  -            catbox = gtk.Label(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catbox = gtk.Label(_('Unknown'))
  +            else:
  +                catbox = gtk.Label(c)
              catbox.set_padding(10, 0)
 
              color = finance.get_category_color_str(c)
  diff --git a/chartscreen.py b/chartscreen.py
  index 129be9b..b6d1977 100644
  --- a/chartscreen.py
  +++ b/chartscreen.py
  @@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
          for c in self.sorted_categories:
              hbox = gtk.HBox()
 
  -            catlabel = gtk.Label()
  -            catlabel.set_markup(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catlabel = gtk.Label(_('Unknown'))
  +            else:
  +                catlabel = gtk.Label(c)
              catgroup.add_widget(catlabel)
 
              color = finance.get_category_color_str(c)
  --
  1.7.7.6
 
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 



 --
 Best Regards,

 Kalpa Pathum Welivitigoda
 http://about.me/callkalpa





-- 
Best Regards,

Kalpa Pathum Welivitigoda
http://about.me/callkalpa
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-19 Thread Chris Leonard
After the crob job runs the POT updater script tonight and and updates
Pootle's POT,  I will update the language projects and land this in
Pootle for L10n and commit.

cjl

On Mon, Mar 19, 2012 at 6:58 AM, Gonzalo Odiard gonz...@laptop.org wrote:
 Pushed and the ticket closed.
 Thanks again, and if is your first patch... welcome!

 Gonzalo

 On Sat, Mar 17, 2012 at 5:16 PM, Kalpa Welivitigoda callka...@gmail.com
 wrote:

 On Sun, Mar 18, 2012 at 1:06 AM, Gonzalo Odiard gonz...@laptop.org
 wrote:
  Thanks Kalpa,
  What do you think about replacing:
 
  -            catbox = gtk.Label(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catbox = gtk.Label(_('Unknown'))
  +            else:
  +                catbox = gtk.Label(c)
 
  by:
 
  +            # If there is no category, display as Unknown
  +            description = c
  +            if c is '':
  +                description = _('Unknown')
               catbox = gtk.Label(description)
 
  Looks simpler, right?
 

 and much better.

 I've attached the new patch.


  Gonzalo
 
  On Sat, Mar 17, 2012 at 4:21 PM, callka...@gmail.com wrote:
 
  From: Kalpa Pathum Welivitigoda callka...@gmail.com
 
  ---
   budgetscreen.py |    6 +-
   chartscreen.py  |    7 +--
   2 files changed, 10 insertions(+), 3 deletions(-)
 
  diff --git a/budgetscreen.py b/budgetscreen.py
  index 0e2cd98..bcbceb5 100644
  --- a/budgetscreen.py
  +++ b/budgetscreen.py
  @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):
 
          # Build categories.
          for c in self.sorted_categories:
  -            catbox = gtk.Label(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catbox = gtk.Label(_('Unknown'))
  +            else:
  +                catbox = gtk.Label(c)
              catbox.set_padding(10, 0)
 
              color = finance.get_category_color_str(c)
  diff --git a/chartscreen.py b/chartscreen.py
  index 129be9b..b6d1977 100644
  --- a/chartscreen.py
  +++ b/chartscreen.py
  @@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
          for c in self.sorted_categories:
              hbox = gtk.HBox()
 
  -            catlabel = gtk.Label()
  -            catlabel.set_markup(c)
  +            # If there is no category, display as Unknown
  +            if c is '':
  +                catlabel = gtk.Label(_('Unknown'))
  +            else:
  +                catlabel = gtk.Label(c)
              catgroup.add_widget(catlabel)
 
              color = finance.get_category_color_str(c)
  --
  1.7.7.6
 
  ___
  Sugar-devel mailing list
  Sugar-devel@lists.sugarlabs.org
  http://lists.sugarlabs.org/listinfo/sugar-devel
 
 



 --
 Best Regards,

 Kalpa Pathum Welivitigoda
 http://about.me/callkalpa



 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-17 Thread callkalpa
From: Kalpa Pathum Welivitigoda callka...@gmail.com

---
 budgetscreen.py |6 +-
 chartscreen.py  |7 +--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/budgetscreen.py b/budgetscreen.py
index 0e2cd98..bcbceb5 100644
--- a/budgetscreen.py
+++ b/budgetscreen.py
@@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):
 
 # Build categories.
 for c in self.sorted_categories:
-catbox = gtk.Label(c)
+# If there is no category, display as Unknown
+if c is '':
+catbox = gtk.Label(_('Unknown'))
+else:
+catbox = gtk.Label(c)
 catbox.set_padding(10, 0)
 
 color = finance.get_category_color_str(c)
diff --git a/chartscreen.py b/chartscreen.py
index 129be9b..b6d1977 100644
--- a/chartscreen.py
+++ b/chartscreen.py
@@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
 for c in self.sorted_categories:
 hbox = gtk.HBox()
 
-catlabel = gtk.Label()
-catlabel.set_markup(c)
+# If there is no category, display as Unknown
+if c is '':
+catlabel = gtk.Label(_('Unknown'))
+else:
+catlabel = gtk.Label(c)
 catgroup.add_widget(catlabel)
 
 color = finance.get_category_color_str(c)
-- 
1.7.7.6

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-17 Thread Gonzalo Odiard
Thanks Kalpa,
What do you think about replacing:

-catbox = gtk.Label(c)
+# If there is no category, display as Unknown
+if c is '':
+catbox = gtk.Label(_('Unknown'))
+else:
+catbox = gtk.Label(c)

by:

+# If there is no category, display as Unknown
+description = c
+if c is '':
+description = _('Unknown')
 catbox = gtk.Label(description)

Looks simpler, right?

Gonzalo

On Sat, Mar 17, 2012 at 4:21 PM, callka...@gmail.com wrote:

 From: Kalpa Pathum Welivitigoda callka...@gmail.com

 ---
  budgetscreen.py |6 +-
  chartscreen.py  |7 +--
  2 files changed, 10 insertions(+), 3 deletions(-)

 diff --git a/budgetscreen.py b/budgetscreen.py
 index 0e2cd98..bcbceb5 100644
 --- a/budgetscreen.py
 +++ b/budgetscreen.py
 @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):

 # Build categories.
 for c in self.sorted_categories:
 -catbox = gtk.Label(c)
 +# If there is no category, display as Unknown
 +if c is '':
 +catbox = gtk.Label(_('Unknown'))
 +else:
 +catbox = gtk.Label(c)
 catbox.set_padding(10, 0)

 color = finance.get_category_color_str(c)
 diff --git a/chartscreen.py b/chartscreen.py
 index 129be9b..b6d1977 100644
 --- a/chartscreen.py
 +++ b/chartscreen.py
 @@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
 for c in self.sorted_categories:
 hbox = gtk.HBox()

 -catlabel = gtk.Label()
 -catlabel.set_markup(c)
 +# If there is no category, display as Unknown
 +if c is '':
 +catlabel = gtk.Label(_('Unknown'))
 +else:
 +catlabel = gtk.Label(c)
 catgroup.add_widget(catlabel)

 color = finance.get_category_color_str(c)
 --
 1.7.7.6

 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH Finance] expenses with no category specified are displayed as Unknown fix to SL#3097

2012-03-17 Thread Kalpa Welivitigoda
On Sun, Mar 18, 2012 at 1:06 AM, Gonzalo Odiard gonz...@laptop.org wrote:
 Thanks Kalpa,
 What do you think about replacing:

 -            catbox = gtk.Label(c)
 +            # If there is no category, display as Unknown
 +            if c is '':
 +                catbox = gtk.Label(_('Unknown'))
 +            else:
 +                catbox = gtk.Label(c)

 by:

 +            # If there is no category, display as Unknown
 +            description = c
 +            if c is '':
 +                description = _('Unknown')
              catbox = gtk.Label(description)

 Looks simpler, right?


and much better.

I've attached the new patch.


 Gonzalo

 On Sat, Mar 17, 2012 at 4:21 PM, callka...@gmail.com wrote:

 From: Kalpa Pathum Welivitigoda callka...@gmail.com

 ---
  budgetscreen.py |    6 +-
  chartscreen.py  |    7 +--
  2 files changed, 10 insertions(+), 3 deletions(-)

 diff --git a/budgetscreen.py b/budgetscreen.py
 index 0e2cd98..bcbceb5 100644
 --- a/budgetscreen.py
 +++ b/budgetscreen.py
 @@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):

         # Build categories.
         for c in self.sorted_categories:
 -            catbox = gtk.Label(c)
 +            # If there is no category, display as Unknown
 +            if c is '':
 +                catbox = gtk.Label(_('Unknown'))
 +            else:
 +                catbox = gtk.Label(c)
             catbox.set_padding(10, 0)

             color = finance.get_category_color_str(c)
 diff --git a/chartscreen.py b/chartscreen.py
 index 129be9b..b6d1977 100644
 --- a/chartscreen.py
 +++ b/chartscreen.py
 @@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
         for c in self.sorted_categories:
             hbox = gtk.HBox()

 -            catlabel = gtk.Label()
 -            catlabel.set_markup(c)
 +            # If there is no category, display as Unknown
 +            if c is '':
 +                catlabel = gtk.Label(_('Unknown'))
 +            else:
 +                catlabel = gtk.Label(c)
             catgroup.add_widget(catlabel)

             color = finance.get_category_color_str(c)
 --
 1.7.7.6

 ___
 Sugar-devel mailing list
 Sugar-devel@lists.sugarlabs.org
 http://lists.sugarlabs.org/listinfo/sugar-devel





-- 
Best Regards,

Kalpa Pathum Welivitigoda
http://about.me/callkalpa
From 3bc44285185d68c3fb21e166a57c9bed2794b98e Mon Sep 17 00:00:00 2001
From: Kalpa Welivitigoda callka...@gmail.com
Date: Sun, 18 Mar 2012 01:41:27 +0530
Subject: [PATCH Finance 2/2] expenses with no category specified are
 displayed as Unknown fix to SL#3097

---
 budgetscreen.py |6 +-
 chartscreen.py  |7 +--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/budgetscreen.py b/budgetscreen.py
index 0e2cd98..41a1dbd 100644
--- a/budgetscreen.py
+++ b/budgetscreen.py
@@ -96,7 +96,11 @@ class BudgetScreen(gtk.VBox):
 
 # Build categories.
 for c in self.sorted_categories:
-catbox = gtk.Label(c)
+description = c
+# If there is no category, display as Unknown
+if c is '':
+description = _('Unknown')
+catbox = gtk.Label(description)
 catbox.set_padding(10, 0)
 
 color = finance.get_category_color_str(c)
diff --git a/chartscreen.py b/chartscreen.py
index 129be9b..b984b33 100644
--- a/chartscreen.py
+++ b/chartscreen.py
@@ -89,8 +89,11 @@ class ChartScreen(gtk.HBox):
 for c in self.sorted_categories:
 hbox = gtk.HBox()
 
-catlabel = gtk.Label()
-catlabel.set_markup(c)
+description = c
+# If there is no category, display as Unknown
+if c is '':
+description = _('Unknown')
+catlabel = gtk.Label(description)
 catgroup.add_widget(catlabel)
 
 color = finance.get_category_color_str(c)
-- 
1.7.7.6

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel